@p4code/cli 0.7.10 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +592 -279
- package/dist/client/assets/{DiffPanel-CGdUVPnJ.js → DiffPanel-CSv6YIBl.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BgE5h4tr.js → FilePreviewPanel-BZSv2upS.js} +2 -2
- package/dist/client/assets/{P4DesignScreen-i-7mNhPB.js → P4DesignScreen-JTgYV5vh.js} +2 -2
- package/dist/client/assets/{PreviewPanel-D42c3ZHu.js → PreviewPanel-DZJQI1fY.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-D5W0ZyCG.js → PullRequestCodeTab-BTR-YcSY.js} +2 -2
- package/dist/client/assets/{collapsible-CjR2aTi6.js → collapsible-cM_BdURl.js} +2 -2
- package/dist/client/assets/{entities-CB30asjw.js → entities-DqtFk7L9.js} +2 -2
- package/dist/client/assets/{fileCommentAnnotations-B4KDyWYP.js → fileCommentAnnotations-U7_SWGlq.js} +2 -2
- package/dist/client/assets/{index-CLwUrcHN.js → index-FfRV_bUK.js} +10 -6
- package/dist/client/assets/{renderFileChildren-DgVcYeGG.js → renderFileChildren-D-xmx4Ci.js} +2 -2
- package/dist/client/assets/textarea-B3YbEkbC.js +48 -0
- package/dist/client/assets/{toggle-group-Bla5cmgT.js → toggle-group-DMoKBtD6.js} +2 -2
- package/dist/client/index.html +4 -4
- package/dist/{renderer-CcbFiDA_.mjs → renderer-DjkoXzr6.mjs} +2 -2
- package/dist/{runtime-4S909Au8.mjs → runtime-Dm3kk93X.mjs} +2 -2
- package/dist/{src-KPj1bz7P.mjs → src-DmphFADh.mjs} +111 -2
- package/package.json +1 -1
- package/dist/client/assets/textarea-DXj6RvAd.js +0 -48
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{r as t}from"./preload-helper-CEhsl8MR.js";import{n,r,t as i}from"./compiler-runtime-CLAvuQ-D.js";import{Ma as a,Ms as o,Qs as s,Ui as c,Zo as l,es as u,ks as d}from"./textarea-DXj6RvAd.js";import"./entities-CB30asjw.js";import{n as f,t as p}from"./renderFileChildren-DgVcYeGG.js";import{Cn as m,Dn as h,En as g,Fn as _,Ln as v,Mn as y,On as b,Pn as x,Rn as S,Sn as C,T as w,Tn as T,b as E,cr as ee,ht as D,jn as O,kn as k,mt as A,nt as j,rt as te,w as ne,wn as M,wt as N,xn as P,y as re}from"./index-CLwUrcHN.js";var F=s(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),I=s(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),L=s(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]);function R(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function z(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:B(e.items,t.items)}function B(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function ie(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(k,``),t.before(r)):(r.setAttribute(b,``),t.after(r)),n?.observe(r),r}function V(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var H=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),U=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],ae=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],oe=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],se=Symbol(`CodeView.itemOptionsState`);function W(e,t){Object.defineProperty(e,se,{configurable:!1,enumerable:!1,value:t})}function G(e){return e[se]}function K(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var ce=120,le=1,ue=`--diffs-overflow-override`,q=12e6,de=1e6,fe=2e6,pe=q-fe,me=q-de;function he(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var ge=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),_e=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=O;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:_},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??y}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??O.hunkLineCount,lineHeight:e?.lineHeight??O.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??O.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??O.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??x}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return v&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<le||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),ge&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(ue,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,ce)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(ue,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??ie(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){g(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(S),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Se(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return R()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncItemEditors(),this.syncSelection()}removeItem(e){let t=this.idToItem.get(e);if(t==null)return console.error(`CodeView.removeItem: unknown item id "${e}"`),!1;let n=[];for(let e of this.items)e!==t&&n.push(e.item);return this.setItems(n),!0}setItems(e){let t;this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||(t=this.reconcileItems(e)),this.syncItemEditors(t),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=ve(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;ye(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!T(r,i),o=!T(n,this.getLayout());o&&this.syncLayout();let s=a||be(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||xe(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),m(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(e=this.idToItem){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),e))}render(t=!1){e.__STOP||(t?(g(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):h(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Oe(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new A(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new f(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&C(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return e.item.edit===!0&&e.item.collapsed!==!0}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t),i=!1;try{if(r==null){he(n);let e={id:t},a=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(a==null)return;r={editor:a,state:e},this.itemEditors.set(t,r),i=!0}r.editor.edit(e.instance),this.attachedEditors.add(t)}catch(n){throw i&&r!=null&&(this.itemEditors.delete(t),r.editor.cleanUp()),this.releaseRenderedItem(e),n}}syncItemEditors(e){if(this.itemEditors.size===0)return;let t=[];for(let[n,r]of this.itemEditors){let i=this.idToItem.get(n),a=e?.get(n);if(a==null&&i!=null&&this.isItemInEditMode(i))continue;r.editor.cleanUp(),this.itemEditors.delete(n),this.attachedEditors.delete(n);let{lastChange:o}=r.state,s=a==null?i?.item??o?.item:o?.item??a.item;s?.type===`diff`&&(a==null&&i!=null&&i.type===`diff`&&i.instance.completeEditSession()&&(this.markItemLayoutDirty(i),this.render()),D(s.fileDiff)),o!=null&&t.push(a!=null||i==null?o:{...o,item:i.item})}for(let{item:e,file:n,lineAnnotations:r}of t)this.options.onItemEditComplete?.(e,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of U)K(e,t,()=>this.options[t]);K(e,`stickyHeader`,()=>this.options.stickyHeaders),K(e,`collapsed`,e=>{let t=G(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of ae)this.defineItemSharedCallback(e,`file`,t);for(let t of oe)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of H)K(e,t,()=>this.options[t]);K(e,`stickyHeader`,()=>this.options.stickyHeaders),K(e,`hunkSeparators`,()=>this.options.hunkSeparators),K(e,`collapsed`,e=>{let t=G(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of ae)this.defineItemSharedCallback(e,`diff`,t);for(let t of oe)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return W(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return W(t,{id:e}),t}updateItemOptionsId(e,t){let n=G(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){K(e,n,e=>{if(this.options[n]==null)return;let r=G(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){K(e,n,e=>{let r=G(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s=new Map,c;for(let s=0;s<e.length;s++){let l=e[s];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,s,0);d.index=s,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(c=Math.min(c??s,s))):c=Math.min(c??s,s),t[s]!==d&&(c=Math.min(c??s,s)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}if(c==null){if(r.size===0)return;c=Math.max(i.length-1,0)}this.capturePendingLayoutAnchor(a);for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;s.set(n.item.id,n),this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);c=Math.min(c??a,a)}return this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(c),this.scrollDirty=!0,this.render(),s.size>0?s:void 0}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>me}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),q):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=V(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=V(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>me&&t<i,o=n<de&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(pe,r):fe):{pagedScrollTop:V(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=V(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ce(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ce(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=P({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Ee(this.stickyContainer,t.element,h),n.virtualizedSetup(),Te(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Ee(this.stickyContainer,t.element,h),Te(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=V(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null){this.renderState.firstIndex===-1&&(this.stickyOffset.style.height=``);return}let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{let t=!1;for(let n of e)if(n.target===this.stickyContainer){let e=n.borderBoxSize[0].blockSize;if(Math.abs(e-this.renderState.stickyHeight)>=le){let e=this.getScrollTop(),n=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let r=n==null?void 0:this.resolveAnchoredScrollTop(n);if(r!=null){let t=r-e;this.applyScrollFix(r,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else if(n.target===this.header.element||n.target===this.footer.element){let e=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==e.height){let n=this.getScrollTop(),i=this.getScrollAnchor(n);this.setHostHeight(e,r);let a=i==null?void 0:this.resolveAnchoredScrollTop(i);if(a!=null){let e=a-n;this.applyScrollFix(a,n,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else this.scrollDirty=!0,this.heightDirty=!0,t=!0;t&&this.render(!0)};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e,t=this.idToItem){let n,{pendingLayoutAnchor:r}=this;if(r!=null){let e=this.idToItem.get(r.id);if(e!=null&&t.get(r.id)===e)return r;e!=null&&(n=e)}if(e<=0)return;let{firstIndex:i,lastIndex:a,stickyTop:o,stickyBottom:s}=this.renderState;if(i===-1||a===-1)return;let c=this.getHeight();if(!(o===-1||s===-1)){for(let r=i;r<=a;r++){let i=this.items[r];if(i==null)continue;let a=this.getItemTopOffset()+i.top;if(a+i.height<=e)continue;if(a>=e+c)break;if(t.get(i.item.id)!==i){n??=i;continue}if(a>=e)return{type:`item`,id:i.item.id,viewportOffset:a-e};let o=this.getScrollAnchorViewportTop(a,e)-a,s=i.instance.getNumericScrollAnchor(o);if(s!=null){let t=a+s.top;return{type:`line`,id:i.item.id,lineNumber:s.lineNumber,side:s.side,viewportOffset:t-e}}}if(n!=null)for(let e=n.index+1;e<this.items.length;e++){let n=this.items[e];if(n!=null&&t.get(n.item.id)===n)return{type:`item`,id:n.item.id,viewportOffset:0}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=V(this.clampScrollTop(e)),i=V(t),{scrollPageOffset:a}=this,o=V(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:V(this.getScrollTop())===V(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);z(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function ve(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function ye(e,t){return!M(e.theme??_,t.theme??_)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function be(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function xe(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Se(e){return e instanceof SVGElement?!0:N(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Ce(e){let t=we(e.start,e.side),n=we(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function we(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Te(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Ee(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function De(e){return(e.annotations?.length??0)>0}function Oe(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)De(t.item)&&i.push(t);return i.length>0?i:void 0}var J=e(r(),1),Y=e(t(),1),X=n(),ke=typeof window>`u`?J.useEffect:J.useLayoutEffect;function Ae(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function je(e,t){let{className:n,containerRef:r,disableWorkerPool:i=!1,editorOptions:a,initialItems:o,items:s,onItemEditChange:c,onItemEditComplete:l,onScroll:u,onSelectedLinesChange:d,options:f,renderAnnotation:p,renderCodeViewFooter:h,renderCodeViewHeader:g,renderCustomHeader:_,renderGutterUtility:v,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderHeaderPrefix:x,selectedLines:S,style:C}=e,T=s!==void 0,E=ne(),ee=(0,J.useContext)(re),D=(0,J.useRef)(Ae(T)),O=_!=null,k=p!=null,A=v!=null,j=O||x!=null||y!=null||b!=null,te=j||k||A,M=g!=null,N=h!=null,P=w(e=>{d?.(e)}),F=S!==void 0,I=w(e=>{if(E==null)throw Error(`CodeView: EditContext is not attached`);let t=E({...a,...e});if(t==null)throw Error(`CodeView: EditProvider.createEditor must return an editor instance`);return t}),L=w((e,t,n)=>{c?.(e,t,n)}),R=w((e,t,n)=>{l?.(e,t,n)}),z=(0,J.useMemo)(()=>Ie({options:f,hasCustomHeader:O,hasGutterRenderer:A,hasCodeViewHeader:M,hasCodeViewFooter:N,onSelectedLinesChange:d==null?void 0:P,controlledSelection:F,createEditor:E==null?void 0:I,onItemEditChange:c==null?void 0:L,onItemEditComplete:l==null?void 0:R}),[E,F,I,L,R,P,N,M,O,A,c,l,d,f]),[B]=(0,J.useState)(()=>Fe()),[,ie]=(0,J.useState)({}),V=w(e=>{D.current.instance!=null&&(e==null||e!==D.current.instance.getContainerElement())&&(D.current.instance.cleanUp(),B.publish(void 0),D.current=Ae(T)),e!=null&&e!==D.current.instance?.getContainerElement()&&(D.current.instance=new _e(z,i?void 0:ee,!0),D.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),H=w(e=>{D.current.disableFlushSync?B.publish(e):(0,Y.flushSync)(()=>{B.publish(e)})}),U=(0,J.useMemo)(()=>{if(!(!j&&!k&&!A&&!M&&!N))return{hasHeaderRenderers:j,hasAnnotationRenderer:k,hasGutterRenderer:A,onSnapshotChange:H}},[H,k,A,j,M,N]);return ke(()=>u==null?void 0:D.current.instance?.subscribeToScroll(u)),ke(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=D.current;if(e!=null)try{D.current.disableFlushSync=!0;let a=!1;if(m(z,r)||(D.current.managedOptions=z,e.setOptions(z),a=!0),t!==T){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(T)s!==n&&(Pe(n,s)?D.current.items=s:Ne(n,s)?(D.current.items=s,e.addItems(s.slice(n.length))):(D.current.items=s,e.setItems(s),a=!0));else if(n==null){let t=o??[];D.current.items=t,t.length>0&&(e.setItems(t),a=!0)}S!==void 0&&e.setSelectedLines(S,{notify:!1});let c=e.setSlotCoordinator(U),l=!1;U!==i&&((U==null||i==null)&&(l=!0),D.current.slotCoordinator=U),(a||c)&&e.render(!0),c&&U==null&&B.publish(void 0),l&&ie({})}finally{D.current.disableFlushSync=!1}}),(0,J.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=D.current;Z(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},removeItem(e){let{controlled:t,instance:n}=D.current;return Z(t,`removeItem`),n==null?(console.error(`CodeView.removeItem: no valid instance to remove item from`,e),!1):n.removeItem(e)},updateItem(e){let{controlled:t,instance:n}=D.current;return Z(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=D.current;return Z(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=D.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=D.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),P(e))},getSelectedLines(){let{instance:e}=D.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=D.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),P(null))},getEditor(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getEditor: no valid instance exists`,e);return}return t.getEditor(e)},getInstance(){return D.current.instance}}),[P]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:V,className:n,style:C}),(te||M||N)&&(0,X.jsx)(Le,{managedContentStore:B,renderCustomHeader:_,renderHeaderPrefix:x,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderAnnotation:p,renderGutterUtility:v,renderCodeViewHeader:g,renderCodeViewFooter:h})]})}var Me=(0,J.forwardRef)(je);function Ne(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Pe(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Z(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function Fe(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!z(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Ie({options:e,hasCustomHeader:t,hasGutterRenderer:n,hasCodeViewHeader:r,hasCodeViewFooter:i,onSelectedLinesChange:a,controlledSelection:o,createEditor:s,onItemEditChange:c,onItemEditComplete:l}){let u={...e,controlledSelection:o,onSelectedLinesChange:a,createEditor:s};return c!=null&&(u.onItemEditChange=c),l!=null&&(u.onItemEditComplete=l),t&&(u.renderCustomHeader=Q),n&&(u.renderGutterUtility=Q),r&&(u.renderCodeViewHeader=Q),i&&(u.renderCodeViewFooter=Q),u}var Le=(0,J.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderCodeViewHeader:s,renderCodeViewFooter:c}){"use no memo";let l=w(t=>e.subscribe(t)),u=w(()=>e.getSnapshot()),d=(0,J.useSyncExternalStore)(l,u,u),f=``;for(let e of d?.items??[])f+=`${e.id}:${e.version}:${e.type}`;return(0,X.jsxs)(X.Fragment,{children:[(0,J.useMemo)(()=>d?.items?.map(e=>(0,Y.createPortal)(Re({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}),e.element,e.id)),[t,n,r,i,a,o,f]),(0,J.useMemo)(()=>s!=null&&d?.header!=null?(0,Y.createPortal)(s(),d.header):null,[s,d?.header]),(0,J.useMemo)(()=>c!=null&&d?.footer!=null?(0,Y.createPortal)(c(),d.footer):null,[c,d?.footer])]})});function Re({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}){if(e.type===`diff`){let{item:s,instance:c}=e;return E({fileDiff:s.fileDiff,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}else{let{item:s,instance:c}=e;return p({file:s.file,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}}function Q(){}function ze(e,t){return e.length>0&&e.every(e=>t.has(e))}function Be(e,t){return ze(e,t)?new Set:new Set(e)}var Ve=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),He={multiple(e){return e?{[Ve.multiple]:``}:null}},Ue=J.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:s,orientation:c=`horizontal`,multiple:f=!1,value:p,className:m,render:h,style:g,..._}=e,v=a(!0),y=J.useMemo(()=>p!==void 0||n!==void 0,[p,n]),b=(v?.disabled??!1)||r,[x,S]=u({controlled:p,default:p===void 0?n??o:void 0,name:`ToggleGroup`,state:`value`}),C=l((e,t,n)=>{let r;f?(r=x.slice(),t?r.push(e):r.splice(x.indexOf(e),1)):r=t?[e]:[],s?.(r,n),!n.isCanceled&&S(r)}),w={disabled:b,multiple:f,orientation:c},T=J.useMemo(()=>({disabled:b,orientation:c,setGroupValue:C,value:x,isValueInitialized:y}),[b,c,C,x,y]),E={role:`group`},D=d(`div`,e,{enabled:!!v,state:w,ref:t,props:[E,_],stateAttributesMapping:He});return(0,X.jsx)(te.Provider,{value:T,children:v?D:(0,X.jsx)(ee,{render:h,className:m,style:g,state:w,refs:[t],props:[E,_],stateAttributesMapping:He,loopFocus:i,enableHomeAndEndKeys:!0,orientation:c})})}),We=i(),$=J.createContext({size:`default`,variant:`default`});function Ge(e){let t=(0,We.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,variant:a,size:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let l=a===void 0?`default`:a,u=o===void 0?`default`:o,d=s===void 0?`horizontal`:s,f;t[7]!==u||t[8]!==l?(f={size:u,variant:l},t[7]=u,t[8]=l,t[9]=f):f=t[9];let p=f,m=d===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=l==="default"?`gap-0.5`:d===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,g;t[10]!==r||t[11]!==m||t[12]!==h?(g=c(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,m,h,r),t[10]=r,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==p?(_=(0,X.jsx)($,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=_):_=t[16];let v;return t[17]!==d||t[18]!==i||t[19]!==u||t[20]!==g||t[21]!==_||t[22]!==l?(v=(0,X.jsx)(Ue,{className:g,"data-size":u,"data-slot":`toggle-group`,"data-variant":l,orientation:d,...i,children:_}),t[17]=d,t[18]=i,t[19]=u,t[20]=g,t[21]=_,t[22]=l,t[23]=v):v=t[23],v}function Ke(e){let t=(0,We.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=J.use($),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,X.jsx)(j,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}export{Me as a,F as c,Be as i,Ge as n,L as o,ze as r,I as s,Ke as t};
|
|
2
|
-
//# sourceMappingURL=toggle-group-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{r as t}from"./preload-helper-CEhsl8MR.js";import{n,r,t as i}from"./compiler-runtime-CLAvuQ-D.js";import{Ma as a,Ms as o,Qs as s,Ui as c,Zo as l,es as u,ks as d}from"./textarea-B3YbEkbC.js";import"./entities-DqtFk7L9.js";import{n as f,t as p}from"./renderFileChildren-D-xmx4Ci.js";import{Cn as m,Dn as h,En as g,Fn as _,Ln as v,Mn as y,On as b,Pn as x,Rn as S,Sn as C,T as w,Tn as T,b as E,cr as ee,ht as D,jn as O,kn as k,mt as A,nt as j,rt as te,w as ne,wn as M,wt as N,xn as P,y as re}from"./index-FfRV_bUK.js";var F=s(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),I=s(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),L=s(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]);function R(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function z(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:B(e.items,t.items)}function B(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function ie(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(k,``),t.before(r)):(r.setAttribute(b,``),t.after(r)),n?.observe(r),r}function V(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var H=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),U=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],ae=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],oe=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],se=Symbol(`CodeView.itemOptionsState`);function W(e,t){Object.defineProperty(e,se,{configurable:!1,enumerable:!1,value:t})}function G(e){return e[se]}function K(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var ce=120,le=1,ue=`--diffs-overflow-override`,q=12e6,de=1e6,fe=2e6,pe=q-fe,me=q-de;function he(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var ge=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),_e=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=O;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:_},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??y}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??O.hunkLineCount,lineHeight:e?.lineHeight??O.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??O.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??O.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??x}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return v&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<le||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),ge&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(ue,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,ce)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(ue,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??ie(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){g(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(S),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Se(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return R()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncItemEditors(),this.syncSelection()}removeItem(e){let t=this.idToItem.get(e);if(t==null)return console.error(`CodeView.removeItem: unknown item id "${e}"`),!1;let n=[];for(let e of this.items)e!==t&&n.push(e.item);return this.setItems(n),!0}setItems(e){let t;this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||(t=this.reconcileItems(e)),this.syncItemEditors(t),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=ve(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;ye(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!T(r,i),o=!T(n,this.getLayout());o&&this.syncLayout();let s=a||be(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||xe(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),m(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(e=this.idToItem){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),e))}render(t=!1){e.__STOP||(t?(g(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):h(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Oe(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new A(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new f(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&C(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return e.item.edit===!0&&e.item.collapsed!==!0}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t),i=!1;try{if(r==null){he(n);let e={id:t},a=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(a==null)return;r={editor:a,state:e},this.itemEditors.set(t,r),i=!0}r.editor.edit(e.instance),this.attachedEditors.add(t)}catch(n){throw i&&r!=null&&(this.itemEditors.delete(t),r.editor.cleanUp()),this.releaseRenderedItem(e),n}}syncItemEditors(e){if(this.itemEditors.size===0)return;let t=[];for(let[n,r]of this.itemEditors){let i=this.idToItem.get(n),a=e?.get(n);if(a==null&&i!=null&&this.isItemInEditMode(i))continue;r.editor.cleanUp(),this.itemEditors.delete(n),this.attachedEditors.delete(n);let{lastChange:o}=r.state,s=a==null?i?.item??o?.item:o?.item??a.item;s?.type===`diff`&&(a==null&&i!=null&&i.type===`diff`&&i.instance.completeEditSession()&&(this.markItemLayoutDirty(i),this.render()),D(s.fileDiff)),o!=null&&t.push(a!=null||i==null?o:{...o,item:i.item})}for(let{item:e,file:n,lineAnnotations:r}of t)this.options.onItemEditComplete?.(e,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of U)K(e,t,()=>this.options[t]);K(e,`stickyHeader`,()=>this.options.stickyHeaders),K(e,`collapsed`,e=>{let t=G(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of ae)this.defineItemSharedCallback(e,`file`,t);for(let t of oe)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of H)K(e,t,()=>this.options[t]);K(e,`stickyHeader`,()=>this.options.stickyHeaders),K(e,`hunkSeparators`,()=>this.options.hunkSeparators),K(e,`collapsed`,e=>{let t=G(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of ae)this.defineItemSharedCallback(e,`diff`,t);for(let t of oe)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return W(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return W(t,{id:e}),t}updateItemOptionsId(e,t){let n=G(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){K(e,n,e=>{if(this.options[n]==null)return;let r=G(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){K(e,n,e=>{let r=G(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s=new Map,c;for(let s=0;s<e.length;s++){let l=e[s];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,s,0);d.index=s,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(c=Math.min(c??s,s))):c=Math.min(c??s,s),t[s]!==d&&(c=Math.min(c??s,s)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}if(c==null){if(r.size===0)return;c=Math.max(i.length-1,0)}this.capturePendingLayoutAnchor(a);for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;s.set(n.item.id,n),this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);c=Math.min(c??a,a)}return this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(c),this.scrollDirty=!0,this.render(),s.size>0?s:void 0}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>me}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),q):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=V(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=V(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>me&&t<i,o=n<de&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(pe,r):fe):{pagedScrollTop:V(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=V(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ce(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ce(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=P({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Ee(this.stickyContainer,t.element,h),n.virtualizedSetup(),Te(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Ee(this.stickyContainer,t.element,h),Te(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=V(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null){this.renderState.firstIndex===-1&&(this.stickyOffset.style.height=``);return}let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{let t=!1;for(let n of e)if(n.target===this.stickyContainer){let e=n.borderBoxSize[0].blockSize;if(Math.abs(e-this.renderState.stickyHeight)>=le){let e=this.getScrollTop(),n=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let r=n==null?void 0:this.resolveAnchoredScrollTop(n);if(r!=null){let t=r-e;this.applyScrollFix(r,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else if(n.target===this.header.element||n.target===this.footer.element){let e=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==e.height){let n=this.getScrollTop(),i=this.getScrollAnchor(n);this.setHostHeight(e,r);let a=i==null?void 0:this.resolveAnchoredScrollTop(i);if(a!=null){let e=a-n;this.applyScrollFix(a,n,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else this.scrollDirty=!0,this.heightDirty=!0,t=!0;t&&this.render(!0)};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e,t=this.idToItem){let n,{pendingLayoutAnchor:r}=this;if(r!=null){let e=this.idToItem.get(r.id);if(e!=null&&t.get(r.id)===e)return r;e!=null&&(n=e)}if(e<=0)return;let{firstIndex:i,lastIndex:a,stickyTop:o,stickyBottom:s}=this.renderState;if(i===-1||a===-1)return;let c=this.getHeight();if(!(o===-1||s===-1)){for(let r=i;r<=a;r++){let i=this.items[r];if(i==null)continue;let a=this.getItemTopOffset()+i.top;if(a+i.height<=e)continue;if(a>=e+c)break;if(t.get(i.item.id)!==i){n??=i;continue}if(a>=e)return{type:`item`,id:i.item.id,viewportOffset:a-e};let o=this.getScrollAnchorViewportTop(a,e)-a,s=i.instance.getNumericScrollAnchor(o);if(s!=null){let t=a+s.top;return{type:`line`,id:i.item.id,lineNumber:s.lineNumber,side:s.side,viewportOffset:t-e}}}if(n!=null)for(let e=n.index+1;e<this.items.length;e++){let n=this.items[e];if(n!=null&&t.get(n.item.id)===n)return{type:`item`,id:n.item.id,viewportOffset:0}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=V(this.clampScrollTop(e)),i=V(t),{scrollPageOffset:a}=this,o=V(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:V(this.getScrollTop())===V(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);z(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function ve(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function ye(e,t){return!M(e.theme??_,t.theme??_)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function be(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function xe(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Se(e){return e instanceof SVGElement?!0:N(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Ce(e){let t=we(e.start,e.side),n=we(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function we(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Te(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Ee(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function De(e){return(e.annotations?.length??0)>0}function Oe(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)De(t.item)&&i.push(t);return i.length>0?i:void 0}var J=e(r(),1),Y=e(t(),1),X=n(),ke=typeof window>`u`?J.useEffect:J.useLayoutEffect;function Ae(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function je(e,t){let{className:n,containerRef:r,disableWorkerPool:i=!1,editorOptions:a,initialItems:o,items:s,onItemEditChange:c,onItemEditComplete:l,onScroll:u,onSelectedLinesChange:d,options:f,renderAnnotation:p,renderCodeViewFooter:h,renderCodeViewHeader:g,renderCustomHeader:_,renderGutterUtility:v,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderHeaderPrefix:x,selectedLines:S,style:C}=e,T=s!==void 0,E=ne(),ee=(0,J.useContext)(re),D=(0,J.useRef)(Ae(T)),O=_!=null,k=p!=null,A=v!=null,j=O||x!=null||y!=null||b!=null,te=j||k||A,M=g!=null,N=h!=null,P=w(e=>{d?.(e)}),F=S!==void 0,I=w(e=>{if(E==null)throw Error(`CodeView: EditContext is not attached`);let t=E({...a,...e});if(t==null)throw Error(`CodeView: EditProvider.createEditor must return an editor instance`);return t}),L=w((e,t,n)=>{c?.(e,t,n)}),R=w((e,t,n)=>{l?.(e,t,n)}),z=(0,J.useMemo)(()=>Ie({options:f,hasCustomHeader:O,hasGutterRenderer:A,hasCodeViewHeader:M,hasCodeViewFooter:N,onSelectedLinesChange:d==null?void 0:P,controlledSelection:F,createEditor:E==null?void 0:I,onItemEditChange:c==null?void 0:L,onItemEditComplete:l==null?void 0:R}),[E,F,I,L,R,P,N,M,O,A,c,l,d,f]),[B]=(0,J.useState)(()=>Fe()),[,ie]=(0,J.useState)({}),V=w(e=>{D.current.instance!=null&&(e==null||e!==D.current.instance.getContainerElement())&&(D.current.instance.cleanUp(),B.publish(void 0),D.current=Ae(T)),e!=null&&e!==D.current.instance?.getContainerElement()&&(D.current.instance=new _e(z,i?void 0:ee,!0),D.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),H=w(e=>{D.current.disableFlushSync?B.publish(e):(0,Y.flushSync)(()=>{B.publish(e)})}),U=(0,J.useMemo)(()=>{if(!(!j&&!k&&!A&&!M&&!N))return{hasHeaderRenderers:j,hasAnnotationRenderer:k,hasGutterRenderer:A,onSnapshotChange:H}},[H,k,A,j,M,N]);return ke(()=>u==null?void 0:D.current.instance?.subscribeToScroll(u)),ke(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=D.current;if(e!=null)try{D.current.disableFlushSync=!0;let a=!1;if(m(z,r)||(D.current.managedOptions=z,e.setOptions(z),a=!0),t!==T){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(T)s!==n&&(Pe(n,s)?D.current.items=s:Ne(n,s)?(D.current.items=s,e.addItems(s.slice(n.length))):(D.current.items=s,e.setItems(s),a=!0));else if(n==null){let t=o??[];D.current.items=t,t.length>0&&(e.setItems(t),a=!0)}S!==void 0&&e.setSelectedLines(S,{notify:!1});let c=e.setSlotCoordinator(U),l=!1;U!==i&&((U==null||i==null)&&(l=!0),D.current.slotCoordinator=U),(a||c)&&e.render(!0),c&&U==null&&B.publish(void 0),l&&ie({})}finally{D.current.disableFlushSync=!1}}),(0,J.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=D.current;Z(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},removeItem(e){let{controlled:t,instance:n}=D.current;return Z(t,`removeItem`),n==null?(console.error(`CodeView.removeItem: no valid instance to remove item from`,e),!1):n.removeItem(e)},updateItem(e){let{controlled:t,instance:n}=D.current;return Z(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=D.current;return Z(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=D.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=D.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),P(e))},getSelectedLines(){let{instance:e}=D.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=D.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),P(null))},getEditor(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getEditor: no valid instance exists`,e);return}return t.getEditor(e)},getInstance(){return D.current.instance}}),[P]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:V,className:n,style:C}),(te||M||N)&&(0,X.jsx)(Le,{managedContentStore:B,renderCustomHeader:_,renderHeaderPrefix:x,renderHeaderFilenameSuffix:y,renderHeaderMetadata:b,renderAnnotation:p,renderGutterUtility:v,renderCodeViewHeader:g,renderCodeViewFooter:h})]})}var Me=(0,J.forwardRef)(je);function Ne(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Pe(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Z(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function Fe(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!z(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Ie({options:e,hasCustomHeader:t,hasGutterRenderer:n,hasCodeViewHeader:r,hasCodeViewFooter:i,onSelectedLinesChange:a,controlledSelection:o,createEditor:s,onItemEditChange:c,onItemEditComplete:l}){let u={...e,controlledSelection:o,onSelectedLinesChange:a,createEditor:s};return c!=null&&(u.onItemEditChange=c),l!=null&&(u.onItemEditComplete=l),t&&(u.renderCustomHeader=Q),n&&(u.renderGutterUtility=Q),r&&(u.renderCodeViewHeader=Q),i&&(u.renderCodeViewFooter=Q),u}var Le=(0,J.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderCodeViewHeader:s,renderCodeViewFooter:c}){"use no memo";let l=w(t=>e.subscribe(t)),u=w(()=>e.getSnapshot()),d=(0,J.useSyncExternalStore)(l,u,u),f=``;for(let e of d?.items??[])f+=`${e.id}:${e.version}:${e.type}`;return(0,X.jsxs)(X.Fragment,{children:[(0,J.useMemo)(()=>d?.items?.map(e=>(0,Y.createPortal)(Re({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}),e.element,e.id)),[t,n,r,i,a,o,f]),(0,J.useMemo)(()=>s!=null&&d?.header!=null?(0,Y.createPortal)(s(),d.header):null,[s,d?.header]),(0,J.useMemo)(()=>c!=null&&d?.footer!=null?(0,Y.createPortal)(c(),d.footer):null,[c,d?.footer])]})});function Re({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}){if(e.type===`diff`){let{item:s,instance:c}=e;return E({fileDiff:s.fileDiff,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}else{let{item:s,instance:c}=e;return p({file:s.file,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}}function Q(){}function ze(e,t){return e.length>0&&e.every(e=>t.has(e))}function Be(e,t){return ze(e,t)?new Set:new Set(e)}var Ve=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),He={multiple(e){return e?{[Ve.multiple]:``}:null}},Ue=J.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:s,orientation:c=`horizontal`,multiple:f=!1,value:p,className:m,render:h,style:g,..._}=e,v=a(!0),y=J.useMemo(()=>p!==void 0||n!==void 0,[p,n]),b=(v?.disabled??!1)||r,[x,S]=u({controlled:p,default:p===void 0?n??o:void 0,name:`ToggleGroup`,state:`value`}),C=l((e,t,n)=>{let r;f?(r=x.slice(),t?r.push(e):r.splice(x.indexOf(e),1)):r=t?[e]:[],s?.(r,n),!n.isCanceled&&S(r)}),w={disabled:b,multiple:f,orientation:c},T=J.useMemo(()=>({disabled:b,orientation:c,setGroupValue:C,value:x,isValueInitialized:y}),[b,c,C,x,y]),E={role:`group`},D=d(`div`,e,{enabled:!!v,state:w,ref:t,props:[E,_],stateAttributesMapping:He});return(0,X.jsx)(te.Provider,{value:T,children:v?D:(0,X.jsx)(ee,{render:h,className:m,style:g,state:w,refs:[t],props:[E,_],stateAttributesMapping:He,loopFocus:i,enableHomeAndEndKeys:!0,orientation:c})})}),We=i(),$=J.createContext({size:`default`,variant:`default`});function Ge(e){let t=(0,We.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,variant:a,size:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let l=a===void 0?`default`:a,u=o===void 0?`default`:o,d=s===void 0?`horizontal`:s,f;t[7]!==u||t[8]!==l?(f={size:u,variant:l},t[7]=u,t[8]=l,t[9]=f):f=t[9];let p=f,m=d===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=l==="default"?`gap-0.5`:d===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,g;t[10]!==r||t[11]!==m||t[12]!==h?(g=c(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,m,h,r),t[10]=r,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==p?(_=(0,X.jsx)($,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=_):_=t[16];let v;return t[17]!==d||t[18]!==i||t[19]!==u||t[20]!==g||t[21]!==_||t[22]!==l?(v=(0,X.jsx)(Ue,{className:g,"data-size":u,"data-slot":`toggle-group`,"data-variant":l,orientation:d,...i,children:_}),t[17]=d,t[18]=i,t[19]=u,t[20]=g,t[21]=_,t[22]=l,t[23]=v):v=t[23],v}function Ke(e){let t=(0,We.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=J.use($),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,X.jsx)(j,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}export{Me as a,F as c,Be as i,Ge as n,L as o,ze as r,I as s,Ke as t};
|
|
2
|
+
//# sourceMappingURL=toggle-group-DMoKBtD6.js.map
|
package/dist/client/index.html
CHANGED
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
does not flash a stage label the client will not use.
|
|
91
91
|
-->
|
|
92
92
|
<title>P4 Code</title>
|
|
93
|
-
<script type="module" crossorigin src="/assets/index-
|
|
93
|
+
<script type="module" crossorigin src="/assets/index-FfRV_bUK.js"></script>
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/compiler-runtime-CLAvuQ-D.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-CEhsl8MR.js">
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/textarea-
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/collapsible-
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/textarea-B3YbEkbC.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/collapsible-cM_BdURl.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/env-jW24S9HL.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/entities-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/entities-DqtFk7L9.js">
|
|
101
101
|
<link rel="stylesheet" crossorigin href="/assets/index-C02-zlcI.css">
|
|
102
102
|
</head>
|
|
103
103
|
<body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { f as selectLayoutItems, r as computeLayout, u as resolveValue } from "./runtime-
|
|
3
|
+
import { f as selectLayoutItems, r as computeLayout, u as resolveValue } from "./runtime-Dm3kk93X.mjs";
|
|
4
4
|
import Konva from "konva";
|
|
5
5
|
import "konva/skia-backend";
|
|
6
6
|
import { Canvas, FontLibrary, Image } from "skia-canvas";
|
|
@@ -423,4 +423,4 @@ function createRenderer(width, height) {
|
|
|
423
423
|
//#endregion
|
|
424
424
|
export { createRenderer, rasterizeSvg, renderDesignExport, renderDesignPng };
|
|
425
425
|
|
|
426
|
-
//# sourceMappingURL=renderer-
|
|
426
|
+
//# sourceMappingURL=renderer-DjkoXzr6.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { L as DesignNode, j as DesignDocument } from "./src-DmphFADh.mjs";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
6
6
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -981,4 +981,4 @@ function semanticDiff(before, after) {
|
|
|
981
981
|
//#endregion
|
|
982
982
|
export { documentContentDigest as a, parseDesign as c, reviewState as d, selectLayoutItems as f, diagnostic as i, patchNode as l, validateDesign as m, canonicalSerialize as n, fileHash as o, semanticDiff as p, computeLayout as r, isConfinedRelativePath as s, buildIndexes as t, resolveValue as u };
|
|
983
983
|
|
|
984
|
-
//# sourceMappingURL=runtime-
|
|
984
|
+
//# sourceMappingURL=runtime-Dm3kk93X.mjs.map
|
|
@@ -17080,6 +17080,115 @@ RpcGroup.make(
|
|
|
17080
17080
|
})
|
|
17081
17081
|
);
|
|
17082
17082
|
//#endregion
|
|
17083
|
-
export { FeedSourceUpsertInput as $, PreviewAutomationStatus as $a, MODEL_SLUG_ALIASES_BY_PROVIDER as $c, UserInputQuestion as $i, CommandId as $l, P4_PROJECT_FILE_NAME as $n, DEFAULT_COMPRESS_MODE as $o, TaskUpdateInput as $r, ProjectMetaUpdatedPayload as $s, ThreadContextUpdateInput as $t, DesignLibraryManifest as A, PreviewAutomationClientDisconnectedError as Aa, ThreadPullRequestLink as Ac, anyWorktreeRuleEnabled as Ai, HubClientRevokeInput as Al, ThreadAdviseNotPermittedError as An, HubNotificationPreferences as Ao, OpenRouterToolFailedError as Ar, OrchestrationGetSnapshotError as As, AGENT_ASSET_FILE_MAX_CHARS as At, DesignValidateRequest as B, PreviewAutomationPressInput as Ba, ThreadSnoozedPayload as Bc, KeybindingsConfig as Bi, AuthOrchestrationOperateScope as Bl, ThreadRequestResult as Bn, ThreadEvidenceReportActivity as Bo, TaskGetInput as Br, OrchestrationSearchThreadsError as Bs, AssetCompressInput as Bt, DesignApplyReceipt as C, ExternalLauncherBrowserSpawnError as Ca, ThreadPairGateId as Cc, DeviceToolTargetInput as Ci, VcsRepositoryDetectionError as Cl, ThreadSpawnResult as Cn, HUB_TUNNEL_INITIAL_WINDOW_BYTES as Co, ServerSettingsError as Cr, OrchestrationCheckpointSummary as Cs, FilesystemBrowseError as Ct, DesignGuideRequest as D, ExternalLauncherUnsupportedEditorError as Da, ThreadPinReorderedPayload as Dc, DEFAULT_WORKTREE_CLEANUP_SETTINGS as Di, HubClientEnrollmentExchange as Dl, AdviseToolUnavailableError as Dn, HubAgentActivityInput as Do, OpenRouterChatInput as Dr, OrchestrationEventMetadata as Ds, mcpOAuthStorageName as Dt, DesignGuideReceipt as E, ExternalLauncherUnknownEditorError as Ea, ThreadPairTriageAdvancedPayload as Ec, SshDeviceHostConfig as Ei, HubClientAssetGrantInput as El, ThreadWaitResult as En, HubTunnelControl as Eo, OpenRouterApiKeyError as Er, OrchestrationEvent as Es, McpServerRegistration as Et, DesignStatusReceipt as F, PreviewAutomationInvalidSelectorError as Fa, ThreadRuntimeModeSetPayload as Fc, planSettingsSync as Fi, AuthAccessTokenType as Fl, ThreadAskNotPermittedError as Fn, HubAnalyticsQuery as Fo, HubTaskCreateInput as Fr, OrchestrationMessageRole as Fs, AgentAssetListFilter as Ft, FeedCleanupResult as G, PreviewAutomationResizeInput as Ga, ThreadUnsnoozedPayload as Gc, PluginManifest as Gi, EnvironmentAuthorizationError as Gl, TicketResolveError as Gn, ThreadWatchFailedError as Go, TaskNotStartableError as Gr, OrchestrationThreadActivityTone as Gs, MemoryAppendInput as Gt, FeedArticle as H, PreviewAutomationRecordingStatus as Ha, ThreadUnarchivedPayload as Hc, MODEL_PICKER_JUMP_KEYBINDING_COMMANDS as Hi, AuthReviewWriteScope as Hl, TrackerApiKeyError as Hn, ThreadEvidenceReportResult as Ho, TaskListFilter as Hr, OrchestrationSessionStatus as Hs, AssetCompressResult as Ht, DesignStatusRequest as I, PreviewAutomationMalformedResponseError as Ia, ThreadScheduledTaskCancelledPayload as Ic, describeFusionPromptRejection as Ii, AuthAccessWriteScope as Il, ThreadAskResult as In, THREAD_EVIDENCE_REPORT_MAX_CHARS as Io, HubTaskPutInput as Ir, OrchestrationProposedPlanId as Is, AgentAssetName as It, FeedListResult as J, PreviewAutomationScrollInput as Ja, ANTIGRAVITY_DEFAULT_MODEL as Jc, ResourceMonitorCommand as Ji, isChatProject as Jl, ProjectListEntriesError as Jn, ThreadWatchReviewResult as Jo, TaskSourceSelector as Jr, PROVIDER_SEND_TURN_MAX_DOCUMENT_BYTES as Js, ThreadCleanupResult as Jt, FeedEngagement as K, PreviewAutomationResizeResult as Ka, ThreadWorkspaceLifecycle as Kc, DesktopHostTelemetryMessage as Ki, ServerAuthSessionMethod as Kl, TicketResolveInput as Kn, ThreadWatchNotPermittedError as Ko, TaskProposeInput as Kr, OrchestrationThreadPairGate as Ks, MemoryAppendResult as Kt, DesignStylesReceipt as L, PreviewAutomationNavigateInput as La, ThreadScheduledTaskCreatedPayload as Lc, rejectFusionPromptOverride as Li, AuthAdministrativeScopes as Ll, ThreadAskToolError as Ln, THREAD_REVIEW_ITEM_MAX_BYTES as Lo, Task as Lr, OrchestrationReadModel as Ls, AgentAssetWriteInput as Lt, DesignRenderReceipt as M, PreviewAutomationError as Ma, ThreadPullRequestsUpdatedPayload as Mc, SETTINGS_SYNC_FILE_PATH as Mi, HubServerMembership as Ml, ThreadAdviseToolError as Mn, HUB_ANALYTICS_QUERY_LIMITS as Mo, TypeSafeAskInput as Mr, OrchestrationGetTurnDiffResult as Ms, AgentAsset as Mt, DesignRenderRequest as N, PreviewAutomationEvaluateInput as Na, ThreadQueuedMessageRemovedPayload as Nc, SettingsSyncPayload as Ni, AuthAccessReadScope as Nl, ThreadAskFailedError as Nn, HubAnalyticsFactInput as No, TypeSafeAskResult as Nr, OrchestrationGetWorkflowScriptError as Ns, AgentAssetFiles as Nt, DesignInspectReceipt as O, PREVIEW_AUTOMATION_V1_OPERATIONS as Oa, ThreadPinnedPayload as Oc, EMPTY_WORKTREE_CLEANUP_PREVIEW as Oi, HubClientEnrollmentInput as Ol, ThreadAdviseFailedError as On, HubLiveActivityRegistrationInput as Oo, OpenRouterChatResult as Or, OrchestrationEventType as Os, mcpSecretStorageName as Ot, DesignSelection as P, PreviewAutomationExecutionError as Pa, ThreadRevertedPayload as Pc, filterSyncedSettings as Pi, AuthAccessStreamError as Pl, ThreadAskInput as Pn, HubAnalyticsPage as Po, DEFAULT_TASK_SOURCE as Pr, OrchestrationMessage as Ps, AgentAssetKind as Pt, FeedSourceId as Q, PreviewAutomationSnapshotInput as Qa, DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER as Qc, MONITOR_TOOL_TASK_TYPES as Qi, CheckpointRef as Ql, P4ProjectFile as Qn, CompressMode as Qo, TaskToolUnavailableError as Qr, ProjectDeletedPayload as Qs, ThreadContextSummarizer as Qt, DesignStylesRequest as R, PreviewAutomationNoAvailableHostError as Ra, ThreadScheduledTaskFiredPayload as Rc, resolveFusionPromptOverride as Ri, AuthClientMetadataDeviceType as Rl, ThreadGateRespondInput as Rn, THREAD_REVIEW_MAX_BYTES as Ro, TaskCreateInput as Rr, OrchestrationScheduledTaskId as Rs, HubLinkError as Rt, DesignSubscribeRequest as S, EDITORS as Sa, ThreadPairGateAdvancedPayload as Sc, DeviceToolScreenshotResult as Si, VcsProcessTimeoutError as Sl, ThreadSpawnNotPermittedError as Sn, EnvironmentScopeRequiredError as So, ServerSettings as Sr, OrchestrationCheckpointStatus as Ss, AssetWorkspaceRootNormalizationError as St, DesignDocument as T, ExternalLauncherEditorSpawnError as Ta, ThreadPairGateResolvedPayload as Tc, LOCAL_DEVICE_HOST_ID as Ti, HubAccountId as Tl, ThreadWaitInput as Tn, HUB_TUNNEL_WEBSOCKET_PROTOCOL as To, DEFAULT_OPENROUTER_DECISIONS_MODEL as Tr, OrchestrationDispatchCommandError as Ts, McpServerName as Tt, FeedArticleId as U, PreviewAutomationRemoteUnavailableError as Ua, ThreadUnpinnedPayload as Uc, ResolvedKeybindingRule as Ui, AuthStandardClientScopes as Ul, TicketCommentInput as Un, ThreadWatchEventsInput as Uo, TaskNotFoundError as Ur, OrchestrationShellSnapshot as Us, AssetCompressValidationFailedError as Ut, FEED_CATEGORIES as V, PreviewAutomationRecordingArtifact as Va, ThreadTurnDiffCompletedPayload as Vc, KeybindingsConfigError as Vi, AuthOrchestrationReadScope as Vl, SupervisorApiKeyError as Vn, ThreadEvidenceReportInput as Vo, TaskLabel as Vr, OrchestrationSession as Vs, AssetCompressRefusedError as Vt, FeedCleanupInput as W, PreviewAutomationRequestQueueClosedError as Wa, ThreadUnpromptedSubagentsSetPayload as Wc, THREAD_JUMP_KEYBINDING_COMMANDS as Wi, AuthTerminalOperateScope as Wl, TicketCommentResult as Wn, ThreadWatchEventsResult as Wo, TaskNotLinkedError as Wr, OrchestrationThread as Ws, MemoryAppendFailedError as Wt, FeedRefreshResult as X, PreviewAutomationSetColorSchemeResult as Xa, DEFAULT_MODEL_BY_PROVIDER as Xc, INERT_TASK_TYPES as Xi, ApprovalRequestId as Xl, ProjectSearchEntriesError as Xn, WatchToolUnavailableError as Xo, TaskStoreError as Xr, PROVIDER_SEND_TURN_MAX_INPUT_CHARS as Xs, ThreadConfigureResult as Xt, FeedMarkReadInput as Y, PreviewAutomationSetColorSchemeInput as Ya, DEFAULT_MODEL as Yc, ResourceMonitorEvent as Yi, AgentAssetId as Yl, ProjectReadFileError as Yn, ThreadWatchToolError as Yo, TaskStatus as Yr, PROVIDER_SEND_TURN_MAX_IMAGE_BYTES as Ys, ThreadConfigureInput as Yt, FeedSource as Z, PreviewAutomationSnapshot as Za, DEFAULT_TEXT_GENERATION_MODEL as Zc, MONITOR_TASK_TYPES as Zi, AuthSessionId as Zl, ProjectWriteFileError as Zn, ChatAttachment as Zo, TaskToolError as Zr, ProjectCreatedPayload as Zs, ThreadContextReadResult as Zt, UserInputRankingError as _, TerminalNotRunningError as _a, ThreadMessageSentPayload as _c, DeviceToolCloseInput as _i, VcsProcessMissingExitCodeError as _l, ThreadRenameRejectedError as _n, EnvironmentHttpCommonError as _o, DEFAULT_SERVER_SETTINGS as _r, ModelSelection as _s, AssetWorkspaceAssetNotFoundError as _t, ComputerUseDeviceRequest as a, UsageLimitSourceId as aa, ProviderSessionRuntimeStatus as ac, DeviceColorFilter as ai, isProviderDriverKind as al, ThreadMergeChildResult as an, PreviewAutomationUnavailableError as ao, ServerProcessResourceHistoryFailureTag as ar, FUSION_GATE_DEFAULT_TIMEOUT_MS as as, parentThreadIdFromSidechat as at, PortSchema as au, DesignRpcGroup as b, TerminalWriteError as ba, ThreadPairCursorAdvancedPayload as bc, DeviceToolOpenInput as bi, VcsProcessSpawnError as bl, ThreadSnoozeResult as bn, EnvironmentRequestInvalidError as bo, OpenCodeSettings as br, OrchestrationAggregateKind as bs, AssetWorkspacePathValidationError as bt, ComputerUseHostRegistration as c, ProviderRespondToUserInputInput as ca, ThreadActivityAppendedPayload as cc, DeviceHostId as ci, PullRequestUnavailableError as cl, ThreadPairCreateInput as cn, FILL_PREVIEW_VIEWPORT as co, ServerSelfUpdateError as cr, FUSION_GATE_UNWATCHED_SUMMARY as cs, AssetLocalFileNotFoundError as ct, ProviderItemId as cu, ComputerUseJsInput as d, ProviderStopSessionInput as da, ThreadCompressModeSetPayload as dc, DeviceListInput as di, resolvePullRequestAuthorFilter as dl, ThreadPairDetachResult as dn, PreviewTabId as do, ClaudeSettings as dr, FUSION_RETRY_PROMPT_PREFIX as ds, AssetPreviewTypeValidationError as dt, RuntimeTaskId as du, WorkflowScriptProvenance as ea, ProjectScript as ec, UNKNOWN_TASK_STATUS_FALLBACK as ei, ModelCapabilities as el, ThreadContextUpdateResult as en, PreviewAutomationTabNotFoundError as eo, GitCommandError as er, DEFAULT_PROVIDER_INTERACTION_MODE as es, FeedSummary as et, EnvironmentId as eu, ComputerUseOutput as f, DEFAULT_TERMINAL_ID as fa, ThreadComputerUseGrantSetPayload as fc, DeviceNotFoundError as fi, SourceControlProviderError as fl, ThreadPlanReadInput as fn, DesktopBackendBootstrap as fo, CodexSettings as fr, FUSION_REVIEW_MESSAGE_ID_PREFIX as fs, AssetProjectFaviconInspectionError as ft, TaskId as fu, ProviderSetupError as g, TerminalHistoryError as ga, ThreadMessageQueuedPayload as gc, DeviceSessionDetailInput as gi, VcsProcessExitError as gl, ThreadRenameInput as gn, EnvironmentHttpApi as go, DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL as gr, JEV_CONSULTED_ACTIVITY_KIND as gs, AssetWorkspaceAssetInspectionError as gt, TurnId as gu, DeviceCommandResult as h, TerminalCwdStatError as ha, ThreadInteractionModeSetPayload as hc, DevicePlatformUnavailableError as hi, VcsDriverKind as hl, ThreadPlanUpdateResult as hn, EnvironmentAuthenticatedPrincipal as ho, DEFAULT_JEV_ROLE_ROUTING_MIN_CONFIDENCE as hr, FusionReviewPolicy as hs, AssetSigningKeyLoadError as ht, TrimmedNonEmptyString as hu, COMPUTER_USE_MAX_OUTPUT_CHARS as i, UsageLimitSourceError as ia, ProviderInteractionMode as ic, DeviceBootError as ii, defaultInstanceIdForDriver as il, ThreadMergeChildInput as in, PreviewAutomationTypeInput as io, ServerLocalCliUpdateError as ir, FUSION_EVIDENCE_REPORT_REPAIR_MESSAGE_ID_PREFIX as is, isSidechatThreadId as it, NonNegativeInt as iu, DesignNode as j, PreviewAutomationControlInterruptedError as ja, ThreadPullRequestStack as jc, SETTINGS_SYNC_ASSET_NAME as ji, HubClientSocketTicketInput as jl, ThreadAdviseResult as jn, HubPushRegistrationInput as jo, TypeSafeAskFailedError as jr, OrchestrationGetTurnDiffError as js, AGENT_ASSET_TOTAL_MAX_BYTES as jt, DesignInspectRequest as k, PreviewAutomationClickInput as ka, ThreadProposedPlanUpsertedPayload as kc, WORKTREE_CLEANUP_RULES as ki, HubClientId as kl, ThreadAdviseInput as kn, HubLiveActivityRemoveInput as ko, OpenRouterDecideInput as kr, OrchestrationGetFullThreadDiffError as ks, mcpUserScopeSessionName as kt, ComputerUseHostReport as l, ProviderSendTurnInput as la, ThreadArchivedPayload as lc, DeviceHostUnavailableError as li, pullRequestHostOf as ll, ThreadPairCreateResult as ln, PreviewInvalidUrlError as lo, isProviderAvailable as lr, FUSION_JEV_PROMPT_PREFIX as ls, AssetLocalPathValidationError as lt, RuntimeItemId as lu, DeviceCommandInput as m, TerminalCwdNotFoundError as ma, ThreadDeletedPayload as mc, DevicePlatformAvailability as mi, SourceControlRepositoryError as ml, ThreadPlanUpdateInput as mn, EnvironmentAuthenticatedAuth as mo, DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL as mr, FusionReviewExperiment as ms, AssetProjectFaviconResolutionError as mt, ThreadPairId as mu, WsRpcGroup as n, ProviderResetCreditError as na, ProjectionPendingApprovalStatus as nc, DeviceActionInput as ni, ProviderDriverKind as nl, ThreadControlRejectedError as nn, PreviewAutomationTargetNotEditableError as no, GitPullRequestMaterializationError as nr, FUSION_ACTIVATION_PROMPT_PREFIX as ns, BtwAskError as nt, IsoDateTime as nu, ComputerUseEnrollmentRequest as o, ProviderInterruptTurnInput as oa, ProviderUserInputAnswers as oc, DeviceDetail as oi, PullRequestOperationError as ol, ThreadMessageInput as on, PreviewAutomationUnsupportedClientError as oo, ServerProvider as or, FUSION_GATE_MESSAGE_ID_PREFIX as os, AssetAttachmentNotFoundError as ot, PositiveInt as ou, ComputerUseSourceAttestation as p, TerminalCwdNotDirectoryError as pa, ThreadCreatedPayload as pc, DeviceOperationError as pi, SourceControlProviderKind as pl, ThreadPlanReadResult as pn, EnvironmentAuthInvalidError as po, CursorSettings as pr, FUSION_REVIEW_PROMPT_PREFIX as ps, AssetProjectFaviconNotFoundError as pt, ThreadId as pu, FeedError as q, PreviewAutomationResultTooLargeError as qa, orchestrationThreadNotFoundMessage as qc, DesktopTelemetryControlMessage as qi, P4_CHAT_PROJECT_ID as ql, TicketResolveResult as qn, ThreadWatchReviewInput as qo, TaskProposeResult as qr, OrchestrationThreadSearchSource as qs, ThreadCleanupInput as qt, COMPUTER_USE_DEFAULT_TIMEOUT_MS as r, ProviderResetCreditOutcome as ra, ProviderApprovalDecision as rc, DeviceActionUnavailableError as ri, ProviderInstanceId as rl, ThreadControlToolError as rn, PreviewAutomationTimeoutError as ro, TextGenerationError as rr, FUSION_ADVICE_PROMPT_PREFIX as rs, SIDECHAT_THREAD_ID_PREFIX as rt, MessageId as ru, ComputerUseError as s, ProviderRespondToRequestInput as sa, RuntimeMode as sc, DeviceDetailInput as si, PullRequestStack as sl, ThreadMessageResult as sn, PreviewAutomationWaitForInput as so, ServerProviderUpdateError as sr, FUSION_GATE_PROMPT_PREFIX as ss, AssetLocalFileInspectionError as st, ProjectId as su, WS_METHODS as t, isToolLifecycleItemType as ta, ProjectionPendingApprovalDecision as tc, isReadableTaskId as ti, PREFERRED_DEFAULT_CODEX_MODELS as tl, ThreadControlNotPermittedError as tn, PreviewAutomationTabTargetInput as to, GitManagerError as tr, DEFAULT_RUNTIME_MODE as ts, UsageReadError as tt, EventId as tu, ComputerUseHostResponse as u, ProviderSessionStartInput as ua, ThreadCompletionFields as uc, DeviceId as ui, pullRequestProviderRequirement as ul, ThreadPairDetachInput as un, PreviewSessionLookupError as uo, AntigravitySettings as ur, FUSION_NO_OBJECTION_TEXT as us, AssetMdxBuildError as ut, RuntimeRequestId as uu, DesignAssetRequest as v, TerminalResizeError as va, ThreadMetaUpdatedPayload as vc, DeviceToolError as vi, VcsProcessOutputLimitError as vl, ThreadRenameResult as vn, EnvironmentInternalError as vo, GrokSettings as vr, ORCHESTRATION_WS_METHODS as vs, AssetWorkspaceContextNotFoundError as vt, DesignApplyRequest as w, ExternalLauncherCommandNotFoundError as wa, ThreadPairGateOpenedPayload as wc, DeviceToolUnavailableError as wi, VcsUnsupportedOperationError as wl, ThreadToolUnavailableError as wn, HUB_TUNNEL_MAX_WINDOW_BYTES as wo, clampProviderHealthRefreshSeconds as wr, OrchestrationCommandReceiptStatus as ws, McpRegistryError as wt, DesignServiceError as x, DesktopPreviewScreenshotArtifactSchema as xa, ThreadPairDetachedPayload as xc, DeviceToolOpenResult as xi, VcsProcessStdinWriteError as xl, ThreadSpawnInput as xn, EnvironmentResourceNotFoundError as xo, STORAGE_CLEANUP_TARGETS as xr, OrchestrationCheckpointFile as xs, AssetWorkspaceResolutionError as xt, DesignHumanApplyRequest as y, TerminalSessionLookupError as ya, ThreadPairCreatedPayload as yc, DeviceToolListResult as yi, VcsProcessOutputReadError as yl, ThreadSnoozeInput as yn, EnvironmentOperationForbiddenError as yo, MuseSettings as yr, OrchestrationActorKind as ys, AssetWorkspaceContextResolutionError as yt, DesignValidateReceipt as z, PreviewAutomationOpenInput as za, ThreadSessionSetPayload as zc, KeybindingRule as zi, AuthEnvironmentScopes as zl, ThreadGateRespondResult as zn, THREAD_REVIEW_SCAN_LIMIT as zo, TaskCurrentInput as zr, OrchestrationScheduledTaskStatus as zs, agentAssetTotalBytes as zt };
|
|
17083
|
+
//#region ../../packages/contracts/src/selfImprove.ts
|
|
17084
|
+
const SelfImproveMode = Schema$1.Literals(["off", "shadow"]);
|
|
17085
|
+
const SelfImproveJudgment = Schema$1.Literals([
|
|
17086
|
+
"review",
|
|
17087
|
+
"skip",
|
|
17088
|
+
"uncertain"
|
|
17089
|
+
]);
|
|
17090
|
+
const Money = Schema$1.Number.check(Schema$1.isFinite(), Schema$1.isGreaterThanOrEqualTo(0));
|
|
17091
|
+
const Note = Schema$1.String.check(Schema$1.isMaxLength(1e3));
|
|
17092
|
+
const SelfImproveEvidence = Schema$1.Struct({
|
|
17093
|
+
state: Schema$1.String,
|
|
17094
|
+
request: Schema$1.String,
|
|
17095
|
+
response: Schema$1.String,
|
|
17096
|
+
activities: Schema$1.Array(Schema$1.Struct({
|
|
17097
|
+
kind: Schema$1.String,
|
|
17098
|
+
summary: Schema$1.String,
|
|
17099
|
+
status: Schema$1.NullOr(Schema$1.String),
|
|
17100
|
+
detail: Schema$1.NullOr(Schema$1.String)
|
|
17101
|
+
})),
|
|
17102
|
+
reviewerGenerated: Schema$1.Boolean
|
|
17103
|
+
});
|
|
17104
|
+
const SelfImproveDecision = Schema$1.Struct({
|
|
17105
|
+
id: TrimmedNonEmptyString,
|
|
17106
|
+
sequence: NonNegativeInt,
|
|
17107
|
+
threadId: ThreadId,
|
|
17108
|
+
turnId: Schema$1.NullOr(Schema$1.String),
|
|
17109
|
+
evidenceHash: Schema$1.String,
|
|
17110
|
+
evidence: SelfImproveEvidence,
|
|
17111
|
+
policyVersion: Schema$1.String,
|
|
17112
|
+
decision: SelfImproveJudgment,
|
|
17113
|
+
source: Schema$1.Literals(["code", "jev"]),
|
|
17114
|
+
reason: Schema$1.String,
|
|
17115
|
+
model: Schema$1.NullOr(Schema$1.String),
|
|
17116
|
+
confidence: Schema$1.NullOr(Schema$1.Number),
|
|
17117
|
+
inputTokens: Schema$1.NullOr(NonNegativeInt),
|
|
17118
|
+
inputCostPerMillionUsd: Schema$1.NullOr(Money),
|
|
17119
|
+
costUsd: Schema$1.NullOr(Money),
|
|
17120
|
+
latencyMs: NonNegativeInt,
|
|
17121
|
+
createdAt: IsoDateTime
|
|
17122
|
+
});
|
|
17123
|
+
const SelfImproveLabel = Schema$1.Struct({
|
|
17124
|
+
decisionId: TrimmedNonEmptyString,
|
|
17125
|
+
expected: Schema$1.Literals(["review", "skip"]),
|
|
17126
|
+
failureKey: Schema$1.NullOr(TrimmedNonEmptyString.check(Schema$1.isMaxLength(120))),
|
|
17127
|
+
note: Note
|
|
17128
|
+
});
|
|
17129
|
+
const SelfImproveOutcome = Schema$1.Struct({
|
|
17130
|
+
taskKey: TrimmedNonEmptyString.check(Schema$1.isMaxLength(200)),
|
|
17131
|
+
decisionIds: Schema$1.Array(TrimmedNonEmptyString).check(Schema$1.isMinLength(1), Schema$1.isMaxLength(100)),
|
|
17132
|
+
acceptedCompleted: Schema$1.Boolean,
|
|
17133
|
+
/** Human-supplied total including implementation, review, decision and retry costs. */
|
|
17134
|
+
totalCostUsd: Schema$1.NullOr(Money)
|
|
17135
|
+
});
|
|
17136
|
+
const SelfImproveRequest = Schema$1.Union([
|
|
17137
|
+
Schema$1.Struct({ action: Schema$1.Literal("status") }),
|
|
17138
|
+
Schema$1.Struct({
|
|
17139
|
+
action: Schema$1.Literal("configure"),
|
|
17140
|
+
mode: SelfImproveMode,
|
|
17141
|
+
inputCostPerMillionUsd: Schema$1.optionalKey(Schema$1.NullOr(Money))
|
|
17142
|
+
}),
|
|
17143
|
+
Schema$1.Struct({
|
|
17144
|
+
action: Schema$1.Literal("list"),
|
|
17145
|
+
beforeSequence: Schema$1.optionalKey(NonNegativeInt),
|
|
17146
|
+
limit: Schema$1.optionalKey(Schema$1.Int.check(Schema$1.isBetween({
|
|
17147
|
+
minimum: 1,
|
|
17148
|
+
maximum: 100
|
|
17149
|
+
}))),
|
|
17150
|
+
decision: Schema$1.optionalKey(SelfImproveJudgment)
|
|
17151
|
+
}),
|
|
17152
|
+
Schema$1.Struct({
|
|
17153
|
+
action: Schema$1.Literal("label"),
|
|
17154
|
+
label: SelfImproveLabel
|
|
17155
|
+
}),
|
|
17156
|
+
Schema$1.Struct({
|
|
17157
|
+
action: Schema$1.Literal("outcome"),
|
|
17158
|
+
outcome: SelfImproveOutcome
|
|
17159
|
+
})
|
|
17160
|
+
]);
|
|
17161
|
+
const SelfImproveMetrics = Schema$1.Struct({
|
|
17162
|
+
decisions: NonNegativeInt,
|
|
17163
|
+
labeled: NonNegativeInt,
|
|
17164
|
+
falseAccepts: NonNegativeInt,
|
|
17165
|
+
falseRejects: NonNegativeInt,
|
|
17166
|
+
uncertain: NonNegativeInt,
|
|
17167
|
+
recurringFailures: Schema$1.Array(Schema$1.Struct({
|
|
17168
|
+
key: Schema$1.String,
|
|
17169
|
+
occurrences: NonNegativeInt
|
|
17170
|
+
})),
|
|
17171
|
+
tasks: NonNegativeInt,
|
|
17172
|
+
acceptedCompletedTasks: NonNegativeInt,
|
|
17173
|
+
knownTaskCostUsd: Money,
|
|
17174
|
+
unknownTaskCosts: NonNegativeInt,
|
|
17175
|
+
unassignedDecisions: NonNegativeInt,
|
|
17176
|
+
costPerAcceptedCompletedTaskUsd: Schema$1.NullOr(Money),
|
|
17177
|
+
knownDecisionCostUsd: Money,
|
|
17178
|
+
unknownDecisionCosts: NonNegativeInt
|
|
17179
|
+
});
|
|
17180
|
+
const SelfImproveResult = Schema$1.Struct({
|
|
17181
|
+
mode: SelfImproveMode,
|
|
17182
|
+
inputCostPerMillionUsd: Schema$1.NullOr(Money),
|
|
17183
|
+
metrics: SelfImproveMetrics,
|
|
17184
|
+
decisions: Schema$1.Array(Schema$1.Struct({
|
|
17185
|
+
...SelfImproveDecision.fields,
|
|
17186
|
+
label: Schema$1.NullOr(SelfImproveLabel),
|
|
17187
|
+
taskKey: Schema$1.NullOr(Schema$1.String)
|
|
17188
|
+
}))
|
|
17189
|
+
});
|
|
17190
|
+
var SelfImproveError = class extends Schema$1.TaggedErrorClass()("SelfImproveError", { message: Schema$1.String }) {};
|
|
17191
|
+
//#endregion
|
|
17192
|
+
export { FeedError as $, PreviewAutomationResultTooLargeError as $a, ThreadWorkspaceLifecycle as $c, DesktopTelemetryControlMessage as $i, ServerAuthSessionMethod as $l, TicketResolveResult as $n, ThreadWatchReviewInput as $o, TaskProposeResult as $r, OrchestrationThreadSearchSource as $s, ThreadCleanupInput as $t, DesignApplyRequest as A, ExternalLauncherCommandNotFoundError as Aa, ThreadPairGateOpenedPayload as Ac, DeviceToolUnavailableError as Ai, VcsRepositoryDetectionError as Al, ThreadToolUnavailableError as An, HUB_TUNNEL_MAX_WINDOW_BYTES as Ao, clampProviderHealthRefreshSeconds as Ar, OrchestrationCommandReceiptStatus as As, McpRegistryError as At, DesignSelection as B, PreviewAutomationExecutionError as Ba, ThreadRevertedPayload as Bc, filterSyncedSettings as Bi, AuthAccessReadScope as Bl, ThreadAskInput as Bn, HubAnalyticsPage as Bo, DEFAULT_TASK_SOURCE as Br, OrchestrationMessage as Bs, AgentAssetKind as Bt, UserInputRankingError as C, TerminalNotRunningError as Ca, ThreadMessageSentPayload as Cc, DeviceToolCloseInput as Ci, VcsProcessExitError as Cl, ThreadRenameRejectedError as Cn, EnvironmentHttpCommonError as Co, DEFAULT_SERVER_SETTINGS as Cr, ModelSelection as Cs, AssetWorkspaceAssetNotFoundError as Ct, TurnId as Cu, DesignServiceError as D, DesktopPreviewScreenshotArtifactSchema as Da, ThreadPairDetachedPayload as Dc, DeviceToolOpenResult as Di, VcsProcessSpawnError as Dl, ThreadSpawnInput as Dn, EnvironmentResourceNotFoundError as Do, STORAGE_CLEANUP_TARGETS as Dr, OrchestrationCheckpointFile as Ds, AssetWorkspaceResolutionError as Dt, DesignRpcGroup as E, TerminalWriteError as Ea, ThreadPairCursorAdvancedPayload as Ec, DeviceToolOpenInput as Ei, VcsProcessOutputReadError as El, ThreadSnoozeResult as En, EnvironmentRequestInvalidError as Eo, OpenCodeSettings as Er, OrchestrationAggregateKind as Es, AssetWorkspacePathValidationError as Et, DesignInspectRequest as F, PreviewAutomationClickInput as Fa, ThreadProposedPlanUpsertedPayload as Fc, WORKTREE_CLEANUP_RULES as Fi, HubClientEnrollmentInput as Fl, ThreadAdviseInput as Fn, HubLiveActivityRemoveInput as Fo, OpenRouterDecideInput as Fr, OrchestrationGetFullThreadDiffError as Fs, mcpUserScopeSessionName as Ft, DesignValidateReceipt as G, PreviewAutomationOpenInput as Ga, ThreadSessionSetPayload as Gc, KeybindingRule as Gi, AuthClientMetadataDeviceType as Gl, ThreadGateRespondResult as Gn, THREAD_REVIEW_SCAN_LIMIT as Go, TaskCurrentInput as Gr, OrchestrationScheduledTaskStatus as Gs, agentAssetTotalBytes as Gt, DesignStatusRequest as H, PreviewAutomationMalformedResponseError as Ha, ThreadScheduledTaskCancelledPayload as Hc, describeFusionPromptRejection as Hi, AuthAccessTokenType as Hl, ThreadAskResult as Hn, THREAD_EVIDENCE_REPORT_MAX_CHARS as Ho, HubTaskPutInput as Hr, OrchestrationProposedPlanId as Hs, AgentAssetName as Ht, DesignLibraryManifest as I, PreviewAutomationClientDisconnectedError as Ia, ThreadPullRequestLink as Ic, anyWorktreeRuleEnabled as Ii, HubClientId as Il, ThreadAdviseNotPermittedError as In, HubNotificationPreferences as Io, OpenRouterToolFailedError as Ir, OrchestrationGetSnapshotError as Is, AGENT_ASSET_FILE_MAX_CHARS as It, FeedArticle as J, PreviewAutomationRecordingStatus as Ja, ThreadTurnDiffCompletedPayload as Jc, MODEL_PICKER_JUMP_KEYBINDING_COMMANDS as Ji, AuthOrchestrationReadScope as Jl, TrackerApiKeyError as Jn, ThreadEvidenceReportResult as Jo, TaskListFilter as Jr, OrchestrationSessionStatus as Js, AssetCompressResult as Jt, DesignValidateRequest as K, PreviewAutomationPressInput as Ka, ThreadSnoozedPayload as Kc, KeybindingsConfig as Ki, AuthEnvironmentScopes as Kl, ThreadRequestResult as Kn, ThreadEvidenceReportActivity as Ko, TaskGetInput as Kr, OrchestrationSearchThreadsError as Ks, AssetCompressInput as Kt, DesignNode as L, PreviewAutomationControlInterruptedError as La, ThreadPullRequestStack as Lc, SETTINGS_SYNC_ASSET_NAME as Li, HubClientRevokeInput as Ll, ThreadAdviseResult as Ln, HubPushRegistrationInput as Lo, TypeSafeAskFailedError as Lr, OrchestrationGetTurnDiffError as Ls, AGENT_ASSET_TOTAL_MAX_BYTES as Lt, DesignGuideReceipt as M, ExternalLauncherUnknownEditorError as Ma, ThreadPairTriageAdvancedPayload as Mc, SshDeviceHostConfig as Mi, HubAccountId as Ml, ThreadWaitResult as Mn, HubTunnelControl as Mo, OpenRouterApiKeyError as Mr, OrchestrationEvent as Ms, McpServerRegistration as Mt, DesignGuideRequest as N, ExternalLauncherUnsupportedEditorError as Na, ThreadPinReorderedPayload as Nc, DEFAULT_WORKTREE_CLEANUP_SETTINGS as Ni, HubClientAssetGrantInput as Nl, AdviseToolUnavailableError as Nn, HubAgentActivityInput as No, OpenRouterChatInput as Nr, OrchestrationEventMetadata as Ns, mcpOAuthStorageName as Nt, DesignSubscribeRequest as O, EDITORS as Oa, ThreadPairGateAdvancedPayload as Oc, DeviceToolScreenshotResult as Oi, VcsProcessStdinWriteError as Ol, ThreadSpawnNotPermittedError as On, EnvironmentScopeRequiredError as Oo, ServerSettings as Or, OrchestrationCheckpointStatus as Os, AssetWorkspaceRootNormalizationError as Ot, DesignInspectReceipt as P, PREVIEW_AUTOMATION_V1_OPERATIONS as Pa, ThreadPinnedPayload as Pc, EMPTY_WORKTREE_CLEANUP_PREVIEW as Pi, HubClientEnrollmentExchange as Pl, ThreadAdviseFailedError as Pn, HubLiveActivityRegistrationInput as Po, OpenRouterChatResult as Pr, OrchestrationEventType as Ps, mcpSecretStorageName as Pt, FeedEngagement as Q, PreviewAutomationResizeResult as Qa, ThreadUnsnoozedPayload as Qc, DesktopHostTelemetryMessage as Qi, EnvironmentAuthorizationError as Ql, TicketResolveInput as Qn, ThreadWatchNotPermittedError as Qo, TaskProposeInput as Qr, OrchestrationThreadPairGate as Qs, MemoryAppendResult as Qt, DesignRenderReceipt as R, PreviewAutomationError as Ra, ThreadPullRequestsUpdatedPayload as Rc, SETTINGS_SYNC_FILE_PATH as Ri, HubClientSocketTicketInput as Rl, ThreadAdviseToolError as Rn, HUB_ANALYTICS_QUERY_LIMITS as Ro, TypeSafeAskInput as Rr, OrchestrationGetTurnDiffResult as Rs, AgentAsset as Rt, ProviderSetupError as S, TerminalHistoryError as Sa, ThreadMessageQueuedPayload as Sc, DeviceSessionDetailInput as Si, VcsDriverKind as Sl, ThreadRenameInput as Sn, EnvironmentHttpApi as So, DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL as Sr, JEV_CONSULTED_ACTIVITY_KIND as Ss, AssetWorkspaceAssetInspectionError as St, TrimmedNonEmptyString as Su, DesignHumanApplyRequest as T, TerminalSessionLookupError as Ta, ThreadPairCreatedPayload as Tc, DeviceToolListResult as Ti, VcsProcessOutputLimitError as Tl, ThreadSnoozeInput as Tn, EnvironmentOperationForbiddenError as To, MuseSettings as Tr, OrchestrationActorKind as Ts, AssetWorkspaceContextResolutionError as Tt, DesignStylesReceipt as U, PreviewAutomationNavigateInput as Ua, ThreadScheduledTaskCreatedPayload as Uc, rejectFusionPromptOverride as Ui, AuthAccessWriteScope as Ul, ThreadAskToolError as Un, THREAD_REVIEW_ITEM_MAX_BYTES as Uo, Task as Ur, OrchestrationReadModel as Us, AgentAssetWriteInput as Ut, DesignStatusReceipt as V, PreviewAutomationInvalidSelectorError as Va, ThreadRuntimeModeSetPayload as Vc, planSettingsSync as Vi, AuthAccessStreamError as Vl, ThreadAskNotPermittedError as Vn, HubAnalyticsQuery as Vo, HubTaskCreateInput as Vr, OrchestrationMessageRole as Vs, AgentAssetListFilter as Vt, DesignStylesRequest as W, PreviewAutomationNoAvailableHostError as Wa, ThreadScheduledTaskFiredPayload as Wc, resolveFusionPromptOverride as Wi, AuthAdministrativeScopes as Wl, ThreadGateRespondInput as Wn, THREAD_REVIEW_MAX_BYTES as Wo, TaskCreateInput as Wr, OrchestrationScheduledTaskId as Ws, HubLinkError as Wt, FeedCleanupInput as X, PreviewAutomationRequestQueueClosedError as Xa, ThreadUnpinnedPayload as Xc, THREAD_JUMP_KEYBINDING_COMMANDS as Xi, AuthStandardClientScopes as Xl, TicketCommentResult as Xn, ThreadWatchEventsResult as Xo, TaskNotLinkedError as Xr, OrchestrationThread as Xs, MemoryAppendFailedError as Xt, FeedArticleId as Y, PreviewAutomationRemoteUnavailableError as Ya, ThreadUnarchivedPayload as Yc, ResolvedKeybindingRule as Yi, AuthReviewWriteScope as Yl, TicketCommentInput as Yn, ThreadWatchEventsInput as Yo, TaskNotFoundError as Yr, OrchestrationShellSnapshot as Ys, AssetCompressValidationFailedError as Yt, FeedCleanupResult as Z, PreviewAutomationResizeInput as Za, ThreadUnpromptedSubagentsSetPayload as Zc, PluginManifest as Zi, AuthTerminalOperateScope as Zl, TicketResolveError as Zn, ThreadWatchFailedError as Zo, TaskNotStartableError as Zr, OrchestrationThreadActivityTone as Zs, MemoryAppendInput as Zt, ComputerUseJsInput as _, ProviderStopSessionInput as _a, ThreadCompressModeSetPayload as _c, DeviceListInput as _i, pullRequestProviderRequirement as _l, ThreadPairDetachResult as _n, PreviewTabId as _o, ClaudeSettings as _r, FUSION_RETRY_PROMPT_PREFIX as _s, AssetPreviewTypeValidationError as _t, RuntimeRequestId as _u, SelfImproveRequest as a, UserInputQuestion as aa, ProjectMetaUpdatedPayload as ac, TaskUpdateInput as ai, DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER as al, ThreadContextUpdateInput as an, PreviewAutomationStatus as ao, P4_PROJECT_FILE_NAME as ar, DEFAULT_COMPRESS_MODE as as, FeedSourceUpsertInput as at, CheckpointRef as au, DeviceCommandInput as b, TerminalCwdNotFoundError as ba, ThreadDeletedPayload as bc, DevicePlatformAvailability as bi, SourceControlProviderKind as bl, ThreadPlanUpdateInput as bn, EnvironmentAuthenticatedAuth as bo, DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL as br, FusionReviewExperiment as bs, AssetProjectFaviconResolutionError as bt, ThreadId as bu, WsRpcGroup as c, ProviderResetCreditError as ca, ProjectionPendingApprovalStatus as cc, DeviceActionInput as ci, PREFERRED_DEFAULT_CODEX_MODELS as cl, ThreadControlRejectedError as cn, PreviewAutomationTargetNotEditableError as co, GitPullRequestMaterializationError as cr, FUSION_ACTIVATION_PROMPT_PREFIX as cs, BtwAskError as ct, EventId as cu, ComputerUseDeviceRequest as d, UsageLimitSourceId as da, ProviderSessionRuntimeStatus as dc, DeviceColorFilter as di, defaultInstanceIdForDriver as dl, ThreadMergeChildResult as dn, PreviewAutomationUnavailableError as do, ServerProcessResourceHistoryFailureTag as dr, FUSION_GATE_DEFAULT_TIMEOUT_MS as ds, parentThreadIdFromSidechat as dt, NonNegativeInt as du, ResourceMonitorCommand as ea, PROVIDER_SEND_TURN_MAX_DOCUMENT_BYTES as ec, TaskSourceSelector as ei, orchestrationThreadNotFoundMessage as el, ThreadCleanupResult as en, PreviewAutomationScrollInput as eo, ProjectListEntriesError as er, ThreadWatchReviewResult as es, FeedListResult as et, P4_CHAT_PROJECT_ID as eu, ComputerUseEnrollmentRequest as f, ProviderInterruptTurnInput as fa, ProviderUserInputAnswers as fc, DeviceDetail as fi, isProviderDriverKind as fl, ThreadMessageInput as fn, PreviewAutomationUnsupportedClientError as fo, ServerProvider as fr, FUSION_GATE_MESSAGE_ID_PREFIX as fs, AssetAttachmentNotFoundError as ft, PortSchema as fu, ComputerUseHostResponse as g, ProviderSessionStartInput as ga, ThreadCompletionFields as gc, DeviceId as gi, pullRequestHostOf as gl, ThreadPairDetachInput as gn, PreviewSessionLookupError as go, AntigravitySettings as gr, FUSION_NO_OBJECTION_TEXT as gs, AssetMdxBuildError as gt, RuntimeItemId as gu, ComputerUseHostReport as h, ProviderSendTurnInput as ha, ThreadArchivedPayload as hc, DeviceHostUnavailableError as hi, PullRequestUnavailableError as hl, ThreadPairCreateResult as hn, PreviewInvalidUrlError as ho, isProviderAvailable as hr, FUSION_JEV_PROMPT_PREFIX as hs, AssetLocalPathValidationError as ht, ProviderItemId as hu, SelfImproveLabel as i, MONITOR_TOOL_TASK_TYPES as ia, ProjectDeletedPayload as ic, TaskToolUnavailableError as ii, DEFAULT_TEXT_GENERATION_MODEL as il, ThreadContextSummarizer as in, PreviewAutomationSnapshotInput as io, P4ProjectFile as ir, CompressMode as is, FeedSourceId as it, AuthSessionId as iu, DesignDocument as j, ExternalLauncherEditorSpawnError as ja, ThreadPairGateResolvedPayload as jc, LOCAL_DEVICE_HOST_ID as ji, VcsUnsupportedOperationError as jl, ThreadWaitInput as jn, HUB_TUNNEL_WEBSOCKET_PROTOCOL as jo, DEFAULT_OPENROUTER_DECISIONS_MODEL as jr, OrchestrationDispatchCommandError as js, McpServerName as jt, DesignApplyReceipt as k, ExternalLauncherBrowserSpawnError as ka, ThreadPairGateId as kc, DeviceToolTargetInput as ki, VcsProcessTimeoutError as kl, ThreadSpawnResult as kn, HUB_TUNNEL_INITIAL_WINDOW_BYTES as ko, ServerSettingsError as kr, OrchestrationCheckpointSummary as ks, FilesystemBrowseError as kt, COMPUTER_USE_DEFAULT_TIMEOUT_MS as l, ProviderResetCreditOutcome as la, ProviderApprovalDecision as lc, DeviceActionUnavailableError as li, ProviderDriverKind as ll, ThreadControlToolError as ln, PreviewAutomationTimeoutError as lo, TextGenerationError as lr, FUSION_ADVICE_PROMPT_PREFIX as ls, SIDECHAT_THREAD_ID_PREFIX as lt, IsoDateTime as lu, ComputerUseHostRegistration as m, ProviderRespondToUserInputInput as ma, ThreadActivityAppendedPayload as mc, DeviceHostId as mi, PullRequestStack as ml, ThreadPairCreateInput as mn, FILL_PREVIEW_VIEWPORT as mo, ServerSelfUpdateError as mr, FUSION_GATE_UNWATCHED_SUMMARY as ms, AssetLocalFileNotFoundError as mt, ProjectId as mu, SelfImproveError as n, INERT_TASK_TYPES as na, PROVIDER_SEND_TURN_MAX_INPUT_CHARS as nc, TaskStoreError as ni, DEFAULT_MODEL as nl, ThreadConfigureResult as nn, PreviewAutomationSetColorSchemeResult as no, ProjectSearchEntriesError as nr, WatchToolUnavailableError as ns, FeedRefreshResult as nt, AgentAssetId as nu, SelfImproveResult as o, WorkflowScriptProvenance as oa, ProjectScript as oc, UNKNOWN_TASK_STATUS_FALLBACK as oi, MODEL_SLUG_ALIASES_BY_PROVIDER as ol, ThreadContextUpdateResult as on, PreviewAutomationTabNotFoundError as oo, GitCommandError as or, DEFAULT_PROVIDER_INTERACTION_MODE as os, FeedSummary as ot, CommandId as ou, ComputerUseError as p, ProviderRespondToRequestInput as pa, RuntimeMode as pc, DeviceDetailInput as pi, PullRequestOperationError as pl, ThreadMessageResult as pn, PreviewAutomationWaitForInput as po, ServerProviderUpdateError as pr, FUSION_GATE_PROMPT_PREFIX as ps, AssetLocalFileInspectionError as pt, PositiveInt as pu, FEED_CATEGORIES as q, PreviewAutomationRecordingArtifact as qa, ThreadTurnCompletedPayload as qc, KeybindingsConfigError as qi, AuthOrchestrationOperateScope as ql, SupervisorApiKeyError as qn, ThreadEvidenceReportInput as qo, TaskLabel as qr, OrchestrationSession as qs, AssetCompressRefusedError as qt, SelfImproveEvidence as r, MONITOR_TASK_TYPES as ra, ProjectCreatedPayload as rc, TaskToolError as ri, DEFAULT_MODEL_BY_PROVIDER as rl, ThreadContextReadResult as rn, PreviewAutomationSnapshot as ro, ProjectWriteFileError as rr, ChatAttachment as rs, FeedSource as rt, ApprovalRequestId as ru, WS_METHODS as s, isToolLifecycleItemType as sa, ProjectionPendingApprovalDecision as sc, isReadableTaskId as si, ModelCapabilities as sl, ThreadControlNotPermittedError as sn, PreviewAutomationTabTargetInput as so, GitManagerError as sr, DEFAULT_RUNTIME_MODE as ss, UsageReadError as st, EnvironmentId as su, SelfImproveDecision as t, ResourceMonitorEvent as ta, PROVIDER_SEND_TURN_MAX_IMAGE_BYTES as tc, TaskStatus as ti, ANTIGRAVITY_DEFAULT_MODEL as tl, ThreadConfigureInput as tn, PreviewAutomationSetColorSchemeInput as to, ProjectReadFileError as tr, ThreadWatchToolError as ts, FeedMarkReadInput as tt, isChatProject as tu, COMPUTER_USE_MAX_OUTPUT_CHARS as u, UsageLimitSourceError as ua, ProviderInteractionMode as uc, DeviceBootError as ui, ProviderInstanceId as ul, ThreadMergeChildInput as un, PreviewAutomationTypeInput as uo, ServerLocalCliUpdateError as ur, FUSION_EVIDENCE_REPORT_REPAIR_MESSAGE_ID_PREFIX as us, isSidechatThreadId as ut, MessageId as uu, ComputerUseOutput as v, DEFAULT_TERMINAL_ID as va, ThreadComputerUseGrantSetPayload as vc, DeviceNotFoundError as vi, resolvePullRequestAuthorFilter as vl, ThreadPlanReadInput as vn, DesktopBackendBootstrap as vo, CodexSettings as vr, FUSION_REVIEW_MESSAGE_ID_PREFIX as vs, AssetProjectFaviconInspectionError as vt, RuntimeTaskId as vu, DesignAssetRequest as w, TerminalResizeError as wa, ThreadMetaUpdatedPayload as wc, DeviceToolError as wi, VcsProcessMissingExitCodeError as wl, ThreadRenameResult as wn, EnvironmentInternalError as wo, GrokSettings as wr, ORCHESTRATION_WS_METHODS as ws, AssetWorkspaceContextNotFoundError as wt, DeviceCommandResult as x, TerminalCwdStatError as xa, ThreadInteractionModeSetPayload as xc, DevicePlatformUnavailableError as xi, SourceControlRepositoryError as xl, ThreadPlanUpdateResult as xn, EnvironmentAuthenticatedPrincipal as xo, DEFAULT_JEV_ROLE_ROUTING_MIN_CONFIDENCE as xr, FusionReviewPolicy as xs, AssetSigningKeyLoadError as xt, ThreadPairId as xu, ComputerUseSourceAttestation as y, TerminalCwdNotDirectoryError as ya, ThreadCreatedPayload as yc, DeviceOperationError as yi, SourceControlProviderError as yl, ThreadPlanReadResult as yn, EnvironmentAuthInvalidError as yo, CursorSettings as yr, FUSION_REVIEW_PROMPT_PREFIX as ys, AssetProjectFaviconNotFoundError as yt, TaskId as yu, DesignRenderRequest as z, PreviewAutomationEvaluateInput as za, ThreadQueuedMessageRemovedPayload as zc, SettingsSyncPayload as zi, HubServerMembership as zl, ThreadAskFailedError as zn, HubAnalyticsFactInput as zo, TypeSafeAskResult as zr, OrchestrationGetWorkflowScriptError as zs, AgentAssetFiles as zt };
|
|
17084
17193
|
|
|
17085
|
-
//# sourceMappingURL=src-
|
|
17194
|
+
//# sourceMappingURL=src-DmphFADh.mjs.map
|