pulls.review 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/ActionButton-BYTohOMA.js +1 -0
- package/dist/client/assets/ActionIconButton-B2taMg1G.js +1 -0
- package/dist/client/assets/ChatMessage-BRtxpV-j.js +80 -0
- package/dist/client/assets/ChatWidget-DGoJBAHG.js +1 -0
- package/dist/client/assets/DisplayFileIcon-CgcKzuIF.js +151 -0
- package/dist/client/assets/LandingHero-BcDLrBWu.js +1 -0
- package/dist/client/assets/LocalAgentSettings-DnWX-4ja.js +1 -0
- package/dist/client/assets/MarkdownMermaid-CZsnBTo5.js +134 -0
- package/dist/client/assets/ModelPicker-DJOF4_oE.js +3 -0
- package/dist/client/assets/SelectViewport-CLu2vHZ1.js +1 -0
- package/dist/client/assets/_repo_-B9Xsfdgp.js +22 -0
- package/dist/client/assets/analyze-Dt4HsiiL.js +1 -0
- package/dist/client/assets/{core-messages-E0LWb5xA.js → core-messages-BKVsL0s6.js} +1 -1
- package/dist/client/assets/dark-BBICmi9u.js +1 -0
- package/dist/client/assets/de-X0_7KOpR.js +1 -0
- package/dist/client/assets/decode-BMLx_QAi.js +1 -0
- package/dist/client/assets/{diagnostics-DundJi2s.js → diagnostics-FPncUZ9A.js} +1 -1
- package/dist/client/assets/diff-BVBdGkpM.js +37 -0
- package/dist/client/assets/diff-CNjyt43T.js +1 -0
- package/dist/client/assets/diffs-store-M5WP-Rye.js +1432 -0
- package/dist/client/assets/dist-B3ulq7dg.js +3 -0
- package/dist/client/assets/en-4wf48bhl.js +1 -0
- package/dist/client/assets/es-z_aJuLEM.js +1 -0
- package/dist/client/assets/fr-BSSnc845.js +1 -0
- package/dist/client/assets/i18n-BaWfCCFj.js +2 -0
- package/dist/client/assets/id-DpmfJDwA.js +1 -0
- package/dist/client/assets/index-B346Vuj9.css +1 -0
- package/dist/client/assets/index-DAczNoU5.js +2 -0
- package/dist/client/assets/install-BtceKESn.js +4 -0
- package/dist/client/assets/it-DnvTXQOp.js +1 -0
- package/dist/client/assets/ja-EKD3f8pB.js +1 -0
- package/dist/client/assets/ko-3WANYsbE.js +1 -0
- package/dist/client/assets/llm-DwxQbGwE.js +88 -0
- package/dist/client/assets/llm-store-CBiRLoQj.js +1 -0
- package/dist/client/assets/local-agents-Bhc2OYII.js +1 -0
- package/dist/client/assets/pages-IPE7GMm2.js +1 -0
- package/dist/client/assets/pages-local-B-qUAdMG.js +1 -0
- package/dist/client/assets/pages-web-CV7QqqdA.js +21 -0
- package/dist/client/assets/portalTarget-DKryvPGY.js +1 -0
- package/dist/client/assets/pt-BR-BC7-mMJ3.js +1 -0
- package/dist/client/assets/rpc-backends-Bm_fmyjf.js +1 -0
- package/dist/client/assets/ru-ChI2XEFF.js +1 -0
- package/dist/client/assets/runtime-dom.esm-bundler-D9VhaAqy.js +2 -0
- package/dist/client/assets/{source-CvnvCX42.js → source-BWADV8Aq.js} +1 -1
- package/dist/client/assets/time-ago-CMSCAiQn.js +1 -0
- package/dist/client/assets/upload-riZ3DIfL.js +1 -0
- package/dist/client/assets/useCommitView-CgsbPEnq.js +1 -0
- package/dist/client/assets/useDocumentTitle-D1Q-0ufQ.js +92 -0
- package/dist/client/assets/useNonce-AntPf6d2.js +1 -0
- package/dist/client/assets/useTypeahead-DtM58Ahg.js +1 -0
- package/dist/client/assets/utils-DaMPgnza.js +1 -0
- package/dist/client/assets/vue-i18n-X72ILEtz.js +3 -0
- package/dist/client/assets/zh-CN-DXr4JfHY.js +1 -0
- package/dist/client/assets/zh-TW-CmCU_HxU.js +1 -0
- package/dist/client/index.html +9 -8
- package/dist/{devframe-Z3sgjlMJ.mjs → devframe-C2cyQ64F.mjs} +1 -1
- package/dist/devframe.mjs +1 -1
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
- package/dist/client/assets/ActionButton-wEgApzce.js +0 -1
- package/dist/client/assets/ActionIconButton-wh9iuTi4.js +0 -1
- package/dist/client/assets/ChatMessage-wZOblr2O.js +0 -80
- package/dist/client/assets/ChatWidget-Dbic6F6V.js +0 -1
- package/dist/client/assets/DisplayFileIcon-DffhOXN6.js +0 -151
- package/dist/client/assets/GithubAvatar-eLlc5vap.js +0 -1
- package/dist/client/assets/LandingHero-Bb_CGwOP.js +0 -1
- package/dist/client/assets/LocalAgentSettings-CWvSCuNr.js +0 -1
- package/dist/client/assets/ModelPicker-CLoBWotf.js +0 -3
- package/dist/client/assets/SelectViewport-Dt28PIGK.js +0 -1
- package/dist/client/assets/_repo_-BIF9MuRW.js +0 -22
- package/dist/client/assets/analyze-B3YV6_zK.js +0 -1
- package/dist/client/assets/de-BfUc2exP.js +0 -1
- package/dist/client/assets/diff-BwixkBTz.js +0 -1
- package/dist/client/assets/diff-Coo81SbJ.js +0 -37
- package/dist/client/assets/diffs-store-BPvgHGVY.js +0 -1431
- package/dist/client/assets/en-OkC_9BLh.js +0 -1
- package/dist/client/assets/es-DuVRv3jP.js +0 -1
- package/dist/client/assets/fr-BI5_M_ty.js +0 -1
- package/dist/client/assets/i18n-DtZTpAlH.js +0 -2
- package/dist/client/assets/id-BU9INgNZ.js +0 -1
- package/dist/client/assets/index-Buksdj5x.js +0 -2
- package/dist/client/assets/index-m8kW8Q0V.css +0 -1
- package/dist/client/assets/install-BrSGg9K8.js +0 -4
- package/dist/client/assets/it-C2TUiK_A.js +0 -1
- package/dist/client/assets/ja-BQDWzjgo.js +0 -1
- package/dist/client/assets/ko-Ca7kDPia.js +0 -1
- package/dist/client/assets/llm-5e9k-gOP.js +0 -88
- package/dist/client/assets/llm-store-1j45N-6d.js +0 -1
- package/dist/client/assets/local-agents-0SHBuj0A.js +0 -1
- package/dist/client/assets/pages-hDJHVoGR.js +0 -1
- package/dist/client/assets/pages-local-0BoMyVi4.js +0 -1
- package/dist/client/assets/pages-web-QiNoFNlt.js +0 -21
- package/dist/client/assets/portalTarget-I9JDQCD2.js +0 -1
- package/dist/client/assets/pt-BR-DcjGEP2y.js +0 -1
- package/dist/client/assets/rpc-backends-arDnFRtp.js +0 -1
- package/dist/client/assets/ru-DhCHBcLb.js +0 -1
- package/dist/client/assets/runtime-dom.esm-bundler-DL194Z-s.js +0 -2
- package/dist/client/assets/time-ago-Bdao9Hh1.js +0 -1
- package/dist/client/assets/upload-Bi-0MPhd.js +0 -1
- package/dist/client/assets/useDocumentTitle-DSsMzDvH.js +0 -92
- package/dist/client/assets/useNonce-DujRSGP5.js +0 -1
- package/dist/client/assets/useTypeahead-CV0JPPYe.js +0 -1
- package/dist/client/assets/utils-bzkWQhBP.js +0 -1
- package/dist/client/assets/vue-i18n-B4RRzKT-.js +0 -5
- package/dist/client/assets/zh-CN-DKqrk-nJ.js +0 -1
- package/dist/client/assets/zh-TW-CXhwUL4C.js +0 -1
|
@@ -1,1431 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ChatWidget-Dbic6F6V.js","./vue-i18n-B4RRzKT-.js","./runtime-dom.esm-bundler-DL194Z-s.js","./ActionButton-wEgApzce.js","./ActionIconButton-wh9iuTi4.js","./floating-ui.dom-CfpSQvPs.js","./ChatMessage-wZOblr2O.js","./rolldown-runtime-Dd_uD5pT.js","./llm-store-1j45N-6d.js","./i18n-DtZTpAlH.js","./locales-SpkpwNqX.js","./preload-helper-BaNbYf_w.js","./en-OkC_9BLh.js","./core-messages-E0LWb5xA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{$n as t,Bt as n,Cn as r,Dr as i,Dt as a,Et as o,G as s,Ht as c,It as l,J as u,Jt as d,K as f,Kn as p,L as m,Mt as h,Nn as g,Or as _,Ot as v,P as y,Qt as b,Rn as x,S,St as C,Tr as w,Vn as T,W as E,Wn as D,Wt as O,Xt as k,Yn as A,Yt as j,_ as M,cn as ee,d as N,et as P,f as te,fn as F,gn as I,kr as L,kt as R,l as ne,ln as re,m as ie,n as z,nr as B,nt as ae,p as oe,pt as se,q as V,r as H,rt as U,tt as W,u as ce,xn as G,y as le}from"./vue-i18n-B4RRzKT-.js";import{C as K,w as ue,x as de}from"./runtime-dom.esm-bundler-DL194Z-s.js";import{C as fe,O as pe,S as me,_ as he,a as ge,c as _e,d as ve,g as ye,h as be,i as xe,k as Se,m as Ce,o as we,p as Te,r as Ee,u as De,w as Oe,x as ke,y as Ae}from"./ModelPicker-CLoBWotf.js";import{t as je}from"./diagnostics-DundJi2s.js";import{i as Me,n as Ne,t as Pe}from"./i18n-DtZTpAlH.js";import{T as Fe,o as Ie,w as Le,y as Re}from"./source-CvnvCX42.js";import{a as ze,i as Be,n as Ve,o as He,r as Ue,s as We,t as Ge}from"./analyze-B3YV6_zK.js";import{n as Ke,o as qe}from"./llm-5e9k-gOP.js";import{i as Je}from"./locales-SpkpwNqX.js";import{t as Ye}from"./preload-helper-BaNbYf_w.js";import{$ as Xe,G as Ze,H as Qe,J as $e,K as et,Q as tt,S as nt,U as rt,V as it,W as at,X as ot,Y as st,Z as ct,_ as lt,a as ut,at as dt,c as ft,ct as pt,d as mt,et as ht,f as gt,g as _t,h as vt,i as yt,it as bt,l as xt,lt as St,n as Ct,nt as wt,ot as Tt,p as Et,q as Dt,r as Ot,rt as kt,s as At,st as jt,tt as Mt,u as Nt,x as Pt}from"./useDocumentTitle-DSsMzDvH.js";import{a as Ft,c as It,t as Lt}from"./index-Buksdj5x.js";import{t as q}from"./ActionButton-wEgApzce.js";import{n as Rt,t as J}from"./ActionIconButton-wh9iuTi4.js";import{n as zt,t as Bt}from"./ChatMessage-wZOblr2O.js";import{t as Vt}from"./useTypeahead-CV0JPPYe.js";import{a as Ht,c as Ut,i as Wt,n as Gt,o as Kt,r as qt,s as Jt,t as Yt}from"./utils-bzkWQhBP.js";import{a as Xt,c as Zt,d as Qt,i as $t,l as en,n as tn,o as nn,r as rn,s as an,t as on,u as sn}from"./DisplayFileIcon-DffhOXN6.js";import{n as cn}from"./core-messages-E0LWb5xA.js";import{n as ln,t as un}from"./GithubAvatar-eLlc5vap.js";var dn=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},fn=new class extends dn{};function pn(e,t,n){return fn.diff(e,t,n)}function mn(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function hn(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function gn(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function _n(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function vn(e,t){return gn(e,t,``)}function yn(e,t){return _n(e,t,``)}function bn(e,t){return t.slice(0,xn(e,t))}function xn(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Sn(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Cn(e,t){if(t)return Tn(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function wn(e,t){if(t)return Tn(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Tn(e,t){if(!t)return[wn(e),Cn(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Sn(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var En=`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}`,Dn=RegExp(`[${En}]+|\\s+|[^${En}]`,`ug`);new class extends dn{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Sn(e,r)}else n=e.match(Dn)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&On(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&On(n,i,r,null,t.intlSegmenter),e}};function On(e,t,n,r,i){if(t&&n){let[a,o]=Tn(t.value,i),[s,c]=Tn(n.value,i);if(e){let r=mn(a,s);e.value=_n(e.value,s,r),t.value=vn(t.value,r),n.value=vn(n.value,r)}if(r){let e=hn(o,c);r.value=gn(r.value,c,e),t.value=yn(t.value,e),n.value=yn(n.value,e)}}else if(n){if(e){let e=wn(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=wn(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=wn(r.value,i),[a,o]=Tn(t.value,i),s=mn(n,a);t.value=vn(t.value,s);let c=hn(vn(n,s),o);t.value=yn(t.value,c),r.value=gn(r.value,n,c),e.value=_n(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=wn(r.value,i),n=bn(Cn(t.value,i),e);t.value=yn(t.value,n)}else if(e){let n=bn(Cn(e.value,i),wn(t.value,i));t.value=vn(t.value,n)}}var kn=new class extends dn{tokenize(e){let t=RegExp(`(\\r?\\n)|[${En}]+|[^\\S\\n\\r]+|[^${En}]`,`ug`);return e.match(t)||[]}};function An(e,t,n){return kn.diff(e,t,n)}var jn=new class extends dn{constructor(){super(...arguments),this.tokenize=Nn}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
3
|
-
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
4
|
-
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
5
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
6
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Mn(e,t,n){return jn.diff(e,t,n)}function Nn(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
7
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Pn(e){return e==`.`||e==`!`||e==`?`}new class extends dn{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(Pn(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends dn{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends dn{constructor(){super(...arguments),this.tokenize=Nn}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Fn(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Fn(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Fn(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Fn(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends dn{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function In(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function Ln(e){if(!In(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var Rn={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function zn(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;Mn(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(Mn(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||Hn(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
8
|
-
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Bn(e,t){if(t||=Rn,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw 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(e=>Bn(e,t)).join(`
|
|
9
|
-
`)}let n=[];if(e.isGit){if(t=Rn,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+Ln(r)+` `+Ln(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+Ln((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+Ln((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+Ln((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+Ln((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+Ln(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+Ln(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
10
|
-
`)+`
|
|
11
|
-
`}function Vn(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;zn(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Bn(e,o.headerOptions):void 0)}}))}else{let s=zn(e,t,n,r,i,a,o);return s?Bn(s,o?.headerOptions):void 0}}function Hn(e){let t=e.endsWith(`
|
|
12
|
-
`),n=e.split(`
|
|
13
|
-
`).map(e=>e+`
|
|
14
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Un(e,t,n){if(e==null)return``;let r,i={},a={},o=``,s=``,c=``,l=2,u=3,d=2,f=[],p=0,m=0;for(let h=0;h<e.length;h+=1)if(o=e.charAt(h),Object.prototype.hasOwnProperty.call(i,o)||(i[o]=u++,a[o]=!0),s=c+o,Object.prototype.hasOwnProperty.call(i,s))c=s;else{if(Object.prototype.hasOwnProperty.call(a,c)){if(c.charCodeAt(0)<256){for(let e=0;e<d;e++)p<<=1,m==t-1?(m=0,f.push(n(p)),p=0):m++;r=c.charCodeAt(0);for(let e=0;e<8;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}else{r=1;for(let e=0;e<d;e++)p=p<<1|r,m==t-1?(m=0,f.push(n(p)),p=0):m++,r=0;r=c.charCodeAt(0);for(let e=0;e<16;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}l--,l==0&&(l=2**d,d++),delete a[c]}else{r=i[c];for(let e=0;e<d;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}l--,l==0&&(l=2**d,d++),i[s]=u++,c=String(o)}if(c!==``){if(Object.prototype.hasOwnProperty.call(a,c)){if(c.charCodeAt(0)<256){for(let e=0;e<d;e++)p<<=1,m==t-1?(m=0,f.push(n(p)),p=0):m++;r=c.charCodeAt(0);for(let e=0;e<8;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}else{r=1;for(let e=0;e<d;e++)p=p<<1|r,m==t-1?(m=0,f.push(n(p)),p=0):m++,r=0;r=c.charCodeAt(0);for(let e=0;e<16;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}l--,l==0&&(l=2**d,d++),delete a[c]}else{r=i[c];for(let e=0;e<d;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1}l--,l==0&&(l=2**d,d++)}r=2;for(let e=0;e<d;e++)p=p<<1|r&1,m==t-1?(m=0,f.push(n(p)),p=0):m++,r>>=1;let h=!0;do p<<=1,m==t-1?(f.push(n(p)),h=!1):m++;while(h);return f.join(``)}function Wn(e,t,n){let r=[],i=[],a={val:n(0),position:t,index:1},o=4,s=4,c=3,l=``,u,d=0,f=4,p=1;for(let e=0;e<3;e+=1)r[e]=String(e);for(;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}switch(d){case 0:for(d=0,f=256,p=1;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}u=String.fromCharCode(d);break;case 1:for(d=0,f=2**16,p=1;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}u=String.fromCharCode(d);break;case 2:return``}if(u===void 0)throw Error(`No character found`);r[3]=String(u);let m=String(u);for(i.push(String(u));;){if(a.index>e)return``;for(d=0,f=2**c,p=1;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}switch(u=d){case 0:for(d=0,f=256,p=1;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}r[s++]=String.fromCharCode(d),u=s-1,o--;break;case 1:for(d=0,f=2**16,p=1;p!=f;){let e=a.val&a.position;a.position>>=1,a.position==0&&(a.position=t,a.val=n(a.index++)),d|=+(e>0)*p,p<<=1}r[s++]=String.fromCharCode(d),u=s-1,o--;break;case 2:return i.join(``)}if(o==0&&(o=2**c,c++),r[u])l=String(r[u]);else if(u===s)l=m+m.charAt(0);else return null;i.push(l),r[s++]=m+l.charAt(0),o--,m=l,o==0&&(o=2**c,c++)}}var Gn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;function Kn(e){if(e==null)return``;let t=Un(e,6,e=>Gn.charAt(e));switch(t.length%4){default:case 0:return t;case 1:return t+`===`;case 2:return t+`==`;case 3:return t+`=`}}var qn={};function Jn(e,t){if(!qn[e]){qn[e]={};for(let t=0;t<e.length;t++)qn[e][e.charAt(t)]=t}return qn[e][t]}function Yn(e){return e==null?``:e==``?null:Wn(e.length,32,t=>Jn(Gn,e.charAt(t)))}var Xn=Re({headSha:Fe(),result:Ie}),Zn=`https://pulls.review`,Qn=`<!-- pulls.review data -->`,$n=6e4;function er(e){return e.replace(`T`,` `).slice(0,16)}function tr(e,t){return t?["```lz-string",Kn(JSON.stringify(e)),"```"].join(`
|
|
15
|
-
`):["```json",JSON.stringify(e,null,2),"```"].join(`
|
|
16
|
-
`)}function nr(e,t,n){let{result:r}=n,i=`${Zn}/gh/${e.owner}/${e.repo}/${e.number}?from=${t}`,a=e=>[Qn,`👁️🗨️ Review this pull request with grouped, summarized diffs at:`,`👉 ${i}`,``,`<details><summary>raw result</summary>`,``,`<br>`,``,`💭 analyzed by \`${r.model??r.source}\``,`🕰️ ${er(r.generatedAt)} UTC`,`🔗 head ${n.headSha.slice(0,7)}`,`🤖 automated by [pulls.review](${Zn})`,``,tr(n,e),``,`</details>`,``].join(`
|
|
17
|
-
`),o=a(!1);if(o.length<=$n)return o;let s=a(!0);if(s.length>$n)throw je.commentTooLarge({n:s.length});return s}function rr(e){if(!e.startsWith(Qn))return;let t=e.match(/```(json|lz-string)\n([\s\S]*?)\n```/);if(t)try{let e=t[1]===`lz-string`?Yn(t[2]):t[2];if(!e)return;let n=Le(Xn,JSON.parse(e));return n.success?n.output:void 0}catch{return}}async function ir(e,t){return(await(await e.request(`/repos/${t.owner}/${t.repo}/issues/${t.number}/comments?per_page=100`)).json()).flatMap(e=>{let t=rr(e.body);return t&&e.user?[{id:e.id,login:e.user.login,url:e.html_url,updatedAt:e.updated_at,analysis:t}]:[]}).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}async function ar(e,t,n){let r=await(await e.request(`/repos/${t.owner}/${t.repo}/issues/${t.number}/comments`,{method:`POST`,body:{body:n}})).json();return{id:r.id,url:r.html_url}}async function or(e,t,n,r){let i=await(await e.request(`/repos/${t.owner}/${t.repo}/issues/comments/${n}`,{method:`PATCH`,body:{body:r}})).json();return{id:i.id,url:i.html_url}}var sr=[`INPUT`,`TEXTAREA`];function cr(e,t,n,r={}){if(!t||r.enableIgnoredElement&&sr.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=lr(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function lr(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?lr(e,o,n,r):o:null}var ur=U({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(c(),f(B(ge),i(se(t)),{default:G(()=>[j(e.$slots,`default`)]),_:3},16))}});function dr(){let e=p(!1);return l(()=>{N(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),N([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var fr=S(dr),[pr,mr]=Se([`MenuRoot`,`MenuSub`],`MenuContext`),[hr,gr]=Se(`MenuRoot`),_r=U({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:n}){let r=e,i=n,{modal:a,dir:o}=t(r),s=fe(o),l=le(r,`open`,i),u=p(),d=fr();return mr({open:l,onOpenChange:e=>{l.value=e},content:u,onContentChange:e=>{u.value=e}}),gr({onClose:()=>{l.value=!1},isUsingKeyboardRef:d,dir:s,modal:a}),(e,t)=>(c(),f(B(we),null,{default:G(()=>[j(e.$slots,`default`)]),_:3}))}}),[vr,yr]=Se(`MenuContent`),br=U({__name:`MenuContentImpl`,props:o({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Ee}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:r}){let i=e,a=r,o=pr(),s=hr(),{trapFocus:l,disableOutsidePointerEvents:u,loop:d}=t(i);ke(),Oe(u.value);let m=p(``),h=p(0),g=p(0),_=p(null),v=p(`right`),y=p(0),b=p(null),x=p(),{forwardRef:S,currentElement:C}=Ae(),{handleTypeaheadSearch:w}=Vt(),T=p();function E(e){let t=cr(e,T.value||pe(),C.value,{loop:d.value,arrowKeyOptions:`vertical`,dir:s?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(T.value=t,t.scrollIntoView({block:`nearest`}))}function D(){T.value&&T.value.click()}let O=p(),k=p();I(T,e=>{if(k.value&&(e===void 0||e!==k.value.trigger.value)){if(e===void 0)return;k.value.onOpenChange(!1),k.value=void 0}}),I(C,e=>{o.onContentChange(e)}),n(()=>{window.clearTimeout(h.value)});function A(e){return v.value===_.value?.side&&Ut(e,_.value?.area)}async function M(e){a(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),C.value?.focus({preventScroll:!0}))}function ee(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1,o=cr(e,pe(),C.value,{loop:d.value,arrowKeyOptions:`vertical`,dir:s?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(o)return o?.focus();if(e.code===`Space`)return;let c=x.value?.getItems()??[];if(n&&(e.key===`Tab`&&s.modal.value&&e.preventDefault(),!i&&a&&!r&&w(e.key,c)),e.target!==C.value||!Yt.includes(e.key))return;e.preventDefault();let l=[...c.map(e=>e.ref)];qt.includes(e.key)&&l.reverse(),Ht(l)}function N(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(h.value),m.value=``)}function P(e){if(!Jt(e))return;let t=e.target,n=y.value!==e.clientX;if((e?.currentTarget)?.contains(t)&&n){let t=e.clientX>y.value?`right`:`left`;v.value=t,y.value=e.clientX}}function te(e){Jt(e)&&O.value&&O.value.focus()}return yr({onItemEnter:e=>!!A(e),onItemLeave:e=>A(e)?!0:([`INPUT`,`TEXTAREA`].includes(pe()?.tagName||``)||C.value?.focus(),b.value=null,!1),onTriggerLeave:e=>!!A(e),searchRef:m,highlightedElement:T,onKeydownNavigation:E,onKeydownEnter:D,filterElement:O,onFilterElementChange:e=>{O.value=e},activeSubmenuContext:k,pointerGraceTimerRef:g,onPointerGraceIntentChange:e=>{_.value=e}}),(e,t)=>(c(),f(B(De),{"as-child":``,trapped:B(l),onMountAutoFocus:M,onUnmountAutoFocus:t[7]||=e=>a(`closeAutoFocus`,e)},{default:G(()=>[W(B(ve),{"as-child":``,"disable-outside-pointer-events":B(u),onEscapeKeyDown:t[2]||=e=>a(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>a(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>a(`focusOutside`,e),onInteractOutside:t[5]||=e=>a(`interactOutside`,e),onDismiss:t[6]||=e=>a(`dismiss`)},{default:G(()=>[W(B(St),{ref_key:`rovingFocusGroupRef`,ref:x,"current-tab-stop-id":b.value,"onUpdate:currentTabStopId":t[0]||=e=>b.value=e,"as-child":``,orientation:`vertical`,dir:B(s).dir.value,loop:B(d),onEntryFocus:t[1]||=e=>{a(`entryFocus`,e),B(s).isUsingKeyboardRef.value||e.preventDefault()}},{default:G(()=>[W(B(xe),{ref:B(S),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":B(Kt)(B(o).open.value),dir:B(s).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:ee,onBlur:N,onPointermove:P,onPointerenter:te},{default:G(()=>[j(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),xr=U({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=vr(),{forwardRef:r,currentElement:i}=Ae(),{CollectionItem:a}=_e(),o=p(!1),s=E(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function l(e){if(!e.defaultPrevented&&Jt(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(pe()?.tagName||``)||t.focus({preventScroll:!0})}}}async function u(e){await R(),!e.defaultPrevented&&Jt(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(c(),f(B(a),{value:{textValue:e.textValue}},{default:G(()=>[W(B(Te),v({ref:B(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:l,onPointerleave:u,onFocus:t[0]||=async t=>{let r=t.currentTarget;await R(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,B(n).highlightedElement.value=r)},onBlur:t[1]||=async e=>{await R(),!e.defaultPrevented&&(o.value=!1)}}),{default:G(()=>[j(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),Sr=U({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Ae(),o=hr(),s=vr(),l=p(!1);async function u(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Gt,{bubbles:!0,cancelable:!0});r(`select`,e),await R(),e.defaultPrevented?l.value=!1:o.onClose()}}return(e,t)=>(c(),f(xr,v(n,{ref:B(i),onClick:u,onPointerdown:t[0]||=()=>{l.value=!0},onPointerup:t[1]||=async e=>{await R(),!e.defaultPrevented&&(l.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=B(s).searchRef.value!==``;e.disabled||n&&t.key===` `||B(Wt).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:G(()=>[j(e.$slots,`default`)]),_:3},16))}}),Cr=U({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=he(n,r),a=pr(),{forwardRef:o,currentElement:s}=Ae();return ye(s),(e,t)=>(c(),f(br,v(B(i),{ref:B(o),"trap-focus":B(a).open.value,"disable-outside-pointer-events":B(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>B(a).onOpenChange(!1),onFocusOutside:t[1]||=ue(e=>r(`focusOutside`,e),[`prevent`])}),{default:G(()=>[j(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),wr=U({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=he(e,t),r=pr();return(e,t)=>(c(),f(br,v(B(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>B(r).onOpenChange(!1)}),{default:G(()=>[j(e.$slots,`default`)]),_:3},16))}}),Tr=U({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=he(e,t),r=pr(),a=hr();return(e,t)=>(c(),f(B(Ce),{present:e.forceMount||B(r).open.value},{default:G(()=>[B(a).modal.value?(c(),f(Cr,i(v({key:0},{...e.$attrs,...B(n)})),{default:G(()=>[j(e.$slots,`default`)]),_:3},16)):(c(),f(wr,i(v({key:1},{...e.$attrs,...B(n)})),{default:G(()=>[j(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),[Er,Dr]=Se(`DropdownMenuRoot`),Or=U({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:n}){let r=e,i=n;Ae();let a=le(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0}),o=p(),{modal:s,dir:l}=t(r),u=fe(l);return Dr({open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerId:``,triggerElement:o,contentId:``,modal:s,dir:u}),(e,t)=>(c(),f(B(_r),{open:B(a),"onUpdate:open":t[0]||=e=>x(a)?a.value=e:null,dir:B(u),modal:B(s)},{default:G(()=>[j(e.$slots,`default`,{open:B(a)})]),_:3},8,[`open`,`dir`,`modal`]))}}),kr=U({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=he(e,t);Ae();let r=Er(),i=p(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=be(void 0,`reka-dropdown-menu-content`),(e,t)=>(c(),f(B(Tr),v(B(n),{id:B(r).contentId,"aria-labelledby":B(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!B(r).modal.value||a)&&(i.value=!0),B(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:G(()=>[j(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Ar=U({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=me(t);return Ae(),(e,t)=>(c(),f(B(Sr),i(se({...n,...B(r)})),{default:G(()=>[j(e.$slots,`default`)]),_:3},16))}}),jr=U({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Er(),{forwardRef:r,currentElement:i}=Ae();return l(()=>{n.triggerElement=i}),n.triggerId||=be(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(c(),f(B(ur),{"as-child":``},{default:G(()=>[W(B(Te),{id:B(n).triggerId,ref:B(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":B(n).open.value,"aria-controls":B(n).open.value?B(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":B(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(B(n)?.onOpenToggle(),await R(),B(n).open.value&&t.preventDefault())},onKeydown:i[1]||=K(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&B(n).onOpenToggle(),t.key===`ArrowDown`&&B(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:G(()=>[j(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Mr=new Set,Nr=null;function Y(e){Mr.add(e),Nr??=requestAnimationFrame(Fr)}function Pr(e){Mr.delete(e)&&Mr.size===0&&Nr!=null&&(cancelAnimationFrame(Nr),Nr=null)}function Fr(e){let t=new Set(Mr);Mr.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}Nr=Mr.size>0?requestAnimationFrame(Fr):null}function Ir(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Lr(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Rr(e,t){let n=e?.theme??at,r=t?.theme??at,i=zr(e),a=zr(t);return Lr(n,r)&&Ir(e,t,[`theme`,`parseDiffOptions`])&&Ir(i,a)}function zr(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Br(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Vr({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Hr(e){return{type:`text`,value:e}}function X({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Ur({name:e,width:t=16,height:n=16,properties:r}){return X({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[X({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Wr(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Gr(e){return X({tagName:`div`,properties:{"data-gutter":``},children:e})}function Kr(e,t,n,r={}){return X({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[X({tagName:`span`,properties:{"data-line-number-content":``},children:[Hr(`${t}`)]})]})}function qr(e,t,n){return X({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 Jr(){return X({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Ur({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Yr(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Xr(e){for(let 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}var Zr=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Pr(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Br(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let 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=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Xr(e.composedPath())||(_i(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(_i(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(_i(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){_i(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}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();_i(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);_i(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=ni(i)&&this.hoveredLine?.lineElement===i.lineElement;ti(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ti(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ni(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(ii(i)&&p!=null){p(i);break}if(ri(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!ni(i))break;ti(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!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,_i(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),_i(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),_i(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&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);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{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;let t=e.composedPath();Xr(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Yr(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{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??(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??(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){let e=document.createElement(`div`);e.innerHTML=sn(Jr());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);ei(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let 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(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let 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){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(si(t));if(ei(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(ei(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){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(ei(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Xr(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=si(e);if(t&&Xr(n))return;let r=ci(e);return r==null?this.pathFromAnnotationSlot(e):si(r)}pathFromAnnotationSlot(e){let t=li(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return si(t);let n=di(ui(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:si(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=fi(t)?t:fi(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Br(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Y(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Pr(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!mi(this.renderedSelectedLinesState,n),i=!mi(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);ai(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=gi(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=gi(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:oi(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:oi(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:hi(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:hi(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Qr({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:$r({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function $r({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function ei(e){return e!=null&&`kind`in e&&e.kind===`line`}function ti(e){return e!=null&&`kind`in e&&e.kind===`token`}function ni(e){return ei(e)||ti(e)}function ri(e){return`type`in e&&e.type===`line-info`}function ii(e){return`kind`in e&&e.kind===`merge-conflict-action`}function ai(e){return e===`current`||e===`incoming`||e===`both`}function oi(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function si(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function ci(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function li(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function ui(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function di(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function fi(e){return e!=null&&typeof e.elementFromPoint==`function`}function pi(e,t){return e===t||Br(e??void 0,t??void 0)}function mi(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&pi(e?.range??null,t.range)}function hi(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function gi(e){let 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 _i(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}console.log(...n)}var vi=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),xi(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?wi(t):Ti(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:yi(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:bi(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Si(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function yi(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function bi(e){return Math.max(Math.ceil(e),0)}function xi(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Si(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Ci(e))}function Si(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Ci(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function wi(e){e.codeElement.isConnected&&Ci(e)}function Ti(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`)}function Ei(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 Di(e){return X({tagName:`div`,children:[X({tagName:`div`,children:e.annotations?.map(e=>X({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Oi(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 ki({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return X({tagName:`div`,children:[t===`custom`?X({tagName:`slot`,properties:{name:it}}):Ai({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[ji(r)]],properties:i})}function Ai({name:e,prevName:t,iconType:n}){let r=[X({tagName:`slot`,properties:{name:Mt}}),Ur({name:Oi(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(X({tagName:`div`,children:[X({tagName:`bdi`,children:[Hr(t)]})],properties:{"data-prev-name":``}})),r.push(Ur({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(X({tagName:`div`,children:[X({tagName:`bdi`,children:[Hr(e)]})],properties:{"data-title":``}})),r.push(X({tagName:`slot`,properties:{name:Xe}})),X({tagName:`div`,children:r,properties:{"data-header-content":``}})}function ji(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(X({tagName:`span`,children:[Hr(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(X({tagName:`span`,children:[Hr(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(X({tagName:`slot`,properties:{name:ht}})),X({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Mi(e){return X({tagName:`pre`,properties:Ni(e)})}function Ni({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"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,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Pi=new Map,Fi={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Ii(e){if(Pi.has(e))return Pi.get(e)??`text`;if(Fi[e]!=null)return Fi[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Pi.has(t[1]))return Pi.get(t[1])??`text`;if(Fi[t[1]]!=null)return Fi[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Pi.has(n)?Pi.get(n)??`text`:Fi[n]??`text`}function Li(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:Array.isArray(e)?e:[e??`text`],themes:en(t),preferredHighlighter:n}}function Ri(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function zi(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function Bi(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}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(Hr(`
|
|
18
|
-
`)),e}var Vi=Symbol(`no-token`),Hi=Symbol(`multiple-tokens`);function Ui(e){let t=Wi(e);if(t!=null)return t;let n=Vi,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Ki(e,a);for(let t of e.children)Gi(t)}else Gi(e);r.push(e),i=[],a=void 0;return}for(let e of i)Gi(e);r.push(X({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Vi){if(e===Hi){n=Hi;return}if(n===Vi){n=e;return}n!==e&&(n=Hi)}};for(let t of e.children){let e=t.type===`element`?Ui(t):Vi;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function Wi(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Gi(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Gi(t)}}function Ki(e,t){e.properties[`data-char`]=t}function qi(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+Ji(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function Ji(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Yi(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Wr(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Ui(a),i.push(Bi(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Zi,Xi),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Xi}}var Xi=qi({classPrefix:`hl-`}),Zi={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function Qi(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var $i=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,ea=/^0(?:\.0+)?%?$/;function ta(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function na(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).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 ra(e){if(e==null)return null;let t=na(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function ia(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||$i.test(t))return!0;let n=ta(t);return n!=null&&ea.test(n)}function aa(e,t,n){if(t==null||n==null)return!1;let r=ra(e),i=ra(t),a=ra(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var oa=new WeakMap;function sa(e){let t=oa.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;ca(r,`editor.background`,i),ca(r,`editor.foreground`,a),ca(r,`sideBar.background`,o),ca(r,`sideBar.foreground`,s),ca(r,`input.background`,n[`input.background`]??o),ca(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),ca(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),ca(r,`gitDecoration.addedResourceForeground`,la(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),ca(r,`gitDecoration.modifiedResourceForeground`,la(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),ca(r,`gitDecoration.deletedResourceForeground`,la(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(ia(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(ia(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(ua(l,o)||aa(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return oa.set(e,u),u}function ca(e,t,n){n!=null&&n!==``&&(e[t]=n)}function la(...e){for(let t of e)if(t!=null&&t!==``)return t}function ua(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function da({theme:e=at,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=sa(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Qi(`global`)}fg:${a.fg};`,r+=`${Qi(`global`)}bg:${a.bg};`,r+=fa(i,n)}else{let n=t.getTheme(e.dark),i=sa(n);r+=`${Qi(`global`)}dark:${i.fg};`,r+=`${Qi(`global`)}dark-bg:${i.bg};`,r+=fa(n,`dark`),n=t.getTheme(e.light),i=sa(n),r+=`${Qi(`global`)}light:${i.fg};`,r+=`${Qi(`global`)}light-bg:${i.bg};`,r+=fa(n,`light`)}return r}function fa(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Qi(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Qi(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Qi(`global`)}${t}modified-color:${a};`),n}function pa(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function ma(e,t){for(let n of t)e.push(n)}var ha=`-1,-1`;function ga(e){return e?.some(e=>e.lineNumber===0)??!1}function _a(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function va(e){return e.startingLine===0&&e.totalLines>0}function ya(e,t){return e.endsWith(`\r
|
|
19
|
-
`)?t+`\r
|
|
20
|
-
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
21
|
-
`)?t+`
|
|
22
|
-
`:t}function ba(e,t){return X({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}var xa=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
23
|
-
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
24
|
-
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
25
|
-
</symbol>
|
|
26
|
-
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
27
|
-
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
28
|
-
</symbol>
|
|
29
|
-
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
30
|
-
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
31
|
-
</symbol>
|
|
32
|
-
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
33
|
-
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
34
|
-
</symbol>
|
|
35
|
-
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
36
|
-
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
37
|
-
</symbol>
|
|
38
|
-
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
39
|
-
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
40
|
-
</symbol>
|
|
41
|
-
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
42
|
-
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
43
|
-
</symbol>
|
|
44
|
-
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
45
|
-
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
46
|
-
</symbol>
|
|
47
|
-
<symbol id="diffs-icon-eye-slash" viewBox="0 0 16 16">
|
|
48
|
-
<path d="m13.47 1.47-12 12 1.06 1.06 12-12zM8 14c-.92 0-1.802-.208-2.624-.547l1.173-1.174c.476.142.963.221 1.451.221 1.66 0 3.307-.949 4.626-2.196a10.4 10.4 0 0 0 1.494-1.751A5 5 0 0 0 14.443 8a5 5 0 0 0-.323-.553 10 10 0 0 0-1.238-1.5l1.061-1.062C15.222 6.173 16 7.511 16 8c0 1.05-3.582 6-8 6"/><path d="M8 11q-.084 0-.167-.005l3.162-3.162q.006.083.005.167a3 3 0 0 1-3 3M5.005 8.167l3.162-3.162a3 3 0 0 0-3.162 3.162"/><path d="M8 3.5c.485 0 .97.081 1.445.227l1.168-1.169C9.794 2.212 8.915 2 8 2 3.582 2 0 6.8 0 8c0 .555.766 1.88 2.027 3.144l1.06-1.06a9.5 9.5 0 0 1-1.203-1.461 4.3 4.3 0 0 1-.345-.617L1.536 8l.003-.006c.064-.149.176-.359.345-.617a9.8 9.8 0 0 1 1.482-1.73C4.675 4.427 6.326 3.5 8 3.5"/>
|
|
49
|
-
</symbol>
|
|
50
|
-
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
51
|
-
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
52
|
-
</symbol>
|
|
53
|
-
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
54
|
-
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
55
|
-
</symbol>
|
|
56
|
-
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
57
|
-
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
58
|
-
</symbol>
|
|
59
|
-
<symbol id="diffs-icon-symbol-added-duo" viewBox="0 0 16 16">
|
|
60
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/>
|
|
61
|
-
</symbol>
|
|
62
|
-
<symbol id="diffs-icon-symbol-added-fill" viewBox="0 0 16 16">
|
|
63
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 4a.75.75 0 0 0-.75.75v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5A.75.75 0 0 0 8 4" clip-rule="evenodd"/>
|
|
64
|
-
</symbol>
|
|
65
|
-
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
66
|
-
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
67
|
-
</symbol>
|
|
68
|
-
<symbol id="diffs-icon-symbol-deleted-duo" viewBox="0 0 16 16">
|
|
69
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/>
|
|
70
|
-
</symbol>
|
|
71
|
-
<symbol id="diffs-icon-symbol-deleted-fill" viewBox="0 0 16 16">
|
|
72
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M4.75 7.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
|
|
73
|
-
</symbol>
|
|
74
|
-
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
75
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
76
|
-
</symbol>
|
|
77
|
-
<symbol id="diffs-icon-symbol-diffstat-duo" viewBox="0 0 16 16">
|
|
78
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
79
|
-
</symbol>
|
|
80
|
-
<symbol id="diffs-icon-symbol-diffstat-fill" viewBox="0 0 16 16">
|
|
81
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5zM8 3.546a.75.75 0 0 0-.75.75V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2V4.296a.75.75 0 0 0-.75-.75" clip-rule="evenodd"/>
|
|
82
|
-
</symbol>
|
|
83
|
-
<symbol id="diffs-icon-symbol-extracted" viewBox="0 0 16 16">
|
|
84
|
-
<path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/><path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 1.5c-1.613 0-2.807.089-3.704.288-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288s2.807-.089 3.704-.288c.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5" clip-rule="evenodd"/>
|
|
85
|
-
</symbol>
|
|
86
|
-
<symbol id="diffs-icon-symbol-extracted-duo" viewBox="0 0 16 16">
|
|
87
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8" clip-rule="evenodd" opacity=".2"/><path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/>
|
|
88
|
-
</symbol>
|
|
89
|
-
<symbol id="diffs-icon-symbol-extracted-fill" viewBox="0 0 16 16">
|
|
90
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5 4.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V6.81l3.302 3.302a1.5 1.5 0 1 0 1.06-1.06L6.811 5.75H8.25a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
|
|
91
|
-
</symbol>
|
|
92
|
-
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
93
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
94
|
-
</symbol>
|
|
95
|
-
<symbol id="diffs-icon-symbol-ignored-duo" viewBox="0 0 16 16">
|
|
96
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11.53 4.47a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06-1.06l6-6a.75.75 0 0 1 1.06 0"/>
|
|
97
|
-
</symbol>
|
|
98
|
-
<symbol id="diffs-icon-symbol-ignored-fill" viewBox="0 0 16 16">
|
|
99
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m3.53 4.47a.75.75 0 0 0-1.06 0l-6 6a.75.75 0 1 0 1.06 1.06l6-6a.75.75 0 0 0 0-1.06" clip-rule="evenodd"/>
|
|
100
|
-
</symbol>
|
|
101
|
-
<symbol id="diffs-icon-symbol-inlined" viewBox="0 0 16 16">
|
|
102
|
-
<path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/><path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8m0-1.5c1.613 0 2.807-.089 3.704-.288.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5s-2.807.089-3.704.288c-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288" clip-rule="evenodd"/>
|
|
103
|
-
</symbol>
|
|
104
|
-
<symbol id="diffs-icon-symbol-inlined-duo" viewBox="0 0 16 16">
|
|
105
|
-
<path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8" clip-rule="evenodd" opacity=".2"/><path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/>
|
|
106
|
-
</symbol>
|
|
107
|
-
<symbol id="diffs-icon-symbol-inlined-fill" viewBox="0 0 16 16">
|
|
108
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.5 4a1.5 1.5 0 1 0 .388 2.948l3.301 3.302H7.75a.75.75 0 0 0 0 1.5H11a.75.75 0 0 0 .75-.75V7.75a.75.75 0 0 0-1.5 0v1.44L6.948 5.887A1.5 1.5 0 0 0 5.5 4" clip-rule="evenodd"/>
|
|
109
|
-
</symbol>
|
|
110
|
-
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
111
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
112
|
-
</symbol>
|
|
113
|
-
<symbol id="diffs-icon-symbol-modified-duo" viewBox="0 0 16 16">
|
|
114
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0"/>
|
|
115
|
-
</symbol>
|
|
116
|
-
<symbol id="diffs-icon-symbol-modified-fill" viewBox="0 0 16 16">
|
|
117
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6" clip-rule="evenodd"/>
|
|
118
|
-
</symbol>
|
|
119
|
-
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
120
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
121
|
-
</symbol>
|
|
122
|
-
<symbol id="diffs-icon-symbol-moved-duo" viewBox="0 0 16 16">
|
|
123
|
-
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.496 4.695a.75.75 0 0 0-.051 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.051 1.06L6.49 8.003 4.693 9.998a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
124
|
-
</symbol>
|
|
125
|
-
<symbol id="diffs-icon-symbol-moved-fill" viewBox="0 0 16 16">
|
|
126
|
-
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m1.555 4.745a.75.75 0 0 0-1.11 1.01L10.486 8l-2.04 2.245a.75.75 0 0 0 1.109 1.01l2.5-2.75a.75.75 0 0 0 0-1.01zm-4 0a.75.75 0 0 0-1.11 1.01l2.043 2.248-1.796 1.995a.75.75 0 0 0 1.116 1.004l2.25-2.5a.75.75 0 0 0-.003-1.007z" clip-rule="evenodd"/>
|
|
127
|
-
</symbol>
|
|
128
|
-
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
129
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
130
|
-
</symbol>
|
|
131
|
-
</svg>`;function Sa(e,t){return e==null||t==null?e===t:wa(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}var Ca={};function wa(e=Ca,t=Ca){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Ta(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Ea(){let 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 Da(){let e=document.createElement(`style`);return e.setAttribute(dt,``),e}var Oa=`@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;--diffs-warning-light:#d5a910;--diffs-warning-dark:#ffd452;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}input,button{font-family:inherit;font-size:inherit;line-height:inherit}*,: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]{--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}&: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,[data-edit-prediction-suffix] 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));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],[data-editor-overlay]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-computed-editor-active-line-bg:var(--diffs-computed-selected-line-bg);--diffs-computed-hovered-line-bg:var(--diffs-computed-editor-active-line-bg);--diffs-hover-mix-target:var(--diffs-bg-hover-override,var(--diffs-mixer));--diffs-line-bg:var(--diffs-computed-hovered-line-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}[data-line],[data-no-newline]{&[data-decoration-bg]{--mix-deco-light:92%;--mix-deco-dark:85%;&[data-decoration-bg-depth="2"]{--mix-deco-light:88%;--mix-deco-dark:80%}&[data-decoration-bg-depth="3"]{--mix-deco-light:85%;--mix-deco-dark:78%}--diffs-hover-mix-target:var(--diffs-decoration-bg);--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)))}}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-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-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[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-hover-mix-target:var(--diffs-computed-editor-active-line-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-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}:where([data-background]){& [data-gutter-buffer],& [data-column-number]{--mix-light:91%;--mix-dark:85%}& [data-line],& [data-no-newline]{--mix-light:88%;--mix-dark:80%}& [data-gutter-buffer],& [data-column-number],& [data-line],& [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg);&[data-line-type=change-deletion]{--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&: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))}--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)))}&[data-line-type=change-addition]{--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&: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))}--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)))}&[data-merge-conflict=current]{--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&: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))}--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)))}&[data-merge-conflict=incoming]{--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&: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))}--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)))}}}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline],[data-editor-overlay]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base));--diffs-selection-emphasis-mix-target:var(--diffs-selection-mix-target);&:where([data-editor-overlay]),&:where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline])[data-selected-line]{--mix-selection-light:82%;--mix-selection-dark:75%;--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line])){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base));--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-line][data-selected-line]):is([data-line-type=change-addition],[data-line-type=change-deletion]){--diffs-selection-emphasis-mix-target:light-dark(color-mix(in lab, var(--diffs-diff-line-mix-target,var(--diffs-selection-mix-target)) var(--mix-selection-light), var(--diffs-selection-mix-target)),var(--diffs-selection-mix-target))}&:where([data-editor-overlay]),&[data-selected-line]{--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)))}}[data-line][data-editor-active-line],[data-column-number][data-editor-active-line]{--diffs-computed-editor-active-line-bg:color-mix(in lab, var(--diffs-computed-selected-line-bg) var(--diffs-editor-active-line-source-mix,100%), var(--diffs-selection-emphasis-mix-target))}@media (pointer:fine){[data-line][data-hovered],[data-gutter-buffer][data-hovered],[data-column-number][data-hovered],[data-line-annotation][data-hovered],[data-no-newline][data-hovered],[data-merge-conflict][data-hovered],[data-merge-conflict-actions][data-hovered],[data-editor-overlay][data-hovered]{--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 97%, var(--diffs-hover-mix-target)),color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 91%, var(--diffs-hover-mix-target)))}}[data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line]){color:var(--diffs-selection-number-fg)}[data-no-newline]{user-select:none;& span{opacity:.6}}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid;& [data-additions]{border-left:1px solid var(--diffs-bg)}& [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))}}[data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]{& [data-code],&[data-overflow=wrap],&[data-dehydrated][data-diff-type=split][data-overflow=scroll]{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-buffer],& [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],[data-dehydrated][data-diff-type=split][data-overflow=scroll]{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-code]{display:contents}& [data-deletions]{& [data-gutter]{grid-column:1}& [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}}& [data-additions]{& [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}& [data-content]{grid-column:4}}}[data-dehydrated][data-diff-type=split][data-overflow=scroll] [data-content]{overflow:clip}[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]{user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch;&: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 calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414));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]{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-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;&:hover{color:var(--diffs-fg)}&[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}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-content]{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;& [data-separator-content]{border-radius:6px}}& [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-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [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);& [data-separator-wrapper]{display:none}}& [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;& [data-separator-content],& [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;& [data-separator-content],& [data-expand-button]{display:none}}[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}}@media (pointer:fine){[data-separator=line-info] [data-separator-wrapper]{&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}& [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;& [data-separator-content]{grid-column:unset;grid-row:unset}}@supports (width:1cqi){[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [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-content]{grid-area:1/2/-1;min-width:min-content}& [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}[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)}& [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}[data-indicators=classic]{& [data-line-type=change-addition],& [data-line-type=change-deletion]{&[data-no-newline],&[data-line]{&:before{user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}}}& [data-line-type=change-addition]{&[data-line],&[data-no-newline]{&:before{content:"+";color:var(--diffs-addition-base)}}}& [data-line-type=change-deletion]{&[data-line],&[data-no-newline]{&:before{content:"-";color:var(--diffs-deletion-base)}}}}[data-indicators=bars]{& [data-line-type=change-deletion],& [data-line-type=change-addition]{&[data-column-number]{&:before{content:"";user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}}}& [data-line-type=change-deletion]{&[data-column-number]{&: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-line-type=change-addition]{&[data-column-number]{&:before{background-color:var(--diffs-addition-base)}}}}[data-overflow=wrap]{& [data-line]{white-space:pre-wrap;word-break:break-word}& [data-annotation-content]{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;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-column-number]{min-width:4px;padding:0;&:before{min-width:0}}& [data-line-number-content]{display:none}& [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}&[data-indicators=bars] [data-gutter-utility-slot]{left:6px}}[data-file][data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{border-right:0;min-width:0}}[data-diff-span]{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;&: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;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;white-space:normal;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(-1lh + 1ch);padding:0;display:flex;position:relative;&: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"] &{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] &{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] &{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] &{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] &{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-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}& [data-error-stack]{color:var(--diffs-fg-number)}}}@layer theme,rendered,unsafe;
|
|
132
|
-
`,ka;function Aa(e){if(ka!=null)return ka;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute($e,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),ka=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),ka}function ja(e){let t=e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`;return`${Dt}: ${t};`}var Ma=`@layer base, theme, rendered, unsafe;`,Na=RegExp(`${La(Dt)}\\s*:\\s*[^;]+;`);function Pa(e){return`${Ma}
|
|
133
|
-
@layer unsafe {
|
|
134
|
-
${e}
|
|
135
|
-
}`}function Fa(e,t=`system`,n){return`${Ma}
|
|
136
|
-
@layer rendered {
|
|
137
|
-
:host {${t===`system`?``:`
|
|
138
|
-
color-scheme: ${t};`}
|
|
139
|
-
${ja(n)}
|
|
140
|
-
${e}
|
|
141
|
-
}
|
|
142
|
-
}`}function Ia(e,t){let n=ja(t);return e.replace(Na,n)}function La(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var Ra=new WeakMap;function za(e){return Ra.get(e)??e}function Ba({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function Va(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Ha(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}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`)}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`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function Ua(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function Wa(e,t,n){let r=new Map;for(let i of e){let e=za(i);r.set(e,n?.slotNames.get(e)??t(i))}return{provided:e,current:e,slotNames:r}}function Ga(e,t,n){for(let r of t){let t=za(r);e.slotNames.has(t)||e.slotNames.set(t,n(r))}e.provided=t,e.current=t}function Ka(e,t,n){if(e==null)return n(t);let r=za(t),i=e.slotNames.get(r);return i??(i=n(t),e.slotNames.set(r,i)),i}function qa(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Ja(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function Ya({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Xa(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Xa(){let e=document.createElement(`style`);return e.setAttribute(bt,``),e}var Za=void 0;function Qa(){return Za??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Oa)),t.adoptedStyleSheets=[e]}connectedCallback(){Aa(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(st,t)}function $a(e){return{...et,...e}}function eo(e,t){let n=to(e,t);return t?n:e.diffHeaderHeight+n}function to(e,t){return e.paddingTop??(t?e.spacing:0)}function no(e){return e.paddingBottom??e.spacing}function ro(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function Z(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function io(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ao(e){return e.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))}))}function oo(e){return{...e,hunks:ao(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function so(e,t){return e-(t===0?0:1)}function Q(e,t){return so(e,t)+t}var co=1;function lo(e,...t){return`ck${co}:${JSON.stringify([e,...t])}`}function uo(e){return e===``?[]:e.split(kt)}function fo(e,t,n){let r=e===`clone`?oo(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return po(r,ho(r,n),go(r,n));case`rename-pure`:{let e=go(r,n);_o(r,n);let t=uo(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,yo(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function po(e,t,n){let r=uo(t.contents),i=uo(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=mo(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,yo(e,t,n),e}function mo(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(so(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=Q(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=Q(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function ho(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function go(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function _o(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function vo(e,t,n){return e.cacheKey==null?bo(t,n):`${e.cacheKey}:hydrated`}function yo(e,t,n){let r=vo(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function bo(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?lo(`hydrated-files`,e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}function xo(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var So=new TextEncoder,Co=new TextDecoder(`utf-8`,{ignoreBOM:!0}),wo=/[\uD800-\uDFFF]/,To=1024,Eo=new Uint8Array(To);function Do(){Eo.length!==To&&(Eo=new Uint8Array(To))}function $(e){if(e.length===0)return e;if(wo.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Eo.length<t&&(Eo=new Uint8Array(t));let{written:n}=So.encodeInto(e,Eo);return Co.decode(Eo.subarray(0,n))}var Oo=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ko={'"':`"`,"\\":`\\`,a:`\x07`,b:`\b`,t:` `,n:`
|
|
143
|
-
`,v:`\v`,f:`\f`,r:`\r`};function Ao(e){if(e[0]!==`"`)return;let t=``,n=1;for(;n<e.length;){let r=e[n];if(r===`"`)return{fileName:t,rawLength:n+1};if(r!==`\\`){t+=r,n++;continue}let i=ko[e[n+1]];if(i!=null){t+=i,n+=2;continue}let a=[];do{let t=jo(e,n+1);if(t==null)return;a.push(t),n+=4}while(e[n]===`\\`&&e[n+1]>=`0`&&e[n+1]<=`7`);t+=Oo.decode(new Uint8Array(a))}}function jo(e,t){let n=e.charCodeAt(t)-48,r=e.charCodeAt(t+1)-48,i=e.charCodeAt(t+2)-48;if(n>=0&&n<=3&&r>=0&&r<=7&&i>=0&&i<=7)return n*64+r*8+i}var Mo=4096,No=.5;function Po(e){for(let t of e.hunks)for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=Io(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}}function Fo(e,t,n){let{hunkContent:r}=e;for(let e=1;e<r.length;e++){let i=r[e],a=r[e-1];if(i.type!==`change`||i.additions>0&&i.deletions>0||a.type!==`context`)continue;let o=i.additions>0,s=o?t.additionLines:t.deletionLines,c=o?i.additionLineIndex:i.deletionLineIndex,l=o?i.additions:i.deletions,u=s[c]??``;if(u.trim()!==``)continue;let d=!0;for(let e=1;e<l;e++)if(s[c+e]!==u){d=!1;break}if(!d)continue;let f=0;for(;f<a.lines&&t.additionLines[a.additionLineIndex+a.lines-1-f]===u;)f++;if(f===0||e===1&&f===a.lines||n!=null&&(f=n(i,f),f===0))continue;i.additionLineIndex-=f,i.deletionLineIndex-=f;let p=i.additionLineIndex+i.additions,m=i.deletionLineIndex+i.deletions,h=r[e+1];h?.type===`context`?(h.lines+=f,h.additionLineIndex=p,h.deletionLineIndex=m):r.splice(e+1,0,{type:`context`,lines:f,additionLineIndex:p,deletionLineIndex:m}),a.lines-=f,a.lines===0&&(r.splice(e-1,1),e--)}}function Io(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Mo)return null;let c=[];for(let t=0;t<n;t++)c.push(Ro(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Ro(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=zo(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*No:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Lo=/\s+/g;function Ro(e){return e.replace(Lo,``)}function zo(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}var Bo=/^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;function Vo(e,t){try{return Ho(e,t)}finally{Do()}}function Ho(e,{cacheKey:t,isGitDiff:n=tt.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Zo(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Go(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Jo(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Wo(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Wo(r.contents):[],cacheKey:$o(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Bo);if(t==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}let n=Uo(t[1],!0),r=Uo(t[2],!0);c.name=$(r),n!==r&&(c.prevName=$(n));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(ct):null;if(t!=null){let[,e,r]=t,i=Uo(r,n);if(e===`---`&&i!==`/dev/null`){let e=$(i);c.prevName=e,c.name=e}else e===`+++`&&i!==`/dev/null`&&(c.name=$(i))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=$(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=$(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=$(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=$(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(wt)??[];t!=null&&(c.prevObjectId=$(t)),n!=null&&(c.newObjectId=$(n)),r!=null&&(c.mode=$(r))}(e.startsWith(`rename from `)||e.startsWith(`copy from `))&&(c.prevName=$(Uo(e.slice(e.startsWith(`rename`)?12:10)))),(e.startsWith(`rename to `)||e.startsWith(`copy to `))&&(c.name=$(Uo(e.slice(e.startsWith(`rename`)?10:8))))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
144
|
-
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
145
|
-
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:$o(p.hunkContext),hunkSpecs:$(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(!Ko(t)||qo(t))break;if(a)throw Error(`parsePatchContent: hunk has more lines than expected`)}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=es(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=ts(t);(g==null||g.type!==`change`)&&(g=ns(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=ts(t);(g==null||g.type!==`change`)&&(g=ns(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=ts(t);(g==null||g.type!==`context`)&&(g=ns(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=xo(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=xo(c.deletionLines[e]))}}}if(x!==b.additionCount||S!==b.deletionCount){if(a)throw Error(`parsePatchContent: hunk line count mismatch`);console.error(`parsePatchContent: hunk line count mismatch: "${f.trimEnd()}", declared old/new ${b.deletionCount}/${b.additionCount}, parsed old/new ${S}/${x}`);let e=so(b.additionStart,b.additionCount)+(x===0?0:1),t=so(b.deletionStart,b.deletionCount)+(S===0?0:1);if(!l){let n=e-b.additionStart,r=t-b.deletionStart;b.additionLineIndex+=n,b.deletionLineIndex+=r;for(let e of b.hunkContent)e.additionLineIndex+=n,e.deletionLineIndex+=r}b.additionStart=e,b.deletionStart=t,b.additionCount=x,b.deletionCount=S}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(so(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Q(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=Q(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),Po(c),c}}function Uo(e,t=!1){let n=e.trim(),r=n.startsWith(`"`)?Ao(n)?.fileName??n:n;return t&&(r.startsWith(`a/`)||r.startsWith(`b/`))?r.slice(2):r}function Wo(e){let t=Go(e);for(let e=0;e<t.length;e++)t[e]=$(t[e]);return t}function Go(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
146
|
-
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function Ko(e){let t=e[0];return t===`+`||t===`-`||t===` `}function qo(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
147
|
-
`&&n!==`\r`)return!1}return!0}function Jo(e){if(!e.startsWith(`@@ -`))return;let t=4,n=Yo(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=Yo(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=Yo(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=Yo(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Xo(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function Yo(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Xo(e){return e.endsWith(`\r
|
|
148
|
-
`)?e.slice(0,-2):e.endsWith(`
|
|
149
|
-
`)?e.slice(0,-1):e}function Zo(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Qo(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Qo(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Qo(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function $o(e){return e==null?e:$(e)}function es(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function ts(e){let t=e.slice(1);return $(t===``?`
|
|
150
|
-
`:t)}function ns(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var rs=`/dev/null`;function is(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??as(),a=t??as(),o=Vo(Vn(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey,r=t?.cacheKey;return n!=null&&r!=null?lo(`diff`,n,r):void 0})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function as(){return{name:rs,contents:``}}var os=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,!1)}setup(e,t,n){if(t==null||n==null)for(let 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 ss(e,t){return Lr(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function cs(e){return X({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ls(e){return X({tagName:`div`,children:[X({tagName:`span`,children:[Hr(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function us(e){return X({tagName:`div`,children:[Ur({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 ds({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(X({tagName:`div`,children:[Hr(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(us(`up`)),s++),o||(e.push(us(`down`)),s++)):(e.push(us(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(X({tagName:`div`,children:[X({tagName:`span`,children:[Hr(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(X({tagName:`div`,children:[Hr(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(X({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(X({tagName:`slot`,properties:{name:i}})),X({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function fs(e,t){return`hunk-separator-${e}-${t}`}function ps(e){let t=e.at(-1);return t==null?0:Math.max(Q(t.additionStart,t.additionCount),Q(t.deletionStart,t.deletionCount))}function ms({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 hs({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function gs(e){return[so(e.additionStart,e.additionCount)+1,Q(e.additionStart,e.additionCount)+1]}function _s({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function vs(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-Q(t.additionStart,t.additionCount),r=e.deletionLines.length-Q(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function ys({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-Q(n.additionStart,n.additionCount),i=e.deletionLines.length-Q(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function bs({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=ys({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function xs({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=gs(a);if(t<o){let s=_s({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=bs({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=gs(a);return t<o+i.fromStart||t>=o+i.rangeSize}function Ss({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=gs(n),l=_s({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=bs({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function Cs({type:e,metrics:t}){return t.hunkSeparatorHeight??ro(e)}function ws({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function Ts({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 Es(e){return e!==`simple`&&e!==`metadata`}function Ds({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!Ts({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=Cs({type:e,metrics:t}),a=ws({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function Os({type:e,metrics:t}){if(!Es(e))return;let n=Cs({type:e,metrics:t}),r=ws({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function ks({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=As({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=so(r.deletionStart,r.deletionCount),s=so(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=_s({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?bs({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Ns(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Ns(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Ns(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Ps(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(Fs({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Ns(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function As({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=js({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function js({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=_s({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?bs({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function Ms(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function Ns(e,t,n,r,i,a){let[o,s]=Ms(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Ps(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function Fs({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var Is={forcePlainText:!1};function Ls(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=Is){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=da({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??Bs();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}ks({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&zs({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=Vs({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else ma(f.deletionLines,s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else ma(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function Rs(e,{deletionLineIndex:t,additionLineIndex:n,deletionDecorations:r,additionDecorations:i}){let a=0,o=0,s=-1,c=0,l=-1,u=0;for(let{value:t,added:n,removed:r}of e)r?(s===-1&&(s=a),a+=t.length,c=a):n?(l===-1&&(l=o),o+=t.length,u=o):(a+=t.length,o+=t.length);s!==-1&&r.push(ms({line:t,spanStart:s,spanLength:c-s})),l!==-1&&i.push(ms({line:n,spanStart:l,spanLength:u-l}))}function zs({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=xo(e),t=xo(t),e.length>s||t.length>s))return;let c=o===`char`?pn(e,t):An(e,t);if(o===`word-line`){Rs(c,{deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a});return}let l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(hs({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),hs({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?hs({item:e,arr:l,enableJoin:d,isLastItem:t}):hs({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(ms({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(ms({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function Bs(){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 Vs({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??Ii(e.name),d=s??Ii(t.name),{state:f,transformers:p}=Yi(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Qi(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Qi(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,pa(i.codeToHast(xo(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,pa(i.codeToHast(xo(t.contents),m)))}}function Hs(e,t){let n=is({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function Us(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function Ws(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Gs(e,t){return t.length>0&&t.length<e.deletionLines.length&&Ws(t)}function Ks(e,t,n){let r=e.deletionLines.join(``),i=Us(t.length,r),a=is({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function qs(e,t){return Ks(e,[``],t)}function Js(e,t){if(e.additionLines.length===0)return qs(e,t);if(Gs(e,e.additionLines))return Ks(e,e.additionLines,t);let n=e.additionLines,r=Hs(e,t);return Xs(r,n),r}function Ys(e){return e.length>1&&e.at(-1)===``}function Xs(e,t){if(!Ys(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&Q(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,oc(e);return}}}function Zs(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Qs(e,Hs(e,n));let r=Array.from(t);if(r.length===0)return Qs(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||xo(r)===xo(i))return Qs(e,Hs(e,n))}let i=$s(e,r);if(i.size===0)return Qs(e,Hs(e,n));for(let t of i)if(!tc(e,t,n))return Qs(e,Hs(e,n));return oc(e),vs(e)?Qs(e,Hs(e,n)):Qs(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Qs(e,t){return Object.assign(e,t),t}function $s(e,t){let n=new Set;for(let r of t){let t=ec(e,r);if(t==null)return new Set;n.add(t)}return n}function ec(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function tc(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=is({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(rc(r,s),nc(e,t),!0)}function nc(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
151
|
-
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
152
|
-
`)}function rc(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>ic(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,ac(e)}function ic(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function ac(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function oc(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(so(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,ac(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=Q(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-Q(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var sc=new WeakMap;function cc(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function lc(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function uc(e,t,n){let r=e.hunks,i=e.additionLines,a=cc(i),o=a===i?e:{...e,additionLines:a},s=xc(r,yc(o,t,n),e.deletionLines.length),c=wc(o,s);if(e.additionLines=a,e.hunks=c,e.editSessionDirty=!0,Pc(e),Xs(e,i),Dc(r,e.hunks))return{regions:s.map(e=>e.previousSpan)}}function dc(e,t,n,r){let i=new Set(t),a=Array.from(i).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(a.length===0)return;let o=t=>i.has(t)?r?.get(t):e.additionLines[t],{hunks:s}=e,c,l=0;for(let t of a){for(;l<s.length;){let e=s[l];if(t<Ac(e)+e.additionCount)break;l++}let r=s[l],i=r==null?void 0:Ac(r);if(i==null||t<i||c!=null&&c!==l)return uc(e,n,o);c=l}if(c!=null){if(fc(e,a,c,r,n)){e.editSessionDirty=!0;return}return uc(e,n,o)}}function fc(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=pc(e),o=e.hunks[n];if(o.hunkContent.some(mc))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function pc(e){let t=sc.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return sc.set(e,{lines:e.deletionLines,set:n}),n}function mc(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function hc(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function gc(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=_s({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=jc(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=bs({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=jc(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function _c(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=jc(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,jc(i)+i.deletionCount,e.deletionLines.length),n}function vc(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Hs(e,t):Js(e,t)),!0)}function yc(e,t,n){if(lc(e.deletionLines,e.additionLines)==null)return[];let r=is({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),i,a=(t,a)=>{i??=bc(e.hunks);for(let e=0;e<=a;e++){let o=i.get(t.deletionLineIndex-e);if(o!=null&&o.additions===t.additions&&o.deletions===t.deletions){if(t.additions>0&&n!=null){for(let e=0;e<t.additions;e++)if(n(o.additionLineIndex+e)!==r.additionLines[t.additionLineIndex+e])return a}return e}}return a},o=[],s=0,c=0;for(let e of r.hunks){Fo(e,r,a);let t=e.additionCount>0?e.additionLineIndex-s:e.deletionLineIndex-c;s+=t,c+=t;for(let t of e.hunkContent){if(t.type===`context`){s+=t.lines,c+=t.lines;continue}let e=ic(t,0,0);e.additions===0&&(e.additionLineIndex=s),e.deletions===0&&(e.deletionLineIndex=c),o.push(e),s+=e.additions,c+=e.deletions}}return o}function bc(e){let t=new Map;for(let n of e)for(let e of n.hunkContent)e.type===`change`&&(e.additions===0||e.deletions===0)&&t.set(e.deletionLineIndex,e);return t}function xc(e,t,n){let r=e.map((e,t)=>{let n=jc(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&Sc(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=Cc(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function Sc(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function Cc(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function wc(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);Ec(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);Ec(s,c,i,r),r+=c,i+=c,n.push(Tc(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function Tc(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Mc(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Nc(t.additionStart,r),deletionStart:Mc(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Nc(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Mc(t.deletionStart,i)},${i} +${Mc(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return ac(s),s}function Ec(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function Dc(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(jc(r)!==jc(i)||r.deletionCount!==i.deletionCount||Ac(r)!==Ac(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!Oc(r,i))return!0}return!1}function Oc(e,t){let n=kc(e),r=kc(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*kc(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function Ac(e){return so(e.additionStart,e.additionCount)}function jc(e){return so(e.deletionStart,e.deletionCount)}function Mc(e,t){return t===0?e:e+1}function Nc(e,t){return t===0?e-1:e}function Pc(e){oc(e);for(let t=0;t<e.hunks.length;t++)nc(e,t)}function Fc(e){let t=e.lang??Ii(e.name),n=e.lang??(e.prevName==null?`text`:Ii(e.prevName));return t===`text`&&n===`text`}var Ic=-1,Lc=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Ic}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=[`text`];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:at},t=Ri,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=Zt(e.theme??at)?nn():void 0)}cleanUp(){this.endEditSession(),this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.editSessionActive?(this.renderCache!=null&&(this.renderCache.renderRange=void 0),this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0):this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}beginEditSession(e,t){let{editSessionActive:n}=this;this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.diff=e,n&&this.renderCache!=null&&this.renderCache.diff!==e&&this.clearRenderCache();let{renderCache:r}=this;if(!e.isPartial&&e.additionLines.length===0){Object.assign(e,qs(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(r==null||n&&r.diff===e)return;let{options:i}=this.getRenderOptions(e),a=r.diff===e,o=t!=null&&Z(r.diff,t),{result:s}=r;if(!r.highlighted||s==null||!ss(r.options,i)||!a&&!o){this.clearRenderCache();return}a||(this.renderCache={diff:e,options:i,highlighted:!0,result:{...s,code:{...s.code,additionLines:[...s.code.additionLines]}},renderRange:r.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0,this.diff??this.clearRenderCache()}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!Z(t.diff,e)||Fc(e)||Xc(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(e).then(t=>this.applyRefreshedResult(e,t)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){let{diff:n,renderCache:r}=this;if(t==null||n==null||r==null||!Z(n,e)||!Z(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);ss(i,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let 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)??Qe}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return!1;let{result:i,diff:a}=r;if(i==null)return!1;if(a.isPartial)throw Error(`Could not update render cache for partial diff`);let o=i.code.additionLines,s=this.pendingStructuralRows=n?new Map:void 0,c=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},r=n.map(e=>e[2]).join(``),i=t<a.additionLines.length,u=i?a.additionLines[t]??``:``,d=xo(u);s==null&&i&&(a.additionLines[t]=ya(u,r),d!==r&&(c.push(t),l.set(t,u)));let f={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};s==null?o[t]=f:s.set(t,f)}let u=!1;if(c.length>0){if(this.editSessionActive){if(a.additionLines.length<=1&&a.additionLines.join(``)===``)this.applyRecomputePreservingSessionType(a,qs(a,this.options.parseDiffOptions)),u=!0;else if(Gs(a,a.additionLines))this.applyRecomputePreservingSessionType(a,Ks(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=dc(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,Zs(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=hc(this.expandedHunks,e))}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;this.pendingStructuralRows=void 0;let r=this.diff??n?.diff;if(r==null)return;let i=n?.result;if(r.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:a}=r;if(r.additionLines=Jc(e),i!=null&&(i.code.additionLines=Kc(a,r.additionLines,i.code.additionLines,e)),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,qs(r,this.options.parseDiffOptions)),i!=null&&(i.code.additionLines[0]=qc(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(r,a):Object.assign(r,Js(r,this.options.parseDiffOptions)),t!=null&&i!=null)for(let[e,n]of t)e<i.code.additionLines.length&&(i.code.additionLines[e]=n);n!=null&&(n.isDirty=!0)}applySessionDocumentChange(e,t){let{parseDiffOptions:n}=this.options,r=e.additionLines;if(Gs(e,r)){this.applyRecomputePreservingSessionType(e,Ks(e,r,n));return}this.applyExpansionRemap(uc(e,n,e=>t[e]))}applyRecomputePreservingSessionType(e,t){let n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Di(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=at,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Ze,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await an(Li(this.computedLangs,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Xc(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!ss(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!Fc(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLangs=Yc(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??at}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Z(e,n.diff)||!ss(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(Z(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||Fc(e)||Xc(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||Z(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&Zt(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&Zt(t.theme)}renderDiff(e=this.diff,t=rt){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getReadyRenderResult(e,i);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||Fc(e)||Xc(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!Z(e,this.renderCache.diff),d=!Ei(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&zi(t);l&&!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(u||d))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||d||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,zi(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=Yc(e),this.highlighter??=nn();let t=this.highlighter!=null&&Zt(i.theme),n=this.highlighter!=null&&Qt(this.computedLangs),r=!c&&n;if(l&&this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=rt){this.diff=e;let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return Mi({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Xc(e,this.getTokenizeMaxLength());this.computedLangs=t?[`text`]:Yc(e);let n=this.highlighter!=null&&Zt(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Qt(this.computedLangs);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=Ls(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(ks({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=qc(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{diff:i,renderCache:a}=this;i!=null&&a!=null&&Z(i,e)&&ss(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&ss(a.options,n)&&Z(a.diff,i)||(this.pendingHighlightResult={diff:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(n!=null&&ss(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&Z(n.diff,e)&&ss(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Z(e,n.diff)&&ss(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1,f=a===`unified`,p=Zc(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Gr(),deletionsGutterAST:Gr(),additionsGutterAST:Gr(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=ys({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,qr(void 0,`buffer`,this.size)),h?.push(cs(this.size))):(x.pushToGutter(`deletions`,qr(void 0,`buffer`,this.size)),g?.push(cs(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,Kr(t,n,r,i))};function T(e){C.flush(),a===`unified`?Uc(`unified`,e,x):(Uc(`deletions`,e,x),Uc(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),ks({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&T({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&Bc(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Wc(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Wc(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Hc({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Bc(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&Vc(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Wc(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Wc(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Hc({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Vc(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),E=_?n.noEOFCRDeletions:!1,D=_?n.noEOFCRAdditions:!1,O=(s?.noEOFCR??!1)||E,k=(o?.noEOFCR??!1)||D;if(k||O){if(a===`split`&&C.flush(),O){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(ls(e)),x.pushToGutter(`unified`,qr(e,`metadata`,1))):(x.deletionsContentAST.push(ls(e)),x.pushToGutter(`deletions`,qr(e,`metadata`,1)),k||(x.pushToGutter(`additions`,qr(void 0,`buffer`,1)),x.additionsContentAST.push(cs(1))))}if(k){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(ls(e)),x.pushToGutter(`unified`,qr(e,`metadata`,1))):(x.additionsContentAST.push(ls(e)),x.pushToGutter(`additions`,qr(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,qr(void 0,`buffer`,1)),x.deletionsContentAST.push(cs(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let E=Math.max(ps(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),D=t.bufferBefore>0||t.bufferAfter>0,O=!f&&e.type!==`deleted`,k=!f&&e.type!==`new`,A=x.rowCount>0||D;h=O&&A?h:void 0,g=k&&A?g:void 0,_=f&&A?_:void 0;let j=this.createPreElement(g!=null&&h!=null,E);return{fileDiff:e,unifiedGutterAST:f&&A?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:k&&A?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:O&&A?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:j,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(e),totalLines:E,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let 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;let i=Gr(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,ba(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(X({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(X({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(X({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return sn(this.renderFullAST(e,t))}renderPartialHTML(e,t){return sn(t==null?e:X({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!va(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(_a(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(_a(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Hc({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Hc({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(this.annotationSlotName(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(this.annotationSlotName(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}getAnnotationNames(e){return e?.map(e=>this.annotationSlotName(e))??[]}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return ki({fileOrDiff:e,mode:t,stickyHeader:n})}},Rc=new Intl.PluralRules(`en-US`);function zc(e){return`${e} unmodified line${Rc.select(e)===`one`?``:`s`}`}function Bc(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Vc(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&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)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Hc({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,qr(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,qr(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,qr(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Uc(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,ds({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(ds({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,ds({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(ds({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=fs(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?zc(n):`More unchanged context may be available`;c.pushToGutter(e,ds({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(ds({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Wc(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Gc(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Kc(e,t,n,r){let i=Gc(e),a=Gc(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let e=s;e<t.length;e++)l[e]??=qc(e,r.getLineText(e));return l}function qc(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function Jc(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function Yc(e){if(e.lang!=null)return[e.lang];let t=Ii(e.prevName??e.name),n=Ii(e.name);return t===n?[n]:[t,n]}function Xc(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Zc(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Qc(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function $c(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function el(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function tl({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function nl(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:qa(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function rl(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function il(e){let t={...e};return delete t.cacheKey,t}function al(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??Ii(e.name),r=t.lang??Ii(t.name),i=e.type!==`new`,a=t.type!==`new`;return e.name!==t.name||n!==r||i!==a||e.deletionLines.length!==t.deletionLines.length||e.deletionLines.some((e,n)=>e!==t.deletionLines[n])}function ol(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function sl(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&ol(n.lines,t.deletionLines)}var cl=-1,ll=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++cl}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:at},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new vi,this.scrollSyncManager=new os,this.interactionManager=new Zr(`diff`,Qr(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()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??at}getHunksRendererOptions(e){return nl(e)}createHunksRenderer(e){return new Lc(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;let r=e.hunks.at(-1),i,a;hunkIterator:for(let o of e.hunks){let e=n===`deletions`?o.deletionStart:o.additionStart,s=n===`deletions`?o.deletionCount:o.additionCount,c=so(e,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(t<c){let e=c-t;i=Math.max(u-e,0),a=Math.max(l-e,0);break hunkIterator}if(t>=c+s){if(o===r){let e=t-(c+s);i=u+o.unifiedLineCount+e,a=l+o.splitLineCount+e;break hunkIterator}continue}for(let e of o.hunkContent)if(e.type===`context`){if(t<c+e.lines){let e=t-c;a=l+e,i=u+e;break hunkIterator}c+=e.lines,l+=e.lines,u+=e.lines}else{let r=n===`deletions`?e.deletions:e.additions;if(t<c+r){let r=t-c;i=u+(n===`additions`?e.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(e.deletions,e.additions),u+=e.deletions+e.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Qr(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Lr(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Ka(this.editSession?.annotations,e,Ri);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Ga(t,e,Ri))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.getLatestAnnotations().length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){let{editor:t}=this;Pr(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSession=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=tl(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||ml(this.pre,fl({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||hl(this.headerElement,pl({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,forceRender:l||a.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Va(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)e instanceof HTMLElement&&e.tagName.toLowerCase()===`code`&&(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.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!==void 0&&n!==void 0?is(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=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.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,n),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||!rl(e)||this.pendingFiles?.fileDiff===e)return;if(t==null)throw Error(`FileDiff: loadDiffFiles is required to load full files for a partial diff`);let n=this.loadFilesForDiff(e,t),r=this.pendingFiles={fileDiff:e,promise:n};r.promise=n.finally(()=>{this.pendingFiles===r&&(this.pendingFiles=void 0)})}__canAttachEditor(){return this.fileDiff!=null&&!this.fileDiff.isPartial}async prepareForEditing(){if(this.__canAttachEditor())return;let e=this.__prepareForEditing();if(e==null)throw this.fileDiff?.isPartial===!0&&!rl(this.fileDiff)?Error(`FileDiff.prepareForEditing: this partial diff cannot be hydrated; provide a complete diff`):Error(`FileDiff.prepareForEditing: a partial diff requires loadDiffFiles`);if(await e,!this.__canAttachEditor())throw Error(`FileDiff.prepareForEditing: the diff did not finish loading`)}__prepareForEditing(){if(!this.__canAttachEditor()){if(this.fileDiff?.isPartial===!0&&!rl(this.fileDiff))throw Error(`FileDiff: this partial diff cannot be hydrated; provide a complete diff to edit`);return this.loadFilesIfNecessary(),this.pendingFiles?.promise}}async loadFilesForDiff(e,t){try{let n=await t(e);if(this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}}async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(fo(`merge`,e,t),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await el(()=>this.primeHighlightCache(e)),this.enabled&&this.fileDiff===e&&this.rerender()}}installHydratedSessionDiff(e){if(e.isPartial)throw Error(`FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing`);return this.fileDiff===e&&this.editSession?.outgoingDiff!=null&&(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(Z(this.fileDiff,e))return!1;let n=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,n!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=n)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=Wa(t,Ri,this.editSession.annotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:uo(t.contents),a=n!=null&&sl(n,e);if(n!=null&&!a)throw Error(`FileDiff: retained session cannot resume against a different old file`);if(t!=null&&t.contents!==r&&!a)throw Error(`FileDiff: retained edits are missing their diff session state`);let o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===r,s=il(e);t!=null&&i!=null&&!o&&(s.name=t.name,s.lang=t.lang),a&&n!=null&&i!=null&&(s.additionLines=i,s.type=n.type,s.hunks=n.hunks,s.editSessionDirty=!0,oc(s)),this.editSession={diff:s,annotations:this.editSession?.annotations??Wa(this.lineAnnotations,Ri),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(s,o&&!a?e:void 0)}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let l=tl(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!dl(u,this.deletionFile)||!dl(d,this.additionFile)),y=e!=null&&!Z(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&Ei(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&!y||e==null&&!v)){let e=this.applyCachedThemeState(p);return e&&this.finalizeRender(),e}let x;e==null&&_&&(v||this.fileDiff==null)&&(x=is(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,i):x!=null&&(y=!0,this.updateExternalDiff(x,i)),y&&this.clearReusableHeader(),i!=null&&this.setLineAnnotations(i);let C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(vc(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:w=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(C,ot);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a,e.fileDiff),this.renderSeparators([]),this.renderedDiff=e?.fileDiff??C,this.injectUnsafeCSS()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g||!Z(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(C,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a,t.fileDiff),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData),this.renderedDiff=t.fileDiff}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){let{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;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){let{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),r=this.computeEditorRenderRange(this.renderRange),i=this.getLatestDiff();if(e==null||t==null||i==null||i.isPartial)return;let a=a=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==i)return;let o=this.editSession?.outgoingDiff,{fileDiff:s}=this,c=o!=null&&s!=null&&o!==i,l=c&&o!=null&&s!=null?al(o,s):!1;e.__syncRenderView({highlighter:a,fileContainer:t,fileDiff:i,lineAnnotations:n,renderRange:r,externalDocument:c,resetHistory:l})},o=this.getTheme(),s=i.lang??Ii(i.name),c=nn({theme:o,lang:s});c==null?an({themes:en(o),langs:[`text`,s],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}computeEditorRenderRange(e){let t=this.getLatestDiff();if(e==null||t==null||zi(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return ks({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:n,outgoingDiff:r}={}}=this;if(r!=null&&t!=null){if(!t.isPartial&&al(r,t))return;n=r}if(!(n==null||n.isPartial))return{diffSession:{oldFile:n.type===`new`?null:{name:n.prevName??n.name,lines:e?[...n.deletionLines]:n.deletionLines},type:n.type,hunks:e?ao(n.hunks):n.hunks},hasChanges:n.editSessionDirty===!0}}__attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw Error(`FileDiff.__attachEditor: an editor is already attached`);if(!this.__canAttachEditor())throw Error(`FileDiff.__attachEditor: a complete diff is required before editing`);let t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`FileDiff.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){let{fileDiff:t}=this,n=this.editSession?.outgoingDiff;n!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===n&&this.installEditSession(t);let r=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;r==null?this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff):this.installEditSession(r,e.__getDocumentContents(ul(r)),e.__getDocumentSessionState()),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();let i=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(i!=null&&this.hunksRenderer.diffCache===i&&(this.renderedDiff=i),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,fileDiff:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{diff:a,annotations:o}=n;if(this.editor!=null)throw Error(`FileDiff.__completeEditSession: detach the editor before completing the session`);this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();let s=o?.current,c,l=null,u=null,d=!1,f;if(t==null)throw Error(`FileDiff.__completeEditSession: editor is required for completion`);let p=oo(a),m={name:p.name,contents:p.additionLines.join(``)};p.lang!=null&&(m.lang=p.lang);let h={fileDiff:p,editor:t,originalFileDiff:r,oldFile:p.type===`new`?null:{name:p.prevName??p.name,contents:p.deletionLines.join(``)},newFile:m,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(h);try{if(t.__emitEditComplete(h),this.options.onEditComplete?.(h)===`accept`){if(p.cacheKey!=null&&p.cacheKey===r.cacheKey)throw Error(`FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey`);c=p,l=h.oldFile,u=h.newFile}}catch(e){d=!0,f=e}if(e&&c!=null&&(this.fileDiff=c,this.additionFile!=null&&(this.deletionFile=l,this.additionFile=u),s!=null&&(this.lineAnnotations=s)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),d)throw f}finalizeEditSessionHunks(){let e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=gc(e,this.hunksRenderer.getExpandedHunksMap(),t);return vc(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(_c(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){let n=this.editSession?.diff;if(n==null)throw Error(`FileDiff.applyDocumentChange: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}applySuspendedDocumentChange(e,t){this.applyDocumentChange(e,t),this.hunksRenderer.clearRenderCache()}updateRenderCache(e,t,n={}){let r=this.editSession?.diff;if(r==null)throw Error(`FileDiff.updateRenderCache: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(r);let{shouldRefreshDiffsView:i,lineCountChangeInFlight:a}=n;if(this.hunksRenderer.updateRenderCache(e,t,a)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){let e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){let t=this.getRenderedDiff();if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return xs({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.getRenderedDiff();if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return Ss({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.getRenderedDiff(),{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=gs(o);if(e<s){let c=_s({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=bs({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=gs(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Y(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{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){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(this.placeHolder.style.setProperty(`height`,`${e}px`),!0)}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Fc(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(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.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!$c(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!Qc(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Ta(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Ea();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.headerCache.lastRenderedHTML=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){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Ua(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Ua(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=xa;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let 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&&(this.editor?.__captureFocusForDOMReplacement(),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(let 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,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{headerCache:{fileDiff:r,html:i,lastRenderedHTML:a}}=this,o=(n!==this.editSession?.diff&&Z(r,n)?i:void 0)??sn(e);if(this.headerCache.html=o,this.headerCache.fileDiff=n,o!==a){let e=document.createElement(`div`);e.innerHTML=o;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.headerCache.lastRenderedHTML=o}if(this.isContainerManaged)return;let{renderCustomHeader:s,renderHeaderPrefix:c,renderHeaderFilenameSuffix:l,renderHeaderMetadata:u}=this.options;if(s!=null){let e=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,it,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let d=c?.(n)??void 0,f=l?.(n)??void 0,p=u?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Mt,d),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Xe,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,ht,p),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{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??=Da(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Pa(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=Aa(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Ya({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Fa(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Ia(this.themeCSSStyle.textContent??``,Aa(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Qa()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Ja(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=gl(t[0]),a=gl(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=sn(i),r.content.innerHTML=sn(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{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 a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Ba({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Ba({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=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=Ba({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:n}){let{pre:r,codeUnified:i,codeAdditions:a,codeDeletions:o,options:{diffStyle:s=`split`}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;let c=this.getCodeColumns(s,i,o,a);if(c==null)return!1;let l=t.startingLine,u=n.startingLine,d=l+t.totalLines,f=u+n.totalLines,p=Math.max(l,u),m=Math.min(d,f);if(m<=p)return!1;let h=Math.max(0,p-l),g=Math.max(0,d-m),_=this.trimColumns({columns:c,trimStart:h,trimEnd:g,previousStart:l,overlapStart:p,overlapEnd:m,diffStyle:s});if(_<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<_)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let v=this.lastRowCount-_,y=(t,n)=>{if(!(n<=0))return this.hunksRenderer.renderDiff(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},b=y(u,Math.max(p-u,0));if(b==null&&u<p)return!1;let x=y(m,Math.max(f-m,0));if(x==null&&f>m)return!1;let S=(e,t)=>{if(e!=null){if(s===`unified`&&!Array.isArray(c))this.insertPartialHTML(s,c,e,t);else if(s===`split`&&Array.isArray(c))this.insertPartialHTML(s,c,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);v+=e.rowCount,this.renderedDiff=e.fileDiff}};return this.cleanupErrorWrapper(),S(b,`afterbegin`),S(x,`beforeend`),this.lastRowCount!==v&&(this.applyRowSpan(s,c,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`split`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;let r=(e,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(e,t),i=gl(r?.[0]),a=gl(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};r(`deletions`,n[0]),r(`additions`,n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`unified`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;let r=this.hunksRenderer.renderCodeAST(`unified`,t),i=gl(r?.[0]),a=gl(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=sn(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?Ja(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=gl(t[0]),i=gl(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let 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,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.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 Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let 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)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&t.dataset.gutter!=null&&n.dataset.content!=null)return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}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??(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??(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){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};Sa(u,this.appliedPreAttributes)||(Ha(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let 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 ul(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function dl(e,t){return e==null||t==null?e==null&&t==null:io(e,t)}function fl({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function pl({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function ml(e,t,n=!1){return!n&&e==null&&t}function hl(e,t,n=!1){return e==null&&t&&!n}function gl(e){if(e!=null&&e.type===`element`)return e.children??[]}function _l({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=eo(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=_s({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=Ds({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=vl(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?bs({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=Os({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=Os({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=no(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function vl(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return yl(e,t)}function yl(e,t){let 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}}var bl=3e3,xl=new Map,Sl=-1,Cl=class extends ll{__id=`little-virtualized-file-diff:${++Sl}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:xl,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=$a(n)}setMetrics(e,t=!1){let n=$a(e);(t||!Ir(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&(this.forceRenderOverride=!0)}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.forceRenderOverride=!0,!0):!1}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){let t=this.getLatestAnnotations();return ga(t)?t.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!Rr(t,e),r=n&&jl(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Ml(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=xl,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){let{cache:{heightDeltas:n,ghostTextRows:r,ghostTextRowsByIndex:i},metrics:{lineHeight:a}}=this;if(r===t)return!1;let o=this.getDiffStyle(),s=new Map;for(let[n,r]of t){let t=this.getLineIndexForDiff(e,n+1,`additions`);t!=null&&s.set(o===`split`?t[1]:t[0],r)}let c=!1;for(let e of new Set([...i.keys(),...s.keys()])){let t=((s.get(e)??0)-(i.get(e)??0))*a;if(t===0)continue;let r=(n.get(e)??0)+t;r===0?n.delete(e):n.set(e,r),this.cache.measuredHeightDeltaTotal+=t,c=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=s,c}reconcileHeights(){let e=!1,{options:{overflow:t=`scroll`},metrics:{lineHeight:n}}=this,r=this.placeHolder==null?this.getRenderedDiff():this.getLayoutDiff();if(this.fileContainer==null||r==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(r,this.editor?.__getGhostTextRows()??xl);let{ghostTextRowsByIndex:i}=this.cache,a=t!==`scroll`||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!a&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let o=this.getDiffStyle(),s=o===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&va(this.renderRange)){let t=wl(s)??0;this.setFileAnnotationHeight(t)&&(e=!0)}for(let t of s){if(t==null)continue;let r=t.children[1];if(!(r instanceof HTMLElement))continue;let s=o===`split`&&t===this.codeDeletions;for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let c=Il(r,o),l=i.get(c)??0;if(s&&l>0)continue;let u=this.cache.heightDeltas.get(c)??0;if(!a&&u===l*n)continue;let d=t.getBoundingClientRect().height+l*n,f=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(f=!0),d+=t.nextElementSibling.getBoundingClientRect().height);let p=this.getEstimatedLineHeight(f),m=d-p;m!==u&&(e=!0,this.cache.measuredHeightDeltaTotal+=m-u,m===0?this.cache.heightDeltas.delete(c):this.cache.heightDeltas.set(c,m))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,r){let i=!1,a=!1,{pendingExpansions:o,pendingHydratedDiff:s,options:{collapsed:c=!1}}=this;if(s!=null&&(this.pendingHydratedDiff=void 0,s.expectedDiff===e&&(Object.assign(e,s.nextDiff),this.setHydratedState(s.files),this.installHydratedSessionDiff(e),this.forceRenderOverride=!0,i=!0,a=!0)),o!=null){this.pendingExpansions=void 0;for(let{hunkIndex:e,direction:t,expansionLineCountOverride:n}of o)this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,a=!0}let l=this.updateExternalDiff(e,r),{pendingRenderDiff:u,layoutDiffChanged:d,renderedDiffChanged:f,annotationsChanged:p}=this.updatePendingRender(e,r);return!this.forceRenderOverride&&(l||f||p)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||d)&&(i=!0),(d||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(a=!0),n?.metrics!=null&&(this.metrics=$a(n.metrics),i=!0,a=!0),this.currentCollapsed!==c&&(this.currentCollapsed=c,i=!0),i?this.resetLayoutCache({includeEstimatedHeights:a}):a&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t=`additions`){let n=this.getLayoutDiff();if(n==null||e<1)return;let r=this.getLineIndexForDiff(n,e,t);if(r==null)return;let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,c=this.getDiffStyle(),l=this.getHunkSeparatorType(),u=c===`split`?r[1]:r[0];this.approximateLayoutCheckpoints(n);let d=eo(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return ks({diff:n,diffStyle:c,startingLine:f?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=c===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=Ds({type:l,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(p+=r.gapBefore,u>=o-n&&u<o)return m={top:p,height:r.height},!0;p+=r.height+r.gapAfter}}let s=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===u)return m={top:p,height:s},!0;if(p+=s,r>0){let e=Os({type:l,metrics:this.metrics});if(e!=null){if(u>o&&u<=o+r)return m={top:p+e.gapBefore,height:e.height},!0;p+=e.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutDiff();if(t==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);let c=this.getLayoutCheckpointBeforeTop(e),l=c?.top??eo(this.metrics,n)+this.cache.fileAnnotationHeight,u;return ks({diff:t,diffStyle:o,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:a,additionLine:c})=>{let d=o===`split`?c?.splitLineIndex??a?.splitLineIndex:c?.unifiedLineIndex??a?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=Ds({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(l+=e.totalHeight)}if(l>=e&&(a==null?c!=null&&(u={lineNumber:c.lineNumber,side:`additions`,top:l}):u={lineNumber:a.lineNumber,side:`deletions`,top:l},u!=null))return!0;let f=this.getLineHeight(d,(c?.noEOFCR??!1)||(a?.noEOFCR??!1));if(l+=f,i>0){let e=Os({type:s,metrics:this.metrics});e!=null&&(l+=e.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!Z(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(this.isAdvancedMode()){let n=fo(`clone`,e,t);if(await el(()=>this.primeHighlightCache(n)),this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(fo(`merge`,e,t),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await el(()=>this.primeHighlightCache(e)),this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return xs({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),this.enabled&&this.fileDiff!=null&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;let e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!Z(this.getRenderedDiff(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});let i=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??xl);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=eo(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=_l({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:Nl(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=tl(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!Fl(s,this.deletionFile)||!Fl(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=is(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!Z(this.fileDiff,u),m=p||l;if(e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;p&&this.updateExternalDiff(u,r);let{pendingRenderDiff:h,layoutDiffChanged:g,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(u,r);if(g&&this.resetLayoutCache({includeEstimatedHeights:!0}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,h));else{this.computeApproximateSize(!1,h);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return a!=null&&(this.deletionFile=s,this.additionFile=c),p&&this.clearReusableHeader(),this.renderPlaceholder(this.height);let y=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(h,b,y);return super.render({fileDiff:u,fileContainer:e,renderRange:x,lineAnnotations:r,forceRender:(d??n)||v||_||p,...a,...i})}finalizeRender(){if(!Z(this.getRenderedDiff(),this.pendingRender?.diff))throw Error(`VirtualizedFileDiff.render: rendered a different diff than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestDiff(e)??e,r=this.getRenderedDiff(),{pendingRender:i}=this,a=i?.diff??r,o=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!Z(a,o),renderedDiffChanged:!Z(r,o)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return Pl(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=Nl(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=Tl(this.cache.heightDeltas),u=eo(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=Ol(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+kl(i,e)*this.metrics.lineHeight+El(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=bl}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+El(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=_s({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?Ds({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?bs({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?Os({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:Al({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,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;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=_s({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=bs({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=Nl(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=eo(this.metrics,i),h=e.hunks.length>0?no(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,T=w,E=[],D=(n+r)/2,O=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),k=t+(O?.top??_),A=O?.renderedLineIndex??0,j,M,ee;if(ks({diff:e,diffStyle:l,startingLine:O?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?Ds({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;k+=y;let b=A%s===0,x=Math.floor(A/s);if(b&&(E[x]=k-(t+_+y),ee!=null)){if(ee<=0)return!0;ee--}let S=this.getLineHeight(l===`split`?m:h,g);if(k>n-S&&k<r&&(j??=x),M==null&&k+S>D&&(M=x),ee==null&&k>=r&&b&&(ee=T),A++,k+=S,c>0||v&&d){let e=Os({type:u,metrics:this.metrics});e!=null&&(k<r&&k+e.totalHeight>n&&(j??=x),M==null&&k+e.totalHeight>D&&(M=x),k+=e.totalHeight)}return!1}}),j==null){if(x)j=0,M=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}M??=j;let N=Math.round(M-w/2),P=Math.max(0,Math.ceil(p/s)-w),te=Math.max(0,Math.min(N,P)),F=te*s,I=N<0?C+N*s:C,L=E[te]??0,R=F===0?0:g+L,ne=te+I/s,re=ne<E.length?v-E[ne]:v-(k-t-_);return{startingLine:F,totalLines:I,bufferBefore:R,bufferAfter:Math.max(0,re)}}};function wl(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===ha&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function Tl(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function El({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=Dl(e,n);return(t[Dl(e,r)]??0)-(t[i]??0)}function Dl(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function Ol(e){return Math.ceil(e/bl)*bl}function kl(e,t){let n=0;for(let r of e)r<t&&n++;return n}function Al({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function jl(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function Ml(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Nl(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Pl(e){return typeof e==`function`?`custom`:e??`line-info`}function Fl(e,t){return e==null||t==null?e==null&&t==null:io(e,t)}function Il(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function Ll(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}var Rl=1e3,zl=Rl*4,Bl=[0,1e-6,.99999,1],Vl={overscrollSize:Rl,intersectionObserverMargin:zl,resizeDebugging:!1},Hl=0,Ul=-1,Wl=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++Ul}`;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;reconcileQueue=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...Vl,...e}}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:Bl,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),Y(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)}requestHeightReconcile(e){this.reconcileQueue.add(e),Y(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=Vr({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-Hl,newSize:e}),Hl=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-Hl,newSize:e}),Hl=e))}t&&Y(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw 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(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){Pr(this.computeRenderRangeAndEmit),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.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(e){return this.getScrollTop()+Gl(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.instancesChanged.delete(t),this.reconcileQueue.delete(t),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Y(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&this.root!=null&&this.root instanceof Document&&(this.scrollDirty=!0,Y(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Y(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty,n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){let e=Vr({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&Ll(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let r=this.getScrollAnchor(this.height),i=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&i.add(e);for(let e of this.instancesChanged)i.has(e)||e.onRender(t)&&i.add(e);this.scrollFix(r);for(let e of i)this.reconcileQueue.delete(e),e.reconcileHeights();for(let e of this.reconcileQueue)e.reconcileHeights()&&(n=!0);this.reconcileQueue.clear(),n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&Y(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=Gl(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=Gl(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=Gl(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=Gl(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);e!=null&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&Y(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=this.clampScrollTop(e),this.scrollTop=e,e}scrollTo({top:e,behavior:t=`auto`}){let{root:n}=this;if(n==null)return;let r=this.clampScrollTop(e);n instanceof Document?window.scrollTo({top:r,behavior:t}):n.scrollTo({top:r,behavior:t}),this.scrollDirty=!0,Y(this.computeRenderRangeAndEmit)}clampScrollTop(e){return Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight()))}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 Gl(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}function Kl({target:e,width:t,min:n,max:r}){let i=p(!1),a=0,o=0,s=0;function c(e){t.value=Math.round(Math.min(Math.max(o+e.clientX-a,n),s))}function l(e){let t=e.currentTarget;t.removeEventListener(`pointermove`,c),t.removeEventListener(`pointerup`,l),i.value=!1}function u(t){t.preventDefault(),a=t.clientX,o=e().getBoundingClientRect().width,s=r(),i.value=!0;let n=t.currentTarget;n.setPointerCapture(t.pointerId),n.addEventListener(`pointermove`,c),n.addEventListener(`pointerup`,l)}return{resizing:i,onPointerDown:u}}var ql=oe(`diffs:group-nav`,`tabs`),Jl=ie(`(min-width: 1024px)`),Yl=E(()=>ql.value===`sidebar`&&Jl.value),Xl=.4,Zl=oe(`diffs:group-sidebar-width`,null,{serializer:H.number}),Ql=Symbol(`diffs-virtualizer`),$l=5,eu=2;function tu(e,t){let n=e.querySelector(`[data-file-start="${t}"]`);if(!n)return;let r=Number.parseFloat(getComputedStyle(n).scrollMarginTop),i=()=>Math.abs(n.getBoundingClientRect().top-r)<=eu,a=0;function o(){if(i()||a++>=$l){window.removeEventListener(`scrollend`,o,{capture:!0});return}n.scrollIntoView({behavior:Pt.value,block:`start`})}i()||(window.addEventListener(`scrollend`,o,{capture:!0}),n.scrollIntoView({behavior:Pt.value,block:`start`}))}function nu(e,t,n,r,i){if(e<=0||n<=0)return i;let a=Math.floor(n/(e/t)*2)/2;return Math.min(i,Math.max(r,a))}function ru(e,t,n,r,i){let a=p(i);function o(){if(!e.value||!t.value)return;let n=Number.parseFloat(getComputedStyle(e.value).fontSize);a.value=nu(t.value.getBoundingClientRect().width,n,e.value.clientWidth,r,i)}return M(e,o),I(n,()=>R(o)),document.fonts?.ready.then(o),a}var iu=oe(`diffs:file-list`,`tree`),au=.5,ou=oe(`diffs:group-aside-width`,null,{serializer:H.number}),su={},cu=[`aria-label`,`title`];function lu(e,t){return c(),u(`span`,{class:`i-ph-circle-wavy-warning-duotone shrink-0 text-amber-600 dark:text-amber-400`,role:`img`,"aria-label":e.$t(`note.critical`),title:e.$t(`note.critical`)},null,8,cu)}var uu=It(su,[[`render`,lu]]);function du(e,t,n){return e.hunks.some(e=>{let[r,i]=t===`additions`?[e.newStart,e.newLines]:[e.oldStart,e.oldLines];return n>=r&&n<r+i})}function fu(e,t){let n={text:e.text,critical:e.critical??!1};return du(t,e.side,e.line)&&(n.anchor={side:e.side,line:e.line}),n}function pu(e){return e?.some(e=>e.critical)??!1}function mu(e,t,n,r){return{key:e.key,label:e.label,summary:e.summary,category:e.category??`other`,critical:(e.critical??!1)||[...n.values()].some(pu),files:t,notes:n,missing:r,added:t.reduce((e,t)=>e+t.additions,0),deleted:t.reduce((e,t)=>e+t.deletions,0)}}function hu(e,t){let n=new Map(t.map(e=>[e.path,e])),r=new Map(t.flatMap(e=>e.previousPath?[[e.previousPath,e]]:[])),i=new Set;function a(e){let t=[],a=[];for(let o of e.filePaths){let e=n.get(o)??r.get(o);e?(t.push(e),i.add(e)):a.push(o)}let o=new Map;function s(e,t){let i=n.get(e)??r.get(e);i&&o.set(i.sha,[...o.get(i.sha)??[],t(i)])}for(let t of e.fileNotes??[])s(t.path,()=>({text:t.text,critical:t.critical??!1}));for(let t of e.lineNotes??[])s(t.path,e=>fu(t,e));return mu(e,t,o,a)}let o=e.map(e=>({...a(e),children:(e.children??[]).map(a)})),s=t.filter(e=>!i.has(e));return s.length>0&&o.push({...mu({key:`uncategorized`,label:Ne(`group.uncategorized`),summary:Ne(`group.uncategorizedSummary`),category:`other`},s,new Map,[]),children:[]}),o}function gu(e){return e.files.length+e.children.reduce((e,t)=>e+t.files.length,0)}function _u(e){return e.critical||e.children.some(e=>e.critical)}function vu(e,t){let n=[...e.files,...e.children.flatMap(e=>e.files)];return n.length===0?1:n.filter(e=>t.has(e.sha)).length/n.length}function yu(e){return{added:e.added+e.children.reduce((e,t)=>e+t.added,0),deleted:e.deleted+e.children.reduce((e,t)=>e+t.deleted,0)}}var bu={class:`flex flex-col items-start`},xu={class:`flex items-center gap-1.5`},Su={class:`flex items-center text-xs`},Cu={class:`op-mute`},wu={key:0,class:`op-mute`},Tu=U({__name:`DiffGroupNavItem`,props:{group:{},active:{type:Boolean},reviewed:{},expanded:{type:Boolean}},emits:[`select`,`toggle`],setup(e){let t=e,n=E(()=>yu(t.group)),r=E(()=>gu(t.group)),i=E(()=>t.group.children.length),a=E(()=>vu(t.group,t.reviewed)),o=E(()=>_u(t.group));return(t,l)=>(c(),u(`div`,{class:w([`flex items-center border border-b-2 border-base rounded-t transition-all`,[B($t)[e.group.category],e.active?`border-b-current shadow translate-y--1px`:``]])},[s(`button`,{type:`button`,class:w([[e.active?`op-100`:`op-fade hover:op-100`],`group flex items-center gap-2 px-2 py-0.5 text-left text-sm color-base hover:bg-active`]),onClick:l[1]||=n=>t.$emit(`select`,e.group.key)},[s(`div`,bu,[s(`div`,xu,[W(rn,{category:e.group.category,class:w([`text-sm group-hover:saturate-100`,e.active?``:`saturate-0`])},null,8,[`category`,`class`]),s(`span`,null,L(e.group.label),1),o.value?(c(),f(uu,{key:0,class:`text-sm`})):V(``,!0)]),s(`div`,Su,[W(ln,{additions:n.value.added,deletions:n.value.deleted},null,8,[`additions`,`deletions`]),s(`span`,Cu,`・`+L(t.$t(`common.files`,{n:r.value},r.value)),1),i.value?(c(),u(`span`,wu,`・`+L(t.$t(`common.subgroups`,{n:i.value},i.value)),1)):V(``,!0)])]),a.value===0?V(``,!0):(c(),f(Xt,{key:0,value:a.value,size:18,thickness:2,class:`color-base`},null,8,[`value`])),i.value?(c(),f(J,{key:1,type:`button`,icon:e.expanded?`i-ph:caret-up`:`i-ph:caret-down`,"aria-expanded":e.expanded,class:`mr--1 text-xs`,"aria-label":t.$t(e.expanded?`group.hideSubgroups`:`group.showSubgroups`),onClick:l[0]||=ue(e=>t.$emit(`toggle`),[`stop`])},null,8,[`icon`,`aria-expanded`,`aria-label`])):V(``,!0)],2)],2))}}),Eu={class:`min-w-0 flex flex-1 flex-col gap-1.5`},Du={class:`flex flex-wrap items-center gap-1.5`},Ou=[`aria-current`],ku={class:`flex items-center gap-1`},Au={class:`text-sm`},ju={class:`op-fade`},Mu={class:`flex flex-wrap items-center gap-1.5`},Nu=U({__name:`DiffGroupNav`,props:{groups:{},groupsVisable:{},reviewed:{},hasDescription:{type:Boolean},descriptionVisible:{type:Boolean}},emits:[`select`,`selectDescription`],setup(e,{emit:t}){let n=e,r=t,i=p();function a(e,t=i.value!==e){i.value=t?e:void 0}let o=E(()=>{let e=n.groups.find(e=>e.key===i.value);return e?e.children.map(e=>({...e,children:[]})):[]});function l(e){r(`select`,e),a(e,!0)}return(t,p)=>(c(),u(`div`,Eu,[s(`div`,Du,[e.hasDescription?(c(),u(`button`,{key:0,type:`button`,class:w([`flex items-center self-stretch gap-1.5 border border-b-2 border-base rounded-t px-2 py-0.5 text-sm transition-all hover:bg-active`,e.descriptionVisible?`border-b-current shadow translate-y--1px`:`op-fade hover:op-100`]),"aria-current":e.descriptionVisible?`location`:void 0,onClick:p[0]||=e=>r(`selectDescription`)},[p[3]||=s(`span`,{class:`i-ph:text-align-left`,"aria-hidden":`true`},null,-1),P(` `+L(t.$t(`pr.description`)),1)],10,Ou)):V(``,!0),(c(!0),u(y,null,d(e.groups,t=>(c(),f(Tu,{key:t.key,group:t,active:e.groupsVisable.includes(t.key),reviewed:e.reviewed,expanded:i.value===t.key,onSelect:p[1]||=e=>l(e),onToggle:e=>a(t.key)},null,8,[`group`,`active`,`reviewed`,`expanded`,`onToggle`]))),128)),j(t.$slots,`default`)]),o.value.length?(c(),u(y,{key:0},[s(`div`,ku,[p[5]||=s(`div`,{class:`i-ph-folder-notch-open-duotone op-fade`},null,-1),s(`div`,Au,[s(`span`,ju,L(t.$t(`group.subgroupsOf`)),1),p[4]||=P(),s(`span`,null,L(n.groups.find(e=>e.key===i.value)?.label),1)]),p[6]||=s(`div`,{class:`flex-auto border-t border-base`},null,-1)]),s(`div`,Mu,[(c(!0),u(y,null,d(o.value,n=>(c(),f(Tu,{key:n.key,group:n,active:e.groupsVisable.includes(n.key),reviewed:e.reviewed,onSelect:p[2]||=e=>t.$emit(`select`,e)},null,8,[`group`,`active`,`reviewed`]))),128))])],64)):V(``,!0)]))}});function Pu(e){return e.replace(/\\/g,`/`)}function Fu(e){return/\bnode_modules\b/.test(Pu(e))}function Iu(e){let t=e.split(`_`)[0]??``,n=t.lastIndexOf(`@`);if(n<=0)return;let r=t.slice(0,n),i=t.slice(n+1),a=r;return r.includes(`+`)&&(a=r.replace(`+`,`/`),a.startsWith(`@`)||(a=`@${a}`)),{name:a,version:i}}function Lu(e){let t=Pu(e).match(/\.pnpm\/([^/]+)/);if(t?.[1]!=null)return Iu(t[1])}function Ru(e){let t=Pu(e),n=Lu(t);if(n)return n.name;let r=t.lastIndexOf(`node_modules/`);if(r===-1)return;let[i,a]=t.slice(r+13).split(`/`);if(i!=null)return i.startsWith(`@`)&&a!=null?`${i}/${a}`:i}function zu(e,t=`~/`){return Pu(e).replace(/.*\.pnpm\/[^/]+\/node_modules\//,t)}function Bu(e,t,n={}){let{pnpmCollapse:r=`~/`,maxUp:i=3}=n,a=Pu(e),o=Pu(t).replace(/\/$/,``);if(a.includes(`.pnpm/`))return zu(a,r);if(!o)return a;if(a===o)return`.`;if(a.startsWith(`${o}/`)){let e=a.slice(o.length+1);return e.startsWith(`.`)?e:`./${e}`}let s=o.split(`/`),c=a.split(`/`),l=0;for(;l<s.length&&l<c.length&&s[l]===c[l];)l++;let u=s.length-l;return u>i||l===0?a:`${`../`.repeat(u)}${c.slice(l).join(`/`)}`}function Vu(e,t,n){let r=Fu(e)?Ru(e):void 0;return{path:Bu(e,t,n),moduleName:r}}var Hu={class:`truncate`},Uu={class:`color-base`},Wu={key:1,class:`op-mute italic`},Gu={key:2,class:`op-mute`},Ku={key:1,class:`text-xs op-mute shrink-0`},qu=U({__name:`DisplayFilePath`,props:{path:{},root:{default:``},icon:{type:Boolean,default:!0},href:{},line:{},column:{},dim:{type:Boolean,default:!0},clickable:{type:Boolean},pnpmCollapse:{},tooltip:{type:[Boolean,String],default:!1}},setup(e){let t=e,n=E(()=>Vu(t.path,t.root,{pnpmCollapse:t.pnpmCollapse})),i=E(()=>{let e=n.value.path,t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t),a=r.lastIndexOf(`/`);return{dir:a===-1?``:r.slice(0,a+1),base:a===-1?r:r.slice(a+1),query:i}}),a=E(()=>t.href!=null||t.clickable);return(t,o)=>r((c(),f(b(e.href?`a`:`span`),{href:e.href,class:w([`text-sm font-mono inline-flex gap-1 max-w-full min-w-0 items-center`,{"hover:color-active transition":a.value,"cursor-pointer":e.clickable&&!e.href}])},{default:G(()=>[e.icon?(c(),u(`span`,{key:0,class:w([B(tn)(i.value.base),`op-fade shrink-0`]),"aria-hidden":`true`},null,2)):V(``,!0),s(`span`,Hu,[i.value.dir?(c(),u(`span`,{key:0,class:w(e.dim?`op-mute`:`color-base`)},L(i.value.dir),3)):V(``,!0),s(`span`,Uu,L(i.value.base),1),i.value.query?(c(),u(`span`,Wu,L(i.value.query),1)):V(``,!0),e.line==null?V(``,!0):(c(),u(`span`,Gu,[P(`:`+L(e.line),1),e.column==null?V(``,!0):(c(),u(y,{key:0},[P(`:`+L(e.column),1)],64))]))]),n.value.moduleName?(c(),u(`span`,Ku,`(`+L(n.value.moduleName)+`)`,1)):V(``,!0)]),_:1},8,[`href`,`class`])),[[B(Rt),e.tooltip===!0?e.path:e.tooltip||``]])}}),Ju={key:1,class:`i-ph:sparkle-duotone mt-0.2 shrink-0 op-fade`,"aria-hidden":`true`},Yu=U({__name:`AnalysisNoteCard`,props:{note:{},borderless:{type:Boolean}},setup(e){return(t,n)=>(c(),u(`div`,{class:w([`flex items-center gap-2 overflow-hidden px-3 py-2 text-left text-sm font-sans`,[e.note.critical?`border-amber:30 bg-amber:10`:`border-base bg-base`,e.borderless?``:`my-1 border rounded-lg max-w-200`]])},[e.note.critical?(c(),f(uu,{key:0,class:`mt-0.2 text-base`})):(c(),u(`span`,Ju)),(c(),f(m,null,{default:G(()=>[W(B(zt),{value:e.note.text,class:`min-w-0 flex-1`},null,8,[`value`])]),_:1}))],2))}}),Xu=[`rows`,`placeholder`,`disabled`,`aria-invalid`],Zu=U({__name:`FormTextarea`,props:a({placeholder:{},rows:{default:4},disabled:{type:Boolean},invalid:{type:Boolean},resize:{type:Boolean,default:!0}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=re(e,`modelValue`);return(n,i)=>r((c(),u(`textarea`,{"onUpdate:modelValue":i[0]||=e=>t.value=e,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,"aria-invalid":e.invalid||void 0,class:w([`color-base px-2 py-1.5 outline-none border rounded bg-raised w-full transition placeholder:op-mute focus:ring-2`,[e.invalid?`border-red-500/60 focus:ring-red-500/40`:`border-base focus:ring-primary-500/40`,{"resize-none":!e.resize,"op50 pointer-events-none":e.disabled}]])},null,10,Xu)),[[de,t.value]])}}),Qu={class:`flex flex-col gap-2 p-2`},$u={key:0,class:`text-xs text-red-600 dark:text-red-400`},ed={class:`flex flex-wrap justify-end gap-2`},td=U({__name:`CommentComposer`,props:{hasPendingReview:{type:Boolean},busy:{type:Boolean},error:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=p(``);function a(e){i.value.trim()&&r(`submit`,i.value,e)}return(t,o)=>(c(),u(`div`,Qu,[W(Zu,{modelValue:i.value,"onUpdate:modelValue":o[0]||=e=>i.value=e,rows:3,placeholder:t.$t(`review.leaveComment`),disabled:e.busy,invalid:!!e.error,onKeydown:[o[1]||=K(ue(e=>a(`review`),[`meta`]),[`enter`]),o[2]||=K(ue(e=>a(`review`),[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`placeholder`,`disabled`,`invalid`]),e.error?(c(),u(`p`,$u,L(e.error),1)):V(``,!0),s(`div`,ed,[W(q,{size:`sm`,variant:`text`,disabled:e.busy,onClick:o[3]||=e=>r(`cancel`)},{default:G(()=>[P(L(t.$t(`common.cancel`)),1)]),_:1},8,[`disabled`]),n.hasPendingReview?V(``,!0):(c(),f(q,{key:0,size:`sm`,disabled:e.busy||!i.value.trim(),onClick:o[4]||=e=>a(`single`)},{default:G(()=>[P(L(t.$t(`review.addSingle`)),1)]),_:1},8,[`disabled`])),W(q,{size:`sm`,variant:`primary`,loading:e.busy,disabled:!i.value.trim(),onClick:o[5]||=e=>a(`review`)},{default:G(()=>[P(L(t.$t(e.hasPendingReview?`review.addToReview`:`review.startReview`)),1)]),_:1},8,[`loading`,`disabled`])])]))}}),nd=Symbol(`file-collapse`);function rd(e){let t=e.previousPath??e.path,n=e.path,r=[`diff --git a/${t} b/${n}`];e.status===`added`?r.push(`new file mode 100644`):e.status===`removed`?r.push(`deleted file mode 100644`):e.status===`renamed`?r.push(`rename from ${t}`,`rename to ${n}`):e.status===`copied`&&r.push(`copy from ${t}`,`copy to ${n}`),r.push(`--- ${e.status===`added`?`/dev/null`:`a/${t}`}`),r.push(`+++ ${e.status===`removed`?`/dev/null`:`b/${n}`}`);for(let t of e.hunks)r.push(t.header,t.patch);return r.join(`
|
|
153
|
-
`)}function id(e,t){let n=e.previousPath??e.path;return Vo(rd(e),t?{oldFile:t.old===void 0?void 0:{name:n,contents:t.old},newFile:t.new===void 0?void 0:{name:e.path,contents:t.new}}:void 0)}function ad(e){return e.isBinary||e.truncated||e.status===`added`||e.status===`removed`?!1:e.hunks.some(e=>e.oldStart>1||e.newStart>1)}var od=[`title`],sd=U({__name:`FileStatus`,props:{status:{}},setup(e){let t={added:`A`,removed:`D`,modified:`M`,renamed:`R`,copied:`C`},n={added:`color-success-500 bg-success-500:10`,removed:`color-error-500 bg-error-500:10`,modified:`color-warning-500 bg-warning-500:10`,renamed:`color-blue-500 bg-blue-500:10`,copied:`color-blue-500 bg-blue-500:10`};return(r,i)=>(c(),u(`span`,{class:w([`w-4 inline-flex shrink-0 items-center justify-center rounded text-xs font-mono`,n[e.status]]),title:r.$t(`fileStatus.${e.status}`)},L(t[e.status]),11,od))}}),cd=(0,e(qe(),1).default)(Ke);function ld(e){return cd(e)}var ud=`@layer base {
|
|
154
|
-
:host {
|
|
155
|
-
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
156
|
-
"Courier New", monospace;
|
|
157
|
-
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
158
|
-
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
159
|
-
--diffs-mixer: light-dark(#000, #fff);
|
|
160
|
-
--diffs-gap-fallback: 8px;
|
|
161
|
-
--diffs-scrollbar-gutter-fallback: 6px;
|
|
162
|
-
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
163
|
-
--diffs-added-light: #0dbe4e;
|
|
164
|
-
--diffs-added-dark: #5ecc71;
|
|
165
|
-
--diffs-modified-light: #009fff;
|
|
166
|
-
--diffs-modified-dark: #69b1ff;
|
|
167
|
-
--diffs-deleted-light: #ff2e3f;
|
|
168
|
-
--diffs-deleted-dark: #ff6762;
|
|
169
|
-
--diffs-warning-light: #d5a910;
|
|
170
|
-
--diffs-warning-dark: #ffd452;
|
|
171
|
-
color-scheme: light dark;
|
|
172
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
173
|
-
font-size: var(--diffs-font-size, 13px);
|
|
174
|
-
line-height: var(--diffs-line-height, 20px);
|
|
175
|
-
font-feature-settings: var(--diffs-font-features);
|
|
176
|
-
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
177
|
-
--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))));
|
|
178
|
-
--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))));
|
|
179
|
-
--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))));
|
|
180
|
-
--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))));
|
|
181
|
-
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
182
|
-
--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))));
|
|
183
|
-
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
184
|
-
--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)))));
|
|
185
|
-
--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)))));
|
|
186
|
-
--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)))));
|
|
187
|
-
--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))));
|
|
188
|
-
--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)));
|
|
189
|
-
--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))));
|
|
190
|
-
--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)));
|
|
191
|
-
--diffs-selection-base: var(--diffs-modified-base);
|
|
192
|
-
--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)));
|
|
193
|
-
background-color: var(--diffs-bg);
|
|
194
|
-
color: var(--diffs-fg);
|
|
195
|
-
display: block;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
pre, code, [data-error-wrapper] {
|
|
199
|
-
isolation: isolate;
|
|
200
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
201
|
-
outline: none;
|
|
202
|
-
margin: 0;
|
|
203
|
-
padding: 0;
|
|
204
|
-
display: block;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
pre, code {
|
|
208
|
-
background-color: var(--diffs-bg);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
code {
|
|
212
|
-
contain: content;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
input, button {
|
|
216
|
-
font-family: inherit;
|
|
217
|
-
font-size: inherit;
|
|
218
|
-
line-height: inherit;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
*, :before, :after {
|
|
222
|
-
box-sizing: border-box;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
[data-icon-sprite] {
|
|
226
|
-
display: none;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
[data-diffs-header], [data-separator] {
|
|
230
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
[data-diffs-header][data-sticky] {
|
|
234
|
-
z-index: 1;
|
|
235
|
-
background-color: var(--diffs-bg);
|
|
236
|
-
position: sticky;
|
|
237
|
-
top: 0;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
[data-file-info] {
|
|
241
|
-
color: var(--fg);
|
|
242
|
-
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
243
|
-
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
244
|
-
padding: 10px;
|
|
245
|
-
font-weight: 700;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
[data-diff], [data-file] {
|
|
249
|
-
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
250
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
251
|
-
|
|
252
|
-
&[data-dehydrated] {
|
|
253
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
257
|
-
background-color: var(--diffs-bg-context);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@supports (-webkit-touch-callout: none) {
|
|
262
|
-
:host {
|
|
263
|
-
--diffs-scrollbar-gutter-fallback: 0px;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
[data-line] span, [data-edit-prediction-suffix] span {
|
|
268
|
-
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
269
|
-
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
270
|
-
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
271
|
-
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
272
|
-
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
276
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
277
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
278
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
279
|
-
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
280
|
-
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
281
|
-
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
282
|
-
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
283
|
-
color: var(--diffs-fg);
|
|
284
|
-
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
[data-line], [data-no-newline] {
|
|
288
|
-
&[data-decoration-bg] {
|
|
289
|
-
--mix-deco-light: 92%;
|
|
290
|
-
--mix-deco-dark: 85%;
|
|
291
|
-
|
|
292
|
-
&[data-decoration-bg-depth="2"] {
|
|
293
|
-
--mix-deco-light: 88%;
|
|
294
|
-
--mix-deco-dark: 80%;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
&[data-decoration-bg-depth="3"] {
|
|
298
|
-
--mix-deco-light: 85%;
|
|
299
|
-
--mix-deco-dark: 78%;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
303
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
304
|
-
var(--diffs-bg) var(--mix-deco-light),
|
|
305
|
-
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
306
|
-
var(--diffs-bg) var(--mix-deco-dark),
|
|
307
|
-
var(--diffs-decoration-bg)));
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
312
|
-
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
313
|
-
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
314
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
[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"] {
|
|
318
|
-
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
319
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
323
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
324
|
-
var(--diffs-bg) 78%,
|
|
325
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
326
|
-
var(--diffs-bg) 68%,
|
|
327
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
328
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
332
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
333
|
-
var(--diffs-bg) 78%,
|
|
334
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
335
|
-
var(--diffs-bg) 68%,
|
|
336
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
337
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
341
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
342
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
:where([data-background]) {
|
|
346
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
347
|
-
--mix-light: 91%;
|
|
348
|
-
--mix-dark: 85%;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
& [data-line], & [data-no-newline] {
|
|
352
|
-
--mix-light: 88%;
|
|
353
|
-
--mix-dark: 80%;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
357
|
-
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
358
|
-
|
|
359
|
-
&[data-line-type="change-deletion"] {
|
|
360
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
361
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
362
|
-
|
|
363
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
364
|
-
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
365
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
369
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
370
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
371
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
372
|
-
var(--diffs-diff-line-mix-target)));
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
&[data-line-type="change-addition"] {
|
|
376
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
377
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
378
|
-
|
|
379
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
380
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
381
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
385
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
386
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
387
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
388
|
-
var(--diffs-diff-line-mix-target)));
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
&[data-merge-conflict="current"] {
|
|
392
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
393
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
394
|
-
|
|
395
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
396
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
397
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
401
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
402
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
403
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
404
|
-
var(--diffs-diff-line-mix-target)));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
&[data-merge-conflict="incoming"] {
|
|
408
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
409
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
410
|
-
|
|
411
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
412
|
-
color: var(--diffs-modified-base);
|
|
413
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
417
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
418
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
419
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
420
|
-
var(--diffs-diff-line-mix-target)));
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
426
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
427
|
-
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
428
|
-
|
|
429
|
-
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
430
|
-
--mix-selection-light: 82%;
|
|
431
|
-
--mix-selection-dark: 75%;
|
|
432
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
436
|
-
--mix-selection-light: 75%;
|
|
437
|
-
--mix-selection-dark: 60%;
|
|
438
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
439
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
443
|
-
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
444
|
-
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
445
|
-
var(--mix-selection-light),
|
|
446
|
-
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
450
|
-
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
451
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
452
|
-
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
453
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
454
|
-
var(--diffs-selection-mix-target)));
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
459
|
-
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
460
|
-
var(--diffs-computed-selected-line-bg)
|
|
461
|
-
var(--diffs-editor-active-line-source-mix, 100%),
|
|
462
|
-
var(--diffs-selection-emphasis-mix-target));
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
@media (pointer: fine) {
|
|
466
|
-
[data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
|
|
467
|
-
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
468
|
-
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
469
|
-
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
470
|
-
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
471
|
-
var(--diffs-hover-mix-target)));
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
476
|
-
color: var(--diffs-selection-number-fg);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
[data-no-newline] {
|
|
480
|
-
user-select: none;
|
|
481
|
-
|
|
482
|
-
& span {
|
|
483
|
-
opacity: .6;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
[data-diff-type="split"][data-overflow="scroll"] {
|
|
488
|
-
grid-template-columns: 1fr 1fr;
|
|
489
|
-
display: grid;
|
|
490
|
-
|
|
491
|
-
& [data-additions] {
|
|
492
|
-
border-left: 1px solid var(--diffs-bg);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
& [data-deletions] {
|
|
496
|
-
border-right: 1px solid var(--diffs-bg);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
[data-code] {
|
|
501
|
-
grid-auto-flow: dense;
|
|
502
|
-
grid-template-columns: var(--diffs-code-grid);
|
|
503
|
-
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
504
|
-
overscroll-behavior-x: none;
|
|
505
|
-
tab-size: var(--diffs-tab-size, 2);
|
|
506
|
-
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
507
|
-
padding-bottom: max(0px,
|
|
508
|
-
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
509
|
-
var(--diffs-scrollbar-gutter)));
|
|
510
|
-
scrollbar-gutter: stable;
|
|
511
|
-
align-self: flex-start;
|
|
512
|
-
display: grid;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
[data-diffs-scrollbar-measure] {
|
|
516
|
-
opacity: 0;
|
|
517
|
-
pointer-events: none;
|
|
518
|
-
scrollbar-gutter: auto;
|
|
519
|
-
grid-template-columns: none;
|
|
520
|
-
width: 100px;
|
|
521
|
-
height: 100px;
|
|
522
|
-
padding: 0;
|
|
523
|
-
position: absolute;
|
|
524
|
-
top: -200px;
|
|
525
|
-
left: -200px;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
[data-container-size] {
|
|
529
|
-
container-type: inline-size;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
[data-code]::-webkit-scrollbar {
|
|
533
|
-
width: 0;
|
|
534
|
-
height: var(--diffs-scrollbar-gutter);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
[data-code]::-webkit-scrollbar-track {
|
|
538
|
-
background: none;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
[data-code]::-webkit-scrollbar-thumb {
|
|
542
|
-
background-color: #0000;
|
|
543
|
-
background-clip: content-box;
|
|
544
|
-
border: 1px solid #0000;
|
|
545
|
-
border-radius: 3px;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
[data-code]::-webkit-scrollbar-corner {
|
|
549
|
-
background-color: #0000;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
@supports ((-moz-appearance: none)) {
|
|
553
|
-
[data-code] {
|
|
554
|
-
scrollbar-width: thin;
|
|
555
|
-
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
556
|
-
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
561
|
-
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
562
|
-
padding-top: 0;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
[data-gutter] {
|
|
567
|
-
grid-template-rows: subgrid;
|
|
568
|
-
grid-template-columns: subgrid;
|
|
569
|
-
z-index: 3;
|
|
570
|
-
background-color: var(--diffs-bg);
|
|
571
|
-
grid-column: 1;
|
|
572
|
-
display: grid;
|
|
573
|
-
position: relative;
|
|
574
|
-
|
|
575
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
576
|
-
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
[data-content] {
|
|
581
|
-
grid-template-rows: subgrid;
|
|
582
|
-
grid-template-columns: subgrid;
|
|
583
|
-
background-color: var(--diffs-bg);
|
|
584
|
-
grid-column: 2;
|
|
585
|
-
min-width: 0;
|
|
586
|
-
display: grid;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
590
|
-
grid-auto-flow: dense;
|
|
591
|
-
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
592
|
-
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
593
|
-
display: grid;
|
|
594
|
-
|
|
595
|
-
& [data-code] {
|
|
596
|
-
display: contents;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
& [data-deletions] {
|
|
600
|
-
& [data-gutter] {
|
|
601
|
-
grid-column: 1;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
& [data-content] {
|
|
605
|
-
border-right: 1px solid var(--diffs-bg);
|
|
606
|
-
grid-column: 2;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
& [data-additions] {
|
|
611
|
-
& [data-gutter] {
|
|
612
|
-
border-left: 1px solid var(--diffs-bg);
|
|
613
|
-
grid-column: 3;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
& [data-content] {
|
|
617
|
-
grid-column: 4;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
623
|
-
overflow: clip;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
[data-overflow="scroll"] [data-gutter] {
|
|
627
|
-
position: sticky;
|
|
628
|
-
left: 0;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
[data-interactive-lines] [data-line] {
|
|
632
|
-
cursor: pointer;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
[data-interactive-line-numbers] [data-column-number] {
|
|
636
|
-
cursor: pointer;
|
|
637
|
-
touch-action: none;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
[data-content-buffer], [data-gutter-buffer] {
|
|
641
|
-
user-select: none;
|
|
642
|
-
min-height: 1lh;
|
|
643
|
-
position: relative;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
[data-gutter-buffer] {
|
|
647
|
-
padding-left: 2ch;
|
|
648
|
-
padding-right: 1ch;
|
|
649
|
-
|
|
650
|
-
&:before {
|
|
651
|
-
content: "";
|
|
652
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
653
|
-
display: block;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
[data-gutter-buffer="annotation"] {
|
|
658
|
-
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
659
|
-
min-height: 0;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
[data-gutter-buffer="buffer"] {
|
|
663
|
-
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
[data-content-buffer] {
|
|
667
|
-
background-position: 5px 0;
|
|
668
|
-
background-size: 8px 8px;
|
|
669
|
-
background-origin: border-box;
|
|
670
|
-
background-image: repeating-linear-gradient(-45deg,
|
|
671
|
-
transparent,
|
|
672
|
-
transparent calc(3px * 1.414),
|
|
673
|
-
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
674
|
-
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
675
|
-
grid-column: 1;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
[data-separator] {
|
|
679
|
-
box-sizing: content-box;
|
|
680
|
-
background-color: var(--diffs-bg);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
[data-separator="simple"] {
|
|
684
|
-
min-height: 4px;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
688
|
-
background-color: var(--diffs-bg-separator);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
692
|
-
height: 32px;
|
|
693
|
-
position: relative;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
[data-separator-wrapper] {
|
|
697
|
-
user-select: none;
|
|
698
|
-
fill: currentColor;
|
|
699
|
-
background-color: var(--diffs-bg);
|
|
700
|
-
align-items: center;
|
|
701
|
-
height: 100%;
|
|
702
|
-
display: flex;
|
|
703
|
-
position: absolute;
|
|
704
|
-
inset-inline: 0;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
[data-content] [data-separator-wrapper] {
|
|
708
|
-
display: none;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
[data-separator="metadata"] [data-separator-wrapper] {
|
|
712
|
-
background-color: var(--diffs-bg-separator);
|
|
713
|
-
height: 100%;
|
|
714
|
-
color: var(--diffs-fg-number);
|
|
715
|
-
white-space: nowrap;
|
|
716
|
-
text-overflow: ellipsis;
|
|
717
|
-
min-width: min-content;
|
|
718
|
-
padding-inline: 1ch;
|
|
719
|
-
inset-inline: 100% auto;
|
|
720
|
-
overflow: hidden;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
[data-separator="line-info"] {
|
|
724
|
-
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
725
|
-
|
|
726
|
-
& [data-separator-wrapper] {
|
|
727
|
-
min-width: 16px;
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
732
|
-
margin-block: 0;
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
[data-separator="line-info"][data-separator-first] {
|
|
736
|
-
margin-top: 0;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
[data-separator="line-info"][data-separator-last] {
|
|
740
|
-
margin-bottom: 0;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
[data-expand-index] [data-separator-wrapper] {
|
|
744
|
-
grid-template-columns: 32px auto;
|
|
745
|
-
display: grid;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
749
|
-
grid-template-columns: 32px 32px auto;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
[data-expand-button], [data-separator-content] {
|
|
753
|
-
background-color: var(--diffs-bg-separator);
|
|
754
|
-
flex: none;
|
|
755
|
-
align-items: center;
|
|
756
|
-
display: flex;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
[data-expand-index] [data-separator-content]:hover {
|
|
760
|
-
cursor: pointer;
|
|
761
|
-
text-decoration: underline;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
[data-expand-button] {
|
|
765
|
-
cursor: pointer;
|
|
766
|
-
min-width: 32px;
|
|
767
|
-
color: var(--diffs-fg-number);
|
|
768
|
-
border-right: 2px solid var(--diffs-bg);
|
|
769
|
-
flex-shrink: 0;
|
|
770
|
-
justify-content: center;
|
|
771
|
-
align-self: stretch;
|
|
772
|
-
|
|
773
|
-
&:hover {
|
|
774
|
-
color: var(--diffs-fg);
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
&[data-expand-all-button] {
|
|
778
|
-
display: none;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
[data-expand-down] [data-icon] {
|
|
783
|
-
transform: scaleY(-1);
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
[data-separator-content] {
|
|
787
|
-
height: 100%;
|
|
788
|
-
color: var(--diffs-fg-number);
|
|
789
|
-
flex: auto;
|
|
790
|
-
justify-content: flex-start;
|
|
791
|
-
padding: 0 1ch;
|
|
792
|
-
overflow: hidden;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
796
|
-
& [data-separator-content] {
|
|
797
|
-
user-select: none;
|
|
798
|
-
height: 100%;
|
|
799
|
-
overflow: clip;
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
[data-unmodified-lines] {
|
|
804
|
-
text-overflow: ellipsis;
|
|
805
|
-
white-space: nowrap;
|
|
806
|
-
flex: 0 auto;
|
|
807
|
-
min-width: 0;
|
|
808
|
-
display: block;
|
|
809
|
-
overflow: hidden;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
@supports (width: 1cqi) {
|
|
813
|
-
[data-unified] {
|
|
814
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
815
|
-
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
816
|
-
width: 100cqi;
|
|
817
|
-
|
|
818
|
-
& [data-separator-content] {
|
|
819
|
-
border-radius: 6px;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
824
|
-
border-top-left-radius: unset;
|
|
825
|
-
border-bottom-left-radius: unset;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
[data-gutter] {
|
|
830
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
831
|
-
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
& [data-separator="line-info"] [data-separator-content] {
|
|
835
|
-
border-top-left-radius: 6px;
|
|
836
|
-
border-bottom-left-radius: 6px;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
840
|
-
border-top-left-radius: unset;
|
|
841
|
-
border-bottom-left-radius: unset;
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
[data-additions] {
|
|
846
|
-
& [data-content] [data-separator="line-info"] {
|
|
847
|
-
background-color: var(--diffs-bg);
|
|
848
|
-
|
|
849
|
-
& [data-separator-wrapper] {
|
|
850
|
-
display: none;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
855
|
-
background-color: var(--diffs-bg-separator);
|
|
856
|
-
border-top-right-radius: 6px;
|
|
857
|
-
border-bottom-right-radius: 6px;
|
|
858
|
-
height: 100%;
|
|
859
|
-
display: block;
|
|
860
|
-
|
|
861
|
-
& [data-separator-content], & [data-expand-button] {
|
|
862
|
-
display: none;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
868
|
-
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
872
|
-
background-color: var(--diffs-bg-separator);
|
|
873
|
-
height: 100%;
|
|
874
|
-
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
875
|
-
border-top-right-radius: 6px;
|
|
876
|
-
border-bottom-right-radius: 6px;
|
|
877
|
-
display: block;
|
|
878
|
-
|
|
879
|
-
& [data-separator-content], & [data-expand-button] {
|
|
880
|
-
display: none;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
885
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
886
|
-
border-top-left-radius: 6px;
|
|
887
|
-
border-bottom-left-radius: 6px;
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
@media (pointer: fine) {
|
|
892
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
893
|
-
&[data-separator-multi-button] {
|
|
894
|
-
& [data-expand-up] {
|
|
895
|
-
border-top-left-radius: 6px;
|
|
896
|
-
border-bottom-left-radius: unset;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
& [data-expand-down] {
|
|
900
|
-
border-bottom-left-radius: 6px;
|
|
901
|
-
border-top-left-radius: unset;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
@media (pointer: coarse) {
|
|
909
|
-
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
910
|
-
grid-template-columns: 34px 34px auto;
|
|
911
|
-
|
|
912
|
-
& [data-separator-content] {
|
|
913
|
-
grid-column: unset;
|
|
914
|
-
grid-row: unset;
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
@supports (width: 1cqi) {
|
|
919
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
920
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
921
|
-
border-top-left-radius: 6px;
|
|
922
|
-
border-bottom-left-radius: 6px;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
&[data-separator-multi-button] {
|
|
926
|
-
& [data-expand-up] {
|
|
927
|
-
border-top-left-radius: 6px;
|
|
928
|
-
border-bottom-left-radius: 6px;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
& [data-expand-down] {
|
|
932
|
-
border-bottom-left-radius: unset;
|
|
933
|
-
border-top-left-radius: unset;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
@media (pointer: fine) {
|
|
941
|
-
[data-separator-wrapper][data-separator-multi-button] {
|
|
942
|
-
grid-template-rows: 50% 50%;
|
|
943
|
-
display: grid;
|
|
944
|
-
|
|
945
|
-
& [data-separator-content] {
|
|
946
|
-
grid-area: 1 / 2 / -1;
|
|
947
|
-
min-width: min-content;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
& [data-expand-button] {
|
|
951
|
-
grid-column: 1;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
956
|
-
grid-template-columns: 34px auto;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
960
|
-
grid-template-columns: 100% auto;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
964
|
-
& [data-separator-multi-button] {
|
|
965
|
-
& [data-expand-up] {
|
|
966
|
-
border-bottom: 1px solid var(--diffs-bg);
|
|
967
|
-
border-right: 2px solid var(--diffs-bg);
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
& [data-expand-down] {
|
|
971
|
-
border-top: 1px solid var(--diffs-bg);
|
|
972
|
-
border-right: 2px solid var(--diffs-bg);
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
979
|
-
display: none;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
[data-line-annotation] {
|
|
983
|
-
min-height: var(--diffs-annotation-min-height, 0);
|
|
984
|
-
z-index: 2;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
[data-merge-conflict-actions] {
|
|
988
|
-
z-index: 2;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
[data-separator="custom"] {
|
|
992
|
-
grid-template-columns: subgrid;
|
|
993
|
-
display: grid;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
[data-line], [data-column-number], [data-no-newline] {
|
|
997
|
-
padding-inline: 1ch;
|
|
998
|
-
position: relative;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
[data-indicators="classic"] [data-line] {
|
|
1002
|
-
padding-inline-start: 2ch;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
[data-indicators="classic"] {
|
|
1006
|
-
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1007
|
-
&[data-no-newline], &[data-line] {
|
|
1008
|
-
&:before {
|
|
1009
|
-
user-select: none;
|
|
1010
|
-
width: 1ch;
|
|
1011
|
-
height: 1lh;
|
|
1012
|
-
display: inline-block;
|
|
1013
|
-
position: absolute;
|
|
1014
|
-
top: 0;
|
|
1015
|
-
left: 0;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
& [data-line-type="change-addition"] {
|
|
1021
|
-
&[data-line], &[data-no-newline] {
|
|
1022
|
-
&:before {
|
|
1023
|
-
content: "+";
|
|
1024
|
-
color: var(--diffs-addition-base);
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
& [data-line-type="change-deletion"] {
|
|
1030
|
-
&[data-line], &[data-no-newline] {
|
|
1031
|
-
&:before {
|
|
1032
|
-
content: "-";
|
|
1033
|
-
color: var(--diffs-deletion-base);
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
[data-indicators="bars"] {
|
|
1040
|
-
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1041
|
-
&[data-column-number] {
|
|
1042
|
-
&:before {
|
|
1043
|
-
content: "";
|
|
1044
|
-
user-select: none;
|
|
1045
|
-
contain: strict;
|
|
1046
|
-
width: 4px;
|
|
1047
|
-
height: 100%;
|
|
1048
|
-
display: block;
|
|
1049
|
-
position: absolute;
|
|
1050
|
-
top: 0;
|
|
1051
|
-
left: 0;
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
& [data-line-type="change-deletion"] {
|
|
1057
|
-
&[data-column-number] {
|
|
1058
|
-
&:before {
|
|
1059
|
-
background-image: linear-gradient(0deg,
|
|
1060
|
-
var(--diffs-bg-deletion) 50%,
|
|
1061
|
-
var(--diffs-deletion-base) 50%);
|
|
1062
|
-
background-repeat: repeat;
|
|
1063
|
-
background-size: 2px 2px;
|
|
1064
|
-
background-size: calc(1lh / round(1lh / 2px))
|
|
1065
|
-
calc(1lh / round(1lh / 2px));
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
& [data-line-type="change-addition"] {
|
|
1071
|
-
&[data-column-number] {
|
|
1072
|
-
&:before {
|
|
1073
|
-
background-color: var(--diffs-addition-base);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
[data-overflow="wrap"] {
|
|
1080
|
-
& [data-line] {
|
|
1081
|
-
white-space: pre-wrap;
|
|
1082
|
-
word-break: break-word;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
& [data-annotation-content] {
|
|
1086
|
-
word-break: break-word;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
[data-overflow="scroll"] [data-line] {
|
|
1091
|
-
white-space: pre;
|
|
1092
|
-
min-height: 1lh;
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
[data-column-number] {
|
|
1096
|
-
box-sizing: content-box;
|
|
1097
|
-
text-align: right;
|
|
1098
|
-
user-select: none;
|
|
1099
|
-
color: var(--diffs-fg-number);
|
|
1100
|
-
padding-left: 2ch;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
[data-line-number-content] {
|
|
1104
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1105
|
-
z-index: 1;
|
|
1106
|
-
display: inline-block;
|
|
1107
|
-
position: relative;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
[data-disable-line-numbers] {
|
|
1111
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1112
|
-
min-width: 4px;
|
|
1113
|
-
padding: 0;
|
|
1114
|
-
|
|
1115
|
-
&:before {
|
|
1116
|
-
min-width: 0;
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
& [data-line-number-content] {
|
|
1121
|
-
display: none;
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
& [data-gutter-utility-slot] {
|
|
1125
|
-
right: unset;
|
|
1126
|
-
justify-content: flex-start;
|
|
1127
|
-
left: 0;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1131
|
-
left: 6px;
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
[data-file][data-disable-line-numbers] {
|
|
1136
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1137
|
-
border-right: 0;
|
|
1138
|
-
min-width: 0;
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
[data-diff-span] {
|
|
1143
|
-
box-decoration-break: clone;
|
|
1144
|
-
border-radius: 3px;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
[data-line-type="change-addition"] [data-diff-span] {
|
|
1148
|
-
background-color: var(--diffs-bg-addition-emphasis);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1152
|
-
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1156
|
-
color: var(--diffs-fg);
|
|
1157
|
-
padding-left: 1ch;
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1161
|
-
align-items: center;
|
|
1162
|
-
display: flex;
|
|
1163
|
-
|
|
1164
|
-
&:after {
|
|
1165
|
-
color: var(--diffs-fg-conflict-marker);
|
|
1166
|
-
font-size: .75rem;
|
|
1167
|
-
font-style: normal;
|
|
1168
|
-
line-height: 1.25rem;
|
|
1169
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1170
|
-
padding-left: 1ch;
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
[data-merge-conflict="marker-start"]:after {
|
|
1175
|
-
content: "(Current Change)";
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
[data-merge-conflict="marker-end"]:after {
|
|
1179
|
-
content: "(Incoming Change)";
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
[data-merge-conflict-actions-content] {
|
|
1183
|
-
min-height: 1.75rem;
|
|
1184
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1185
|
-
color: var(--diffs-fg);
|
|
1186
|
-
align-items: center;
|
|
1187
|
-
gap: .25rem;
|
|
1188
|
-
padding-inline: .5rem;
|
|
1189
|
-
font-size: .75rem;
|
|
1190
|
-
line-height: 1.2;
|
|
1191
|
-
display: flex;
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
[data-merge-conflict-action] {
|
|
1195
|
-
appearance: none;
|
|
1196
|
-
color: var(--diffs-fg-number);
|
|
1197
|
-
font: inherit;
|
|
1198
|
-
cursor: pointer;
|
|
1199
|
-
background: none;
|
|
1200
|
-
border: 0;
|
|
1201
|
-
padding: 0;
|
|
1202
|
-
font-style: normal;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
[data-merge-conflict-action]:hover {
|
|
1206
|
-
color: var(--diffs-fg);
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
[data-merge-conflict-action="current"]:hover {
|
|
1210
|
-
color: var(--diffs-addition-base);
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
[data-merge-conflict-action="incoming"]:hover {
|
|
1214
|
-
color: var(--diffs-modified-base);
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
[data-merge-conflict-action-separator] {
|
|
1218
|
-
color: var(--diffs-fg-number);
|
|
1219
|
-
opacity: .6;
|
|
1220
|
-
user-select: none;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
[data-diffs-header="default"] {
|
|
1224
|
-
background-color: var(--diffs-bg);
|
|
1225
|
-
justify-content: space-between;
|
|
1226
|
-
align-items: center;
|
|
1227
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1228
|
-
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1229
|
-
z-index: 2;
|
|
1230
|
-
flex-direction: row;
|
|
1231
|
-
padding-inline: 16px;
|
|
1232
|
-
display: flex;
|
|
1233
|
-
position: relative;
|
|
1234
|
-
top: 0;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
[data-header-content] {
|
|
1238
|
-
align-items: center;
|
|
1239
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1240
|
-
white-space: nowrap;
|
|
1241
|
-
flex-direction: row;
|
|
1242
|
-
min-width: 0;
|
|
1243
|
-
display: flex;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1247
|
-
text-overflow: ellipsis;
|
|
1248
|
-
white-space: nowrap;
|
|
1249
|
-
direction: rtl;
|
|
1250
|
-
min-width: 0;
|
|
1251
|
-
overflow: hidden;
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
[data-prev-name] {
|
|
1255
|
-
opacity: .7;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
[data-rename-icon] {
|
|
1259
|
-
fill: currentColor;
|
|
1260
|
-
flex-grow: 0;
|
|
1261
|
-
flex-shrink: 0;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
[data-diffs-header="default"] [data-metadata] {
|
|
1265
|
-
white-space: nowrap;
|
|
1266
|
-
align-items: center;
|
|
1267
|
-
gap: 1ch;
|
|
1268
|
-
display: flex;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
[data-diffs-header="default"] [data-additions-count] {
|
|
1272
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1273
|
-
color: var(--diffs-addition-base);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
[data-diffs-header="default"] [data-deletions-count] {
|
|
1277
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1278
|
-
color: var(--diffs-deletion-base);
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
[data-change-icon] {
|
|
1282
|
-
fill: currentColor;
|
|
1283
|
-
flex-shrink: 0;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1287
|
-
color: var(--diffs-modified-base);
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
[data-change-icon="new"] {
|
|
1291
|
-
color: var(--diffs-addition-base);
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
[data-change-icon="deleted"] {
|
|
1295
|
-
color: var(--diffs-deletion-base);
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
[data-change-icon="file"] {
|
|
1299
|
-
opacity: .6;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
[data-annotation-content] {
|
|
1303
|
-
z-index: 2;
|
|
1304
|
-
isolation: isolate;
|
|
1305
|
-
white-space: normal;
|
|
1306
|
-
align-self: flex-start;
|
|
1307
|
-
min-width: 0;
|
|
1308
|
-
display: flow-root;
|
|
1309
|
-
position: relative;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1313
|
-
width: var(--diffs-column-content-width, auto);
|
|
1314
|
-
left: var(--diffs-column-number-width, 0);
|
|
1315
|
-
position: sticky;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
[data-annotation-slot] {
|
|
1319
|
-
text-wrap-mode: wrap;
|
|
1320
|
-
word-break: normal;
|
|
1321
|
-
white-space-collapse: collapse;
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
[data-gutter-utility-slot] {
|
|
1325
|
-
touch-action: none;
|
|
1326
|
-
justify-content: flex-end;
|
|
1327
|
-
display: flex;
|
|
1328
|
-
position: absolute;
|
|
1329
|
-
top: 0;
|
|
1330
|
-
bottom: 0;
|
|
1331
|
-
right: 0;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
[data-utility-button] {
|
|
1335
|
-
appearance: none;
|
|
1336
|
-
cursor: pointer;
|
|
1337
|
-
width: 1lh;
|
|
1338
|
-
height: 1lh;
|
|
1339
|
-
font-size: var(--diffs-font-size, 13px);
|
|
1340
|
-
line-height: var(--diffs-line-height, 20px);
|
|
1341
|
-
background-color: var(--diffs-modified-base);
|
|
1342
|
-
color: var(--diffs-bg);
|
|
1343
|
-
fill: currentColor;
|
|
1344
|
-
z-index: 4;
|
|
1345
|
-
touch-action: none;
|
|
1346
|
-
border: none;
|
|
1347
|
-
border-radius: 4px;
|
|
1348
|
-
justify-content: center;
|
|
1349
|
-
align-items: center;
|
|
1350
|
-
margin-right: calc(-1lh + 1ch);
|
|
1351
|
-
padding: 0;
|
|
1352
|
-
display: flex;
|
|
1353
|
-
position: relative;
|
|
1354
|
-
|
|
1355
|
-
&:before {
|
|
1356
|
-
content: "";
|
|
1357
|
-
display: block;
|
|
1358
|
-
position: absolute;
|
|
1359
|
-
inset: 0 0 0 -4px;
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
[data-decoration-bar-stack] {
|
|
1364
|
-
pointer-events: none;
|
|
1365
|
-
isolation: isolate;
|
|
1366
|
-
z-index: 1;
|
|
1367
|
-
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1368
|
-
box-sizing: content-box;
|
|
1369
|
-
border-left: 2px solid var(--diffs-bg);
|
|
1370
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1371
|
-
width: 6px;
|
|
1372
|
-
position: absolute;
|
|
1373
|
-
top: 0;
|
|
1374
|
-
bottom: 0;
|
|
1375
|
-
right: -2px;
|
|
1376
|
-
|
|
1377
|
-
[data-decoration-bar-depth="1"] & {
|
|
1378
|
-
background-color: color-mix(in lab,
|
|
1379
|
-
var(--diffs-bg) 20%,
|
|
1380
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
[data-decoration-bar-depth="2"] & {
|
|
1384
|
-
background-color: color-mix(in lab,
|
|
1385
|
-
var(--diffs-bg) 45%,
|
|
1386
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
[data-decoration-bar-depth="3"] & {
|
|
1390
|
-
background-color: color-mix(in lab,
|
|
1391
|
-
var(--diffs-bg) 65%,
|
|
1392
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
[data-decoration-bar-start] & {
|
|
1396
|
-
border-top-left-radius: 5px;
|
|
1397
|
-
border-top-right-radius: 5px;
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
[data-decoration-bar-end] & {
|
|
1401
|
-
z-index: 3;
|
|
1402
|
-
border-bottom-right-radius: 5px;
|
|
1403
|
-
border-bottom-left-radius: 5px;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
[data-placeholder] {
|
|
1408
|
-
contain: strict;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
[data-error-wrapper] {
|
|
1412
|
-
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1413
|
-
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1414
|
-
scrollbar-width: none;
|
|
1415
|
-
max-height: 400px;
|
|
1416
|
-
overflow: auto;
|
|
1417
|
-
|
|
1418
|
-
& [data-error-message] {
|
|
1419
|
-
color: var(--diffs-deletion-base);
|
|
1420
|
-
font-size: 18px;
|
|
1421
|
-
font-weight: bold;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
& [data-error-stack] {
|
|
1425
|
-
color: var(--diffs-fg-number);
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
@layer theme, rendered, unsafe;
|
|
1431
|
-
`,dd;function fd(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return dd??=(()=>{let e=new CSSStyleSheet;return e.replaceSync(ud),e})(),t.adoptedStyleSheets.includes(dd)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,dd]),t}function pd(e,t){return e.reviewed.has(t.sha)?`reviewed`:e.changedSinceReviewed.has(t.path)?`changed`:`unreviewed`}var md=U({__name:`ReviewCheckbox`,props:{status:{},ariaLabel:{}},emits:[`update`],setup(e,{emit:t}){let n=e,r=t,i=E(()=>n.status===`reviewed`||n.status!==`unreviewed`&&`indeterminate`),a=E(()=>n.status===`changed`?`data-[state=indeterminate]:border-orange-500 data-[state=indeterminate]:bg-orange-500 focus-visible:ring-orange-500/40`:`data-[state=checked]:border-primary-500 data-[state=indeterminate]:border-primary-500 data-[state=checked]:bg-primary-500 data-[state=indeterminate]:bg-primary-500 focus-visible:ring-primary-500/40`);return(t,n)=>(c(),f(B(pt),{class:w([`h-4 w-4 flex shrink-0 items-center justify-center border border-base rounded bg-raised outline-none transition focus-visible:ring-2`,a.value]),"model-value":i.value,"aria-label":e.ariaLabel,"onUpdate:modelValue":n[0]||=e=>r(`update`,e===!0)},{default:G(()=>[W(B(jt),{class:`text-white`},{default:G(()=>[s(`div`,{class:w([i.value===`indeterminate`?`i-ph:minus-bold`:`i-ph:check-bold`,`mt--1px text-micro`]),"aria-hidden":`true`},null,2)]),_:1})]),_:1},8,[`class`,`model-value`,`aria-label`]))}}),hd={class:`flex flex-col gap-1.5 px-3 py-2 text-sm`},gd={class:`flex items-center gap-2`},_d={class:`font-medium`},vd={key:0,class:`flex flex-col gap-2`},yd={class:`flex justify-end gap-2`},bd=U({__name:`ReviewCommentCard`,props:{comment:{},isViewer:{type:Boolean},busy:{type:Boolean}},emits:[`edit`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=p(!1),a=p(``);function o(){a.value=n.comment.body,i.value=!0}function l(){a.value.trim()&&(r(`edit`,a.value),i.value=!1)}return(t,n)=>(c(),u(`article`,hd,[s(`header`,gd,[e.comment.author?(c(),f(un,{key:0,login:e.comment.author.login,"avatar-url":e.comment.author.avatarUrl,size:18},null,8,[`login`,`avatar-url`])):V(``,!0),s(`span`,_d,L(e.comment.author?.login??`ghost`),1),W(vt,{date:e.comment.createdAt,class:`text-xs op-fade`},null,8,[`date`]),e.comment.pending?(c(),f(lt,{key:1,text:t.$t(`review.pending`),class:`text-xs text-amber-700 dark:text-amber-400`},null,8,[`text`])):V(``,!0),n[3]||=s(`div`,{class:`flex-auto`},null,-1),e.isViewer&&!i.value?(c(),u(y,{key:2},[W(J,{compact:``,icon:`i-ph:pencil-simple-duotone`,label:t.$t(`review.editComment`),disabled:e.busy,onClick:o},null,8,[`label`,`disabled`]),W(J,{compact:``,icon:`i-ph:trash-duotone`,label:t.$t(`review.deleteComment`),disabled:e.busy,onClick:n[0]||=e=>r(`delete`)},null,8,[`label`,`disabled`])],64)):V(``,!0)]),i.value?(c(),u(`div`,vd,[W(Zu,{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e,rows:3,disabled:e.busy,onKeydown:[K(ue(l,[`meta`]),[`enter`]),K(ue(l,[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`disabled`,`onKeydown`]),s(`div`,yd,[W(q,{size:`sm`,variant:`text`,disabled:e.busy,onClick:n[2]||=e=>i.value=!1},{default:G(()=>[P(L(t.$t(`common.cancel`)),1)]),_:1},8,[`disabled`]),W(q,{size:`sm`,variant:`primary`,disabled:e.busy||!a.value.trim(),onClick:l},{default:G(()=>[P(L(t.$t(`common.save`)),1)]),_:1},8,[`disabled`])])])):(c(),f(m,{key:1},{default:G(()=>[W(B(zt),{value:e.comment.body,class:`review-comment-markdown text-sm`},null,8,[`value`])]),_:1}))]))}}),xd={class:`my-1 max-w-200 overflow-hidden border border-base rounded-lg bg-base text-left font-sans`},Sd={class:`divide-y divide-#9992`},Cd={key:0,class:`px-3 pb-1 text-xs text-red-600 dark:text-red-400`},wd={key:1,class:`flex flex-col gap-2 border-t border-base bg-raised px-2 py-1.5`},Td={class:`flex justify-end gap-2`},Ed={key:1,class:`flex items-center gap-2`},Dd={key:1,class:`flex-1`},Od=U({__name:`ReviewThreadCard`,props:{thread:{},reviews:{}},setup(e){let t=e,n=p(!1),r=p(),i=p(!1),a=p(``),o=E(()=>t.reviews.canWrite),l=E(()=>o.value&&!!t.thread.threadId&&!t.thread.pending);async function m(e){n.value=!0,r.value=void 0;try{await e()}catch(e){r.value=e instanceof Error?e.message:String(e)}finally{n.value=!1}}async function h(){let e=a.value;e.trim()&&await m(async()=>{await t.reviews.reply(t.thread.rootId,e),a.value=``,i.value=!1})}return(t,p)=>(c(),u(`div`,xd,[s(`div`,Sd,[(c(!0),u(y,null,d(e.thread.comments,t=>(c(),f(bd,{key:t.id,comment:t,"is-viewer":!!t.author&&t.author.login===e.reviews.viewerLogin,busy:n.value,onEdit:n=>m(()=>e.reviews.editComment(t.id,n)),onDelete:n=>m(()=>e.reviews.deleteComment(t.id))},null,8,[`comment`,`is-viewer`,`busy`,`onEdit`,`onDelete`]))),128))]),r.value?(c(),u(`p`,Cd,L(r.value),1)):V(``,!0),o.value?(c(),u(`footer`,wd,[i.value?(c(),u(y,{key:0},[W(Zu,{modelValue:a.value,"onUpdate:modelValue":p[0]||=e=>a.value=e,rows:2,placeholder:t.$t(`review.replyPlaceholder`),disabled:n.value,onKeydown:[K(ue(h,[`meta`]),[`enter`]),K(ue(h,[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`]),s(`div`,Td,[W(q,{size:`sm`,variant:`text`,disabled:n.value,onClick:p[1]||=e=>i.value=!1},{default:G(()=>[P(L(t.$t(`common.cancel`)),1)]),_:1},8,[`disabled`]),W(q,{size:`sm`,variant:`primary`,loading:n.value,disabled:!a.value.trim(),onClick:h},{default:G(()=>[P(L(t.$t(`common.reply`)),1)]),_:1},8,[`loading`,`disabled`])])],64)):(c(),u(`div`,Ed,[e.thread.pending?(c(),u(`div`,Dd)):(c(),u(`button`,{key:0,type:`button`,class:`flex-1 border border-base rounded bg-base px-2 py-1 text-left text-sm color-base op-fade hover:op-100`,onClick:p[2]||=e=>i.value=!0},L(t.$t(`review.replyPlaceholder`)),1)),l.value?(c(),f(q,{key:2,size:`sm`,disabled:n.value,icon:`i-ph:check-circle-duotone`,onClick:p[3]||=t=>m(()=>e.reviews.resolveThread(e.thread.threadId))},{default:G(()=>[P(L(t.$t(`review.resolve`)),1)]),_:1},8,[`disabled`])):V(``,!0)]))])):V(``,!0)]))}}),kd={class:`sticky top-[calc(var(--diffs-header-height)-1px)] z-file-diff-header mt-2 bg-base`},Ad=[`id`],jd={class:`min-w-0 flex items-center gap-2 text-sm`},Md={class:`flex shrink-0 items-center gap-2`},Nd={key:0,class:`text-xs op-fade`},Pd={key:2,class:`text-xs op-fade`},Fd=[`title`],Id={key:0,class:`overflow-hidden border-x border-b border-base rounded-b-xl`},Ld={key:0,class:`flex flex-wrap items-center justify-between gap-2 border-b border-orange:20 bg-orange:10 px-3 py-1.5 text-sm text-orange-700 dark:text-orange-400`},Rd={class:`flex items-center gap-1.5`},zd={key:1,class:`mb-2 flex flex-col border-b border-base`},Bd={key:2,class:`p-4 text-sm op-fade`},Vd={key:3,class:`p-4 text-sm op-fade`},Hd=[`slot`],Ud={key:0,class:`my-1 max-w-200 overflow-hidden border border-base rounded-lg bg-base`},Wd=640,Gd=U({__name:`FileDiff`,props:{store:{},file:{},notes:{}},setup(e,{expose:t}){let n=e,r=E(()=>pd(n.store,n.file)),i=E(()=>r.value===`reviewed`),a=E(()=>pu(n.notes)),o=E(()=>n.notes?.filter(e=>!e.anchor)??[]),m=C(gt,mt),g=C(Ql,void 0),_=F(`container`),v=C(nd,()=>D(new Map),!0),b=E({get:()=>v.get(n.file.sha)??(i.value||ld(n.file.path)),set:e=>v.set(n.file.sha,e)}),x,S=p(),T=p(),O=p(!1),k=p(),A=E(()=>S.value!==void 0||T.value!==void 0),j=E(()=>!!n.store.fileContent&&!n.file.isBinary&&!A.value);async function M(){let{fileContent:e}=n.store;if(!(!e||O.value||A.value)){O.value=!0,k.value=void 0;try{let t=await e.load(n.file);S.value=t.old,T.value=t.new}catch(e){k.value=e instanceof Error?e:Error(String(e))}finally{O.value=!1}}}function ee(e){for(let t of e.composedPath()){if(!(t instanceof HTMLElement)||!t.hasAttribute(`data-expand-button`)&&!t.hasAttribute(`data-unmodified-lines`))continue;let n=Number(t.getAttribute(`data-expand-index`));if(Number.isNaN(n))return;let r=t.hasAttribute(`data-expand-up`)?`up`:t.hasAttribute(`data-expand-down`)?`down`:`both`;return{index:n,direction:t.hasAttribute(`data-expand-all-button`)||e.shiftKey?`both`:r}}}async function N(e){if(!j.value)return;let t=ee(e);t&&(await M(),A.value&&(await R(),x?.expandHunk(t.index,t.direction,t.direction===`both`?1/0:void 0)))}let ne=E(()=>{if(!(b.value||n.file.isBinary))return id(n.file,A.value?{old:S.value,new:T.value}:void 0)}),re=p(!1),{stop:ie}=te(_,([e])=>{re.value=!!e?.isIntersecting},{rootMargin:`600px 0px`});I([re,Et],([e,t])=>{e&&t&&(ie(),j.value&&ad(n.file)&&M())});let z=p(0),B;I(_,(e,t)=>{t&&B?.unobserve(t),e&&(B??=new ResizeObserver(e=>{z.value=e[0]?.contentRect.width??0}),B.observe(e))},{immediate:!0}),h(()=>B?.disconnect());let ae=E(()=>n.store.reviews),oe=E(()=>{let e=ae.value;return e?e.threads.filter(t=>t.path===n.file.path&&t.line!==void 0&&!t.outdated&&t.resolved!==!0&&(e.showThreads||t.pending)):[]}),se=E(()=>ae.value?.threads.filter(e=>e.path===n.file.path&&e.resolved===!0).length??0),H=p(),U=p(!1),ce=p(),le=E(()=>{let e=new Map;function t(t,n){let r=`${t}-${n}`,i=e.get(r);return i||(i={side:t,line:n,notes:[],threads:[],hasDraft:!1},e.set(r,i)),i}for(let e of n.notes??[])e.anchor&&t(e.anchor.side,e.anchor.line).notes.push(e);for(let e of oe.value)t(e.side,e.line).threads.push(e);return H.value&&(t(H.value.side,H.value.line).hasDraft=!0),[...e.values()]}),K=E(()=>le.value.map(e=>({side:e.side,lineNumber:e.line}))),de=E(()=>(ae.value?.canWrite??!1)&&!n.file.isBinary);function fe(e){let t=e.endSide??e.side??`additions`,r=Math.max(e.start,e.end),i=Math.min(e.start,e.end);H.value={path:n.file.path,side:t,line:r,...i<r?{startLine:i,startSide:e.side??t}:{}},ce.value=void 0}async function pe(e,t){let n=H.value,r=ae.value;if(n&&r){U.value=!0,ce.value=void 0;try{await r.addComment(n,e,t),H.value=void 0}catch(e){ce.value=e instanceof Error?e.message:String(e)}finally{U.value=!1}}}let me=E(()=>n.file.additions===0||n.file.deletions===0),he=E(()=>n.store.ui.layout===`unified`||me.value||z.value>0&&z.value<Wd?`unified`:n.store.ui.layout),ge=E(()=>({diffStyle:he.value,overflow:xt.value?`wrap`:`scroll`,theme:{...Nt.value},themeType:m.value?`dark`:`light`,disableErrorHandling:!1,disableFileHeader:!0,...de.value?{enableGutterUtility:!0,enableLineSelection:!0,onGutterUtilityClick:fe}:{}}));function _e(){x?.cleanUp(),_.value&&!n.file.isBinary&&!b.value&&ne.value&&(fd(_.value).addEventListener(`click`,N),x=g?new Cl(ge.value,g,void 0,void 0,!0):new ll(ge.value,void 0,!0),x.render({fileDiff:ne.value,fileContainer:_.value,lineAnnotations:K.value.map(e=>({...e}))}))}return l(_e),h(()=>x?.cleanUp()),I(b,()=>_e(),{flush:`post`}),I(ge,e=>{x?.setOptions(e),x?.rerender()}),I([ne,_],([e,t])=>{e&&t&&x?.render({fileDiff:e,fileContainer:t,lineAnnotations:K.value.map(e=>({...e}))})}),I(K,e=>{x?.setLineAnnotations(e.map(e=>({...e}))),x?.rerender()}),I(i,e=>{b.value=e}),t({expand:()=>{b.value=!1}}),(t,n)=>(c(),u(y,null,[s(`div`,kd,[s(`header`,{id:`file-${e.file.sha}`,class:w([`relative flex items-center justify-between gap-2 overflow-hidden border border-base bg-base px-2 py-1.5`,b.value?`rounded-lg`:`rounded-t-lg`]),role:`button`,onClick:n[2]||=ue(e=>b.value=!b.value,[`self`])},[s(`div`,jd,[W(md,{status:r.value,"aria-label":t.$t(`file.markReviewed`),onUpdate:n[0]||=t=>e.store.setReviewed([e.file.sha],t)},null,8,[`status`,`aria-label`]),W(qu,{path:e.file.path,class:`min-w-0`},null,8,[`path`]),a.value?(c(),f(uu,{key:0})):V(``,!0)]),s(`div`,Md,[se.value?(c(),u(`span`,Nd,L(t.$t(`file.resolved`,{n:se.value})),1)):V(``,!0),e.file.isBinary?(c(),u(`span`,Pd,L(t.$t(`file.binary`)),1)):(c(),f(ln,{key:1,additions:e.file.additions,deletions:e.file.deletions},null,8,[`additions`,`deletions`])),W(sd,{status:e.file.status},null,8,[`status`]),k.value?(c(),u(`span`,{key:3,class:`text-xs text-red-500`,title:k.value.message},L(t.$t(`file.loadFailed`)),9,Fd)):V(``,!0),j.value||O.value?(c(),f(J,{key:4,compact:``,icon:O.value?`i-ph:spinner-duotone animate-spin`:`i-ph:file-text-duotone`,disabled:O.value,label:t.$t(`file.loadFull`),tooltip:t.$t(`file.loadFull`),onClick:M},null,8,[`icon`,`disabled`,`label`,`tooltip`])):V(``,!0),W(J,{compact:``,icon:b.value?`i-ph:caret-right`:`i-ph:caret-down`,label:t.$t(b.value?`file.expand`:`file.collapse`),onClick:n[1]||=e=>b.value=!b.value},null,8,[`icon`,`label`])])],10,Ad)]),b.value?V(``,!0):(c(),u(`div`,Id,[r.value===`changed`?(c(),u(`div`,Ld,[s(`span`,Rd,[n[5]||=s(`span`,{class:`i-ph:warning-circle-duotone shrink-0`,"aria-hidden":`true`},null,-1),P(` `+L(t.$t(`file.changedSinceReviewed`)),1)]),W(q,{size:`sm`,onClick:n[3]||=t=>e.store.setReviewed([e.file.sha],!0)},{default:G(()=>[P(L(t.$t(`file.markReviewed`)),1)]),_:1})])):V(``,!0),o.value.length?(c(),u(`div`,zd,[(c(!0),u(y,null,d(o.value,(e,t)=>(c(),f(Yu,{key:t,note:e,borderless:!0},null,8,[`note`]))),128))])):V(``,!0),e.file.isBinary?(c(),u(`div`,Bd,L(t.$t(`file.binaryNotShown`)),1)):e.file.truncated&&!A.value?(c(),u(`div`,Vd,L(t.$t(`file.tooLarge`)),1)):(c(),u(`div`,{key:4,ref:`container`,class:w(r.value===`changed`?`mb--2`:`my--2`)},[(c(!0),u(y,null,d(le.value,t=>(c(),u(`div`,{key:`${t.side}-${t.line}`,slot:`annotation-${t.side}-${t.line}`,"data-annotation-slot":``,class:`whitespace-normal px-2 text-left font-sans`},[(c(!0),u(y,null,d(t.notes,(e,t)=>(c(),f(Yu,{key:t,note:e},null,8,[`note`]))),128)),(c(!0),u(y,null,d(t.threads,t=>(c(),f(Od,{key:t.rootId,thread:t,reviews:e.store.reviews},null,8,[`thread`,`reviews`]))),128)),t.hasDraft?(c(),u(`div`,Ud,[W(td,{"has-pending-review":!!e.store.reviews.pendingReview,busy:U.value,error:ce.value,onSubmit:pe,onCancel:n[4]||=e=>H.value=void 0},null,8,[`has-pending-review`,`busy`,`error`])])):V(``,!0)],8,Hd))),128))],2))]))],64))}});function Kd(e,t,n){let r=[...e.map(e=>({path:e.path,file:e})),...t.map(e=>({path:e,file:void 0}))];if(n===`list`)return r.map(({path:e,file:t})=>t?{key:`file:${e}`,depth:0,type:`file`,name:e,file:t}:{key:`missing:${e}`,depth:0,type:`missing`,name:e});let i={name:``,children:new Map};for(let{path:e,file:t}of r){let n=e.split(`/`),r=i;for(let e=0;e<n.length-1;e++){let t=n[e],i=r.children.get(t);i||(i={name:t,children:new Map},r.children.set(t,i)),r=i}r.children.set(`\0file:${e}`,{name:n[n.length-1],children:new Map,file:t,missing:!t})}function a(e){let t=[];for(let n of e.children.values())t.push(...n.file?[n.file]:a(n));return t}let o=[];function s(e,t,n){for(let[r,i]of e.children){if(i.file){o.push({key:`file:${i.file.path}`,depth:t,type:`file`,name:i.name,file:i.file});continue}if(i.missing){o.push({key:`missing:${n}${i.name}`,depth:t,type:`missing`,name:i.name});continue}let e=i.name,c=i,l=`${n}${r}/`;for(;c.children.size===1;){let[t,n]=[...c.children.entries()][0];if(n.file||n.missing)break;e+=`/${n.name}`,c=n,l+=`${t}/`}o.push({key:`folder:${l}`,depth:t,type:`folder`,name:e,files:a(c)}),s(c,t+1,l)}}return s(i,0,``),o}var qd={ref:`scrollEl`,class:`overflow-auto`},Jd={class:`truncate op-fade`},Yd=[`title`,`onClick`],Xd=[`title`],Zd={class:`shrink-0 text-xs`},Qd=U({__name:`FileTree`,props:{store:{},files:{},notes:{},missing:{},filesVisible:{},layout:{}},emits:[`navigate`],setup(e,{emit:t}){let n=e,r=t,i=E(()=>Kd(n.files,n.missing??[],n.layout));function a(e){let t=e.filter(e=>n.store.reviewed.has(e.sha)).length;return t===0?`unreviewed`:t===e.length?`reviewed`:`partial`}let o=F(`scrollEl`),l=We(E(()=>({count:i.value.length,getScrollElement:()=>o.value,estimateSize:()=>24,overscan:10})));return(t,n)=>(c(),u(`div`,qd,[s(`div`,{style:_({height:`${B(l).getTotalSize()}px`,position:`relative`})},[(c(!0),u(y,null,d(B(l).getVirtualItems().map(e=>({item:e,row:i.value[e.index]})),i=>(c(),u(`div`,{key:i.row.key,class:w([`flex items-center gap-1.5 rounded text-sm`,i.row.file&&e.filesVisible.includes(i.row.file.sha)?`bg-active`:``]),style:_({position:`absolute`,top:0,left:0,width:`100%`,height:`${i.item.size}px`,transform:`translateY(${i.item.start}px)`,paddingLeft:`${.5+i.row.depth}em`})},[i.row.type===`folder`?(c(),u(y,{key:0},[W(md,{status:a(i.row.files),"aria-label":t.$t(`file.markFolderReviewed`,{name:i.row.name}),onUpdate:t=>e.store.setReviewed(i.row.files.map(e=>e.sha),t)},null,8,[`status`,`aria-label`,`onUpdate`]),W(on,{directory:``,path:i.row.name,class:`op-fade`},null,8,[`path`]),s(`span`,Jd,L(i.row.name),1)],64)):i.row.file?(c(),u(y,{key:1},[W(md,{status:B(pd)(e.store,i.row.file),"aria-label":t.$t(`file.markReviewed`),onUpdate:t=>e.store.setReviewed([i.row.file.sha],t)},null,8,[`status`,`aria-label`,`onUpdate`]),s(`button`,{type:`button`,class:`min-w-0 flex flex-1 items-center gap-1.5 text-left`,title:B(pd)(e.store,i.row.file)===`changed`?t.$t(`file.changedSinceReviewed`):void 0,onClick:e=>r(`navigate`,i.row.file.sha)},[W(qu,{path:i.row.name,dim:e.layout===`list`,class:`min-w-0 flex-1`},null,8,[`path`,`dim`]),B(pu)(e.notes?.get(i.row.file.sha))?(c(),f(uu,{key:0,class:`text-sm`})):V(``,!0),W(ln,{additions:i.row.file.additions,deletions:i.row.file.deletions},null,8,[`additions`,`deletions`]),W(sd,{status:i.row.file.status},null,8,[`status`])],8,Yd)],64)):i.row.type===`missing`?(c(),u(y,{key:2},[n[0]||=s(`span`,{class:`w-4 shrink-0`,"aria-hidden":`true`},null,-1),s(`span`,{class:`min-w-0 flex flex-1 items-center gap-1.5 op-50`,title:t.$t(`file.noLongerInDiff`)},[W(qu,{path:i.row.name,dim:e.layout===`list`,class:`min-w-0 flex-1 line-through`},null,8,[`path`,`dim`]),s(`span`,Zd,L(t.$t(`file.removed`)),1)],8,Xd)],64)):V(``,!0)],6))),128))],4)],512))}}),$d=[`id`],ef={key:0,class:`flex flex-col gap-2 border-b border-base p-3`},tf={class:`w-full flex items-center`},nf=[`aria-expanded`],rf={class:`min-w-0 flex flex-1 flex-col gap-1.5`},af={class:`flex items-center gap-2 leading-1em`},of=[`title`],sf={class:`flex items-center gap-2 leading-1em`},cf={class:`text-xs op-fade`},lf={class:`text-xs op-fade`},uf={key:0,class:`flex shrink-0 items-center gap-1 px-2`},df={key:0,class:`w-full flex flex-col bg-base`},ff={class:`w-full flex items-center`},pf=[`aria-expanded`],mf={class:`min-w-0 flex-1`},hf={class:`flex items-center gap-2 leading-1em`},gf=[`title`],_f=[`title`],vf={class:`flex items-center gap-2 leading-1em`},yf={class:`text-xs op-fade`},bf={key:0,class:`flex shrink-0 items-center gap-1 px-2`},xf={class:`relative min-w-0 flex flex-col`},Sf=[`aria-label`,`title`],Cf=[`data-file-start`],wf={key:2,class:`flex flex-col gap-4`},Tf=U({__name:`DiffGroup`,props:{store:{},group:{},collapsed:{type:Boolean},parentLabel:{},parentKey:{},filesVisible:{}},emits:[`toggle`],setup(e,{emit:t}){let n=e,r=t,i=E(()=>gu(n.group)),a=E(()=>_u(n.group)),o=E(()=>yu(n.group)),l=E(()=>o.value.added),h=E(()=>o.value.deleted),g=E(()=>[...n.group.files,...n.group.children.flatMap(e=>e.files)].filter(e=>n.store.reviewed.has(e.sha)).length),v=p(new Set);function b(e){let t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}let x=p(),S=p(),C=ru(x,S,()=>n.group.label,14,20),T=E(()=>!n.parentLabel&&n.group.children.length>0),D=new Map;function O(e,t){t?D.set(e,t.$el):D.delete(e)}function k(e){D.get(e)?.scrollIntoView({behavior:Pt.value,block:`start`})}function A(){n.parentKey&&document.getElementById(`group-${n.parentKey}`)?.scrollIntoView({behavior:Pt.value,block:`start`})}let M=E(()=>i.value===0?1:g.value/i.value),ee=E(()=>ou.value?{"--group-aside-cols":`min(${ou.value}px, ${au*100}%) minmax(0, 1fr)`}:void 0),N=p(),P=p(),{resizing:te,onPointerDown:F}=Kl({target:()=>P.value,width:ou,min:280,max:()=>{let e=N.value,{paddingLeft:t,paddingRight:n}=getComputedStyle(e);return(e.clientWidth-Number.parseFloat(t)-Number.parseFloat(n))*au}}),I=new Map;function ne(e,t){t?I.set(e,t):I.delete(e)}function re(e){I.get(e)?.expand(),R(()=>{tu(document,e)})}return(t,n)=>(c(),u(`section`,{id:`group-${e.group.key}`,class:`scroll-mt-[var(--diffs-header-height)]`},[T.value?(c(),u(`header`,ef,[s(`div`,tf,[s(`button`,{type:`button`,class:`min-w-0 flex flex-1 items-start px-2 py-1 text-left`,"aria-expanded":!e.collapsed,onClick:n[0]||=e=>r(`toggle`)},[W(J,{compact:``,class:`ml--5 py2 op-mute hover:op-100`,icon:e.collapsed?`i-ph:caret-right`:`i-ph:caret-down`,label:t.$t(`group.toggle`),as:`span`},null,8,[`icon`,`label`]),s(`div`,rf,[s(`div`,af,[W(rn,{category:e.group.category,class:`text-xl`},null,8,[`category`]),s(`span`,{class:`truncate text-2xl font-medium leading-1em`,title:e.group.label},L(e.group.label),9,of),a.value?(c(),f(uu,{key:0,class:`text-xl`})):V(``,!0)]),s(`div`,sf,[W(ln,{additions:l.value,deletions:h.value},null,8,[`additions`,`deletions`]),s(`span`,cf,L(t.$t(`common.files`,{n:i.value},i.value)),1),s(`span`,lf,L(t.$t(`common.subgroups`,{n:e.group.children.length},e.group.children.length)),1),W(Xt,{value:M.value,size:12,thickness:2.5},null,8,[`value`])])])],8,nf),t.$slots.actions?(c(),u(`div`,uf,[j(t.$slots,`actions`)])):V(``,!0)]),e.collapsed?V(``,!0):(c(),u(y,{key:0},[e.group.summary?(c(),f(m,{key:0},{default:G(()=>[W(B(zt),{value:e.group.summary,class:`max-w-200 px-2 text-sm op-fade`},null,8,[`value`])]),_:1})):V(``,!0),B(Yl)?V(``,!0):(c(),f(Nu,{key:1,class:`px-2`,groups:e.group.children.map(e=>({...e,children:[]})),"groups-visable":[],reviewed:e.store.reviewed,onSelect:k},null,8,[`groups`,`reviewed`]))],64))])):V(``,!0),!T.value||!e.collapsed&&e.group.files.length?(c(),u(`div`,{key:1,ref_key:`rowEl`,ref:N,class:`flex flex-col gap-4 p-3 lg:grid lg:grid-cols-[var(--group-aside-cols,1fr_4fr)]`,style:_(ee.value)},[s(`aside`,{ref_key:`asideEl`,ref:P,class:`top-[calc(var(--diffs-header-height)+10px)] min-w-70 flex shrink-0 flex-col gap-3 lg:sticky lg:max-h-[calc(100vh-var(--diffs-header-height)-20px)] lg:self-start`},[T.value?V(``,!0):(c(),u(`header`,df,[e.parentLabel?(c(),u(`button`,{key:0,type:`button`,class:`self-start truncate pb1 pl2 text-xs leading-1em op-fade hover:op-100`,onClick:A},L(e.parentLabel)+` › `,1)):V(``,!0),s(`div`,ff,[s(`button`,{type:`button`,class:`min-w-0 flex flex-1 items-start px-2 py-1 text-left text-sm`,"aria-expanded":!e.collapsed,onClick:n[1]||=e=>r(`toggle`)},[W(J,{compact:``,class:`ml--5 py1.5 op-mute hover:op-100`,icon:e.collapsed?`i-ph:caret-right`:`i-ph:caret-down`,label:t.$t(`group.toggle`),as:`span`},null,8,[`icon`,`label`]),s(`div`,mf,[s(`div`,hf,[W(rn,{category:e.group.category,class:`text-base`},null,8,[`category`]),s(`span`,{ref_key:`labelBox`,ref:x,class:`min-w-0 flex-1 truncate text-xl font-medium`,style:_({fontSize:`${B(C)}px`}),title:e.group.label},[s(`span`,{ref_key:`labelText`,ref:S},L(e.group.label),513)],12,gf),a.value?(c(),f(uu,{key:0,class:`text-base`})):V(``,!0),s(`div`,{class:`flex shrink-0 items-center`,title:t.$t(`group.filesReviewed`,{reviewed:g.value,total:i.value})},null,8,_f)]),s(`div`,vf,[W(ln,{additions:l.value,deletions:h.value},null,8,[`additions`,`deletions`]),s(`span`,yf,L(t.$t(`common.files`,{n:i.value},i.value)),1),W(Xt,{value:M.value,size:12,thickness:2.5},null,8,[`value`])])])],8,pf),t.$slots.actions?(c(),u(`div`,bf,[j(t.$slots,`actions`)])):V(``,!0)])])),e.collapsed?V(``,!0):(c(),u(y,{key:1},[e.group.summary&&!T.value?(c(),f(m,{key:0},{default:G(()=>[W(B(zt),{value:e.group.summary,class:`border-b border-base pb-2 pl2 text-sm op-fade`},null,8,[`value`])]),_:1})):V(``,!0),W(Qd,{class:`min-h-0 flex-1`,store:e.store,files:e.group.files,notes:e.group.notes,missing:e.group.missing,"files-visible":e.filesVisible,layout:B(iu),onNavigate:re},null,8,[`store`,`files`,`notes`,`missing`,`files-visible`,`layout`])],64))],512),s(`div`,xf,[e.collapsed?V(``,!0):(c(),u(`div`,{key:0,role:`separator`,"aria-orientation":`vertical`,"aria-label":t.$t(`group.resize`),title:t.$t(`group.resize`),class:`group/resize absolute inset-y-0 right-full hidden w-4 cursor-col-resize touch-none justify-center lg:flex`,onPointerdown:n[2]||=(...e)=>B(F)&&B(F)(...e),onDblclick:n[3]||=e=>ou.value=null},[s(`div`,{class:w([`w-px transition-colors`,B(te)?`bg-primary-500`:`group-hover/resize:bg-primary-500`])},null,2)],40,Sf)),e.collapsed?V(``,!0):(c(!0),u(y,{key:1},d(e.group.files,t=>(c(),u(y,{key:t.sha},[s(`div`,{"data-file-start":t.sha,class:`scroll-mt-[var(--diffs-header-height)]`},null,8,Cf),W(Gd,{ref_for:!0,ref:e=>ne(t.sha,e),store:e.store,file:t,notes:e.group.notes.get(t.sha)},null,8,[`store`,`file`,`notes`])],64))),128))])],4)):V(``,!0),T.value&&!e.collapsed?(c(),u(`div`,wf,[(c(!0),u(y,null,d(e.group.children,t=>(c(),f(Tf,{key:t.key,ref_for:!0,ref:e=>O(t.key,e),store:e.store,group:{...t,children:[]},collapsed:v.value.has(t.key),"parent-label":e.group.label,"parent-key":e.group.key,"files-visible":e.filesVisible,onToggle:e=>b(t.key)},null,8,[`store`,`group`,`collapsed`,`parent-label`,`parent-key`,`files-visible`,`onToggle`]))),128))])):V(``,!0)],8,$d))}}),Ef={class:`flex flex-col gap-0.5 text-sm`},Df=[`aria-current`],Of=[`onClick`],kf={class:`w-full flex items-center gap-1.5`},Af=[`title`],jf={class:`ml-6 flex items-center gap-1 text-xs`},Mf={class:`op-mute`},Nf=U({__name:`DiffGroupSidebar`,props:{groups:{},groupsVisable:{},reviewed:{},hasDescription:{type:Boolean},descriptionVisible:{type:Boolean}},emits:[`select`,`selectDescription`],setup(e){let t=e,n=p(new Set);function r(e){let t=new Set(n.value);t.has(e)?t.delete(e):t.add(e),n.value=t}let i=E(()=>t.groups.flatMap(e=>[{group:e,depth:0},...n.value.has(e.key)?[]:e.children.map(e=>({group:{...e,children:[]},depth:1}))]));return(t,a)=>(c(),u(`nav`,Ef,[e.hasDescription?(c(),u(`button`,{key:0,type:`button`,class:w([`mt-1 flex items-center gap-1.5 rounded px-2 py-1 text-left color-base transition-colors`,e.descriptionVisible?`bg-active`:`op-fade hover:op-100 hover:bg-hover`]),"aria-current":e.descriptionVisible?`location`:void 0,onClick:a[0]||=e=>t.$emit(`selectDescription`)},[a[1]||=s(`span`,{class:`i-ph:text-align-left`,"aria-hidden":`true`},null,-1),P(` `+L(t.$t(`pr.description`)),1)],10,Df)):V(``,!0),(c(!0),u(y,null,d(i.value,({group:i,depth:a})=>(c(),u(`div`,{key:i.key,class:w([`group flex items-center rounded pr-1 transition-colors`,[e.groupsVisable.includes(i.key)?`bg-active`:`hover:bg-hover`,a?`pl-4 border-base rounded-l-none`:`mt-1`]])},[s(`button`,{type:`button`,class:w([`min-w-0 flex flex-1 flex-col items-start px-2 py-1 text-left color-base`,e.groupsVisable.includes(i.key)?`op-100`:`op-fade hover:op-100`]),onClick:e=>t.$emit(`select`,i.key)},[s(`span`,kf,[W(rn,{category:i.category,class:w([`text-sm group-hover:saturate-100`,e.groupsVisable.includes(i.key)?``:`saturate-0`])},null,8,[`category`,`class`]),s(`span`,{class:`truncate`,title:i.label},L(i.label),9,Af),B(_u)(i)?(c(),f(uu,{key:0,class:`text-sm`})):V(``,!0)]),s(`span`,jf,[W(ln,{additions:B(yu)(i).added,deletions:B(yu)(i).deleted},null,8,[`additions`,`deletions`]),s(`span`,Mf,`・`+L(t.$t(`common.files`,{n:B(gu)(i)},B(gu)(i))),1)])],10,Of),B(vu)(i,e.reviewed)?(c(),f(Xt,{key:0,value:B(vu)(i,e.reviewed),size:16,thickness:2,class:`shrink-0`},null,8,[`value`])):V(``,!0),i.children.length?(c(),f(J,{key:1,icon:n.value.has(i.key)?`i-ph:caret-right`:`i-ph:caret-down`,"aria-expanded":!n.value.has(i.key),label:t.$t(n.value.has(i.key)?`group.showSubgroups`:`group.hideSubgroups`),class:`shrink-0 text-xs`,onClick:e=>r(i.key)},null,8,[`icon`,`aria-expanded`,`label`,`onClick`])):V(``,!0)],2))),128))]))}}),Pf={class:`max-h-[60vh] min-h-40 flex flex-col gap-3`},Ff={key:0,class:`flex items-center gap-1.5 text-xs op-mute`,role:`status`},If={key:0,class:`break-words text-sm text-red-600 dark:text-red-400`},Lf=U({__name:`AnalyzeStatusModal`,props:{open:{type:Boolean},store:{},document:{}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=E(()=>n.store.llm),a=E(()=>i.value.transcript.filter(e=>e.role===`assistant`||e.role===`toolResult`)),o=F(`listEl`),l=F(`contentEl`),m=p(!0);function h(){let e=o.value;e&&(m.value=e.scrollHeight-e.scrollTop-e.clientHeight<40)}M(l,()=>{m.value&&o.value&&(o.value.scrollTop=o.value.scrollHeight)});function g(){m.value=!0,i.value.reanalyze()}return(t,n)=>(c(),f(ut,{title:t.$t(`analyze.statusTitle`),open:e.open,document:e.document,"onUpdate:open":n[1]||=e=>r(`update:open`,e)},{footer:G(()=>[i.value.isAnalyzing?(c(),f(q,{key:0,size:`sm`,icon:`i-ph:stop-duotone`,onClick:n[0]||=e=>i.value.abort()},{default:G(()=>[P(L(t.$t(`common.abort`)),1)]),_:1})):(c(),f(q,{key:1,size:`sm`,variant:`primary`,icon:`i-ph:arrow-clockwise-duotone`,onClick:g},{default:G(()=>[P(L(t.$t(`common.rerun`)),1)]),_:1}))]),default:G(()=>[s(`div`,Pf,[s(`div`,{ref_key:`listEl`,ref:o,class:`min-w-0 flex-auto overflow-y-auto overscroll-contain`,onScroll:h},[s(`div`,{ref_key:`contentEl`,ref:l,class:`flex flex-col gap-3`},[(c(!0),u(y,null,d(a.value,(e,t)=>(c(),f(Bt,{key:t,message:e},null,8,[`message`]))),128)),i.value.isAnalyzing?(c(),u(`div`,Ff,[n[2]||=s(`span`,{class:`i-ph:spinner-duotone animate-spin`,"aria-hidden":`true`},null,-1),P(` `+L(i.value.progress?.message??t.$t(`analyze.starting`)),1)])):V(``,!0)],512)],544),i.value.error?(c(),u(`p`,If,L(i.value.error.message),1)):V(``,!0)])]),_:1},8,[`title`,`open`,`document`]))}}),Rf=U({__name:`DiffAnalyzeButton`,props:{store:{},document:{}},setup(e){let t=e,{t:n}=z(),r=E(()=>t.store.llm),i=E(()=>t.store.aiResult!==void 0),a=E(()=>r.value.isAnalyzing||r.value.error!==void 0),o=p(!1),s=E(()=>r.value.isAnalyzing?`i-ph:spinner-duotone animate-spin`:r.value.error?`i-ph:warning-circle-duotone ${i.value?`text-red-500`:`text-red-100`}`:`i-ph:sparkle-duotone`),l=E(()=>r.value.isAnalyzing?n(`analyze.analyzing`):r.value.error?n(`analyze.failed`):i.value?n(`analyze.reanalyze`):n(`analyze.withAi`)),d=E(()=>{if(r.value.isAnalyzing)return r.value.progress?.message??n(`analyze.analyzing`);if(r.value.error)return n(`analyze.failedTitle`,{message:r.value.error.message})});function m(){a.value?o.value=!0:r.value.reanalyze()}return(t,n)=>(c(),u(y,null,[r.value.isSetup?!i.value||a.value||e.store.analyzeMode!==`rule-based`?(c(),f(q,{key:1,class:`shrink-0 text-xs`,variant:i.value?`text`:`primary`,icon:s.value,title:d.value,onClick:m},{default:G(()=>[P(L(l.value),1)]),_:1},8,[`variant`,`icon`,`title`])):V(``,!0):(c(),f(q,{key:0,class:`shrink-0 text-xs shadow`,size:`sm`,icon:`i-ph:key-duotone`,variant:`primary`,onClick:n[0]||=e=>B(At)(`ai`)},{default:G(()=>[P(L(t.$t(`analyze.setupKeys`)),1)]),_:1})),W(Lf,{open:o.value&&a.value,store:e.store,document:e.document,"onUpdate:open":n[1]||=e=>o.value=e},null,8,[`open`,`store`,`document`])],64))}}),zf={class:`flex-1`},Bf=U({__name:`OverlayDropdownItem`,props:{icon:{},disabled:{type:Boolean},variant:{default:`default`},shortcut:{}},emits:[`select`],setup(e,{emit:t}){let n=t;return(t,r)=>(c(),f(B(Ar),{disabled:e.disabled,class:w([`text-sm px-2 py-1.5 outline-none rounded-md flex gap-2 cursor-pointer select-none transition items-center data-[highlighted]:bg-hover data-[disabled]:op50 data-[disabled]:pointer-events-none`,e.variant===`danger`?`text-red-600 dark:text-red-400 data-[highlighted]:bg-red-500/10`:`color-base`]),onSelect:r[0]||=e=>n(`select`)},{default:G(()=>[e.icon?(c(),u(`span`,{key:0,class:w([e.icon,`op-fade`]),"aria-hidden":`true`},null,2)):V(``,!0),s(`span`,zf,[j(t.$slots,`default`)]),e.shortcut?(c(),f(Ue,{key:1,keys:e.shortcut,class:`op-fade`},null,8,[`keys`])):V(``,!0)]),_:3},8,[`disabled`,`class`]))}}),Vf=U({__name:`DiffCollapseMenu`,props:{store:{}},setup(e){let t=e,n=C(nd),r=p(!1),i=F(`root`),a=E(()=>{let e=[];for(let t=i.value?.parentElement;t;t=t.parentElement){let{overflowX:n,overflowY:r}=getComputedStyle(t);/auto|scroll|hidden|clip/.test(`${n} ${r}`)&&e.push(t)}return e}),o=[{label:`file.expandAll`,icon:`i-ph:arrows-out-line-vertical-duotone`,collapse:!1,applies:()=>!0},{label:`file.collapseAll`,icon:`i-ph:arrows-in-line-vertical-duotone`,collapse:!0,applies:()=>!0},{label:`file.collapseReviewed`,icon:`i-ph:check-square-duotone`,collapse:!0,applies:e=>pd(t.store,e)===`reviewed`}];function s(e){for(let r of t.store.diff?.files??[])e.applies(r)&&n.set(r.sha,e.collapse);r.value=!1}return(e,t)=>(c(),u(`div`,{ref_key:`root`,ref:i,class:`relative`},[W(B(Or),{open:r.value,"onUpdate:open":t[0]||=e=>r.value=e,modal:!1},{default:G(()=>[W(B(jr),{"as-child":``},{default:G(()=>[W(J,{icon:`i-ph:caret-up-down-duotone`,label:e.$t(`file.collapseMenu`),tooltip:e.$t(`file.collapseMenu`),active:r.value},null,8,[`label`,`tooltip`,`active`])]),_:1}),W(B(kr),{align:`end`,"side-offset":4,"collision-boundary":a.value,"collision-padding":8,class:`z-dropdown min-w-48 flex flex-col overflow-auto border border-base rounded-lg bg-base p-1 shadow-lg outline-none`,style:{maxWidth:`var(--reka-dropdown-menu-content-available-width)`,maxHeight:`var(--reka-dropdown-menu-content-available-height)`}},{default:G(()=>[(c(),u(y,null,d(o,t=>W(Bf,{key:t.label,icon:t.icon,onSelect:e=>s(t)},{default:G(()=>[P(L(e.$t(t.label)),1)]),_:2},1032,[`icon`,`onSelect`])),64))]),_:1},8,[`collision-boundary`])]),_:1},8,[`open`])],512))}}),Hf=U({__name:`DiffGroupNavToggle`,setup(e){let t=E(()=>ql.value===`sidebar`);return(e,n)=>(c(),f(J,{icon:t.value?`i-ph:tabs-duotone`:`i-ph:sidebar-simple-duotone`,label:e.$t(t.value?`group.navTabs`:`group.navSidebar`),tooltip:e.$t(t.value?`group.navTabs`:`group.navSidebar`),onClick:n[0]||=e=>ql.value=t.value?`tabs`:`sidebar`},null,8,[`icon`,`label`,`tooltip`]))}}),Uf={key:0,class:`op-fade`},Wf={key:1,class:`text-xs ml-0.5 op-fade`},Gf=U({__name:`DisplayNumber`,props:{value:{},prefix:{},suffix:{},options:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=E(()=>_t(t.value,t.options));return(t,r)=>(c(),u(`span`,{class:w({"font-mono tabular-nums":e.mono})},[e.prefix?(c(),u(`span`,Uf,L(e.prefix),1)):V(``,!0),P(L(n.value),1),e.suffix?(c(),u(`span`,Wf,L(e.suffix),1)):V(``,!0)],2))}}),Kf=U({__name:`DisplayNumberBadge`,props:{value:{},prefix:{},suffix:{},options:{},color:{type:[Boolean,Number,String],default:!1}},setup(e){return(t,n)=>(c(),f(lt,{color:e.color,class:`text-micro`},{default:G(()=>[j(t.$slots,`default`,{},()=>[W(Gf,{value:e.value,prefix:e.prefix,suffix:e.suffix,options:e.options},null,8,[`value`,`prefix`,`suffix`,`options`])])]),_:3},8,[`color`]))}}),qf={class:`relative shrink-0`},Jf=U({__name:`DiffReviewButton`,props:{pendingCommentCount:{}},emits:[`review`],setup(e){return(t,n)=>(c(),u(`div`,qf,[W(q,{size:`sm`,variant:`action`,icon:`i-ph:chat-centered-text-duotone`,onClick:n[0]||=e=>t.$emit(`review`)},{default:G(()=>[P(L(t.$t(`review.addReview`)),1)]),_:1}),e.pendingCommentCount>0?(c(),f(Kf,{key:0,value:e.pendingCommentCount,class:`absolute right--2 top--2`},null,8,[`value`])):V(``,!0)]))}}),Yf={class:`flex flex-col gap-3`},Xf={class:`flex flex-wrap gap-2`},Zf={class:`flex flex-col text-sm`},Qf=[`onClick`],$f=U({__name:`ReviewProgressModal`,props:{open:{type:Boolean},store:{},document:{}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=E(()=>(n.store.diff?.files??[]).map(e=>({file:e,status:pd(n.store,e)})).sort((e,t)=>e.file.path.localeCompare(t.file.path))),a=E(()=>i.value.filter(e=>e.status===`reviewed`).length);function o(e){return i.value.filter(t=>t.status===`reviewed`===e).map(e=>e.file.sha)}async function l(){let[e,t]=[o(!0),o(!1)];await n.store.setReviewed(e,!1),await n.store.setReviewed(t,!0)}function p(e){let t=n.document??document;r(`update:open`,!1),tu(t,e)}return(t,n)=>(c(),f(ut,{title:t.$t(`reviewProgress.title`),description:t.$t(`group.filesReviewed`,{reviewed:a.value,total:i.value.length}),open:e.open,document:e.document,"onUpdate:open":n[2]||=e=>r(`update:open`,e)},{default:G(()=>[s(`div`,Yf,[s(`div`,Xf,[W(q,{size:`sm`,icon:`i-ph:checks`,disabled:a.value===i.value.length,onClick:n[0]||=t=>e.store.setReviewed(o(!1),!0)},{default:G(()=>[P(L(t.$t(`reviewProgress.markAll`)),1)]),_:1},8,[`disabled`]),W(q,{size:`sm`,icon:`i-ph:arrows-left-right`,disabled:i.value.length===0,onClick:l},{default:G(()=>[P(L(t.$t(`reviewProgress.invert`)),1)]),_:1},8,[`disabled`]),W(q,{size:`sm`,icon:`i-ph:arrow-counter-clockwise`,disabled:a.value===0&&e.store.changedSinceReviewed.size===0,onClick:n[1]||=t=>e.store.setReviewed(i.value.map(e=>e.file.sha),!1)},{default:G(()=>[P(L(t.$t(`reviewProgress.reset`)),1)]),_:1},8,[`disabled`])]),s(`ul`,Zf,[(c(!0),u(y,null,d(i.value,({file:n,status:r})=>(c(),u(`li`,{key:n.sha,class:`flex items-center gap-2 rounded-md px-1 py-1 hover:bg-hover`},[W(md,{status:r,"aria-label":t.$t(`file.markReviewed`),onUpdate:t=>e.store.setReviewed([n.sha],t)},null,8,[`status`,`aria-label`,`onUpdate`]),s(`button`,{type:`button`,class:`min-w-0 flex-1 text-left`,onClick:e=>p(n.sha)},[W(qu,{path:n.path,class:`min-w-0`},null,8,[`path`])],8,Qf),s(`span`,{class:w([`shrink-0 text-xs`,r===`changed`?`text-orange-700 dark:text-orange-400`:r===`reviewed`?`text-primary-600 dark:text-primary-400`:`op-fade`])},L(t.$t(`reviewProgress.status.${r}`)),3)]))),128))])])]),_:1},8,[`title`,`description`,`open`,`document`]))}}),ep={class:`w-full flex flex-col gap-3 p-3`},tp={key:0,class:`text-sm op-fade`},np={key:1,class:`text-sm text-red-600 dark:text-red-400`},rp={class:`flex flex-wrap items-center justify-end gap-2`},ip={key:2,class:`text-xs color-muted`},ap=U({__name:`ReviewSubmitModal`,props:{open:{type:Boolean},reviews:{},authorLogin:{},document:{}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=p(``),a=p(`COMMENT`),o=p(!1),l=p(),{t:d}=z(),m=E(()=>!!n.authorLogin&&!!n.reviews.viewerLogin&&n.authorLogin.toLowerCase()===n.reviews.viewerLogin.toLowerCase());I(m,e=>{e&&(a.value=`COMMENT`)});let h=E(()=>[{value:`COMMENT`,label:d(`review.comment`),icon:`i-octicon-comment-16`},{value:`APPROVE`,label:d(`review.approve`),icon:`i-octicon-check-circle-16`,disabled:m.value},{value:`REQUEST_CHANGES`,label:d(`review.requestChanges`),icon:`i-octicon-code-review-16`,disabled:m.value}]);async function g(e){o.value=!0,l.value=void 0;try{await e(),i.value=``,a.value=`COMMENT`,r(`update:open`,!1)}catch(e){l.value=e instanceof Error?e.message:String(e)}finally{o.value=!1}}return(t,d)=>(c(),f(ut,{title:t.$t(`review.reviewChanges`),open:e.open,document:e.document,"onUpdate:open":d[4]||=e=>r(`update:open`,e)},{default:G(()=>[s(`div`,ep,[e.reviews.pendingCommentCount>0?(c(),u(`p`,tp,L(t.$t(`review.includesPending`,{n:e.reviews.pendingCommentCount},e.reviews.pendingCommentCount)),1)):V(``,!0),W(Zu,{modelValue:i.value,"onUpdate:modelValue":d[0]||=e=>i.value=e,rows:4,placeholder:t.$t(`review.summaryPlaceholder`),disabled:o.value,invalid:!!l.value},null,8,[`modelValue`,`placeholder`,`disabled`,`invalid`]),l.value?(c(),u(`p`,np,L(l.value),1)):V(``,!0),s(`div`,rp,[W(ft,{"model-value":a.value,options:h.value,"onUpdate:modelValue":d[1]||=e=>{e&&(a.value=e)}},null,8,[`model-value`,`options`]),d[5]||=s(`div`,{class:`flex-auto`},null,-1),e.reviews.pendingReview?(c(),f(q,{key:0,variant:`text`,class:`text-red-600 dark:text-red-400`,disabled:o.value,onClick:d[2]||=e=>g(()=>n.reviews.discardPendingReview())},{default:G(()=>[P(L(t.$t(`review.discard`)),1)]),_:1},8,[`disabled`])):V(``,!0),d[6]||=s(`div`,{class:`flex-auto`},null,-1),W(q,{variant:`primary`,class:`px3`,loading:o.value,disabled:a.value!==`APPROVE`&&!i.value.trim()&&e.reviews.pendingCommentCount===0,onClick:d[3]||=e=>g(()=>n.reviews.submitReview(a.value,i.value))},{default:G(()=>[P(L(t.$t(`common.submit`)),1)]),_:1},8,[`loading`,`disabled`])]),m.value?(c(),u(`p`,ip,L(t.$t(`review.ownPrCommentOnly`)),1)):V(``,!0)])]),_:1},8,[`title`,`open`,`document`]))}}),op={class:`flex items-center gap-2 text-sm`},sp=[`title`,`aria-expanded`],cp={class:`text-xs opacity-50`},lp=U({__name:`DiffPrMeta`,props:{document:{},store:{}},setup(e){let t=e,n=E(()=>t.store.diff.files),r=E(()=>n.value.length),i=E(()=>n.value.filter(e=>t.store.reviewed.has(e.sha)).length),a=E(()=>n.value.reduce((e,t)=>e+t.additions,0)),o=E(()=>n.value.reduce((e,t)=>e+t.deletions,0)),l=E(()=>r.value===0?1:i.value/r.value),d=E(()=>t.store.reviews),m=p(!1),h=p(!1);return(t,n)=>(c(),u(`div`,op,[W(ln,{additions:a.value,deletions:o.value},null,8,[`additions`,`deletions`]),s(`button`,{type:`button`,class:`flex shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-1.5 py-0.5 transition -mx-1.5 hover:bg-hover`,title:t.$t(`reviewProgress.title`),"aria-expanded":h.value,onClick:n[0]||=e=>h.value=!0},[W(Xt,{value:l.value,size:18,thickness:3},null,8,[`value`]),s(`span`,null,[P(L(i.value)+` `,1),s(`span`,cp,L(t.$t(`pr.reviewedOf`,{total:r.value})),1)])],8,sp),d.value?.canWrite?(c(),f(Jf,{key:0,"pending-comment-count":d.value.pendingCommentCount,onReview:n[1]||=e=>m.value=!0},null,8,[`pending-comment-count`])):V(``,!0),d.value?(c(),f(ap,{key:1,open:m.value,"onUpdate:open":n[2]||=e=>m.value=e,reviews:d.value,"author-login":e.store.diff?.author?.name,document:e.document},null,8,[`open`,`reviews`,`author-login`,`document`])):V(``,!0),W($f,{open:h.value,"onUpdate:open":n[3]||=e=>h.value=e,store:e.store,document:e.document},null,8,[`open`,`store`,`document`])]))}}),up=U({__name:`DiffReviewThreadsToggle`,props:{showThreads:{type:Boolean}},emits:[`update:showThreads`],setup(e){return(t,n)=>(c(),f(J,{class:w([`shrink-0`,e.showThreads?``:`op-fade`]),icon:e.showThreads?`i-ph:chats-duotone`:`i-ph:chats`,label:t.$t(e.showThreads?`review.hideComments`:`review.showComments`),tooltip:t.$t(e.showThreads?`review.hideComments`:`review.showComments`),onClick:n[0]||=n=>t.$emit(`update:showThreads`,!e.showThreads)},null,8,[`class`,`icon`,`label`,`tooltip`]))}}),dp={class:`w-full flex flex-col gap-3 text-sm`},fp=[`href`],pp={key:0,class:`inline-flex items-center gap-1 align-middle`},mp={class:`h-4 w-4 overflow-hidden rounded-full`},hp={class:`flex flex-col gap-1`},gp={class:`op-fade`},_p={class:`flex flex-col list-disc gap-0.5 pl-5`},vp={class:`op-fade`},yp={class:`op-fade`},bp={key:0,class:`flex items-start gap-2 border border-amber:20 rounded-lg bg-amber:10 px-3 py-2 text-amber-700 dark:text-amber-400`},xp={key:1,class:`text-red-600 dark:text-red-400`},Sp={class:`flex justify-end gap-2`},Cp=U({__name:`ShareResultModal`,props:{open:{type:Boolean},store:{},document:{}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{t:i}=z(),a=E(()=>n.store.shared),o=E(()=>{let e=n.store.aiResult?.locale;return e!==void 0&&e!==`en`}),l=E(()=>a.value.ownComment?o.value?i(`share.updateAnyway`):i(`share.update`):o.value?i(`share.shareAnyway`):i(`share.share`));async function d(){await a.value.share(),a.value.error||r(`update:open`,!1)}return(t,n)=>{let i=k(`i18n-t`);return c(),f(ut,{title:t.$t(a.value.ownComment?`share.titleUpdate`:`share.titleShare`),open:e.open,document:e.document,"onUpdate:open":n[1]||=e=>r(`update:open`,e)},{default:G(()=>[s(`div`,dp,[W(i,{keypath:a.value.ownComment?`share.willUpdate`:`share.willPost`,tag:`p`,scope:`global`},{comment:G(()=>[s(`a`,{href:a.value.ownComment?.url,target:`_blank`,rel:`noopener`,class:`underline`},L(t.$t(`share.commentLink`)),9,fp)]),user:G(()=>[a.value.viewerLogin?(c(),u(`span`,pp,[s(`span`,mp,[W(un,{login:a.value.viewerLogin,size:16},null,8,[`login`])]),s(`strong`,null,L(a.value.viewerLogin),1)])):(c(),u(y,{key:1},[P(L(t.$t(`common.you`)),1)],64))]),_:1},8,[`keypath`]),s(`div`,hp,[s(`p`,gp,L(t.$t(`share.contains`)),1),s(`ul`,_p,[W(i,{keypath:`share.containsLink`,tag:`li`,scope:`global`},{site:G(()=>[...n[2]||=[s(`span`,{class:`text-primary font-bold`},`pulls.review`,-1)]]),_:1}),s(`li`,null,L(t.$t(`share.containsJson`)),1)]),s(`p`,vp,L(t.$t(`share.excludes`)),1)]),s(`p`,yp,L(t.$t(`share.anyoneCanLoad`)),1),o.value?(c(),u(`div`,bp,[n[3]||=s(`span`,{class:`i-ph:globe-duotone mt-0.5 shrink-0`,"aria-hidden":`true`},null,-1),s(`span`,null,L(t.$t(`share.englishRecommended`)),1)])):V(``,!0),a.value.error?(c(),u(`p`,xp,L(a.value.error.message),1)):V(``,!0),s(`div`,Sp,[W(q,{variant:`text`,disabled:a.value.isSharing,onClick:n[0]||=e=>r(`update:open`,!1)},{default:G(()=>[P(L(t.$t(`common.cancel`)),1)]),_:1},8,[`disabled`]),W(q,{variant:`primary`,icon:`i-ph:share-network-duotone`,loading:a.value.isSharing,onClick:d},{default:G(()=>[P(L(l.value),1)]),_:1},8,[`loading`])])])]),_:1},8,[`title`,`open`,`document`])}}}),wp=[`title`],Tp=U({__name:`DiffShareButton`,props:{store:{},document:{}},setup(e){let t=e,n=E(()=>t.store.shared),r=p(!1);return(t,i)=>(c(),u(y,null,[W(q,{class:`shrink-0 text-xs`,variant:`text`,disabled:n.value.isSharing||!n.value.canShare,title:t.$t(n.value.canShare?`share.tooltip`:`share.needsToken`),icon:n.value.isSharing?`i-ph:spinner-duotone animate-spin`:`i-ph:share-network-duotone`,onClick:i[0]||=e=>r.value=!0},{default:G(()=>[P(L(t.$t(n.value.isSharing?`share.sharing`:n.value.ownComment?`share.updateButton`:`share.button`)),1)]),_:1},8,[`disabled`,`title`,`icon`]),n.value.error&&!r.value?(c(),u(`span`,{key:0,class:`max-w-80 self-center truncate text-xs text-red-500`,title:t.$t(`share.failed`,{message:n.value.error.message})},L(t.$t(`share.failed`,{message:n.value.error.message})),9,wp)):V(``,!0),W(Cp,{open:r.value,"onUpdate:open":i[1]||=e=>r.value=e,store:e.store,document:e.document},null,8,[`open`,`store`,`document`])],64))}}),Ep=U({__name:`FileListLayoutToggle`,setup(e){let t=E(()=>iu.value===`list`);return(e,n)=>(c(),f(J,{icon:t.value?`i-ph:tree-view-duotone`:`i-ph:list-bullets-duotone`,label:e.$t(t.value?`file.layoutTree`:`file.layoutList`),tooltip:e.$t(t.value?`file.layoutTree`:`file.layoutList`),onClick:n[0]||=e=>iu.value=t.value?`tree`:`list`},null,8,[`icon`,`label`,`tooltip`]))}}),Dp={class:`mxa max-w-500 w-full`},Op={class:`flex flex-wrap items-center gap-2`},kp={key:1,class:`i-ph-house-line-duotone`},Ap={class:`flex flex-auto items-center gap-2 break-words text-lg font-semibold`},jp=[`href`],Mp={key:0,class:`flex shrink-0 items-center gap-1.5 text-sm`},Np={class:`shrink-0`},Pp={class:`hidden lg:block`},Fp={class:`flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-sm`},Ip={key:1,class:`flex items-center gap-1.5`},Lp={class:`op-fade`},Rp={class:`op-fade`},zp={key:2,class:`flex items-center gap-1 font-mono`},Bp={class:`border border-base rounded bg-code px-2 py-0.5 text-xs font-mono`},Vp={class:`border border-base rounded bg-code px-2 py-0.5 text-xs font-mono`},Hp=[`title`],Up={key:0,class:`flex items-center gap-2 pt-2 text-sm`},Wp=U({__name:`DiffsHeader`,props:{document:{},store:{},groupsVisable:{},scrollY:{},hidden:{type:Boolean},descriptionVisible:{type:Boolean}},emits:[`selectDescription`],setup(e){let t=e,{t:n}=z(),r=E(()=>t.store.diff),i=E(()=>!!r.value.description?.trim()),a=E(()=>t.store.groups),o=E(()=>t.store.aiResult),l=E(()=>[{value:`rule-based`,label:n(`pr.rules`)},{value:o.value?.source??`llm`,label:n(`pr.ai`),icon:`i-ph-sparkle-duotone`}]),d=E(()=>t.store.shared&&t.store.llm&&o.value&&!o.value.sharedBy),p=E(()=>Lt(r.value.ref)),m=E(()=>t.store.reviews);function h(e){(t.document??document).getElementById(`group-${e}`)?.scrollIntoView({behavior:Pt.value,block:`start`})}return(t,n)=>(c(),u(`header`,{class:w([`sticky left-0 right-0 top-0 z-nav flex flex-col gap-2 border-b bg-base px4 py2 transition-all`,e.hidden?`-translate-y-full border-transparent`:e.scrollY>20?`border-base shadow-sm`:`border-transparent`])},[s(`div`,Dp,[s(`div`,Op,[(c(),f(b(B(!1)?`div`:B(Ft)),{to:`/`,class:`flex`},{default:G(()=>[r.value.pullRequest?.state?(c(),f(Ct,{key:0,state:r.value.pullRequest.state},null,8,[`state`])):(c(),u(`div`,kp))]),_:1})),s(`h1`,Ap,[P(L(r.value.title)+` `,1),r.value.label?(c(),u(`a`,{key:0,href:r.value.url,target:`_blank`,rel:`noopener`,class:`text-base font-normal op-fade hover:underline`},L(r.value.label),9,jp)):V(``,!0),e.store.canRefresh?(c(),f(J,{key:1,icon:`i-ph:arrows-clockwise-duotone`,label:t.$t(`common.refresh`),tooltip:t.$t(`common.refresh`),class:`shrink-0 text-sm`,onClick:n[0]||=t=>e.store.refresh()},null,8,[`label`,`tooltip`])):V(``,!0)]),o.value?(c(),u(`div`,Mp,[W(ft,{"model-value":e.store.analyzeMode,options:l.value,"onUpdate:modelValue":n[1]||=t=>e.store.setAnalyzeMode(t)},null,8,[`model-value`,`options`])])):V(``,!0),m.value?(c(),f(up,{key:1,"show-threads":m.value.showThreads,"onUpdate:showThreads":n[2]||=e=>m.value.setShowThreads(e)},null,8,[`show-threads`])):V(``,!0),s(`div`,Np,[W(Ot,{document:e.document},{default:G(()=>[W(Vf,{store:e.store},null,8,[`store`]),W(Ep),s(`div`,Pp,[W(Hf)])]),_:1},8,[`document`])])]),s(`div`,Fp,[p.value&&!B(!1)?(c(),f(B(Ft),{key:0,to:p.value.route,class:`flex items-center gap-1.5 op-fade hover:underline`},{default:G(()=>[s(`span`,null,L(p.value.label),1)]),_:1},8,[`to`])):V(``,!0),r.value.author?(c(),u(`span`,Ip,[s(`span`,Lp,L(t.$t(`pr.by`)),1),W(un,{login:r.value.author.name,"avatar-url":r.value.author.avatarUrl,size:16},null,8,[`login`,`avatar-url`]),s(`span`,Rp,L(r.value.author.name),1)])):V(``,!0),r.value.base&&r.value.head&&!B(!1)?(c(),u(`span`,zp,[s(`span`,Bp,L(r.value.base.ref),1),n[4]||=P(` ← `,-1),s(`span`,Vp,L(r.value.head.ref),1)])):V(``,!0),o.value?.sharedBy&&e.store.analyzeMode!==`rule-based`?(c(),u(`span`,{key:3,class:`flex items-center gap-1.5 border border-base rounded px2`,title:o.value.model},[o.value.sharedBy===B(`github-actions[bot]`)?(c(),u(y,{key:0},[P(L(t.$t(`pr.sharedAnalysis`)),1)],64)):(c(),u(y,{key:1},[P(L(t.$t(`pr.sharedBy`))+` `,1),W(un,{login:o.value.sharedBy,size:16},null,8,[`login`]),P(` `+L(o.value.sharedBy),1)],64))],8,Hp)):V(``,!0),e.store.llm?(c(),f(Rf,{key:4,store:e.store,document:e.document},null,8,[`store`,`document`])):V(``,!0),d.value?(c(),f(Tp,{key:5,store:e.store,document:e.document},null,8,[`store`,`document`])):V(``,!0),B(Yl)?(c(),f(lp,{key:6,class:`ml-auto`,store:e.store,document:e.document},null,8,[`store`,`document`])):V(``,!0)]),B(Yl)?V(``,!0):(c(),u(`div`,Up,[W(Nu,{class:`flex-auto`,groups:a.value,"groups-visable":e.groupsVisable,reviewed:e.store.reviewed,"has-description":i.value,"description-visible":e.descriptionVisible,onSelect:h,onSelectDescription:n[3]||=e=>t.$emit(`selectDescription`)},{default:G(()=>[W(lp,{class:`ml-auto self-end pt-2`,store:e.store,document:e.document},null,8,[`store`,`document`])]),_:1},8,[`groups`,`groups-visable`,`reviewed`,`has-description`,`description-visible`])]))])],2))}}),Gp={key:0,class:`border border-base rounded-lg`},Kp=[`aria-expanded`],qp={class:`font-medium`},Jp={class:`font-mono op-mute`},Yp={key:0,class:`border-t border-base divide-y divide-#9992`},Xp={class:`flex items-center gap-2`},Zp={class:`font-medium`},Qp={class:`op-fade`},$p=U({__name:`ReviewSummaries`,props:{summaries:{}},setup(e){let t=p(!1),n={approved:{label:`review.approved`,icon:`i-ph:check-circle-duotone text-green-600 dark:text-green-400`},changes_requested:{label:`review.changesRequested`,icon:`i-ph:x-circle-duotone text-red-600 dark:text-red-400`},commented:{label:`review.commented`,icon:`i-ph:chat-circle-dots-duotone op-fade`},dismissed:{label:`review.dismissed`,icon:`i-ph:prohibit op-mute`}};return(r,i)=>e.summaries.length?(c(),u(`section`,Gp,[s(`button`,{type:`button`,class:`w-full flex items-center gap-1.5 px-3 py-2 text-sm`,"aria-expanded":t.value,onClick:i[0]||=e=>t.value=!t.value},[s(`span`,{class:w(t.value?`i-ph:caret-down`:`i-ph:caret-right`),"aria-hidden":`true`},null,2),s(`span`,qp,L(r.$t(`review.reviews`)),1),s(`span`,Jp,L(e.summaries.length),1)],8,Kp),t.value?(c(),u(`ul`,Yp,[(c(!0),u(y,null,d(e.summaries,e=>(c(),u(`li`,{key:e.id,class:`flex flex-col gap-1 px-3 py-2 text-sm`},[s(`div`,Xp,[s(`span`,{class:w(n[e.state].icon),"aria-hidden":`true`},null,2),e.author?(c(),f(un,{key:0,login:e.author.login,"avatar-url":e.author.avatarUrl,size:16},null,8,[`login`,`avatar-url`])):V(``,!0),s(`span`,Zp,L(e.author?.login??`ghost`),1),s(`span`,Qp,L(r.$t(n[e.state].label)),1),e.submittedAt?(c(),f(vt,{key:1,date:e.submittedAt,class:`text-xs op-fade`},null,8,[`date`])):V(``,!0)]),e.body?(c(),f(m,{key:0},{default:G(()=>[W(B(zt),{value:e.body,class:`pl-6 text-sm op-fade`},null,8,[`value`])]),_:2},1024)):V(``,!0)]))),128))])):V(``,!0)])):V(``,!0)}}),em={key:0,class:`flex flex-wrap items-center gap-x-3 gap-y-2 border border-base rounded-lg bg-raised px-3 py-2 text-sm`},tm={key:0,class:`text-xs op-fade`},nm={key:1,class:`text-xs op-fade`},rm={key:1,class:`op-fade`},im=U({__name:`SharedAnalysisBanner`,props:{store:{}},setup(e){let t=e,{t:n,locale:r}=z(),i=E(()=>t.store.shared),a=E(()=>t.store.aiResult!==void 0&&t.store.aiResult.sharedBy===void 0);function o(e){let t=e.result.locale;return t!==void 0&&t!==r.value?Je(t):void 0}function l(e){let t=o(e);return e.stale?n(`share.staleTitle`):t?n(`share.inLanguage`,{language:t}):e.result.model}return(e,t)=>i.value.candidates.length||i.value.notice?(c(),u(`div`,em,[t[1]||=s(`span`,{class:`i-ph-sparkle-duotone shrink-0 op-fade`,"aria-hidden":`true`},null,-1),i.value.candidates.length?(c(),u(y,{key:0},[s(`span`,null,L(e.$t(a.value?`share.loadReplaces`:`share.available`)),1),(c(!0),u(y,null,d(i.value.candidates,t=>(c(),f(q,{key:t.login,size:`sm`,class:`rounded-full`,title:l(t),onClick:e=>i.value.load(t.login)},{default:G(()=>[W(un,{login:t.login,size:16},null,8,[`login`]),P(` `+L(t.own?e.$t(`common.you`):t.login)+` `,1),t.stale?(c(),u(`span`,tm,L(e.$t(`share.outdated`)),1)):o(t)?(c(),u(`span`,nm,`(`+L(o(t))+`)`,1)):V(``,!0)]),_:2},1032,[`title`,`onClick`]))),128))],64)):(c(),u(`span`,rm,L(i.value.notice),1)),t[2]||=s(`div`,{class:`flex-auto`},null,-1),W(J,{icon:`i-ph:x`,label:e.$t(`common.dismiss`),tooltip:e.$t(`common.dismiss`),class:`text-sm`,onClick:t[0]||=e=>i.value.dismiss()},null,8,[`label`,`tooltip`])])):V(``,!0)}}),am={key:0,class:`mxa max-w-500 w-full px-4 py-12`},om={key:1,class:`mxa max-w-500 w-full flex flex-col gap-8 px-4 py-12`},sm={ref:`sidebarRow`,class:`flex`},cm={class:`sticky top-[calc(var(--diffs-header-height)+10px)] max-h-[calc(100vh-var(--diffs-header-height)-20px)] overflow-auto py-3 pl-3 pr-2`},lm=[`aria-label`,`title`],um={class:`mxa max-w-500 min-w-0 flex flex-auto flex-col gap-4`},dm=[`id`,`aria-labelledby`],fm=[`id`],pm={ref:`descriptionBody`},mm=[`aria-expanded`],hm={key:0,class:`mb-4 flex flex-wrap items-center justify-between gap-3 border border-amber:20 rounded-lg bg-amber:10 bg-raised px-3 py-2 text-sm text-amber-700 dark:text-amber-400`},gm={class:`flex items-center gap-3`},_m={class:`mt-200 p2 text-center text-xs italic op50`},vm={key:3,class:`mxa max-w-500 w-full px-4 py-12`},ym=160,bm=U({__name:`DiffsPage`,props:{document:{},store:{}},setup(e){let t=e,n=ae(()=>Ye(()=>import(`./ChatWidget-Dbic6F6V.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),r=E(()=>t.store?.diff),i=E(()=>t.store?.grouped),a=E(()=>t.store?.isLoading??!1),o=E(()=>t.store?.error),g=E(()=>t.store?.isStale??!1),v=E(()=>t.store?.groups??[]),b=new Wl;O(Ql,b),O(nd,D(new Map));let x=F(`root`);l(()=>{b.setup(t.document&&!(t.document instanceof Document)?x.value:document)}),h(()=>b.cleanUp());let S=p(new Set);function C(e){let t=new Set(S.value);t.has(e)?t.delete(e):t.add(e),S.value=t}let T=p(0),k=0,A=p(0);N(()=>t.document??document,`scroll`,e=>{let t=e.target instanceof Element?e.target.scrollTop:window.scrollY;t<T.value&&(k=t),A.value=t-k,T.value=t,de(),pe()},{capture:!0});let M=F(`header`),{height:te}=ne(()=>M.value?.$el),re=E(()=>!Jl.value&&A.value>300),ie=E(()=>re.value?0:te.value),z=p([]),oe=ee(),se=p(!1),H=p(!1),U=F(`descriptionBody`),{height:le}=ce(U),K=E(()=>le.value>ym),ue=E(()=>K.value&&!H.value);function de(){let e=t.document??document,n=window.innerHeight,r=e.getElementById(oe)?.getBoundingClientRect();se.value=!!r&&r.bottom>te.value&&r.top<n;let i=v.value.flatMap(e=>[e.key,...e.children.map(e=>e.key)]);z.value=i.filter(t=>{let r=e.getElementById(`group-${t}`);if(!r)return!1;let i=r.getBoundingClientRect();return i.bottom>ie.value&&i.top<n})}let fe=p([]);function pe(){let e=t.document??document,n=window.innerHeight,r=[...e.querySelectorAll(`[data-file-start]`)];fe.value=r.filter((e,t)=>{let i=r[t+1],a=e.getBoundingClientRect().top;return(i&&i.parentElement===e.parentElement?i.getBoundingClientRect().top:e.parentElement.getBoundingClientRect().bottom)>ie.value&&a<n}).map(e=>e.dataset.fileStart)}I([v,ie],()=>R(()=>{de(),pe()}),{immediate:!0});function me(e){(t.document??document).getElementById(`group-${e}`)?.scrollIntoView({behavior:Pt.value,block:`start`})}function he(){H.value=!0,(t.document??document).getElementById(oe)?.scrollIntoView({behavior:Pt.value,block:`start`})}let ge=E(()=>Zl.value?{width:`min(${Zl.value}px, ${Xl*100}%)`}:void 0),_e=F(`sidebarRow`),ve=F(`sidebar`),{resizing:ye,onPointerDown:be}=Kl({target:()=>ve.value,width:Zl,min:192,max:()=>_e.value.clientWidth*Xl}),xe=E(()=>({"--diffs-header-height":te.value?`${ie.value}px`:void 0})),Se=p(!0);function Ce(){nt.value=Se.value,t.store?.refresh()}return(t,l)=>(c(),u(`div`,{ref:`root`,class:`diffs-page bg-base color-base`,style:_(xe.value)},[s(`div`,null,[a.value&&!r.value?(c(),u(`div`,am,[j(t.$slots,`loading`,{},()=>[W(ze,{text:t.$t(`common.loading`)},null,8,[`text`])])])):o.value?(c(),u(`div`,om,[j(t.$slots,`error`,{error:o.value,retry:()=>e.store?.load()},()=>[W(He,{icon:`i-ph:warning-duotone`,title:t.$t(`pr.somethingWrong`)},{hint:G(()=>[P(L(o.value.message),1)]),actions:G(()=>[W(q,{variant:`primary`,onClick:l[0]||=t=>e.store?.load()},{default:G(()=>[P(L(t.$t(`common.retry`)),1)]),_:1})]),_:1},8,[`title`])]),e.store?.auth===`github-token`?(c(),f(Be,{key:0,class:`mxa max-w-200 border border-base border-rounded p4`,onSaved:l[1]||=t=>e.store?.load()})):V(``,!0)])):r.value&&i.value?(c(),u(y,{key:2},[W(Wp,{ref:`header`,document:e.document,store:e.store,"groups-visable":z.value,"scroll-y":T.value,hidden:re.value,"description-visible":se.value,onSelectDescription:he},null,8,[`document`,`store`,`groups-visable`,`scroll-y`,`hidden`,`description-visible`]),s(`div`,sm,[B(Yl)?(c(),u(`aside`,{key:0,ref:`sidebar`,class:`relative w-64 shrink-0 border-r border-base`,style:_(ge.value)},[s(`div`,cm,[W(Nf,{groups:v.value,"groups-visable":z.value,reviewed:e.store.reviewed,"has-description":!!r.value.description?.trim(),"description-visible":se.value,onSelect:me,onSelectDescription:he},null,8,[`groups`,`groups-visable`,`reviewed`,`has-description`,`description-visible`])]),s(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":t.$t(`group.resize`),title:t.$t(`group.resize`),class:`group/resize absolute inset-y-0 right-0 w-3 flex translate-x-1/2 cursor-col-resize touch-none justify-center`,onPointerdown:l[2]||=(...e)=>B(be)&&B(be)(...e),onDblclick:l[3]||=e=>Zl.value=null},[s(`div`,{class:w([`w-px transition-colors`,B(ye)?`bg-primary-500`:`group-hover/resize:bg-primary-500`])},null,2)],40,lm)],4)):V(``,!0),s(`div`,um,[r.value.description?.trim()?(c(),u(`section`,{key:0,id:B(oe),"aria-labelledby":`${B(oe)}-title`,class:`scroll-mt-[calc(var(--diffs-header-height)+10px)] border-b border-base p-4`},[s(`h2`,{id:`${B(oe)}-title`,class:`mb-3 font-semibold`},L(t.$t(`pr.description`)),9,fm),s(`div`,{class:w([`overflow-hidden`,ue.value&&`[mask-image:linear-gradient(to_bottom,black_60%,transparent)]`]),style:_(ue.value?{maxHeight:`${ym}px`}:void 0)},[s(`div`,pm,[(c(),f(m,null,{default:G(()=>[W(B(zt),{value:r.value.description,class:`description-markdown min-w-0`},null,8,[`value`])]),_:1}))],512)],6),K.value?(c(),u(`button`,{key:0,type:`button`,class:`mt-2 flex items-center gap-1 text-sm color-muted hover:color-base`,"aria-expanded":H.value,onClick:l[4]||=e=>H.value=!H.value},[s(`span`,{class:w(H.value?`i-ph:caret-up`:`i-ph:caret-down`),"aria-hidden":`true`},null,2),P(` `+L(H.value?t.$t(`pr.descriptionCollapse`):t.$t(`pr.descriptionExpand`)),1)],8,mm)):V(``,!0)],8,dm)):V(``,!0),j(t.$slots,`stale`,{refresh:()=>e.store?.refresh()},()=>[g.value?(c(),u(`div`,hm,[s(`span`,null,L(t.$t(`pr.newCommits`)),1),s(`div`,gm,[W(Tt,{modelValue:Se.value,"onUpdate:modelValue":l[5]||=e=>Se.value=e,label:t.$t(`pr.autoRefreshNextTime`)},null,8,[`modelValue`,`label`]),W(q,{size:`sm`,onClick:Ce},{default:G(()=>[P(L(t.$t(`common.refresh`)),1)]),_:1})])])):V(``,!0)]),e.store?.shared?(c(),f(im,{key:1,store:e.store},null,8,[`store`])):V(``,!0),e.store?.reviews?(c(),f($p,{key:2,summaries:e.store.reviews.summaries},null,8,[`summaries`])):V(``,!0),i.value?.overallSummary?(c(),f(m,{key:3},{default:G(()=>[W(B(zt),{value:i.value?.overallSummary,class:`border-b border-base px-4 pb-2 text-sm op-fade`},null,8,[`value`])]),_:1})):V(``,!0),(c(!0),u(y,null,d(v.value,t=>(c(),f(Tf,{key:t.key,store:e.store,group:t,collapsed:S.value.has(t.key),"files-visible":fe.value,onToggle:e=>C(t.key)},null,8,[`store`,`group`,`collapsed`,`files-visible`,`onToggle`]))),128)),s(`div`,_m,L(t.$t(`pr.endOfDiff`)),1)])],512),B(n)&&e.store?.llm&&e.store.aiResult?(c(),f(B(n),{key:0,store:e.store},null,8,[`store`])):V(``,!0)],64)):(c(),u(`div`,vm,[j(t.$slots,`empty`)]))])],4))}}),xm=oe(`diffs:show-review-comments`,!0);function Sm(e,t){let{write:n}=t.access,r=p({threads:[],summaries:[],pendingReview:void 0}),i=p(!1),a=E(()=>r.value.threads.reduce((e,t)=>e+t.comments.filter(e=>e.pending).length,0));async function o(){let n=await e.fetch();r.value=n;let i=t.getCacheKey();i&&await t.cache.diffs.setReviewData(i,n)}async function s(){let e=t.cachedData?.();e&&(r.value=e),i.value=!e;try{await t.access.resolve(),await o()}catch{}finally{i.value=!1}}async function c(e){await n(e),await o()}async function l(n,i,a){let o=t.getHeadSha();if(!o)throw Error(Ne(`errors.diffNotLoaded`));await c(()=>e.addComment({target:n,body:i,mode:a,headSha:o,pendingReview:r.value.pendingReview}))}async function u(){let t=r.value.pendingReview;t&&await c(()=>e.discardPendingReview(t))}return D({threads:E(()=>r.value.threads),summaries:E(()=>r.value.summaries),pendingReview:E(()=>r.value.pendingReview),pendingCommentCount:a,isLoading:i,viewerLogin:t.access.viewerLogin,canWrite:t.access.canWrite,writeBlockedReason:t.access.writeBlockedReason,showThreads:xm,setShowThreads:e=>{xm.value=e},load:s,addComment:l,reply:(t,n)=>c(()=>e.reply(t,n)),editComment:(t,n)=>c(()=>e.editComment(t,n)),deleteComment:t=>c(()=>e.deleteComment(t)),resolveThread:t=>c(()=>e.resolveThread(t)),submitReview:(t,n)=>c(()=>e.submitReview(t,n,r.value.pendingReview)),discardPendingReview:u})}function Cm(e,t){let{access:n}=t,r=p([]),i=p(),a=p(!1),o=p(),s=p();async function c(e){await t.applyResult({...e.result,sharedBy:e.login}),r.value=[],i.value=void 0}async function l(a){await n.resolve(),s.value??=t.cachedComment();let o=t.getAiResult();if(!a&&o)return;let l;try{l=await e.list()}catch{return}let u=n.viewerLogin.value,d=l.find(e=>e.login===u);d&&(s.value={id:d.id,url:d.url});let f=t.getDiff()?.head?.sha,p=e=>({login:e.login,url:e.url,result:e.analysis.result,own:e.login===u,stale:e.analysis.headSha!==f}),m=l.find(e=>e.login===(a??`github-actions[bot]`));if(m){o!==void 0&&o.sharedBy===void 0?r.value=[p(m)]:await c(p(m));return}a&&(i.value=Ne(`share.notShared`,{login:a})),o||(r.value=l.map(p))}async function u(e){let t=r.value.find(t=>t.login===e);t?await c(t):await l(e)}function d(){r.value=[],i.value=void 0}async function f(){let r=t.getDiff(),i=t.getAiResult();if(r&&i&&!i.sharedBy){a.value=!0,o.value=void 0;try{let a=await n.write(()=>{let t=n.viewerLogin.value;if(!t)throw Error(Ne(`errors.noViewer`));return e.upsert(t,{headSha:r.head?.sha??``,result:i},s.value)});s.value=a;let o=t.getCacheKey();o&&await t.cache.diffs.setSharedComment(o,a)}catch(e){o.value=cn(e)}finally{a.value=!1}}}return{store:D({candidates:r,notice:i,viewerLogin:n.viewerLogin,canShare:n.canWrite,isSharing:a,error:o,ownComment:s,dismiss:d,load:u,share:f}),discover:l}}var wm=`This token cannot write to this repository. It needs the "repo" scope (classic token) or "Pull requests: Read and write" permission (fine-grained token).`;function Tm(e){let t=p(),n=p(),r=E(()=>t.value?.login),i=E(()=>!!t.value?.canWrite&&!n.value);async function a(){t.value=await e()}async function o(e){if(t.value||await a(),!t.value)throw Error(Ne(`errors.tokenRequired`));try{return await e()}catch(e){throw e instanceof Me&&e.name===`writeForbidden`&&(n.value=wm),e}}return{viewerLogin:r,canWrite:i,writeBlockedReason:n,resolve:a,write:o}}function Em(e,t){let{cache:n}=t,r=p(),i=p({}),a=p(!1),o=p(),s=p(!1),c=p(`llm`),l=p(),u=p(new Set),d=p(new Set),f=A(),m=A();g()&&T(()=>m.value?.abort());let h,_,v=Tm(e.viewer??(async()=>void 0)),y=e.reviews?Sm(e.reviews,{cache:n,access:v,getHeadSha:()=>r.value?.head?.sha,getCacheKey:()=>l.value,cachedData:()=>h}):void 0,b=E(()=>i.value[c.value]??i.value[`rule-based`]),x=E(()=>i.value.llm??i.value[`web-llm`]),S=E(()=>r.value&&b.value?hu(b.value.groups,r.value.files):[]),C=t.llm,w=C?Ye(async()=>{let{createLlmStore:e}=await import(`./llm-store-1j45N-6d.js`);return{createLlmStore:e}},__vite__mapDeps([8,1,9,10,11,12,7,13]),import.meta.url).then(({createLlmStore:e})=>{m.value=e({cache:n,runner:C,diff:r,session:f,getCacheKey:()=>l.value,setResult:e=>i.value={...i.value,llm:e},showLlmResult:()=>M(`llm`)})}):void 0;async function O(){r.value&&(u.value=await n.reviewMarks.get(r.value.files.map(e=>e.sha)))}async function k(e,t){await n.reviewMarks.set(e,t);let i=new Set(u.value);for(let n of e)t?i.add(n):i.delete(n);u.value=i;let a=new Set(e),o=r.value?.files.filter(e=>a.has(e.sha)).map(e=>e.path)??[];if(!o.some(e=>d.value.has(e)))return;let s=new Set(d.value);for(let e of o)s.delete(e);d.value=s,l.value&&await n.diffs.setChangedSinceReviewed(l.value,[...s])}async function j(e){if(!r.value)return;let t=await Ge(e).analyze(r.value);i.value={...i.value,[e]:t}}I(Pe.global.locale,()=>{for(let e of[`rule-based`,`none`])i.value[e]&&j(e)});async function M(e){c.value=e,e!==`llm`&&i.value[e]===void 0&&await j(e)}async function ee(e){let t=e.source;(t===`llm`||t===`web-llm`)&&(m.value?.abort(),i.value={...i.value,[t]:e},f.value=void 0,c.value=t,l.value&&(await n.diffs.setAnalyzedResult(l.value,t,e),await n.diffs.setLlmSession(l.value,void 0)))}let N=e.sharing?Cm(e.sharing,{cache:n,access:v,getDiff:()=>r.value,getCacheKey:()=>l.value,getAiResult:()=>x.value,cachedComment:()=>_,applyResult:ee}):void 0;async function P(e,t){r.value=t.diff,l.value=e,d.value=new Set(t.changedSinceReviewed),i.value={...t.analyzedBy,"rule-based":await Ve.analyze(t.diff)},f.value=t.llmSession,await O()}async function te(e,t){m.value?.abort(),await P(e,await n.diffs.putDiff(e,t,t.head?.sha??``));let r=c.value;r!==`rule-based`&&r!==`llm`&&await j(r)}async function F(){await te(await e.key(),await e.fetch())}async function L(t){if(e.fingerprint)try{if(await e.fingerprint()===t)return;nt.value?await ne():s.value=!0}catch{}}async function R(){a.value=!0,o.value=void 0,s.value=!1;try{let r=await e.key(),i=await n.diffs.get(r);i?(h=i.reviews,_=i.sharedComment,await n.diffs.touch(r),await P(r,i),L(i.headSha)):await F(),y?.load(),N?.discover(t.from),await w}catch(e){o.value=e instanceof Error?e:Error(String(e))}finally{a.value=!1}}async function ne(){a.value=!0,o.value=void 0;try{await F(),s.value=!1,y?.load(),N?.discover()}catch(e){o.value=e instanceof Error?e:Error(String(e))}finally{a.value=!1}}let{loadFile:re}=e,ie=re&&{async load(e){let t=r.value,i=l.value;if(!t?.base||!t.head||!i)throw Error(Ne(`errors.diffNotLoaded`));let a=async(e,t)=>{let r=await n.fileContents.get(i,t,e);if(r!==void 0)return r;let a=await re(e,t);return a!==void 0&&await n.fileContents.set(i,t,e,a),a},[o,s]=await Promise.all([e.status===`added`?void 0:a(e.previousPath??e.path,t.base.sha),e.status===`removed`?void 0:a(e.path,t.head.sha)]);return{old:o,new:s}}},z=D({layout:yt,setLayout:e=>{yt.value=e}});return D({diff:r,grouped:b,isLoading:a,error:o,isStale:s,reviewed:u,changedSinceReviewed:d,groups:S,aiResult:x,analyzeMode:c,setAnalyzeMode:M,ui:z,llm:m,reviews:y,shared:N?.store,fileContent:ie,canRefresh:!!e.fingerprint,auth:e.auth,load:R,refresh:ne,setReviewed:k})}export{nr as a,ir as i,bm as n,or as o,ar as r,Vn as s,Em as t};
|