{#snippet itemRow(item: DeployableItem, depth: number, subPath: string)} {@const isSelectable = selectablePredicate(item)} {@const isSelected = selectedItems.includes(item.key)} {@const status = deploymentStatus[item.key]} {@const isDeployed = status?.status === 'deployed'} {@const blockedReason = !isSelectable && !isDeployed ? selectBlockedReason?.(item) : undefined} {@const showPath = isAgent?.(item) || (item.kind !== 'resource' && item.kind !== 'variable' && item.kind !== 'resource_type')} handleSelect(item)} path={showPath ? item.path : ''} marked={undefined} kind={isAgent?.(item) ? 'agent' : item.kind} triggerKind={item.triggerKind} canFavorite={false} workspaceId="" {depth} > {#snippet customSummary()} {#if itemSummary} {@render itemSummary(item)} {:else} {item.path} {/if} {/snippet} {#snippet pathDisplay()} {#if itemPath} {@render itemPath(item)} {:else} {showPath ? subPath : ''} {/if} {/snippet} {#snippet actions()} {#if itemActions} {@render itemActions(item)} {/if} {#if status} {#if status.status === 'loading'} {:else if status.status === 'deployed'} Deployed {:else if status.status === 'failed'}
Failed {status.error}
{/if} {/if} {/snippet}
{/snippet} {#snippet treeLeaf(leaf: ItemType, depth: number)} {@const item = leaf as unknown as DeployableItem} {@render itemRow(item, depth, item.path.split('/').pop() ?? item.path)} {/snippet} {#snippet prefixCheckbox(prefix: string)} {@const under = underPrefix(prefix)} {@const selectable = bulkSelectable(under)} {@const selectedCount = selectable.filter((i) => selectedItems.includes(i.key)).length} 0 && selectedCount === selectable.length} indeterminate={selectedCount > 0 && selectedCount < selectable.length} disabled={selectable.length === 0} title={selectedCount === selectable.length ? `Deselect all in ${prefix}` : `Select all in ${prefix}`} onChange={() => toggleGroup({ items: under })} /> {/snippet}
{#if header}
{@render header()}
{/if} {#if alerts} {@render alerts()} {/if} {#if items.length > 0 || selectAllActions}
{#if items.length > 0 && !hideSelection} {:else} {/if} {#if selectAllActions} {@render selectAllActions()} {/if}
{/if} {#if items.length > 0 && nested}
{}} sortCompare={(a, b) => a.path.localeCompare(b.path)} leaf={treeLeaf} ownerLead={hideSelection ? undefined : prefixCheckbox} ownerDetail={folderDetail} />
{:else if items.length > 0}
{#each groups as group (group.key)} {#if showGroupHeaders} {@const selectable = groupSelectable(group)} {@const selectedCount = selectable.filter((i) => selectedItems.includes(i.key)).length} {@const selectedInGroup = group.items.filter((i) => selectedItems.includes(i.key) ).length}
{#if !hideSelection} 0 && selectedCount === selectable.length} indeterminate={selectedCount > 0 && selectedCount < selectable.length} disabled={selectable.length === 0} title={selectedCount === selectable.length ? `Deselect all in ${group.label}` : `Select all in ${group.label}`} onChange={() => toggleGroup(group)} /> {/if} {#if group.groupKind === 'folder'} {:else if group.groupKind === 'user'} {/if} {group.label} {group.items.length} item{group.items.length !== 1 ? 's' : ''}{selectedInGroup > 0 ? ` · ${selectedInGroup} selected` : ''} {#if groupActions}
{@render groupActions(group.items)}
{/if}
{/if} {#each group.items as item (item.key)} {@render itemRow( item, 0, showGroupHeaders && group.key && item.path.startsWith(group.key + '/') ? item.path.slice(group.key.length + 1) : item.path )} {/each} {/each}
{:else if loading}
Comparing…
{:else}
{emptyMessage}
{/if} {#if footer}
{@render footer()}
{/if}