{$t("Plug-ins")}

{$t("Install a plugin ZIP file or get a release from a Git repository link.")}

{$t("To update a plugin, select its new ZIP or release link. Its settings and enabled state stay the same.")}

reveal()} />
{#if $installedPlugins.root}

{$installedPlugins.root}

{/if} {#if !desktop}

{$t("Installation requires the RuneStone desktop app.")}

{/if} {#if $pluginServiceError}{/if}

{$t("Installed plugins")}

{$t("Plugins run with RuneStone's access. Only enable code you trust.")}

{#if !external.length}

{$t("No plugins installed.")}

{/if} {#each external as plugin (plugin.manifest.id)}

{plugin.manifest.description}

{plugin.manifest.author} · {plugin.manifest.version} · {$t("Full app access")}
{builtInPackages.includes(plugin.manifest.id) ? $t("Included with RuneStone") : plugin.removal ? $t("Removal incomplete") : plugin.enabled ? $t("Enabled") : $t("Disabled")} {#if plugin.installedAt != null} {$t("Installed")} {:else} {$t("Install date unknown")} {/if}
{ const value = event.currentTarget.checked; event.currentTarget.checked = plugin.enabled; void toggle(plugin.manifest.id, value, plugin.hash); }} /> reveal(plugin.manifest.id)} /> {#if plugin.removal} {:else} prepare(plugin)} /> {/if}
{#if plugin.manifest.id === "runestone.browser"}

{$t("Browser is now built in. You can remove this old package. Your browser profiles and bookmarks stay available.")}

{/if} {#if plugin.manifest.id === "runestone.table-formulas"}

{$t("Table Formulas is now built in. You can remove this old package. Your formulas stay in your files. To turn formulas on or off, go to Settings → General.")}

{/if} {#if plugin.error || $externalErrors[plugin.manifest.id]}{/if}
{/each} {#if $restartPlugins.length}

{$t("Restart RuneStone to clear all code from plugins that stopped in this window.")}

{/if} {#if error}{/if} {#if message}

{message}

{/if} {#if candidates.length || plan || gitForm} { event.preventDefault(); event.stopPropagation(); void cancel(); }}> {#if gitForm}

{$t("Install from Git link")}

{$t("Get a Gitea release ZIP, then review it before installation. Git-link installation is an experimental feature.")}

{ event.preventDefault(); if (!busy) void fromGit(); }}>

{$t("Private repositories need a token with read access. RuneStone does not save the token.")}

{#if gitUrl.trim().startsWith("http:")}

{$t("HTTP sends the token and package without encryption. Use it only for a trusted local server.")}

{/if} {#if error}{/if}
{:else if plan}

{$t("Uninstall {name}?", { name: plan.plugin.manifest.name })}

{plan.plugin.manifest.author} · {plan.plugin.manifest.version}

{plan.plugin.path}

{$t("This stops the plugin in every window and permanently deletes its installed folder. Settings, source packages, and workspace documents stay intact.")}

{#if error}{/if} {:else}

{$t("Review plugin installation")}

{$t("Plugins run with RuneStone's access. Only enable code you trust.")}

{#each candidates as candidate (candidate.token)}
{#if candidate.manifest}

{candidate.manifest.author} · {candidate.manifest.version}

{candidate.manifest.description}

{$t("Destination: {path}", { path: `${$installedPlugins.root}\\${candidate.manifest.id}` })}

{/if} {#each external.filter(plugin => plugin.manifest.id === candidate.manifest?.id) as installed}

{$t("Update {current} → {next}. Settings and enabled state stay the same.", { current: installed.manifest.version, next: candidate.manifest!.version })}

{/each}

{$t("Source: {path}", { path: candidate.source })}

{#if candidate.error}

{candidate.error}

{/if}
{/each} {#if error}{/if} {/if}
{/if}