diffhub 0.1.3 → 0.1.5
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.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +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/_0r24f4c._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0oc3qg_._.js +1 -1
- 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/{15uwrard~z-l5.js → 0b4pujbysgmxg.js} +1 -1
- package/.next/standalone/apps/web/package.json +1 -1
- package/bin/diffhub.mjs +18 -5
- package/package.json +1 -1
- /package/.next/standalone/apps/web/.next/static/{C1Ggd_ITpnb7yBHrIOODV → 50OFqtYzVfKmfsBAKOjr3}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{C1Ggd_ITpnb7yBHrIOODV → 50OFqtYzVfKmfsBAKOjr3}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{C1Ggd_ITpnb7yBHrIOODV → 50OFqtYzVfKmfsBAKOjr3}/_ssgManifest.js +0 -0
|
@@ -64,6 +64,6 @@ ${n.default}
|
|
|
64
64
|
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
65
65
|
<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"/>
|
|
66
66
|
</symbol>
|
|
67
|
-
</svg>`;e.s(["SVGSpriteSheet",0,n])},33574,e=>{"use strict";let n={};e.s(["arePrePropertiesEqual",0,function(e,t){return null==e||null==t?e===t:function(e=n,t=n){if(e===t)return!0;let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(let n of i)if(e[n]!==t[n])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}])},22555,e=>{"use strict";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}])},68382,e=>{"use strict";var n=e.i(90578);e.s(["createUnsafeCSSStyleNode",0,function(){let e=document.createElement("style");return e.setAttribute(n.UNSAFE_CSS_ATTRIBUTE,""),e}])},55740,e=>{"use strict";e.s(["getOrCreateCodeNode",0,function({code:e,pre:n,columnType:t,rowSpan:i,containerSize:r=!1}={}){return null==e&&((e=document.createElement("code")).setAttribute("data-code",""),null!=t&&e.setAttribute(`data-${t}`,""),n?.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}])},2756,e=>{"use strict";var n=e.i(90578);e.s(["upsertHostThemeStyle",0,function({shadowRoot:e,currentNode:t,themeCSS:i}){let r;return""===i.trim()?void t?.remove():((t??=((r=document.createElement("style")).setAttribute(n.THEME_CSS_ATTRIBUTE,""),r)).textContent=i,t.parentNode!==e&&e.appendChild(t),t)}])},54337,e=>{"use strict";e.s(["prerenderHTMLIfNecessary",0,function(e,n){if(null==n)return;let t=e.shadowRoot??e.attachShadow({mode:"open"});""===t.innerHTML&&(t.innerHTML=n)}])},28695,e=>{"use strict";e.s(["setPreNodeProperties",0,function(e,{type:n,diffIndicators:t,disableBackground:i,disableLineNumbers:r,overflow:o,split:a,totalLines:l,customProperties:s}){if(null!=s)for(let n in s){let t=s[n];null!=t&&e.setAttribute(n,`${t}`)}switch("diff"===n?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),t){case"bars":case"classic":e.setAttribute("data-indicators",t);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"===n?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",`${`${l}`.length}ch`),e}])},57360,e=>{"use strict";var n=e.i(90578),t=e.i(91260);if("u">typeof HTMLElement&&null==customElements.get(n.DIFFS_TAG_NAME)){let e;class i extends HTMLElement{constructor(){if(super(),null!=this.shadowRoot)return;const n=this.attachShadow({mode:"open"});null==e&&(e=new CSSStyleSheet).replaceSync(t.default),n.adoptedStyleSheets=[e]}}customElements.define(n.DIFFS_TAG_NAME,i)}e.s(["DiffsContainerLoaded",0,!0])},88860,e=>{"use strict";var n=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,n,t){if(null==n||null==t)for(let i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?n=i:"additions"in i.dataset&&(t=i));null==t||null==n?this.cleanUp():(this.codeDeletions!==n&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=n,n.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==t&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=t,t.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,n])},55594,e=>{"use strict";e.s(["areDiffLineAnnotationsEqual",0,function(e,n){return e.lineNumber===n.lineNumber&&e.side===n.side&&e.metadata===n.metadata}])},49667,e=>{"use strict";e.s(["areHunkDataEqual",0,function(e,n){return e.slotName===n.slotName&&e.hunkIndex===n.hunkIndex&&e.lines===n.lines&&e.type===n.type&&e.expandable?.chunked===n.expandable?.chunked&&e.expandable?.up===n.expandable?.up&&e.expandable?.down===n.expandable?.down}])},49889,e=>e.a(async(n,t)=>{try{var i=e.i(90578),r=e.i(27763),o=e.i(56752),a=e.i(199),l=e.i(59808),s=e.i(37403),d=e.i(76493),u=e.i(33574),c=e.i(65597),f=e.i(22555),h=e.i(68382),p=e.i(10787),m=e.i(55740),g=e.i(2756),v=e.i(54337),b=e.i(28695),y=e.i(57360),x=e.i(88860),C=e.i(8704),k=e.i(55594),S=e.i(49667),L=e.i(67997),E=e.i(36680),w=n([C]);[C]=w.then?(await w)():w;let I=-1;var A=class{static LoadedCustomComponent=y.DiffsContainerLoaded;__id=`file-diff:${++I}`;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:i.DEFAULT_THEMES},n,t=!1){this.options=e,this.workerManager=n,this.isContainerManaged=t,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new o.ResizeManager,this.scrollSyncManager=new x.ScrollSyncManager,this.interactionManager=new r.InteractionManager("diff",(0,r.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 C.DiffHunksRenderer(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,n="additions")=>{let t,i;if(null==this.fileDiff)return;let r=this.fileDiff.hunks.at(-1);e:for(let o of this.fileDiff.hunks){let a="deletions"===n?o.deletionStart:o.additionStart,l="deletions"===n?o.deletionCount:o.additionCount,s=o.splitLineStart,d=o.unifiedLineStart;if(e<a){let n=a-e;t=Math.max(d-n,0),i=Math.max(s-n,0);break}if(e>=a+l){if(o===r){let n=e-(a+l);t=d+o.unifiedLineCount+n,i=s+o.splitLineCount+n;break}continue}for(let r of o.hunkContent)if("context"===r.type)if(e<a+r.lines){let n=e-a;i=s+n,t=d+n;break e}else a+=r.lines,s+=r.lines,d+=r.lines;else{let o="deletions"===n?r.deletions:r.additions;if(e<a+o){let o=e-a;t=d+("additions"===n?r.deletions:0)+o,i=s+o;break e}a+=o,s+=Math.max(r.deletions,r.additions),d+=r.deletions+r.additions}break}if(null!=t&&null!=i)return[t,i]};setOptions(e){null!=e&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions((0,r.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,n,t){return!e&&!n&&!t&&"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:n,prerenderedHTML:t,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:a,fileDiff:l}=e;this.hydrateElements(n,t),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:l,oldFile:o,newFile:a,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,n){for(let t of((0,v.prerenderHTMLIfNecessary)(e,n),e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){for(let e of(this.pre=t,t.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 t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(i.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(i.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.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:n,newFile:t,lineAnnotations:i}){let{diffStyle:r="split",overflow:o="scroll"}=this.options;this.lineAnnotations=i??this.lineAnnotations,this.additionFile=t,this.deletionFile=n,this.fileDiff=e??(null!=n&&null!=t?(0,L.parseDiffFromFile)(n,t,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,n,t)=>{this.expandHunk(e,n,t)};expandHunk=(e,n,t)=>{this.hunksRenderer.expandHunk(e,n,t),this.rerender()};render({oldFile:e,newFile:n,fileDiff:t,forceRender:r=!1,preventEmit:o=!1,lineAnnotations:l,fileContainer:s,containerWrapper:u,renderRange:c}){if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");let{collapsed:f=!1}=this.options,h=f?void 0:c,p=null!=e&&null!=n&&(!(0,d.areFilesEqual)(e,this.deletionFile)||!(0,d.areFilesEqual)(n,this.additionFile)),m=null!=t&&t!==this.fileDiff,g=null!=l&&(l.length>0||this.lineAnnotations.length>0)&&l!==this.lineAnnotations;if(!f&&(0,a.areRenderRangesEqual)(h,this.renderRange)&&!r&&!g&&(null!=t&&t===this.fileDiff||null==t&&!p))return!1;let{renderRange:v}=this;if(this.renderRange=h,this.deletionFile=e,this.additionFile=n,null!=t?this.fileDiff=t:null!=e&&null!=n&&p&&(m=!0,this.fileDiff=(0,L.parseDiffFromFile)(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:y=!1,disableFileHeader:x=!1,overflow:C="scroll",themeType:k="system"}=this.options;if(x&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,u),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,i.EMPTY_RENDER_RANGE);null!=e&&this.applyThemeState(s,e.themeStyles,k,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return o||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(r,g,p||m)&&this.applyPartialRender({previousRenderRange:v,renderRange:h}))){let n=this.hunksRenderer.renderDiff(this.fileDiff,h);if(null==n)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,n.themeStyles,k,n.baseThemeType),null!=n.headerElement&&this.applyHeaderToDOM(n.headerElement,s),null!=n.additionsContentAST||null!=n.deletionsContentAST||null!=n.unifiedContentAST?this.applyHunksToDOM(e,n):null!=this.pre&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(n.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,"wrap"===C),"scroll"===C&&"split"===b?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return o||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:n}=this.options;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof n){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let t=new Map(this.separatorCache);for(let i of e){let e=i.slotName,r=this.separatorCache.get(e);if(null==r||!(0,S.areHunkDataEqual)(i,r.hunkData)){r?.element.remove();let t=document.createElement("div");t.style.display="contents",t.slot=i.slotName;let o=n(i,this);null!=o&&t.appendChild(o),this.fileContainer.appendChild(t),r={element:t,hunkData:i},this.separatorCache.set(e,r)}t.delete(e)}for(let[e,{element:n}]of t.entries())this.separatorCache.delete(e),n.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:n}=this.options;if(null!=n&&this.lineAnnotations.length>0)for(let[t,i]of this.lineAnnotations.entries()){let r=`${t}-${(0,l.getLineAnnotationName)(i)}`,o=this.annotationCache.get(r);if(null==o||!(0,k.areDiffLineAnnotationsEqual)(i,o.annotation)){o?.element.remove();let e=n(i);if(null==e)continue;(o={element:(0,c.createAnnotationWrapperNode)((0,l.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(let[n,{element:t}]of e.entries())this.annotationCache.delete(n),t.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 n=e(this.interactionManager.getHoveredLine);if(null!=n&&null!=this.gutterUtilityContent)return;if(null==n){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=(0,f.createGutterUtilityContentNode)();t.appendChild(n),this.fileContainer.appendChild(t),this.gutterUtilityContent=t}getOrCreateFileContainer(e,n){let t=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(i.DIFFS_TAG_NAME),null!=t&&t!==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 n=e.firstChild;n instanceof SVGElement&&(this.spriteSVG=n,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let n=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,n.appendChild(this.pre)):this.pre.parentNode!==n&&(n.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){for(let n of(this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,Array.from(e.children)))n instanceof HTMLElement&&(n.hasAttribute("data-unified")?this.codeUnified=n:n.hasAttribute("data-deletions")?this.codeDeletions=n:n.hasAttribute("data-additions")&&(this.codeAdditions=n))}applyHeaderToDOM(e,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:t}=this,r=(0,E.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==t)return;let{renderCustomHeader:o,renderHeaderPrefix:a,renderHeaderMetadata:l}=this.options;if(null!=o){let e=o(t)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,i.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(t)??void 0,d=l?.(t)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,i.HEADER_PREFIX_SLOT_ID,s),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,i.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,n,t,i){if(null==i)return void n?.remove();let r=n??this.createHeaderSlotElement(t);return null==n&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,n){e.replaceChildren(),n instanceof Element?e.appendChild(n):e.innerText=`${n}`}createHeaderSlotElement(e){let n=document.createElement("div");return n.slot=e,n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,n=this.fileContainer?.shadowRoot;if(null!=n){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==n||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,h.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,p.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,n,t,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??t;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==n||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,g.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,p.wrapThemeCSS)(n,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:n,themeType:o,baseThemeType:i}:void 0)}applyHunksToDOM(e,n){let{overflow:t="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r="wrap"===t?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,n);let o=!1,a=[],l=this.hunksRenderer.renderCodeAST("unified",n),s=this.hunksRenderer.renderCodeAST("deletions",n),d=this.hunksRenderer.renderCodeAST("additions",n);null!=l?(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,m.getOrCreateCodeNode)({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeUnified)):null!=s||null!=d?(null!=s?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=(0,m.getOrCreateCodeNode)({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(s),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,m.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=n.rowCount}applyPartialRender({previousRenderRange:e,renderRange:n}){let{pre:t,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==t||null==e||null==n||!Number.isFinite(e.totalLines)||!Number.isFinite(n.totalLines)||null==this.lastRowCount)return!1;let l=this.getCodeColumns(a,i,o,r);if(null==l)return!1;let s=e.startingLine,d=n.startingLine,u=s+e.totalLines,c=d+n.totalLines,f=Math.max(s,d),h=Math.min(u,c);if(h<=f)return!1;let p=Math.max(0,f-s),m=Math.max(0,u-h),g=this.trimColumns({columns:l,trimStart:p,trimEnd:m,previousStart:s,overlapStart:f,overlapEnd:h,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,n)=>{if(!(n<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:n,bufferBefore:0,bufferAfter:0})},y=b(d,Math.max(f-d,0));if(null==y&&d<f)return!1;let x=b(h,Math.max(c-h,0));if(null==x&&c>h)return!1;let C=(e,n)=>{if(null!=e){if("unified"!==a||Array.isArray(l))if("split"===a&&Array.isArray(l))this.insertPartialHTML(a,l,e,n);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,l,e,n);v+=e.rowCount}};return this.cleanupErrorWrapper(),C(y,"afterbegin"),C(x,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(a,l,v),this.lastRowCount=v),!0}insertPartialHTML(e,n,t,i){if("unified"!==e||Array.isArray(n))if("split"===e&&Array.isArray(n)){let e=this.hunksRenderer.renderCodeAST("deletions",t),r=this.hunksRenderer.renderCodeAST("additions",t);this.renderPartialColumn(n[0],e,i),this.renderPartialColumn(n[1],r,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",t);this.renderPartialColumn(n,e,i)}}renderPartialColumn(e,n,t){if(null==e||null==n)return;let i=T(n[0]),r=T(n[1]);if(null==i||null==r)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);"beforeend"===t&&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"===t&&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(t,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(t,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,n,t,i,r,o){if(!(n instanceof HTMLElement)||!(t instanceof HTMLElement))return;let a=this.getBufferSize(n.dataset);null!=a&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(n,a+e),this.updateBufferSize(t,a+e))}applyRowSpan(e,n,t){let i=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${t}`),e.content.style.setProperty("grid-row",`span ${t}`))};if("unified"!==e||Array.isArray(n))if("split"===e&&Array.isArray(n))i(n[0]),i(n[1]);else throw Error("dun fuuuuked up");else i(n)}trimColumnRows(e,n,t){let i=0,r=0,o=0,a=!1,l=t>=0;if(null==e)return 0;let s=Array.from(e.content.children),d=Array.from(e.gutter.children);if(s.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<s.length&&(!(n<=0)||l||a);){let e=d[o],u=s[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),r++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(n>0||l&&i>=t)&&(e.remove(),u.remove(),n>0&&(n--,0===n&&(a=!0)),r++),i++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(n>0||l&&i>=t)&&(e.remove(),u.remove(),r++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(n>0){let t=Math.min(n,o),i=o-t;i>0?(this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=t):(e.remove(),u.remove(),r+=o),n-=t}else if(l){let n=i,a=i+o-1;if(t<=n)e.remove(),u.remove(),r+=o;else if(t<=a){let n=a-t+1,i=o-n;this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=n}}i+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:n,overlapEnd:t,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let l=Math.max(0,i-r),s=t-r;if(s<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let c=d?l:0,f=u?s:-1;if("unified"===n&&!Array.isArray(e))return this.trimColumnRows(e,c,f);if("split"===n&&Array.isArray(e)){let n=this.trimColumnRows(e[0],c,f),t=this.trimColumnRows(e[1],c,f);if(null!=e[0]&&null!=e[1]&&n!==t)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?n:t}throw console.error({diffStyle:n,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let n=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(n)?void 0:n}updateBufferSize(e,n){e.dataset.bufferSize=`${n}`,e.style.setProperty("grid-row",`span ${n}`),e.style.setProperty("min-height",`calc(${n} * 1lh)`)}getCodeColumns(e,n,t,i){function r(e){if(null==e)return;let n=e.children[0],t=e.children[1];if(n instanceof HTMLElement&&t instanceof HTMLElement&&null!=n.dataset.gutter&&null!=t.dataset.content)return{gutter:n,content:t}}if("unified"===e)return r(n);{let e=r(t),n=r(i);return null!=e||null!=n?[e,n]:void 0}}applyBuffers(e,n){let{disableVirtualizationBuffers:t=!1}=this.options;if(t||null==n){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:n,deletionsContentAST:t,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:s="scroll",diffStyle:d="split"}=this.options,c={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:l,overflow:s,split:"unified"!==d&&null!=n&&null!=t,totalLines:i,customProperties:r};(0,u.arePrePropertiesEqual)(c,this.appliedPreAttributes)||((0,b.setPreNodeProperties)(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,n){this.cleanupErrorWrapper();let t=this.getOrCreatePreNode(n);t.innerHTML="",t.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=n.shadowRoot??n.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 T(e){if(null!=e&&"element"===e.type)return e.children??[]}e.s(["FileDiff",0,A]),t()}catch(e){t(e)}},!1),19657,e=>{"use strict";e.s(["areMergeConflictActionsEqual",0,function(e,n){var t,i;return e.hunkIndex===n.hunkIndex&&e.startContentIndex===n.startContentIndex&&e.endContentIndex===n.endContentIndex&&e.currentContentIndex===n.currentContentIndex&&e.baseContentIndex===n.baseContentIndex&&e.incomingContentIndex===n.incomingContentIndex&&e.endMarkerContentIndex===n.endMarkerContentIndex&&e.conflictIndex===n.conflictIndex&&(t=e.conflict,i=n.conflict,t.conflictIndex===i.conflictIndex&&t.startLineIndex===i.startLineIndex&&t.startLineNumber===i.startLineNumber&&t.separatorLineIndex===i.separatorLineIndex&&t.separatorLineNumber===i.separatorLineNumber&&t.endLineIndex===i.endLineIndex&&t.endLineNumber===i.endLineNumber&&t.baseMarkerLineIndex===i.baseMarkerLineIndex&&t.baseMarkerLineNumber===i.baseMarkerLineNumber)}])},52719,e=>{"use strict";function n(e,n,t,i,r,o){for(let a=0;a<o;a++){let o=n[i+a],l=t[r+a];if(null==o||null==l)throw Error("pushCollapsedContextLines: missing collapsed context line");e.deletionLines.push(o),e.additionLines.push(l)}}function t(e,n,t,i){if("context"===e.type)for(let t=0;t<e.lines;t++){let r=i[e.additionLineIndex+t];if(null==r)throw console.error({additionLines:i,content:e,i:t}),Error("pushContentLinesToDiff: Context line does not exist");n.deletionLines.push(r),n.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=t[e.deletionLineIndex+o];if(null==i)throw console.error({deletionLines:t,content:e,i:o}),Error("pushContentLinesToDiff: Deletion line does not exist");n.deletionLines.push(i)}if(o<e.additions){let t=i[e.additionLineIndex+o];if(null==t)throw console.error({additionLines:i,content:e,i:o}),Error("pushContentLinesToDiff: Addition line does not exist");n.additionLines.push(t)}}}}function i(e,n,t){"context"===e.type?(n.nextAdditionLineIndex+=e.lines,n.nextDeletionLineIndex+=e.lines,n.nextAdditionStart+=e.lines,n.nextDeletionStart+=e.lines,n.splitLineCount+=e.lines,n.unifiedLineCount+=e.lines,t.additionCount+=e.lines,t.deletionCount+=e.lines,t.splitLineCount+=e.lines,t.unifiedLineCount+=e.lines):(n.nextAdditionLineIndex+=e.additions,n.nextDeletionLineIndex+=e.deletions,n.nextAdditionStart+=e.additions,n.nextDeletionStart+=e.deletions,n.splitLineCount+=Math.max(e.deletions,e.additions),n.unifiedLineCount+=e.deletions+e.additions,t.deletionCount+=e.deletions,t.deletionLines+=e.deletions,t.additionCount+=e.additions,t.additionLines+=e.additions,t.splitLineCount+=Math.max(e.deletions,e.additions),t.unifiedLineCount+=e.deletions+e.additions)}e.s(["resolveConflict",0,function(e,r,o){var a;let l,s;return function(e,r){let{resolution:o,hunkIndex:a,startContentIndex:l,endContentIndex:s,indexesToDelete:d=new Set}=r,u=e.hunks[a];if(null==u)throw console.error({diff:e,hunkIndex:a}),Error(`resolveRegion: Invalid hunk index: ${a}`);if(l<0||s>=u.hunkContent.length||l>s)throw Error(`resolveRegion: Invalid content range, ${l}, ${s}`);let{hunks:c,additionLines:f,deletionLines:h}=e,p={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:null!=e.cacheKey?`${e.cacheKey}:${o[0]}-${a}:${l}-${s}`:void 0},m={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},g=a===c.length-1&&s===u.hunkContent.length-1,v=!e.isPartial;for(let[r,u]of c.entries()){var b,y,x,C,k,S,L;b=e,y=p,x=m,C=u.deletionLineIndex-u.collapsedBefore,k=u.additionLineIndex-u.collapsedBefore,S=u.collapsedBefore,L=v,S<=0||(L&&(n(y,b.deletionLines,b.additionLines,C,k,S),x.nextAdditionLineIndex+=S,x.nextDeletionLineIndex+=S),x.nextAdditionStart+=S,x.nextDeletionStart+=S,x.splitLineCount+=S,x.unifiedLineCount+=S);let c={...u,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,n]of u.hunkContent.entries())if(r!==a||e<l||e>s){t(n,p,h,f);let e={...n,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex};c.hunkContent.push(e),i(e,m,c)}else if(d.has(e))c.hunkContent.push({type:"context",lines:0,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex});else if("context"===n.type){t(n,p,h,f);let e={...n,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),i(e,m,c)}else{var E=o,w=n,A=p,T=h,I=f;if("deletions"===E||"both"===E)for(let e=0;e<w.deletions;e++){let n=T[w.deletionLineIndex+e];if(null==n)throw console.error({deletionLines:T,content:w,i:e}),Error("pushResolveLinesToDiff: Deletion line does not exist");A.deletionLines.push(n),A.additionLines.push(n)}if("additions"===E||"both"===E)for(let e=0;e<w.additions;e++){let n=I[w.additionLineIndex+e];if(null==n)throw console.error({additionLines:I,content:w,i:e}),Error("pushResolveLinesToDiff: Addition line does not exist");A.deletionLines.push(n),A.additionLines.push(n)}let e={type:"context",lines:"deletions"===o?n.deletions:"additions"===o?n.additions:n.deletions+n.additions,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),i(e,m,c)}if(r===a&&g){let e="deletions"===o?u.noEOFCRDeletions:u.noEOFCRAdditions;c.noEOFCRAdditions=e,c.noEOFCRDeletions=e}p.hunks.push(c)}let R=c.at(-1);return null==R||e.isPartial||n(p,h,f,R.deletionLineIndex+R.deletionCount,R.additionLineIndex+R.additionCount,Math.min(h.length-(R.deletionLineIndex+R.deletionCount),f.length-(R.additionLineIndex+R.additionCount))),p.splitLineCount=m.splitLineCount,p.unifiedLineCount=m.unifiedLineCount,p}(e,{resolution:"accept"===(l="string"==typeof o?o:o.type)||"incoming"===l?"additions":"reject"===l||"current"===l?"deletions":"both",hunkIndex:r.hunkIndex,startContentIndex:r.startContentIndex,endContentIndex:r.endContentIndex,indexesToDelete:(a=r,s=new Set,null!=a.baseContentIndex&&s.add(a.baseContentIndex),a.endMarkerContentIndex!==a.endContentIndex&&s.add(a.endMarkerContentIndex),s)})}],52719)},1062,e=>e.a(async(n,t)=>{try{e.i(90578),e.i(27763),e.i(58498),e.i(76493),e.i(65597);var i=e.i(49889),r=(e.i(2391),e.i(58975),e.i(84661)),o=(e.i(19657),e.i(52719),n([i,r]));[i,r]=o.then?(await o)():o;i.FileDiff;e.s(["getUnresolvedDiffHunksRendererOptions",0,function(e,n){return{...n,...e,hunkSeparators:"function"==typeof e?.hunkSeparators?"custom":e?.hunkSeparators,mergeConflictActionsType:"function"==typeof e?.mergeConflictActionsType?"custom":e?.mergeConflictActionsType}}]),t()}catch(e){t(e)}},!1),52831,e=>{"use strict";var n=e.i(90578),t=e.i(52205),i=e.i(10787);e.s(["createStyleElement",0,function(e,r=!1){return(0,t.createHastElement)({tagName:"style",children:[(0,t.createTextNodeElement)(r?(0,i.wrapCoreCSS)(e):(0,i.wrapUnsafeCSS)(e))],properties:{[n.CORE_CSS_ATTRIBUTE]:r?"":void 0,[n.UNSAFE_CSS_ATTRIBUTE]:r?void 0:""}})},"createThemeStyleElement",0,function(e){return(0,t.createHastElement)({tagName:"style",children:[(0,t.createTextNodeElement)(e)],properties:{[n.THEME_CSS_ATTRIBUTE]:""}})}])},76160,e=>{"use strict";var n=e.i(40103);e.s(["getSingularPatch",0,function(e){let t=(0,n.parsePatchFiles)(e);if(1!==t.length)throw console.error(t),Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");let{files:i}=t[0];if(1!==i.length)throw console.error(i),Error("FileDiff: Provided patch must contain exactly 1 file diff");return i[0]}])},34208,e=>{"use strict";var n=e.i(37403),t=e.i(36680);e.s(["renderHTML",0,function(e){return`${n.SVGSpriteSheet}${(0,t.toHtml)(e)}`}])},30788,e=>e.a(async(n,t)=>{try{var i=e.i(10787),r=e.i(8704),o=e.i(67997);e.i(58975);var a=e.i(84661),l=e.i(1062),s=e.i(52831),d=e.i(76160),u=e.i(34208),c=n([r,a,l]);async function f({fileDiff:e,oldFile:n,newFile:t,options:a,annotations:l}){var d,c,h,p,m;let g,v;if(null==e&&null!=n&&null!=t&&(e=(0,o.parseDiffFromFile)(n,t,a?.parseDiffOptions)),null==e)throw Error("preloadFileDiff: You must pass at least a fileDiff prop or oldFile/newFile props");let b=new r.DiffHunksRenderer({...d=a,headerRenderMode:d?.renderCustomHeader!=null?"custom":"default",hunkSeparators:"function"==typeof d?.hunkSeparators?"custom":d?.hunkSeparators});return null!=l&&l.length>0&&b.setLineAnnotations(l),(0,u.renderHTML)((c=await b.asyncRender(e),h=b,p=a?.unsafeCSS,m=a?.themeType??"system",(g=[(0,s.createStyleElement)(c.css,!0)]).push((0,s.createThemeStyleElement)((0,i.wrapThemeCSS)(c.themeStyles,c.baseThemeType??m))),null!=p&&g.push((0,s.createStyleElement)(p)),null!=c.headerElement&&g.push(c.headerElement),(v=h.renderFullAST(c)).properties["data-dehydrated"]="",g.push(v),g))}async function h({patch:e,options:n,annotations:t}){return{patch:e,options:n,annotations:t,prerenderedHTML:await f({fileDiff:(0,d.getSingularPatch)(e),options:n,annotations:t})}}[r,a,l]=c.then?(await c)():c,e.s(["preloadPatchDiff",0,h]),t()}catch(e){t(e)}},!1),8720,e=>e.a(async(n,t)=>{try{var i=e.i(30788),r=n([i]);[i]=r.then?(await r)():r;let o=e=>({diffStyle:"split"===e?"split":"unified",disableFileHeader:!0,disableLineNumbers:!1,expansionLineCount:20,hunkSeparators:"line-info",lineDiffType:"char",maxLineDiffLength:500,overflow:"scroll",theme:{dark:"github-dark",light:"github-light"},unsafeCSS:"[data-diff-span] { border-radius: 0; }"}),a=async e=>{let[n,t]=await Promise.all([(0,i.preloadPatchDiff)({options:o("split"),patch:e}),(0,i.preloadPatchDiff)({options:o("stacked"),patch:e})]);return{split:n.prerenderedHTML,stacked:t.prerenderedHTML}};e.s(["preloadPatchHtmlByLayout",0,a]),t()}catch(e){t(e)}},!1),90072,e=>e.a(async(n,t)=>{try{var i=e.i(29950),r=e.i(69951),o=e.i(8720),a=n([o]);[o]=a.then?(await a)():a;let l=async e=>{let{searchParams:n}=new URL(e.url),t=n.get("base")??void 0,a=n.get("file")??void 0,l="uncommitted"===n.get("mode")?"uncommitted":void 0,s="ignore"===n.get("ws")?"ignore":void 0;try{let e=a?await (0,r.getDiffForFile)(a,t,l,s):await (0,r.getDiff)(t,l,s),n=a&&e.patch?await (0,o.preloadPatchHtmlByLayout)(e.patch):void 0;return i.NextResponse.json({...e,...n?{prerenderedHTML:n}:{}})}catch(e){return i.NextResponse.json({error:String(e)},{status:500})}};e.s(["GET",0,l]),t()}catch(e){t(e)}},!1),78713,e=>e.a(async(n,t)=>{try{var i=e.i(31173),r=e.i(62205),o=e.i(9467),a=e.i(68273),l=e.i(18601),s=e.i(67822),d=e.i(94179),u=e.i(86434),c=e.i(34044),f=e.i(282),h=e.i(63625),p=e.i(62788),m=e.i(60321),g=e.i(21422),v=e.i(91917),b=e.i(93695);e.i(93930);var y=e.i(82490),x=e.i(90072),C=n([x]);[x]=C.then?(await C)():C;let S=new i.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/diff/route",pathname:"/api/diff",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/web/app/api/diff/route.ts",nextConfigOutput:"standalone",userland:x,...{}}),{workAsyncStorage:L,workUnitAsyncStorage:E,serverHooks:w}=S;async function k(e,n,t){t.requestMeta&&(0,a.setRequestMeta)(e,t.requestMeta),S.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let i="/api/diff/route";i=i.replace(/\/index$/,"")||"/";let o=await S.prepare(e,n,{srcPage:i,multiZoneDraftMode:!1});if(!o)return n.statusCode=400,n.end("Bad Request"),null==t.waitUntil||t.waitUntil.call(t,Promise.resolve()),null;let{buildId:x,params:C,nextConfig:k,parsedUrl:L,isDraftMode:E,prerenderManifest:w,routerServerContext:A,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,resolvedPathname:R,clientReferenceManifest:N,serverActionsManifest:D}=o,M=(0,d.normalizeAppPath)(i),P=!!(w.dynamicRoutes[M]||w.routes[R]),H=async()=>((null==A?void 0:A.render404)?await A.render404(e,n,L,!1):n.end("This page could not be found"),null);if(P&&!E){let e=!!w.routes[R],n=w.dynamicRoutes[M];if(n&&!1===n.fallback&&!e){if(k.adapterPath)return await H();throw new b.NoFallbackError}}let O=null;!P||S.isDev||E||(O=R,O="/index"===O?"/":O);let F=!0===S.isDev||!P,U=P&&!F;D&&N&&(0,s.setManifestsSingleton)({page:i,clientReferenceManifest:N,serverActionsManifest:D});let B=e.method||"GET",_=(0,l.getTracer)(),z=_.getActiveScopeSpan(),$=!!(null==A?void 0:A.isWrappedByNextServer),G=!!(0,a.getRequestMeta)(e,"minimalMode"),j=(0,a.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,k,w,G);null==j||j.resetRequestCache(),globalThis.__incrementalCache=j;let W={params:C,previewProps:w.preview,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:F,incrementalCache:j,cacheLifeProfiles:k.cacheLife,waitUntil:t.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,r)=>S.onRequestError(e,n,i,r,A)},sharedContext:{buildId:x}},q=new u.NodeNextRequest(e),K=new u.NodeNextResponse(n),V=c.NextRequestAdapter.fromNodeNextRequest(q,(0,c.signalFromNodeResponse)(n));try{let o,a=async e=>S.handle(V,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=_.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${t.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=t.get("next.route");if(r){let n=`${B} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":n}),e.updateName(n),o&&o!==e&&(o.setAttribute("http.route",r),o.updateName(n))}else e.updateName(`${B} ${i}`)}),s=async o=>{var l,s;let d=async({previousCacheEntry:r})=>{try{if(!G&&T&&I&&!r)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let i=await a(o);e.fetchMetrics=W.renderOpts.fetchMetrics;let l=W.renderOpts.pendingWaitUntil;l&&t.waitUntil&&(t.waitUntil(l),l=void 0);let s=W.renderOpts.collectedTags;if(!P)return await (0,p.sendResponse)(q,K,i,W.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),n=(0,m.toNodeOutgoingHttpHeaders)(i.headers);s&&(n[v.NEXT_CACHE_TAGS_HEADER]=s),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,r=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:r}}}}catch(n){throw(null==r?void 0:r.isStale)&&await S.onRequestError(e,n,{routerKind:"App Router",routePath:i,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),n}},u=await S.handleResponse({req:e,nextConfig:k,cacheKey:O,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,responseGenerator:d,waitUntil:t.waitUntil,isMinimalMode:G});if(!P)return null;if((null==u||null==(l=u.value)?void 0:l.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(s=u.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||n.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,m.fromNodeOutgoingHttpHeaders)(u.value.headers);return G&&P||c.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||n.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,g.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(q,K,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};$&&z?await s(z):(o=_.getActiveScopeSpan(),await _.withPropagatedContext(e.headers,()=>_.trace(f.BaseServerSpan.handleRequest,{spanName:`${B} ${i}`,kind:l.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},s),void 0,!$))}catch(n){if(n instanceof b.NoFallbackError||await S.onRequestError(e,n,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),P)throw n;return await (0,p.sendResponse)(q,K,new Response(null,{status:500})),null}}e.s(["handler",0,k,"patchFetch",0,function(){return(0,o.patchFetch)({workAsyncStorage:L,workUnitAsyncStorage:E})},"routeModule",0,S,"serverHooks",0,w,"workAsyncStorage",0,L,"workUnitAsyncStorage",0,E]),t()}catch(e){t(e)}},!1)];
|
|
67
|
+
</svg>`;e.s(["SVGSpriteSheet",0,n])},33574,e=>{"use strict";let n={};e.s(["arePrePropertiesEqual",0,function(e,t){return null==e||null==t?e===t:function(e=n,t=n){if(e===t)return!0;let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(let n of i)if(e[n]!==t[n])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}])},22555,e=>{"use strict";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}])},68382,e=>{"use strict";var n=e.i(90578);e.s(["createUnsafeCSSStyleNode",0,function(){let e=document.createElement("style");return e.setAttribute(n.UNSAFE_CSS_ATTRIBUTE,""),e}])},55740,e=>{"use strict";e.s(["getOrCreateCodeNode",0,function({code:e,pre:n,columnType:t,rowSpan:i,containerSize:r=!1}={}){return null==e&&((e=document.createElement("code")).setAttribute("data-code",""),null!=t&&e.setAttribute(`data-${t}`,""),n?.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}])},2756,e=>{"use strict";var n=e.i(90578);e.s(["upsertHostThemeStyle",0,function({shadowRoot:e,currentNode:t,themeCSS:i}){let r;return""===i.trim()?void t?.remove():((t??=((r=document.createElement("style")).setAttribute(n.THEME_CSS_ATTRIBUTE,""),r)).textContent=i,t.parentNode!==e&&e.appendChild(t),t)}])},54337,e=>{"use strict";e.s(["prerenderHTMLIfNecessary",0,function(e,n){if(null==n)return;let t=e.shadowRoot??e.attachShadow({mode:"open"});""===t.innerHTML&&(t.innerHTML=n)}])},28695,e=>{"use strict";e.s(["setPreNodeProperties",0,function(e,{type:n,diffIndicators:t,disableBackground:i,disableLineNumbers:r,overflow:o,split:a,totalLines:l,customProperties:s}){if(null!=s)for(let n in s){let t=s[n];null!=t&&e.setAttribute(n,`${t}`)}switch("diff"===n?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),t){case"bars":case"classic":e.setAttribute("data-indicators",t);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"===n?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",`${`${l}`.length}ch`),e}])},57360,e=>{"use strict";var n=e.i(90578),t=e.i(91260);if("u">typeof HTMLElement&&null==customElements.get(n.DIFFS_TAG_NAME)){let e;class i extends HTMLElement{constructor(){if(super(),null!=this.shadowRoot)return;const n=this.attachShadow({mode:"open"});null==e&&(e=new CSSStyleSheet).replaceSync(t.default),n.adoptedStyleSheets=[e]}}customElements.define(n.DIFFS_TAG_NAME,i)}e.s(["DiffsContainerLoaded",0,!0])},88860,e=>{"use strict";var n=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,n,t){if(null==n||null==t)for(let i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?n=i:"additions"in i.dataset&&(t=i));null==t||null==n?this.cleanUp():(this.codeDeletions!==n&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=n,n.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==t&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=t,t.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,n])},55594,e=>{"use strict";e.s(["areDiffLineAnnotationsEqual",0,function(e,n){return e.lineNumber===n.lineNumber&&e.side===n.side&&e.metadata===n.metadata}])},49667,e=>{"use strict";e.s(["areHunkDataEqual",0,function(e,n){return e.slotName===n.slotName&&e.hunkIndex===n.hunkIndex&&e.lines===n.lines&&e.type===n.type&&e.expandable?.chunked===n.expandable?.chunked&&e.expandable?.up===n.expandable?.up&&e.expandable?.down===n.expandable?.down}])},49889,e=>e.a(async(n,t)=>{try{var i=e.i(90578),r=e.i(27763),o=e.i(56752),a=e.i(199),l=e.i(59808),s=e.i(37403),d=e.i(76493),u=e.i(33574),c=e.i(65597),f=e.i(22555),h=e.i(68382),p=e.i(10787),m=e.i(55740),g=e.i(2756),v=e.i(54337),b=e.i(28695),y=e.i(57360),x=e.i(88860),C=e.i(8704),k=e.i(55594),S=e.i(49667),L=e.i(67997),E=e.i(36680),w=n([C]);[C]=w.then?(await w)():w;let I=-1;var A=class{static LoadedCustomComponent=y.DiffsContainerLoaded;__id=`file-diff:${++I}`;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:i.DEFAULT_THEMES},n,t=!1){this.options=e,this.workerManager=n,this.isContainerManaged=t,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new o.ResizeManager,this.scrollSyncManager=new x.ScrollSyncManager,this.interactionManager=new r.InteractionManager("diff",(0,r.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 C.DiffHunksRenderer(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,n="additions")=>{let t,i;if(null==this.fileDiff)return;let r=this.fileDiff.hunks.at(-1);e:for(let o of this.fileDiff.hunks){let a="deletions"===n?o.deletionStart:o.additionStart,l="deletions"===n?o.deletionCount:o.additionCount,s=o.splitLineStart,d=o.unifiedLineStart;if(e<a){let n=a-e;t=Math.max(d-n,0),i=Math.max(s-n,0);break}if(e>=a+l){if(o===r){let n=e-(a+l);t=d+o.unifiedLineCount+n,i=s+o.splitLineCount+n;break}continue}for(let r of o.hunkContent)if("context"===r.type)if(e<a+r.lines){let n=e-a;i=s+n,t=d+n;break e}else a+=r.lines,s+=r.lines,d+=r.lines;else{let o="deletions"===n?r.deletions:r.additions;if(e<a+o){let o=e-a;t=d+("additions"===n?r.deletions:0)+o,i=s+o;break e}a+=o,s+=Math.max(r.deletions,r.additions),d+=r.deletions+r.additions}break}if(null!=t&&null!=i)return[t,i]};setOptions(e){null!=e&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions((0,r.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,n,t){return!e&&!n&&!t&&"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:n,prerenderedHTML:t,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:a,fileDiff:l}=e;this.hydrateElements(n,t),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:l,oldFile:o,newFile:a,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,n){for(let t of((0,v.prerenderHTMLIfNecessary)(e,n),e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){for(let e of(this.pre=t,t.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 t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(i.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(i.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.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:n,newFile:t,lineAnnotations:i}){let{diffStyle:r="split",overflow:o="scroll"}=this.options;this.lineAnnotations=i??this.lineAnnotations,this.additionFile=t,this.deletionFile=n,this.fileDiff=e??(null!=n&&null!=t?(0,L.parseDiffFromFile)(n,t,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,n,t)=>{this.expandHunk(e,n,t)};expandHunk=(e,n,t)=>{this.hunksRenderer.expandHunk(e,n,t),this.rerender()};render({oldFile:e,newFile:n,fileDiff:t,forceRender:r=!1,preventEmit:o=!1,lineAnnotations:l,fileContainer:s,containerWrapper:u,renderRange:c}){if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");let{collapsed:f=!1}=this.options,h=f?void 0:c,p=null!=e&&null!=n&&(!(0,d.areFilesEqual)(e,this.deletionFile)||!(0,d.areFilesEqual)(n,this.additionFile)),m=null!=t&&t!==this.fileDiff,g=null!=l&&(l.length>0||this.lineAnnotations.length>0)&&l!==this.lineAnnotations;if(!f&&(0,a.areRenderRangesEqual)(h,this.renderRange)&&!r&&!g&&(null!=t&&t===this.fileDiff||null==t&&!p))return!1;let{renderRange:v}=this;if(this.renderRange=h,this.deletionFile=e,this.additionFile=n,null!=t?this.fileDiff=t:null!=e&&null!=n&&p&&(m=!0,this.fileDiff=(0,L.parseDiffFromFile)(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:y=!1,disableFileHeader:x=!1,overflow:C="scroll",themeType:k="system"}=this.options;if(x&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,u),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,i.EMPTY_RENDER_RANGE);null!=e&&this.applyThemeState(s,e.themeStyles,k,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return o||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(r,g,p||m)&&this.applyPartialRender({previousRenderRange:v,renderRange:h}))){let n=this.hunksRenderer.renderDiff(this.fileDiff,h);if(null==n)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,n.themeStyles,k,n.baseThemeType),null!=n.headerElement&&this.applyHeaderToDOM(n.headerElement,s),null!=n.additionsContentAST||null!=n.deletionsContentAST||null!=n.unifiedContentAST?this.applyHunksToDOM(e,n):null!=this.pre&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(n.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,"wrap"===C),"scroll"===C&&"split"===b?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return o||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:n}=this.options;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof n){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let t=new Map(this.separatorCache);for(let i of e){let e=i.slotName,r=this.separatorCache.get(e);if(null==r||!(0,S.areHunkDataEqual)(i,r.hunkData)){r?.element.remove();let t=document.createElement("div");t.style.display="contents",t.slot=i.slotName;let o=n(i,this);null!=o&&t.appendChild(o),this.fileContainer.appendChild(t),r={element:t,hunkData:i},this.separatorCache.set(e,r)}t.delete(e)}for(let[e,{element:n}]of t.entries())this.separatorCache.delete(e),n.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:n}=this.options;if(null!=n&&this.lineAnnotations.length>0)for(let[t,i]of this.lineAnnotations.entries()){let r=`${t}-${(0,l.getLineAnnotationName)(i)}`,o=this.annotationCache.get(r);if(null==o||!(0,k.areDiffLineAnnotationsEqual)(i,o.annotation)){o?.element.remove();let e=n(i);if(null==e)continue;(o={element:(0,c.createAnnotationWrapperNode)((0,l.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(let[n,{element:t}]of e.entries())this.annotationCache.delete(n),t.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 n=e(this.interactionManager.getHoveredLine);if(null!=n&&null!=this.gutterUtilityContent)return;if(null==n){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=(0,f.createGutterUtilityContentNode)();t.appendChild(n),this.fileContainer.appendChild(t),this.gutterUtilityContent=t}getOrCreateFileContainer(e,n){let t=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(i.DIFFS_TAG_NAME),null!=t&&t!==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 n=e.firstChild;n instanceof SVGElement&&(this.spriteSVG=n,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let n=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,n.appendChild(this.pre)):this.pre.parentNode!==n&&(n.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){for(let n of(this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,Array.from(e.children)))n instanceof HTMLElement&&(n.hasAttribute("data-unified")?this.codeUnified=n:n.hasAttribute("data-deletions")?this.codeDeletions=n:n.hasAttribute("data-additions")&&(this.codeAdditions=n))}applyHeaderToDOM(e,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:t}=this,r=(0,E.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==t)return;let{renderCustomHeader:o,renderHeaderPrefix:a,renderHeaderMetadata:l}=this.options;if(null!=o){let e=o(t)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,i.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(t)??void 0,d=l?.(t)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,i.HEADER_PREFIX_SLOT_ID,s),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,i.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,n,t,i){if(null==i)return void n?.remove();let r=n??this.createHeaderSlotElement(t);return null==n&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,n){e.replaceChildren(),n instanceof Element?e.appendChild(n):e.innerText=`${n}`}createHeaderSlotElement(e){let n=document.createElement("div");return n.slot=e,n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,n=this.fileContainer?.shadowRoot;if(null!=n){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==n||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,h.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,p.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,n,t,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??t;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==n||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,g.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,p.wrapThemeCSS)(n,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:n,themeType:o,baseThemeType:i}:void 0)}applyHunksToDOM(e,n){let{overflow:t="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r="wrap"===t?n.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,n);let o=!1,a=[],l=this.hunksRenderer.renderCodeAST("unified",n),s=this.hunksRenderer.renderCodeAST("deletions",n),d=this.hunksRenderer.renderCodeAST("additions",n);null!=l?(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,m.getOrCreateCodeNode)({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeUnified)):null!=s||null!=d?(null!=s?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=(0,m.getOrCreateCodeNode)({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(s),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,m.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=n.rowCount}applyPartialRender({previousRenderRange:e,renderRange:n}){let{pre:t,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==t||null==e||null==n||!Number.isFinite(e.totalLines)||!Number.isFinite(n.totalLines)||null==this.lastRowCount)return!1;let l=this.getCodeColumns(a,i,o,r);if(null==l)return!1;let s=e.startingLine,d=n.startingLine,u=s+e.totalLines,c=d+n.totalLines,f=Math.max(s,d),h=Math.min(u,c);if(h<=f)return!1;let p=Math.max(0,f-s),m=Math.max(0,u-h),g=this.trimColumns({columns:l,trimStart:p,trimEnd:m,previousStart:s,overlapStart:f,overlapEnd:h,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,n)=>{if(!(n<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:n,bufferBefore:0,bufferAfter:0})},y=b(d,Math.max(f-d,0));if(null==y&&d<f)return!1;let x=b(h,Math.max(c-h,0));if(null==x&&c>h)return!1;let C=(e,n)=>{if(null!=e){if("unified"!==a||Array.isArray(l))if("split"===a&&Array.isArray(l))this.insertPartialHTML(a,l,e,n);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,l,e,n);v+=e.rowCount}};return this.cleanupErrorWrapper(),C(y,"afterbegin"),C(x,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(a,l,v),this.lastRowCount=v),!0}insertPartialHTML(e,n,t,i){if("unified"!==e||Array.isArray(n))if("split"===e&&Array.isArray(n)){let e=this.hunksRenderer.renderCodeAST("deletions",t),r=this.hunksRenderer.renderCodeAST("additions",t);this.renderPartialColumn(n[0],e,i),this.renderPartialColumn(n[1],r,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",t);this.renderPartialColumn(n,e,i)}}renderPartialColumn(e,n,t){if(null==e||null==n)return;let i=T(n[0]),r=T(n[1]);if(null==i||null==r)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);"beforeend"===t&&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"===t&&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(t,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(t,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,n,t,i,r,o){if(!(n instanceof HTMLElement)||!(t instanceof HTMLElement))return;let a=this.getBufferSize(n.dataset);null!=a&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(n,a+e),this.updateBufferSize(t,a+e))}applyRowSpan(e,n,t){let i=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${t}`),e.content.style.setProperty("grid-row",`span ${t}`))};if("unified"!==e||Array.isArray(n))if("split"===e&&Array.isArray(n))i(n[0]),i(n[1]);else throw Error("dun fuuuuked up");else i(n)}trimColumnRows(e,n,t){let i=0,r=0,o=0,a=!1,l=t>=0;if(null==e)return 0;let s=Array.from(e.content.children),d=Array.from(e.gutter.children);if(s.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<s.length&&(!(n<=0)||l||a);){let e=d[o],u=s[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),r++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(n>0||l&&i>=t)&&(e.remove(),u.remove(),n>0&&(n--,0===n&&(a=!0)),r++),i++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(n>0||l&&i>=t)&&(e.remove(),u.remove(),r++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(n>0){let t=Math.min(n,o),i=o-t;i>0?(this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=t):(e.remove(),u.remove(),r+=o),n-=t}else if(l){let n=i,a=i+o-1;if(t<=n)e.remove(),u.remove(),r+=o;else if(t<=a){let n=a-t+1,i=o-n;this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=n}}i+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:n,overlapEnd:t,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let l=Math.max(0,i-r),s=t-r;if(s<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let c=d?l:0,f=u?s:-1;if("unified"===n&&!Array.isArray(e))return this.trimColumnRows(e,c,f);if("split"===n&&Array.isArray(e)){let n=this.trimColumnRows(e[0],c,f),t=this.trimColumnRows(e[1],c,f);if(null!=e[0]&&null!=e[1]&&n!==t)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?n:t}throw console.error({diffStyle:n,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let n=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(n)?void 0:n}updateBufferSize(e,n){e.dataset.bufferSize=`${n}`,e.style.setProperty("grid-row",`span ${n}`),e.style.setProperty("min-height",`calc(${n} * 1lh)`)}getCodeColumns(e,n,t,i){function r(e){if(null==e)return;let n=e.children[0],t=e.children[1];if(n instanceof HTMLElement&&t instanceof HTMLElement&&null!=n.dataset.gutter&&null!=t.dataset.content)return{gutter:n,content:t}}if("unified"===e)return r(n);{let e=r(t),n=r(i);return null!=e||null!=n?[e,n]:void 0}}applyBuffers(e,n){let{disableVirtualizationBuffers:t=!1}=this.options;if(t||null==n){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:n,deletionsContentAST:t,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:s="scroll",diffStyle:d="split"}=this.options,c={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:l,overflow:s,split:"unified"!==d&&null!=n&&null!=t,totalLines:i,customProperties:r};(0,u.arePrePropertiesEqual)(c,this.appliedPreAttributes)||((0,b.setPreNodeProperties)(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,n){this.cleanupErrorWrapper();let t=this.getOrCreatePreNode(n);t.innerHTML="",t.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=n.shadowRoot??n.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 T(e){if(null!=e&&"element"===e.type)return e.children??[]}e.s(["FileDiff",0,A]),t()}catch(e){t(e)}},!1),19657,e=>{"use strict";e.s(["areMergeConflictActionsEqual",0,function(e,n){var t,i;return e.hunkIndex===n.hunkIndex&&e.startContentIndex===n.startContentIndex&&e.endContentIndex===n.endContentIndex&&e.currentContentIndex===n.currentContentIndex&&e.baseContentIndex===n.baseContentIndex&&e.incomingContentIndex===n.incomingContentIndex&&e.endMarkerContentIndex===n.endMarkerContentIndex&&e.conflictIndex===n.conflictIndex&&(t=e.conflict,i=n.conflict,t.conflictIndex===i.conflictIndex&&t.startLineIndex===i.startLineIndex&&t.startLineNumber===i.startLineNumber&&t.separatorLineIndex===i.separatorLineIndex&&t.separatorLineNumber===i.separatorLineNumber&&t.endLineIndex===i.endLineIndex&&t.endLineNumber===i.endLineNumber&&t.baseMarkerLineIndex===i.baseMarkerLineIndex&&t.baseMarkerLineNumber===i.baseMarkerLineNumber)}])},52719,e=>{"use strict";function n(e,n,t,i,r,o){for(let a=0;a<o;a++){let o=n[i+a],l=t[r+a];if(null==o||null==l)throw Error("pushCollapsedContextLines: missing collapsed context line");e.deletionLines.push(o),e.additionLines.push(l)}}function t(e,n,t,i){if("context"===e.type)for(let t=0;t<e.lines;t++){let r=i[e.additionLineIndex+t];if(null==r)throw console.error({additionLines:i,content:e,i:t}),Error("pushContentLinesToDiff: Context line does not exist");n.deletionLines.push(r),n.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=t[e.deletionLineIndex+o];if(null==i)throw console.error({deletionLines:t,content:e,i:o}),Error("pushContentLinesToDiff: Deletion line does not exist");n.deletionLines.push(i)}if(o<e.additions){let t=i[e.additionLineIndex+o];if(null==t)throw console.error({additionLines:i,content:e,i:o}),Error("pushContentLinesToDiff: Addition line does not exist");n.additionLines.push(t)}}}}function i(e,n,t){"context"===e.type?(n.nextAdditionLineIndex+=e.lines,n.nextDeletionLineIndex+=e.lines,n.nextAdditionStart+=e.lines,n.nextDeletionStart+=e.lines,n.splitLineCount+=e.lines,n.unifiedLineCount+=e.lines,t.additionCount+=e.lines,t.deletionCount+=e.lines,t.splitLineCount+=e.lines,t.unifiedLineCount+=e.lines):(n.nextAdditionLineIndex+=e.additions,n.nextDeletionLineIndex+=e.deletions,n.nextAdditionStart+=e.additions,n.nextDeletionStart+=e.deletions,n.splitLineCount+=Math.max(e.deletions,e.additions),n.unifiedLineCount+=e.deletions+e.additions,t.deletionCount+=e.deletions,t.deletionLines+=e.deletions,t.additionCount+=e.additions,t.additionLines+=e.additions,t.splitLineCount+=Math.max(e.deletions,e.additions),t.unifiedLineCount+=e.deletions+e.additions)}e.s(["resolveConflict",0,function(e,r,o){var a;let l,s;return function(e,r){let{resolution:o,hunkIndex:a,startContentIndex:l,endContentIndex:s,indexesToDelete:d=new Set}=r,u=e.hunks[a];if(null==u)throw console.error({diff:e,hunkIndex:a}),Error(`resolveRegion: Invalid hunk index: ${a}`);if(l<0||s>=u.hunkContent.length||l>s)throw Error(`resolveRegion: Invalid content range, ${l}, ${s}`);let{hunks:c,additionLines:f,deletionLines:h}=e,p={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:null!=e.cacheKey?`${e.cacheKey}:${o[0]}-${a}:${l}-${s}`:void 0},m={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},g=a===c.length-1&&s===u.hunkContent.length-1,v=!e.isPartial;for(let[r,u]of c.entries()){var b,y,x,C,k,S,L;b=e,y=p,x=m,C=u.deletionLineIndex-u.collapsedBefore,k=u.additionLineIndex-u.collapsedBefore,S=u.collapsedBefore,L=v,S<=0||(L&&(n(y,b.deletionLines,b.additionLines,C,k,S),x.nextAdditionLineIndex+=S,x.nextDeletionLineIndex+=S),x.nextAdditionStart+=S,x.nextDeletionStart+=S,x.splitLineCount+=S,x.unifiedLineCount+=S);let c={...u,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,n]of u.hunkContent.entries())if(r!==a||e<l||e>s){t(n,p,h,f);let e={...n,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex};c.hunkContent.push(e),i(e,m,c)}else if(d.has(e))c.hunkContent.push({type:"context",lines:0,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex});else if("context"===n.type){t(n,p,h,f);let e={...n,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),i(e,m,c)}else{var E=o,w=n,A=p,T=h,I=f;if("deletions"===E||"both"===E)for(let e=0;e<w.deletions;e++){let n=T[w.deletionLineIndex+e];if(null==n)throw console.error({deletionLines:T,content:w,i:e}),Error("pushResolveLinesToDiff: Deletion line does not exist");A.deletionLines.push(n),A.additionLines.push(n)}if("additions"===E||"both"===E)for(let e=0;e<w.additions;e++){let n=I[w.additionLineIndex+e];if(null==n)throw console.error({additionLines:I,content:w,i:e}),Error("pushResolveLinesToDiff: Addition line does not exist");A.deletionLines.push(n),A.additionLines.push(n)}let e={type:"context",lines:"deletions"===o?n.deletions:"additions"===o?n.additions:n.deletions+n.additions,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),i(e,m,c)}if(r===a&&g){let e="deletions"===o?u.noEOFCRDeletions:u.noEOFCRAdditions;c.noEOFCRAdditions=e,c.noEOFCRDeletions=e}p.hunks.push(c)}let R=c.at(-1);return null==R||e.isPartial||n(p,h,f,R.deletionLineIndex+R.deletionCount,R.additionLineIndex+R.additionCount,Math.min(h.length-(R.deletionLineIndex+R.deletionCount),f.length-(R.additionLineIndex+R.additionCount))),p.splitLineCount=m.splitLineCount,p.unifiedLineCount=m.unifiedLineCount,p}(e,{resolution:"accept"===(l="string"==typeof o?o:o.type)||"incoming"===l?"additions":"reject"===l||"current"===l?"deletions":"both",hunkIndex:r.hunkIndex,startContentIndex:r.startContentIndex,endContentIndex:r.endContentIndex,indexesToDelete:(a=r,s=new Set,null!=a.baseContentIndex&&s.add(a.baseContentIndex),a.endMarkerContentIndex!==a.endContentIndex&&s.add(a.endMarkerContentIndex),s)})}],52719)},1062,e=>e.a(async(n,t)=>{try{e.i(90578),e.i(27763),e.i(58498),e.i(76493),e.i(65597);var i=e.i(49889),r=(e.i(2391),e.i(58975),e.i(84661)),o=(e.i(19657),e.i(52719),n([i,r]));[i,r]=o.then?(await o)():o;i.FileDiff;e.s(["getUnresolvedDiffHunksRendererOptions",0,function(e,n){return{...n,...e,hunkSeparators:"function"==typeof e?.hunkSeparators?"custom":e?.hunkSeparators,mergeConflictActionsType:"function"==typeof e?.mergeConflictActionsType?"custom":e?.mergeConflictActionsType}}]),t()}catch(e){t(e)}},!1),52831,e=>{"use strict";var n=e.i(90578),t=e.i(52205),i=e.i(10787);e.s(["createStyleElement",0,function(e,r=!1){return(0,t.createHastElement)({tagName:"style",children:[(0,t.createTextNodeElement)(r?(0,i.wrapCoreCSS)(e):(0,i.wrapUnsafeCSS)(e))],properties:{[n.CORE_CSS_ATTRIBUTE]:r?"":void 0,[n.UNSAFE_CSS_ATTRIBUTE]:r?void 0:""}})},"createThemeStyleElement",0,function(e){return(0,t.createHastElement)({tagName:"style",children:[(0,t.createTextNodeElement)(e)],properties:{[n.THEME_CSS_ATTRIBUTE]:""}})}])},76160,e=>{"use strict";var n=e.i(40103);e.s(["getSingularPatch",0,function(e){let t=(0,n.parsePatchFiles)(e);if(1!==t.length)throw console.error(t),Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");let{files:i}=t[0];if(1!==i.length)throw console.error(i),Error("FileDiff: Provided patch must contain exactly 1 file diff");return i[0]}])},34208,e=>{"use strict";var n=e.i(37403),t=e.i(36680);e.s(["renderHTML",0,function(e){return`${n.SVGSpriteSheet}${(0,t.toHtml)(e)}`}])},30788,e=>e.a(async(n,t)=>{try{var i=e.i(10787),r=e.i(8704),o=e.i(67997);e.i(58975);var a=e.i(84661),l=e.i(1062),s=e.i(52831),d=e.i(76160),u=e.i(34208),c=n([r,a,l]);async function f({fileDiff:e,oldFile:n,newFile:t,options:a,annotations:l}){var d,c,h,p,m;let g,v;if(null==e&&null!=n&&null!=t&&(e=(0,o.parseDiffFromFile)(n,t,a?.parseDiffOptions)),null==e)throw Error("preloadFileDiff: You must pass at least a fileDiff prop or oldFile/newFile props");let b=new r.DiffHunksRenderer({...d=a,headerRenderMode:d?.renderCustomHeader!=null?"custom":"default",hunkSeparators:"function"==typeof d?.hunkSeparators?"custom":d?.hunkSeparators});return null!=l&&l.length>0&&b.setLineAnnotations(l),(0,u.renderHTML)((c=await b.asyncRender(e),h=b,p=a?.unsafeCSS,m=a?.themeType??"system",(g=[(0,s.createStyleElement)(c.css,!0)]).push((0,s.createThemeStyleElement)((0,i.wrapThemeCSS)(c.themeStyles,c.baseThemeType??m))),null!=p&&g.push((0,s.createStyleElement)(p)),null!=c.headerElement&&g.push(c.headerElement),(v=h.renderFullAST(c)).properties["data-dehydrated"]="",g.push(v),g))}async function h({patch:e,options:n,annotations:t}){return{patch:e,options:n,annotations:t,prerenderedHTML:await f({fileDiff:(0,d.getSingularPatch)(e),options:n,annotations:t})}}[r,a,l]=c.then?(await c)():c,e.s(["preloadPatchDiff",0,h]),t()}catch(e){t(e)}},!1),8720,e=>e.a(async(n,t)=>{try{var i=e.i(30788),r=n([i]);[i]=r.then?(await r)():r;let o=(e,n)=>({diffStyle:"split"===e?"split":"unified",disableFileHeader:!0,disableLineNumbers:!1,expansionLineCount:20,hunkSeparators:"line-info",lineDiffType:"char",maxLineDiffLength:500,overflow:"scroll",theme:{dark:"github-dark",light:"github-light"},themeType:n,unsafeCSS:"[data-diff-span] { border-radius: 0; }"}),a=async e=>{let[n,t,r,a]=await Promise.all([(0,i.preloadPatchDiff)({options:o("split","light"),patch:e}),(0,i.preloadPatchDiff)({options:o("split","dark"),patch:e}),(0,i.preloadPatchDiff)({options:o("stacked","light"),patch:e}),(0,i.preloadPatchDiff)({options:o("stacked","dark"),patch:e})]);return{split:{dark:t.prerenderedHTML,light:n.prerenderedHTML},stacked:{dark:a.prerenderedHTML,light:r.prerenderedHTML}}};e.s(["preloadPatchHtmlByLayout",0,a]),t()}catch(e){t(e)}},!1),90072,e=>e.a(async(n,t)=>{try{var i=e.i(29950),r=e.i(69951),o=e.i(8720),a=n([o]);[o]=a.then?(await a)():a;let l=async e=>{let{searchParams:n}=new URL(e.url),t=n.get("base")??void 0,a=n.get("file")??void 0,l="uncommitted"===n.get("mode")?"uncommitted":void 0,s="ignore"===n.get("ws")?"ignore":void 0;try{let e=a?await (0,r.getDiffForFile)(a,t,l,s):await (0,r.getDiff)(t,l,s),n=a&&e.patch?await (0,o.preloadPatchHtmlByLayout)(e.patch):void 0;return i.NextResponse.json({...e,...n?{prerenderedHTML:n}:{}})}catch(e){return i.NextResponse.json({error:String(e)},{status:500})}};e.s(["GET",0,l]),t()}catch(e){t(e)}},!1),78713,e=>e.a(async(n,t)=>{try{var i=e.i(31173),r=e.i(62205),o=e.i(9467),a=e.i(68273),l=e.i(18601),s=e.i(67822),d=e.i(94179),u=e.i(86434),c=e.i(34044),f=e.i(282),h=e.i(63625),p=e.i(62788),m=e.i(60321),g=e.i(21422),v=e.i(91917),b=e.i(93695);e.i(93930);var y=e.i(82490),x=e.i(90072),C=n([x]);[x]=C.then?(await C)():C;let S=new i.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/diff/route",pathname:"/api/diff",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/web/app/api/diff/route.ts",nextConfigOutput:"standalone",userland:x,...{}}),{workAsyncStorage:L,workUnitAsyncStorage:E,serverHooks:w}=S;async function k(e,n,t){t.requestMeta&&(0,a.setRequestMeta)(e,t.requestMeta),S.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let i="/api/diff/route";i=i.replace(/\/index$/,"")||"/";let o=await S.prepare(e,n,{srcPage:i,multiZoneDraftMode:!1});if(!o)return n.statusCode=400,n.end("Bad Request"),null==t.waitUntil||t.waitUntil.call(t,Promise.resolve()),null;let{buildId:x,params:C,nextConfig:k,parsedUrl:L,isDraftMode:E,prerenderManifest:w,routerServerContext:A,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,resolvedPathname:R,clientReferenceManifest:N,serverActionsManifest:D}=o,M=(0,d.normalizeAppPath)(i),P=!!(w.dynamicRoutes[M]||w.routes[R]),H=async()=>((null==A?void 0:A.render404)?await A.render404(e,n,L,!1):n.end("This page could not be found"),null);if(P&&!E){let e=!!w.routes[R],n=w.dynamicRoutes[M];if(n&&!1===n.fallback&&!e){if(k.adapterPath)return await H();throw new b.NoFallbackError}}let O=null;!P||S.isDev||E||(O=R,O="/index"===O?"/":O);let F=!0===S.isDev||!P,U=P&&!F;D&&N&&(0,s.setManifestsSingleton)({page:i,clientReferenceManifest:N,serverActionsManifest:D});let B=e.method||"GET",_=(0,l.getTracer)(),z=_.getActiveScopeSpan(),$=!!(null==A?void 0:A.isWrappedByNextServer),G=!!(0,a.getRequestMeta)(e,"minimalMode"),j=(0,a.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,k,w,G);null==j||j.resetRequestCache(),globalThis.__incrementalCache=j;let W={params:C,previewProps:w.preview,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:F,incrementalCache:j,cacheLifeProfiles:k.cacheLife,waitUntil:t.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,r)=>S.onRequestError(e,n,i,r,A)},sharedContext:{buildId:x}},q=new u.NodeNextRequest(e),K=new u.NodeNextResponse(n),V=c.NextRequestAdapter.fromNodeNextRequest(q,(0,c.signalFromNodeResponse)(n));try{let o,a=async e=>S.handle(V,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=_.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==f.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${t.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=t.get("next.route");if(r){let n=`${B} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":n}),e.updateName(n),o&&o!==e&&(o.setAttribute("http.route",r),o.updateName(n))}else e.updateName(`${B} ${i}`)}),s=async o=>{var l,s;let d=async({previousCacheEntry:r})=>{try{if(!G&&T&&I&&!r)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let i=await a(o);e.fetchMetrics=W.renderOpts.fetchMetrics;let l=W.renderOpts.pendingWaitUntil;l&&t.waitUntil&&(t.waitUntil(l),l=void 0);let s=W.renderOpts.collectedTags;if(!P)return await (0,p.sendResponse)(q,K,i,W.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),n=(0,m.toNodeOutgoingHttpHeaders)(i.headers);s&&(n[v.NEXT_CACHE_TAGS_HEADER]=s),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,r=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:r}}}}catch(n){throw(null==r?void 0:r.isStale)&&await S.onRequestError(e,n,{routerKind:"App Router",routePath:i,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),n}},u=await S.handleResponse({req:e,nextConfig:k,cacheKey:O,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,responseGenerator:d,waitUntil:t.waitUntil,isMinimalMode:G});if(!P)return null;if((null==u||null==(l=u.value)?void 0:l.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(s=u.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||n.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,m.fromNodeOutgoingHttpHeaders)(u.value.headers);return G&&P||c.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||n.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,g.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(q,K,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};$&&z?await s(z):(o=_.getActiveScopeSpan(),await _.withPropagatedContext(e.headers,()=>_.trace(f.BaseServerSpan.handleRequest,{spanName:`${B} ${i}`,kind:l.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},s),void 0,!$))}catch(n){if(n instanceof b.NoFallbackError||await S.onRequestError(e,n,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:T})},!1,A),P)throw n;return await (0,p.sendResponse)(q,K,new Response(null,{status:500})),null}}e.s(["handler",0,k,"patchFetch",0,function(){return(0,o.patchFetch)({workAsyncStorage:L,workUnitAsyncStorage:E})},"routeModule",0,S,"serverHooks",0,w,"workAsyncStorage",0,L,"workUnitAsyncStorage",0,E]),t()}catch(e){t(e)}},!1)];
|
|
68
68
|
|
|
69
69
|
//# sourceMappingURL=_0r24f4c._.js.map
|