diffhub 0.1.2 → 0.1.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/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/api/comments/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/comments/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/diff/route.js +3 -2
- package/.next/standalone/apps/web/.next/server/app/api/diff/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/discard/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/discard/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/file/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/file/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/files/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/open/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/open/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +12 -12
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +12 -12
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +6 -6
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/page/react-loadable-manifest.json +1 -2
- package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/[externals]_shiki_wasm_0~fgmgp._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__01.zj5h._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0tbrp5x._.js +13 -0
- package/.next/standalone/apps/web/.next/server/chunks/_0r24f4c._.js +69 -0
- package/.next/standalone/apps/web/.next/server/chunks/node_modules_@pierre_theme_dist_pierre-dark_mjs_0ojo3_n._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/node_modules_@pierre_theme_dist_pierre-light_mjs_0pw9wwg._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/0fuv_@swc_helpers_cjs__interop_require_default_cjs_0ghzfn9._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0bit3~x._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{_0qo42r0._.js → _0m1v4-9._.js} +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0oc3qg_._.js +3 -3
- package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/01f1ms~jsc5vh.js +138 -0
- package/.next/standalone/apps/web/.next/static/chunks/0c7yx0ttmhb4s.js +63 -0
- package/.next/standalone/apps/web/.next/static/chunks/0ogqv_xj2r0c6.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0qp8t.3t~v6um.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/130i667qy-j80.css +3 -0
- package/.next/standalone/apps/web/.next/static/chunks/15uwrard~z-l5.js +16 -0
- package/.next/standalone/apps/web/package.json +1 -1
- package/bin/diffhub.mjs +25 -1
- package/package.json +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0gf_xk6._.js +0 -13
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0t.tl18._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0jit913._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0v19a7g._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0f40lcw._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0v8w2j~._.js +0 -70
- package/.next/standalone/apps/web/.next/static/chunks/00zp83w4g1v1r.js +0 -16
- package/.next/standalone/apps/web/.next/static/chunks/042ip11u2i2z6.js +0 -138
- package/.next/standalone/apps/web/.next/static/chunks/07ndp5x2cvqo..css +0 -3
- package/.next/standalone/apps/web/.next/static/chunks/085s9eg867ha-.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0_vmme_k_ff_u.js +0 -67
- package/.next/standalone/apps/web/.next/static/chunks/0ap~_hc7r17_6.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0nt5-rwas5thn.js +0 -67
- package/.next/standalone/apps/web/.next/static/chunks/0p~3-4_.v0cft.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0wx-2dr44ql-g.js +0 -1
- /package/.next/standalone/apps/web/.next/static/{mAVCL4HCmtJwT35feBPdK → C1Ggd_ITpnb7yBHrIOODV}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{mAVCL4HCmtJwT35feBPdK → C1Ggd_ITpnb7yBHrIOODV}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{mAVCL4HCmtJwT35feBPdK → C1Ggd_ITpnb7yBHrIOODV}/_ssgManifest.js +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44011,34053,e=>{"use strict";e.s(["areSelectionsEqual",0,function(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}],44011);var t=e.i(6104);e.s(["createGutterUtilityElement",0,function(){return(0,t.createHastElement)({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[(0,t.createIconElement)({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}],34053)},76474,e=>{"use strict";e.s(["areSelectionPointsEqual",0,function(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}])},22671,51756,e=>{"use strict";var t=e.i(76474),n=e.i(44011),i=e.i(34053),r=e.i(27118),o=class{hoveredLine;hoveredToken;pre;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;renderedSelectionRange;selectionAnchor;queuedSelectionRender;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.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}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):null!=this.gutterUtilityContainer&&(this.gutterUtilityContainer.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,"gutterSelecting"===this.pointerSession.mode&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return null===this.renderedSelectionRange}setSelection(e){let t=!(e===this.selectedRange||(0,n.areSelectionsEqual)(e??void 0,this.selectedRange??void 0));(this.isSelectionDirty()||t)&&(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{if(null!=this.hoveredLine){if("diff"===this.mode&&"diff-line"===this.hoveredLine.type)return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if("file"===this.mode&&"line"===this.hoveredLine.type)return{lineNumber:this.hoveredLine.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;null==t&&null==n&&null==i&&null==o&&null==r||null!=this.options.onGutterUtilityClick&&c(e.composedPath())||(u(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{let{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;("disabled"!==t||a||null!=n||null!=i||null!=r||null!=o)&&(u(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;(u(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),null==this.hoveredLine&&null==this.hoveredToken)?u(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token"):(this.gutterUtilityContainer?.remove(),null!=this.hoveredToken&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),null!=this.hoveredLine&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()))};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,i=t.composedPath();u(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});let r=this.resolvePointerTarget(i);u(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);let{onLineClick:o,onLineNumberClick:a,onLineEnter:d,onLineLeave:h,onTokenClick:f,onTokenEnter:c,onTokenLeave:p,onHunkExpand:m,onMergeConflictActionClick:g}=this.options;switch(e){case"move":{let e=l(r)&&this.hoveredLine?.lineElement===r.lineElement;!(s(r)&&this.hoveredToken?.tokenElement===r.tokenElement)&&(null!=this.hoveredToken&&(p?.(this.hoveredToken,t),this.clearHoveredToken()),s(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),c?.(this.hoveredToken,t))),!e&&(null!=this.hoveredLine&&(this.gutterUtilityContainer?.remove(),h?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),l(r)&&(this.setHoveredLine(this.toEventBaseProps(r)),null!=this.gutterUtilityContainer&&r.numberElement.appendChild(this.gutterUtilityContainer),d?.({...this.hoveredLine,event:t})));break}case"click":{var v,b;if(null==r)break;if("kind"in(v=r)&&"merge-conflict-action"===v.kind&&null!=g){g(r);break}if("type"in(b=r)&&"line-info"===b.type&&null!=m){m(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?1/0:void 0);break}if(!l(r))break;s(r)&&null!=f&&f(this.toTokenEventBaseProps(r),t);let e=this.toEventBaseProps(r);null!=a&&r.numberColumn?a({...e,event:t}):null!=o&&o({...e,event:t})}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:a,onTokenClick:s,onTokenEnter:l,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:f,enableGutterUtility:c=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,g=null!=m,v="disabled"!==n||null!=i||null!=r||null!=o||null!=a||null!=s||null!=l||null!=d||null!=h||null!=f||c||p||g;if(v&&!this.hasPointerListeners){let n;e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,u(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(n=[],("both"===t||"click"===t)&&(null!=i&&n.push("onLineClick"),null!=r&&n.push("onLineNumberClick"),null!=h&&n.push("expandable hunk separators"),null!=f&&n.push("merge conflict actions")),n)),u(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),u(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")}else!v&&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 b="selecting"===this.pointerSession.mode||"pendingSingleLineUnselect"===this.pointerSession.mode,C="gutterSelecting"===this.pointerSession.mode;(!p&&b||!g&&C)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(null==this.pre)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=null!=e,r=null!=t||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if("mouse"===e.pointerType&&0!==e.button||null==this.pre||"idle"!==this.pointerSession.mode)return;let t=e.composedPath();c(t)&&null!=this.options.onGutterUtilityClick?this.startGutterSelectionFromPointerDown(e,t):this.startLineSelectionFromPointerDown(e,t)};startLineSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1}=this.options;if(!n)return;let i=this.getSelectionPointerInfo(t,!0);if(null==i)return;let{pre:r}=this;if(null==r)return;e.preventDefault();let{lineNumber:o,eventSide:a,lineIndex:s}=i;if(e.shiftKey&&null!=this.selectedRange){let t=this.getIndexesFromSelection(this.selectedRange,"split"===r.getAttribute("data-diff-type"));if(null==t)return;let n=t.start<=t.end?s>=t.start:s<=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(o,a,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===o&&this.selectedRange?.end===o){let t={lineNumber:o,side:a};this.selectionAnchor=t,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.selectedRange=null,this.selectionAnchor={lineNumber:o,side:a},this.updateSelection(o,a,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1,onGutterUtilityClick:i}=this.options;if(null==i)return;let r=this.getSelectionPointFromPath(t);null!=r&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:r},n&&(this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.selectedRange)),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:n=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointFromPath(e.composedPath());if(null==t)return;this.pointerSession.current=t,!0===n&&this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointerInfo(e.composedPath(),!1);if(null==t||null==this.selectionAnchor)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;let n=this.getSelectionPointerInfo(e.composedPath(),!1);if(null==n||null==this.selectionAnchor)return;let i={lineNumber:n.lineNumber,side:n.eventSide};if((0,t.areSelectionPointsEqual)(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.selectedRange),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let i=this.getSelectionPointFromPath(e.composedPath());null!=i&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()}};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.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){null!=this.hoveredLine&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t="disabled"}=this.options;null!=this.hoveredLine&&this.clearHoveredLine(),this.hoveredLine=e,"disabled"!==t&&(("both"===t||"line"===t)&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),("both"===t||"number"===t)&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){null!=this.hoveredToken&&(this.hoveredToken=void 0)}setHoveredToken(e){null!=this.hoveredToken&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(null==this.gutterUtilityContainer&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)null!=this.gutterUtilityButton&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),null==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,null==this.gutterUtilityButton){let e=document.createElement("div");e.innerHTML=(0,r.toHtml)((0,i.createGutterUtilityElement)());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)}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){"pendingSingleLineUnselect"===this.pointerSession.mode&&(this.pointerSession={mode:"idle"})}getSelectionPointerInfo(e,t){let n=this.resolvePointerTarget(e);if(a(n)&&(!t||n.numberColumn)&&null!=n.splitLineIndex)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:"diff"===this.mode?n.side:void 0}}getSelectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(a(t))return{lineNumber:t.lineNumber,side:"diff"===this.mode?t.side:void 0}}getLineIndex(e,t){let{getLineIndex:n}=this.options;return null!=n?n(e,t):[e-1,e-1]}updateSelection(e,t,i=!0){let r,{selectedRange:o}=this;if(null==e)r=null;else{let n=this.selectionAnchor?.side??t,i=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(i,e,n,t)}(0,n.areSelectionsEqual)(o??void 0,r??void 0)||(this.selectedRange=r,i&&this.notifySelectionChangeDelta(),this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection))}getIndexesFromSelection(e,t){if(null==this.pre)return;let n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return null!=n&&null!=i?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),null==this.pre||this.renderedSelectionRange===this.selectedRange)return;for(let e of this.pre.querySelectorAll("[data-selected-line]"))e.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,null==this.selectedRange)return;let{children:e}=this.pre;if(0===e.length)return;if(e.length>2)throw console.error(e),Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");let t="split"===this.pre.getAttribute("data-diff-type"),n=this.getIndexesFromSelection(this.selectedRange,t);if(null==n)throw console.error({rowRange:n,selectedRange:this.selectedRange}),Error("InteractionManager.renderSelection: No valid rowRange");let i=n.start===n.end,r=Math.min(n.start,n.end),o=Math.max(n.start,n.end);for(let n of e){let[e,a]=n.children,s=a.children.length;if(s!==e.children.length)throw Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let n=0;n<s;n++){let s=a.children[n],l=e.children[n];if(!(s instanceof HTMLElement)||!(l instanceof HTMLElement))continue;let d=this.parseLineIndex(s,t);if((d??0)>o)break;if(null==d||d<r)continue;let h=i?"single":d===r?"first":d===o?"last":"";s.setAttribute("data-selected-line",h),l.setAttribute("data-selected-line",h),l.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute("data-line-annotation")||s.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(i?(h="last",s.setAttribute("data-selected-line","first")):d===r?h="":d===o&&s.setAttribute("data-selected-line",""),s.nextSibling.setAttribute("data-selected-line",h),l.nextSibling.setAttribute("data-selected-line",h))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.selectedRange??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.selectedRange??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return"file"===this.mode?{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:i,tokenElement:r,tokenText:o}){return"file"===this.mode?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...null!=n?{side:n}:{},...n!==i&&null!=i?{endSide:i}:{}}}resolvePointerTarget(e){let t,n,i,r,o,a,s,l,c,u,p=!1;for(let d of e){if(!(d instanceof HTMLElement))continue;if(null==u&&d.hasAttribute("data-merge-conflict-action")){var m;let e=d.getAttribute("data-merge-conflict-action")??void 0,t=d.getAttribute("data-merge-conflict-conflict-index")??void 0,n=null!=t?Number.parseInt(t,10):NaN;("current"===(m=e)||"incoming"===m||"both"===m)&&Number.isFinite(n)&&(u={kind:"merge-conflict-action",resolution:e,conflictIndex:n})}if(null==a&&d.hasAttribute("data-char")){a=d;let e=d.getAttribute("data-char");if(null!=e){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=d.textContent??"",n=t+e.length;(""!==e.trim()||!0===this.options.enableTokenInteractionsOnWhitespace)&&(s={tokenElement:a,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=null==o?d.getAttribute("data-column-number")??void 0:void 0;if(null!=e){o=d,c=Number.parseInt(e,10),p=!0,t=f(d),r=d.getAttribute("data-line-index")??void 0;continue}let h=null==i?d.getAttribute("data-line")??void 0:void 0;if(null!=h){i=d,c=Number.parseInt(h,10),t=f(d),r=d.getAttribute("data-line-index")??void 0;continue}if(null==l&&(d.hasAttribute("data-expand-button")||d.hasAttribute("data-unmodified-lines"))){l={hunkIndex:void 0,direction:d.hasAttribute("data-expand-up")?"up":d.hasAttribute("data-expand-down")?"down":"both",all:d.hasAttribute("data-expand-all-button")};continue}let g=null!=l?d.getAttribute("data-expand-index")??void 0:void 0;if(null!=l&&null!=g){let e=Number.parseInt(g,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(null==n&&d.hasAttribute("data-code")){n=d;break}}if(null!=u)return u;if(l?.hunkIndex!=null)return{type:"line-info",hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=null!=r?d(n,`[data-line][data-line-index="${r}"]`):void 0,o??=null!=r?d(n,`[data-column-number][data-line-index="${r}"]`):void 0,null==n||null==i||null==o||null==t||null==c||Number.isNaN(c))return;let g=this.parseLineIndex(i,this.isSplitDiff());return null!=s?"file"===this.mode?{kind:"token",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:void 0,splitLineIndex:g,...s}:{kind:"token",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:h(t,n),splitLineIndex:g,...s}:"file"===this.mode?{kind:"line",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:void 0,splitLineIndex:g}:{kind:"line",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:h(t,n),splitLineIndex:g}}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));return t&&2===n.length?n[1]:t?void 0:n[0]}};function a(e){return null!=e&&"kind"in e&&"line"===e.kind}function s(e){return null!=e&&"kind"in e&&"token"===e.kind}function l(e){return a(e)||s(e)}function d(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function h(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function f(e){let t=e.getAttribute("data-line-type");if(null!=t)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function c(e){for(let t of e)if(t instanceof HTMLElement&&t.hasAttribute("data-utility-button"))return!0;return!1}function u(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if("click"!==t)return;break;case"move":if("move"!==t)return}console.log(...n)}e.s(["InteractionManager",0,o,"pluckInteractionOptions",0,function({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,enableHoverUtility:n,lineHoverHighlight:i,onGutterUtilityClick:r,onLineClick:o,onLineEnter:a,onLineLeave:s,onLineNumberClick:l,onTokenClick:d,onTokenEnter:h,onTokenLeave:f,renderGutterUtility:c,renderHoverUtility:u,__debugPointerEvents:p,enableLineSelection:m,onLineSelected:g,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:C},x,S,y){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:function({enableGutterUtility:e,enableHoverUtility:t,renderGutterUtility:n,renderHoverUtility:i,onGutterUtilityClick:r}){if(void 0!==e&&void 0!==t)throw Error("Cannot use both 'enableGutterUtility' and deprecated 'enableHoverUtility'. Use only 'enableGutterUtility'.");if(null!=n&&null!=i)throw Error("Cannot use both 'renderGutterUtility' and deprecated 'renderHoverUtility'. Use only 'renderGutterUtility'.");if(null!=r&&(null!=n||null!=i))throw Error("Cannot use both 'onGutterUtilityClick' and render utility callbacks ('renderGutterUtility'/'renderHoverUtility'). Use only one gutter utility API.");return e??t??!1}({enableGutterUtility:t,enableHoverUtility:n,renderGutterUtility:c,renderHoverUtility:u,onGutterUtilityClick:r}),usesCustomGutterUtility:null!=c||null!=u,lineHoverHighlight:i,onGutterUtilityClick:r,onHunkExpand:x,onMergeConflictActionClick:y,onLineClick:o,onLineEnter:a,onLineLeave:s,onLineNumberClick:l,onTokenClick:d,onTokenEnter:h,onTokenLeave:f,__debugPointerEvents:p,enableLineSelection:m,onLineSelected:g,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:C,getLineIndex:S}}],22671);var p=class{observedNodes=new Map;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.queuedUpdates.clear()}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);let n=e.querySelectorAll("code"),i=new Map(this.observedNodes);for(let e of(this.observedNodes.clear(),n)){let t=i.get(e);if(null!=t&&"code"!==t.type)throw Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let n=e.firstElementChild;n instanceof HTMLElement||(n=null),null!=t?(this.observedNodes.set(e,t),i.delete(e),t.numberElement!==n?(null!=t.numberElement&&this.resizeObserver.unobserve(t.numberElement),null!=n&&(this.resizeObserver.observe(n),i.delete(n),this.observedNodes.set(n,t)),t.numberElement=n):null!=t.numberElement&&(i.delete(t.numberElement),this.observedNodes.set(t.numberElement,t))):(t={type:"code",codeElement:e,numberElement:n,codeWidth:"auto",numberWidth:0},this.observedNodes.set(e,t),this.resizeObserver.observe(e),null!=n&&(this.observedNodes.set(n,t),this.resizeObserver.observe(n)))}if(n.length>1&&!t){let t=e.querySelectorAll('[data-line-annotation*=","]'),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let{lineAnnotation:t=""}=e.dataset;if(!/^\d+,\d+$/.test(t)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:t,element:e});continue}let i=n.get(t);null==i&&(i=[],n.set(t,i)),i.push(e)}for(let[e,t]of n){if(2!==t.length){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",e,t);continue}let[n,r]=t,o=n.firstElementChild,a=r.firstElementChild;if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||!(o instanceof HTMLElement)||!(a instanceof HTMLElement))continue;let s=i.get(o);if(null!=s){this.observedNodes.set(o,s),this.observedNodes.set(a,s),i.delete(o),i.delete(a);continue}let l=Math.max((s={type:"annotations",column1:{container:n,child:o,childHeight:o.getBoundingClientRect().height},column2:{container:r,child:a,childHeight:a.getBoundingClientRect().height},currentHeight:"auto"}).column1.childHeight,s.column2.childHeight);this.applyNewHeight(s,l),this.observedNodes.set(o,s),this.observedNodes.set(a,s),this.resizeObserver.observe(o),this.resizeObserver.observe(a)}}for(let e of i.keys())e.isConnected&&(e.style.removeProperty("--diffs-column-content-width"),e.style.removeProperty("--diffs-column-number-width"),e.style.removeProperty("--diffs-column-width"),e.parentElement instanceof HTMLElement&&e.parentElement.style.removeProperty("--diffs-annotation-min-height")),this.resizeObserver.unobserve(e);i.clear()}handleResizeObserver=e=>{for(let t of e){let{target:e,borderBoxSize:n}=t;if(!(e instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",t);continue}let i=this.observedNodes.get(e);if(null==i){console.error("FileDiff.handleResizeObserver: Not a valid observed node",t);continue}let r=n[0];if("annotations"===i.type){let t=e===i.column1.child?i.column1:e===i.column2.child?i.column2:void 0;if(null==t){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:i,target:e});continue}t.childHeight=r.blockSize;let n=Math.max(i.column1.childHeight,i.column2.childHeight);this.applyNewHeight(i,n)}else if("code"===i.type){let t=[e,r.inlineSize],n=this.queuedUpdates.get(i)??[];n.push(t),this.queuedUpdates.set(i,n)}}this.handleColumnChange()};handleColumnChange=()=>{for(let[e,t]of this.queuedUpdates)for(let[n,i]of t)if(n===e.codeElement){let n=Math.max(Math.floor(i),0);if(n!==e.codeWidth){let t=Math.max(n-e.numberWidth,0);e.codeWidth=0===n?"auto":n,e.codeElement.style.setProperty("--diffs-column-content-width",`${t>0?`${t}px`:"auto"}`),e.codeElement.style.setProperty("--diffs-column-width",`${"number"==typeof e.codeWidth?`${e.codeWidth}px`:"auto"}`)}null!=e.numberElement&&"number"==typeof e.codeWidth&&0===e.numberWidth&&t.push([e.numberElement,e.numberElement.getBoundingClientRect().width])}else if(n===e.numberElement){let t=Math.max(Math.ceil(i),0);if(t!==e.numberWidth&&(e.numberWidth=t,e.codeElement.style.setProperty("--diffs-column-number-width",`${0===e.numberWidth?"auto":`${e.numberWidth}px`}`),"auto"!==e.codeWidth)){let t=Math.max(e.codeWidth-e.numberWidth,0);e.codeElement.style.setProperty("--diffs-column-content-width",`${0===t?"auto":`${t}px`}`)}}this.queuedUpdates.clear()};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`))}};e.s(["ResizeManager",0,p],51756)},84324,82994,e=>{"use strict";var t=e.i(22256);e.s(["areLanguagesAttached",0,function(e){for(let n of Array.isArray(e)?e:[e])if(!t.AttachedLanguages.has(n))return!1;return!0}],84324);var n=e.i(86309),i=e.i(51045);e.s(["areThemesAttached",0,function(e){for(let t of(0,i.getThemes)(e))if(!n.AttachedThemes.has(t))return!1;return!0}],82994)},25106,e=>{"use strict";e.s(["areRenderRangesEqual",0,function(e,t){return null==e||null==t?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}])},24183,e=>{"use strict";var t=e.i(6104);e.s(["createAnnotationElement",0,function(e){return(0,t.createHastElement)({tagName:"div",children:[(0,t.createHastElement)({tagName:"div",children:e.annotations?.map(e=>(0,t.createHastElement)({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}])},34481,78641,45786,82856,e=>{"use strict";var t=e.i(27101),n=e.i(6104);function i(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 r({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:o,totalLines:a,type:s,customProperties:l}){return{...l,"data-diff":"diff"===s?"":void 0,"data-file":"file"===s?"":void 0,"data-diff-type":"diff"===s?o?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":"bars"===e||"classic"===e?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}e.s(["getIconForType",0,i],78641),e.s(["createFileHeaderElement",0,function({fileOrDiff:e,mode:r}){let o="type"in e?e:void 0,a={"data-diffs-header":r,"data-change-type":o?.type};return(0,n.createHastElement)({tagName:"div",children:["custom"===r?(0,n.createHastElement)({tagName:"slot",properties:{name:t.CUSTOM_HEADER_SLOT_ID}}):function({name:e,prevName:r,iconType:o}){let a=[(0,n.createHastElement)({tagName:"slot",properties:{name:t.HEADER_PREFIX_SLOT_ID}}),(0,n.createIconElement)({name:i(o),properties:{"data-change-icon":o}})];return null!=r&&(a.push((0,n.createHastElement)({tagName:"div",children:[(0,n.createHastElement)({tagName:"bdi",children:[(0,n.createTextNodeElement)(r)]})],properties:{"data-prev-name":""}})),a.push((0,n.createIconElement)({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),a.push((0,n.createHastElement)({tagName:"div",children:[(0,n.createHastElement)({tagName:"bdi",children:[(0,n.createTextNodeElement)(e)]})],properties:{"data-title":""}})),(0,n.createHastElement)({tagName:"div",children:a,properties:{"data-header-content":""}})}({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:o?.type??"file"}),..."custom"===r?[]:[function(e){let i=[];if(null!=e){let t=0,r=0;for(let n of e.hunks)t+=n.additionLines,r+=n.deletionLines;(r>0||0===t)&&i.push((0,n.createHastElement)({tagName:"span",children:[(0,n.createTextNodeElement)(`-${r}`)],properties:{"data-deletions-count":""}})),(t>0||0===r)&&i.push((0,n.createHastElement)({tagName:"span",children:[(0,n.createTextNodeElement)(`+${t}`)],properties:{"data-additions-count":""}}))}return i.push((0,n.createHastElement)({tagName:"slot",properties:{name:t.HEADER_METADATA_SLOT_ID}})),(0,n.createHastElement)({tagName:"div",children:i,properties:{"data-metadata":""}})}(o)]],properties:a})}],34481),e.s(["createPreElement",0,function(e){return(0,n.createHastElement)({tagName:"pre",properties:r(e)})},"createPreWrapperProperties",0,r],45786);var o=e.i(51045);e.s(["getHighlighterOptions",0,function(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:(0,o.getThemes)(t),preferredHighlighter:n}}],82856)},2612,e=>{"use strict";e.s(["getLineAnnotationName",0,function(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}])},41914,e=>{"use strict";var t=e.i(6104);e.s(["createContentColumn",0,function(e,n){return(0,t.createHastElement)({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${n}`}})}])},47535,83981,44477,32547,61647,93946,36635,45705,50925,116,60654,e=>{"use strict";var t=e.i(27101),n=e.i(6104),i=e.i(84324),r=e.i(30891),o=e.i(51045),a=e.i(82994),s=e.i(16049),l=e.i(25106),d=e.i(8456),h=e.i(24183),f=e.i(41914),c=e.i(34481),u=e.i(45786),p=e.i(35864),m=e.i(82856),g=e.i(2612),v=e.i(82189),b=e.i(6609),C=e.i(59390),x=e.i(16876);function S(e){return!0===e.useTokenTransformer||null!=e.onTokenClick||null!=e.onTokenEnter||null!=e.onTokenLeave}e.s(["shouldUseTokenTransformer",0,S],83981);var y=e.i(27118);let L=-1;var k=class{__id=`file-renderer:${++L}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:t.DEFAULT_THEMES},n,i){this.options=e,this.onRenderUpdate=n,this.workerManager=i,i?.isWorkingPool()!==!0&&(this.highlighter=(0,a.areThemesAttached)(e.theme??t.DEFAULT_THEMES)?(0,r.getHighlighterIfLoaded)():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){for(let t of(this.lineAnnotations={},e)){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0,this.lineCache=void 0}hydrate(e){let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getFileResultCache(e);null==n||E(t,n.options)||(n=void 0),this.renderCache??={file:e,options:t,highlighted:!(0,v.isFilePlainText)(e),result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?null==this.renderCache.result&&this.workerManager.highlightFileAST(this,e):null==this.highlighter&&(this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name),this.initializeHighlighter())}getRenderOptions(e){let n=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();let{theme:e=t.DEFAULT_THEMES,tokenizeMaxLineLength:n=1e3}=this.options;return{theme:e,useTokenTransformer:S(this.options),tokenizeMaxLineLength:n}})(),{renderCache:i}=this;return i?.result!=null&&e===i.file&&E(n,i.options)?{options:n,forceRender:!1}:{options:n,forceRender:!0}}getOrCreateLineCache(e){if(null==e.cacheKey)return this.lineCache=void 0,(0,C.splitFileContents)(e.contents);let{lineCache:t}=this;return(null==t||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:(0,C.splitFileContents)(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,n=t.DEFAULT_RENDER_RANGE){if(null==e)return;let r=this.workerManager?.getFileResultCache(e);null!=r&&null==this.renderCache&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r});let{options:o,forceRender:s}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:o,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)null!=this.renderCache.result&&(this.renderCache.highlighted||e===this.renderCache.file&&(0,l.areRenderRangesEqual)(this.renderCache.renderRange,n))||(this.renderCache.file=e,this.renderCache.result=this.workerManager.getPlainFileAST(e,n.startingLine,n.totalLines,this.getOrCreateLineCache(e)),this.renderCache.renderRange=n),n.totalLines>0&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,a.areThemesAttached)(o.theme),n=null!=this.highlighter&&(0,i.areLanguagesAttached)(this.computedLang);if(null!=this.highlighter&&t&&(s||!this.renderCache.highlighted&&n||null==this.renderCache.result)){let{result:t,options:i}=this.renderFileWithHighlighter(e,this.highlighter,!n);this.renderCache={file:e,options:i,highlighted:n,result:t,renderRange:void 0}}t&&n||this.asyncHighlight(e).then(({result:t,options:n})=>{null!=this.renderCache&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n)})}return null!=this.renderCache.result?this.processFileResult(this.renderCache.file,n,this.renderCache.result):void 0}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){let{result:i}=await this.asyncHighlight(e);return this.processFileResult(e,n,i)}async asyncHighlight(e){this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,s.hasResolvedThemes)((0,o.getThemes)(this.options.theme)),n=null!=this.highlighter&&(0,i.areLanguagesAttached)(this.computedLang);return null!=this.highlighter&&t&&n||(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e);return{result:(0,x.renderFileWithHighlighter)(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:i,themeStyles:r,baseThemeType:o}){let{disableFileHeader:a=!1}=this.options,s=[],l=(0,n.createGutterWrapper)(),d=this.getOrCreateLineCache(e),f=0;return(0,b.iterateOverFile)({lines:d,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:t,lineNumber:r})=>{let o=i[t];if(null==o){let n="FileRenderer.processFileResult: Line doesnt exist";throw console.error(n,{name:e.name,lineIndex:t,lineNumber:r,lines:d}),Error(n)}if(null!=o){l.children.push((0,n.createGutterItem)("context",r,`${t}`)),s.push(o),f++;let e=this.lineAnnotations[r];null!=e&&(l.children.push((0,n.createGutterGap)("context","annotation",1)),s.push((0,h.createAnnotationElement)({type:"annotation",hunkIndex:0,lineIndex:r,annotations:e.map(e=>(0,g.getLineAnnotationName)(e))})),f++)}}}),l.properties.style=`grid-row: span ${f}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(d.length),headerAST:a?void 0:this.renderHeader(e),totalLines:d.length,rowCount:f,themeStyles:r,baseThemeType:o,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){let{headerRenderMode:t="default"}=this.options;return(0,c.createFileHeaderElement)({fileOrDiff:e,mode:t})}renderFullHTML(e){return(0,y.toHtml)(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push((0,n.createHastElement)({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){let t=(0,n.createGutterWrapper)();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,(0,f.createContentColumn)(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?(0,y.toHtml)((0,n.createHastElement)({tagName:"code",children:e,properties:{"data-code":""}})):(0,y.toHtml)(e)}async initializeHighlighter(){return this.highlighter=await (0,r.getSharedHighlighter)((0,m.getHighlighterOptions)(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(null==this.renderCache)return;let i=this.renderCache.file!==e||!this.renderCache.highlighted||!E(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return(0,u.createPreElement)({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function E(e,t){return(0,d.areThemesEqual)(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}e.s(["FileRenderer",0,k],47535);let A=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
2
|
-
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
3
|
-
<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"/>
|
|
4
|
-
</symbol>
|
|
5
|
-
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
6
|
-
<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"/>
|
|
7
|
-
</symbol>
|
|
8
|
-
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
9
|
-
<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"/>
|
|
10
|
-
</symbol>
|
|
11
|
-
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
12
|
-
<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"/>
|
|
13
|
-
</symbol>
|
|
14
|
-
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
15
|
-
<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"/>
|
|
16
|
-
</symbol>
|
|
17
|
-
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
18
|
-
<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"/>
|
|
19
|
-
</symbol>
|
|
20
|
-
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
21
|
-
<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"/>
|
|
22
|
-
</symbol>
|
|
23
|
-
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
24
|
-
<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"/>
|
|
25
|
-
</symbol>
|
|
26
|
-
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
27
|
-
<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"/>
|
|
28
|
-
</symbol>
|
|
29
|
-
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
30
|
-
<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"/>
|
|
31
|
-
</symbol>
|
|
32
|
-
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
33
|
-
<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"/>
|
|
34
|
-
</symbol>
|
|
35
|
-
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
36
|
-
<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"/>
|
|
37
|
-
</symbol>
|
|
38
|
-
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
39
|
-
<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"/>
|
|
40
|
-
</symbol>
|
|
41
|
-
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
42
|
-
<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"/>
|
|
43
|
-
</symbol>
|
|
44
|
-
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
45
|
-
<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"/>
|
|
46
|
-
</symbol>
|
|
47
|
-
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
48
|
-
<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"/>
|
|
49
|
-
</symbol>
|
|
50
|
-
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
51
|
-
<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"/>
|
|
52
|
-
</symbol>
|
|
53
|
-
</svg>`;e.s(["SVGSpriteSheet",0,A],44477),e.s(["areLineAnnotationsEqual",0,function(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}],32547);let w={};e.s(["arePrePropertiesEqual",0,function(e,t){return null==e||null==t?e===t:function(e=w,t=w){if(e===t)return!0;let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let i of n)if(e[i]!==t[i])return!1;return!0}(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}],61647),e.s(["createAnnotationWrapperNode",0,function(e){let t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}],93946),e.s(["createGutterUtilityContentNode",0,function(){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}],36635),e.s(["createUnsafeCSSStyleNode",0,function(){let e=document.createElement("style");return e.setAttribute(t.UNSAFE_CSS_ATTRIBUTE,""),e}],45705);var T="@layer base, theme, rendered, unsafe;\n\n@layer base {\n :host {\n --diffs-font-fallback:\n 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono',\n 'Courier New', monospace;\n --diffs-header-font-fallback:\n system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',\n 'Noto Sans', 'Liberation Sans', Arial, sans-serif;\n\n --diffs-mixer: light-dark(black, white);\n --diffs-gap-fallback: 8px;\n\n --diffs-added-light: #0dbe4e;\n --diffs-added-dark: #5ecc71;\n --diffs-modified-light: #009fff;\n --diffs-modified-dark: #69b1ff;\n --diffs-deleted-light: #ff2e3f;\n --diffs-deleted-dark: #ff6762;\n\n /*\n // Available CSS Color Overrides\n --diffs-bg-buffer-override\n --diffs-bg-hover-override\n --diffs-bg-context-override\n --diffs-bg-separator-override\n\n --diffs-fg-number-override\n --diffs-fg-number-addition-override\n --diffs-fg-number-deletion-override\n --diffs-fg-conflict-marker-override\n\n --diffs-deletion-color-override\n --diffs-addition-color-override\n --diffs-modified-color-override\n\n --diffs-bg-deletion-override\n --diffs-bg-deletion-number-override\n --diffs-bg-deletion-hover-override\n --diffs-bg-deletion-emphasis-override\n\n --diffs-bg-addition-override\n --diffs-bg-addition-number-override\n --diffs-bg-addition-hover-override\n --diffs-bg-addition-emphasis-override\n\n // Line Selection Color Overrides (for enableLineSelection)\n --diffs-selection-color-override\n --diffs-bg-selection-override\n --diffs-bg-selection-number-override\n --diffs-bg-selection-background-override\n --diffs-bg-selection-number-background-override\n\n // Available CSS Layout Overrides\n --diffs-gap-inline\n --diffs-gap-block\n --diffs-gap-style\n --diffs-tab-size\n */\n\n color-scheme: light dark;\n display: block;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n font-feature-settings: var(--diffs-font-features);\n\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n --diffs-bg: light-dark(\n var(--diffs-light-bg, #fff),\n var(--diffs-dark-bg, #000)\n );\n --diffs-bg-buffer: var(\n --diffs-bg-buffer-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))\n )\n );\n --diffs-bg-hover: var(\n --diffs-bg-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))\n )\n );\n\n --diffs-bg-context: var(\n --diffs-bg-context-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))\n )\n );\n --diffs-bg-context-number: var(\n --diffs-bg-context-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-marker: var(\n --diffs-bg-conflict-marker-override,\n light-dark(\n color-mix(\n in lab,\n var(--diffs-bg-context) 88%,\n var(--diffs-modified-base)\n ),\n color-mix(\n in lab,\n var(--diffs-bg-context) 80%,\n var(--diffs-modified-base)\n )\n )\n );\n --diffs-bg-conflict-current: var(\n --diffs-bg-conflict-current-override,\n light-dark(#e5f8ea, #274432)\n );\n --diffs-bg-conflict-base: var(\n --diffs-bg-conflict-base-override,\n light-dark(\n color-mix(\n in lab,\n var(--diffs-bg-context) 90%,\n var(--diffs-modified-base)\n ),\n color-mix(\n in lab,\n var(--diffs-bg-context) 82%,\n var(--diffs-modified-base)\n )\n )\n );\n --diffs-bg-conflict-incoming: var(\n --diffs-bg-conflict-incoming-override,\n light-dark(#e6f1ff, #253b5a)\n );\n --diffs-bg-conflict-marker-number: var(\n --diffs-bg-conflict-marker-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-conflict-marker) 72%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-conflict-marker) 54%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-current-number: var(\n --diffs-bg-conflict-current-number-override,\n light-dark(#d7f1de, #30533d)\n );\n --diffs-bg-conflict-base-number: var(\n --diffs-bg-conflict-base-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-conflict-base) 72%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-conflict-base) 54%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-incoming-number: var(\n --diffs-bg-conflict-incoming-number-override,\n light-dark(#d8e8ff, #2f4b73)\n );\n --conflict-bg-current: var(\n --conflict-bg-current-override,\n var(--diffs-bg-addition)\n );\n --conflict-bg-incoming: var(\n --conflict-bg-incoming-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-number: var(\n --conflict-bg-current-number-override,\n var(--diffs-bg-addition-number)\n );\n --conflict-bg-incoming-number: var(\n --conflict-bg-incoming-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-header: var(\n --conflict-bg-current-header-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 78%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 68%, var(--diffs-addition-base))\n )\n );\n --conflict-bg-incoming-header: var(\n --conflict-bg-incoming-header-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 78%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 68%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-header-number: var(\n --conflict-bg-current-header-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 72%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 62%, var(--diffs-addition-base))\n )\n );\n --conflict-bg-incoming-header-number: var(\n --conflict-bg-incoming-header-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 72%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 62%, var(--diffs-modified-base))\n )\n );\n\n --diffs-bg-separator: var(\n --diffs-bg-separator-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))\n )\n );\n\n --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));\n --diffs-fg-number: var(\n --diffs-fg-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))\n )\n );\n --diffs-fg-conflict-marker: var(\n --diffs-fg-conflict-marker-override,\n var(--diffs-fg-number)\n );\n\n --diffs-deletion-base: var(\n --diffs-deletion-color-override,\n light-dark(\n var(\n --diffs-light-deletion-color,\n var(--diffs-deletion-color, var(--diffs-deleted-light))\n ),\n var(\n --diffs-dark-deletion-color,\n var(--diffs-deletion-color, var(--diffs-deleted-dark))\n )\n )\n );\n --diffs-addition-base: var(\n --diffs-addition-color-override,\n light-dark(\n var(\n --diffs-light-addition-color,\n var(--diffs-addition-color, var(--diffs-added-light))\n ),\n var(\n --diffs-dark-addition-color,\n var(--diffs-addition-color, var(--diffs-added-dark))\n )\n )\n );\n --diffs-modified-base: var(\n --diffs-modified-color-override,\n light-dark(\n var(\n --diffs-light-modified-color,\n var(--diffs-modified-color, var(--diffs-modified-light))\n ),\n var(\n --diffs-dark-modified-color,\n var(--diffs-modified-color, var(--diffs-modified-dark))\n )\n )\n );\n\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n --diffs-bg-deletion: var(\n --diffs-bg-deletion-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-number: var(\n --diffs-bg-deletion-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-hover: var(\n --diffs-bg-deletion-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-emphasis: var(\n --diffs-bg-deletion-emphasis-override,\n light-dark(\n rgb(from var(--diffs-deletion-base) r g b / 0.15),\n rgb(from var(--diffs-deletion-base) r g b / 0.2)\n )\n );\n\n --diffs-bg-addition: var(\n --diffs-bg-addition-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-number: var(\n --diffs-bg-addition-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-hover: var(\n --diffs-bg-addition-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-emphasis: var(\n --diffs-bg-addition-emphasis-override,\n light-dark(\n rgb(from var(--diffs-addition-base) r g b / 0.15),\n rgb(from var(--diffs-addition-base) r g b / 0.2)\n )\n );\n\n --diffs-selection-base: var(--diffs-modified-base);\n --diffs-selection-number-fg: light-dark(\n color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))\n );\n --diffs-bg-selection: var(\n --diffs-bg-selection-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)),\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base))\n )\n );\n --diffs-bg-selection-number: var(\n --diffs-bg-selection-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)),\n color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base))\n )\n );\n\n background-color: var(--diffs-bg);\n color: var(--diffs-fg);\n }\n\n /* NOTE(mdo): Some semantic HTML elements (e.g. `pre`, `code`) have default\n * user-agent styles. These must be overridden to use our custom styles. */\n pre,\n code,\n [data-error-wrapper] {\n isolation: isolate;\n margin: 0;\n padding: 0;\n display: block;\n outline: none;\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n }\n\n pre,\n code {\n background-color: var(--diffs-bg);\n }\n\n code {\n contain: content;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n [data-icon-sprite] {\n display: none;\n }\n\n /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset\n * their font-family explicitly. */\n [data-diffs-header],\n [data-separator] {\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n }\n\n [data-file-info] {\n padding: 10px;\n font-weight: 700;\n color: var(--fg);\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n background-color: color-mix(in lab, var(--bg) 98%, var(--fg));\n border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));\n }\n\n [data-diff],\n [data-file] {\n /* This feels a bit crazy to me... so I need to think about it a bit more... */\n --diffs-grid-number-column-width: minmax(min-content, max-content);\n --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;\n\n &[data-dehydrated] {\n --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);\n }\n\n &:hover [data-code]::-webkit-scrollbar-thumb {\n background-color: var(--diffs-bg-context);\n }\n }\n\n [data-line] span {\n color: light-dark(\n var(--diffs-token-light, var(--diffs-light)),\n var(--diffs-token-dark, var(--diffs-dark))\n );\n background-color: light-dark(\n var(--diffs-token-light-bg, inherit),\n var(--diffs-token-dark-bg, inherit)\n );\n font-weight: light-dark(\n var(--diffs-token-light-font-weight, inherit),\n var(--diffs-token-dark-font-weight, inherit)\n );\n font-style: light-dark(\n var(--diffs-token-light-font-style, inherit),\n var(--diffs-token-dark-font-style, inherit)\n );\n -webkit-text-decoration: light-dark(\n var(--diffs-token-light-text-decoration, inherit),\n var(--diffs-token-dark-text-decoration, inherit)\n );\n text-decoration: light-dark(\n var(--diffs-token-light-text-decoration, inherit),\n var(--diffs-token-dark-text-decoration, inherit)\n );\n }\n\n [data-line],\n [data-gutter-buffer],\n [data-line-annotation],\n [data-no-newline] {\n color: var(--diffs-fg);\n background-color: var(--diffs-line-bg, var(--diffs-bg));\n }\n\n [data-no-newline] {\n -webkit-user-select: none;\n user-select: none;\n\n span {\n opacity: 0.6;\n }\n }\n\n [data-diff-type='split'][data-overflow='scroll'] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n\n [data-additions] {\n border-left: 1px solid var(--diffs-bg);\n }\n\n [data-deletions] {\n border-right: 1px solid var(--diffs-bg);\n }\n }\n\n [data-code] {\n display: grid;\n grid-auto-flow: dense;\n grid-template-columns: var(--diffs-code-grid);\n overflow: scroll clip;\n overscroll-behavior-x: none;\n tab-size: var(--diffs-tab-size, 2);\n align-self: flex-start;\n padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));\n padding-bottom: max(\n 0px,\n calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px)\n );\n }\n\n [data-container-size] {\n container-type: inline-size;\n }\n\n [data-code]::-webkit-scrollbar {\n width: 0;\n height: 6px;\n }\n\n [data-code]::-webkit-scrollbar-track {\n background: transparent;\n }\n\n [data-code]::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 1px solid transparent;\n background-clip: content-box;\n border-radius: 3px;\n }\n\n [data-code]::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n\n /*\n * If we apply these rules globally it will mean that webkit will opt into the\n * standards compliant version of custom css scrollbars, which we do not want\n * because the custom stuff will look better\n */\n @supports (-moz-appearance: none) {\n [data-code] {\n scrollbar-width: thin;\n scrollbar-color: var(--diffs-bg-context) transparent;\n padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));\n }\n }\n\n [data-diffs-header] ~ [data-diff],\n [data-diffs-header] ~ [data-file] {\n [data-code],\n &[data-overflow='wrap'] {\n padding-top: 0;\n }\n }\n\n [data-gutter] {\n display: grid;\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n grid-column: 1;\n z-index: 3;\n position: relative;\n background-color: var(--diffs-bg);\n\n [data-gutter-buffer],\n [data-column-number] {\n border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));\n }\n }\n\n [data-content] {\n display: grid;\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n grid-column: 2;\n min-width: 0;\n }\n\n [data-diff-type='split'][data-overflow='wrap'] {\n display: grid;\n grid-auto-flow: dense;\n grid-template-columns: repeat(2, var(--diffs-code-grid));\n padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n\n [data-deletions] {\n display: contents;\n\n [data-gutter] {\n grid-column: 1;\n }\n\n [data-content] {\n grid-column: 2;\n border-right: 1px solid var(--diffs-bg);\n }\n }\n\n [data-additions] {\n display: contents;\n\n [data-gutter] {\n grid-column: 3;\n border-left: 1px solid var(--diffs-bg);\n }\n\n [data-content] {\n grid-column: 4;\n }\n }\n }\n\n [data-overflow='scroll'] [data-gutter] {\n position: sticky;\n left: 0;\n }\n\n [data-line-annotation][data-selected-line] {\n background-color: unset;\n\n &::before {\n content: '';\n /* FIXME(amadeus): This needs to be audited ... */\n position: sticky;\n top: 0;\n left: 0;\n display: block;\n border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));\n background-color: var(--diffs-bg-selection-number);\n }\n\n [data-annotation-content] {\n background-color: var(--diffs-bg-selection);\n }\n }\n\n [data-interactive-lines] [data-line] {\n cursor: pointer;\n }\n\n [data-content-buffer],\n [data-gutter-buffer] {\n position: relative;\n -webkit-user-select: none;\n user-select: none;\n min-height: 1lh;\n }\n\n [data-gutter-buffer='annotation'] {\n min-height: 0;\n }\n\n [data-gutter-buffer='buffer'] {\n background-size: 8px 8px;\n background-position: 0 0;\n background-origin: border-box;\n background-color: var(--diffs-bg);\n /* This is incredibley expensive... */\n background-image: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent calc(3px * 1.414),\n rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414),\n rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414)\n );\n }\n\n [data-content-buffer] {\n grid-column: 1;\n /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */\n background-size: 8px 8px;\n background-position: 5px 0;\n background-origin: border-box;\n background-color: var(--diffs-bg);\n /* This is incredibley expensive... */\n background-image: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(4px * 1.414)\n );\n }\n\n [data-separator] {\n box-sizing: content-box;\n background-color: var(--diffs-bg);\n }\n\n [data-separator='simple'] {\n min-height: 4px;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'],\n [data-separator='metadata'],\n [data-separator='simple'] {\n background-color: var(--diffs-bg-separator);\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'],\n [data-separator='metadata'] {\n height: 32px;\n position: relative;\n }\n\n [data-separator-wrapper] {\n -webkit-user-select: none;\n user-select: none;\n fill: currentColor;\n position: absolute;\n inset-inline: 0;\n display: flex;\n align-items: center;\n background-color: var(--diffs-bg);\n height: 100%;\n }\n\n [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-separator='metadata'] [data-separator-wrapper] {\n inset-inline: 100% auto;\n padding-inline: 1ch;\n height: 100%;\n background-color: var(--diffs-bg-separator);\n color: var(--diffs-fg-number);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: min-content;\n }\n\n [data-separator='line-info'] {\n margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n }\n\n [data-separator='line-info-basic'],\n [data-separator='metadata'] {\n margin-block: 0;\n }\n\n [data-separator='line-info'][data-separator-first] {\n margin-top: 0;\n }\n\n [data-separator='line-info'][data-separator-last] {\n margin-bottom: 0;\n }\n\n [data-expand-index] [data-separator-wrapper] {\n display: grid;\n grid-template-columns: 32px auto;\n }\n\n [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 32px 32px auto;\n }\n\n [data-expand-button],\n [data-separator-content] {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n background-color: var(--diffs-bg-separator);\n }\n\n [data-expand-index] [data-separator-content]:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n\n [data-expand-button] {\n justify-content: center;\n flex-shrink: 0;\n cursor: pointer;\n min-width: 32px;\n align-self: stretch;\n color: var(--diffs-fg-number);\n border-right: 2px solid var(--diffs-bg);\n\n &:hover {\n color: var(--diffs-fg);\n }\n\n &[data-expand-all-button] {\n display: none;\n }\n }\n\n [data-expand-down] [data-icon] {\n transform: scaleY(-1);\n }\n\n [data-separator-content] {\n flex: 1 1 auto;\n padding: 0 1ch;\n height: 100%;\n color: var(--diffs-fg-number);\n\n overflow: hidden;\n justify-content: flex-start;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'] {\n [data-separator-content] {\n height: 100%;\n -webkit-user-select: none;\n user-select: none;\n overflow: clip;\n }\n }\n\n @supports (width: 1cqi) {\n [data-unified] {\n [data-separator='line-info'] [data-separator-wrapper] {\n padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n width: 100cqi;\n\n [data-separator-content] {\n border-radius: 6px;\n }\n }\n\n [data-separator='line-info'][data-expand-index]\n [data-separator-wrapper]\n [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-gutter] {\n [data-separator='line-info'] [data-separator-wrapper] {\n padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n }\n\n [data-separator='line-info'] [data-separator-content] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n [data-separator='line-info'][data-expand-index] [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-additions] {\n [data-content] [data-separator='line-info'] {\n background-color: var(--diffs-bg);\n\n [data-separator-wrapper] {\n display: none;\n }\n }\n\n [data-gutter] [data-separator='line-info'] [data-separator-wrapper] {\n display: block;\n height: 100%;\n background-color: var(--diffs-bg-separator);\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n\n [data-separator-content],\n [data-expand-button] {\n display: none;\n }\n }\n }\n\n [data-overflow='scroll']\n [data-additions]\n [data-gutter]\n [data-separator='line-info']\n [data-separator-wrapper] {\n width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));\n }\n\n [data-overflow='wrap']\n [data-additions]\n [data-content]\n [data-separator='line-info']\n [data-separator-wrapper] {\n background-color: var(--diffs-bg-separator);\n display: block;\n height: 100%;\n margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n\n [data-separator-content],\n [data-expand-button] {\n display: none;\n }\n }\n\n [data-separator='line-info'] [data-separator-wrapper] {\n [data-expand-both],\n [data-expand-down],\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n @media (pointer: fine) {\n [data-separator='line-info'] [data-separator-wrapper] {\n &[data-separator-multi-button] {\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: unset;\n }\n\n [data-expand-down] {\n border-bottom-left-radius: 6px;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: coarse) {\n [data-separator='line-info-basic']\n [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px 34px auto;\n\n [data-separator-content] {\n grid-column: unset;\n grid-row: unset;\n }\n }\n\n @supports (width: 1cqi) {\n [data-separator='line-info'] [data-separator-wrapper] {\n [data-expand-both],\n [data-expand-down],\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n &[data-separator-multi-button] {\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n [data-expand-down] {\n border-bottom-left-radius: unset;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: fine) {\n [data-separator-wrapper][data-separator-multi-button] {\n display: grid;\n grid-template-rows: 50% 50%;\n\n [data-separator-content] {\n grid-column: 2;\n grid-row: 1 / -1;\n min-width: min-content;\n }\n\n [data-expand-button] {\n grid-column: 1;\n }\n }\n\n [data-separator='line-info'] [data-separator-wrapper],\n [data-separator='line-info']\n [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px auto;\n }\n\n [data-separator='line-info-basic'][data-expand-index]\n [data-separator-wrapper] {\n grid-template-columns: 100% auto;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'] {\n [data-separator-multi-button] {\n [data-expand-up] {\n border-bottom: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n [data-expand-down] {\n border-top: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n }\n }\n }\n\n [data-additions] [data-gutter] [data-separator-wrapper],\n [data-additions] [data-separator='line-info-basic'] [data-separator-wrapper],\n [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-line-annotation],\n [data-gutter-buffer='annotation'] {\n --diffs-line-bg: var(--diffs-bg-context);\n }\n\n [data-merge-conflict-actions],\n [data-gutter-buffer='merge-conflict-action'] {\n --diffs-line-bg: var(--diffs-bg-context);\n }\n\n [data-has-merge-conflict] [data-line-annotation],\n [data-has-merge-conflict] [data-gutter-buffer='annotation'] {\n --diffs-line-bg: var(--diffs-bg);\n }\n\n [data-has-merge-conflict] [data-gutter-buffer='merge-conflict-action'] {\n --diffs-line-bg: var(--diffs-bg);\n }\n\n [data-line-annotation] {\n min-height: var(--diffs-annotation-min-height, 0);\n z-index: 2;\n }\n\n [data-merge-conflict-actions] {\n z-index: 2;\n }\n\n [data-separator='custom'] {\n display: grid;\n grid-template-columns: subgrid;\n }\n\n [data-line],\n [data-column-number],\n [data-no-newline] {\n position: relative;\n padding-inline: 1ch;\n }\n\n [data-indicators='classic'] [data-line] {\n padding-inline-start: 2ch;\n }\n\n [data-indicators='classic'] {\n [data-line-type='change-addition'],\n [data-line-type='change-deletion'] {\n &[data-no-newline],\n &[data-line] {\n &::before {\n display: inline-block;\n width: 1ch;\n height: 1lh;\n position: absolute;\n top: 0;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n }\n }\n }\n\n [data-line-type='change-addition'] {\n &[data-line],\n &[data-no-newline] {\n &::before {\n content: '+';\n color: var(--diffs-addition-base);\n }\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-line],\n &[data-no-newline] {\n &::before {\n content: '-';\n color: var(--diffs-deletion-base);\n }\n }\n }\n }\n\n [data-indicators='bars'] {\n [data-line-type='change-deletion'],\n [data-line-type='change-addition'] {\n &[data-column-number] {\n &::before {\n content: '';\n display: block;\n width: 4px;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n contain: strict;\n }\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-column-number] {\n &::before {\n background-image: linear-gradient(\n 0deg,\n var(--diffs-bg-deletion) 50%,\n var(--diffs-deletion-base) 50%\n );\n background-repeat: repeat;\n background-size: 2px 2px;\n background-size: calc(1lh / round(1lh / 2px))\n calc(1lh / round(1lh / 2px));\n }\n }\n }\n\n [data-line-type='change-addition'] {\n &[data-column-number] {\n &::before {\n background-color: var(--diffs-addition-base);\n }\n }\n }\n }\n\n [data-overflow='wrap'] {\n [data-line],\n [data-annotation-content] {\n white-space: pre-wrap;\n word-break: break-word;\n }\n }\n\n [data-overflow='scroll'] [data-line] {\n white-space: pre;\n min-height: 1lh;\n }\n\n [data-column-number] {\n box-sizing: content-box;\n text-align: right;\n -webkit-user-select: none;\n user-select: none;\n background-color: var(--diffs-bg);\n color: var(--diffs-fg-number);\n padding-left: 2ch;\n }\n\n [data-line-number-content] {\n display: inline-block;\n min-width: var(\n --diffs-min-number-column-width,\n var(--diffs-min-number-column-width-default, 3ch)\n );\n }\n\n [data-disable-line-numbers] {\n [data-column-number] {\n min-width: 4px;\n padding: 0;\n }\n\n [data-line-number-content] {\n display: none;\n }\n\n [data-gutter-utility-slot] {\n right: unset;\n left: 0;\n justify-content: flex-start;\n }\n\n &[data-indicators='bars'] [data-gutter-utility-slot] {\n /* Using 5px here because theres a 1px separator after the bar */\n left: 5px;\n }\n }\n\n [data-file][data-disable-line-numbers] {\n [data-gutter-buffer],\n [data-column-number] {\n min-width: 0;\n border-right: 0;\n }\n }\n\n [data-interactive-line-numbers] [data-column-number] {\n cursor: pointer;\n }\n\n [data-diff-span] {\n border-radius: 3px;\n -webkit-box-decoration-break: clone;\n box-decoration-break: clone;\n }\n\n [data-line-type='change-addition'] {\n &[data-column-number] {\n color: var(\n --diffs-fg-number-addition-override,\n var(--diffs-addition-base)\n );\n }\n\n [data-diff-span] {\n background-color: var(--diffs-bg-addition-emphasis);\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-column-number] {\n color: var(\n --diffs-fg-number-deletion-override,\n var(--diffs-deletion-base)\n );\n }\n\n [data-diff-span] {\n background-color: var(--diffs-bg-deletion-emphasis);\n }\n }\n\n [data-background] [data-line-type='change-addition'] {\n --diffs-line-bg: var(--diffs-bg-addition);\n\n &[data-column-number] {\n background-color: var(--diffs-bg-addition-number);\n }\n }\n\n [data-background] [data-line-type='change-deletion'] {\n --diffs-line-bg: var(--diffs-bg-deletion);\n\n &[data-column-number] {\n background-color: var(--diffs-bg-deletion-number);\n }\n }\n\n [data-merge-conflict='marker-start'],\n [data-merge-conflict='marker-base'],\n [data-merge-conflict='marker-separator'],\n [data-merge-conflict='marker-end'] {\n padding-left: 1ch;\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict='marker-start'],\n [data-merge-conflict='marker-end'] {\n display: flex;\n align-items: center;\n\n &::after {\n color: var(--diffs-fg-conflict-marker);\n font-style: normal;\n font-size: 0.75rem;\n line-height: 1.25rem;\n padding-left: 1ch;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n }\n }\n\n [data-merge-conflict='marker-start']::after {\n content: '(Current Change)';\n }\n\n [data-merge-conflict='marker-end']::after {\n content: '(Incoming Change)';\n }\n\n [data-merge-conflict='marker-base'],\n [data-merge-conflict='marker-end'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg-conflict-marker);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg-conflict-marker-number);\n color: var(--diffs-fg-conflict-marker);\n\n [data-line-number-content] {\n color: var(--diffs-fg-conflict-marker);\n }\n }\n }\n\n [data-merge-conflict='current'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--conflict-bg-current);\n }\n\n &[data-column-number] {\n background-color: var(--conflict-bg-current-number);\n color: var(--diffs-addition-base);\n }\n }\n\n [data-gutter-buffer='merge-conflict-marker-start'],\n [data-merge-conflict='marker-start'] {\n background-color: var(--conflict-bg-current-header);\n }\n\n [data-gutter-buffer='merge-conflict-marker-end'],\n [data-merge-conflict='marker-end'] {\n background-color: var(--conflict-bg-incoming-header);\n }\n\n [data-merge-conflict='marker-separator'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg);\n }\n }\n\n [data-merge-conflict='base'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg-conflict-base);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg-conflict-base-number);\n color: var(--diffs-modified-base);\n }\n }\n\n [data-merge-conflict='incoming'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--conflict-bg-incoming);\n }\n\n &[data-column-number] {\n background-color: var(--conflict-bg-incoming-number);\n color: var(--diffs-modified-base);\n }\n }\n\n @media (pointer: fine) {\n [data-column-number],\n [data-line] {\n &[data-hovered] {\n background-color: var(--diffs-bg-hover);\n }\n }\n\n [data-background] {\n [data-column-number],\n [data-line] {\n &[data-hovered] {\n &[data-line-type='change-deletion'] {\n background-color: var(--diffs-bg-deletion-hover);\n }\n\n &[data-line-type='change-addition'] {\n background-color: var(--diffs-bg-addition-hover);\n }\n }\n }\n }\n }\n\n [data-diffs-header='default'] {\n position: relative;\n background-color: var(--diffs-bg);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n min-height: calc(\n 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)\n );\n padding-inline: 16px;\n top: 0;\n z-index: 2;\n }\n\n [data-header-content] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n min-width: 0;\n white-space: nowrap;\n }\n\n [data-header-content] [data-prev-name],\n [data-header-content] [data-title] {\n direction: rtl;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n white-space: nowrap;\n }\n\n [data-prev-name] {\n opacity: 0.7;\n }\n\n [data-rename-icon] {\n fill: currentColor;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n [data-diffs-header='default'] [data-metadata] {\n display: flex;\n align-items: center;\n gap: 1ch;\n white-space: nowrap;\n }\n\n [data-diffs-header='default'] [data-additions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-addition-base);\n }\n\n [data-diffs-header='default'] [data-deletions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-deletion-base);\n }\n\n [data-annotation-content] {\n position: relative;\n display: flow-root;\n align-self: flex-start;\n z-index: 2;\n min-width: 0;\n isolation: isolate;\n }\n\n [data-merge-conflict-actions-content] {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n padding-inline: 0.5rem;\n min-height: 1.75rem;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n font-size: 0.75rem;\n line-height: 1.2;\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict-action] {\n appearance: none;\n border: 0;\n background: transparent;\n color: var(--diffs-fg-number);\n font: inherit;\n font-style: normal;\n cursor: pointer;\n padding: 0;\n }\n\n [data-merge-conflict-action]:hover {\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict-action='current']:hover {\n color: var(--diffs-addition-base);\n }\n\n [data-merge-conflict-action='incoming']:hover {\n color: var(--diffs-modified-base);\n }\n\n [data-merge-conflict-action-separator] {\n color: var(--diffs-fg-number);\n opacity: 0.6;\n -webkit-user-select: none;\n user-select: none;\n }\n\n /* Sticky positioning has a composite costs, so we should _only_ pay it if we\n * need to */\n [data-overflow='scroll'] [data-annotation-content] {\n position: sticky;\n width: var(--diffs-column-content-width, auto);\n left: var(--diffs-column-number-width, 0);\n }\n\n [data-overflow='scroll'] [data-merge-conflict-actions-content] {\n position: sticky;\n width: var(--diffs-column-content-width, auto);\n left: var(--diffs-column-number-width, 0);\n }\n\n /* Undo some of the stuff that the 'pre' tag does */\n [data-annotation-slot] {\n text-wrap-mode: wrap;\n word-break: normal;\n white-space-collapse: collapse;\n }\n\n [data-change-icon] {\n fill: currentColor;\n flex-shrink: 0;\n }\n\n [data-change-icon='change'],\n [data-change-icon='rename-pure'],\n [data-change-icon='rename-changed'] {\n color: var(--diffs-modified-base);\n }\n\n [data-change-icon='new'] {\n color: var(--diffs-addition-base);\n }\n\n [data-change-icon='deleted'] {\n color: var(--diffs-deletion-base);\n }\n\n [data-change-icon='file'] {\n opacity: 0.6;\n }\n\n /* Line selection highlighting */\n [data-selected-line] {\n &[data-gutter-buffer='annotation'],\n &[data-column-number] {\n color: var(--diffs-selection-number-fg);\n background-color: var(--diffs-bg-selection-number);\n }\n\n &[data-line] {\n background-color: var(--diffs-bg-selection);\n }\n }\n\n [data-line-type='change-addition'],\n [data-line-type='change-deletion'] {\n &[data-selected-line] {\n &[data-line],\n &[data-line][data-hovered] {\n background-color: light-dark(\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 82%,\n var(--diffs-selection-base)\n ),\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 75%,\n var(--diffs-selection-base)\n )\n );\n }\n\n &[data-column-number],\n &[data-column-number][data-hovered] {\n color: var(--diffs-selection-number-fg);\n background-color: light-dark(\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 75%,\n var(--diffs-selection-base)\n ),\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 60%,\n var(--diffs-selection-base)\n )\n );\n }\n }\n }\n\n [data-gutter-utility-slot] {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n justify-content: flex-end;\n }\n\n [data-unmodified-lines] {\n display: block;\n overflow: hidden;\n min-width: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 0 1 auto;\n }\n\n [data-error-wrapper] {\n overflow: auto;\n padding: var(--diffs-gap-block, var(--diffs-gap-fallback))\n var(--diffs-gap-inline, var(--diffs-gap-fallback));\n max-height: 400px;\n scrollbar-width: none;\n\n [data-error-message] {\n font-weight: bold;\n font-size: 18px;\n color: var(--diffs-deletion-base);\n }\n\n [data-error-stack] {\n color: var(--diffs-fg-number);\n }\n }\n\n [data-placeholder] {\n contain: strict;\n }\n\n [data-utility-button] {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n appearance: none;\n width: 1lh;\n height: 1lh;\n margin-right: calc((1lh - 1ch) * -1);\n padding: 0;\n cursor: pointer;\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n border-radius: 4px;\n background-color: var(--diffs-modified-base);\n color: var(--diffs-bg);\n fill: currentColor;\n position: relative;\n z-index: 4;\n }\n}\n";e.s(["default",0,T],50925);let M="@layer base, theme, rendered, unsafe;";e.s(["wrapCoreCSS",0,function(e){return`${M}
|
|
54
|
-
${T}
|
|
55
|
-
@layer theme {
|
|
56
|
-
${e}
|
|
57
|
-
}`},"wrapThemeCSS",0,function(e,t="system"){return`${M}
|
|
58
|
-
@layer rendered {
|
|
59
|
-
:host {${"system"===t?"":`
|
|
60
|
-
color-scheme: ${t};`}
|
|
61
|
-
${e}
|
|
62
|
-
}
|
|
63
|
-
}`},"wrapUnsafeCSS",0,function(e){return`${M}
|
|
64
|
-
@layer unsafe {
|
|
65
|
-
${e}
|
|
66
|
-
}`}],116),e.s(["getOrCreateCodeNode",0,function({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return null==e&&((e=document.createElement("code")).setAttribute("data-code",""),null!=n&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),null!=i?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}],60654)},51598,47391,e=>{"use strict";e.s(["prerenderHTMLIfNecessary",0,function(e,t){if(null==t)return;let n=e.shadowRoot??e.attachShadow({mode:"open"});""===n.innerHTML&&(n.innerHTML=t)}],51598),e.s(["setPreNodeProperties",0,function(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:a,totalLines:s,customProperties:l}){if(null!=l)for(let t in l){let n=l[t];null!=n&&e.setAttribute(t,`${n}`)}switch("diff"===t?(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 r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),"diff"===t?e.setAttribute("data-diff-type",a?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.tabIndex=0,e.style.setProperty("--diffs-min-number-column-width-default",`${`${s}`.length}ch`),e}],47391)},41645,e=>{"use strict";var t=e.i(27101);e.s(["upsertHostThemeStyle",0,function({shadowRoot:e,currentNode:n,themeCSS:i}){let r;return""===i.trim()?void n?.remove():((n??=((r=document.createElement("style")).setAttribute(t.THEME_CSS_ATTRIBUTE,""),r)).textContent=i,n.parentNode!==e&&e.appendChild(n),n)}])},81604,91301,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(51756),r=e.i(25106),o=e.i(2612),a=e.i(47535),s=e.i(44477),l=e.i(60166),d=e.i(32547),h=e.i(61647),f=e.i(93946),c=e.i(36635),u=e.i(45705),p=e.i(116),m=e.i(60654),g=e.i(41645),v=e.i(51598),b=e.i(47391),C=e.i(50925);if("u">typeof HTMLElement&&null==customElements.get(t.DIFFS_TAG_NAME)){let e;class n extends HTMLElement{constructor(){if(super(),null!=this.shadowRoot)return;const t=this.attachShadow({mode:"open"});null==e&&(e=new CSSStyleSheet).replaceSync(C.default),t.adoptedStyleSheets=[e]}}customElements.define(t.DIFFS_TAG_NAME,n)}e.s(["DiffsContainerLoaded",0,!0],91301);var x=e.i(27118);let S=[],y=-1;var L=class{static LoadedCustomComponent=!0;__id=`file:${++y}`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;appliedPreAttributes;lastRowCount;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];file;renderRange;constructor(e={theme:t.DEFAULT_THEMES},r,o=!1){this.options=e,this.workerManager=r,this.isContainerManaged=o,this.fileRenderer=new a.FileRenderer(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new i.ResizeManager,this.interactionManager=new n.InteractionManager("file",(0,n.pluckInteractionOptions)(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){null!=this.file&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}setOptions(e){null!=e&&(this.options=e,this.interactionManager.setOptions((0,n.pluckInteractionOptions)(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")===e||(this.mergeOptions({themeType:e}),"string"!=typeof this.options.theme&&null!=this.fileContainer&&null!=this.appliedThemeCSS&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.renderRange=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:r,lineAnnotations:o}=e;this.hydrateElements(t,n),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:r,lineAnnotations:o}),i||this.emitPostRender()}hydrateElements(e,n){for(let i of((0,v.prerenderHTMLIfNecessary)(e,n),Array.from(e.shadowRoot?.children??[]))){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}null!=this.pre&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),(null!=this.pre||null!=this.headerElement)&&(this.fileContainer=e)}hydrationSetup({file:e,lineAnnotations:t}){let{overflow:n="scroll"}=this.options;this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions({...this.options,headerRenderMode:null!=this.options.renderCustomHeader?"custom":"default"}),null!=this.pre&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,"wrap"===n))}getOrCreateLineCache(e=this.file){return null!=e?this.fileRenderer.getOrCreateLineCache(e):S}render({file:e,fileContainer:n,forceRender:i=!1,preventEmit:o=!1,containerWrapper:a,lineAnnotations:s,renderRange:d}){let{collapsed:h=!1,themeType:f="system"}=this.options,c=h?void 0:d,u=this.renderRange,p=null!=s&&(s.length>0||this.lineAnnotations.length>0)&&s!==this.lineAnnotations,m=!(0,l.areFilesEqual)(this.file,e);if(!h&&!i&&(0,r.areRenderRangesEqual)(c,this.renderRange)&&!m&&!p)return!1;this.renderRange=c,this.file=e,this.fileRenderer.setOptions({...this.options,headerRenderMode:null!=this.options.renderCustomHeader?"custom":"default"}),null!=s&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:g=!1,disableFileHeader:v=!1,overflow:b="scroll"}=this.options;if(v&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,a),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let i=this.fileRenderer.renderFile(e,t.EMPTY_RENDER_RANGE);null!=i&&this.applyThemeState(n,i.themeStyles,f,i.baseThemeType),i?.headerAST!=null&&this.applyHeaderToDOM(i.headerAST,n),this.injectUnsafeCSS()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,n)}return o||this.emitPostRender(),!0}try{let t=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(i,p,m)||!this.applyPartialRender(u,c)){let i=this.fileRenderer.renderFile(e,c);if(null==i)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,i.themeStyles,f,i.baseThemeType),null!=i.headerAST&&this.applyHeaderToDOM(i.headerAST,n),this.applyFullRender(i,t)}this.applyBuffers(t,c),this.injectUnsafeCSS(),this.interactionManager.setup(t),this.resizeManager.setup(t,"wrap"===b),this.renderAnnotations(),this.renderGutterUtility()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,n)}return o||this.emitPostRender(),!0}emitPostRender(){null!=this.fileContainer&&this.options.onPostRender?.(this.fileContainer,this)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!e&&!t&&!n}renderPlaceholder(e){if(null==this.fileContainer)return!1;if(this.cleanChildNodes(),null==this.placeHolder){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.placeHolder.style.setProperty("height",`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderAnnotations(){if(this.isContainerManaged||null==this.fileContainer){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(null!=t&&this.lineAnnotations.length>0)for(let[n,i]of this.lineAnnotations.entries()){let r=`${n}-${(0,o.getLineAnnotationName)(i)}`,a=this.annotationCache.get(r);if(null==a||!(0,d.areLineAnnotationsEqual)(i,a.annotation)){a?.element.remove();let e=t(i);if(null==e)continue;(a={element:(0,f.createAnnotationWrapperNode)((0,o.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(r,a)}e.delete(r)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(null==this.fileContainer||null==e){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(null!=t&&null!=this.gutterUtilityContent)return;if(null==t){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=(0,c.createGutterUtilityContentNode)();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(null!=t){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,u.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,p.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==t||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,g.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,p.wrapThemeCSS)(t,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:t,themeType:o,baseThemeType:i}:void 0)}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=(0,m.getOrCreateCodeNode)({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(null==e||null==t)return!1;let{file:n,code:i}=this,r=null!=i?this.getColumns(i):void 0;if(null==n||null==i||null==r)return!1;let o=e.startingLine,a=t.startingLine,s=e.totalLines===1/0?1/0:o+e.totalLines,l=t.totalLines===1/0?1/0:a+t.totalLines,d=Math.max(o,a),h=Math.min(s,l);if(h<=d||!this.trimDOMToOverlap(r.gutter,d,h)||!this.trimDOMToOverlap(r.content,d,h))return!1;let{length:f}=r.content.children,c=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},u=a<d?c(a,d-a):void 0;if(void 0===u&&a<d)return!1;let p=l===1/0?1/0:Math.max(0,l-h),m=l>h?c(h,p):void 0;return(void 0!==m||!(l>h))&&(this.cleanupErrorWrapper(),null!=u&&(r.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(u.gutterAST)),r.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(u.contentAST)),f+=u.rowCount),null!=m&&(r.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(m.gutterAST)),r.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(m.contentAST)),f+=m.rowCount),this.lastRowCount!==f&&(r.gutter.style.setProperty("grid-row",`span ${f}`),r.content.style.setProperty("grid-row",`span ${f}`),this.lastRowCount=f),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let i=this.getDOMBoundaryIndices(e,[t,n]),r=i.get(t)??e.children.length,o=i.get(n)??e.children.length;if(r>o)return!1;for(let t=e.children.length-1;t>=o;t-=1)e.children[t]?.remove();for(let t=r-1;t>=0;t-=1)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),i=new Map;if(0===n.length)return i;let r=0,o=n[0],{children:a}=e;for(let e=0;e<a.length;e+=1){let t=a[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(null!=s){for(;null!=o&&s>=o;)i.set(o,e),r+=1,o=n[r];if(r>=n.length)break}}for(let e of n)i.has(e)||i.set(e,a.length);return i}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(null==t)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||null==t){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==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")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==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")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyHeaderToDOM(e,n){let{file:i}=this;if(null==i)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=(0,x.toHtml)(e);if(r!==this.lastRenderedHeaderHTML){let e=document.createElement("div");e.innerHTML=r;let t=e.firstElementChild;if(!(t instanceof HTMLElement))return;null!=this.headerElement?n.shadowRoot?.replaceChild(t,this.headerElement):n.shadowRoot?.prepend(t),this.headerElement=t,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:o,renderCustomHeader:a,renderCustomMetadata:s}=this.options;if(null!=a){let e=a(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,t.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{let e=o?.(i)??void 0,r=s?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,t.HEADER_PREFIX_SLOT_ID,e),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,t.HEADER_METADATA_SLOT_ID,r),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(null==i)return void t?.remove();let r=t??this.createHeaderSlotElement(n);return null==t&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}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}getOrCreateFileContainerNode(e,n){let i=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(t.DIFFS_TAG_NAME),null!=i&&i!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),null!=n&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),null==this.spriteSVG){let e=document.createElement("div");e.innerHTML=s.SVGSpriteSheet;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return null==this.pre?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){for(let t of(this.code=void 0,Array.from(e.children)))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,r={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};(0,h.arePrePropertiesEqual)(r,this.appliedPreAttributes)||((0,b.setPreNodeProperties)(e,r),this.appliedPreAttributes=r)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML="",n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};e.s(["File",0,L],81604)},18750,40648,68456,62498,93608,32187,20181,50522,10923,61092,57192,10028,22300,92458,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(51756),r=e.i(25106),o=e.i(2612),a=e.i(44477),s=e.i(60166),l=e.i(61647),d=e.i(93946),h=e.i(36635),f=e.i(45705),c=e.i(116),u=e.i(60654),p=e.i(41645),m=e.i(51598),g=e.i(47391),v=e.i(91301),b=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(null==t||null==n)for(let i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));null==n||null==t?this.cleanUp():(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}))}};e.s(["ScrollSyncManager",0,b],40648);var C=e.i(6104),x=e.i(84324),S=e.i(30891),y=e.i(82994),L=e.i(24183),k=e.i(41914),E=e.i(34481),A=e.i(45786),w=e.i(35864),T=e.i(82856),M=e.i(83981),R=e.i(19013);function I(e){return(0,C.createHastElement)({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function H(e){return(0,C.createHastElement)({tagName:"div",children:[(0,C.createHastElement)({tagName:"span",children:[(0,C.createTextNodeElement)("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function D(e){return(0,C.createHastElement)({tagName:"div",children:[(0,C.createIconElement)({name:"both"===e?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":"both"===e?"":void 0,"data-expand-up":"up"===e?"":void 0,"data-expand-down":"down"===e?"":void 0}})}function N({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:a}){let s=0,l=[];if("metadata"===e&&null!=t&&l.push((0,C.createHastElement)({tagName:"div",children:[(0,C.createTextNodeElement)(t)],properties:{"data-separator-wrapper":""}})),("line-info"===e||"line-info-basic"===e)&&null!=t){let e=[];null!=n&&(i?(!o&&(e.push(D("up")),s++),!a&&(e.push(D("down")),s++)):(e.push(D(o||a?o?"down":"up":"both")),s++)),e.push((0,C.createHastElement)({tagName:"div",children:[(0,C.createHastElement)({tagName:"span",children:[(0,C.createTextNodeElement)(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&null!=n&&e.push((0,C.createHastElement)({tagName:"div",children:[(0,C.createTextNodeElement)("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push((0,C.createHastElement)({tagName:"div",children:e,properties:{"data-separator-wrapper":"","data-separator-multi-button":s>1?"":void 0}}))}return"custom"===e&&null!=r&&l.push((0,C.createHastElement)({tagName:"slot",properties:{name:r}})),(0,C.createHastElement)({tagName:"div",children:l,properties:{"data-separator":0===l.length?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":a?"":void 0}})}function P(e,t){return`hunk-separator-${e}-${t}`}function F(e){let t=e.at(-1);return null==t?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function O(e){return 0===e.startingLine&&e.totalLines===1/0&&0===e.bufferBefore&&0===e.bufferAfter}e.s(["createEmptyRowBuffer",0,I],68456),e.s(["createNoNewlineElement",0,H],62498),e.s(["createSeparator",0,N],93608),e.s(["getHunkSeparatorSlotName",0,P],32187),e.s(["getTotalLineCountFromHunks",0,F],20181),e.s(["isDefaultRenderRange",0,O],50522);var U=e.i(84036),z=e.i(89107),B=e.i(10906),_=e.i(27118);let G=-1;var $=class{__id=`diff-hunks-renderer:${++G}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:t.DEFAULT_THEMES},n,i){this.options=e,this.onRenderUpdate=n,this.workerManager=i,i?.isWorkingPool()!==!0&&(this.highlighter=(0,y.areThemesAttached)(e.theme??t.DEFAULT_THEMES)?(0,S.getHighlighterIfLoaded)():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};("up"===t||"both"===t)&&(i.fromStart+=n),("down"===t||"both"===t)&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&(this.renderCache=void 0),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??t.DEFAULT_EXPANDED_REGION}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){for(let t of(this.additionAnnotations={},this.deletionAnnotations={},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)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return"change"!==t?{gutterLineType:t}:{gutterLineType:"deletions"===e?"change-deletion":"change-addition"}}createAnnotationElement(e){return(0,L.createAnnotationElement)(e)}getOptionsWithDefaults(){let{diffIndicators:e="bars",diffStyle:n="split",disableBackground:i=!1,disableFileHeader:r=!1,disableLineNumbers:o=!1,disableVirtualizationBuffers:a=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:d=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,expansionLineCount:h=100,hunkSeparators:f="line-info",lineDiffType:c="word-alt",maxLineDiffLength:u=1e3,overflow:p="scroll",theme:m=t.DEFAULT_THEMES,headerRenderMode:g="default",tokenizeMaxLineLength:v=1e3,useTokenTransformer:b=!1,useCSSClasses:C=!1}=this.options;return{diffIndicators:e,diffStyle:n,disableBackground:i,disableFileHeader:r,disableLineNumbers:o,disableVirtualizationBuffers:a,collapsed:s,expandUnchanged:l,collapsedContextThreshold:d,expansionLineCount:h,hunkSeparators:f,lineDiffType:c,maxLineDiffLength:u,overflow:p,theme:this.workerManager?.getDiffRenderOptions().theme??m,headerRenderMode:g,tokenizeMaxLineLength:v,useTokenTransformer:b,useCSSClasses:C}}async initializeHighlighter(){return this.highlighter=await (0,S.getSharedHighlighter)((0,T.getHighlighterOptions)(this.computedLang,this.options)),this.highlighter}hydrate(e){if(null==e)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getDiffResultCache(e);null==n||(0,R.areDiffRenderOptionsEqual)(t,n.options)||(n=void 0),this.renderCache??={diff:e,highlighted:!(0,U.isDiffPlainText)(e),options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?null==this.renderCache.result&&this.workerManager.highlightDiffAST(this,this.diff):null==this.highlighter&&(this.computedLang=e.lang??(0,w.getFiletypeFromFileName)(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:(0,M.shouldUseTokenTransformer)(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result!=null&&e===n.diff&&(0,R.areDiffRenderOptionsEqual)(t,n.options)?{options:t,forceRender:!1}:{options:t,forceRender:!0}}renderDiff(e=this.renderCache?.diff,n=t.DEFAULT_RENDER_RANGE){if(null==e)return;let{expandUnchanged:i=!1,collapsedContextThreshold:o}=this.getOptionsWithDefaults(),a=this.workerManager?.getDiffResultCache(e);null!=a&&null==this.renderCache&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...a});let{options:s,forceRender:l}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:s,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)null!=this.renderCache.result&&(this.renderCache.highlighted||e===this.renderCache.diff&&(0,r.areRenderRangesEqual)(this.renderCache.renderRange,n))||(this.renderCache.diff=e,this.renderCache.result=this.workerManager.getPlainDiffAST(e,n.startingLine,n.totalLines,!!O(n)||!!i||this.expandedHunks,o),this.renderCache.renderRange=n),n.totalLines>0&&(!this.renderCache.highlighted||l)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??(0,w.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,y.areThemesAttached)(s.theme),n=null!=this.highlighter&&(0,x.areLanguagesAttached)(this.computedLang);if(null!=this.highlighter&&t&&(l||!this.renderCache.highlighted&&n||null==this.renderCache.result)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,!n);this.renderCache={diff:e,options:i,highlighted:n,result:t,renderRange:void 0}}t&&n||this.asyncHighlight(e).then(({result:t,options:n})=>{null!=this.renderCache&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n)})}return null!=this.renderCache.result?this.processDiffResult(this.renderCache.diff,n,this.renderCache.result):void 0}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){let{result:i}=await this.asyncHighlight(e);return this.processDiffResult(e,n,i)}createPreElement(e,t,n){let{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a}=this.getOptionsWithDefaults();return(0,A.createPreElement)({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){this.computedLang=e.lang??(0,w.getFiletypeFromFileName)(e.name);let n=null!=this.highlighter&&(0,y.areThemesAttached)(this.options.theme??t.DEFAULT_THEMES),i=null!=this.highlighter&&(0,x.areLanguagesAttached)(this.computedLang);return null!=this.highlighter&&n&&i||(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults();return{result:(0,B.renderDiffWithHighlighter)(e,t,i,{forcePlainText:n,expandedHunks:!!n||void 0,collapsedContextThreshold:r}),options:i}}onHighlightSuccess(e,t,n){if(null==this.renderCache)return;let i=!this.renderCache.highlighted||!(0,R.areDiffRenderOptionsEqual)(this.renderCache.options,n)||this.renderCache.diff!==e;this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){let{diffStyle:o,disableFileHeader:a,expandUnchanged:s,expansionLineCount:l,collapsedContextThreshold:d,hunkSeparators:h}=this.getOptionsWithDefaults();this.diff=e;let f="unified"===o,c=[],u=[],p=[],m=[],{additionLines:g,deletionLines:v}=n,b={rowCount:0,hunkSeparators:h,additionsContentAST:c,deletionsContentAST:u,unifiedContentAST:p,unifiedGutterAST:(0,C.createGutterWrapper)(),deletionsGutterAST:(0,C.createGutterWrapper)(),additionsGutterAST:(0,C.createGutterWrapper)(),expansionLineCount:l,hunkData:m,incrementRowCount(e=1){b.rowCount+=e},pushToGutter(e,t){switch(e){case"unified":b.unifiedGutterAST.children.push(t);break;case"deletions":b.deletionsGutterAST.children.push(t);break;case"additions":b.additionsGutterAST.children.push(t)}}},x=function(e){let t=e.hunks.at(-1);if(null==t||e.isPartial||0===e.additionLines.length||0===e.deletionLines.length)return 0;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),i=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==i)throw Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${i}) for ${e.name}`);return Math.min(n,i)}(e),S={size:0,side:void 0,increment(){this.size+=1},flush(){if("unified"!==o){if(this.size<=0||null==this.side){this.side=void 0,this.size=0;return}"additions"===this.side?(b.pushToGutter("additions",(0,C.createGutterGap)(void 0,"buffer",this.size)),c?.push(I(this.size))):(b.pushToGutter("deletions",(0,C.createGutterGap)(void 0,"buffer",this.size)),u?.push(I(this.size))),this.size=0,this.side=void 0}}},y=(e,t,n,i,r)=>{b.pushToGutter(e,(0,C.createGutterItem)(t,n,i,r))};function L(e){S.flush(),"unified"===o?K("unified",e,b):(K("deletions",e,b),K("additions",e,b))}(0,z.iterateOverDiff)({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:!!s||this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:t,hunk:n,collapsedBefore:i,collapsedAfter:r,additionLine:a,deletionLine:s,type:l})=>{let d=null!=s?s.splitLineIndex:a.splitLineIndex,f=null!=a?a.unifiedLineIndex:s.unifiedLineIndex;"split"===o&&"change"!==l&&S.flush(),i>0&&L({hunkIndex:t,collapsedLines:i,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:0===t,isLastHunk:!1,isExpandable:!e.isPartial});let c="unified"===o?f:d,u={type:l,hunkIndex:t,lineIndex:c,unifiedLineIndex:f,splitLineIndex:d,deletionLine:s,additionLine:a};if("unified"===o){let n=this.getUnifiedInjectedRowsForLine?.(u);n?.before!=null&&q(n.before,b);let i=null!=s?v[s.lineIndex]:void 0,r=null!=a?g[a.lineIndex]:void 0;if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let o="change"===l?null!=a?"change-addition":"change-deletion":l,h=this.getUnifiedLineDecoration({type:l,lineType:o,additionLineIndex:a?.lineIndex,deletionLineIndex:s?.lineIndex});y("unified",h.gutterLineType,null!=a?a.lineNumber:s.lineNumber,`${f},${d}`,h.gutterProperties),null!=r?r=X(r,h.contentProperties):null!=i&&(i=X(i,h.contentProperties)),j({diffStyle:"unified",type:l,deletionLine:i,additionLine:r,unifiedSpan:this.getAnnotations("unified",s?.lineNumber,a?.lineNumber,t,c),createAnnotationElement:e=>this.createAnnotationElement(e),context:b}),n?.after!=null&&q(n.after,b)}else{let n=this.getSplitInjectedRowsForLine?.(u);n?.before!=null&&V(n.before,b,S);let i=null!=s?v[s.lineIndex]:void 0,r=null!=a?g[a.lineIndex]:void 0,o=this.getSplitLineDecoration({side:"deletions",type:l,lineIndex:s?.lineIndex}),h=this.getSplitLineDecoration({side:"additions",type:l,lineIndex:a?.lineIndex});if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if("change"===l){if(null==r)return"additions";else if(null==i)return"deletions"}})();if(null!=f){if(null!=S.side&&S.side!==f)throw Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");S.side=f,S.increment()}let p=this.getAnnotations("split",s?.lineNumber,a?.lineNumber,t,c);if(null!=p&&S.size>0&&S.flush(),null!=s){let e=X(i,o.contentProperties);y("deletions",o.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${d}`,o.gutterProperties),null!=e&&(i=e)}if(null!=a){let e=X(r,h.contentProperties);y("additions",h.gutterLineType,a.lineNumber,`${a.unifiedLineIndex},${d}`,h.gutterProperties),null!=e&&(r=e)}j({diffStyle:"split",type:l,additionLine:r,deletionLine:i,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:b}),n?.after!=null&&V(n.after,b,S)}let p=s?.noEOFCR??!1,m=a?.noEOFCR??!1;if(m||p){if(p){let e="context"===l||"context-expanded"===l?l:"change-deletion";"unified"===o?(b.unifiedContentAST.push(H(e)),b.pushToGutter("unified",(0,C.createGutterGap)(e,"metadata",1))):(b.deletionsContentAST.push(H(e)),b.pushToGutter("deletions",(0,C.createGutterGap)(e,"metadata",1)),m||(b.pushToGutter("additions",(0,C.createGutterGap)(void 0,"buffer",1)),b.additionsContentAST.push(I(1))))}if(m){let e="context"===l||"context-expanded"===l?l:"change-addition";"unified"===o?(b.unifiedContentAST.push(H(e)),b.pushToGutter("unified",(0,C.createGutterGap)(e,"metadata",1))):(b.additionsContentAST.push(H(e)),b.pushToGutter("additions",(0,C.createGutterGap)(e,"metadata",1)),p||(b.pushToGutter("deletions",(0,C.createGutterGap)(void 0,"buffer",1)),b.deletionsContentAST.push(I(1))))}b.incrementRowCount(1)}r>0&&"simple"!==h&&L({hunkIndex:"context-expanded"===l?t:t+1,collapsedLines:r,rangeSize:x,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),b.incrementRowCount(1)}}),"split"===o&&S.flush();let k=Math.max(F(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),E=t.bufferBefore>0||t.bufferAfter>0,A=!f&&"deleted"!==e.type,w=!f&&"new"!==e.type,T=b.rowCount>0||E;c=A&&T?c:void 0,u=w&&T?u:void 0,p=f&&T?p:void 0;let M=this.createPreElement(null!=u&&null!=c,k);return{unifiedGutterAST:f&&T?b.unifiedGutterAST.children:void 0,unifiedContentAST:p,deletionsGutterAST:w&&T?b.deletionsGutterAST.children:void 0,deletionsContentAST:u,additionsGutterAST:A&&T?b.additionsGutterAST.children:void 0,additionsContentAST:c,hunkData:m,preNode:M,themeStyles:i,baseThemeType:r,headerElement:a?void 0:this.renderHeader(this.diff),totalLines:k,rowCount:b.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){let n="unified"===e?t.unifiedGutterAST:"deletions"===e?t.deletionsGutterAST:t.additionsGutterAST,i="unified"===e?t.unifiedContentAST:"deletions"===e?t.deletionsContentAST:t.additionsContentAST;if(null==n||null==i)return;let r=(0,C.createGutterWrapper)(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,(0,k.createContentColumn)(i,t.rowCount)]}renderFullAST(e,t=[]){let n="line-info"===this.getOptionsWithDefaults().hunkSeparators,i=this.renderCodeAST("unified",e);if(null!=i)return t.push((0,C.createHastElement)({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};let r=this.renderCodeAST("deletions",e);null!=r&&t.push((0,C.createHastElement)({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));let o=this.renderCodeAST("additions",e);return null!=o&&t.push((0,C.createHastElement)({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return(0,_.toHtml)(this.renderFullAST(e,t))}renderPartialHTML(e,t){return null==t?(0,_.toHtml)(e):(0,_.toHtml)((0,C.createHastElement)({tagName:"code",children:e,properties:{"data-code":"","data-container-size":"line-info"===this.getOptionsWithDefaults().hunkSeparators?"":void 0,[`data-${t}`]:""}}))}getAnnotations(e,t,n,i,r){let a={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=t)for(let e of this.deletionAnnotations[t]??[])a.annotations.push((0,o.getLineAnnotationName)(e));let s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=n)for(let t of this.additionAnnotations[n]??[])("unified"===e?a:s).annotations.push((0,o.getLineAnnotationName)(t));return"unified"===e?a.annotations.length>0?a:void 0:0!==s.annotations.length||0!==a.annotations.length?{deletionSpan:a,additionSpan:s}:void 0}renderHeader(e){let{headerRenderMode:t}=this.getOptionsWithDefaults();return(0,E.createFileHeaderElement)({fileOrDiff:e,mode:t})}};function W(e){return`${e} unmodified line${e>1?"s":""}`}function q(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function V(e,t,n){for(let{deletion:i,addition:r}of e){if(null==i&&null==r)continue;let e=null!=i&&null!=r?void 0:null==i?"deletions":"additions";(null==e||n.side!==e)&&n.flush(),null!=i&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),null!=r&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),null!=e&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function j({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:a,createAnnotationElement:s,context:l}){let d=!1;"unified"===e?(null!=i?l.unifiedContentAST.push(i):null!=n&&l.unifiedContentAST.push(n),null!=r&&(l.unifiedContentAST.push(s(r)),l.pushToGutter("unified",(0,C.createGutterGap)("change"===t?null!=n?"change-deletion":"change-addition":t,"annotation",1)),d=!0)):"split"===e&&(null!=n&&l.deletionsContentAST.push(n),null!=i&&l.additionsContentAST.push(i),null!=o&&(l.deletionsContentAST.push(s(o)),l.pushToGutter("deletions",(0,C.createGutterGap)("change"===t?null!=n?"change-deletion":"context":t,"annotation",1)),d=!0),null!=a&&(l.additionsContentAST.push(s(a)),l.pushToGutter("additions",(0,C.createGutterGap)("change"===t?null!=i?"change-addition":"context":t,"annotation",1)),d=!0)),d&&l.incrementRowCount(1)}function K(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:a,isExpandable:s},l){if(n<=0)return;let d="unified"===e?l.unifiedContentAST:"deletions"===e?l.deletionsContentAST:l.additionsContentAST;if("metadata"===l.hunkSeparators){null!=r&&(l.pushToGutter(e,N({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),d.push(N({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&l.incrementRowCount(1));return}if("simple"===l.hunkSeparators){t>0&&(l.pushToGutter(e,N({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(N({type:"simple",isFirstHunk:o,isLastHunk:!1})),"additions"!==e&&l.incrementRowCount(1));return}let h=P(e,t),f=i>l.expansionLineCount,c=s?t:void 0;l.pushToGutter(e,N({type:l.hunkSeparators,content:W(n),expandIndex:c,chunked:f,slotName:h,isFirstHunk:o,isLastHunk:a})),d.push(N({type:l.hunkSeparators,content:W(n),expandIndex:c,chunked:f,slotName:h,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&l.incrementRowCount(1),l.hunkData.push({slotName:h,hunkIndex:t,lines:n,type:e,expandable:s?{up:!o,down:!a,chunked:f}:void 0})}function X(e,t){return null==e||"element"!==e.type||null==t?e:{...e,properties:{...e.properties,...t}}}function Q(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Y(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}e.s(["DiffHunksRenderer",0,$],10923),e.s(["areDiffLineAnnotationsEqual",0,Q],61092),e.s(["areHunkDataEqual",0,Y],57192);var J=e.i(17443);function Z(e){let t=e[0];if("+"!==t&&"-"!==t&&" "!==t&&"\\"!==t)return void console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);let n=e.substring(1);return{line:""===n?"\n":n,type:" "===t?"context":"\\"===t?"metadata":"+"===t?"addition":"deletion"}}function ee(e,n,i=!1){let r,o=t.GIT_DIFF_FILE_BREAK_REGEX.test(e),a=e.split(o?t.GIT_DIFF_FILE_BREAK_REGEX:t.UNIFIED_DIFF_FILE_BREAK_REGEX),s=[];for(let e of a){if(o&&!t.GIT_DIFF_FILE_BREAK_REGEX.test(e)||!o&&!t.UNIFIED_DIFF_FILE_BREAK_REGEX.test(e)){if(null==r)r=e;else if(i)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}let a=et(e,{cacheKey:null!=n?`${n}-${s.length}`:void 0,isGitDiff:o,throwOnError:i});null!=a&&s.push(a)}return{patchMetadata:r,files:s}}function et(e,{cacheKey:n,isGitDiff:i=t.GIT_DIFF_FILE_BREAK_REGEX.test(e),oldFile:r,newFile:o,throwOnError:a=!1}={}){let s,l=0,d=e.split(t.FILE_CONTEXT_BLOB),h=null==r||null==o,f=0,c=0;for(let e of d){let d,u,p=e.split(t.SPLIT_WITH_NEWLINES),m=p.shift();if(null==m){if(a)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",e);continue}let g=m.match(t.HUNK_HEADER),v=0,b=0;if(null==g||null==s){if(null!=s){if(a)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",e);continue}for(let e of(1===(s={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:h,additionLines:h||null==r||null==o?[]:o.contents.split(t.SPLIT_WITH_NEWLINES),deletionLines:h||null==r||null==o?[]:r.contents.split(t.SPLIT_WITH_NEWLINES),cacheKey:n}).additionLines.length&&o?.contents===""&&(s.additionLines.length=0),1===s.deletionLines.length&&r?.contents===""&&(s.deletionLines.length=0),p.unshift(m),p)){let n=e.match(i?t.FILENAME_HEADER_REGEX_GIT:t.FILENAME_HEADER_REGEX);if(e.startsWith("diff --git")){let[,,n,,i]=e.trim().match(t.ALTERNATE_FILE_NAMES_GIT)??[];s.name=i.trim(),n!==i&&(s.prevName=n.trim())}else if(null!=n){let[,e,t]=n;"---"===e&&"/dev/null"!==t?(s.prevName=t.trim(),s.name=t.trim()):"+++"===e&&"/dev/null"!==t&&(s.name=t.trim())}else if(i){if(e.startsWith("new mode ")&&(s.mode=e.replace("new mode","").trim()),e.startsWith("old mode ")&&(s.prevMode=e.replace("old mode","").trim()),e.startsWith("new file mode")&&(s.type="new",s.mode=e.replace("new file mode","").trim()),e.startsWith("deleted file mode")&&(s.type="deleted",s.mode=e.replace("deleted file mode","").trim()),e.startsWith("similarity index")&&(e.startsWith("similarity index 100%")?s.type="rename-pure":s.type="rename-changed"),e.startsWith("index ")){let[,n,i,r]=e.trim().match(t.INDEX_LINE_METADATA)??[];null!=n&&(s.prevObjectId=n),null!=i&&(s.newObjectId=i),null!=r&&(s.mode=r)}e.startsWith("rename from ")&&(s.prevName=e.replace("rename from ","").trim()),e.startsWith("rename to ")&&(s.name=e.replace("rename to ","").trim())}}continue}for(;p.length>0&&("\n"===p[p.length-1]||"\r"===p[p.length-1]||"\r\n"===p[p.length-1]||""===p[p.length-1]);)p.pop();let C=parseInt(g[3]),x=parseInt(g[1]);f=h?f:x-1,c=h?c:C-1;let S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(g[4]??"1"),additionStart:C,additionLines:v,deletionCount:parseInt(g[2]??"1"),deletionStart:x,deletionLines:b,deletionLineIndex:f,additionLineIndex:c,hunkContent:[],hunkContext:g[5],hunkSpecs:m,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(S.additionCount)||isNaN(S.deletionCount)||isNaN(S.additionStart)||isNaN(S.deletionStart)){if(a)throw Error("parsePatchContent: invalid hunk metadata");console.error("parsePatchContent: invalid hunk metadata",S);continue}for(let e of p){let t=Z(e);if(null==t){console.error("processFile: invalid rawLine:",e);continue}let{type:n,line:i}=t;if("addition"===n)(null==d||"change"!==d.type)&&(d=en("change",f,c),S.hunkContent.push(d)),c++,h&&s.additionLines.push(i),d.additions++,v++,u="addition";else if("deletion"===n)(null==d||"change"!==d.type)&&(d=en("change",f,c),S.hunkContent.push(d)),f++,h&&s.deletionLines.push(i),d.deletions++,b++,u="deletion";else if("context"===n)(null==d||"context"!==d.type)&&(d=en("context",f,c),S.hunkContent.push(d)),c++,f++,h&&(s.deletionLines.push(i),s.additionLines.push(i)),d.lines++,u="context";else if("metadata"===n&&null!=d){if("context"===d.type?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):"deletion"===u?S.noEOFCRDeletions=!0:"addition"===u&&(S.noEOFCRAdditions=!0),h&&("addition"===u||"context"===u)){let e=s.additionLines.length-1;e>=0&&(s.additionLines[e]=(0,J.cleanLastNewline)(s.additionLines[e]))}if(h&&("deletion"===u||"context"===u)){let e=s.deletionLines.length-1;e>=0&&(s.deletionLines[e]=(0,J.cleanLastNewline)(s.deletionLines[e]))}}}for(let e of(S.additionLines=v,S.deletionLines=b,S.collapsedBefore=Math.max(S.additionStart-1-l,0),s.hunks.push(S),l=S.additionStart+S.additionCount-1,S.hunkContent))"context"===e.type?(S.splitLineCount+=e.lines,S.unifiedLineCount+=e.lines):(S.splitLineCount+=Math.max(e.additions,e.deletions),S.unifiedLineCount+=e.deletions+e.additions);S.splitLineStart=s.splitLineCount+S.collapsedBefore,S.unifiedLineStart=s.unifiedLineCount+S.collapsedBefore,s.splitLineCount+=S.collapsedBefore+S.splitLineCount,s.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(null!=s){if(s.hunks.length>0&&!h&&s.additionLines.length>0&&s.deletionLines.length>0){let e=s.hunks[s.hunks.length-1],t=e.additionStart+e.additionCount-1,n=Math.max(s.additionLines.length-t,0);s.splitLineCount+=n,s.unifiedLineCount+=n}return i||(null!=s.prevName&&s.name!==s.prevName?s.hunks.length>0?s.type="rename-changed":s.type="rename-pure":null!=o&&""===o.contents?s.type="deleted":null!=r&&""===r.contents&&(s.type="new")),"rename-pure"!==s.type&&"rename-changed"!==s.type&&(s.prevName=void 0),s}}function en(e,t,n){return"change"===e?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}e.s(["parseLineType",0,Z],10028),e.s(["parsePatchFiles",0,function(e,n,i=!1){let r=[];for(let o of e.split(t.COMMIT_METADATA_SPLIT))try{r.push(ee(o,null!=n?`${n}-${r.length}`:void 0,i))}catch(e){if(i)throw e;console.error(e)}return r},"processFile",0,et,"processPatch",0,ee],22300);var ei=e.i(24315);class er extends ei.default{constructor(){super(...arguments),this.tokenize=ea}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}}let eo=new er;function ea(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let r=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}let es={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function el(e,t,n,i,r,o,a){var s;let l;void 0===(l=a?"function"==typeof a?{callback:a}:a:{}).context&&(l.context=4);let d=l.context;if(l.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!l.callback)return h(eo.diff(n,i,l));{let{callback:e}=l;s=Object.assign(Object.assign({},l),{callback:t=>{e(h(t))}}),eo.diff(n,i,s)}function h(n){if(!n)return;function i(e){return e.map(function(e){return" "+e})}n.push({value:"",lines:[]});let a=[],s=0,l=0,h=[],f=1,c=1;for(let e=0;e<n.length;e++){let t=n[e],r=t.lines||function(e){let t=e.endsWith("\n"),n=e.split("\n").map(e=>e+"\n");return t?n.pop():n.push(n.pop().slice(0,-1)),n}(t.value);if(t.lines=r,t.added||t.removed){if(!s){let t=n[e-1];s=f,l=c,t&&(s-=(h=d>0?i(t.lines.slice(-d)):[]).length,l-=h.length)}for(let e of r)h.push((t.added?"+":"-")+e);t.added?c+=r.length:f+=r.length}else{if(s)if(r.length<=2*d&&e<n.length-2)for(let e of i(r))h.push(e);else{let e=Math.min(r.length,d);for(let t of i(r.slice(0,e)))h.push(t);let t={oldStart:s,oldLines:f-s+e,newStart:l,newLines:c-l+e,lines:h};a.push(t),s=0,l=0,h=[]}f+=r.length,c+=r.length}}for(let e of a)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith("\n")?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,"\"),t++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:a}}}function ed(e,t){if(t||(t=es),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)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=>ed(e,t)).join("\n")}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":" "+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let i=e.hunks[t];for(let e of(0===i.oldLines&&(i.oldStart-=1),0===i.newLines&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@"),i.lines))n.push(e)}return n.join("\n")+"\n"}function eh(e,t,n,i=!1){let r=et(function(e,t,n,i,r,o,a){if("function"==typeof a&&(a={callback:a}),null==a?void 0:a.callback){let{callback:s}=a;el(e,t,n,i,r,o,Object.assign(Object.assign({},a),{callback:e=>{e?s(ed(e,a.headerOptions)):s(void 0)}}))}else{let s=el(e,t,n,i,r,o,a);if(!s)return;return ed(s,null==a?void 0:a.headerOptions)}}(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(null!=e.cacheKey&&null!=t.cacheKey)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(null==r)throw Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return null!=t.lang&&(r.lang=t.lang),r}e.s(["parseDiffFromFile",0,eh],92458);let ef=-1;var ec=class{static LoadedCustomComponent=v.DiffsContainerLoaded;__id=`file-diff:${++ef}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:t.DEFAULT_THEMES},r,o=!1){this.options=e,this.workerManager=r,this.isContainerManaged=o,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new i.ResizeManager,this.scrollSyncManager=new b,this.interactionManager=new n.InteractionManager("diff",(0,n.pluckInteractionOptions)(e,"function"==typeof e.hunkSeparators||(e.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===e.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return{...e,headerRenderMode:null!=e.renderCustomHeader?"custom":"default",hunkSeparators:"function"==typeof e.hunkSeparators?"custom":e.hunkSeparators}}createHunksRenderer(e){return new $(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{let n,i;if(null==this.fileDiff)return;let r=this.fileDiff.hunks.at(-1);e:for(let o of this.fileDiff.hunks){let a="deletions"===t?o.deletionStart:o.additionStart,s="deletions"===t?o.deletionCount:o.additionCount,l=o.splitLineStart,d=o.unifiedLineStart;if(e<a){let t=a-e;n=Math.max(d-t,0),i=Math.max(l-t,0);break}if(e>=a+s){if(o===r){let t=e-(a+s);n=d+o.unifiedLineCount+t,i=l+o.splitLineCount+t;break}continue}for(let r of o.hunkContent)if("context"===r.type)if(e<a+r.lines){let t=e-a;i=l+t,n=d+t;break e}else a+=r.lines,l+=r.lines,d+=r.lines;else{let o="deletions"===t?r.deletions:r.additions;if(e<a+o){let o=e-a;n=d+("additions"===t?r.deletions:0)+o,i=l+o;break e}a+=o,l+=Math.max(r.deletions,r.additions),d+=r.deletions+r.additions}break}if(null!=n&&null!=i)return[n,i]};setOptions(e){null!=e&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions((0,n.pluckInteractionOptions)(e,"function"==typeof e.hunkSeparators||(e.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===e.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")===e||(this.mergeOptions({themeType:e}),"string"!=typeof this.options.theme&&null!=this.fileContainer&&null!=this.appliedThemeCSS&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!e&&!t&&!n&&"function"!=typeof this.options.hunkSeparators}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,null!=this.pre&&(this.pre.innerHTML="",this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:a,fileDiff:s}=e;this.hydrateElements(t,n),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:o,newFile:a,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,n){for(let i of((0,m.prerenderHTMLIfNecessary)(e,n),e.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){for(let e of(this.pre=i,i.children))e instanceof HTMLElement&&"code"===e.tagName.toLowerCase()&&("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 i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}}}null!=this.pre&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),(null!=this.pre||null!=this.headerElement)&&(this.fileContainer=e)}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){let{diffStyle:r="split",overflow:o="scroll"}=this.options;this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(null!=t&&null!=n?eh(t,n,this.options.parseDiffOptions):void 0),null!=this.pre&&(this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,"wrap"===o),"scroll"===o&&"split"===r&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions))}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&this.render({forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:n,fileDiff:i,forceRender:o=!1,preventEmit:a=!1,lineAnnotations:l,fileContainer:d,containerWrapper:h,renderRange:f}){if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");let{collapsed:c=!1}=this.options,u=c?void 0:f,p=null!=e&&null!=n&&(!(0,s.areFilesEqual)(e,this.deletionFile)||!(0,s.areFilesEqual)(n,this.additionFile)),m=null!=i&&i!==this.fileDiff,g=null!=l&&(l.length>0||this.lineAnnotations.length>0)&&l!==this.lineAnnotations;if(!c&&(0,r.areRenderRangesEqual)(u,this.renderRange)&&!o&&!g&&(null!=i&&i===this.fileDiff||null==i&&!p))return!1;let{renderRange:v}=this;if(this.renderRange=u,this.deletionFile=e,this.additionFile=n,null!=i?this.fileDiff=i:null!=e&&null!=n&&p&&(m=!0,this.fileDiff=eh(e,n,this.options.parseDiffOptions)),null!=l&&this.setLineAnnotations(l),null==this.fileDiff)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:b="split",disableErrorHandling:C=!1,disableFileHeader:x=!1,overflow:S="scroll",themeType:y="system"}=this.options;if(x&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),d=this.getOrCreateFileContainer(d,h),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,t.EMPTY_RENDER_RANGE);null!=e&&this.applyThemeState(d,e.themeStyles,y,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,d),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,d)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(d);if(!(this.canPartiallyRender(o,g,p||m)&&this.applyPartialRender({previousRenderRange:v,renderRange:u}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,u);if(null==t)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(d,t.themeStyles,y,t.baseThemeType),null!=t.headerElement&&this.applyHeaderToDOM(t.headerElement,d),null!=t.additionsContentAST||null!=t.deletionsContentAST||null!=t.unifiedContentAST?this.applyHunksToDOM(e,t):null!=this.pre&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,"wrap"===S),"scroll"===S&&"split"===b?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,d)}return a||this.emitPostRender(),!0}emitPostRender(){null!=this.fileContainer&&this.options.onPostRender?.(this.fileContainer,this)}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();for(let{element:e}of(this.separatorCache.clear(),this.annotationCache.values()))e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(null==this.fileContainer)return!1;if(this.cleanChildNodes(),null==this.placeHolder){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.placeHolder.style.setProperty("height",`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof t){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let i of e){let e=i.slotName,r=this.separatorCache.get(e);if(null==r||!Y(i,r.hunkData)){r?.element.remove();let n=document.createElement("div");n.style.display="contents",n.slot=i.slotName;let o=t(i,this);null!=o&&n.appendChild(o),this.fileContainer.appendChild(n),r={element:n,hunkData:i},this.separatorCache.set(e,r)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||null==this.fileContainer){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(null!=t&&this.lineAnnotations.length>0)for(let[n,i]of this.lineAnnotations.entries()){let r=`${n}-${(0,o.getLineAnnotationName)(i)}`,a=this.annotationCache.get(r);if(null==a||!Q(i,a.annotation)){a?.element.remove();let e=t(i);if(null==e)continue;(a={element:(0,d.createAnnotationWrapperNode)((0,o.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(r,a)}e.delete(r)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(null==this.fileContainer||null==e){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(null!=t&&null!=this.gutterUtilityContent)return;if(null==t){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=(0,h.createGutterUtilityContentNode)();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,n){let i=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(t.DIFFS_TAG_NAME),null!=i&&i!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),null!=n&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),null==this.spriteSVG){let e=document.createElement("div");e.innerHTML=a.SVGSpriteSheet;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return null==this.pre?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){for(let t of(this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,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,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:i}=this,r=(0,_.toHtml)(e);if(r!==this.lastRenderedHeaderHTML){let e=document.createElement("div");e.innerHTML=r;let t=e.firstElementChild;if(!(t instanceof HTMLElement))return;null!=this.headerElement?n.shadowRoot?.replaceChild(t,this.headerElement):n.shadowRoot?.prepend(t),this.headerElement=t,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||null==i)return;let{renderCustomHeader:o,renderHeaderPrefix:a,renderHeaderMetadata:s}=this.options;if(null!=o){let e=o(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,t.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let l=a?.(i)??void 0,d=s?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,t.HEADER_PREFIX_SLOT_ID,l),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,t.HEADER_METADATA_SLOT_ID,d),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(null==i)return void t?.remove();let r=t??this.createHeaderSlotElement(n);return null==t&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}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(null!=t){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,f.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,c.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==t||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,p.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,c.wrapThemeCSS)(t,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:t,themeType:o,baseThemeType:i}:void 0)}applyHunksToDOM(e,t){let{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r="wrap"===n?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],s=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);null!=s?(o=null==this.codeUnified||null!=this.codeAdditions||null!=this.codeDeletions,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=(0,u.getOrCreateCodeNode)({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),a.push(this.codeUnified)):null!=l||null!=d?(null!=l?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=(0,u.getOrCreateCodeNode)({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),null!=d?(o=o||null==this.codeAdditions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=(0,u.getOrCreateCodeNode)({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),0===a.length?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==n||null==e||null==t||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||null==this.lastRowCount)return!1;let s=this.getCodeColumns(a,i,o,r);if(null==s)return!1;let l=e.startingLine,d=t.startingLine,h=l+e.totalLines,f=d+t.totalLines,c=Math.max(l,d),u=Math.min(h,f);if(u<=c)return!1;let p=Math.max(0,c-l),m=Math.max(0,h-u),g=this.trimColumns({columns:s,trimStart:p,trimEnd:m,previousStart:l,overlapStart:c,overlapEnd:u,diffStyle:a});if(g<0)throw Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<g)throw Error("applyPartialRender: trimmed beyond DOM row count");let v=this.lastRowCount-g,b=(e,t)=>{if(!(t<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},C=b(d,Math.max(c-d,0));if(null==C&&d<c)return!1;let x=b(u,Math.max(f-u,0));if(null==x&&f>u)return!1;let S=(e,t)=>{if(null!=e){if("unified"!==a||Array.isArray(s))if("split"===a&&Array.isArray(s))this.insertPartialHTML(a,s,e,t);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,s,e,t);v+=e.rowCount}};return this.cleanupErrorWrapper(),S(C,"afterbegin"),S(x,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(a,s,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,i){if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST("deletions",n),r=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],e,i),this.renderPartialColumn(t[1],r,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,e,i)}}renderPartialColumn(e,t,n){if(null==e||null==t)return;let i=eu(t[0]),r=eu(t[1]);if(null==i||null==r)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);"beforeend"===n&&o?.type==="element"&&"number"==typeof o.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);let a=r.at(-1);"afterbegin"===n&&a?.type==="element"&&"number"==typeof a.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);null!=a&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let i=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${n}`),e.content.style.setProperty("grid-row",`span ${n}`))};if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t))i(t[0]),i(t[1]);else throw Error("dun fuuuuked up");else i(t)}trimColumnRows(e,t,n){let i=0,r=0,o=0,a=!1,s=n>=0;if(null==e)return 0;let l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<l.length&&(!(t<=0)||s||a);){let e=d[o],h=l[o];if(o++,!(e instanceof HTMLElement)||!(h instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:h}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in h.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in h.dataset)){e.remove(),h.remove(),r++;continue}if("lineIndex"in e.dataset&&"lineIndex"in h.dataset){(t>0||s&&i>=n)&&(e.remove(),h.remove(),t>0&&0==--t&&(a=!0),r++),i++;continue}if("separator"in e.dataset&&"separator"in h.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in h.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in h.dataset){(t>0||s&&i>=n)&&(e.remove(),h.remove(),r++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in h.dataset){let o=this.getBufferSize(h.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let n=Math.min(t,o),i=o-n;i>0?(this.updateBufferSize(e,i),this.updateBufferSize(h,i),r+=n):(e.remove(),h.remove(),r+=o),t-=n}else if(s){let t=i,a=i+o-1;if(n<=t)e.remove(),h.remove(),r+=o;else if(n<=a){let t=a-n+1,i=o-t;this.updateBufferSize(e,i),this.updateBufferSize(h,i),r+=t}}i+=o;continue}throw console.error({gutterElement:e,contentElement:h}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let s=Math.max(0,i-r),l=n-r;if(l<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,h=o>0;if(!d&&!h)return 0;let f=d?s:0,c=h?l:-1;if("unified"===t&&!Array.isArray(e))return this.trimColumnRows(e,f,c);if("split"===t&&Array.isArray(e)){let t=this.trimColumnRows(e[0],f,c),n=this.trimColumnRows(e[1],f,c);if(null!=e[0]&&null!=e[1]&&t!==n)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?t:n}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)`)}getCodeColumns(e,t,n,i){function r(e){if(null==e)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}if("unified"===e)return r(t);{let e=r(n),t=r(i);return null!=e||null!=t?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||null==t){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==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")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==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")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:s=!1,overflow:d="scroll",diffStyle:h="split"}=this.options,f={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:s,overflow:d,split:"unified"!==h&&null!=t&&null!=n,totalLines:i,customProperties:r};(0,l.arePrePropertiesEqual)(f,this.appliedPreAttributes)||((0,g.setPreNodeProperties)(e,f),this.appliedPreAttributes=f)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML="",n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function eu(e){if(null!=e&&"element"===e.type)return e.children??[]}e.s(["FileDiff",0,ec],18750)},5096,e=>{"use strict";let t=new Set,n=new Set,i=null,r=!1;function o(e){for(let t of(r=!0,n))try{t(e)}catch(e){console.error(e)}n.clear(),t.size>0?(n=new Set(t),t.clear(),i=requestAnimationFrame(o)):i=null,r=!1}e.s(["queueRender",0,function(e){r?t.add(e):(n.add(e),i??=requestAnimationFrame(o))}])},52861,e=>{"use strict";function t(e,t,n,i,r,o){for(let a=0;a<o;a++){let o=t[i+a],s=n[r+a];if(null==o||null==s)throw Error("pushCollapsedContextLines: missing collapsed context line");e.deletionLines.push(o),e.additionLines.push(s)}}function n(e,t,n,i){if("context"===e.type)for(let n=0;n<e.lines;n++){let r=i[e.additionLineIndex+n];if(null==r)throw console.error({additionLines:i,content:e,i:n}),Error("pushContentLinesToDiff: Context line does not exist");t.deletionLines.push(r),t.additionLines.push(r)}else{let r=Math.max(e.deletions,e.additions);for(let o=0;o<r;o++){if(o<e.deletions){let i=n[e.deletionLineIndex+o];if(null==i)throw console.error({deletionLines:n,content:e,i:o}),Error("pushContentLinesToDiff: Deletion line does not exist");t.deletionLines.push(i)}if(o<e.additions){let n=i[e.additionLineIndex+o];if(null==n)throw console.error({additionLines:i,content:e,i:o}),Error("pushContentLinesToDiff: Addition line does not exist");t.additionLines.push(n)}}}}function i(e,t,n){"context"===e.type?(t.nextAdditionLineIndex+=e.lines,t.nextDeletionLineIndex+=e.lines,t.nextAdditionStart+=e.lines,t.nextDeletionStart+=e.lines,t.splitLineCount+=e.lines,t.unifiedLineCount+=e.lines,n.additionCount+=e.lines,n.deletionCount+=e.lines,n.splitLineCount+=e.lines,n.unifiedLineCount+=e.lines):(t.nextAdditionLineIndex+=e.additions,t.nextDeletionLineIndex+=e.deletions,t.nextAdditionStart+=e.additions,t.nextDeletionStart+=e.deletions,t.splitLineCount+=Math.max(e.deletions,e.additions),t.unifiedLineCount+=e.deletions+e.additions,n.deletionCount+=e.deletions,n.deletionLines+=e.deletions,n.additionCount+=e.additions,n.additionLines+=e.additions,n.splitLineCount+=Math.max(e.deletions,e.additions),n.unifiedLineCount+=e.deletions+e.additions)}e.s(["resolveRegion",0,function(e,r){let{resolution:o,hunkIndex:a,startContentIndex:s,endContentIndex:l,indexesToDelete:d=new Set}=r,h=e.hunks[a];if(null==h)throw console.error({diff:e,hunkIndex:a}),Error(`resolveRegion: Invalid hunk index: ${a}`);if(s<0||l>=h.hunkContent.length||s>l)throw Error(`resolveRegion: Invalid content range, ${s}, ${l}`);let{hunks:f,additionLines:c,deletionLines:u}=e,p={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:null!=e.cacheKey?`${e.cacheKey}:${o[0]}-${a}:${s}-${l}`:void 0},m={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},g=a===f.length-1&&l===h.hunkContent.length-1,v=!e.isPartial;for(let[r,h]of f.entries()){var b,C,x,S,y,L,k;b=e,C=p,x=m,S=h.deletionLineIndex-h.collapsedBefore,y=h.additionLineIndex-h.collapsedBefore,L=h.collapsedBefore,k=v,L<=0||(k&&(t(C,b.deletionLines,b.additionLines,S,y,L),x.nextAdditionLineIndex+=L,x.nextDeletionLineIndex+=L),x.nextAdditionStart+=L,x.nextDeletionStart+=L,x.splitLineCount+=L,x.unifiedLineCount+=L);let f={...h,hunkContent:[],additionStart:m.nextAdditionStart,deletionStart:m.nextDeletionStart,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex,additionCount:0,deletionCount:0,deletionLines:0,additionLines:0,splitLineStart:m.splitLineCount,unifiedLineStart:m.unifiedLineCount,splitLineCount:0,unifiedLineCount:0};for(let[e,t]of h.hunkContent.entries())if(r!==a||e<s||e>l){n(t,p,u,c);let e={...t,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex};f.hunkContent.push(e),i(e,m,f)}else if(d.has(e))f.hunkContent.push({type:"context",lines:0,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex});else if("context"===t.type){n(t,p,u,c);let e={...t,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};f.hunkContent.push(e),i(e,m,f)}else{var E=o,A=t,w=p,T=u,M=c;if("deletions"===E||"both"===E)for(let e=0;e<A.deletions;e++){let t=T[A.deletionLineIndex+e];if(null==t)throw console.error({deletionLines:T,content:A,i:e}),Error("pushResolveLinesToDiff: Deletion line does not exist");w.deletionLines.push(t),w.additionLines.push(t)}if("additions"===E||"both"===E)for(let e=0;e<A.additions;e++){let t=M[A.additionLineIndex+e];if(null==t)throw console.error({additionLines:M,content:A,i:e}),Error("pushResolveLinesToDiff: Addition line does not exist");w.deletionLines.push(t),w.additionLines.push(t)}let e={type:"context",lines:"deletions"===o?t.deletions:"additions"===o?t.additions:t.deletions+t.additions,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};f.hunkContent.push(e),i(e,m,f)}if(r===a&&g){let e="deletions"===o?h.noEOFCRDeletions:h.noEOFCRAdditions;f.noEOFCRAdditions=e,f.noEOFCRDeletions=e}p.hunks.push(f)}let R=f.at(-1);return null==R||e.isPartial||t(p,u,c,R.deletionLineIndex+R.deletionCount,R.additionLineIndex+R.additionCount,Math.min(u.length-(R.deletionLineIndex+R.deletionCount),c.length-(R.additionLineIndex+R.additionCount))),p.splitLineCount=m.splitLineCount,p.unifiedLineCount=m.unifiedLineCount,p}])},89221,e=>{"use strict";e.s(["normalizeDiffResolution",0,function(e){let t="string"==typeof e?e:e.type;return"accept"===t||"incoming"===t?"additions":"reject"===t||"current"===t?"deletions":"both"}])},7256,e=>{"use strict";var t=e.i(89221),n=e.i(52861);e.s(["resolveConflict",0,function(e,i,r){var o;let a;return(0,n.resolveRegion)(e,{resolution:(0,t.normalizeDiffResolution)(r),hunkIndex:i.hunkIndex,startContentIndex:i.startContentIndex,endContentIndex:i.endContentIndex,indexesToDelete:(o=i,a=new Set,null!=o.baseContentIndex&&a.add(o.baseContentIndex),o.endMarkerContentIndex!==o.endContentIndex&&a.add(o.endMarkerContentIndex),a)})}])},1376,22151,e=>{"use strict";function t(e,t,n){let i=e.conflictStack[e.conflictStack.length-1];if(null==i)return t.length>=7&&60===t.charCodeAt(0)&&"start"===f(t)?void l(e,t,n):void a(e,t);let r=f(t);if("start"===r)return void l(e,t,n);if("base"===r){i.stage="base",i.baseMarkerLineIndex=n,i.markerLines.base=t;return}if("separator"===r){i.stage="incoming",i.separatorLineIndex=n,i.markerLines.separator=t;return}if("end"===r){let i=e.conflictStack.pop();if(null==i)throw Error("parseMergeConflictDiffFromFile: encountered end marker before start marker");var o=e,d=i,h=n,c=t;if(null==d.separatorLineIndex||null==d.markerLines.separator)throw Error(`parseMergeConflictDiffFromFile: conflict ${d.conflictIndex} is missing a separator marker`);let r=o.conflictBuilders[d.conflictIndex];if(null==r)throw Error(`parseMergeConflictDiffFromFile: failed to finalize conflict ${d.conflictIndex}`);let a=r.action;a.markerLines.separator=d.markerLines.separator,a.markerLines.end=c,null!=d.markerLines.base&&(a.markerLines.base=d.markerLines.base),a.conflict={conflictIndex:d.conflictIndex,startLineIndex:d.startLineIndex,startLineNumber:d.startLineIndex+1,separatorLineIndex:d.separatorLineIndex,separatorLineNumber:d.separatorLineIndex+1,endLineIndex:h,endLineNumber:h+1,baseMarkerLineIndex:d.baseMarkerLineIndex,baseMarkerLineNumber:null!=d.baseMarkerLineIndex?d.baseMarkerLineIndex+1:void 0};let s=a.currentContentIndex??a.incomingContentIndex;if(a.currentContentIndex??=s,a.incomingContentIndex??=s,a.startContentIndex<0&&null!=s&&(a.startContentIndex=s),a.endContentIndex<0&&null!=s&&(a.endContentIndex=s),a.endMarkerContentIndex<0&&null!=s&&(a.endMarkerContentIndex=s),a.hunkIndex<0||a.startContentIndex<0||a.endContentIndex<0||a.endMarkerContentIndex<0)throw Error(`parseMergeConflictDiffFromFile: failed to anchor merge conflict ${d.conflictIndex}`);o.actions[a.conflictIndex]=a,r.completed=!0;return}"current"===i.stage?s(e,"deletion",t,i.conflictIndex,"current"):"base"===i.stage?a(e,t,i.conflictIndex):s(e,"addition",t,i.conflictIndex,"incoming")}function n(e){return e.activeHunk??=d(e.additionLines.length+1,e.deletionLines.length+1),e.activeHunk}function i(e,t,n,i){let r=e.conflictBuilders[t];if(null==r)throw Error(`parseMergeConflictDiffFromFile: failed to locate conflict action ${t}`);let o=r.action,a=e.hunks.length;if(o.hunkIndex<0)o.hunkIndex=a;else if(o.hunkIndex!==a)throw Error(`parseMergeConflictDiffFromFile: conflict ${t} spans multiple hunks and cannot be anchored`);if(o.startContentIndex<0&&(o.startContentIndex=i),o.endContentIndex=i,o.endMarkerContentIndex=i,"current"===n){o.currentContentIndex??=i;return}if("base"===n){o.baseContentIndex??=i;return}o.incomingContentIndex=i}function r(e,t,n){let r,o=t.contextBufferCount,a=t.contextBufferAdditionStart,s=t.contextBufferDeletionStart;if("leading"===n&&o>e.maxContextLines){let n=o-e.maxContextLines;a+=n,s+=n,o=e.maxContextLines,t.additionStart+=n,t.deletionStart+=n,t.additionLineIndex+=n,t.deletionLineIndex+=n}if("trailing"===n&&o>e.maxContextLines&&(o=e.maxContextLines),0===o){t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0;return}let l=t.hunkContent,d=l[l.length-1];d?.type==="context"?d.lines+=o:l.push({type:"context",lines:o,additionLineIndex:a,deletionLineIndex:s}),r=l.length-1,t.additionCount+=o,t.deletionCount+=o;let h=t.contextBufferBaseConflicts;if(null!=h){let n=a-t.contextBufferAdditionStart;for(let[t,a]of h)t>=n&&t<n+o&&i(e,a,"base",r)}t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0}function o(e){if(null==e.activeHunk)return;let t=e.activeHunk;if(e.activeHunk=void 0,0===t.hunkContent.length)return;let n=0,i=0;for(let e of t.hunkContent)"context"===e.type?(n+=e.lines,i+=e.lines):(n+=Math.max(e.additions,e.deletions),i+=e.additions+e.deletions);let r=Math.max(t.additionStart-1-e.lastHunkEnd,0),o={collapsedBefore:r,additionStart:t.additionStart,additionCount:t.additionCount,additionLines:t.additionLines,additionLineIndex:t.additionLineIndex,deletionStart:t.deletionStart,deletionCount:t.deletionCount,deletionLines:t.deletionLines,deletionLineIndex:t.deletionLineIndex,hunkContent:t.hunkContent,hunkContext:void 0,hunkSpecs:`@@ -${h(t.deletionStart,t.deletionCount)} +${h(t.additionStart,t.additionCount)} @@
|
|
67
|
-
`,splitLineStart:e.splitLineCount+r,splitLineCount:n,unifiedLineStart:e.unifiedLineCount+r,unifiedLineCount:i,noEOFCRAdditions:!1,noEOFCRDeletions:!1};e.hunks.push(o),e.splitLineCount+=r+n,e.unifiedLineCount+=r+i,e.lastHunkEnd=t.additionStart+t.additionCount-1}function a(e,t,i=-1){let r=n(e);0===r.contextBufferCount&&(r.contextBufferAdditionStart=e.additionLines.length,r.contextBufferDeletionStart=e.deletionLines.length),e.additionLines.push(t),e.deletionLines.push(t),i>=0&&(r.contextBufferBaseConflicts??=new Map,r.contextBufferBaseConflicts.set(r.contextBufferCount,i)),r.contextBufferCount++}function s(e,t,a,s,l){let h,f,c=n(e);c.hunkContent.length>0&&c.contextBufferCount>e.maxContextLines2&&(!function(e){let t;if(null==e.activeHunk)return;let n=e.activeHunk,i=n.contextBufferCount,a=i-e.maxContextLines2,s=n.contextBufferAdditionStart+i-e.maxContextLines,l=n.contextBufferDeletionStart+i-e.maxContextLines;if(null!=n.contextBufferBaseConflicts){let r=i-e.maxContextLines;for(let[e,i]of n.contextBufferBaseConflicts)e>=r&&(t??=new Map).set(e-r,i)}r(e,n,"trailing");let h=n.additionCount,f=n.deletionCount;o(e),e.activeHunk=d(n.additionStart+h+a,n.deletionStart+f+a),e.activeHunk.contextBufferAdditionStart=s,e.activeHunk.contextBufferDeletionStart=l,e.activeHunk.contextBufferCount=e.maxContextLines,e.activeHunk.contextBufferBaseConflicts=t}(e),c=e.activeHunk),r(e,c,0===c.hunkContent.length?"leading":"before-change");let u=e.additionLines.length,p=e.deletionLines.length;"addition"===t?e.additionLines.push(a):e.deletionLines.push(a);let m=(f=(h=c.hunkContent)[h.length-1],f?.type==="change"?"addition"===t?f.additions++:f.deletions++:h.push({type:"change",additions:+("addition"===t),deletions:+("deletion"===t),additionLineIndex:u,deletionLineIndex:p}),h.length-1);"addition"===t?(c.additionCount++,c.additionLines++):(c.deletionCount++,c.deletionLines++),i(e,s,l,m)}function l(e,t,n){let i=e.nextConflictIndex;e.nextConflictIndex++,e.conflictStack.push({conflictIndex:i,stage:"current",startLineIndex:n,markerLines:{start:t}}),e.conflictBuilders[i]={completed:!1,action:{conflict:{conflictIndex:i,startLineIndex:n,startLineNumber:n+1,separatorLineIndex:n,separatorLineNumber:n+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:void 0,baseMarkerLineNumber:void 0},conflictIndex:i,hunkIndex:-1,startContentIndex:-1,endContentIndex:-1,endMarkerContentIndex:-1,markerLines:{start:t,separator:"",end:""}}}}function d(e,t){return{additionStart:e,deletionStart:t,additionCount:0,deletionCount:0,additionLines:0,deletionLines:0,additionLineIndex:Math.max(e-1,0),deletionLineIndex:Math.max(t-1,0),hunkContent:[],contextBufferAdditionStart:Math.max(e-1,0),contextBufferDeletionStart:Math.max(t-1,0),contextBufferCount:0,contextBufferBaseConflicts:void 0}}function h(e,t){return 1===t?`${e}`:`${e},${t}`}function f(e){var t,n;let i;if(e.length<7)return;let r=e.charCodeAt(0);if(60!==r&&62!==r&&61!==r&&124!==r)return;let o=((i=(t=e).length)>0&&10===t.charCodeAt(i-1)&&i--,i>0&&13===t.charCodeAt(i-1)&&i--,i);if(o<7)return;let a=1;for(;a<o&&e.charCodeAt(a)===r;)a++;if(!(a<7)){if(61===r)return a===o?"separator":void 0;if(a===o||9===(n=e.charCodeAt(a))||10===n||11===n||12===n||13===n||32===n)return 60===r?"start":62===r?"end":"base"}}function c(e,t,n){return{...e,contents:n,cacheKey:null!=e.cacheKey?`${e.cacheKey}:merge-conflict-${t}`:void 0}}function u(e,t){let n=[],i=Array(e.hunks.length),r=(t,n)=>{let r=e.hunks[t];if(null==r)return 0;let o=i[t];if(null==o){o=Array(r.hunkContent.length+1);let e=r.unifiedLineStart;o[0]=e;for(let t=0;t<r.hunkContent.length;t++){let n=r.hunkContent[t];e+="context"===n.type?n.lines:n.deletions+n.additions,o[t+1]=e}i[t]=o}return o[Math.max(n,0)]??r.unifiedLineStart},o=(e,t)=>Math.max(r(e,t),(i[e]?.[Math.max(t+1,0)]??r(e,t+1))-1);for(let i of t){if(null==i)continue;let t=e.hunks[i.hunkIndex];if(null==t)continue;let a=r(i.hunkIndex,i.startContentIndex);if(n.push(p(i,"marker-start",i.startContentIndex,i.markerLines.start,a)),null!=i.baseContentIndex){let e=i.currentContentIndex,a=i.incomingContentIndex;if(null==e||null==a)continue;let s=i.markerLines.base;if(null==s)continue;let l=t.hunkContent[e],d=t.hunkContent[i.baseContentIndex],h=t.hunkContent[a];if(l?.type!=="change"||d?.type!=="context"||h?.type!=="change")continue;let f=r(i.hunkIndex,e),c=r(i.hunkIndex,a);n.push(p(i,"marker-base",i.baseContentIndex,s,f+l.deletions)),n.push(p(i,"marker-separator",i.baseContentIndex,i.markerLines.separator,c),p(i,"marker-end",i.endMarkerContentIndex,i.markerLines.end,o(i.hunkIndex,i.endMarkerContentIndex)));continue}let s=i.currentContentIndex;if(null==s)continue;let l=t.hunkContent[s];if(l?.type!=="change")continue;let d=r(i.hunkIndex,s),h=l.deletions>0?d+l.deletions:a;n.push(p(i,"marker-separator",s,i.markerLines.separator,h),p(i,"marker-end",i.endMarkerContentIndex,i.markerLines.end,o(i.hunkIndex,i.endMarkerContentIndex)))}return n}function p(e,t,n,i,r){return{type:t,hunkIndex:e.hunkIndex,contentIndex:n,conflictIndex:e.conflictIndex,lineText:i,lineIndex:r}}e.s(["getMergeConflictActionSlotName",0,function({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}],1376),e.s(["buildMergeConflictMarkerRows",0,u,"getMergeConflictActionAnchor",0,function(e,t){let n=t.hunks[e.hunkIndex];if(null!=n)return{hunkIndex:e.hunkIndex,lineIndex:function(e,t){let n=e.unifiedLineStart;for(let i=0;i<t;i++){let t=e.hunkContent[i];n+="context"===t.type?t.lines:t.deletions+t.additions}return n}(n,e.startContentIndex)}},"parseMergeConflictDiffFromFile",0,function(e,n=6){let i={deletionLines:[],additionLines:[],conflictStack:[],conflictBuilders:[],actions:[],hunks:[],nextConflictIndex:0,splitLineCount:0,unifiedLineCount:0,lastHunkEnd:0,activeHunk:void 0,maxContextLines:n=Math.max(n,1),maxContextLines2:2*n},a=e.contents,s=a.length;if(s>0){let e=0,n=0,r=a.indexOf("\n",e);for(;-1!==r;)t(i,a.slice(e,r+1),n),e=r+1,n++,r=a.indexOf("\n",e);e<s&&t(i,a.slice(e),n)}if(i.conflictStack.length>0)throw Error("parseMergeConflictDiffFromFile: unfinished merge conflict marker stack");null!=i.activeHunk&&i.activeHunk.hunkContent.length>0&&(r(i,i.activeHunk,"trailing"),o(i));for(let e=0;e<i.conflictBuilders.length;e++){let t=i.conflictBuilders[e];if(null==t||!t.completed)throw Error(`parseMergeConflictDiffFromFile: failed to build merge conflict action ${e}`)}if(i.hunks.length>0&&i.additionLines.length>0&&i.deletionLines.length>0){let e=i.hunks[i.hunks.length-1],t=Math.max(i.additionLines.length-(e.additionStart+e.additionCount-1),0);i.splitLineCount+=t,i.unifiedLineCount+=t}let l=i.deletionLines.join(""),d=i.additionLines.join(""),h=c(e,"current",l),f=c(e,"incoming",d),p="change";""===d?p="deleted":""===l&&(p="new");let m={name:e.name,prevName:void 0,type:p,hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,isPartial:!1,deletionLines:i.deletionLines,additionLines:i.additionLines,cacheKey:null!=e.cacheKey?`${e.cacheKey}:merge-conflict-diff`:void 0};return{fileDiff:m,currentFile:h,incomingFile:f,actions:i.actions,markerRows:u(m,i.actions)}}],22151)},38401,73810,e=>{"use strict";var t=e.i(27101),n=e.i(6104),i=e.i(10923),r=e.i(1376),o=e.i(22151),a=class extends i.DiffHunksRenderer{pendingConflictActions=[];pendingMarkerRows=[];injectedRows=new Map;options;constructor(e={theme:t.DEFAULT_THEMES},n,i){super(void 0,n,i),this.options=e}setConflictState(e,t,n){this.pendingConflictActions=e,this.pendingMarkerRows=t,this.syncInjectedRows(e,t,n)}syncInjectedRows(e,t,n){for(let t of(this.injectedRows.clear(),e)){let e=null!=t?(0,o.getMergeConflictActionAnchor)(t,n):void 0;if(null==t||null==e)continue;let i={type:"actions",hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:t.conflictIndex};this.addInjectedRow(i)}for(let e of t)this.addInjectedRow(e)}addInjectedRow(e){let t=`${e.hunkIndex}:${e.lineIndex}`,n=this.injectedRows.get(t);null==n?this.injectedRows.set(t,[e]):n.push(e)}renderDiff(e,n=t.DEFAULT_RENDER_RANGE){return null!=e&&this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.renderDiff(e,n)}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){return this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.asyncRender(e,n)}createPreElement(e,t){return super.createPreElement(e,t,{"data-has-merge-conflict":""})}getUnifiedLineDecoration({type:e,lineType:t}){let n="change"===e?"change-deletion"===t?"current":"incoming":void 0;return{gutterLineType:"change"===e?"context":t,gutterProperties:s(n),contentProperties:l(e,n)}}getSplitLineDecoration({side:e,type:t}){let n="change"===t?"deletions"===e?"current":"incoming":void 0;return{gutterLineType:"change"===t?"context":t,gutterProperties:s(n),contentProperties:l(t,n)}}getUnifiedInjectedRowsForLine=e=>{let t=this.injectedRows.get(`${e.hunkIndex}:${e.lineIndex}`);if(null==t||0===t.length)return;let{mergeConflictActionsType:i}=this.getOptionsWithDefaults(),o=[],a=[];for(let e of t){var s;if("actions"===e.type){o.push({content:function({row:e,includeDefaultActions:t,includeSlot:i}){var o;let a=t?[h({resolution:"current",label:"Accept current change",conflictIndex:o=e.conflictIndex}),f(),h({resolution:"incoming",label:"Accept incoming change",conflictIndex:o}),f(),h({resolution:"both",label:"Accept both",conflictIndex:o})]:[];return i&&a.push((0,n.createHastElement)({tagName:"slot",properties:{name:(0,r.getMergeConflictActionSlotName)({hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:e.conflictIndex}),"data-merge-conflict-action-slot":""}})),(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict-actions":""},children:[(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict-actions-content":""},children:a})]})}({row:e,includeDefaultActions:"default"===i,includeSlot:!0}),gutter:d("action")});continue}("marker-end"===e.type?a:o).push({content:(s=e,(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict":s.type,"data-merge-conflict-marker-row":""},children:[(0,n.createTextNodeElement)(s.lineText.replace(/(?:\r\n|\n|\r)$/,""))]})),gutter:d("marker",e.type)})}return{before:o.length>0?o:void 0,after:a.length>0?a:void 0}};getOptionsWithDefaults(){let e=super.getOptionsWithDefaults();return e.diffStyle="unified",e.lineDiffType="none",e.mergeConflictActionsType=this.options.mergeConflictActionsType??"default",e}};function s(e){return null!=e?{"data-merge-conflict":e}:void 0}function l(e,t){if(null!=t){if("change"===e)return"current"===t||"incoming"===t?{"data-line-type":"context","data-merge-conflict":t}:void 0;if("marker-start"===t||"marker-base"===t||"marker-separator"===t||"marker-end"===t)return{"data-merge-conflict":t}}}function d(e,t){let i=(0,n.createGutterGap)(void 0,"annotation",1);return i.properties["data-gutter-buffer"]="action"===e?"merge-conflict-action":`merge-conflict-${t??"marker"}`,i}function h({resolution:e,label:t,conflictIndex:i}){return(0,n.createHastElement)({tagName:"button",properties:{type:"button","data-merge-conflict-action":e,"data-merge-conflict-conflict-index":`${i}`},children:[(0,n.createTextNodeElement)(t)]})}function f(){return(0,n.createHastElement)({tagName:"span",properties:{"data-merge-conflict-action-separator":""},children:[(0,n.createTextNodeElement)("|")]})}e.s(["UnresolvedFileHunksRenderer",0,a],38401),e.s(["areMergeConflictActionsEqual",0,function(e,t){var n,i;return e.hunkIndex===t.hunkIndex&&e.startContentIndex===t.startContentIndex&&e.endContentIndex===t.endContentIndex&&e.currentContentIndex===t.currentContentIndex&&e.baseContentIndex===t.baseContentIndex&&e.incomingContentIndex===t.incomingContentIndex&&e.endMarkerContentIndex===t.endMarkerContentIndex&&e.conflictIndex===t.conflictIndex&&(n=e.conflict,i=t.conflict,n.conflictIndex===i.conflictIndex&&n.startLineIndex===i.startLineIndex&&n.startLineNumber===i.startLineNumber&&n.separatorLineIndex===i.separatorLineIndex&&n.separatorLineNumber===i.separatorLineNumber&&n.endLineIndex===i.endLineIndex&&n.endLineNumber===i.endLineNumber&&n.baseMarkerLineIndex===i.baseMarkerLineIndex&&n.baseMarkerLineNumber===i.baseMarkerLineNumber)}],73810)},84745,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(59390),r=e.i(60166),o=e.i(93946),a=e.i(18750),s=e.i(1376),l=e.i(22151),d=e.i(38401),h=e.i(73810),f=e.i(7256);let c=-1;var u=class extends a.FileDiff{__id=`unresolved-file:${++c}`;computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0};conflictActions=[];markerRows=[];conflictActionCache=new Map;constructor(e={theme:t.DEFAULT_THEMES},n,i=!1){super(void 0,n,i),this.options=e,this.setOptions(e)}setOptions(e){if(null==e)return;if(null!=e.onMergeConflictAction&&null!=e.onMergeConflictResolve)throw Error("UnresolvedFile: onMergeConflictAction and onMergeConflictResolve are mutually exclusive. Use only one callback.");this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e));let t=this.options.hunkSeparators??"line-info";this.interactionManager.setOptions((0,n.pluckInteractionOptions)(this.options,"function"==typeof t||"line-info"===t||"line-info-basic"===t?this.expandHunk:void 0,this.getLineIndex,this.handleMergeConflictActionClick))}createHunksRenderer(e){return new d.UnresolvedFileHunksRenderer(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getHunksRendererOptions(e){return p(e,this.options)}applyPreNodeAttributes(e,t){super.applyPreNodeAttributes(e,t,{"data-has-merge-conflict":""})}cleanUp(){this.clearMergeConflictActionCache(),this.computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0},this.conflictActions=[],super.cleanUp()}getOrComputeDiff({file:e,fileDiff:t,actions:n,markerRows:i}){let{maxContextLines:o,onMergeConflictAction:a}=this.options;t:if(null!=a){let a=null!=t;if(a!==(null!=n)||a!==(null!=i))throw Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows must be passed together");if(null!=t&&null!=n&&null!=i){this.computedCache={file:e??this.computedCache.file,fileDiff:t,actions:n,markerRows:i};break t}if(null!=e||null!=this.computedCache.file){if(null!=e&&null!=this.computedCache.file&&!(0,r.areFilesEqual)(e,this.computedCache.file)&&null!=this.computedCache.fileDiff&&null!=this.computedCache.actions)throw Error("UnresolvedFile.getOrComputeDiff: file can only be used to initialize unresolved state once. Pass fileDiff and actions for subsequent updates.");if(null==(e??=this.computedCache.file))throw Error("UnresolvedFile.getOrComputeDiff: file is null, should be impossible");if(!(0,r.areFilesEqual)(e,this.computedCache.file)||null==this.computedCache.fileDiff||null==this.computedCache.actions){let t=(0,l.parseMergeConflictDiffFromFile)(e,o);this.computedCache={file:e,fileDiff:t.fileDiff,actions:t.actions,markerRows:t.markerRows}}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}else{if(null!=t||null!=n||null!=i)throw Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows are only usable in controlled mode, you must pass in `onMergeConflictAction`");if(null!=e&&null!=this.computedCache.file&&!(0,r.areFilesEqual)(e,this.computedCache.file))throw Error("UnresolvedFile.getOrComputeDiff: uncontrolled unresolved files parse the file only once. Later updates must come from the cached diff state.");if(this.computedCache.file??=e,null==this.computedCache.fileDiff&&null!=this.computedCache.file){let e=(0,l.parseMergeConflictDiffFromFile)(this.computedCache.file,o);this.computedCache.fileDiff=e.fileDiff,this.computedCache.actions=e.actions,this.computedCache.markerRows=e.markerRows}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}if(null!=t&&null!=n&&null!=i)return{fileDiff:t,actions:n,markerRows:i}}hydrate(e){let{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,fileContainer:a,prerenderedHTML:s,preventEmit:l=!1}=e,d=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});null!=d&&(this.hydrateElements(a,s),this.setActiveMergeConflictState(d.actions,d.markerRows),null==this.pre?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:d.fileDiff,lineAnnotations:o}),this.renderMergeConflictActionSlots(),l||this.emitPostRender())}rerender(){this.enabled&&null!=this.fileDiff&&this.render({forceRender:!0,renderRange:this.renderRange})}render(e={}){let{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,preventEmit:a=!1,...s}=e,l=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});if(null==l)return!1;this.setActiveMergeConflictState(l.actions,l.markerRows);let d=super.render({...s,fileDiff:l.fileDiff,lineAnnotations:o,preventEmit:!0});return d&&(this.renderMergeConflictActionSlots(),a||this.emitPostRender()),d}resolveConflict(e,t,n=this.computedCache.fileDiff){let r=this.conflictActions[e];if(null==n||null==r)return;if(r.conflictIndex!==e)throw console.error({conflictIndex:e,action:r}),Error("UnresolvedFile.resolveConflict: conflictIndex and conflictAction don't match");let o=(0,f.resolveConflict)(n,r,t),a=this.computedCache.file,{file:s,actions:d,markerRows:h}=function({fileDiff:e,previousActions:t,resolvedConflictIndex:n,previousFile:r,resolution:o}){var a,s,d,h,f,c;let u,p,m,g=t[n];if(null==g)throw Error("rebuildFileAndActions: missing resolved action for unresolved file rebuild");let v=(a=t,s=n,d=g,h=o,m=(f=d.conflict,c=h,u=(f.baseMarkerLineIndex??f.separatorLineIndex)-f.startLineIndex-1,p=f.endLineIndex-f.separatorLineIndex-1,("current"===c?u:"incoming"===c?p:u+p)-(f.endLineIndex-f.startLineIndex+1)),a.map((e,t)=>{if(t!==s&&null!=e){var n,i;return e.conflict.startLineIndex>d.conflict.endLineIndex?{...e,conflict:(n=e.conflict,i=m,{...n,startLineIndex:n.startLineIndex+i,startLineNumber:n.startLineNumber+i,separatorLineIndex:n.separatorLineIndex+i,separatorLineNumber:n.separatorLineNumber+i,endLineIndex:n.endLineIndex+i,endLineNumber:n.endLineNumber+i,baseMarkerLineIndex:null!=n.baseMarkerLineIndex?n.baseMarkerLineIndex+i:void 0,baseMarkerLineNumber:null!=n.baseMarkerLineNumber?n.baseMarkerLineNumber+i:void 0})}:e}})),b=(0,l.buildMergeConflictMarkerRows)(e,v);return{file:function({resolvedAction:e,resolvedConflictIndex:t,previousFile:n,fileDiff:r,resolution:o}){var a,s,l;let d,h,f=(0,i.splitFileContents)(n?.contents??""),{conflict:c}=e,u=(a=f,s=c,l=o,d=a.slice(s.startLineIndex+1,s.baseMarkerLineIndex??s.separatorLineIndex),h=a.slice(s.separatorLineIndex+1,s.endLineIndex),"current"===l?d:"incoming"===l?h:[...d,...h]),p=[...f.slice(0,c.startLineIndex),...u,...f.slice(c.endLineIndex+1)].join("");return{name:n?.name??r.name,contents:p,cacheKey:n?.cacheKey!=null?`${n.cacheKey}:mc-${t}-${o}`:void 0}}({fileDiff:e,resolvedAction:g,resolvedConflictIndex:n,previousFile:r,resolution:o}),actions:v,markerRows:b}}({fileDiff:o,previousActions:this.conflictActions,resolvedConflictIndex:e,previousFile:a,resolution:t});return{file:s,fileDiff:o,actions:d,markerRows:h}}resolveConflictAndRender(e,t){let n=this.conflictActions[e];if(null==n)return;if(n.conflictIndex!==e)throw console.error({conflictIndex:e,action:n}),Error("UnresolvedFile.resolveConflictAndRender: conflictIndex and conflictAction don't match");let i={resolution:t,conflict:n.conflict},{file:r,fileDiff:o,actions:a,markerRows:s}=this.resolveConflict(e,t)??{};null!=r&&null!=o&&null!=a&&null!=s&&(this.computedCache={file:r,fileDiff:o,actions:a,markerRows:s},this.setActiveMergeConflictState(a,s),null!=this.workerManager?this.hunksRenderer.renderDiff(o):this.render({forceRender:!0}),this.options.onMergeConflictResolve?.(r,i))}setActiveMergeConflictState(e=this.conflictActions,t=this.markerRows){this.conflictActions=e,this.markerRows=t,null!=this.computedCache.fileDiff&&this.hunksRenderer instanceof d.UnresolvedFileHunksRenderer&&this.hunksRenderer.setConflictState("none"===this.options.mergeConflictActionsType?[]:e,t,this.computedCache.fileDiff)}handleMergeConflictActionClick=e=>{let t=this.conflictActions[e.conflictIndex];if(null==t)return;if(t.conflictIndex!==e.conflictIndex)throw console.error({conflictIndex:e.conflictIndex,action:t}),Error("UnresolvedFile.handleMergeConflictActionClick: conflictIndex and conflictAction don't match");let n={resolution:e.resolution,conflict:t.conflict};null!=this.options.onMergeConflictAction?this.options.onMergeConflictAction(n,this):this.resolveConflictAndRender(e.conflictIndex,e.resolution)};renderMergeConflictActionSlots(){let{fileDiff:e}=this.computedCache;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof this.options.mergeConflictActionsType||0===this.conflictActions.length||null==e)return void this.clearMergeConflictActionCache();let t=new Map(this.conflictActionCache);for(let n=0;n<this.conflictActions.length;n++){let i=this.conflictActions[n];if(null==i)continue;if(i.conflictIndex!==n)throw console.error({conflictIndex:n,action:i}),Error("UnresolvedFile.renderMergeConflictActionSlots: conflictIndex and conflictAction don't match");let r=(0,l.getMergeConflictActionAnchor)(i,e);if(null==r)continue;let a=i.conflictIndex,d=(0,s.getMergeConflictActionSlotName)({hunkIndex:r.hunkIndex,lineIndex:r.lineIndex,conflictIndex:a}),f=`${n}-${d}`,c=this.conflictActionCache.get(f);if(null==c||!(0,h.areMergeConflictActionsEqual)(c.action,i)){c?.element.remove();let e=this.renderMergeConflictAction(i);if(null==e)continue;let t=(0,o.createAnnotationWrapperNode)(d);t.appendChild(e),this.fileContainer.appendChild(t),c={element:t,action:i},this.conflictActionCache.set(f,c)}t.delete(f)}for(let[e,{element:n}]of t.entries())this.conflictActionCache.delete(e),n.remove()}renderMergeConflictAction(e){if("function"!=typeof this.options.mergeConflictActionsType)return;let t=this.options.mergeConflictActionsType(e,this);if(null!=t){if(t instanceof HTMLElement)return t;if("u">typeof DocumentFragment&&t instanceof DocumentFragment){let e=document.createElement("div");return e.style.display="contents",e.appendChild(t),e}}}clearMergeConflictActionCache(){for(let{element:e}of this.conflictActionCache.values())e.remove();this.conflictActionCache.clear()}};function p(e,t){return{...t,...e,hunkSeparators:"function"==typeof e?.hunkSeparators?"custom":e?.hunkSeparators,mergeConflictActionsType:"function"==typeof e?.mergeConflictActionsType?"custom":e?.mergeConflictActionsType}}e.s(["UnresolvedFile",0,u,"getUnresolvedDiffHunksRendererOptions",0,p])},10495,e=>{"use strict";var t=e.i(27101),n=e.i(6609),i=e.i(81604);let r=-1;var o=class extends i.File{__id=`virtualized-file:${++r}`;top;height=0;heightCache=new Map;isVisible=!1;constructor(e,n,i=t.DEFAULT_VIRTUAL_FILE_METRICS,r,o=!1){super(e,r,o),this.virtualizer=n,this.metrics=i}getLineHeight(e,t=!1){let n=this.heightCache.get(e);return null!=n?n:this.metrics.lineHeight*(t?2:1)}setOptions(e){if(null==e)return;let t=this.options.overflow,n=this.options.collapsed;super.setOptions(e),(t!==this.options.overflow||n!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){if(null==this.fileContainer||null==this.file){this.height=0;return}let{overflow:e="scroll"}=this.options;if(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),"scroll"===e&&0===this.lineAnnotations.length&&!this.virtualizer.config.resizeDebugging)return;let t=!1;if(null==this.code)return;let n=this.code.children[1];if(n instanceof HTMLElement){for(let e of n.children){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(null==n)continue;let i=Number(n),r=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in e.nextElementSibling.dataset||"noNewline"in e.nextElementSibling.dataset)&&("noNewline"in e.nextElementSibling.dataset&&(o=!0),r+=e.nextElementSibling.getBoundingClientRect().height),r!==this.getLineHeight(i,o)&&(t=!0,r===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,r))}(t||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}}onRender=e=>null!=this.fileContainer&&null!=this.file&&(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render({file:this.file}));cleanUp(){null!=this.fileContainer&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}computeApproximateSize(){let e=0===this.height;if(this.height=0,null==this.file)return;let{disableFileHeader:t=!1,collapsed:i=!1,overflow:r="scroll"}=this.options,{diffHeaderHeight:o,fileGap:a,lineHeight:s}=this.metrics,l=this.getOrCreateLineCache(this.file);if(t?this.height+=a:this.height+=o,!i&&("scroll"===r&&0===this.lineAnnotations.length?this.height+=this.getOrCreateLineCache(this.file).length*s:(0,n.iterateOverFile)({lines:l,callback:({lineIndex:e})=>{this.height+=this.getLineHeight(e,!1)}}),l.length>0&&(this.height+=a),null!=this.fileContainer&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}}setVisibility(e){null!=this.fileContainer&&(e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}render({fileContainer:e,file:t,...n}){let i=null==this.fileContainer;if(this.file??=t,e=this.getOrCreateFileContainerNode(e),null==this.file)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(i?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(this.file,this.top,r);return super.render({file:this.file,fileContainer:e,renderRange:o,...n})}computeRenderRangeFromWindow(e,t,{top:i,bottom:r}){let o,a,s,{disableFileHeader:l=!1,overflow:d="scroll"}=this.options,{diffHeaderHeight:h,fileGap:f,hunkLineCount:c,lineHeight:u}=this.metrics,p=this.getOrCreateLineCache(e),m=p.length,g=this.height,v=l?f:h;if(t<i-g||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-v-f};if(m<=c)return{startingLine:0,totalLines:c,bufferBefore:0,bufferAfter:0};let b=Math.ceil(Math.ceil(Math.max(r-i,0)/u)/c)*c+2*c,C=b/c,x=(i+r)/2;if("scroll"===d&&0===this.lineAnnotations.length){let e=Math.floor(Math.floor((x-(t+v))/u)/c)-Math.floor(C/2),n=Math.max(0,Math.min(e,Math.ceil(m/c)))*c,i=e<0?b+e*c:b,r=Math.min(i,m-n);return{startingLine:n,totalLines:i,bufferBefore:n*u,bufferAfter:Math.max(0,(m-n-r)*u)}}let S=[],y=t+v,L=0;if((0,n.iterateOverFile)({lines:p,callback:({lineIndex:e})=>{let n=L%c==0;if(n&&(S.push(y-(t+v)),null!=s)){if(s<=0)return!0;s--}let l=this.getLineHeight(e,!1),d=Math.floor(L/c);return y>i-l&&y<r&&(o??=d),y+l>x&&(a??=d),null==s&&y>=r&&n&&(s=C),L++,y+=l,!1}}),null==o)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-v-f};let k=S.length,E=Math.round((a??=o)-C/2),A=Math.max(0,Math.min(E,Math.max(0,k-C))),w=E<0?b+E*c:b,T=S[A]??0,M=A+w/c;return{startingLine:A*c,totalLines:w,bufferBefore:T,bufferAfter:M<S.length?g-v-S[M]-f:g-(y-t)-f}}};e.s(["VirtualizedFile",0,o])},51404,e=>{"use strict";var t=e.i(27101),n=e.i(89107),i=e.i(92458),r=e.i(18750);let o=-1;var a=class extends r.FileDiff{__id=`little-virtualized-file-diff:${++o}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;virtualizer;constructor(e,n,i,r,o=!1){super(e,r,o);const{hunkSeparators:a="line-info"}=this.options;this.virtualizer=n,this.metrics=function(e,n){let i={...t.DEFAULT_VIRTUAL_FILE_METRICS,...n};return i.hunkSeparatorHeight=function(e,t){if(null!=t)return t;switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}(e,n?.hunkSeparatorHeight),i}("function"==typeof a?"custom":a,i)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);return null!=n?n:this.metrics.lineHeight*(t?2:1)}setOptions(e){if(null==e)return;let t=this.options.diffStyle,n=this.options.overflow,i=this.options.collapsed;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow||i!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e="scroll"}=this.options;if(null!=this.fileContainer&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),null==this.fileContainer||null==this.fileDiff){this.height=0;return}if("scroll"===e&&0===this.lineAnnotations.length&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1;for(let e of"split"===t?[this.codeDeletions,this.codeAdditions]:[this.codeUnified]){if(null==e)continue;let i=e.children[1];if(i instanceof HTMLElement)for(let e of i.children){if(!(e instanceof HTMLElement))continue;let i=e.dataset.lineIndex;if(null==i)continue;let r=function(e,t){let[n,i]=e.split(",").map(Number);return"split"===t?i:n}(i,t),o=e.getBoundingClientRect().height,a=!1;e.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in e.nextElementSibling.dataset||"noNewline"in e.nextElementSibling.dataset)&&("noNewline"in e.nextElementSibling.dataset&&(a=!0),o+=e.nextElementSibling.getBoundingClientRect().height),o!==this.getLineHeight(r,a)&&(n=!0,o===this.metrics.lineHeight*(a?2:1)?this.heightCache.delete(r):this.heightCache.set(r,o))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>null!=this.fileContainer&&(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){null!=this.fileContainer&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)};setVisibility(e){null!=this.fileContainer&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=0===this.height;if(this.height=0,null==this.fileDiff)return;let{disableFileHeader:i=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:a=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,hunkSeparators:s="line-info"}=this.options,{diffHeaderHeight:l,fileGap:d,hunkSeparatorHeight:h}=this.metrics,f=this.getDiffStyle(),c="simple"!==s&&"metadata"!==s&&"line-info-basic"!==s?d:0;if(i?"simple"!==s&&"metadata"!==s&&(this.height+=d):this.height+=l,!o&&((0,n.iterateOverDiff)({diff:this.fileDiff,diffStyle:f,expandedHunks:!!r||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:i,additionLine:r})=>{let o=null!=r?r.splitLineIndex:i.splitLineIndex,a=null!=r?r.unifiedLineIndex:i.unifiedLineIndex,l=(r?.noEOFCR??!1)||(i?.noEOFCR??!1);t>0&&(e>0&&(this.height+=c),this.height+=h+c),this.height+=this.getLineHeight("split"===f?o:a,l),n>0&&"simple"!==s&&(this.height+=c+h)}}),this.fileDiff.hunks.length>0&&(this.height+=d),null!=this.fileContainer&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...o}={}){let a=null==this.fileContainer;if(this.fileDiff??=r??(null!=t&&null!=n?(0,i.parseDiffFromFile)(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),null==this.fileDiff)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(a?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let s=this.virtualizer.getWindowSpecs(),l=this.computeRenderRangeFromWindow(this.fileDiff,this.top,s);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:l,oldFile:t,newFile:n,...o})}getDiffStyle(){return this.options.diffStyle??"split"}getExpandedRegion(e,n,i){if(i<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(i,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:o=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD}=this.options;if(r||i<=o)return{fromStart:i,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(n),s=Math.min(Math.max(a.fromStart,0),i),l=Math.min(Math.max(a.fromEnd,0),i),d=s+l;return{fromStart:s,fromEnd:l,collapsedLines:Math.max(i-d,0),renderAll:d>=i}}getExpandedLineCount(e,t){var n;let i,r=0;if(e.isPartial){for(let n of e.hunks)r+="split"===t?n.splitLineCount:n.unifiedLineCount;return r}for(let[n,i]of e.hunks.entries()){r+="split"===t?i.splitLineCount:i.unifiedLineCount;let o=Math.max(i.collapsedBefore,0),{fromStart:a,fromEnd:s,renderAll:l}=this.getExpandedRegion(e.isPartial,n,o);o>0&&(r+=l?o:a+s)}let o=e.hunks.at(-1);if(null!=o&&null!=(i=(n=e).hunks.at(-1))&&!n.isPartial&&0!==n.additionLines.length&&0!==n.deletionLines.length&&(i.additionLineIndex+i.additionCount<n.additionLines.length||i.deletionLineIndex+i.deletionCount<n.deletionLines.length)){let t=e.additionLines.length-(o.additionLineIndex+o.additionCount),n=e.deletionLines.length-(o.deletionLineIndex+o.deletionCount);if(null!=o&&t!==n)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${n}) for ${e.name}`);let i=Math.min(t,n);if(null!=o&&i>0){let{fromStart:t,renderAll:n}=this.getExpandedRegion(e.isPartial,e.hunks.length,i);r+=n?i:t}}return r}computeRenderRangeFromWindow(e,i,{top:r,bottom:o}){let a,s,l,{disableFileHeader:d=!1,expandUnchanged:h=!1,collapsedContextThreshold:f=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,hunkSeparators:c="line-info"}=this.options,{diffHeaderHeight:u,fileGap:p,hunkLineCount:m,hunkSeparatorHeight:g,lineHeight:v}=this.metrics,b=this.getDiffStyle(),C=this.height,x=this.getExpandedLineCount(e,b),S=d?p:u;if(i<r-C||i>o)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:C-S-p};if(x<=m||0===e.hunks.length)return{startingLine:0,totalLines:m,bufferBefore:0,bufferAfter:0};let y=Math.ceil(Math.ceil(Math.max(o-r,0)/v)/m)*m+m,L=y/m,k=[],E=(r+o)/2,A="simple"===c||"metadata"===c||"line-info-basic"===c?0:p,w=i+S,T=0;if((0,n.iterateOverDiff)({diff:e,diffStyle:b,expandedHunks:!!h||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:f,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:d,additionLine:h})=>{let f=null!=h?h.splitLineIndex:d.splitLineIndex,u=null!=h?h.unifiedLineIndex:d.unifiedLineIndex,p=(h?.noEOFCR??!1)||(d?.noEOFCR??!1),v=t>0?g+A+(e>0?A:0):0;0===e&&"simple"===c&&(v=0),w+=v;let C=T%m==0;if(C&&(k.push(w-(i+S+v)),null!=l)){if(l<=0)return!0;l--}let x=this.getLineHeight("split"===b?f:u,p),y=Math.floor(T/m);return w>r-x&&w<o&&(a??=y),null==s&&w+x>E&&(s=y),null==l&&w>=o&&C&&(l=L),T++,w+=x,n>0&&"simple"!==c&&(w+=g+A),!1}}),null==a)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:C-S-p};let M=k.length,R=Math.round((s??=a)-L/2),I=Math.max(0,Math.min(R,Math.max(0,M-L))),H=R<0?y+R*m:y,D=k[I]??0,N=I+H/m;return{startingLine:I*m,totalLines:H,bufferBefore:D,bufferAfter:N<k.length?C-S-k[N]-p:C-(w-i)-p}}};e.s(["VirtualizedFileDiff",0,a],51404)},29788,12543,21103,e=>{"use strict";var t=e.i(5096);function n(e,t){return null==e||null==t?e===t:e.top===t.top&&e.bottom===t.bottom}function i({scrollTop:e,scrollHeight:t,height:n,containerOffset:r=0,fitPerfectly:o,overscrollSize:a}){let s=n+2*a,l=o?n:s;if(s>=(t=Math.max(t,l))||o){let n=Math.max(e-r,0);return{top:n,bottom:Math.max(Math.min(e+l,t)-r,n)}}let d=e+n/2-s/2,h=d+s;return d<0&&(d=0),h>t&&(h=t),{top:d=Math.floor(Math.max(d-r,0)),bottom:Math.ceil(Math.max(Math.min(h,t)-r,d))}}e.s(["areVirtualWindowSpecsEqual",0,n],12543),e.s(["createWindowFromScrollPosition",0,i],21103);let r=[0,1e-6,.99999,1],o={overscrollSize:1e3,intersectionObserverMargin:4e3,resizeDebugging:!1},a=0,s=-1;var l=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++s}`;config;type="basic";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...o,...e}}setup(n,i){if(null==this.root){for(let[o,a]of(this.root=n,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:r,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),n instanceof Document?this.setupWindow():this.setupElement(i),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),(0,t.queueRender)(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)},this.connectQueue.entries()))this.connect(o,a);this.connectQueue.clear(),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)}}instanceChanged(e){this.instancesChanged.add(e),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)}getWindowSpecs(){return 0===this.windowSpecs.top&&0===this.windowSpecs.bottom&&(this.windowSpecs=i({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),i=this.getHeight(),r=this.config.intersectionObserverMargin;return!(e<n-r-t||e>n+i+r)}handleContainerResize=e=>{if(null==this.root)return;let n=!1;for(let t of e){let e=t.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:e-a,newSize:e}),a=e)):t.target===this.root?e!==this.height&&(this.heightDirty=!0,n=!0):t.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:e-a,newSize:e}),a=e))}n&&(0,t.queueRender)(this.computeRenderRangeAndEmit)};setupWindow(){if(null==this.root||!(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(null==this.root||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)instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+d(e,this.getScrollContainerElement())}connect(e,n){if(this.observers.has(e))throw Error("Virtualizer.connect: instance is already connected...");return null==this.intersectionObserver?this.connectQueue.set(e,n):(this.intersectionObserver.observe(e),this.observers.set(e,n),this.instancesChanged.add(n),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let n=this.observers.get(e);this.connectQueue.delete(e),null!=n&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&null!=this.root&&this.root instanceof Document&&(this.scrollDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||null==this.root||this.root instanceof Document||(this.scrollDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let r=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;if(0===this.instancesChanged.size){let e=i({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(n(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let o=this.getScrollAnchor(this.height),a=new Set;for(let e of r?this.observers.values():this.visibleInstances.values())e.onRender(r)&&a.add(e);for(let e of this.instancesChanged)!a.has(e)&&e.onRender(r)&&a.add(e);for(let e of(this.scrollFix(o),this.instancesChanged.size>0&&this.markDOMDirty(),a))e.reconcileHeights();(this.instancesChanged.size>0||r)&&(0,t.queueRender)(this.computeRenderRangeAndEmit),a.clear(),this.instancesChanged.clear()};scrollFix(e){if(null==e)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:i,fileElement:r,fileOffset:o,fileTypeOffset:a}=e;if(null!=n&&null!=i){let e=r.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=d(e,t);n!==i&&this.applyScrollFix(n-i);return}}let s=d(r,t);if("top"===a)s!==o&&this.applyScrollFix(s-o);else{let e=s+r.getBoundingClientRect().height;e!==o&&this.applyScrollFix(e-o)}}applyScrollFix(e){null==this.root||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,n=this.getScrollContainerElement();for(let[i]of this.visibleInstances.entries()){let r,o,a,s,l=d(i,n),h=l+i.offsetHeight;if(h<=0?(r=h,o="bottom"):(r=l,o="top"),h>0&&l<e)for(let e of i.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(e instanceof HTMLElement))continue;let t=e.dataset.lineIndex;if(null==t)continue;let i=d(e,n);if(!(i<0)){a=t,s=i;break}}if(t?.lineOffset!=null&&null==s)continue;let f=!1;null==t||null!=s&&(null==t.lineOffset||s<t.lineOffset)?f=!0:null==s&&null==t.lineOffset&&(r>=0&&(t.fileOffset<0||r<t.fileOffset)?f=!0:r<0&&t.fileOffset<0&&r>t.fileOffset&&(f=!0)),f&&(t={fileElement:i,fileTypeOffset:o,fileOffset:r,lineIndex:a,lineOffset:s})}return t}handleIntersectionChange=e=>{for(let{target:t,isIntersecting:n}of(this.scrollDirty=!0,e)){if(!(t instanceof HTMLElement))throw Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");let e=this.observers.get(t);if(null==e)throw Error("Virtualizer.handleIntersectionChange: no instance for target");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&&(0,t.queueRender)(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=null==this.root?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty&&(this.scrollHeightDirty=!1,this.scrollHeight=null==this.root?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight),this.scrollHeight}getHeight(){return this.heightDirty&&(this.heightDirty=!1,this.height=null==this.root?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height),this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return null==this.root||this.root instanceof Document?void 0:this.root}};function d(e,t){let n=e.getBoundingClientRect(),i=t?.getBoundingClientRect().top??0;return n.top-i}e.s(["Virtualizer",0,l],29788)},87439,3467,e=>{"use strict";var t=e.i(27101),n=e.i(8456);function i(e,t,n){if(e===t||null==e||null==t)return e===t;let i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(let n of r)if(o.delete(n),!i.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(o))if(!i.has(e))return!1;return!0}function r(e){if(null!=e&&"parseDiffOptions"in e)return e.parseDiffOptions}e.s(["areObjectsEqual",0,i],3467),e.s(["areOptionsEqual",0,function(e,o){let a=e?.theme??t.DEFAULT_THEMES,s=o?.theme??t.DEFAULT_THEMES,l=r(e),d=r(o);return(0,n.areThemesEqual)(a,s)&&i(e,o,["theme","parseDiffOptions"])&&i(l,d)}],87439)},7871,e=>{"use strict";var t=e.i(22300);e.s(["getSingularPatch",0,function(e){let n=(0,t.parsePatchFiles)(e);if(1!==n.length)throw console.error(n),Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");let{files:i}=n[0];if(1!==i.length)throw console.error(i),Error("FileDiff: Provided patch must contain exactly 1 file diff");return i[0]}])}]);
|