From de5d6899f52153b31d612281ea8431e3124fc3a8 Mon Sep 17 00:00:00 2001 From: i2cjak Date: Tue, 24 Nov 2026 01:53:25 -0500 Subject: [PATCH 1/4] chats: New chat and Move to project in GPUI and web GPUI: a New chat button beside the sidebar search, Ctrl/Cmd+Shift+N, the palette's New chat (no project), a + on the Chats section's head and the hub's Move to project second menu on a chat's row and title menu. Web: the same button, Alt+Shift+N, the palette actions and a project picker over thread.move_project. Co-Authored-By: Claude Fable 5.2 --- i18n/en.msg | 8 + i18n/es.msg | 8 + i18n/ja.msg | 8 + .../src/main/java/dev/backplane/mobile/Msg.kt | 5466 +++++++++-------- mobile/ios/Shared/TrCatalog.swift | 6 + native/gpui/src/keys.rs | 16 +- native/gpui/src/screens/ctxmenu.rs | 34 +- native/gpui/src/screens/palette.rs | 3 + native/gpui/src/screens/sections.rs | 16 +- native/gpui/src/ui.rs | 7 +- web/dist/assets/app.js | 40 +- web/dist/assets/pair.js | 2 +- web/dist/assets/style.css | 8 + web/dist/manifest.json | 34 +- web/src/app.ts | 81 +- web/src/palette-model.ts | 21 +- web/src/shell.css | 8 + web/src/sidebar.ts | 84 +- web/test/palette.test.ts | 3 + web/test/sidebar.test.ts | 13 +- 20 files changed, 3096 insertions(+), 2770 deletions(-) diff --git a/i18n/en.msg b/i18n/en.msg index 9be5322dda..c4bd2af856 100644 --- a/i18n/en.msg +++ b/i18n/en.msg @@ -2449,6 +2449,14 @@ gpui.star.why = Stars help other hardware designers find Backplane, and tell us gpui.projects.unpushed = {n, plural, one {# commit not pushed to {upstream}} other {# commits not pushed to {upstream}}} gpui.projects.push = Push +# quick chats: threads in no project (sidebar New chat, the Chats section, Move to project) +chats.new = New chat +chats.new.noproject = New chat (no project) +chats.title = Chats +chats.move = Move to project… +chats.move.none = No project to move it to. Add a project first. +chats.old.tip = Older chats that belong to no project, kept as they are. New chat starts a new one. + # ---- gpui-e: hub settings and panels ---- gpui.e.files.max.mb = Largest attachment (MB) gpui.e.files.max.note = A file sent with a message, or shown from this hub, may be up to {mb} MB. Files stream from disk, so a large one costs disk space, not memory. diff --git a/i18n/es.msg b/i18n/es.msg index cfa5cc21cd..a7cc0f503f 100644 --- a/i18n/es.msg +++ b/i18n/es.msg @@ -2450,6 +2450,14 @@ gpui.star.why = Las estrellas ayudan a otros diseñadores de hardware a encontra gpui.projects.unpushed = {n, plural, one {# commit sin enviar a {upstream}} other {# commits sin enviar a {upstream}}} gpui.projects.push = Enviar +# quick chats: threads in no project (sidebar New chat, the Chats section, Move to project) +chats.new = Chat nuevo +chats.new.noproject = Chat nuevo (sin proyecto) +chats.title = Chats +chats.move = Mover a un proyecto… +chats.move.none = No hay ningún proyecto al que moverlo. Añade uno primero. +chats.old.tip = Chats antiguos sin proyecto, tal como estaban. Chat nuevo empieza uno. + # ---- gpui-e: hub settings and panels ---- gpui.e.files.max.mb = Adjunto más grande (MB) gpui.e.files.max.note = Un archivo enviado con un mensaje, o mostrado desde este hub, puede pesar hasta {mb} MB. Los archivos se transmiten desde disco, así que uno grande consume espacio en disco, no memoria. diff --git a/i18n/ja.msg b/i18n/ja.msg index d49ecfb29c..dd5954add5 100644 --- a/i18n/ja.msg +++ b/i18n/ja.msg @@ -2472,6 +2472,14 @@ gpui.star.why = スターは、ほかのハードウェア設計者がBackplane gpui.projects.unpushed = {upstream} にプッシュしていないコミット: {n} 件 gpui.projects.push = プッシュ +# quick chats: threads in no project (sidebar New chat, the Chats section, Move to project) +chats.new = 新しいチャット +chats.new.noproject = 新しいチャット(プロジェクトなし) +chats.title = チャット +chats.move = プロジェクトに移動… +chats.move.none = 移動先のプロジェクトがありません。先にプロジェクトを追加してください。 +chats.old.tip = プロジェクトに属さない以前のチャットです。そのまま残っています。新しいチャットから新しく始められます。 + # ---- gpui-e: hub settings and panels ---- gpui.e.files.max.mb = 添付の上限(MB) gpui.e.files.max.note = メッセージで送るファイルやこのハブから表示するファイルは{mb} MBまでです。ファイルはディスクから順に読むので、大きなファイルはメモリではなくディスク容量を使います。 diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt index 64275e2ecc..3614dce998 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/Msg.kt @@ -2357,6 +2357,12 @@ object Msg { "gpui.star.why", "gpui.projects.unpushed", "gpui.projects.push", + "chats.new", + "chats.new.noproject", + "chats.title", + "chats.move", + "chats.move.none", + "chats.old.tip", "gpui.e.files.max.mb", "gpui.e.files.max.note", "gpui.e.dev.replay", @@ -2516,14 +2522,14 @@ object Msg { "gpui.e.acct.opus.resets", "gpui.e.acct.sonnet.resets", "notify.which.alerts.reach.you.quiet", + ) + private fun keys10(): Array = arrayOf( "notify.notifications", "notify.phones", "notify.only.your.uberbot.pushes.to", "notify.quiet.hours", "notify.a.push.waits.until.the", "notify.quiet.from.and.until", - ) - private fun keys10(): Array = arrayOf( "notify.hh.mm.hours", "notify.times.are.hh.mm.hours", "notify.quiet.hours.are.hh.mm", @@ -2768,14 +2774,14 @@ object Msg { "gpui.f.note.signin.text", "gpui.f.note.accounts.text", "gpui.f.note.vault.text", + ) + private fun keys11(): Array = arrayOf( "gpui.f.ov.counts", "gpui.f.ov.mb", "gpui.f.ov.files", "gpui.f.ov.now", "gpui.f.ov.min", "gpui.f.ov.s", - ) - private fun keys11(): Array = arrayOf( "gpui.f.ov.measuring", "gpui.f.ov.title", "gpui.f.ov.body", @@ -3020,14 +3026,14 @@ object Msg { "android.conn.offline", "android.hub", "android.hub.add", + ) + private fun keys12(): Array = arrayOf( "android.pair.repair", "android.pair.revoked", "android.pair.paste", "android.pair.photo", "android.pair.other", "android.pair.code.lead", - ) - private fun keys12(): Array = arrayOf( "android.pair.code", "android.pair.code.bad", "android.pair.link.bad", @@ -3272,14 +3278,14 @@ object Msg { "android.hub.voice.skip", "android.hub.voice.heard.many", "android.hub.voice.dropped", + ) + private fun keys13(): Array = arrayOf( "android.hub.voice.err.copy", "android.hub.voice.err.busy", "android.hub.voice.err.setting", "android.hub.voice.err.action", "android.hub.voice.err.request", "android.hub.voice.err.term", - ) - private fun keys13(): Array = arrayOf( "android.hub.voice.err.key", "android.hub.voice.err.write", "android.hub.voice.err.start", @@ -3524,14 +3530,14 @@ object Msg { "android.hub.accounts.msg.closed", "android.hub.accounts.msg.timeout", "android.hub.accounts.msg.notusage", + ) + private fun keys14(): Array = arrayOf( "android.hub.accounts.usage.unauthorized", "android.hub.accounts.usage.forbidden", "android.hub.accounts.usage.limited", "android.hub.accounts.usage.code", "android.hub.accounts.err.gone", "android.hub.accounts.err.provider", - ) - private fun keys14(): Array = arrayOf( "android.hub.accounts.err.add", "android.hub.accounts.err.gate", "android.hub.accounts.err.default", @@ -3776,14 +3782,14 @@ object Msg { "android.sub.thread", "android.sub.back", "android.sub.gone", + ) + private fun keys15(): Array = arrayOf( "android.sub.more", "android.sub.none", "android.sub.asked", "android.sub.tool", "android.machine.on", "android.handoff.from", - ) - private fun keys15(): Array = arrayOf( "android.handoff.note", "android.queue.unsent", "android.mark.runs", @@ -4028,14 +4034,14 @@ object Msg { "ios.accounts", "ios.devices.add", "ios.hub.add", + ) + private fun keys16(): Array = arrayOf( "ios.accounts.addsignin", "ios.devices.intro", "ios.project.add.first", "ios.settings.alerts", "ios.settings.sound", "ios.pair.ask.note", - ) - private fun keys16(): Array = arrayOf( "ios.projects.none.note", "ios.review.comment.field", "ios.project.badge", @@ -4280,14 +4286,14 @@ object Msg { "gpui.f2.coming", "gpui.f2.coming.note", "gpui.f2.project.body", + ) + private fun keys17(): Array = arrayOf( "gpui.f2.first.message.note", "gpui.f2.what.agent", "gpui.f2.folder.note", "gpui.f2.pair.phone", "gpui.f2.pair.phone.note", "gpui.f2.pair.phone.shown", - ) - private fun keys17(): Array = arrayOf( "gpui.f2.show.code", "gpui.f2.done.body", "gpui.f2.open.uber", @@ -4532,14 +4538,14 @@ object Msg { "gpui.mgmt.plan.nets", "gpui.mgmt.plan.tab", "gpui.mgmt.plan.before", + ) + private fun keys18(): Array = arrayOf( "gpui.mgmt.plan.onwords", "gpui.mgmt.plan.offwords", "gpui.mgmt.plan.elsewhere", "gpui.mgmt.plan.openboard", "gpui.mgmt.plan.noboard", "gpui.mgmt.plan.drawn", - ) - private fun keys18(): Array = arrayOf( "gpui.pick.planonce", "gpui.pick.planonce.note", "hub.view.board.unlisted", @@ -4784,14 +4790,14 @@ object Msg { "viewer.layout.refusal.unknownframe", "viewer.layout.refusal.invalidinput", "viewer.layout.refusal.toomany", + ) + private fun keys19(): Array = arrayOf( "viewer.layout.refusal.toomanysources", "viewer.layout.refusal.unresolvedversion", "viewer.layout.refusal.nohistory", "viewer.layout.refusal.linked", "viewer.layout.refusal.notondevice", "viewer.layout.refusal.starting", - ) - private fun keys19(): Array = arrayOf( "viewer.footprinteditor", "viewer.symboleditor", "web.clone.tab", @@ -7353,6 +7359,12 @@ object Msg { "Stars help other hardware designers find Backplane, and tell us what to keep building.", "{n, plural, one {# commit not pushed to {upstream}} other {# commits not pushed to {upstream}}}", "Push", + "New chat", + "New chat (no project)", + "Chats", + "Move to project…", + "No project to move it to. Add a project first.", + "Older chats that belong to no project, kept as they are. New chat starts a new one.", "Largest attachment (MB)", "A file sent with a message, or shown from this hub, may be up to {mb} MB. Files stream from disk, so a large one costs disk space, not memory.", "Replay first run", @@ -7512,14 +7524,14 @@ object Msg { "Opus weekly {left}% left · resets {when}", "Sonnet weekly {left}% left · resets {when}", "Which alerts reach you, quiet hours and phones are under Notifications.", + ) + private fun en10(): Array = arrayOf( "Notifications ›", "Phones", "Only your uberbot pushes to a phone, and a phone window open on the thread is not pushed to.", "Quiet hours", "A push waits until the end of quiet hours, in your time zone, and goes then as one.", "Quiet from and until", - ) - private fun en10(): Array = arrayOf( "HH:MM, 24 hours.", "Times are HH:MM, 24 hours, and not the same.", "Quiet hours are HH:MM to HH:MM, 24 hours, and not the same time twice.", @@ -7764,14 +7776,14 @@ object Msg { "Sign in again to {names}. Their history came across.", "The account profiles were copied but not added yet. Import again once the hub has finished starting.", "The 0.14 keys did not come: {why}. Add them again in Settings, API keys.", + ) + private fun en11(): Array = arrayOf( "{p, number} of {pn, number} projects · {t, number} of {tn, number} threads · {e, number} of {en, number} events", "{done, number} of {total, number} MB read", "{n, number} files copied", "Now: {what}", "About {n, number} min left in this step.", "About {n, number} s left in this step.", - ) - private fun en11(): Array = arrayOf( "Measuring how long this step takes.", "Bringing your 0.14 work across…", "{what}. Backplane works meanwhile, and your 0.14 folder is only read.", @@ -8016,14 +8028,14 @@ object Msg { "offline · showing what this phone has saved", "Hub", "Add a hub", + ) + private fun en12(): Array = arrayOf( "Re-pair this device", "This device was revoked. Make a new link in Settings → Devices on the hub.", "Paste the hub's pairing link or its address.", "Choose a photo of the code", "Or use another paired hub", "Or the hub's address and short code", - ) - private fun en12(): Array = arrayOf( "Pair with code", "Check the hub address and the eight-character code.", "That is not a pairing link.", @@ -8268,14 +8280,14 @@ object Msg { "Skip", "Heard “{word}” (1 of {count})", "{heard} dropped ↶", + ) + private fun en13(): Array = arrayOf( "A hub on a copied log cannot install or remove voice models.", "A model operation is already running.", "not a voice setting", "unknown voice action", "unknown voice request", "a term to add", - ) - private fun en13(): Array = arrayOf( "that is not an OpenAI API key (they start with sk-)", "the key could not be written", "The voice helper could not start. Check that it is installed beside Backplane.", @@ -8520,14 +8532,14 @@ object Msg { "The Claude CLI closed before reporting usage.", "The Claude CLI did not answer within 30 seconds.", "Claude's usage service answered with something else than usage.", + ) + private fun en14(): Array = arrayOf( "Claude refused the request: OAuth token rejected (status code 401).", "Claude refused the usage read for this account (403); it may not be a subscription plan.", "Claude is limiting usage reads right now (429); the last reading stays.", "Claude's usage service answered {code}.", "that account is gone", "provider: claude or codex", - ) - private fun en14(): Array = arrayOf( "the account could not be added", "This thread uses a named account. Use updated Backplane web or desktop to continue; your draft is preserved.", "Check and reconnect this account before making it the default.", @@ -8772,14 +8784,14 @@ object Msg { "the thread", "Back to {title}", "This subagent's steps are no longer kept.", + ) + private fun en15(): Array = arrayOf( "{n, plural, one {# earlier step not shown} other {# earlier steps not shown}}", "No steps reported yet.", "Asked", "tool", "on {name}", "‹ Handed over from {title}", - ) - private fun en15(): Array = arrayOf( "Note: {note}", "Unsent", "runs on {machine}", @@ -9024,14 +9036,14 @@ object Msg { "Accounts", "Add a device", "Add a hub", + ) + private fun en16(): Array = arrayOf( "Add and sign in", "Add another computer or phone. Invitations work once and expire in 10 minutes.", "Add a project", "Alerts on this phone", "Alert sound", "A link opened this. Pair only with a hub you know.", - ) - private fun en16(): Array = arrayOf( "A project is a folder on your hub's computer. Add one to start a thread.", "A review comment", "Badge", @@ -9276,14 +9288,14 @@ object Msg { "Coming soon", "This build cannot set it up yet. Stay on this computer for now.", "A project is a folder, usually with a KiCad project in it. Give a folder that exists to add it, or a new path to make it. Then tell an agent what you want.", + ) + private fun en17(): Array = arrayOf( "Starts a thread in this project with it. You can also leave it empty and write after setup.", "What should the agent do?", "The full path of a folder on this computer.", "Pair a phone", "Optional. Get the app, then show the code here and scan it. The phone opens your uberbot.", "Scan this with the Backplane app, or type the short code and this address. It works once, for ten minutes. Treat it as a password.", - ) - private fun en17(): Array = arrayOf( "Show the code", "Press ? any time for keys.", "Open the uberbot", @@ -9528,14 +9540,14 @@ object Msg { "{n, plural, one {# net} other {# nets}}", "Plan", "Plan before routing", + ) + private fun en18(): Array = arrayOf( "Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve.", "Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here.", "A routing plan for {board} awaits your approval", "Open board", "No routing plan for this board.", "The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them.", - ) - private fun en18(): Array = arrayOf( "Plan first, this turn only", "Claude proposes a plan and waits for Implement; the thread goes back to its own mode after.", "That board is not in this project's list yet.", @@ -9780,14 +9792,14 @@ object Msg { "Unknown KiCad frame", "Invalid layout request", "Too many tiles open", + ) + private fun en19(): Array = arrayOf( "Too many sources in one layout", "That version is not in this project's history", "This page has no history", "That layout is shown on its own machine only for now.", "That cannot be a tile here.", "The hub is starting.", - ) - private fun en19(): Array = arrayOf( "Footprint Editor", "Symbol Editor", "Clone from git", @@ -12349,6 +12361,12 @@ object Msg { "スターは、ほかのハードウェア設計者がBackplaneを見つける助けになり、私たちが何を作り続けるべきかを知る手がかりにもなります。", "{upstream} にプッシュしていないコミット: {n} 件", "プッシュ", + "新しいチャット", + "新しいチャット(プロジェクトなし)", + "チャット", + "プロジェクトに移動…", + "移動先のプロジェクトがありません。先にプロジェクトを追加してください。", + "プロジェクトに属さない以前のチャットです。そのまま残っています。新しいチャットから新しく始められます。", "添付の上限(MB)", "メッセージで送るファイルやこのハブから表示するファイルは{mb} MBまでです。ファイルはディスクから順に読むので、大きなファイルはメモリではなくディスク容量を使います。", "初回起動をやり直す", @@ -12508,14 +12526,14 @@ object Msg { "週間(Opus) 残り{left}% · {when}にリセット", "週間(Sonnet) 残り{left}% · {when}にリセット", "どの通知を受け取るか、静かな時間帯、スマートフォンは「通知」にあります。", + ) + private fun ja10(): Array = arrayOf( "通知 ›", "スマートフォン", "スマートフォンにプッシュするのはあなたのメインボットだけです。スレッドを開いているスマートフォンの画面にはプッシュしません。", "静かな時間帯", "プッシュは静かな時間帯が終わる(あなたのタイムゾーン)まで待ち、終わるとまとめて送られます。", "静かな時間帯の開始と終了", - ) - private fun ja10(): Array = arrayOf( "HH:MM(24時間表記)。", "時刻はHH:MM(24時間表記)で、同じ時刻にはできません。", "静かな時間帯はHH:MMからHH:MM(24時間表記)で、同じ時刻にはできません。", @@ -12760,14 +12778,14 @@ object Msg { "{names}に再度サインインしてください。履歴は移行されました。", "アカウントのプロファイルはコピーされましたが、まだ追加されていません。ハブの起動が終わったらもう一度インポートしてください。", "0.14のキーは移行されませんでした: {why}。設定 → APIキーでもう一度追加してください。", + ) + private fun ja11(): Array = arrayOf( "プロジェクト {p, number}/{pn, number} · スレッド {t, number}/{tn, number} · イベント {e, number}/{en, number}", "{total, number} MB中{done, number} MBを読み込み済み", "{n, number}個のファイルをコピー済み", "処理中: {what}", "このステップの残りは約{n, number}分です。", "このステップの残りは約{n, number}秒です。", - ) - private fun ja11(): Array = arrayOf( "このステップの所要時間を測っています。", "0.14の作業を移行しています…", "{what}。その間もBackplaneは使え、0.14のフォルダは読むだけです。", @@ -13012,14 +13030,14 @@ object Msg { "オフライン · この端末に保存した内容を表示中", "ハブ", "ハブを追加", + ) + private fun ja12(): Array = arrayOf( "この端末を再ペアリング", "この端末は取り消されました。ハブの「設定 → デバイス」で新しいリンクを作成してください。", "ハブのペアリングリンクかアドレスを貼り付けてください。", "コードの写真を選ぶ", "またはペアリング済みの別のハブを使う", "またはハブのアドレスと短いコード", - ) - private fun ja12(): Array = arrayOf( "コードでペアリング", "ハブのアドレスと8文字のコードを確認してください。", "ペアリングリンクではありません。", @@ -13264,14 +13282,14 @@ object Msg { "スキップ", "「{word}」と聞き取りました({count}件中1件目)", "{heard}を削除 ↶", + ) + private fun ja13(): Array = arrayOf( "コピーしたログで動くハブでは、音声モデルのインストールや削除はできません。", "モデルの操作はすでに実行中です。", "音声の設定ではありません", "不明な音声操作です", "不明な音声リクエストです", "追加する用語を入力してください", - ) - private fun ja13(): Array = arrayOf( "OpenAI APIキーではありません(sk-で始まります)", "キーを書き込めませんでした", "音声ヘルパーを起動できませんでした。Backplaneと同じ場所にインストールされているか確認してください。", @@ -13516,14 +13534,14 @@ object Msg { "Claude CLIが使用状況を報告する前に終了しました。", "Claude CLIが30秒以内に応答しませんでした。", "Claudeの使用状況サービスが使用状況以外の応答を返しました。", + ) + private fun ja14(): Array = arrayOf( "Claudeがリクエストを拒否しました: OAuthトークンが拒否されました(ステータスコード401)。", "Claudeがこのアカウントの使用状況の読み取りを拒否しました(403)。サブスクリプションプランではない可能性があります。", "Claudeが現在使用状況の読み取りを制限しています(429)。前回の値が表示されます。", "Claudeの使用状況サービスが{code}を返しました。", "そのアカウントはもうありません", "provider: claudeまたはcodex", - ) - private fun ja14(): Array = arrayOf( "アカウントを追加できませんでした", "このスレッドは名前付きアカウントを使います。続けるには最新のBackplaneのWeb版かデスクトップ版を使ってください。下書きは保持されます。", "デフォルトにする前に、このアカウントを確認して再接続してください。", @@ -13768,14 +13786,14 @@ object Msg { "スレッド", "{title} に戻る", "このサブエージェントの手順はもう保存されていません。", + ) + private fun ja15(): Array = arrayOf( "{n, plural, other {それ以前の # 件の手順は表示されていません}}", "まだ手順の報告はありません。", "依頼内容", "ツール", "{name} 上", "‹ {title} から引き継ぎ", - ) - private fun ja15(): Array = arrayOf( "メモ: {note}", "未送信", "{machine} で実行", @@ -14020,14 +14038,14 @@ object Msg { "アカウント", "デバイスを追加", "ハブを追加", + ) + private fun ja16(): Array = arrayOf( "追加してサインイン", "別のコンピューターやスマートフォンを追加します。招待は1回だけ使え、10分で期限切れになります。", "プロジェクトを追加", "この端末の通知", "通知音", "リンクから開きました。知っているハブとだけペアリングしてください。", - ) - private fun ja16(): Array = arrayOf( "プロジェクトはハブのコンピューター上のフォルダーです。追加するとスレッドを始められます。", "レビューコメント", "バッジ", @@ -14272,14 +14290,14 @@ object Msg { "近日対応", "このビルドではまだ設定できません。今はこのコンピュータのままにしてください。", "プロジェクトはフォルダで、ふつうKiCadプロジェクトが入っています。既存のフォルダを指定すると追加し、新しいパスなら作成します。そのあとエージェントにしてほしいことを伝えてください。", + ) + private fun ja17(): Array = arrayOf( "このメッセージでこのプロジェクトにスレッドを始めます。空のままにして、セットアップ後に書くこともできます。", "エージェントに何をしてほしいですか?", "このコンピュータ上のフォルダのフルパス。", "スマホをペアリング", "任意です。アプリを入れてから、ここでコードを表示して読み取ってください。スマホはメインボットを開きます。", "Backplaneアプリでこれを読み取るか、短いコードとこのアドレスを入力してください。1回だけ、10分間有効です。パスワードと同じように扱ってください。", - ) - private fun ja17(): Array = arrayOf( "コードを表示", "? でいつでもキー一覧を表示できます。", "メインボットを開く", @@ -14524,14 +14542,14 @@ object Msg { "ネット{n}本", "計画", "配線前に計画する", + ) + private fun ja18(): Array = arrayOf( "銅箔層が4層以上、またはネットが60本を超える基板では、配線の前にエージェントがここで配線経路とプレーン領域を提案します。承認したものだけを配線します。", "エージェントは指示どおりに配線します。オンにすると、まず配線計画を提案し、ここで承認したものだけを配線します。", "{board}の配線計画が承認を待っています", "基板を開く", "この基板の配線計画はありません。", "計画の配線経路とプレーンは、このパネルを開いている間だけ基板上に表示されます。閉じると消えます。", - ) - private fun ja18(): Array = arrayOf( "このターンだけ先に計画", "Claude が計画を提案し、「実装」を待ちます。その後スレッドは元のモードに戻ります。", "その基板はまだこのプロジェクトの一覧にありません。", @@ -14776,14 +14794,14 @@ object Msg { "不明な KiCad フレームです", "無効なレイアウト要求です", "タイルが多すぎます", + ) + private fun ja19(): Array = arrayOf( "レイアウトのソースが多すぎます", "このバージョンはこのプロジェクトの履歴にありません", "このページには履歴がありません", "そのレイアウトは今のところ元のマシンでのみ表示されます。", "ここではタイルにできません。", "ハブを起動しています。", - ) - private fun ja19(): Array = arrayOf( "フットプリントエディター", "シンボルエディター", "git からクローン", @@ -17345,6 +17363,12 @@ object Msg { "Las estrellas ayudan a otros diseñadores de hardware a encontrar Backplane y nos indican qué seguir construyendo.", "{n, plural, one {# commit sin enviar a {upstream}} other {# commits sin enviar a {upstream}}}", "Enviar", + "Chat nuevo", + "Chat nuevo (sin proyecto)", + "Chats", + "Mover a un proyecto…", + "No hay ningún proyecto al que moverlo. Añade uno primero.", + "Chats antiguos sin proyecto, tal como estaban. Chat nuevo empieza uno.", "Adjunto más grande (MB)", "Un archivo enviado con un mensaje, o mostrado desde este hub, puede pesar hasta {mb} MB. Los archivos se transmiten desde disco, así que uno grande consume espacio en disco, no memoria.", "Repetir primer inicio", @@ -17504,14 +17528,14 @@ object Msg { "Semanal Opus {left}% restante · se reinicia {when}", "Semanal Sonnet {left}% restante · se reinicia {when}", "Qué alertas te llegan, horas de silencio y teléfonos están en Notificaciones.", + ) + private fun es10(): Array = arrayOf( "Notificaciones ›", "Teléfonos", "Solo tu uberbot envía notificaciones push a un teléfono, y una ventana de teléfono abierta en el hilo no recibe push.", "Horas de silencio", "Una notificación push espera hasta el fin de las horas de silencio, en tu zona horaria, y se envía entonces junta.", "Silencio desde y hasta", - ) - private fun es10(): Array = arrayOf( "HH:MM, 24 horas.", "Las horas son HH:MM, 24 horas, y no la misma.", "Las horas de silencio son HH:MM a HH:MM, 24 horas, y no la misma hora dos veces.", @@ -17756,14 +17780,14 @@ object Msg { "Inicia sesión de nuevo en {names}. Su historial sí se trajo.", "Los perfiles de cuenta se copiaron pero aún no se añadieron. Importa de nuevo cuando el hub termine de iniciar.", "Las claves de 0.14 no llegaron: {why}. Añádelas de nuevo en Ajustes, Claves API.", + ) + private fun es11(): Array = arrayOf( "{p, number} de {pn, number} proyectos · {t, number} de {tn, number} hilos · {e, number} de {en, number} eventos", "{done, number} de {total, number} MB leídos", "{n, number} archivos copiados", "Ahora: {what}", "Unos {n, number} min restantes en este paso.", "Unos {n, number} s restantes en este paso.", - ) - private fun es11(): Array = arrayOf( "Midiendo cuánto tarda este paso.", "Trayendo tu trabajo de 0.14…", "{what}. Backplane trabaja mientras tanto y tu carpeta 0.14 solo se lee.", @@ -18008,14 +18032,14 @@ object Msg { "sin conexión · mostrando lo que este teléfono tiene guardado", "Hub", "Añadir un hub", + ) + private fun es12(): Array = arrayOf( "Volver a vincular este dispositivo", "Este dispositivo fue revocado. Crea un nuevo enlace en Ajustes → Dispositivos en el hub.", "Pega el enlace de vinculación del hub o su dirección.", "Elegir una foto del código", "O usar otro hub vinculado", "O la dirección del hub y código corto", - ) - private fun es12(): Array = arrayOf( "Vincular con código", "Comprueba la dirección del hub y el código de ocho caracteres.", "Ese no es un enlace de vinculación.", @@ -18260,14 +18284,14 @@ object Msg { "Saltar", "Se oyó “{word}” (1 de {count})", "{heard} descartado ↶", + ) + private fun es13(): Array = arrayOf( "Un hub en un registro copiado no puede instalar ni quitar modelos de voz.", "Ya hay una operación de modelo en curso.", "no es un ajuste de voz", "acción de voz desconocida", "petición de voz desconocida", "un término para añadir", - ) - private fun es13(): Array = arrayOf( "esa no es una clave API de OpenAI (empiezan con sk-)", "no se pudo escribir la clave", "El asistente de voz no pudo iniciar. Comprueba que esté instalado junto a Backplane.", @@ -18512,14 +18536,14 @@ object Msg { "La CLI de Claude se cerró antes de reportar el uso.", "La CLI de Claude no respondió en 30 segundos.", "El servicio de uso de Claude respondió con algo distinto al uso.", + ) + private fun es14(): Array = arrayOf( "Claude rechazó la petición: token OAuth rechazado (código de estado 401).", "Claude rechazó la lectura de uso para esta cuenta (403); puede que no sea un plan de suscripción.", "Claude está limitando las lecturas de uso ahora mismo (429); se conserva la última lectura.", "El servicio de uso de Claude respondió {code}.", "esa cuenta ya no está", "proveedor: claude o codex", - ) - private fun es14(): Array = arrayOf( "no se pudo añadir la cuenta", "Este hilo usa una cuenta con nombre. Usa Backplane web o escritorio actualizado para continuar; tu borrador se conserva.", "Comprueba y reconecta esta cuenta antes de hacerla la predeterminada.", @@ -18764,14 +18788,14 @@ object Msg { "el hilo", "Volver a {title}", "Los pasos de este subagente ya no se conservan.", + ) + private fun es15(): Array = arrayOf( "{n, plural, one {# paso anterior no mostrado} other {# pasos anteriores no mostrados}}", "Sin pasos reportados aún.", "Preguntó", "herramienta", "en {name}", "‹ Transferido desde {title}", - ) - private fun es15(): Array = arrayOf( "Nota: {note}", "Sin enviar", "se ejecuta en {machine}", @@ -19016,14 +19040,14 @@ object Msg { "Cuentas", "Añadir un dispositivo", "Añadir un hub", + ) + private fun es16(): Array = arrayOf( "Añadir e iniciar sesión", "Añade otro ordenador o teléfono. Las invitaciones funcionan una vez y caducan en 10 minutos.", "Añadir un proyecto", "Alertas en este teléfono", "Sonido de alerta", "Un enlace abrió esto. Vincula solo con un hub que conozcas.", - ) - private fun es16(): Array = arrayOf( "Un proyecto es una carpeta en el ordenador de tu hub. Añade uno para iniciar un hilo.", "Un comentario de revisión", "Insignia", @@ -19268,14 +19292,14 @@ object Msg { "Próximamente", "Esta compilación aún no puede configurarlo. Quédate en este ordenador por ahora.", "Un proyecto es una carpeta, normalmente con un proyecto de KiCad dentro. Indica una carpeta existente para añadirla, o una ruta nueva para crearla. Luego dile a un agente qué quieres.", + ) + private fun es17(): Array = arrayOf( "Inicia un hilo en este proyecto con él. También puedes dejarlo vacío y escribir tras la configuración.", "¿Qué debería hacer el agente?", "La ruta completa de una carpeta en este ordenador.", "Vincular un teléfono", "Opcional. Consigue la app, muestra el código aquí y escanéalo. El teléfono abre tu uberbot.", "Escanea esto con la app de Backplane, o escribe el código corto y esta dirección. Funciona una vez, durante diez minutos. Trátalo como una contraseña.", - ) - private fun es17(): Array = arrayOf( "Mostrar el código", "Pulsa ? en cualquier momento para ver los atajos.", "Abrir el uberbot", @@ -19520,14 +19544,14 @@ object Msg { "{n, plural, one {# red} other {# redes}}", "Plan", "Planificar antes de rutear", + ) + private fun es18(): Array = arrayOf( "Antes de rutear una placa con 4 o más capas de cobre o más de 60 redes, el agente propone aquí corredores y regiones de plano. Solo rutea lo que apruebes.", "Los agentes rutean como les pidas. Actívalo para que primero propongan un plan de ruteo y ruteen solo lo que apruebes aquí.", "Un plan de ruteo para {board} espera tu aprobación", "Abrir placa", "No hay plan de ruteo para esta placa.", "Los corredores y planos del plan se dibujan en la placa mientras este panel está abierto. Ciérralo para ocultarlos.", - ) - private fun es18(): Array = arrayOf( "Planificar primero, solo en este turno", "Claude propone un plan y espera a Implementar; después el hilo vuelve a su propio modo.", "Esa placa aún no está en la lista de este proyecto.", @@ -19772,14 +19796,14 @@ object Msg { "Marco de KiCad desconocido", "Solicitud de diseño no válida", "Demasiados mosaicos abiertos", + ) + private fun es19(): Array = arrayOf( "Demasiadas fuentes en un diseño", "Esa versión no está en el historial de este proyecto", "Esta página no tiene historial", "Ese diseño solo se muestra por ahora en su propia máquina.", "Eso no puede ser un mosaico aquí.", "El hub se está iniciando.", - ) - private fun es19(): Array = arrayOf( "Editor de huellas", "Editor de símbolos", "Clonar desde git", @@ -21800,6 +21824,12 @@ object Msg { "Don't ask again", "Stars help other hardware designers find Backplane, and tell us what to keep building.", "Push", + "New chat", + "New chat (no project)", + "Chats", + "Move to project…", + "No project to move it to. Add a project first.", + "Older chats that belong to no project, kept as they are. New chat starts a new one.", "Largest attachment (MB)", "Replay first run", "Clears setup's progress and opens it at the first step, as on a new hub.", @@ -21996,14 +22026,14 @@ object Msg { "No group", "Install FreeCAD", "Install FreeCAD?", + ) + private fun exactText8(): Array = arrayOf( "Installing FreeCAD", "Download FreeCAD from freecad.org, then set its path above.", "FreeCAD's own release for this computer. Agents make mechanical parts with it.", "Clones the repository and adds it as a project", "Projects and git", "Push commits to the remote automatically", - ) - private fun exactText8(): Array = arrayOf( "Backplane commits design files locally at each turn's end. On: it also pushes them to the branch's remote. Off: a project's page shows the commits not pushed, with Push.", "Backplane no longer pushes automatically. Turn it on in Settings if you want it.", "Keep Backplane's commits off my branch", @@ -22248,14 +22278,14 @@ object Msg { "Microphone access is off for Backplane. Turn it on in Settings, then press the mic again.", "That picture could not be read.", "Buy it did not start.", + ) + private fun exactText9(): Array = arrayOf( "That photo could not be read.", "The camera did not start.", "Camera access is off for Backplane. Turn it on in Settings, or choose a photo instead.", "That message is no longer in this thread.", "load earlier", "This hub does not take pictures yet (update it).", - ) - private fun exactText9(): Array = arrayOf( "Choose a photo", "Take a photo", "That could not be done.", @@ -22500,14 +22530,14 @@ object Msg { "Stop answering here", "Pairing link · open", "Pairing link · used", + ) + private fun exactText10(): Array = arrayOf( "Tailscale", "Over your tailnet: the other device needs Tailscale, signed in to the same tailnet.", "Plain HTTP on this network: the traffic is not encrypted, though every device still has to pair. Prefer Tailscale on a network you do not trust.", "Reach this hub by", "Local network address", "Add another", - ) - private fun exactText10(): Array = arrayOf( "Let the hub answer on the local network", "This link names only this computer (127.0.0.1): a phone or another computer cannot reach it. Start the hub with Tailscale on, or on an address they can reach, then make a new link.", "A hub on a copied log does not listen on the network.", @@ -22752,14 +22782,14 @@ object Msg { "Its own", "Different cat", "The name's cat", + ) + private fun exactText11(): Array = arrayOf( "Type a colour like #6fb3f2.", "This hub has no terminal for chats yet. Update it to use one here.", "BROWSER", "Clone from git", "https or ssh URL, or owner/repo", "Sign in to GitHub", - ) - private fun exactText11(): Array = arrayOf( "Clone into", "Change folder", "Clone into this folder", @@ -23004,14 +23034,14 @@ object Msg { "Handover", "none waiting", "Session", + ) + private fun exactText12(): Array = arrayOf( "Last handover", "Mailroom triage", "Back office", "back office", "Switch model", "Costs are estimates at the model's API rates.", - ) - private fun exactText12(): Array = arrayOf( "Mail, routines and reports run in sessions of their own: they never fill this chat's context.", "Routines run as turns of this chat.", "50+ more turns at this rate", @@ -23256,14 +23286,14 @@ object Msg { "Only one KiCad tile", "Those views cannot be overlaid", "That tile is no longer open", + ) + private fun exactText13(): Array = arrayOf( "That tile has no overlay", "That file is outside this project", "Choose two different tiles", "Invalid split ratio", "Tile already exists", "Unknown KiCad frame", - ) - private fun exactText13(): Array = arrayOf( "Invalid layout request", "Too many tiles open", "Too many sources in one layout", @@ -23423,9 +23453,9 @@ object Msg { "(no words)", ) internal val exactText: Array by lazy { arrayOf(*exactText0(), *exactText1(), *exactText2(), *exactText3(), *exactText4(), *exactText5(), *exactText6(), *exactText7(), *exactText8(), *exactText9(), *exactText10(), *exactText11(), *exactText12(), *exactText13()) } - internal val exactKey: IntArray by lazy { intArrayOf(0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3163, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 3731, 61, 62, 63, 64, 66, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 84, 85, 3770, 87, 88, 98, 99, 3092, 3769, 102, 103, 105, 106, 107, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 159, 161, 162, 163, 3212, 165, 166, 3214, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 3173, 183, 187, 189, 193, 194, 195, 197, 198, 199, 200, 201, 202, 206, 209, 213, 215, 216, 217, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 234, 235, 2979, 237, 238, 239, 240, 3730, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 260, 262, 263, 264, 265, 266, 267, 270, 271, 272, 273, 275, 279, 280, 281, 282, 286, 287, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 300, 301, 3184, 305, 306, 307, 308, 309, 310, 311, 313, 314, 315, 317, 319, 333, 3778, 336, 3777, 3780, 340, 3790, 342, 343, 344, 345, 354, 3161, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 2982, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 2974, 2975, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 453, 454, 455, 3191, 457, 458, 459, 460, 461, 2964, 463, 464, 465, 3094, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 556, 557, 558, 559, 560, 561, 562, 563, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 592, 628, 629, 630, 3199, 3200, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 651, 652, 3843, 654, 656, 657, 659, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 686, 687, 689, 690, 692, 693, 694, 695, 698, 704, 724, 728, 729, 730, 731, 732, 3775, 734, 735, 736, 737, 3198, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 3758, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 843, 844, 845, 847, 848, 3194, 850, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 3768, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 3845, 903, 904, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 3164, 964, 965, 966, 967, 968, 969, 3793, 971, 3019, 3076, 974, 975, 976, 978, 979, 987, 988, 989, 991, 992, 993, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 3796, 1020, 1021, 1022, 1025, 1029, 1030, 1031, 2971, 3045, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1045, 1046, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1082, 1083, 1086, 1087, 1088, 1090, 1091, 1092, 3810, 1094, 1095, 1098, 1099, 1100, 3193, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 3795, 1120, 1123, 1124, 1125, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1150, 1151, 1152, 1153, 1154, 1155, 1158, 1162, 1163, 1165, 1170, 1171, 1172, 1173, 1176, 1178, 1180, 1181, 1182, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1220, 1222, 1223, 2973, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1240, 1241, 1244, 1245, 1246, 1247, 1248, 1250, 1253, 1254, 1255, 1256, 1257, 1258, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1277, 1278, 1279, 1280, 1281, 1288, 1289, 1290, 1291, 1294, 1296, 1297, 1298, 1299, 1301, 1305, 1306, 1308, 1309, 1310, 1311, 1315, 1316, 1318, 1319, 1320, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1335, 1338, 1339, 1340, 1341, 1344, 1347, 1348, 1356, 1357, 3508, 1361, 1362, 1363, 1364, 1365, 1366, 3575, 1373, 1375, 1380, 1384, 1385, 3049, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 2976, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 3093, 3586, 1436, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 3588, 1473, 1474, 1475, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1493, 1494, 3733, 1496, 1497, 1498, 3745, 3751, 1501, 1502, 1503, 1504, 1505, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1523, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1573, 1574, 1575, 1576, 1578, 1579, 1580, 1581, 1582, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 3052, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 3462, 1670, 1671, 1672, 1673, 3463, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 2985, 1692, 1694, 1696, 1698, 1702, 1706, 1712, 1714, 1715, 1716, 1718, 1719, 1720, 1721, 1722, 1723, 1725, 1727, 1728, 1729, 1730, 1731, 1733, 1734, 3757, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1744, 1745, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1826, 1827, 3028, 1836, 1838, 1842, 3010, 1844, 1845, 3011, 1847, 1848, 1852, 3075, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1864, 1869, 1871, 1872, 1873, 1874, 1875, 1876, 3090, 1878, 1879, 1882, 1883, 1893, 1894, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1943, 1945, 1946, 1956, 1958, 1959, 1962, 1963, 1966, 1967, 1968, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1988, 1994, 1995, 1996, 1997, 2001, 3151, 2007, 2008, 2010, 2011, 2012, 2013, 3803, 3804, 2022, 2024, 2025, 2026, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2039, 2040, 2042, 2043, 2046, 2047, 3136, 3137, 3138, 2055, 3364, 2057, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2074, 2075, 2076, 2077, 2078, 2079, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2112, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2127, 2128, 2129, 3078, 2133, 2134, 2135, 2137, 2139, 2140, 2141, 2142, 3001, 3126, 3127, 3128, 3129, 3130, 2149, 2150, 2151, 2153, 3003, 3004, 2994, 2993, 2159, 2995, 2161, 2999, 2163, 3362, 2168, 2172, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 3029, 2188, 2189, 2190, 2191, 3062, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2204, 3375, 2206, 2207, 2208, 2209, 3044, 2211, 2212, 2213, 2214, 2992, 2216, 3107, 2219, 2223, 2224, 3652, 2226, 2227, 3739, 3740, 2231, 3189, 2234, 3728, 2237, 2238, 2239, 2240, 2241, 3788, 2243, 3159, 2245, 3158, 2247, 2249, 2251, 2252, 2253, 2257, 2260, 2262, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2279, 2280, 2281, 3746, 2283, 2284, 2286, 3036, 3034, 3038, 2292, 2294, 2295, 2301, 2302, 2303, 2304, 3074, 2309, 2310, 2312, 2317, 2318, 3018, 3587, 2981, 2980, 2983, 3103, 3106, 2331, 2332, 2334, 2335, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 3807, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2368, 2370, 2371, 2372, 2376, 2377, 2380, 2381, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2402, 2403, 2404, 2405, 2406, 2407, 2429, 2430, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2449, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2463, 2464, 2465, 2466, 2468, 2469, 2470, 2472, 2475, 2476, 2477, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2540, 2541, 2542, 2543, 3140, 2545, 2547, 2548, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2559, 2560, 2561, 2562, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2581, 2582, 2583, 2584, 2587, 2588, 2589, 2590, 2591, 2592, 2593, 2594, 2595, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2604, 2605, 2608, 2610, 2611, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2624, 2625, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2639, 2641, 2644, 2646, 3736, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2661, 2662, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2672, 2673, 2674, 2679, 2680, 2681, 2683, 2684, 2685, 2686, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 3709, 2702, 2703, 2705, 3706, 2707, 2708, 3710, 3707, 2720, 2724, 3717, 3213, 3718, 2728, 3719, 2730, 2732, 3721, 2734, 3722, 2736, 2738, 3726, 3704, 3697, 3705, 2757, 2758, 2760, 2761, 2771, 2772, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2786, 2789, 2792, 2794, 2796, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 3384, 2816, 2817, 2818, 2819, 2820, 2822, 2824, 2825, 3416, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2844, 2845, 2846, 2847, 2850, 2851, 2853, 2854, 2855, 2856, 3008, 2858, 2860, 2861, 2863, 2864, 2865, 2866, 2867, 2869, 2870, 2874, 2877, 2878, 2879, 2881, 2882, 2883, 2885, 2886, 2887, 2888, 2890, 2891, 2894, 2897, 2898, 2899, 2900, 2901, 2903, 2905, 2906, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2942, 2943, 2944, 2946, 2947, 2948, 2952, 2953, 2954, 2955, 2956, 2960, 2961, 2965, 2966, 2967, 2968, 2969, 2970, 2972, 2977, 2978, 2984, 2989, 2991, 2996, 2997, 2998, 3000, 3002, 3005, 3006, 3007, 3009, 3013, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3030, 3031, 3032, 3033, 3037, 3039, 3040, 3041, 3042, 3046, 3047, 3051, 3053, 3054, 3055, 3057, 3058, 3059, 3060, 3061, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3079, 3080, 3081, 3082, 3087, 3088, 3089, 3091, 3095, 3096, 3097, 3098, 3099, 3102, 3104, 3105, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3118, 3120, 3121, 3122, 3123, 3124, 3125, 3131, 3132, 3133, 3134, 3135, 3139, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3149, 3150, 3153, 3155, 3156, 3157, 3160, 3165, 3166, 3167, 3169, 3172, 3174, 3175, 3177, 3178, 3179, 3181, 3182, 3183, 3185, 3186, 3187, 3188, 3192, 3197, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3210, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3230, 3231, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3257, 3258, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3358, 3359, 3363, 3365, 3366, 3367, 3369, 3370, 3371, 3374, 3376, 3377, 3378, 3379, 3380, 3383, 3385, 3388, 3390, 3391, 3396, 3397, 3398, 3399, 3402, 3409, 3410, 3411, 3412, 3413, 3414, 3417, 3418, 3419, 3420, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3434, 3435, 3436, 3437, 3438, 3439, 3441, 3442, 3444, 3445, 3446, 3447, 3448, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3464, 3467, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3507, 3512, 3518, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3536, 3537, 3538, 3539, 3540, 3541, 3545, 3546, 3550, 3551, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3567, 3568, 3569, 3570, 3573, 3574, 3576, 3577, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3608, 3609, 3610, 3614, 3615, 3616, 3617, 3623, 3624, 3625, 3626, 3630, 3632, 3633, 3634, 3636, 3639, 3640, 3644, 3651, 3653, 3656, 3658, 3659, 3660, 3661, 3662, 3663, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3714, 3729, 3732, 3734, 3735, 3737, 3741, 3743, 3747, 3756, 3759, 3760, 3761, 3762, 3763, 3764, 3766, 3772, 3773, 3776, 3779, 3781, 3782, 3783, 3784, 3785, 3786, 3789, 3792, 3794, 3798, 3799, 3800, 3801, 3802, 3805, 3806, 3808, 3809, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837, 3840, 3842, 3844, 3853, 3854, 3856, 3857, 3866, 3872, 3878, 3887, 3889, 3890, 3891, 3892, 3895, 3896, 3898, 3904, 3908, 3912, 3917, 3918, 3920, 3921, 3922, 3924, 3925, 3926, 3931, 3932, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3942, 3943, 3944, 3989, 3990, 3995, 3997, 3998, 4000, 4006, 4009, 4024, 4025, 4026, 4027, 4028, 4029, 4031, 4032, 4034, 4035, 4037, 4039, 4040, 4053, 4056, 4057, 4059, 4060, 4064, 4069, 4072, 4073, 4075, 4076, 4082, 4084, 4085, 4088, 4090, 4095, 4096, 4097, 4102, 4113, 4136, 4152, 4160, 4169, 4170, 4174, 4179, 4195, 4196, 4197, 4198, 4200, 4202, 4203, 4205, 4208, 4212, 4215, 4218, 4219, 4220, 4221, 4225, 4226, 4227, 4228, 4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4262, 4265, 4266, 4272, 4277, 4278, 4279, 4280, 4284, 4288, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4299, 4300, 4301, 4302, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4320, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4340, 4341, 4345, 4346, 4348, 4349, 4350, 4351, 4355, 4356, 4357, 4358, 4359, 4360, 4362, 4363, 4364, 4370, 4371, 4372, 4373, 4374, 4375, 4379, 4383, 4384, 4386, 4387, 4388, 4389, 4390, 4392, 4402, 4404, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4437, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4462, 4463, 4464, 4466, 4467, 4468, 4469, 4472, 4473, 4474, 4476, 4477, 4478, 4480, 4481, 4482, 4483, 4484, 4485, 4487, 4489, 4492, 4493, 4494, 4495, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 4507, 4511, 4513, 4514, 4515, 4516, 4517, 4521, 4522, 4526, 4527, 4528, 4530, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4570, 4571, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4605, 4606, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4624, 4625, 4626, 4627, 4636, 4637, 4638, 4639, 4640, 4641, 4643, 4646, 4647, 4648, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4756, 4757, 4758, 4764, 4777, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4798, 4799, 4800, 4801, 4802, 4804, 4805, 4806, 4807, 4808, 4809, 4810, 4813, 4814, 4816, 4817, 4818, 4821, 4822, 4823, 4824, 4825, 4826, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4849, 4850, 4851, 4852, 4853, 4854, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4882, 4883, 4884, 4886, 4888, 4890, 4891, 4892, 4893, 4896, 4898, 4899, 4900, 4901, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4913, 4917, 4918, 4922, 4923, 4924, 4925, 4926, 4928, 4929, 4932, 4933, 4934, 4935, 4936, 4938, 4939, 4940, 4941, 4943, 4945, 4946, 4949, 4950, 4951, 4952, 4953, 4954) } - internal val templates: IntArray by lazy { intArrayOf(2369, 2848, 2660, 2659, 2658, 2880, 2902, 3382, 2623, 418, 2793, 2791, 2687, 2378, 2384, 2795, 2892, 2607, 2606, 285, 2336, 2797, 2904, 3232, 4184, 2546, 4927, 2596, 2050, 2374, 3716, 2115, 2723, 2379, 3233, 1336, 4204, 4224, 3715, 2564, 2721, 1867, 4199, 2126, 2167, 2173, 4566, 283, 2116, 4508, 3394, 3415, 2073, 2347, 3712, 452, 2755, 2787, 2788, 3395, 3711, 2756, 3643, 609, 1711, 3720, 1868, 2731, 3723, 2737, 3386, 616, 617, 2773, 3084, 3698, 1659, 2790, 3642, 303, 614, 69, 711, 621, 2346, 4222, 1121, 2488, 3465, 3838, 1242, 2202, 2575, 3387, 2165, 3727, 714, 1763, 1964, 2743, 2752, 2963, 4229, 3389, 3401, 136, 594, 596, 2563, 2718, 1865, 4217, 3035, 610, 2289, 2586, 3875, 1302, 4216, 3511, 3648, 3649, 158, 2080, 2082, 2117, 2843, 4365, 2171, 2373, 2516, 3637, 214, 284, 1276, 2014, 4797, 3506, 3515, 3516, 67, 83, 218, 619, 4602, 3535, 1360, 4311, 3360, 3725, 726, 1023, 1372, 2387, 2479, 2741, 4367, 89, 2386, 2401, 2916, 624, 1657, 1954, 2830, 4496, 3408, 1577, 2101, 2293, 2577, 4548, 3403, 3469, 3519, 650, 1888, 3930, 3168, 3510, 3556, 3620, 3839, 1317, 1866, 2045, 2425, 2712, 3858, 4567, 3422, 3468, 1841, 1863, 3357, 593, 1292, 1346, 1371, 1953, 3497, 3699, 221, 1701, 2744, 2941, 3086, 3154, 3443, 258, 591, 1026, 1379, 1965, 1989, 4137, 3440, 3566, 655, 1342, 1717, 2051, 3162, 3361, 3622, 3641, 710, 1283, 1370, 1382, 1658, 1732, 1895, 2375, 2478, 2576, 3945, 4223, 4433, 3421, 3489, 3635, 649, 699, 1044, 2612, 3180, 3299, 3702, 108, 184, 606, 721, 1081, 1969, 2049, 2111, 2169, 2411, 2492, 2748, 2784, 2828, 3950, 4479, 4820, 3381, 3452, 3613, 160, 623, 701, 1332, 1333, 1345, 1520, 1660, 2166, 2170, 2263, 2410, 2638, 4192, 4509, 3117, 3209, 3256, 3334, 3548, 3703, 3713, 703, 1183, 1572, 1897, 2258, 2261, 2491, 2749, 2769, 2770, 2938, 2939, 3960, 3980, 4213, 4470, 4803, 4819, 3621, 3638, 3744, 1378, 1492, 1584, 1703, 1955, 2431, 2443, 2768, 4156, 4214, 4510, 4601, 3083, 3085, 3100, 3618, 3631, 3797, 723, 1024, 1832, 2138, 2203, 2421, 2764, 2765, 3965, 4211, 4287, 4298, 3287, 3407, 91, 93, 595, 715, 1027, 1350, 1355, 2020, 2333, 2426, 2711, 2763, 2767, 3927, 4549, 4881, 3014, 3015, 3517, 3581, 3724, 94, 1251, 1259, 1353, 1377, 1519, 1583, 1880, 2186, 2218, 2471, 2489, 2739, 3867, 3868, 4210, 4376, 4439, 4885, 3333, 3372, 3373, 3451, 3607, 299, 599, 618, 700, 1109, 1117, 1175, 1367, 1518, 1626, 1948, 2130, 2136, 2154, 2221, 2441, 2446, 2448, 2671, 2704, 2762, 2940, 2957, 2958, 4181, 4207, 4324, 3016, 3170, 3547, 3580, 3749, 211, 585, 590, 605, 717, 720, 906, 990, 1084, 1159, 1334, 1470, 1524, 1705, 1886, 1906, 1926, 1961, 1991, 2072, 2316, 2424, 2490, 2945, 3894, 3946, 4164, 4550, 4568, 4569, 4768, 4930, 3077, 3433, 3628, 3629, 92, 96, 269, 603, 648, 712, 980, 1331, 1707, 1887, 1944, 2114, 2419, 2445, 2447, 2450, 2539, 2677, 2713, 2895, 2907, 4255, 4552, 4780, 2990, 3255, 3288, 3368, 3466, 3585, 3619, 208, 277, 316, 329, 330, 1287, 1352, 1376, 1521, 1522, 1949, 2019, 2044, 2113, 2220, 2248, 2299, 2413, 2428, 2440, 2714, 2717, 2798, 2799, 3865, 4565, 4763, 4937, 3012, 3400, 3404, 3453, 3509, 3664, 3701, 3754, 6, 244, 304, 600, 604, 1047, 1221, 1286, 1354, 1359, 1708, 1709, 1884, 1957, 1960, 2018, 2021, 2152, 2187, 2235, 2412, 2420, 2640, 2746, 2785, 2862, 3862, 3863, 3923, 4180, 4766, 4778, 4779, 4948, 3450, 3572, 3579, 3584, 3646, 3654, 268, 318, 322, 331, 583, 707, 722, 1076, 1160, 1164, 1284, 1285, 1312, 1517, 1710, 1828, 1889, 2009, 2222, 2228, 2383, 2409, 2415, 2442, 2574, 2675, 3928, 4153, 4206, 4269, 4368, 4438, 4649, 4767, 4942, 3063, 3148, 3513, 3514, 3612, 3645, 65, 210, 274, 587, 608, 613, 708, 713, 984, 1075, 1167, 1369, 1713, 1743, 1829, 1834, 1849, 1885, 2048, 2081, 2278, 2296, 2305, 2408, 2462, 2474, 2766, 4191, 3043, 3393, 3578, 3647, 3655, 3700, 90, 207, 288, 320, 323, 324, 349, 597, 607, 709, 855, 905, 1166, 1169, 1252, 1437, 1890, 2005, 2015, 2414, 2423, 2467, 2745, 2783, 2937, 2951, 3900, 4811, 4812, 4815, 4911, 3017, 3048, 3101, 3171, 3229, 3242, 3243, 3406, 3554, 3555, 3627, 3650, 3657, 3708, 110, 186, 190, 191, 212, 321, 327, 328, 352, 375, 580, 582, 589, 625, 727, 851, 977, 1077, 1118, 1147, 1243, 1304, 1314, 1746, 1830, 1831, 1839, 1950, 1951, 1952, 2041, 2254, 2256, 2285, 2297, 2298, 2320, 2382, 2416, 2417, 2473, 2579, 2580, 2663, 2678, 2710, 2715, 2716, 2753, 2800, 2801, 3846, 3864, 3910, 3964, 4209, 4303, 4321, 4339, 4366, 4436, 4471, 4523, 4547, 4608, 4848, 4931, 4947, 3050, 3152, 3176, 3190, 3211, 3392, 3405, 3549, 3553, 3583, 3611, 3742, 3752, 3753, 3765, 3767, 3774, 5, 8, 82, 185, 188, 192, 257, 276, 325, 326, 348, 351, 356, 598, 620, 658, 696, 705, 856, 985, 1048, 1122, 1148, 1149, 1168, 1179, 1239, 1383, 1491, 1649, 1693, 1704, 1850, 1881, 1947, 1993, 2006, 2027, 2250, 2255, 2308, 2314, 2315, 2322, 2427, 2613, 2649, 2823, 3911, 3919, 3949, 3966, 4133, 4168, 4182, 4230, 4270, 4322, 4361, 4524, 4551, 4944, 3073, 3119, 3195, 3196, 3201, 3259, 3543, 154, 259, 261, 347, 350, 353, 579, 602, 612, 702, 706, 982, 1078, 1381, 1593, 1833, 1925, 1987, 1990, 2306, 2319, 2385, 2432, 2578, 2626, 2868, 3869, 3916, 3982, 4149, 4520, 4607, 3449, 3542, 3544, 3552, 3571, 3582, 3750, 3771, 3791, 95, 196, 203, 204, 205, 242, 243, 346, 581, 586, 601, 615, 622, 626, 627, 691, 716, 725, 983, 986, 1085, 1089, 1161, 1174, 1204, 1349, 1471, 1506, 1688, 1689, 1691, 1726, 1851, 1891, 2233, 2311, 2321, 2422, 2444, 2452, 2959, 4135, 4165, 4166, 4256, 4281, 4319, 4434, 4490, 4531, 4887, 4912) } - internal val argNames: Map> by lazy { mapOf(5 to arrayOf("n"), 6 to arrayOf("n"), 7 to arrayOf("who"), 8 to arrayOf("title"), 65 to arrayOf("state"), 67 to arrayOf("listen"), 69 to arrayOf("listen"), 82 to arrayOf("version"), 83 to arrayOf("count", "plural"), 89 to arrayOf("size", "limit"), 90 to arrayOf("name"), 91 to arrayOf("dir"), 92 to arrayOf("dir"), 93 to arrayOf("name"), 94 to arrayOf("name"), 95 to arrayOf("path"), 96 to arrayOf("path"), 97 to arrayOf("name"), 108 to arrayOf("first"), 110 to arrayOf("n"), 136 to arrayOf("count", "plural"), 154 to arrayOf("tool"), 158 to arrayOf("n"), 160 to arrayOf("name"), 184 to arrayOf("pid", "cmd"), 185 to arrayOf("title", "ago"), 186 to arrayOf("name", "who", "n"), 188 to arrayOf("line"), 190 to arrayOf("n"), 191 to arrayOf("n"), 192 to arrayOf("n"), 196 to arrayOf("name"), 203 to arrayOf("when"), 204 to arrayOf("text", "when"), 205 to arrayOf("when"), 207 to arrayOf("count", "plural"), 208 to arrayOf("count", "plural"), 210 to arrayOf("took", "ago"), 211 to arrayOf("ago"), 212 to arrayOf("kind"), 214 to arrayOf("kind", "code", "why"), 218 to arrayOf("clock"), 221 to arrayOf("build"), 242 to arrayOf("step"), 243 to arrayOf("turn"), 244 to arrayOf("branch"), 257 to arrayOf("step", "total"), 258 to arrayOf("step", "total"), 259 to arrayOf("when"), 261 to arrayOf("tool"), 268 to arrayOf("count", "plural"), 269 to arrayOf("count", "total"), 274 to arrayOf("old", "new"), 276 to arrayOf("version"), 277 to arrayOf("count"), 278 to arrayOf("tag"), 283 to arrayOf("version"), 284 to arrayOf("old", "version"), 285 to arrayOf("version"), 288 to arrayOf("version"), 299 to arrayOf("project", "location"), 303 to arrayOf("account"), 304 to arrayOf("account"), 316 to arrayOf("n"), 318 to arrayOf("n"), 320 to arrayOf("minute"), 321 to arrayOf("time"), 322 to arrayOf("time"), 323 to arrayOf("clock"), 324 to arrayOf("clock", "took"), 325 to arrayOf("clock"), 326 to arrayOf("clock", "took"), 327 to arrayOf("clock"), 328 to arrayOf("clock", "took"), 329 to arrayOf("clock"), 330 to arrayOf("clock", "took"), 331 to arrayOf("clock"), 346 to arrayOf("target"), 347 to arrayOf("target"), 348 to arrayOf("target"), 349 to arrayOf("target"), 350 to arrayOf("target"), 351 to arrayOf("target"), 352 to arrayOf("target"), 353 to arrayOf("target"), 356 to arrayOf("name"), 375 to arrayOf("t"), 418 to arrayOf("minutes", "plural"), 452 to arrayOf("path"), 579 to arrayOf("count"), 580 to arrayOf("count"), 581 to arrayOf("title"), 582 to arrayOf("path"), 583 to arrayOf("path", "error"), 584 to arrayOf("first", "last", "count"), 585 to arrayOf("task", "step"), 586 to arrayOf("count"), 587 to arrayOf("path"), 588 to arrayOf("count", "plural"), 589 to arrayOf("label"), 590 to arrayOf("provider"), 591 to arrayOf("version"), 593 to arrayOf("key"), 594 to arrayOf("device"), 595 to arrayOf("kind", "device"), 596 to arrayOf("status"), 597 to arrayOf("kind", "title"), 598 to arrayOf("layer"), 599 to arrayOf("error"), 600 to arrayOf("page"), 601 to arrayOf("page", "kind", "total"), 602 to arrayOf("reason"), 603 to arrayOf("tag"), 604 to arrayOf("tag"), 605 to arrayOf("title"), 606 to arrayOf("title"), 607 to arrayOf("text", "time"), 608 to arrayOf("kind", "device"), 609 to arrayOf("device"), 610 to arrayOf("device"), 611 to arrayOf("word"), 612 to arrayOf("word", "kind", "count"), 613 to arrayOf("error"), 614 to arrayOf("count"), 615 to arrayOf("time", "relative", "rel", "zoned", "zone"), 616 to arrayOf("zone"), 617 to arrayOf("zone"), 618 to arrayOf("id", "state", "count", "age"), 619 to arrayOf("id"), 620 to arrayOf("name"), 621 to arrayOf("name"), 622 to arrayOf("clock", "count", "plural"), 623 to arrayOf("name"), 624 to arrayOf("name"), 625 to arrayOf("name"), 626 to arrayOf("count"), 627 to arrayOf("count"), 631 to arrayOf("name", "state"), 632 to arrayOf("author", "place", "state"), 633 to arrayOf("title", "state"), 648 to arrayOf("error"), 649 to arrayOf("error"), 650 to arrayOf("host"), 655 to arrayOf("email"), 658 to arrayOf("version"), 660 to arrayOf("first", "last", "count"), 661 to arrayOf("n"), 662 to arrayOf("n"), 691 to arrayOf("ref"), 696 to arrayOf("name"), 697 to arrayOf("name"), 699 to arrayOf("name"), 700 to arrayOf("name"), 701 to arrayOf("action"), 702 to arrayOf("label"), 703 to arrayOf("count", "plural"), 705 to arrayOf("path"), 706 to arrayOf("word", "kind", "count"), 707 to arrayOf("name"), 708 to arrayOf("name"), 709 to arrayOf("name"), 710 to arrayOf("name"), 711 to arrayOf("url"), 712 to arrayOf("count"), 713 to arrayOf("count"), 714 to arrayOf("device"), 715 to arrayOf("device"), 716 to arrayOf("count"), 717 to arrayOf("label"), 718 to arrayOf("label"), 719 to arrayOf("label"), 720 to arrayOf("title"), 721 to arrayOf("title"), 722 to arrayOf("state"), 723 to arrayOf("open", "kind"), 725 to arrayOf("count"), 726 to arrayOf("email"), 727 to arrayOf("email"), 851 to arrayOf("at", "count"), 855 to arrayOf("name"), 856 to arrayOf("name"), 905 to arrayOf("name"), 906 to arrayOf("name"), 977 to arrayOf("count"), 980 to arrayOf("name"), 981 to arrayOf("name", "count"), 982 to arrayOf("label", "n"), 983 to arrayOf("action"), 984 to arrayOf("count", "plural"), 985 to arrayOf("count"), 986 to arrayOf("waiting", "busy", "done"), 990 to arrayOf("count", "plural"), 1023 to arrayOf("name"), 1024 to arrayOf("name"), 1026 to arrayOf("seconds", "long"), 1027 to arrayOf("size", "triangles", "delayed", "waited", "built"), 1028 to arrayOf("size", "delayed", "waited"), 1044 to arrayOf("name"), 1047 to arrayOf("name"), 1048 to arrayOf("count"), 1075 to arrayOf("state"), 1076 to arrayOf("bytes"), 1077 to arrayOf("count"), 1078 to arrayOf("when"), 1079 to arrayOf("state", "name"), 1080 to arrayOf("name", "state"), 1081 to arrayOf("reason", "code"), 1084 to arrayOf("kind", "code"), 1085 to arrayOf("number"), 1089 to arrayOf("x", "y"), 1096 to arrayOf("state"), 1097 to arrayOf("label", "example"), 1109 to arrayOf("text"), 1117 to arrayOf("error"), 1118 to arrayOf("kind", "count"), 1121 to arrayOf("name"), 1122 to arrayOf("n"), 1147 to arrayOf("ago"), 1148 to arrayOf("name"), 1149 to arrayOf("kind", "place", "hub"), 1159 to arrayOf("label"), 1160 to arrayOf("word"), 1161 to arrayOf("count"), 1164 to arrayOf("hub"), 1166 to arrayOf("count"), 1167 to arrayOf("state"), 1168 to arrayOf("label"), 1169 to arrayOf("label"), 1174 to arrayOf("state", "text"), 1175 to arrayOf("text"), 1177 to arrayOf("question"), 1179 to arrayOf("label"), 1183 to arrayOf("title"), 1204 to arrayOf("count"), 1205 to arrayOf("name", "counts"), 1219 to arrayOf("n"), 1221 to arrayOf("mode"), 1238 to arrayOf("first", "last", "total"), 1239 to arrayOf("count"), 1242 to arrayOf("n"), 1243 to arrayOf("who", "name"), 1251 to arrayOf("name"), 1252 to arrayOf("when"), 1259 to arrayOf("why"), 1276 to arrayOf("name"), 1283 to arrayOf("kind"), 1284 to arrayOf("title"), 1285 to arrayOf("title"), 1286 to arrayOf("title"), 1287 to arrayOf("title"), 1292 to arrayOf("name"), 1302 to arrayOf("heard"), 1303 to arrayOf("out", "heard"), 1304 to arrayOf("heard"), 1312 to arrayOf("name", "mb"), 1314 to arrayOf("name"), 1317 to arrayOf("platform"), 1321 to arrayOf("heard", "out", "yes"), 1331 to arrayOf("name", "done", "total", "percent"), 1332 to arrayOf("name", "done"), 1333 to arrayOf("name"), 1334 to arrayOf("error"), 1336 to arrayOf("mb"), 1342 to arrayOf("mb"), 1345 to arrayOf("n"), 1346 to arrayOf("n"), 1349 to arrayOf("n"), 1350 to arrayOf("pct"), 1351 to arrayOf("px"), 1352 to arrayOf("version"), 1353 to arrayOf("tag"), 1354 to arrayOf("tag"), 1355 to arrayOf("hub"), 1359 to arrayOf("tag"), 1360 to arrayOf("tag"), 1367 to arrayOf("when"), 1369 to arrayOf("tag"), 1370 to arrayOf("tag", "when"), 1371 to arrayOf("tag"), 1372 to arrayOf("tag", "when"), 1376 to arrayOf("channel"), 1377 to arrayOf("tag"), 1378 to arrayOf("app", "hub"), 1379 to arrayOf("hub", "app"), 1381 to arrayOf("key"), 1382 to arrayOf("key"), 1383 to arrayOf("why"), 1437 to arrayOf("n"), 1470 to arrayOf("title"), 1471 to arrayOf("note"), 1491 to arrayOf("title"), 1492 to arrayOf("more"), 1506 to arrayOf("bots"), 1517 to arrayOf("name"), 1518 to arrayOf("name", "time"), 1519 to arrayOf("name", "n"), 1520 to arrayOf("name", "time", "n"), 1521 to arrayOf("to"), 1522 to arrayOf("to", "step"), 1524 to arrayOf("note"), 1572 to arrayOf("why"), 1577 to arrayOf("e"), 1583 to arrayOf("max"), 1584 to arrayOf("secs", "max", "mib"), 1593 to arrayOf("path"), 1626 to arrayOf("secs"), 1649 to arrayOf("pct", "scope"), 1657 to arrayOf("n"), 1658 to arrayOf("n"), 1659 to arrayOf("n"), 1660 to arrayOf("n"), 1688 to arrayOf("d", "h"), 1689 to arrayOf("h", "m"), 1690 to arrayOf("m"), 1691 to arrayOf("window", "pct"), 1693 to arrayOf("when"), 1695 to arrayOf("label", "e"), 1697 to arrayOf("from", "to", "total"), 1701 to arrayOf("messages", "lines", "left"), 1703 to arrayOf("pct", "view", "max"), 1704 to arrayOf("pct"), 1705 to arrayOf("done", "total"), 1707 to arrayOf("n"), 1708 to arrayOf("n"), 1709 to arrayOf("time"), 1710 to arrayOf("view", "max"), 1711 to arrayOf("view", "max"), 1713 to arrayOf("more"), 1717 to arrayOf("n"), 1726 to arrayOf("n"), 1732 to arrayOf("page"), 1743 to arrayOf("title"), 1746 to arrayOf("n"), 1763 to arrayOf("name"), 1828 to arrayOf("line"), 1829 to arrayOf("quote"), 1830 to arrayOf("n"), 1831 to arrayOf("n"), 1832 to arrayOf("n"), 1833 to arrayOf("n"), 1834 to arrayOf("n"), 1839 to arrayOf("held"), 1840 to arrayOf("machine"), 1841 to arrayOf("machine"), 1849 to arrayOf("count", "total"), 1850 to arrayOf("count"), 1851 to arrayOf("n"), 1863 to arrayOf("name"), 1865 to arrayOf("n", "c", "total"), 1866 to arrayOf("n", "c"), 1867 to arrayOf("n", "c", "total", "before"), 1868 to arrayOf("n", "c", "before"), 1880 to arrayOf("name"), 1881 to arrayOf("path"), 1884 to arrayOf("file"), 1885 to arrayOf("path", "n"), 1886 to arrayOf("why"), 1887 to arrayOf("n"), 1888 to arrayOf("name"), 1889 to arrayOf("name"), 1890 to arrayOf("name"), 1891 to arrayOf("n"), 1892 to arrayOf("shown", "n"), 1895 to arrayOf("path"), 1897 to arrayOf("n"), 1906 to arrayOf("status"), 1923 to arrayOf("name", "pct"), 1924 to arrayOf("name", "mb"), 1925 to arrayOf("name"), 1926 to arrayOf("name", "why"), 1944 to arrayOf("machine"), 1947 to arrayOf("n"), 1948 to arrayOf("ref"), 1949 to arrayOf("ref", "sheet"), 1950 to arrayOf("name"), 1951 to arrayOf("name"), 1952 to arrayOf("file", "folder"), 1953 to arrayOf("name", "error"), 1954 to arrayOf("name", "status"), 1955 to arrayOf("name", "error"), 1957 to arrayOf("name"), 1960 to arrayOf("code"), 1961 to arrayOf("error"), 1964 to arrayOf("error"), 1965 to arrayOf("error"), 1969 to arrayOf("error"), 1987 to arrayOf("done", "of"), 1989 to arrayOf("why"), 1990 to arrayOf("path"), 1991 to arrayOf("error"), 1992 to arrayOf("secs"), 1993 to arrayOf("secs"), 2005 to arrayOf("code"), 2006 to arrayOf("code"), 2009 to arrayOf("state"), 2014 to arrayOf("hide", "copy", "paste"), 2015 to arrayOf("n"), 2018 to arrayOf("name"), 2019 to arrayOf("name", "folder"), 2020 to arrayOf("name"), 2021 to arrayOf("name", "percent"), 2027 to arrayOf("folder"), 2037 to arrayOf("w", "h"), 2041 to arrayOf("path"), 2044 to arrayOf("why"), 2045 to arrayOf("mb"), 2048 to arrayOf("n"), 2049 to arrayOf("delete", "undo"), 2050 to arrayOf("delete", "undo"), 2051 to arrayOf("undo"), 2072 to arrayOf("what", "secs"), 2073 to arrayOf("file", "holder"), 2080 to arrayOf("what"), 2081 to arrayOf("what"), 2082 to arrayOf("editor", "why"), 2101 to arrayOf("files"), 2111 to arrayOf("why"), 2113 to arrayOf("title"), 2114 to arrayOf("title"), 2115 to arrayOf("version"), 2116 to arrayOf("version", "size", "folder"), 2117 to arrayOf("version", "size", "folder"), 2126 to arrayOf("title"), 2130 to arrayOf("dir", "files"), 2136 to arrayOf("why"), 2138 to arrayOf("code"), 2152 to arrayOf("origin"), 2154 to arrayOf("why"), 2165 to arrayOf("dir"), 2166 to arrayOf("path"), 2167 to arrayOf("home", "other"), 2169 to arrayOf("path"), 2170 to arrayOf("code", "log"), 2171 to arrayOf("log"), 2173 to arrayOf("addr"), 2186 to arrayOf("home"), 2187 to arrayOf("addr"), 2202 to arrayOf("dir", "why"), 2203 to arrayOf("dir"), 2218 to arrayOf("phase"), 2220 to arrayOf("why"), 2221 to arrayOf("what"), 2222 to arrayOf("code"), 2228 to arrayOf("label"), 2233 to arrayOf("kind"), 2235 to arrayOf("project"), 2248 to arrayOf("what"), 2250 to arrayOf("when"), 2254 to arrayOf("n"), 2255 to arrayOf("n"), 2256 to arrayOf("n"), 2258 to arrayOf("agent"), 2259 to arrayOf("effort"), 2261 to arrayOf("n"), 2263 to arrayOf("model"), 2278 to arrayOf("word"), 2285 to arrayOf("more", "step"), 2289 to arrayOf("name"), 2293 to arrayOf("max", "skipped"), 2296 to arrayOf("name"), 2297 to arrayOf("n"), 2298 to arrayOf("name"), 2299 to arrayOf("name"), 2305 to arrayOf("n"), 2306 to arrayOf("name"), 2308 to arrayOf("price"), 2311 to arrayOf("name"), 2313 to arrayOf("name"), 2314 to arrayOf("name"), 2315 to arrayOf("name"), 2316 to arrayOf("text"), 2319 to arrayOf("key"), 2320 to arrayOf("key"), 2321 to arrayOf("pct"), 2322 to arrayOf("when"), 2333 to arrayOf("n", "upstream"), 2336 to arrayOf("mb"), 2346 to arrayOf("path"), 2347 to arrayOf("path"), 2369 to arrayOf("id"), 2373 to arrayOf("model"), 2374 to arrayOf("platform"), 2375 to arrayOf("version"), 2378 to arrayOf("version", "from", "into"), 2379 to arrayOf("version", "from"), 2382 to arrayOf("version", "path"), 2383 to arrayOf("version", "path"), 2384 to arrayOf("version", "pin", "from"), 2385 to arrayOf("path"), 2386 to arrayOf("version", "path"), 2387 to arrayOf("version", "path", "set"), 2401 to arrayOf("turns", "input", "cread", "cwrite", "output", "cost"), 2408 to arrayOf("tool"), 2409 to arrayOf("tool"), 2410 to arrayOf("tool", "word"), 2411 to arrayOf("tool", "word"), 2412 to arrayOf("tool"), 2413 to arrayOf("tool"), 2414 to arrayOf("due"), 2415 to arrayOf("due"), 2416 to arrayOf("due"), 2417 to arrayOf("due"), 2418 to arrayOf("zone"), 2419 to arrayOf("zone"), 2420 to arrayOf("zone"), 2421 to arrayOf("zone"), 2422 to arrayOf("n"), 2423 to arrayOf("who"), 2424 to arrayOf("n", "who"), 2425 to arrayOf("harness"), 2426 to arrayOf("path"), 2427 to arrayOf("path"), 2428 to arrayOf("path"), 2431 to arrayOf("error", "line"), 2432 to arrayOf("label"), 2440 to arrayOf("who"), 2441 to arrayOf("who"), 2442 to arrayOf("label", "left", "when"), 2443 to arrayOf("left"), 2444 to arrayOf("name", "left"), 2445 to arrayOf("used"), 2446 to arrayOf("used", "limit"), 2447 to arrayOf("used", "reason"), 2448 to arrayOf("used", "limit", "reason"), 2450 to arrayOf("provider"), 2451 to arrayOf("used", "window", "pct"), 2452 to arrayOf("rate"), 2462 to arrayOf("n", "r"), 2467 to arrayOf("time", "n"), 2471 to arrayOf("n", "m"), 2473 to arrayOf("pct"), 2474 to arrayOf("cost", "n"), 2478 to arrayOf("in", "out", "cread", "cwrite"), 2479 to arrayOf("in", "out", "cread", "cwrite", "n"), 2488 to arrayOf("turns", "input", "cread", "cwrite", "output"), 2489 to arrayOf("left", "when"), 2490 to arrayOf("left", "when"), 2491 to arrayOf("left", "when"), 2492 to arrayOf("left", "when"), 2516 to arrayOf("n"), 2539 to arrayOf("when"), 2546 to arrayOf("phrase", "now"), 2557 to arrayOf("s"), 2563 to arrayOf("now"), 2564 to arrayOf("now", "nudge", "sent", "undone"), 2574 to arrayOf("e"), 2575 to arrayOf("a", "ams", "b", "bms"), 2576 to arrayOf("ms"), 2577 to arrayOf("e"), 2578 to arrayOf("t"), 2579 to arrayOf("t"), 2580 to arrayOf("t"), 2586 to arrayOf("why"), 2596 to arrayOf("apps"), 2606 to arrayOf("n"), 2607 to arrayOf("n", "k"), 2612 to arrayOf("stt", "conf"), 2613 to arrayOf("words"), 2623 to arrayOf("into"), 2626 to arrayOf("origin"), 2638 to arrayOf("url"), 2640 to arrayOf("url"), 2648 to arrayOf("i", "n"), 2649 to arrayOf("d", "n"), 2658 to arrayOf("version"), 2659 to arrayOf("version"), 2660 to arrayOf("version"), 2663 to arrayOf("path"), 2671 to arrayOf("addr"), 2675 to arrayOf("label"), 2677 to arrayOf("label"), 2678 to arrayOf("label"), 2682 to arrayOf("label"), 2687 to arrayOf("from"), 2704 to arrayOf("done", "of"), 2710 to arrayOf("n"), 2711 to arrayOf("t", "m"), 2712 to arrayOf("m"), 2713 to arrayOf("b", "m"), 2714 to arrayOf("r", "p"), 2715 to arrayOf("n"), 2716 to arrayOf("n"), 2717 to arrayOf("n"), 2718 to arrayOf("n"), 2721 to arrayOf("n"), 2723 to arrayOf("n"), 2731 to arrayOf("n"), 2737 to arrayOf("name", "gb", "path"), 2739 to arrayOf("path", "why"), 2741 to arrayOf("names"), 2743 to arrayOf("why"), 2744 to arrayOf("p", "pn", "t", "tn", "e", "en"), 2745 to arrayOf("done", "total"), 2746 to arrayOf("n"), 2747 to arrayOf("what"), 2748 to arrayOf("n"), 2749 to arrayOf("n"), 2752 to arrayOf("what"), 2753 to arrayOf("n"), 2755 to arrayOf("why", "from"), 2756 to arrayOf("why"), 2762 to arrayOf("path"), 2763 to arrayOf("path", "who"), 2764 to arrayOf("path"), 2765 to arrayOf("path", "cmd"), 2766 to arrayOf("version", "path"), 2767 to arrayOf("version", "path"), 2768 to arrayOf("version", "path", "who"), 2769 to arrayOf("version", "path"), 2770 to arrayOf("version", "path", "cmd"), 2773 to arrayOf("cmd"), 2783 to arrayOf("name", "version", "path"), 2784 to arrayOf("path", "why"), 2785 to arrayOf("name"), 2787 to arrayOf("version", "cli"), 2788 to arrayOf("cli"), 2790 to arrayOf("version"), 2791 to arrayOf("version"), 2793 to arrayOf("version"), 2795 to arrayOf("version"), 2797 to arrayOf("computer"), 2798 to arrayOf("version", "cli"), 2799 to arrayOf("cli"), 2800 to arrayOf("version", "cli"), 2801 to arrayOf("cli"), 2823 to arrayOf("n"), 2828 to arrayOf("code"), 2830 to arrayOf("e"), 2843 to arrayOf("n"), 2848 to arrayOf("channel"), 2862 to arrayOf("project"), 2868 to arrayOf("n"), 2880 to arrayOf("m"), 2892 to arrayOf("m"), 2895 to arrayOf("m"), 2902 to arrayOf("pages"), 2904 to arrayOf("name"), 2907 to arrayOf("name"), 2916 to arrayOf("d", "n"), 2937 to arrayOf("n", "tools"), 2938 to arrayOf("n", "tools", "d"), 2939 to arrayOf("n", "d"), 2940 to arrayOf("n", "what"), 2941 to arrayOf("n", "d", "what"), 2945 to arrayOf("head"), 2951 to arrayOf("name", "path"), 2957 to arrayOf("page", "net", "near"), 2958 to arrayOf("page", "what"), 2959 to arrayOf("ref"), 2963 to arrayOf("page"), 2986 to arrayOf("n"), 2987 to arrayOf("n"), 2988 to arrayOf("n"), 2990 to arrayOf("hub"), 3012 to arrayOf("project"), 3014 to arrayOf("n"), 3015 to arrayOf("n"), 3016 to arrayOf("word"), 3017 to arrayOf("n"), 3035 to arrayOf("name"), 3043 to arrayOf("answer"), 3048 to arrayOf("why"), 3050 to arrayOf("hub"), 3056 to arrayOf("from", "to"), 3063 to arrayOf("project"), 3073 to arrayOf("name"), 3077 to arrayOf("n"), 3083 to arrayOf("code"), 3084 to arrayOf("hub"), 3085 to arrayOf("hub"), 3086 to arrayOf("hub"), 3100 to arrayOf("n"), 3101 to arrayOf("n"), 3117 to arrayOf("status"), 3119 to arrayOf("status"), 3148 to arrayOf("project"), 3152 to arrayOf("code"), 3154 to arrayOf("why"), 3162 to arrayOf("title"), 3168 to arrayOf("title"), 3170 to arrayOf("q"), 3171 to arrayOf("title"), 3176 to arrayOf("room"), 3180 to arrayOf("q"), 3190 to arrayOf("title"), 3195 to arrayOf("n"), 3196 to arrayOf("n"), 3201 to arrayOf("at"), 3209 to arrayOf("size"), 3211 to arrayOf("n", "total"), 3228 to arrayOf("n"), 3229 to arrayOf("what"), 3232 to arrayOf("device"), 3233 to arrayOf("device"), 3242 to arrayOf("word", "count"), 3243 to arrayOf("heard"), 3255 to arrayOf("files"), 3256 to arrayOf("files"), 3259 to arrayOf("name"), 3287 to arrayOf("n"), 3288 to arrayOf("n"), 3299 to arrayOf("n"), 3333 to arrayOf("root"), 3334 to arrayOf("path"), 3357 to arrayOf("name"), 3360 to arrayOf("until"), 3361 to arrayOf("error"), 3368 to arrayOf("url"), 3372 to arrayOf("name"), 3373 to arrayOf("name"), 3381 to arrayOf("code", "hub", "until"), 3382 to arrayOf("url"), 3386 to arrayOf("kinds"), 3387 to arrayOf("address"), 3389 to arrayOf("address"), 3392 to arrayOf("url"), 3393 to arrayOf("url"), 3394 to arrayOf("url"), 3395 to arrayOf("url", "via"), 3400 to arrayOf("name"), 3401 to arrayOf("url", "check", "left"), 3403 to arrayOf("check"), 3404 to arrayOf("address"), 3405 to arrayOf("name"), 3406 to arrayOf("error"), 3407 to arrayOf("url"), 3408 to arrayOf("url"), 3415 to arrayOf("code", "address", "left"), 3421 to arrayOf("name"), 3422 to arrayOf("name"), 3433 to arrayOf("address"), 3440 to arrayOf("code", "body"), 3443 to arrayOf("code", "body"), 3449 to arrayOf("window", "used"), 3450 to arrayOf("window", "used", "when"), 3451 to arrayOf("window", "used"), 3452 to arrayOf("window", "used", "when"), 3453 to arrayOf("provider"), 3465 to arrayOf("label"), 3466 to arrayOf("when"), 3468 to arrayOf("provider"), 3469 to arrayOf("provider", "title", "why"), 3489 to arrayOf("reason"), 3497 to arrayOf("code"), 3506 to arrayOf("name"), 3509 to arrayOf("version"), 3510 to arrayOf("version"), 3511 to arrayOf("version"), 3513 to arrayOf("version"), 3514 to arrayOf("version"), 3515 to arrayOf("version"), 3516 to arrayOf("version", "why"), 3517 to arrayOf("version"), 3519 to arrayOf("code"), 3535 to arrayOf("name"), 3542 to arrayOf("count"), 3543 to arrayOf("title"), 3544 to arrayOf("name"), 3547 to arrayOf("n", "holder"), 3548 to arrayOf("n", "title"), 3549 to arrayOf("title"), 3552 to arrayOf("n"), 3553 to arrayOf("n"), 3554 to arrayOf("n"), 3555 to arrayOf("n"), 3556 to arrayOf("harness", "typed", "type", "remote", "host", "wt", "branch"), 3566 to arrayOf("pid"), 3571 to arrayOf("left"), 3572 to arrayOf("left"), 3578 to arrayOf("left"), 3579 to arrayOf("left"), 3580 to arrayOf("left"), 3581 to arrayOf("left"), 3582 to arrayOf("label", "left"), 3583 to arrayOf("when"), 3584 to arrayOf("used"), 3585 to arrayOf("used", "limit"), 3607 to arrayOf("tracking"), 3611 to arrayOf("total"), 3612 to arrayOf("price"), 3613 to arrayOf("price"), 3618 to arrayOf("n"), 3619 to arrayOf("parts"), 3620 to arrayOf("note"), 3621 to arrayOf("error"), 3622 to arrayOf("error", "parts"), 3627 to arrayOf("state"), 3628 to arrayOf("name", "path"), 3629 to arrayOf("name", "path", "why"), 3631 to arrayOf("code"), 3635 to arrayOf("detail"), 3637 to arrayOf("why"), 3638 to arrayOf("parts"), 3641 to arrayOf("build", "to"), 3642 to arrayOf("build"), 3643 to arrayOf("build", "skip"), 3645 to arrayOf("why"), 3646 to arrayOf("why"), 3647 to arrayOf("build"), 3648 to arrayOf("build", "why"), 3649 to arrayOf("build"), 3650 to arrayOf("build"), 3654 to arrayOf("build"), 3655 to arrayOf("build"), 3657 to arrayOf("build"), 3664 to arrayOf("build"), 3698 to arrayOf("step"), 3699 to arrayOf("p", "pt", "t", "tt", "e", "et"), 3700 to arrayOf("done", "total"), 3701 to arrayOf("n"), 3702 to arrayOf("n"), 3703 to arrayOf("n"), 3708 to arrayOf("n"), 3711 to arrayOf("why"), 3712 to arrayOf("why", "from"), 3713 to arrayOf("error"), 3715 to arrayOf("n"), 3716 to arrayOf("n"), 3720 to arrayOf("n"), 3723 to arrayOf("name", "gb", "path"), 3724 to arrayOf("path", "why"), 3725 to arrayOf("names"), 3727 to arrayOf("why"), 3738 to arrayOf("n", "total"), 3742 to arrayOf("title"), 3744 to arrayOf("n"), 3748 to arrayOf("name"), 3749 to arrayOf("title"), 3750 to arrayOf("note"), 3752 to arrayOf("machine"), 3753 to arrayOf("machines"), 3754 to arrayOf("machine"), 3765 to arrayOf("n"), 3767 to arrayOf("n"), 3771 to arrayOf("name"), 3774 to arrayOf("name"), 3791 to arrayOf("why"), 3797 to arrayOf("project"), 3838 to arrayOf("path"), 3839 to arrayOf("path"), 3841 to arrayOf("have", "total"), 3846 to arrayOf("n"), 3855 to arrayOf("hub"), 3858 to arrayOf("title"), 3862 to arrayOf("project"), 3863 to arrayOf("project"), 3864 to arrayOf("n"), 3865 to arrayOf("hub"), 3867 to arrayOf("n"), 3868 to arrayOf("n"), 3869 to arrayOf("model"), 3875 to arrayOf("name"), 3894 to arrayOf("word"), 3900 to arrayOf("answer"), 3910 to arrayOf("version", "build"), 3911 to arrayOf("hub"), 3916 to arrayOf("name"), 3919 to arrayOf("when", "who", "mark"), 3923 to arrayOf("who"), 3927 to arrayOf("time"), 3928 to arrayOf("address"), 3930 to arrayOf("kind", "name"), 3945 to arrayOf("title"), 3946 to arrayOf("query"), 3949 to arrayOf("room"), 3950 to arrayOf("query"), 3952 to arrayOf("n"), 3953 to arrayOf("n"), 3954 to arrayOf("n"), 3960 to arrayOf("size"), 3964 to arrayOf("n"), 3965 to arrayOf("n"), 3966 to arrayOf("n"), 3980 to arrayOf("status"), 3982 to arrayOf("status"), 4133 to arrayOf("code"), 4135 to arrayOf("n"), 4137 to arrayOf("why"), 4149 to arrayOf("done", "of"), 4153 to arrayOf("thread"), 4156 to arrayOf("n"), 4164 to arrayOf("title"), 4165 to arrayOf("note"), 4166 to arrayOf("label"), 4167 to arrayOf("machine"), 4168 to arrayOf("machine"), 4175 to arrayOf("at", "total"), 4176 to arrayOf("at", "total"), 4180 to arrayOf("machine"), 4181 to arrayOf("machine"), 4182 to arrayOf("machines"), 4184 to arrayOf("device"), 4191 to arrayOf("price"), 4192 to arrayOf("price"), 4199 to arrayOf("home"), 4204 to arrayOf("from"), 4206 to arrayOf("note"), 4207 to arrayOf("note"), 4209 to arrayOf("v"), 4210 to arrayOf("v"), 4211 to arrayOf("v", "who"), 4213 to arrayOf("who"), 4214 to arrayOf("v"), 4216 to arrayOf("v", "cmd"), 4217 to arrayOf("cmd"), 4222 to arrayOf("v", "path"), 4223 to arrayOf("v", "note"), 4224 to arrayOf("v"), 4229 to arrayOf("tool"), 4230 to arrayOf("tool"), 4255 to arrayOf("n", "w"), 4256 to arrayOf("why"), 4257 to arrayOf("state", "why"), 4269 to arrayOf("project"), 4270 to arrayOf("n"), 4281 to arrayOf("why"), 4287 to arrayOf("name"), 4298 to arrayOf("project"), 4303 to arrayOf("n"), 4311 to arrayOf("names"), 4319 to arrayOf("dest"), 4321 to arrayOf("repo"), 4322 to arrayOf("repo"), 4324 to arrayOf("url"), 4339 to arrayOf("time"), 4361 to arrayOf("group"), 4365 to arrayOf("project"), 4366 to arrayOf("n"), 4367 to arrayOf("n"), 4368 to arrayOf("n"), 4376 to arrayOf("n"), 4433 to arrayOf("n"), 4434 to arrayOf("n"), 4435 to arrayOf("a", "b"), 4436 to arrayOf("n"), 4438 to arrayOf("parts", "lines"), 4439 to arrayOf("n"), 4470 to arrayOf("what", "project", "fab"), 4471 to arrayOf("rev", "day"), 4479 to arrayOf("n"), 4490 to arrayOf("layer"), 4491 to arrayOf("n"), 4496 to arrayOf("board"), 4508 to arrayOf("others"), 4509 to arrayOf("must", "should", "notes"), 4510 to arrayOf("id", "w"), 4520 to arrayOf("what"), 4523 to arrayOf("why"), 4524 to arrayOf("why"), 4531 to arrayOf("n"), 4547 to arrayOf("price", "n"), 4548 to arrayOf("n", "need"), 4549 to arrayOf("n"), 4550 to arrayOf("n"), 4551 to arrayOf("cost"), 4552 to arrayOf("cost"), 4565 to arrayOf("day", "n"), 4566 to arrayOf("day"), 4567 to arrayOf("cost", "n", "lines"), 4568 to arrayOf("stock", "price"), 4569 to arrayOf("lines"), 4590 to arrayOf("host"), 4601 to arrayOf("n"), 4602 to arrayOf("a", "b"), 4603 to arrayOf("n"), 4604 to arrayOf("n"), 4607 to arrayOf("day"), 4608 to arrayOf("n"), 4649 to arrayOf("turn"), 4763 to arrayOf("text"), 4766 to arrayOf("repo", "dest"), 4767 to arrayOf("repo", "dest"), 4768 to arrayOf("repo"), 4773 to arrayOf("dir"), 4774 to arrayOf("dir"), 4778 to arrayOf("editor", "job", "secs"), 4779 to arrayOf("editor", "secs"), 4780 to arrayOf("editor"), 4797 to arrayOf("time"), 4803 to arrayOf("status"), 4811 to arrayOf("time"), 4812 to arrayOf("time", "dur"), 4815 to arrayOf("answer"), 4819 to arrayOf("type"), 4820 to arrayOf("max"), 4848 to arrayOf("bytes", "tokens"), 4881 to arrayOf("what"), 4885 to arrayOf("n"), 4887 to arrayOf("n"), 4911 to arrayOf("n"), 4912 to arrayOf("done", "total"), 4920 to arrayOf("v"), 4921 to arrayOf("x", "y"), 4927 to arrayOf("machine"), 4930 to arrayOf("days"), 4931 to arrayOf("warnings"), 4937 to arrayOf("n"), 4942 to arrayOf("n"), 4944 to arrayOf("found", "total", "q"), 4947 to arrayOf("model"), 4948 to arrayOf("model", "conf")) } + internal val exactKey: IntArray by lazy { intArrayOf(0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3169, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 3737, 61, 62, 63, 64, 66, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 84, 85, 3776, 87, 88, 98, 99, 3098, 3775, 102, 103, 105, 106, 107, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 159, 161, 162, 163, 3218, 165, 166, 3220, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 3179, 183, 187, 189, 193, 194, 195, 197, 198, 199, 200, 201, 202, 206, 209, 213, 215, 216, 217, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 234, 235, 2985, 237, 238, 239, 240, 3736, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 260, 262, 263, 264, 265, 266, 267, 270, 271, 272, 273, 275, 279, 280, 281, 282, 286, 287, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 300, 301, 3190, 305, 306, 307, 308, 309, 310, 311, 313, 314, 315, 317, 319, 333, 3784, 336, 3783, 3786, 340, 3796, 342, 343, 344, 345, 354, 3167, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 2988, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 2980, 2981, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 453, 454, 455, 3197, 457, 458, 459, 460, 461, 2970, 463, 464, 465, 3100, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 556, 557, 558, 559, 560, 561, 562, 563, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 592, 628, 629, 630, 3205, 3206, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 651, 652, 3849, 654, 656, 657, 659, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 680, 681, 682, 683, 684, 686, 687, 689, 690, 692, 693, 694, 695, 698, 704, 724, 728, 729, 730, 731, 732, 3781, 734, 735, 736, 737, 3204, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 3764, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 843, 844, 845, 847, 848, 3200, 850, 852, 853, 854, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 3774, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 3851, 903, 904, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 3170, 964, 965, 966, 967, 968, 969, 3799, 971, 3025, 3082, 974, 975, 976, 978, 979, 987, 988, 989, 991, 992, 993, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 3802, 1020, 1021, 1022, 1025, 1029, 1030, 1031, 2977, 3051, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1045, 1046, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1082, 1083, 1086, 1087, 1088, 1090, 1091, 1092, 3816, 1094, 1095, 1098, 1099, 1100, 3199, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 3801, 1120, 1123, 1124, 1125, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1150, 1151, 1152, 1153, 1154, 1155, 1158, 1162, 1163, 1165, 1170, 1171, 1172, 1173, 1176, 1178, 1180, 1181, 1182, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1220, 1222, 1223, 2979, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1240, 1241, 1244, 1245, 1246, 1247, 1248, 1250, 1253, 1254, 1255, 1256, 1257, 1258, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1277, 1278, 1279, 1280, 1281, 1288, 1289, 1290, 1291, 1294, 1296, 1297, 1298, 1299, 1301, 1305, 1306, 1308, 1309, 1310, 1311, 1315, 1316, 1318, 1319, 1320, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1335, 1338, 1339, 1340, 1341, 1344, 1347, 1348, 1356, 1357, 3514, 1361, 1362, 1363, 1364, 1365, 1366, 3581, 1373, 1375, 1380, 1384, 1385, 3055, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 2982, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 3099, 3592, 1436, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 3594, 1473, 1474, 1475, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1493, 1494, 3739, 1496, 1497, 1498, 3751, 3757, 1501, 1502, 1503, 1504, 1505, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1523, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1573, 1574, 1575, 1576, 1578, 1579, 1580, 1581, 1582, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 3058, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 3468, 1670, 1671, 1672, 1673, 3469, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 2991, 1692, 1694, 1696, 1698, 1702, 1706, 1712, 1714, 1715, 1716, 1718, 1719, 1720, 1721, 1722, 1723, 1725, 1727, 1728, 1729, 1730, 1731, 1733, 1734, 3763, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1744, 1745, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1826, 1827, 3034, 1836, 1838, 1842, 3016, 1844, 1845, 3017, 1847, 1848, 1852, 3081, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1864, 1869, 1871, 1872, 1873, 1874, 1875, 1876, 3096, 1878, 1879, 1882, 1883, 1893, 1894, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1942, 1943, 1945, 1946, 1956, 1958, 1959, 1962, 1963, 1966, 1967, 1968, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1988, 1994, 1995, 1996, 1997, 2001, 3157, 2007, 2008, 2010, 2011, 2012, 2013, 3809, 3810, 2022, 2024, 2025, 2026, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2039, 2040, 2042, 2043, 2046, 2047, 3142, 3143, 3144, 2055, 3370, 2057, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2074, 2075, 2076, 2077, 2078, 2079, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2112, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2127, 2128, 2129, 3084, 2133, 2134, 2135, 2137, 2139, 2140, 2141, 2142, 3007, 3132, 3133, 3134, 3135, 3136, 2149, 2150, 2151, 2153, 3009, 3010, 3000, 2999, 2159, 3001, 2161, 3005, 2163, 3368, 2168, 2172, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 3035, 2188, 2189, 2190, 2191, 3068, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2204, 3381, 2206, 2207, 2208, 2209, 3050, 2211, 2212, 2213, 2214, 2998, 2216, 3113, 2219, 2223, 2224, 3658, 2226, 2227, 3745, 3746, 2231, 3195, 2234, 3734, 2237, 2238, 2239, 2240, 2241, 3794, 2243, 3165, 2245, 3164, 2247, 2249, 2251, 2252, 2253, 2257, 2260, 2262, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2279, 2280, 2281, 3752, 2283, 2284, 2286, 3042, 3040, 3044, 2292, 2294, 2295, 2301, 2302, 2303, 2304, 3080, 2309, 2310, 2312, 2317, 2318, 3024, 3593, 2987, 2986, 2989, 3109, 3112, 2331, 2332, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 3813, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2374, 2376, 2377, 2378, 2382, 2383, 2386, 2387, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2408, 2409, 2410, 2411, 2412, 2413, 2435, 2436, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2455, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2469, 2470, 2471, 2472, 2474, 2475, 2476, 2478, 2481, 2482, 2483, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2544, 2546, 2547, 2548, 2549, 3146, 2551, 2553, 2554, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2565, 2566, 2567, 2568, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2587, 2588, 2589, 2590, 2593, 2594, 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2614, 2616, 2617, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2630, 2631, 2633, 2634, 2635, 2636, 2637, 2638, 2639, 2640, 2641, 2642, 2643, 2645, 2647, 2650, 2652, 3742, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2667, 2668, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2678, 2679, 2680, 2685, 2686, 2687, 2689, 2690, 2691, 2692, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 3715, 2708, 2709, 2711, 3712, 2713, 2714, 3716, 3713, 2726, 2730, 3723, 3219, 3724, 2734, 3725, 2736, 2738, 3727, 2740, 3728, 2742, 2744, 3732, 3710, 3703, 3711, 2763, 2764, 2766, 2767, 2777, 2778, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 2787, 2788, 2792, 2795, 2798, 2800, 2802, 2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819, 2820, 3390, 2822, 2823, 2824, 2825, 2826, 2828, 2830, 2831, 3422, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, 2850, 2851, 2852, 2853, 2856, 2857, 2859, 2860, 2861, 2862, 3014, 2864, 2866, 2867, 2869, 2870, 2871, 2872, 2873, 2875, 2876, 2880, 2883, 2884, 2885, 2887, 2888, 2889, 2891, 2892, 2893, 2894, 2896, 2897, 2900, 2903, 2904, 2905, 2906, 2907, 2909, 2911, 2912, 2914, 2915, 2916, 2917, 2918, 2919, 2920, 2921, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2948, 2949, 2950, 2952, 2953, 2954, 2958, 2959, 2960, 2961, 2962, 2966, 2967, 2971, 2972, 2973, 2974, 2975, 2976, 2978, 2983, 2984, 2990, 2995, 2997, 3002, 3003, 3004, 3006, 3008, 3011, 3012, 3013, 3015, 3019, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3036, 3037, 3038, 3039, 3043, 3045, 3046, 3047, 3048, 3052, 3053, 3057, 3059, 3060, 3061, 3063, 3064, 3065, 3066, 3067, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3085, 3086, 3087, 3088, 3093, 3094, 3095, 3097, 3101, 3102, 3103, 3104, 3105, 3108, 3110, 3111, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3124, 3126, 3127, 3128, 3129, 3130, 3131, 3137, 3138, 3139, 3140, 3141, 3145, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3155, 3156, 3159, 3161, 3162, 3163, 3166, 3171, 3172, 3173, 3175, 3178, 3180, 3181, 3183, 3184, 3185, 3187, 3188, 3189, 3191, 3192, 3193, 3194, 3198, 3203, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3216, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3236, 3237, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3263, 3264, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3364, 3365, 3369, 3371, 3372, 3373, 3375, 3376, 3377, 3380, 3382, 3383, 3384, 3385, 3386, 3389, 3391, 3394, 3396, 3397, 3402, 3403, 3404, 3405, 3408, 3415, 3416, 3417, 3418, 3419, 3420, 3423, 3424, 3425, 3426, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3440, 3441, 3442, 3443, 3444, 3445, 3447, 3448, 3450, 3451, 3452, 3453, 3454, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 3467, 3470, 3473, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3513, 3518, 3524, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3542, 3543, 3544, 3545, 3546, 3547, 3551, 3552, 3556, 3557, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3573, 3574, 3575, 3576, 3579, 3580, 3582, 3583, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3614, 3615, 3616, 3620, 3621, 3622, 3623, 3629, 3630, 3631, 3632, 3636, 3638, 3639, 3640, 3642, 3645, 3646, 3650, 3657, 3659, 3662, 3664, 3665, 3666, 3667, 3668, 3669, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3720, 3735, 3738, 3740, 3741, 3743, 3747, 3749, 3753, 3762, 3765, 3766, 3767, 3768, 3769, 3770, 3772, 3778, 3779, 3782, 3785, 3787, 3788, 3789, 3790, 3791, 3792, 3795, 3798, 3800, 3804, 3805, 3806, 3807, 3808, 3811, 3812, 3814, 3815, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3826, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, 3842, 3843, 3846, 3848, 3850, 3859, 3860, 3862, 3863, 3872, 3878, 3884, 3893, 3895, 3896, 3897, 3898, 3901, 3902, 3904, 3910, 3914, 3918, 3923, 3924, 3926, 3927, 3928, 3930, 3931, 3932, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3948, 3949, 3950, 3995, 3996, 4001, 4003, 4004, 4006, 4012, 4015, 4030, 4031, 4032, 4033, 4034, 4035, 4037, 4038, 4040, 4041, 4043, 4045, 4046, 4059, 4062, 4063, 4065, 4066, 4070, 4075, 4078, 4079, 4081, 4082, 4088, 4090, 4091, 4094, 4096, 4101, 4102, 4103, 4108, 4119, 4142, 4158, 4166, 4175, 4176, 4180, 4185, 4201, 4202, 4203, 4204, 4206, 4208, 4209, 4211, 4214, 4218, 4221, 4224, 4225, 4226, 4227, 4231, 4232, 4233, 4234, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4268, 4271, 4272, 4278, 4283, 4284, 4285, 4286, 4290, 4294, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4305, 4306, 4307, 4308, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 4326, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4346, 4347, 4351, 4352, 4354, 4355, 4356, 4357, 4361, 4362, 4363, 4364, 4365, 4366, 4368, 4369, 4370, 4376, 4377, 4378, 4379, 4380, 4381, 4385, 4389, 4390, 4392, 4393, 4394, 4395, 4396, 4398, 4408, 4410, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4443, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4468, 4469, 4470, 4472, 4473, 4474, 4475, 4478, 4479, 4480, 4482, 4483, 4484, 4486, 4487, 4488, 4489, 4490, 4491, 4493, 4495, 4498, 4499, 4500, 4501, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4517, 4519, 4520, 4521, 4522, 4523, 4527, 4528, 4532, 4533, 4534, 4536, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4576, 4577, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4611, 4612, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4630, 4631, 4632, 4633, 4642, 4643, 4644, 4645, 4646, 4647, 4649, 4652, 4653, 4654, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 4757, 4762, 4763, 4764, 4770, 4783, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4804, 4805, 4806, 4807, 4808, 4810, 4811, 4812, 4813, 4814, 4815, 4816, 4819, 4820, 4822, 4823, 4824, 4827, 4828, 4829, 4830, 4831, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841, 4842, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4851, 4852, 4853, 4855, 4856, 4857, 4858, 4859, 4860, 4861, 4862, 4863, 4864, 4865, 4866, 4867, 4868, 4869, 4870, 4871, 4872, 4873, 4874, 4875, 4876, 4877, 4878, 4879, 4880, 4881, 4882, 4883, 4884, 4885, 4886, 4888, 4889, 4890, 4892, 4894, 4896, 4897, 4898, 4899, 4902, 4904, 4905, 4906, 4907, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4919, 4923, 4924, 4928, 4929, 4930, 4931, 4932, 4934, 4935, 4938, 4939, 4940, 4941, 4942, 4944, 4945, 4946, 4947, 4949, 4951, 4952, 4955, 4956, 4957, 4958, 4959, 4960) } + internal val templates: IntArray by lazy { intArrayOf(2375, 2854, 2666, 2665, 2664, 2886, 2908, 3388, 2629, 418, 2799, 2797, 2693, 2384, 2390, 2801, 2898, 2613, 2612, 285, 2342, 2803, 2910, 3238, 4190, 2552, 4933, 2602, 2050, 2380, 3722, 2115, 2729, 2385, 3239, 1336, 4210, 4230, 3721, 2570, 2727, 1867, 4205, 2126, 2167, 2173, 4572, 283, 2116, 4514, 3400, 3421, 2073, 2353, 3718, 452, 2761, 2793, 2794, 3401, 3717, 2762, 3649, 609, 1711, 3726, 1868, 2737, 3729, 2743, 3392, 616, 617, 2779, 3090, 3704, 1659, 2796, 3648, 303, 614, 69, 711, 621, 2352, 4228, 1121, 2494, 3471, 3844, 1242, 2202, 2581, 3393, 2165, 3733, 714, 1763, 1964, 2749, 2758, 2969, 4235, 3395, 3407, 136, 594, 596, 2569, 2724, 1865, 4223, 3041, 610, 2289, 2592, 3881, 1302, 4222, 3517, 3654, 3655, 158, 2080, 2082, 2117, 2849, 4371, 2171, 2379, 2522, 3643, 214, 284, 1276, 2014, 4803, 3512, 3521, 3522, 67, 83, 218, 619, 4608, 3541, 1360, 4317, 3366, 3731, 726, 1023, 1372, 2393, 2485, 2747, 4373, 89, 2392, 2407, 2922, 624, 1657, 1954, 2836, 4502, 3414, 1577, 2101, 2293, 2583, 4554, 3409, 3475, 3525, 650, 1888, 3936, 3174, 3516, 3562, 3626, 3845, 1317, 1866, 2045, 2431, 2718, 3864, 4573, 3428, 3474, 1841, 1863, 3363, 593, 1292, 1346, 1371, 1953, 3503, 3705, 221, 1701, 2750, 2947, 3092, 3160, 3449, 258, 591, 1026, 1379, 1965, 1989, 4143, 3446, 3572, 655, 1342, 1717, 2051, 3168, 3367, 3628, 3647, 710, 1283, 1370, 1382, 1658, 1732, 1895, 2381, 2484, 2582, 3951, 4229, 4439, 3427, 3495, 3641, 649, 699, 1044, 2618, 3186, 3305, 3708, 108, 184, 606, 721, 1081, 1969, 2049, 2111, 2169, 2417, 2498, 2754, 2790, 2834, 3956, 4485, 4826, 3387, 3458, 3619, 160, 623, 701, 1332, 1333, 1345, 1520, 1660, 2166, 2170, 2263, 2416, 2644, 4198, 4515, 3123, 3215, 3262, 3340, 3554, 3709, 3719, 703, 1183, 1572, 1897, 2258, 2261, 2497, 2755, 2775, 2776, 2944, 2945, 3966, 3986, 4219, 4476, 4809, 4825, 3627, 3644, 3750, 1378, 1492, 1584, 1703, 1955, 2437, 2449, 2774, 4162, 4220, 4516, 4607, 3089, 3091, 3106, 3624, 3637, 3803, 723, 1024, 1832, 2138, 2203, 2427, 2770, 2771, 3971, 4217, 4293, 4304, 3293, 3413, 91, 93, 595, 715, 1027, 1350, 1355, 2020, 2333, 2432, 2717, 2769, 2773, 3933, 4555, 4887, 3020, 3021, 3523, 3587, 3730, 94, 1251, 1259, 1353, 1377, 1519, 1583, 1880, 2186, 2218, 2477, 2495, 2745, 3873, 3874, 4216, 4382, 4445, 4891, 3339, 3378, 3379, 3457, 3613, 299, 599, 618, 700, 1109, 1117, 1175, 1367, 1518, 1626, 1948, 2130, 2136, 2154, 2221, 2447, 2452, 2454, 2677, 2710, 2768, 2946, 2963, 2964, 4187, 4213, 4330, 3022, 3176, 3553, 3586, 3755, 211, 585, 590, 605, 717, 720, 906, 990, 1084, 1159, 1334, 1470, 1524, 1705, 1886, 1906, 1926, 1961, 1991, 2072, 2316, 2430, 2496, 2951, 3900, 3952, 4170, 4556, 4574, 4575, 4774, 4936, 3083, 3439, 3634, 3635, 92, 96, 269, 603, 648, 712, 980, 1331, 1707, 1887, 1944, 2114, 2425, 2451, 2453, 2456, 2545, 2683, 2719, 2901, 2913, 4261, 4558, 4786, 2996, 3261, 3294, 3374, 3472, 3591, 3625, 208, 277, 316, 329, 330, 1287, 1352, 1376, 1521, 1522, 1949, 2019, 2044, 2113, 2220, 2248, 2299, 2419, 2434, 2446, 2720, 2723, 2804, 2805, 3871, 4571, 4769, 4943, 3018, 3406, 3410, 3459, 3515, 3670, 3707, 3760, 6, 244, 304, 600, 604, 1047, 1221, 1286, 1354, 1359, 1708, 1709, 1884, 1957, 1960, 2018, 2021, 2152, 2187, 2235, 2418, 2426, 2646, 2752, 2791, 2868, 3868, 3869, 3929, 4186, 4772, 4784, 4785, 4954, 3456, 3578, 3585, 3590, 3652, 3660, 268, 318, 322, 331, 583, 707, 722, 1076, 1160, 1164, 1284, 1285, 1312, 1517, 1710, 1828, 1889, 2009, 2222, 2228, 2389, 2415, 2421, 2448, 2580, 2681, 3934, 4159, 4212, 4275, 4374, 4444, 4655, 4773, 4948, 3069, 3154, 3519, 3520, 3618, 3651, 65, 210, 274, 587, 608, 613, 708, 713, 984, 1075, 1167, 1369, 1713, 1743, 1829, 1834, 1849, 1885, 2048, 2081, 2278, 2296, 2305, 2414, 2468, 2480, 2772, 4197, 3049, 3399, 3584, 3653, 3661, 3706, 90, 207, 288, 320, 323, 324, 349, 597, 607, 709, 855, 905, 1166, 1169, 1252, 1437, 1890, 2005, 2015, 2420, 2429, 2473, 2751, 2789, 2943, 2957, 3906, 4817, 4818, 4821, 4917, 3023, 3054, 3107, 3177, 3235, 3248, 3249, 3412, 3560, 3561, 3633, 3656, 3663, 3714, 110, 186, 190, 191, 212, 321, 327, 328, 352, 375, 580, 582, 589, 625, 727, 851, 977, 1077, 1118, 1147, 1243, 1304, 1314, 1746, 1830, 1831, 1839, 1950, 1951, 1952, 2041, 2254, 2256, 2285, 2297, 2298, 2320, 2388, 2422, 2423, 2479, 2585, 2586, 2669, 2684, 2716, 2721, 2722, 2759, 2806, 2807, 3852, 3870, 3916, 3970, 4215, 4309, 4327, 4345, 4372, 4442, 4477, 4529, 4553, 4614, 4854, 4937, 4953, 3056, 3158, 3182, 3196, 3217, 3398, 3411, 3555, 3559, 3589, 3617, 3748, 3758, 3759, 3771, 3773, 3780, 5, 8, 82, 185, 188, 192, 257, 276, 325, 326, 348, 351, 356, 598, 620, 658, 696, 705, 856, 985, 1048, 1122, 1148, 1149, 1168, 1179, 1239, 1383, 1491, 1649, 1693, 1704, 1850, 1881, 1947, 1993, 2006, 2027, 2250, 2255, 2308, 2314, 2315, 2322, 2433, 2619, 2655, 2829, 3917, 3925, 3955, 3972, 4139, 4174, 4188, 4236, 4276, 4328, 4367, 4530, 4557, 4950, 3079, 3125, 3201, 3202, 3207, 3265, 3549, 154, 259, 261, 347, 350, 353, 579, 602, 612, 702, 706, 982, 1078, 1381, 1593, 1833, 1925, 1987, 1990, 2306, 2319, 2391, 2438, 2584, 2632, 2874, 3875, 3922, 3988, 4155, 4526, 4613, 3455, 3548, 3550, 3558, 3577, 3588, 3756, 3777, 3797, 95, 196, 203, 204, 205, 242, 243, 346, 581, 586, 601, 615, 622, 626, 627, 691, 716, 725, 983, 986, 1085, 1089, 1161, 1174, 1204, 1349, 1471, 1506, 1688, 1689, 1691, 1726, 1851, 1891, 2233, 2311, 2321, 2428, 2450, 2458, 2965, 4141, 4171, 4172, 4262, 4287, 4325, 4440, 4496, 4537, 4893, 4918) } + internal val argNames: Map> by lazy { mapOf(5 to arrayOf("n"), 6 to arrayOf("n"), 7 to arrayOf("who"), 8 to arrayOf("title"), 65 to arrayOf("state"), 67 to arrayOf("listen"), 69 to arrayOf("listen"), 82 to arrayOf("version"), 83 to arrayOf("count", "plural"), 89 to arrayOf("size", "limit"), 90 to arrayOf("name"), 91 to arrayOf("dir"), 92 to arrayOf("dir"), 93 to arrayOf("name"), 94 to arrayOf("name"), 95 to arrayOf("path"), 96 to arrayOf("path"), 97 to arrayOf("name"), 108 to arrayOf("first"), 110 to arrayOf("n"), 136 to arrayOf("count", "plural"), 154 to arrayOf("tool"), 158 to arrayOf("n"), 160 to arrayOf("name"), 184 to arrayOf("pid", "cmd"), 185 to arrayOf("title", "ago"), 186 to arrayOf("name", "who", "n"), 188 to arrayOf("line"), 190 to arrayOf("n"), 191 to arrayOf("n"), 192 to arrayOf("n"), 196 to arrayOf("name"), 203 to arrayOf("when"), 204 to arrayOf("text", "when"), 205 to arrayOf("when"), 207 to arrayOf("count", "plural"), 208 to arrayOf("count", "plural"), 210 to arrayOf("took", "ago"), 211 to arrayOf("ago"), 212 to arrayOf("kind"), 214 to arrayOf("kind", "code", "why"), 218 to arrayOf("clock"), 221 to arrayOf("build"), 242 to arrayOf("step"), 243 to arrayOf("turn"), 244 to arrayOf("branch"), 257 to arrayOf("step", "total"), 258 to arrayOf("step", "total"), 259 to arrayOf("when"), 261 to arrayOf("tool"), 268 to arrayOf("count", "plural"), 269 to arrayOf("count", "total"), 274 to arrayOf("old", "new"), 276 to arrayOf("version"), 277 to arrayOf("count"), 278 to arrayOf("tag"), 283 to arrayOf("version"), 284 to arrayOf("old", "version"), 285 to arrayOf("version"), 288 to arrayOf("version"), 299 to arrayOf("project", "location"), 303 to arrayOf("account"), 304 to arrayOf("account"), 316 to arrayOf("n"), 318 to arrayOf("n"), 320 to arrayOf("minute"), 321 to arrayOf("time"), 322 to arrayOf("time"), 323 to arrayOf("clock"), 324 to arrayOf("clock", "took"), 325 to arrayOf("clock"), 326 to arrayOf("clock", "took"), 327 to arrayOf("clock"), 328 to arrayOf("clock", "took"), 329 to arrayOf("clock"), 330 to arrayOf("clock", "took"), 331 to arrayOf("clock"), 346 to arrayOf("target"), 347 to arrayOf("target"), 348 to arrayOf("target"), 349 to arrayOf("target"), 350 to arrayOf("target"), 351 to arrayOf("target"), 352 to arrayOf("target"), 353 to arrayOf("target"), 356 to arrayOf("name"), 375 to arrayOf("t"), 418 to arrayOf("minutes", "plural"), 452 to arrayOf("path"), 579 to arrayOf("count"), 580 to arrayOf("count"), 581 to arrayOf("title"), 582 to arrayOf("path"), 583 to arrayOf("path", "error"), 584 to arrayOf("first", "last", "count"), 585 to arrayOf("task", "step"), 586 to arrayOf("count"), 587 to arrayOf("path"), 588 to arrayOf("count", "plural"), 589 to arrayOf("label"), 590 to arrayOf("provider"), 591 to arrayOf("version"), 593 to arrayOf("key"), 594 to arrayOf("device"), 595 to arrayOf("kind", "device"), 596 to arrayOf("status"), 597 to arrayOf("kind", "title"), 598 to arrayOf("layer"), 599 to arrayOf("error"), 600 to arrayOf("page"), 601 to arrayOf("page", "kind", "total"), 602 to arrayOf("reason"), 603 to arrayOf("tag"), 604 to arrayOf("tag"), 605 to arrayOf("title"), 606 to arrayOf("title"), 607 to arrayOf("text", "time"), 608 to arrayOf("kind", "device"), 609 to arrayOf("device"), 610 to arrayOf("device"), 611 to arrayOf("word"), 612 to arrayOf("word", "kind", "count"), 613 to arrayOf("error"), 614 to arrayOf("count"), 615 to arrayOf("time", "relative", "rel", "zoned", "zone"), 616 to arrayOf("zone"), 617 to arrayOf("zone"), 618 to arrayOf("id", "state", "count", "age"), 619 to arrayOf("id"), 620 to arrayOf("name"), 621 to arrayOf("name"), 622 to arrayOf("clock", "count", "plural"), 623 to arrayOf("name"), 624 to arrayOf("name"), 625 to arrayOf("name"), 626 to arrayOf("count"), 627 to arrayOf("count"), 631 to arrayOf("name", "state"), 632 to arrayOf("author", "place", "state"), 633 to arrayOf("title", "state"), 648 to arrayOf("error"), 649 to arrayOf("error"), 650 to arrayOf("host"), 655 to arrayOf("email"), 658 to arrayOf("version"), 660 to arrayOf("first", "last", "count"), 661 to arrayOf("n"), 662 to arrayOf("n"), 691 to arrayOf("ref"), 696 to arrayOf("name"), 697 to arrayOf("name"), 699 to arrayOf("name"), 700 to arrayOf("name"), 701 to arrayOf("action"), 702 to arrayOf("label"), 703 to arrayOf("count", "plural"), 705 to arrayOf("path"), 706 to arrayOf("word", "kind", "count"), 707 to arrayOf("name"), 708 to arrayOf("name"), 709 to arrayOf("name"), 710 to arrayOf("name"), 711 to arrayOf("url"), 712 to arrayOf("count"), 713 to arrayOf("count"), 714 to arrayOf("device"), 715 to arrayOf("device"), 716 to arrayOf("count"), 717 to arrayOf("label"), 718 to arrayOf("label"), 719 to arrayOf("label"), 720 to arrayOf("title"), 721 to arrayOf("title"), 722 to arrayOf("state"), 723 to arrayOf("open", "kind"), 725 to arrayOf("count"), 726 to arrayOf("email"), 727 to arrayOf("email"), 851 to arrayOf("at", "count"), 855 to arrayOf("name"), 856 to arrayOf("name"), 905 to arrayOf("name"), 906 to arrayOf("name"), 977 to arrayOf("count"), 980 to arrayOf("name"), 981 to arrayOf("name", "count"), 982 to arrayOf("label", "n"), 983 to arrayOf("action"), 984 to arrayOf("count", "plural"), 985 to arrayOf("count"), 986 to arrayOf("waiting", "busy", "done"), 990 to arrayOf("count", "plural"), 1023 to arrayOf("name"), 1024 to arrayOf("name"), 1026 to arrayOf("seconds", "long"), 1027 to arrayOf("size", "triangles", "delayed", "waited", "built"), 1028 to arrayOf("size", "delayed", "waited"), 1044 to arrayOf("name"), 1047 to arrayOf("name"), 1048 to arrayOf("count"), 1075 to arrayOf("state"), 1076 to arrayOf("bytes"), 1077 to arrayOf("count"), 1078 to arrayOf("when"), 1079 to arrayOf("state", "name"), 1080 to arrayOf("name", "state"), 1081 to arrayOf("reason", "code"), 1084 to arrayOf("kind", "code"), 1085 to arrayOf("number"), 1089 to arrayOf("x", "y"), 1096 to arrayOf("state"), 1097 to arrayOf("label", "example"), 1109 to arrayOf("text"), 1117 to arrayOf("error"), 1118 to arrayOf("kind", "count"), 1121 to arrayOf("name"), 1122 to arrayOf("n"), 1147 to arrayOf("ago"), 1148 to arrayOf("name"), 1149 to arrayOf("kind", "place", "hub"), 1159 to arrayOf("label"), 1160 to arrayOf("word"), 1161 to arrayOf("count"), 1164 to arrayOf("hub"), 1166 to arrayOf("count"), 1167 to arrayOf("state"), 1168 to arrayOf("label"), 1169 to arrayOf("label"), 1174 to arrayOf("state", "text"), 1175 to arrayOf("text"), 1177 to arrayOf("question"), 1179 to arrayOf("label"), 1183 to arrayOf("title"), 1204 to arrayOf("count"), 1205 to arrayOf("name", "counts"), 1219 to arrayOf("n"), 1221 to arrayOf("mode"), 1238 to arrayOf("first", "last", "total"), 1239 to arrayOf("count"), 1242 to arrayOf("n"), 1243 to arrayOf("who", "name"), 1251 to arrayOf("name"), 1252 to arrayOf("when"), 1259 to arrayOf("why"), 1276 to arrayOf("name"), 1283 to arrayOf("kind"), 1284 to arrayOf("title"), 1285 to arrayOf("title"), 1286 to arrayOf("title"), 1287 to arrayOf("title"), 1292 to arrayOf("name"), 1302 to arrayOf("heard"), 1303 to arrayOf("out", "heard"), 1304 to arrayOf("heard"), 1312 to arrayOf("name", "mb"), 1314 to arrayOf("name"), 1317 to arrayOf("platform"), 1321 to arrayOf("heard", "out", "yes"), 1331 to arrayOf("name", "done", "total", "percent"), 1332 to arrayOf("name", "done"), 1333 to arrayOf("name"), 1334 to arrayOf("error"), 1336 to arrayOf("mb"), 1342 to arrayOf("mb"), 1345 to arrayOf("n"), 1346 to arrayOf("n"), 1349 to arrayOf("n"), 1350 to arrayOf("pct"), 1351 to arrayOf("px"), 1352 to arrayOf("version"), 1353 to arrayOf("tag"), 1354 to arrayOf("tag"), 1355 to arrayOf("hub"), 1359 to arrayOf("tag"), 1360 to arrayOf("tag"), 1367 to arrayOf("when"), 1369 to arrayOf("tag"), 1370 to arrayOf("tag", "when"), 1371 to arrayOf("tag"), 1372 to arrayOf("tag", "when"), 1376 to arrayOf("channel"), 1377 to arrayOf("tag"), 1378 to arrayOf("app", "hub"), 1379 to arrayOf("hub", "app"), 1381 to arrayOf("key"), 1382 to arrayOf("key"), 1383 to arrayOf("why"), 1437 to arrayOf("n"), 1470 to arrayOf("title"), 1471 to arrayOf("note"), 1491 to arrayOf("title"), 1492 to arrayOf("more"), 1506 to arrayOf("bots"), 1517 to arrayOf("name"), 1518 to arrayOf("name", "time"), 1519 to arrayOf("name", "n"), 1520 to arrayOf("name", "time", "n"), 1521 to arrayOf("to"), 1522 to arrayOf("to", "step"), 1524 to arrayOf("note"), 1572 to arrayOf("why"), 1577 to arrayOf("e"), 1583 to arrayOf("max"), 1584 to arrayOf("secs", "max", "mib"), 1593 to arrayOf("path"), 1626 to arrayOf("secs"), 1649 to arrayOf("pct", "scope"), 1657 to arrayOf("n"), 1658 to arrayOf("n"), 1659 to arrayOf("n"), 1660 to arrayOf("n"), 1688 to arrayOf("d", "h"), 1689 to arrayOf("h", "m"), 1690 to arrayOf("m"), 1691 to arrayOf("window", "pct"), 1693 to arrayOf("when"), 1695 to arrayOf("label", "e"), 1697 to arrayOf("from", "to", "total"), 1701 to arrayOf("messages", "lines", "left"), 1703 to arrayOf("pct", "view", "max"), 1704 to arrayOf("pct"), 1705 to arrayOf("done", "total"), 1707 to arrayOf("n"), 1708 to arrayOf("n"), 1709 to arrayOf("time"), 1710 to arrayOf("view", "max"), 1711 to arrayOf("view", "max"), 1713 to arrayOf("more"), 1717 to arrayOf("n"), 1726 to arrayOf("n"), 1732 to arrayOf("page"), 1743 to arrayOf("title"), 1746 to arrayOf("n"), 1763 to arrayOf("name"), 1828 to arrayOf("line"), 1829 to arrayOf("quote"), 1830 to arrayOf("n"), 1831 to arrayOf("n"), 1832 to arrayOf("n"), 1833 to arrayOf("n"), 1834 to arrayOf("n"), 1839 to arrayOf("held"), 1840 to arrayOf("machine"), 1841 to arrayOf("machine"), 1849 to arrayOf("count", "total"), 1850 to arrayOf("count"), 1851 to arrayOf("n"), 1863 to arrayOf("name"), 1865 to arrayOf("n", "c", "total"), 1866 to arrayOf("n", "c"), 1867 to arrayOf("n", "c", "total", "before"), 1868 to arrayOf("n", "c", "before"), 1880 to arrayOf("name"), 1881 to arrayOf("path"), 1884 to arrayOf("file"), 1885 to arrayOf("path", "n"), 1886 to arrayOf("why"), 1887 to arrayOf("n"), 1888 to arrayOf("name"), 1889 to arrayOf("name"), 1890 to arrayOf("name"), 1891 to arrayOf("n"), 1892 to arrayOf("shown", "n"), 1895 to arrayOf("path"), 1897 to arrayOf("n"), 1906 to arrayOf("status"), 1923 to arrayOf("name", "pct"), 1924 to arrayOf("name", "mb"), 1925 to arrayOf("name"), 1926 to arrayOf("name", "why"), 1944 to arrayOf("machine"), 1947 to arrayOf("n"), 1948 to arrayOf("ref"), 1949 to arrayOf("ref", "sheet"), 1950 to arrayOf("name"), 1951 to arrayOf("name"), 1952 to arrayOf("file", "folder"), 1953 to arrayOf("name", "error"), 1954 to arrayOf("name", "status"), 1955 to arrayOf("name", "error"), 1957 to arrayOf("name"), 1960 to arrayOf("code"), 1961 to arrayOf("error"), 1964 to arrayOf("error"), 1965 to arrayOf("error"), 1969 to arrayOf("error"), 1987 to arrayOf("done", "of"), 1989 to arrayOf("why"), 1990 to arrayOf("path"), 1991 to arrayOf("error"), 1992 to arrayOf("secs"), 1993 to arrayOf("secs"), 2005 to arrayOf("code"), 2006 to arrayOf("code"), 2009 to arrayOf("state"), 2014 to arrayOf("hide", "copy", "paste"), 2015 to arrayOf("n"), 2018 to arrayOf("name"), 2019 to arrayOf("name", "folder"), 2020 to arrayOf("name"), 2021 to arrayOf("name", "percent"), 2027 to arrayOf("folder"), 2037 to arrayOf("w", "h"), 2041 to arrayOf("path"), 2044 to arrayOf("why"), 2045 to arrayOf("mb"), 2048 to arrayOf("n"), 2049 to arrayOf("delete", "undo"), 2050 to arrayOf("delete", "undo"), 2051 to arrayOf("undo"), 2072 to arrayOf("what", "secs"), 2073 to arrayOf("file", "holder"), 2080 to arrayOf("what"), 2081 to arrayOf("what"), 2082 to arrayOf("editor", "why"), 2101 to arrayOf("files"), 2111 to arrayOf("why"), 2113 to arrayOf("title"), 2114 to arrayOf("title"), 2115 to arrayOf("version"), 2116 to arrayOf("version", "size", "folder"), 2117 to arrayOf("version", "size", "folder"), 2126 to arrayOf("title"), 2130 to arrayOf("dir", "files"), 2136 to arrayOf("why"), 2138 to arrayOf("code"), 2152 to arrayOf("origin"), 2154 to arrayOf("why"), 2165 to arrayOf("dir"), 2166 to arrayOf("path"), 2167 to arrayOf("home", "other"), 2169 to arrayOf("path"), 2170 to arrayOf("code", "log"), 2171 to arrayOf("log"), 2173 to arrayOf("addr"), 2186 to arrayOf("home"), 2187 to arrayOf("addr"), 2202 to arrayOf("dir", "why"), 2203 to arrayOf("dir"), 2218 to arrayOf("phase"), 2220 to arrayOf("why"), 2221 to arrayOf("what"), 2222 to arrayOf("code"), 2228 to arrayOf("label"), 2233 to arrayOf("kind"), 2235 to arrayOf("project"), 2248 to arrayOf("what"), 2250 to arrayOf("when"), 2254 to arrayOf("n"), 2255 to arrayOf("n"), 2256 to arrayOf("n"), 2258 to arrayOf("agent"), 2259 to arrayOf("effort"), 2261 to arrayOf("n"), 2263 to arrayOf("model"), 2278 to arrayOf("word"), 2285 to arrayOf("more", "step"), 2289 to arrayOf("name"), 2293 to arrayOf("max", "skipped"), 2296 to arrayOf("name"), 2297 to arrayOf("n"), 2298 to arrayOf("name"), 2299 to arrayOf("name"), 2305 to arrayOf("n"), 2306 to arrayOf("name"), 2308 to arrayOf("price"), 2311 to arrayOf("name"), 2313 to arrayOf("name"), 2314 to arrayOf("name"), 2315 to arrayOf("name"), 2316 to arrayOf("text"), 2319 to arrayOf("key"), 2320 to arrayOf("key"), 2321 to arrayOf("pct"), 2322 to arrayOf("when"), 2333 to arrayOf("n", "upstream"), 2342 to arrayOf("mb"), 2352 to arrayOf("path"), 2353 to arrayOf("path"), 2375 to arrayOf("id"), 2379 to arrayOf("model"), 2380 to arrayOf("platform"), 2381 to arrayOf("version"), 2384 to arrayOf("version", "from", "into"), 2385 to arrayOf("version", "from"), 2388 to arrayOf("version", "path"), 2389 to arrayOf("version", "path"), 2390 to arrayOf("version", "pin", "from"), 2391 to arrayOf("path"), 2392 to arrayOf("version", "path"), 2393 to arrayOf("version", "path", "set"), 2407 to arrayOf("turns", "input", "cread", "cwrite", "output", "cost"), 2414 to arrayOf("tool"), 2415 to arrayOf("tool"), 2416 to arrayOf("tool", "word"), 2417 to arrayOf("tool", "word"), 2418 to arrayOf("tool"), 2419 to arrayOf("tool"), 2420 to arrayOf("due"), 2421 to arrayOf("due"), 2422 to arrayOf("due"), 2423 to arrayOf("due"), 2424 to arrayOf("zone"), 2425 to arrayOf("zone"), 2426 to arrayOf("zone"), 2427 to arrayOf("zone"), 2428 to arrayOf("n"), 2429 to arrayOf("who"), 2430 to arrayOf("n", "who"), 2431 to arrayOf("harness"), 2432 to arrayOf("path"), 2433 to arrayOf("path"), 2434 to arrayOf("path"), 2437 to arrayOf("error", "line"), 2438 to arrayOf("label"), 2446 to arrayOf("who"), 2447 to arrayOf("who"), 2448 to arrayOf("label", "left", "when"), 2449 to arrayOf("left"), 2450 to arrayOf("name", "left"), 2451 to arrayOf("used"), 2452 to arrayOf("used", "limit"), 2453 to arrayOf("used", "reason"), 2454 to arrayOf("used", "limit", "reason"), 2456 to arrayOf("provider"), 2457 to arrayOf("used", "window", "pct"), 2458 to arrayOf("rate"), 2468 to arrayOf("n", "r"), 2473 to arrayOf("time", "n"), 2477 to arrayOf("n", "m"), 2479 to arrayOf("pct"), 2480 to arrayOf("cost", "n"), 2484 to arrayOf("in", "out", "cread", "cwrite"), 2485 to arrayOf("in", "out", "cread", "cwrite", "n"), 2494 to arrayOf("turns", "input", "cread", "cwrite", "output"), 2495 to arrayOf("left", "when"), 2496 to arrayOf("left", "when"), 2497 to arrayOf("left", "when"), 2498 to arrayOf("left", "when"), 2522 to arrayOf("n"), 2545 to arrayOf("when"), 2552 to arrayOf("phrase", "now"), 2563 to arrayOf("s"), 2569 to arrayOf("now"), 2570 to arrayOf("now", "nudge", "sent", "undone"), 2580 to arrayOf("e"), 2581 to arrayOf("a", "ams", "b", "bms"), 2582 to arrayOf("ms"), 2583 to arrayOf("e"), 2584 to arrayOf("t"), 2585 to arrayOf("t"), 2586 to arrayOf("t"), 2592 to arrayOf("why"), 2602 to arrayOf("apps"), 2612 to arrayOf("n"), 2613 to arrayOf("n", "k"), 2618 to arrayOf("stt", "conf"), 2619 to arrayOf("words"), 2629 to arrayOf("into"), 2632 to arrayOf("origin"), 2644 to arrayOf("url"), 2646 to arrayOf("url"), 2654 to arrayOf("i", "n"), 2655 to arrayOf("d", "n"), 2664 to arrayOf("version"), 2665 to arrayOf("version"), 2666 to arrayOf("version"), 2669 to arrayOf("path"), 2677 to arrayOf("addr"), 2681 to arrayOf("label"), 2683 to arrayOf("label"), 2684 to arrayOf("label"), 2688 to arrayOf("label"), 2693 to arrayOf("from"), 2710 to arrayOf("done", "of"), 2716 to arrayOf("n"), 2717 to arrayOf("t", "m"), 2718 to arrayOf("m"), 2719 to arrayOf("b", "m"), 2720 to arrayOf("r", "p"), 2721 to arrayOf("n"), 2722 to arrayOf("n"), 2723 to arrayOf("n"), 2724 to arrayOf("n"), 2727 to arrayOf("n"), 2729 to arrayOf("n"), 2737 to arrayOf("n"), 2743 to arrayOf("name", "gb", "path"), 2745 to arrayOf("path", "why"), 2747 to arrayOf("names"), 2749 to arrayOf("why"), 2750 to arrayOf("p", "pn", "t", "tn", "e", "en"), 2751 to arrayOf("done", "total"), 2752 to arrayOf("n"), 2753 to arrayOf("what"), 2754 to arrayOf("n"), 2755 to arrayOf("n"), 2758 to arrayOf("what"), 2759 to arrayOf("n"), 2761 to arrayOf("why", "from"), 2762 to arrayOf("why"), 2768 to arrayOf("path"), 2769 to arrayOf("path", "who"), 2770 to arrayOf("path"), 2771 to arrayOf("path", "cmd"), 2772 to arrayOf("version", "path"), 2773 to arrayOf("version", "path"), 2774 to arrayOf("version", "path", "who"), 2775 to arrayOf("version", "path"), 2776 to arrayOf("version", "path", "cmd"), 2779 to arrayOf("cmd"), 2789 to arrayOf("name", "version", "path"), 2790 to arrayOf("path", "why"), 2791 to arrayOf("name"), 2793 to arrayOf("version", "cli"), 2794 to arrayOf("cli"), 2796 to arrayOf("version"), 2797 to arrayOf("version"), 2799 to arrayOf("version"), 2801 to arrayOf("version"), 2803 to arrayOf("computer"), 2804 to arrayOf("version", "cli"), 2805 to arrayOf("cli"), 2806 to arrayOf("version", "cli"), 2807 to arrayOf("cli"), 2829 to arrayOf("n"), 2834 to arrayOf("code"), 2836 to arrayOf("e"), 2849 to arrayOf("n"), 2854 to arrayOf("channel"), 2868 to arrayOf("project"), 2874 to arrayOf("n"), 2886 to arrayOf("m"), 2898 to arrayOf("m"), 2901 to arrayOf("m"), 2908 to arrayOf("pages"), 2910 to arrayOf("name"), 2913 to arrayOf("name"), 2922 to arrayOf("d", "n"), 2943 to arrayOf("n", "tools"), 2944 to arrayOf("n", "tools", "d"), 2945 to arrayOf("n", "d"), 2946 to arrayOf("n", "what"), 2947 to arrayOf("n", "d", "what"), 2951 to arrayOf("head"), 2957 to arrayOf("name", "path"), 2963 to arrayOf("page", "net", "near"), 2964 to arrayOf("page", "what"), 2965 to arrayOf("ref"), 2969 to arrayOf("page"), 2992 to arrayOf("n"), 2993 to arrayOf("n"), 2994 to arrayOf("n"), 2996 to arrayOf("hub"), 3018 to arrayOf("project"), 3020 to arrayOf("n"), 3021 to arrayOf("n"), 3022 to arrayOf("word"), 3023 to arrayOf("n"), 3041 to arrayOf("name"), 3049 to arrayOf("answer"), 3054 to arrayOf("why"), 3056 to arrayOf("hub"), 3062 to arrayOf("from", "to"), 3069 to arrayOf("project"), 3079 to arrayOf("name"), 3083 to arrayOf("n"), 3089 to arrayOf("code"), 3090 to arrayOf("hub"), 3091 to arrayOf("hub"), 3092 to arrayOf("hub"), 3106 to arrayOf("n"), 3107 to arrayOf("n"), 3123 to arrayOf("status"), 3125 to arrayOf("status"), 3154 to arrayOf("project"), 3158 to arrayOf("code"), 3160 to arrayOf("why"), 3168 to arrayOf("title"), 3174 to arrayOf("title"), 3176 to arrayOf("q"), 3177 to arrayOf("title"), 3182 to arrayOf("room"), 3186 to arrayOf("q"), 3196 to arrayOf("title"), 3201 to arrayOf("n"), 3202 to arrayOf("n"), 3207 to arrayOf("at"), 3215 to arrayOf("size"), 3217 to arrayOf("n", "total"), 3234 to arrayOf("n"), 3235 to arrayOf("what"), 3238 to arrayOf("device"), 3239 to arrayOf("device"), 3248 to arrayOf("word", "count"), 3249 to arrayOf("heard"), 3261 to arrayOf("files"), 3262 to arrayOf("files"), 3265 to arrayOf("name"), 3293 to arrayOf("n"), 3294 to arrayOf("n"), 3305 to arrayOf("n"), 3339 to arrayOf("root"), 3340 to arrayOf("path"), 3363 to arrayOf("name"), 3366 to arrayOf("until"), 3367 to arrayOf("error"), 3374 to arrayOf("url"), 3378 to arrayOf("name"), 3379 to arrayOf("name"), 3387 to arrayOf("code", "hub", "until"), 3388 to arrayOf("url"), 3392 to arrayOf("kinds"), 3393 to arrayOf("address"), 3395 to arrayOf("address"), 3398 to arrayOf("url"), 3399 to arrayOf("url"), 3400 to arrayOf("url"), 3401 to arrayOf("url", "via"), 3406 to arrayOf("name"), 3407 to arrayOf("url", "check", "left"), 3409 to arrayOf("check"), 3410 to arrayOf("address"), 3411 to arrayOf("name"), 3412 to arrayOf("error"), 3413 to arrayOf("url"), 3414 to arrayOf("url"), 3421 to arrayOf("code", "address", "left"), 3427 to arrayOf("name"), 3428 to arrayOf("name"), 3439 to arrayOf("address"), 3446 to arrayOf("code", "body"), 3449 to arrayOf("code", "body"), 3455 to arrayOf("window", "used"), 3456 to arrayOf("window", "used", "when"), 3457 to arrayOf("window", "used"), 3458 to arrayOf("window", "used", "when"), 3459 to arrayOf("provider"), 3471 to arrayOf("label"), 3472 to arrayOf("when"), 3474 to arrayOf("provider"), 3475 to arrayOf("provider", "title", "why"), 3495 to arrayOf("reason"), 3503 to arrayOf("code"), 3512 to arrayOf("name"), 3515 to arrayOf("version"), 3516 to arrayOf("version"), 3517 to arrayOf("version"), 3519 to arrayOf("version"), 3520 to arrayOf("version"), 3521 to arrayOf("version"), 3522 to arrayOf("version", "why"), 3523 to arrayOf("version"), 3525 to arrayOf("code"), 3541 to arrayOf("name"), 3548 to arrayOf("count"), 3549 to arrayOf("title"), 3550 to arrayOf("name"), 3553 to arrayOf("n", "holder"), 3554 to arrayOf("n", "title"), 3555 to arrayOf("title"), 3558 to arrayOf("n"), 3559 to arrayOf("n"), 3560 to arrayOf("n"), 3561 to arrayOf("n"), 3562 to arrayOf("harness", "typed", "type", "remote", "host", "wt", "branch"), 3572 to arrayOf("pid"), 3577 to arrayOf("left"), 3578 to arrayOf("left"), 3584 to arrayOf("left"), 3585 to arrayOf("left"), 3586 to arrayOf("left"), 3587 to arrayOf("left"), 3588 to arrayOf("label", "left"), 3589 to arrayOf("when"), 3590 to arrayOf("used"), 3591 to arrayOf("used", "limit"), 3613 to arrayOf("tracking"), 3617 to arrayOf("total"), 3618 to arrayOf("price"), 3619 to arrayOf("price"), 3624 to arrayOf("n"), 3625 to arrayOf("parts"), 3626 to arrayOf("note"), 3627 to arrayOf("error"), 3628 to arrayOf("error", "parts"), 3633 to arrayOf("state"), 3634 to arrayOf("name", "path"), 3635 to arrayOf("name", "path", "why"), 3637 to arrayOf("code"), 3641 to arrayOf("detail"), 3643 to arrayOf("why"), 3644 to arrayOf("parts"), 3647 to arrayOf("build", "to"), 3648 to arrayOf("build"), 3649 to arrayOf("build", "skip"), 3651 to arrayOf("why"), 3652 to arrayOf("why"), 3653 to arrayOf("build"), 3654 to arrayOf("build", "why"), 3655 to arrayOf("build"), 3656 to arrayOf("build"), 3660 to arrayOf("build"), 3661 to arrayOf("build"), 3663 to arrayOf("build"), 3670 to arrayOf("build"), 3704 to arrayOf("step"), 3705 to arrayOf("p", "pt", "t", "tt", "e", "et"), 3706 to arrayOf("done", "total"), 3707 to arrayOf("n"), 3708 to arrayOf("n"), 3709 to arrayOf("n"), 3714 to arrayOf("n"), 3717 to arrayOf("why"), 3718 to arrayOf("why", "from"), 3719 to arrayOf("error"), 3721 to arrayOf("n"), 3722 to arrayOf("n"), 3726 to arrayOf("n"), 3729 to arrayOf("name", "gb", "path"), 3730 to arrayOf("path", "why"), 3731 to arrayOf("names"), 3733 to arrayOf("why"), 3744 to arrayOf("n", "total"), 3748 to arrayOf("title"), 3750 to arrayOf("n"), 3754 to arrayOf("name"), 3755 to arrayOf("title"), 3756 to arrayOf("note"), 3758 to arrayOf("machine"), 3759 to arrayOf("machines"), 3760 to arrayOf("machine"), 3771 to arrayOf("n"), 3773 to arrayOf("n"), 3777 to arrayOf("name"), 3780 to arrayOf("name"), 3797 to arrayOf("why"), 3803 to arrayOf("project"), 3844 to arrayOf("path"), 3845 to arrayOf("path"), 3847 to arrayOf("have", "total"), 3852 to arrayOf("n"), 3861 to arrayOf("hub"), 3864 to arrayOf("title"), 3868 to arrayOf("project"), 3869 to arrayOf("project"), 3870 to arrayOf("n"), 3871 to arrayOf("hub"), 3873 to arrayOf("n"), 3874 to arrayOf("n"), 3875 to arrayOf("model"), 3881 to arrayOf("name"), 3900 to arrayOf("word"), 3906 to arrayOf("answer"), 3916 to arrayOf("version", "build"), 3917 to arrayOf("hub"), 3922 to arrayOf("name"), 3925 to arrayOf("when", "who", "mark"), 3929 to arrayOf("who"), 3933 to arrayOf("time"), 3934 to arrayOf("address"), 3936 to arrayOf("kind", "name"), 3951 to arrayOf("title"), 3952 to arrayOf("query"), 3955 to arrayOf("room"), 3956 to arrayOf("query"), 3958 to arrayOf("n"), 3959 to arrayOf("n"), 3960 to arrayOf("n"), 3966 to arrayOf("size"), 3970 to arrayOf("n"), 3971 to arrayOf("n"), 3972 to arrayOf("n"), 3986 to arrayOf("status"), 3988 to arrayOf("status"), 4139 to arrayOf("code"), 4141 to arrayOf("n"), 4143 to arrayOf("why"), 4155 to arrayOf("done", "of"), 4159 to arrayOf("thread"), 4162 to arrayOf("n"), 4170 to arrayOf("title"), 4171 to arrayOf("note"), 4172 to arrayOf("label"), 4173 to arrayOf("machine"), 4174 to arrayOf("machine"), 4181 to arrayOf("at", "total"), 4182 to arrayOf("at", "total"), 4186 to arrayOf("machine"), 4187 to arrayOf("machine"), 4188 to arrayOf("machines"), 4190 to arrayOf("device"), 4197 to arrayOf("price"), 4198 to arrayOf("price"), 4205 to arrayOf("home"), 4210 to arrayOf("from"), 4212 to arrayOf("note"), 4213 to arrayOf("note"), 4215 to arrayOf("v"), 4216 to arrayOf("v"), 4217 to arrayOf("v", "who"), 4219 to arrayOf("who"), 4220 to arrayOf("v"), 4222 to arrayOf("v", "cmd"), 4223 to arrayOf("cmd"), 4228 to arrayOf("v", "path"), 4229 to arrayOf("v", "note"), 4230 to arrayOf("v"), 4235 to arrayOf("tool"), 4236 to arrayOf("tool"), 4261 to arrayOf("n", "w"), 4262 to arrayOf("why"), 4263 to arrayOf("state", "why"), 4275 to arrayOf("project"), 4276 to arrayOf("n"), 4287 to arrayOf("why"), 4293 to arrayOf("name"), 4304 to arrayOf("project"), 4309 to arrayOf("n"), 4317 to arrayOf("names"), 4325 to arrayOf("dest"), 4327 to arrayOf("repo"), 4328 to arrayOf("repo"), 4330 to arrayOf("url"), 4345 to arrayOf("time"), 4367 to arrayOf("group"), 4371 to arrayOf("project"), 4372 to arrayOf("n"), 4373 to arrayOf("n"), 4374 to arrayOf("n"), 4382 to arrayOf("n"), 4439 to arrayOf("n"), 4440 to arrayOf("n"), 4441 to arrayOf("a", "b"), 4442 to arrayOf("n"), 4444 to arrayOf("parts", "lines"), 4445 to arrayOf("n"), 4476 to arrayOf("what", "project", "fab"), 4477 to arrayOf("rev", "day"), 4485 to arrayOf("n"), 4496 to arrayOf("layer"), 4497 to arrayOf("n"), 4502 to arrayOf("board"), 4514 to arrayOf("others"), 4515 to arrayOf("must", "should", "notes"), 4516 to arrayOf("id", "w"), 4526 to arrayOf("what"), 4529 to arrayOf("why"), 4530 to arrayOf("why"), 4537 to arrayOf("n"), 4553 to arrayOf("price", "n"), 4554 to arrayOf("n", "need"), 4555 to arrayOf("n"), 4556 to arrayOf("n"), 4557 to arrayOf("cost"), 4558 to arrayOf("cost"), 4571 to arrayOf("day", "n"), 4572 to arrayOf("day"), 4573 to arrayOf("cost", "n", "lines"), 4574 to arrayOf("stock", "price"), 4575 to arrayOf("lines"), 4596 to arrayOf("host"), 4607 to arrayOf("n"), 4608 to arrayOf("a", "b"), 4609 to arrayOf("n"), 4610 to arrayOf("n"), 4613 to arrayOf("day"), 4614 to arrayOf("n"), 4655 to arrayOf("turn"), 4769 to arrayOf("text"), 4772 to arrayOf("repo", "dest"), 4773 to arrayOf("repo", "dest"), 4774 to arrayOf("repo"), 4779 to arrayOf("dir"), 4780 to arrayOf("dir"), 4784 to arrayOf("editor", "job", "secs"), 4785 to arrayOf("editor", "secs"), 4786 to arrayOf("editor"), 4803 to arrayOf("time"), 4809 to arrayOf("status"), 4817 to arrayOf("time"), 4818 to arrayOf("time", "dur"), 4821 to arrayOf("answer"), 4825 to arrayOf("type"), 4826 to arrayOf("max"), 4854 to arrayOf("bytes", "tokens"), 4887 to arrayOf("what"), 4891 to arrayOf("n"), 4893 to arrayOf("n"), 4917 to arrayOf("n"), 4918 to arrayOf("done", "total"), 4926 to arrayOf("v"), 4927 to arrayOf("x", "y"), 4933 to arrayOf("machine"), 4936 to arrayOf("days"), 4937 to arrayOf("warnings"), 4943 to arrayOf("n"), 4948 to arrayOf("n"), 4950 to arrayOf("found", "total", "q"), 4953 to arrayOf("model"), 4954 to arrayOf("model", "conf")) } val common_cancel: String get() = Tr.s(0) val common_delete: String get() = Tr.s(1) @@ -25762,2624 +25792,2630 @@ object Msg { val gpui_star_why: String get() = Tr.s(2332) fun gpui_projects_unpushed(n: Number, upstream: Any): String = Tr.f(2333, arrayOf(n, upstream)) val gpui_projects_push: String get() = Tr.s(2334) - val gpui_e_files_max_mb: String get() = Tr.s(2335) - fun gpui_e_files_max_note(mb: Any): String = Tr.f(2336, arrayOf(mb)) - val gpui_e_dev_replay: String get() = Tr.s(2337) - val gpui_e_dev_replay_note: String get() = Tr.s(2338) - val gpui_e_dev_replay_button: String get() = Tr.s(2339) - val gpui_e_dev_star: String get() = Tr.s(2340) - val gpui_e_dev_star_show: String get() = Tr.s(2341) - val gpui_e_about_updates: String get() = Tr.s(2342) - val gpui_e_about_frames: String get() = Tr.s(2343) - val gpui_e_about_cef: String get() = Tr.s(2344) - val gpui_e_about_notices: String get() = Tr.s(2345) - fun gpui_e_about_notices_here(path: Any): String = Tr.f(2346, arrayOf(path)) - fun gpui_e_about_notices_hub(path: Any): String = Tr.f(2347, arrayOf(path)) - val gpui_e_open_folder: String get() = Tr.s(2348) - val gpui_e_agents_thinking: String get() = Tr.s(2349) - val gpui_e_agents_thinking_note: String get() = Tr.s(2350) - val gpui_e_agents_recall: String get() = Tr.s(2351) - val gpui_e_agents_recall_note: String get() = Tr.s(2352) - val gpui_e_order_comes: String get() = Tr.s(2353) - val gpui_e_devices_local_machine: String get() = Tr.s(2354) - val gpui_e_rules_standing: String get() = Tr.s(2355) - val gpui_e_rules_words: String get() = Tr.s(2356) - val gpui_e_rules_eg: String get() = Tr.s(2357) - val gpui_e_rules_add: String get() = Tr.s(2358) - val gpui_e_board_doing: String get() = Tr.s(2359) - val gpui_e_board_todo: String get() = Tr.s(2360) - val gpui_e_board_what: String get() = Tr.s(2361) - val gpui_e_board_eg: String get() = Tr.s(2362) - val gpui_e_board_add: String get() = Tr.s(2363) - val gpui_e_tz_phone_again: String get() = Tr.s(2364) - val gpui_e_tz_machine_again: String get() = Tr.s(2365) - val gpui_e_tz_phone_auto: String get() = Tr.s(2366) - val gpui_e_tz_machine_auto: String get() = Tr.s(2367) - val gpui_e_privacy_note: String get() = Tr.s(2368) - fun gpui_e_privacy_note_id(id: Any): String = Tr.f(2369, arrayOf(id)) - val gpui_e_privacy_share: String get() = Tr.s(2370) - val gpui_e_privacy_reset: String get() = Tr.s(2371) - val gpui_e_privacy_report: String get() = Tr.s(2372) - fun gpui_e_writing_model_note(model: Any): String = Tr.f(2373, arrayOf(model)) - fun gpui_e_kicad_none(platform: Any): String = Tr.f(2374, arrayOf(platform)) - fun gpui_e_kicad_installing(version: Any): String = Tr.f(2375, arrayOf(version)) - val gpui_e_kicad_starting: String get() = Tr.s(2376) - val gpui_e_kicad_ask: String get() = Tr.s(2377) - fun gpui_e_kicad_ask_note(version: Any, from: Any, into: Any): String = Tr.f(2378, arrayOf(version, from, into)) - fun gpui_e_kicad_offer(version: Any, from: Any): String = Tr.f(2379, arrayOf(version, from)) - val gpui_e_kicad_own: String get() = Tr.s(2380) - val gpui_e_kicad_notfound: String get() = Tr.s(2381) - fun gpui_e_kicad_found_version(version: Any, path: Any): String = Tr.f(2382, arrayOf(version, path)) - fun gpui_e_kicad_found_stock(version: Any, path: Any): String = Tr.f(2383, arrayOf(version, path)) - fun gpui_e_kicad_offer_stock(version: Any, pin: Any, from: Any): String = Tr.f(2384, arrayOf(version, pin, from)) - fun gpui_e_kicad_found(path: Any): String = Tr.f(2385, arrayOf(path)) - fun gpui_e_kicad_just(version: Any, path: Any): String = Tr.f(2386, arrayOf(version, path)) - fun gpui_e_kicad_passed(version: Any, path: Any, set: Any): String = Tr.f(2387, arrayOf(version, path, set)) - val gpui_e_kicad_checking: String get() = Tr.s(2388) - val gpui_e_kicad_path_hint: String get() = Tr.s(2389) - val gpui_e_freecad_notfound: String get() = Tr.s(2390) - val gpui_e_freecad_notat: String get() = Tr.s(2391) - val gpui_e_freecad_path_hint: String get() = Tr.s(2392) - val gpui_e_keys_kept: String get() = Tr.s(2393) - val gpui_e_keys_again: String get() = Tr.s(2394) - val gpui_e_keys_forget_it: String get() = Tr.s(2395) - val gpui_e_keys_note: String get() = Tr.s(2396) - val gpui_e_fallback_unavailable: String get() = Tr.s(2397) - val gpui_e_fallback_provider: String get() = Tr.s(2398) - val gpui_e_fallback_provider_note: String get() = Tr.s(2399) - val gpui_e_fallback_add: String get() = Tr.s(2400) - fun gpui_e_usage_line(turns: Number, input: Any, cread: Any, cwrite: Any, output: Any, cost: Any): String = Tr.f(2401, arrayOf(turns, input, cread, cwrite, output, cost)) - val gpui_e_cost_not_reported: String get() = Tr.s(2402) - val gpui_e_usage_title: String get() = Tr.s(2403) - val gpui_e_usage_none: String get() = Tr.s(2404) - val gpui_e_usage_unknown: String get() = Tr.s(2405) - val gpui_e_usage_all: String get() = Tr.s(2406) - val gpui_e_page_back: String get() = Tr.s(2407) - fun gpui_e_rules_on_refuses(tool: Any): String = Tr.f(2408, arrayOf(tool)) - fun gpui_e_rules_off_refuses(tool: Any): String = Tr.f(2409, arrayOf(tool)) - fun gpui_e_rules_on_refuses_word(tool: Any, word: Any): String = Tr.f(2410, arrayOf(tool, word)) - fun gpui_e_rules_off_refuses_word(tool: Any, word: Any): String = Tr.f(2411, arrayOf(tool, word)) - fun gpui_e_rules_on_using(tool: Any): String = Tr.f(2412, arrayOf(tool)) - fun gpui_e_rules_off_using(tool: Any): String = Tr.f(2413, arrayOf(tool)) - fun gpui_e_board_doing_due(due: Any): String = Tr.f(2414, arrayOf(due)) - fun gpui_e_board_blocked_due(due: Any): String = Tr.f(2415, arrayOf(due)) - fun gpui_e_board_todo_due(due: Any): String = Tr.f(2416, arrayOf(due)) - fun gpui_e_board_done_due(due: Any): String = Tr.f(2417, arrayOf(due)) - fun gpui_e_tz_zone_set(zone: Any): String = Tr.f(2418, arrayOf(zone)) - fun gpui_e_tz_zone_phone(zone: Any): String = Tr.f(2419, arrayOf(zone)) - fun gpui_e_tz_zone_machine(zone: Any): String = Tr.f(2420, arrayOf(zone)) - fun gpui_e_tz_zone_none(zone: Any): String = Tr.f(2421, arrayOf(zone)) - fun gpui_e_subs_done(n: Any): String = Tr.f(2422, arrayOf(n)) - fun gpui_e_lock_starting(who: Any): String = Tr.f(2423, arrayOf(who)) - fun gpui_e_lock_position(n: Any, who: Any): String = Tr.f(2424, arrayOf(n, who)) - fun gpui_e_subs_where(harness: Any): String = Tr.f(2425, arrayOf(harness)) - fun gpui_e_picker_already(path: Any): String = Tr.f(2426, arrayOf(path)) - fun gpui_e_picker_create(path: Any): String = Tr.f(2427, arrayOf(path)) - fun gpui_e_picker_notdir(path: Any): String = Tr.f(2428, arrayOf(path)) - val gpui_e_picker_hint: String get() = Tr.s(2429) - val gpui_e_fab_nogoal: String get() = Tr.s(2430) - fun gpui_e_fab_unavailable_line(error: Any, line: Any): String = Tr.f(2431, arrayOf(error, line)) - fun gpui_e_fab_buy_label(label: Any): String = Tr.f(2432, arrayOf(label)) - val gpui_e_tools_back: String get() = Tr.s(2433) - val gpui_e_tools_back_tip: String get() = Tr.s(2434) - val gpui_e_status_working: String get() = Tr.s(2435) - val gpui_e_status_inactive: String get() = Tr.s(2436) - val gpui_e_status_finished: String get() = Tr.s(2437) - val gpui_e_status_waiting: String get() = Tr.s(2438) - val gpui_e_status_blocked: String get() = Tr.s(2439) - fun gpui_e_acct_saved(who: Any): String = Tr.f(2440, arrayOf(who)) - fun gpui_e_acct_cli(who: Any): String = Tr.f(2441, arrayOf(who)) - fun gpui_e_acct_window_resets(label: Any, left: Any, `when`: Any): String = Tr.f(2442, arrayOf(label, left, `when`)) - fun gpui_e_acct_default_left(left: Any): String = Tr.f(2443, arrayOf(left)) - fun gpui_e_acct_profile_left(name: Any, left: Any): String = Tr.f(2444, arrayOf(name, left)) - fun gpui_e_acct_extra_off(used: Any): String = Tr.f(2445, arrayOf(used)) - fun gpui_e_acct_extra_of_off(used: Any, limit: Any): String = Tr.f(2446, arrayOf(used, limit)) - fun gpui_e_acct_extra_off_why(used: Any, reason: Any): String = Tr.f(2447, arrayOf(used, reason)) - fun gpui_e_acct_extra_of_off_why(used: Any, limit: Any, reason: Any): String = Tr.f(2448, arrayOf(used, limit, reason)) - val gpui_e_tok_noreading: String get() = Tr.s(2449) - fun gpui_e_tok_notby(provider: Any): String = Tr.f(2450, arrayOf(provider)) - fun gpui_e_tok_ofwindow(used: Any, window: Any, pct: Any): String = Tr.f(2451, arrayOf(used, window, pct)) - fun gpui_e_tok_rate(rate: Any): String = Tr.f(2452, arrayOf(rate)) - val gpui_e_tok_held: String get() = Tr.s(2453) - val gpui_e_tok_room: String get() = Tr.s(2454) - val gpui_e_tok_noturn: String get() = Tr.s(2455) - val gpui_e_tok_tokens_label: String get() = Tr.s(2456) - val gpui_e_tok_nottold: String get() = Tr.s(2457) - val gpui_e_tok_input: String get() = Tr.s(2458) - val gpui_e_tok_cread: String get() = Tr.s(2459) - val gpui_e_tok_cwrite: String get() = Tr.s(2460) - val gpui_e_tok_output: String get() = Tr.s(2461) - fun gpui_e_tok_output_reasoning(n: Any, r: Any): String = Tr.f(2462, arrayOf(n, r)) - val gpui_e_tok_cost: String get() = Tr.s(2463) - val gpui_e_tok_notreported: String get() = Tr.s(2464) - val gpui_e_tok_speed: String get() = Tr.s(2465) - val gpui_e_tok_modeltime: String get() = Tr.s(2466) - fun gpui_e_tok_modeltime_steps(time: Any, n: Number): String = Tr.f(2467, arrayOf(time, n)) - val gpui_e_tok_turntime: String get() = Tr.s(2468) - val gpui_e_tok_noturns: String get() = Tr.s(2469) - val gpui_e_tok_turns: String get() = Tr.s(2470) - fun gpui_e_tok_turns_unknown(n: Any, m: Any): String = Tr.f(2471, arrayOf(n, m)) - val gpui_e_tok_hits: String get() = Tr.s(2472) - fun gpui_e_tok_hits_of(pct: Any): String = Tr.f(2473, arrayOf(pct)) - fun gpui_e_tok_cost_some(cost: Any, n: Any): String = Tr.f(2474, arrayOf(cost, n)) - val gpui_e_tok_avg: String get() = Tr.s(2475) - val gpui_e_tok_last: String get() = Tr.s(2476) - val gpui_e_tok_bymodel: String get() = Tr.s(2477) - fun gpui_e_tok_model_line(`in`: Any, out: Any, cread: Any, cwrite: Any): String = Tr.f(2478, arrayOf(`in`, out, cread, cwrite)) - fun gpui_e_tok_model_line_web(`in`: Any, out: Any, cread: Any, cwrite: Any, n: Any): String = Tr.f(2479, arrayOf(`in`, out, cread, cwrite, n)) - val gpui_e_tok_speed_note: String get() = Tr.s(2480) - val gpui_e_viewer_noproject: String get() = Tr.s(2481) - val gpui_e_viewer_remote_files: String get() = Tr.s(2482) - val gpui_e_viewer_remote_parts: String get() = Tr.s(2483) - val gpui_e_viewer_noparts: String get() = Tr.s(2484) - val gpui_e_order_how: String get() = Tr.s(2485) - val gpui_e_fallback_note: String get() = Tr.s(2486) - val gpui_e_fallback_model: String get() = Tr.s(2487) - fun gpui_e_usage_line_nocost(turns: Number, input: Any, cread: Any, cwrite: Any, output: Any): String = Tr.f(2488, arrayOf(turns, input, cread, cwrite, output)) - fun gpui_e_acct_weekly_resets(left: Any, `when`: Any): String = Tr.f(2489, arrayOf(left, `when`)) - fun gpui_e_acct_hour5_resets(left: Any, `when`: Any): String = Tr.f(2490, arrayOf(left, `when`)) - fun gpui_e_acct_opus_resets(left: Any, `when`: Any): String = Tr.f(2491, arrayOf(left, `when`)) - fun gpui_e_acct_sonnet_resets(left: Any, `when`: Any): String = Tr.f(2492, arrayOf(left, `when`)) - val notify_which_alerts_reach_you_quiet: String get() = Tr.s(2493) - val notify_notifications: String get() = Tr.s(2494) - val notify_phones: String get() = Tr.s(2495) - val notify_only_your_uberbot_pushes_to: String get() = Tr.s(2496) - val notify_quiet_hours: String get() = Tr.s(2497) - val notify_a_push_waits_until_the: String get() = Tr.s(2498) - val notify_quiet_from_and_until: String get() = Tr.s(2499) - val notify_hh_mm_hours: String get() = Tr.s(2500) - val notify_times_are_hh_mm_hours: String get() = Tr.s(2501) - val notify_quiet_hours_are_hh_mm: String get() = Tr.s(2502) - val notify_urgent_asks_come_through: String get() = Tr.s(2503) - val notify_an_approval_or_a_question: String get() = Tr.s(2504) - val notify_iphones_that_hear_a_push: String get() = Tr.s(2505) - val notify_none_yet_an_iphone_registers: String get() = Tr.s(2506) - val notify_muted_hears_only_what_urgent: String get() = Tr.s(2507) - val notify_hears_alerts: String get() = Tr.s(2508) - val notify_hears: String get() = Tr.s(2509) - val notify_muted: String get() = Tr.s(2510) - val gpui_e_failover_failover_order: String get() = Tr.s(2511) - val gpui_e_failover_applies_to_all_threads_bots: String get() = Tr.s(2512) - val gpui_e_failover_not_installed_on_this_machine: String get() = Tr.s(2513) - val gpui_e_failover_its_own_sign_in_on: String get() = Tr.s(2514) - val gpui_e_failover_account: String get() = Tr.s(2515) - fun gpui_e_failover_accounts_the_one_with_the(n: Any): String = Tr.f(2516, arrayOf(n)) - val gpui_e_failover_default_order: String get() = Tr.s(2517) - val gpui_e_failover_use_the_default_order: String get() = Tr.s(2518) - val gpui_e_failover_choose_an_installed_provider_and: String get() = Tr.s(2519) - val gpui_e_failover_add_to_the_order: String get() = Tr.s(2520) - val ring_ring: String get() = Tr.s(2521) - val ring_pebble_index_ring: String get() = Tr.s(2522) - val ring_test_event: String get() = Tr.s(2523) - val ring_recordings: String get() = Tr.s(2524) - val ring_search_what_you_said: String get() = Tr.s(2525) - val ring_copy_header: String get() = Tr.s(2526) - val ring_copy_both: String get() = Tr.s(2527) - val ring_set_up_again: String get() = Tr.s(2528) - val ring_show_all: String get() = Tr.s(2529) - val ring_hear_again_local: String get() = Tr.s(2530) - val ring_hear_again_openai: String get() = Tr.s(2531) - val ring_what_happened: String get() = Tr.s(2532) - val ring_send_again: String get() = Tr.s(2533) - val ring_no_recordings_yet: String get() = Tr.s(2534) - val hub_acct_claude_sync: String get() = Tr.s(2535) - val hub_acct_add_a_claude_sync_token: String get() = Tr.s(2536) - val hub_acct_connected_sync_token: String get() = Tr.s(2537) - val hub_acct_sync_token_ended: String get() = Tr.s(2538) - fun hub_acct_sync_token_ends(`when`: Any): String = Tr.f(2539, arrayOf(`when`)) - val gpui_e_telemetry_notice: String get() = Tr.s(2540) - val voice_cmd_sending: String get() = Tr.s(2541) - val voice_cmd_cleared: String get() = Tr.s(2542) - val voice_cmd_sent: String get() = Tr.s(2543) - val voice_cmd_undo: String get() = Tr.s(2544) - val settings_voice_cmd_send: String get() = Tr.s(2545) - fun settings_voice_cmd_send_note(phrase: Any, now: Any): String = Tr.f(2546, arrayOf(phrase, now)) - val settings_voice_cmd_off: String get() = Tr.s(2547) - val settings_voice_cmd_hint: String get() = Tr.s(2548) - val settings_voice_cmd_default: String get() = Tr.s(2549) - val settings_voice_cmds: String get() = Tr.s(2550) - val settings_voice_cmds_note: String get() = Tr.s(2551) - val voice_cmd_scratch: String get() = Tr.s(2552) - val voice_cmd_newline: String get() = Tr.s(2553) - val voice_cmd_cancel: String get() = Tr.s(2554) - val settings_voice_auto: String get() = Tr.s(2555) - val settings_voice_auto_note: String get() = Tr.s(2556) - fun voice_cmd_secs(s: Any): String = Tr.f(2557, arrayOf(s)) - val voice_eot_sending: String get() = Tr.s(2558) - val voice_eot_hold: String get() = Tr.s(2559) - val settings_voice_eot: String get() = Tr.s(2560) - val settings_voice_eot_note: String get() = Tr.s(2561) - val settings_voice_eot_eager: String get() = Tr.s(2562) - fun settings_voice_eot_eager_note(now: Any): String = Tr.f(2563, arrayOf(now)) - fun settings_voice_eot_eager_learned(now: Any, nudge: Any, sent: Any, undone: Any): String = Tr.f(2564, arrayOf(now, nudge, sent, undone)) - val settings_voice_eot_reset: String get() = Tr.s(2565) - val settings_voice_jev: String get() = Tr.s(2566) - val settings_voice_jev_set: String get() = Tr.s(2567) - val settings_voice_jev_unset: String get() = Tr.s(2568) - val settings_voice_jev_key: String get() = Tr.s(2569) - val settings_voice_jev_use: String get() = Tr.s(2570) - val settings_voice_jev_test: String get() = Tr.s(2571) - val settings_voice_jev_model: String get() = Tr.s(2572) - val settings_voice_jev_check: String get() = Tr.s(2573) - fun settings_voice_jev_failed(e: Any): String = Tr.f(2574, arrayOf(e)) - fun settings_voice_jev_result(a: Any, ams: Any, b: Any, bms: Any): String = Tr.f(2575, arrayOf(a, ams, b, bms)) - fun settings_voice_jev_last(ms: Any): String = Tr.f(2576, arrayOf(ms)) - fun settings_voice_jev_fallback(e: Any): String = Tr.f(2577, arrayOf(e)) - fun voice_eot_eager_label(t: Any): String = Tr.f(2578, arrayOf(t)) - fun voice_eot_default_label(t: Any): String = Tr.f(2579, arrayOf(t)) - fun voice_eot_patient_label(t: Any): String = Tr.f(2580, arrayOf(t)) - val voice_always_listening: String get() = Tr.s(2581) - val voice_always_paused: String get() = Tr.s(2582) - val voice_always_muted: String get() = Tr.s(2583) - val keys_always: String get() = Tr.s(2584) - val voice_always_status: String get() = Tr.s(2585) - fun voice_always_note_paused(why: Any): String = Tr.f(2586, arrayOf(why)) - val settings_voice_always: String get() = Tr.s(2587) - val settings_voice_always_note: String get() = Tr.s(2588) - val settings_voice_always_start: String get() = Tr.s(2589) - val settings_voice_always_start_note: String get() = Tr.s(2590) - val settings_voice_always_word1: String get() = Tr.s(2591) - val settings_voice_always_word2: String get() = Tr.s(2592) - val settings_voice_always_ms: String get() = Tr.s(2593) - val settings_voice_always_pause: String get() = Tr.s(2594) - val settings_voice_always_pause_note: String get() = Tr.s(2595) - fun settings_voice_always_pause_note2(apps: Any): String = Tr.f(2596, arrayOf(apps)) - val settings_voice_always_ignore: String get() = Tr.s(2597) - val settings_voice_always_lock: String get() = Tr.s(2598) - val settings_voice_always_call: String get() = Tr.s(2599) - val settings_voice_always_away: String get() = Tr.s(2600) - val settings_voice_always_saveapps: String get() = Tr.s(2601) - val settings_voice_always_target: String get() = Tr.s(2602) - val settings_voice_always_target_note: String get() = Tr.s(2603) - val settings_voice_always_open: String get() = Tr.s(2604) - val settings_voice_speaker: String get() = Tr.s(2605) - fun settings_voice_speaker_on(n: Any): String = Tr.f(2606, arrayOf(n)) - fun settings_voice_speaker_learning(n: Any, k: Any): String = Tr.f(2607, arrayOf(n, k)) - val settings_voice_speaker_reenrol: String get() = Tr.s(2608) - val voice_always_pill_listening: String get() = Tr.s(2609) - val voice_always_pill_paused: String get() = Tr.s(2610) - val voice_always_pill_listen: String get() = Tr.s(2611) - fun voice_mark_tip(stt: Any, conf: Any): String = Tr.f(2612, arrayOf(stt, conf)) - fun voice_mark_unsure(words: Any): String = Tr.f(2613, arrayOf(words)) - val voice_mark_edited: String get() = Tr.s(2614) - val gpui_side_old_chats_that_belong_to: String get() = Tr.s(2615) - val gpui_side_group_projects: String get() = Tr.s(2616) - val gpui_side_on_projects_with_nothing_going: String get() = Tr.s(2617) - val gpui_side_no_group: String get() = Tr.s(2618) - val gpui_e_freecad_install: String get() = Tr.s(2619) - val gpui_e_freecad_ask: String get() = Tr.s(2620) - val gpui_e_freecad_installing: String get() = Tr.s(2621) - val gpui_e_freecad_page: String get() = Tr.s(2622) - fun gpui_e_freecad_ask_note(into: Any): String = Tr.f(2623, arrayOf(into)) - val gpui_e_freecad_offer: String get() = Tr.s(2624) - val gpui_e_picker_clone_hint: String get() = Tr.s(2625) - fun gpui_e_picker_clone_typed(origin: Any): String = Tr.f(2626, arrayOf(origin)) - val settings_git_page: String get() = Tr.s(2627) - val settings_git_autopush: String get() = Tr.s(2628) - val settings_git_autopush_note: String get() = Tr.s(2629) - val settings_git_notice: String get() = Tr.s(2630) - val settings_git_offbranch: String get() = Tr.s(2631) - val settings_git_offbranch_note: String get() = Tr.s(2632) - val settings_browser_start: String get() = Tr.s(2633) - val settings_browser_start_note: String get() = Tr.s(2634) - val settings_browser_opens: String get() = Tr.s(2635) - val settings_browser_reset: String get() = Tr.s(2636) - val settings_browser_blank: String get() = Tr.s(2637) - fun settings_browser_now_default(url: Any): String = Tr.f(2638, arrayOf(url)) - val settings_browser_now_blank: String get() = Tr.s(2639) - fun settings_browser_now(url: Any): String = Tr.f(2640, arrayOf(url)) - val settings_browser_bad: String get() = Tr.s(2641) - val gpui_f_group_install: String get() = Tr.s(2642) - val gpui_f_group_agents: String get() = Tr.s(2643) - val gpui_f_group_cad: String get() = Tr.s(2644) - val gpui_f_group_devices: String get() = Tr.s(2645) - val gpui_f_group_first: String get() = Tr.s(2646) - val gpui_f_group_tour: String get() = Tr.s(2647) - fun gpui_f_counter(i: Number, n: Number): String = Tr.f(2648, arrayOf(i, n)) - fun gpui_f_progress(d: Number, n: Number): String = Tr.f(2649, arrayOf(d, n)) - val gpui_f_next: String get() = Tr.s(2650) - val gpui_f_skip_step: String get() = Tr.s(2651) - val gpui_f_finish_later: String get() = Tr.s(2652) - val gpui_f_end_setup: String get() = Tr.s(2653) - val gpui_f_finish_setup: String get() = Tr.s(2654) - val gpui_f_welcome: String get() = Tr.s(2655) - val gpui_f_welcome_body: String get() = Tr.s(2656) - val gpui_f_installed: String get() = Tr.s(2657) - fun gpui_f_install_body_linux(version: Any): String = Tr.f(2658, arrayOf(version)) - fun gpui_f_install_body_darwin(version: Any): String = Tr.f(2659, arrayOf(version)) - fun gpui_f_install_body_windows(version: Any): String = Tr.f(2660, arrayOf(version)) - val gpui_f_program: String get() = Tr.s(2661) - val gpui_f_terminal_command: String get() = Tr.s(2662) - fun gpui_f_found_at(path: Any): String = Tr.f(2663, arrayOf(path)) - val gpui_f_path_fix: String get() = Tr.s(2664) - val gpui_f_path_fix_windows: String get() = Tr.s(2665) - val gpui_f_updates: String get() = Tr.s(2666) - val gpui_f_updates_note: String get() = Tr.s(2667) - val gpui_f_home_title: String get() = Tr.s(2668) - val gpui_f_home_body: String get() = Tr.s(2669) - val gpui_f_data_folder: String get() = Tr.s(2670) - fun gpui_f_hub_listens(addr: Any): String = Tr.f(2671, arrayOf(addr)) - val gpui_f_other_folder: String get() = Tr.s(2672) - val gpui_f_other_folder_note: String get() = Tr.s(2673) - val gpui_f_choose_folder: String get() = Tr.s(2674) - fun gpui_f_installing(label: Any): String = Tr.f(2675, arrayOf(label)) - val gpui_f_starting: String get() = Tr.s(2676) - fun gpui_f_did_not_install(label: Any): String = Tr.f(2677, arrayOf(label)) - fun gpui_f_install_label(label: Any): String = Tr.f(2678, arrayOf(label)) - val gpui_f_winget_note: String get() = Tr.s(2679) - val gpui_f_runs_codex: String get() = Tr.s(2680) - val gpui_f_runs_vendor: String get() = Tr.s(2681) - fun gpui_f_get_label(label: Any): String = Tr.f(2682, arrayOf(label)) - val gpui_f_opens_download: String get() = Tr.s(2683) - val gpui_f_checking: String get() = Tr.s(2684) - val gpui_f_import_title: String get() = Tr.s(2685) - val gpui_f_import_copied: String get() = Tr.s(2686) - fun gpui_f_import_body(from: Any): String = Tr.f(2687, arrayOf(from)) - val gpui_f_import_nothing: String get() = Tr.s(2688) - val gpui_f_import_nothing_note: String get() = Tr.s(2689) - val gpui_f_import_what: String get() = Tr.s(2690) - val gpui_f_import_notcounted: String get() = Tr.s(2691) - val gpui_f_import_count: String get() = Tr.s(2692) - val gpui_f_import_counting: String get() = Tr.s(2693) - val gpui_f_import_reading: String get() = Tr.s(2694) - val gpui_f_import_nothing_new: String get() = Tr.s(2695) - val gpui_f_import_here_already: String get() = Tr.s(2696) - val gpui_f_import_count_again: String get() = Tr.s(2697) - val gpui_f_import_comes: String get() = Tr.s(2698) - val gpui_f_import_import: String get() = Tr.s(2699) - val gpui_f_import_import_note: String get() = Tr.s(2700) - val gpui_f_import_withkeys: String get() = Tr.s(2701) - val gpui_f_import_withkeys_note: String get() = Tr.s(2702) - val gpui_f_import_importing: String get() = Tr.s(2703) - fun gpui_f_import_events(done: Number, of: Number): String = Tr.f(2704, arrayOf(done, of)) - val gpui_f_import_imported: String get() = Tr.s(2705) - val gpui_f_import_nothing_came: String get() = Tr.s(2706) - val gpui_f_import_again: String get() = Tr.s(2707) - val gpui_f_import_again_note: String get() = Tr.s(2708) - val gpui_f_import_stopped: String get() = Tr.s(2709) - fun gpui_f_import_n_projects(n: Number): String = Tr.f(2710, arrayOf(n)) - fun gpui_f_import_n_threads(t: Number, m: Number): String = Tr.f(2711, arrayOf(t, m)) - fun gpui_f_import_n_newmsgs(m: Number): String = Tr.f(2712, arrayOf(m)) - fun gpui_f_import_n_bots(b: Number, m: Number): String = Tr.f(2713, arrayOf(b, m)) - fun gpui_f_import_n_rooms(r: Number, p: Number): String = Tr.f(2714, arrayOf(r, p)) - fun gpui_f_import_n_routines(n: Number): String = Tr.f(2715, arrayOf(n)) - fun gpui_f_import_n_settings(n: Number): String = Tr.f(2716, arrayOf(n)) - fun gpui_f_import_n_devices(n: Number): String = Tr.f(2717, arrayOf(n)) - fun gpui_f_import_n_subagents(n: Number): String = Tr.f(2718, arrayOf(n)) - val gpui_f_import_nothing_new_dot: String get() = Tr.s(2719) - val gpui_f_note_mailruns: String get() = Tr.s(2720) - fun gpui_f_note_mailruns_text(n: Number): String = Tr.f(2721, arrayOf(n)) - val gpui_f_note_routines: String get() = Tr.s(2722) - fun gpui_f_note_routines_text(n: Number): String = Tr.f(2723, arrayOf(n)) - val gpui_f_note_machines: String get() = Tr.s(2724) - val gpui_f_note_machines_text: String get() = Tr.s(2725) - val gpui_f_note_keys: String get() = Tr.s(2726) - val gpui_f_note_keys_text: String get() = Tr.s(2727) - val gpui_f_note_google: String get() = Tr.s(2728) - val gpui_f_note_google_text: String get() = Tr.s(2729) - val gpui_f_note_clashes: String get() = Tr.s(2730) - fun gpui_f_note_clashes_text(n: Number): String = Tr.f(2731, arrayOf(n)) - val gpui_f_note_fresh: String get() = Tr.s(2732) - val gpui_f_note_fresh_text: String get() = Tr.s(2733) - val gpui_f_note_running: String get() = Tr.s(2734) - val gpui_f_note_running_text: String get() = Tr.s(2735) - val gpui_f_note_botfolder: String get() = Tr.s(2736) - fun gpui_f_note_botfolder_text(name: Any, gb: Any, path: Any): String = Tr.f(2737, arrayOf(name, gb, path)) - val gpui_f_note_notcopied: String get() = Tr.s(2738) - fun gpui_f_note_notcopied_text(path: Any, why: Any): String = Tr.f(2739, arrayOf(path, why)) - val gpui_f_note_signin: String get() = Tr.s(2740) - fun gpui_f_note_signin_text(names: Any): String = Tr.f(2741, arrayOf(names)) - val gpui_f_note_accounts_text: String get() = Tr.s(2742) - fun gpui_f_note_vault_text(why: Any): String = Tr.f(2743, arrayOf(why)) - fun gpui_f_ov_counts(p: Number, pn: Number, t: Number, tn: Number, e: Number, en: Number): String = Tr.f(2744, arrayOf(p, pn, t, tn, e, en)) - fun gpui_f_ov_mb(done: Number, total: Number): String = Tr.f(2745, arrayOf(done, total)) - fun gpui_f_ov_files(n: Number): String = Tr.f(2746, arrayOf(n)) - fun gpui_f_ov_now(what: Any): String = Tr.f(2747, arrayOf(what)) - fun gpui_f_ov_min(n: Number): String = Tr.f(2748, arrayOf(n)) - fun gpui_f_ov_s(n: Number): String = Tr.f(2749, arrayOf(n)) - val gpui_f_ov_measuring: String get() = Tr.s(2750) - val gpui_f_ov_title: String get() = Tr.s(2751) - fun gpui_f_ov_body(what: Any): String = Tr.f(2752, arrayOf(what)) - fun gpui_f_ov_took(n: Number): String = Tr.f(2753, arrayOf(n)) - val gpui_f_ov_here: String get() = Tr.s(2754) - fun gpui_f_ov_failed_in(why: Any, from: Any): String = Tr.f(2755, arrayOf(why, from)) - fun gpui_f_ov_failed(why: Any): String = Tr.f(2756, arrayOf(why)) - val gpui_f_usage_title: String get() = Tr.s(2757) - val gpui_f_usage_body: String get() = Tr.s(2758) - val gpui_f_usage_share: String get() = Tr.s(2759) - val gpui_f_usage_saved: String get() = Tr.s(2760) - val gpui_f_usage_choose: String get() = Tr.s(2761) - fun gpui_f_agent_found_signed(path: Any): String = Tr.f(2762, arrayOf(path)) - fun gpui_f_agent_found_signed_who(path: Any, who: Any): String = Tr.f(2763, arrayOf(path, who)) - fun gpui_f_agent_found_notsigned(path: Any): String = Tr.f(2764, arrayOf(path)) - fun gpui_f_agent_found_howsign(path: Any, cmd: Any): String = Tr.f(2765, arrayOf(path, cmd)) - fun gpui_f_agent_version(version: Any, path: Any): String = Tr.f(2766, arrayOf(version, path)) - fun gpui_f_agent_version_signed(version: Any, path: Any): String = Tr.f(2767, arrayOf(version, path)) - fun gpui_f_agent_version_signed_who(version: Any, path: Any, who: Any): String = Tr.f(2768, arrayOf(version, path, who)) - fun gpui_f_agent_version_notsigned(version: Any, path: Any): String = Tr.f(2769, arrayOf(version, path)) - fun gpui_f_agent_version_howsign(version: Any, path: Any, cmd: Any): String = Tr.f(2770, arrayOf(version, path, cmd)) - val gpui_f_not_installed: String get() = Tr.s(2771) - val gpui_f_or_terminal: String get() = Tr.s(2772) - fun gpui_f_no_install_button(cmd: Any): String = Tr.f(2773, arrayOf(cmd)) - val gpui_f_check_again: String get() = Tr.s(2774) - val gpui_f_check_again_note: String get() = Tr.s(2775) - val gpui_f_check_again_one: String get() = Tr.s(2776) - val gpui_f_claude_title: String get() = Tr.s(2777) - val gpui_f_claude_body: String get() = Tr.s(2778) - val gpui_f_codex_title: String get() = Tr.s(2779) - val gpui_f_codex_body: String get() = Tr.s(2780) - val gpui_f_others_title: String get() = Tr.s(2781) - val gpui_f_others_body: String get() = Tr.s(2782) - fun gpui_f_tool_runs(name: Any, version: Any, path: Any): String = Tr.f(2783, arrayOf(name, version, path)) - fun gpui_f_tool_broken(path: Any, why: Any): String = Tr.f(2784, arrayOf(path, why)) - fun gpui_f_tool_notfound(name: Any): String = Tr.f(2785, arrayOf(name)) - val gpui_f_kicad_body: String get() = Tr.s(2786) - fun gpui_f_kicad_ok_v(version: Any, cli: Any): String = Tr.f(2787, arrayOf(version, cli)) - fun gpui_f_kicad_ok(cli: Any): String = Tr.f(2788, arrayOf(cli)) - val gpui_f_releases: String get() = Tr.s(2789) - fun gpui_f_kicad_auto(version: Any): String = Tr.f(2790, arrayOf(version)) - fun gpui_f_kicad_offer_stock_v(version: Any): String = Tr.f(2791, arrayOf(version)) - val gpui_f_kicad_offer_stock: String get() = Tr.s(2792) - fun gpui_f_kicad_offer_old_v(version: Any): String = Tr.f(2793, arrayOf(version)) - val gpui_f_kicad_offer_old: String get() = Tr.s(2794) - fun gpui_f_kicad_offer_broken_v(version: Any): String = Tr.f(2795, arrayOf(version)) - val gpui_f_kicad_offer_broken: String get() = Tr.s(2796) - fun gpui_f_kicad_nopackage(computer: Any): String = Tr.f(2797, arrayOf(computer)) - fun gpui_f_kicad_found_stock_v(version: Any, cli: Any): String = Tr.f(2798, arrayOf(version, cli)) - fun gpui_f_kicad_found_stock(cli: Any): String = Tr.f(2799, arrayOf(cli)) - fun gpui_f_kicad_found_v(version: Any, cli: Any): String = Tr.f(2800, arrayOf(version, cli)) - fun gpui_f_kicad_found_plain(cli: Any): String = Tr.f(2801, arrayOf(cli)) - val gpui_f_kicad_found: String get() = Tr.s(2802) - val gpui_f_stock_kicad: String get() = Tr.s(2803) - val gpui_f_stock_kicad_note: String get() = Tr.s(2804) - val gpui_f_download_kicad: String get() = Tr.s(2805) - val gpui_f_locate: String get() = Tr.s(2806) - val gpui_f_locate_kicad: String get() = Tr.s(2807) - val gpui_f_use_path: String get() = Tr.s(2808) - val gpui_f_hint_kicad: String get() = Tr.s(2809) - val gpui_f_freecad_body: String get() = Tr.s(2810) - val gpui_f_locate_freecad: String get() = Tr.s(2811) - val gpui_f_hint_freecad: String get() = Tr.s(2812) - val gpui_f_debian: String get() = Tr.s(2813) - val gpui_f_local_code: String get() = Tr.s(2814) - val gpui_f_only_this: String get() = Tr.s(2815) - val gpui_f_machine_title: String get() = Tr.s(2816) - val gpui_f_machine_body: String get() = Tr.s(2817) - val gpui_f_ts_on: String get() = Tr.s(2818) - val gpui_f_ts_off: String get() = Tr.s(2819) - val gpui_f_ts_none: String get() = Tr.s(2820) - val gpui_f_linked_machines: String get() = Tr.s(2821) - val gpui_f_none_yet: String get() = Tr.s(2822) - fun gpui_f_n_linked(n: Number): String = Tr.f(2823, arrayOf(n)) - val gpui_f_phone_title: String get() = Tr.s(2824) - val gpui_f_phone_body: String get() = Tr.s(2825) - val gpui_f_pairing_link: String get() = Tr.s(2826) - val gpui_f_make_another: String get() = Tr.s(2827) - fun gpui_f_short_code(code: Any): String = Tr.f(2828, arrayOf(code)) - val gpui_f_add_device: String get() = Tr.s(2829) - fun gpui_f_invite_failed(e: Any): String = Tr.f(2830, arrayOf(e)) - val gpui_f_invite_note: String get() = Tr.s(2831) - val gpui_f_show_qr: String get() = Tr.s(2832) - val gpui_f_android_app: String get() = Tr.s(2833) - val gpui_f_android_note: String get() = Tr.s(2834) - val gpui_f_download_apk: String get() = Tr.s(2835) - val gpui_f_iphone_app: String get() = Tr.s(2836) - val gpui_f_iphone_note: String get() = Tr.s(2837) - val gpui_f_ts_phone: String get() = Tr.s(2838) - val gpui_f_ts_phone_note: String get() = Tr.s(2839) - val gpui_f_app_store: String get() = Tr.s(2840) - val gpui_f_google_play: String get() = Tr.s(2841) - val gpui_f_paired_devices: String get() = Tr.s(2842) - fun gpui_f_n_paired(n: Number): String = Tr.f(2843, arrayOf(n)) - val gpui_f_remote_title: String get() = Tr.s(2844) - val gpui_f_cont_on: String get() = Tr.s(2845) - val gpui_f_cont_off: String get() = Tr.s(2846) - val gpui_f_remote_body_package: String get() = Tr.s(2847) - fun gpui_f_remote_body_channel(channel: Any): String = Tr.f(2848, arrayOf(channel)) - val gpui_f_cont_restart: String get() = Tr.s(2849) - val gpui_f_open_page: String get() = Tr.s(2850) - val gpui_f_open_page_note: String get() = Tr.s(2851) - val gpui_f_network_updates: String get() = Tr.s(2852) - val gpui_f_project_title: String get() = Tr.s(2853) - val gpui_f_project_body: String get() = Tr.s(2854) - val gpui_f_add_another: String get() = Tr.s(2855) - val gpui_f_path_folder: String get() = Tr.s(2856) - val gpui_f_add_project: String get() = Tr.s(2857) - val gpui_f_create_project: String get() = Tr.s(2858) - val gpui_f_full_path: String get() = Tr.s(2859) - val gpui_f_thread_title: String get() = Tr.s(2860) - val gpui_f_thread_body: String get() = Tr.s(2861) - fun gpui_f_new_thread_in(project: Any): String = Tr.f(2862, arrayOf(project)) - val gpui_f_new_thread_note: String get() = Tr.s(2863) - val gpui_f_start_thread: String get() = Tr.s(2864) - val gpui_f_first_message: String get() = Tr.s(2865) - val gpui_f_project_first: String get() = Tr.s(2866) - val gpui_f_go_project: String get() = Tr.s(2867) - fun gpui_f_n_so_far(n: Number): String = Tr.f(2868, arrayOf(n)) - val gpui_f_tour_viewers: String get() = Tr.s(2869) - val gpui_f_tour_viewers_body: String get() = Tr.s(2870) - val gpui_f_key_side: String get() = Tr.s(2871) - val gpui_f_key_diff: String get() = Tr.s(2872) - val gpui_f_tour_threed: String get() = Tr.s(2873) - val gpui_f_tour_threed_body: String get() = Tr.s(2874) - val gpui_f_key_threed: String get() = Tr.s(2875) - val gpui_f_tour_mech: String get() = Tr.s(2876) - val gpui_f_tour_mech_body: String get() = Tr.s(2877) - val gpui_f_tour_browser_body: String get() = Tr.s(2878) - val gpui_f_tour_thread: String get() = Tr.s(2879) - fun gpui_f_tour_thread_body(m: Any): String = Tr.f(2880, arrayOf(m)) - val gpui_f_tour_bots_body: String get() = Tr.s(2881) - val gpui_f_make_bot: String get() = Tr.s(2882) - val gpui_f_opens_form: String get() = Tr.s(2883) - val gpui_f_new_bot: String get() = Tr.s(2884) - val gpui_f_tour_space: String get() = Tr.s(2885) - val gpui_f_tour_space_body: String get() = Tr.s(2886) - val gpui_f_tour_rooms_body: String get() = Tr.s(2887) - val gpui_f_make_room: String get() = Tr.s(2888) - val gpui_f_new_room: String get() = Tr.s(2889) - val gpui_f_tour_routines_body: String get() = Tr.s(2890) - val gpui_f_tour_palette: String get() = Tr.s(2891) - fun gpui_f_tour_palette_body(m: Any): String = Tr.f(2892, arrayOf(m)) - val gpui_f_key_agent: String get() = Tr.s(2893) - val gpui_f_key_prevnext: String get() = Tr.s(2894) - fun gpui_f_key_prevnext_keys(m: Any): String = Tr.f(2895, arrayOf(m)) - val gpui_f_key_uber: String get() = Tr.s(2896) - val gpui_f_try_it: String get() = Tr.s(2897) - val gpui_f_try_palette: String get() = Tr.s(2898) - val gpui_f_open_palette: String get() = Tr.s(2899) - val gpui_f_try_settings: String get() = Tr.s(2900) - val gpui_f_open_settings: String get() = Tr.s(2901) - fun gpui_f_tour_settings_body(pages: Any): String = Tr.f(2902, arrayOf(pages)) - val gpui_f_uber_title: String get() = Tr.s(2903) - fun gpui_f_uber_is(name: Any): String = Tr.f(2904, arrayOf(name)) - val gpui_f_uber_pick: String get() = Tr.s(2905) - val gpui_f_uber_create: String get() = Tr.s(2906) - fun gpui_f_uber_make(name: Any): String = Tr.f(2907, arrayOf(name)) - val gpui_f_uber_create_btn: String get() = Tr.s(2908) - val gpui_f_all_set: String get() = Tr.s(2909) - val gpui_f_still_open: String get() = Tr.s(2910) - val gpui_f_skipped_dot: String get() = Tr.s(2911) - val gpui_f_not_done_dot: String get() = Tr.s(2912) - val gpui_f_skipped: String get() = Tr.s(2913) - val gpui_f_not_done: String get() = Tr.s(2914) - val gpui_f_setup_finished: String get() = Tr.s(2915) - fun gpui_f_setup_finished_note(d: Number, n: Number): String = Tr.f(2916, arrayOf(d, n)) - val gpui_f_run_again: String get() = Tr.s(2917) - val gpui_f_setup_unfinished: String get() = Tr.s(2918) - val gpui_f_resume: String get() = Tr.s(2919) - val gpui_f_start_again: String get() = Tr.s(2920) - val gpui_f_setup_note: String get() = Tr.s(2921) - val gpui_f_run_setup: String get() = Tr.s(2922) - val gpui_f_name_bpkicad: String get() = Tr.s(2923) - val gpui_f_name_kicad: String get() = Tr.s(2924) - val gpui_f_name_freecad: String get() = Tr.s(2925) - val gpui_f_name_claude: String get() = Tr.s(2926) - val gpui_f_name_codex: String get() = Tr.s(2927) - val gpui_f_name_grok: String get() = Tr.s(2928) - val gpui_f_name_muse: String get() = Tr.s(2929) - val gpui_f_name_opencode: String get() = Tr.s(2930) - val gpui_f_name_pi: String get() = Tr.s(2931) - val gpui_f_name_omp: String get() = Tr.s(2932) - val gpui_f_name_fedora: String get() = Tr.s(2933) - val gpui_f_name_arch: String get() = Tr.s(2934) - val gpui_f_name_homebrew: String get() = Tr.s(2935) - val gpui_f_name_winget: String get() = Tr.s(2936) - fun gpui_f_fold_tools(n: Number, tools: Any): String = Tr.f(2937, arrayOf(n, tools)) - fun gpui_f_fold_tools_steps(n: Number, tools: Any, d: Number): String = Tr.f(2938, arrayOf(n, tools, d)) - fun gpui_f_fold_steps(n: Number, d: Number): String = Tr.f(2939, arrayOf(n, d)) - fun gpui_f_fold_live(n: Number, what: Any): String = Tr.f(2940, arrayOf(n, what)) - fun gpui_f_fold_live_steps(n: Number, d: Number, what: Any): String = Tr.f(2941, arrayOf(n, d, what)) - val gpui_f_restart: String get() = Tr.s(2942) - val gpui_f_not_read: String get() = Tr.s(2943) - val gpui_f_needs: String get() = Tr.s(2944) - fun gpui_f_needs_head(head: Any): String = Tr.f(2945, arrayOf(head)) - val gpui_f_type_here: String get() = Tr.s(2946) - val gpui_f_or_type: String get() = Tr.s(2947) - val gpui_f_quote_files: String get() = Tr.s(2948) - val gpui_f_dictate: String get() = Tr.s(2949) - val gpui_f_inactive: String get() = Tr.s(2950) - fun gpui_f_tool_runs_nover(name: Any, path: Any): String = Tr.f(2951, arrayOf(name, path)) - val gpui_f2_aon_boat_learn: String get() = Tr.s(2952) - val gpui_f2_uberbot_what: String get() = Tr.s(2953) - val gpui_acct_account_name_optional: String get() = Tr.s(2954) - val gpui_follow_button: String get() = Tr.s(2955) - val gpui_follow_button_tip: String get() = Tr.s(2956) - fun gpui_follow_route(page: Any, net: Any, near: Any): String = Tr.f(2957, arrayOf(page, net, near)) - fun gpui_follow_edit(page: Any, what: Any): String = Tr.f(2958, arrayOf(page, what)) - fun gpui_follow_near(ref: Any): String = Tr.f(2959, arrayOf(ref)) - val gpui_follow_wait: String get() = Tr.s(2960) - val gpui_follow_paused: String get() = Tr.s(2961) - val gpui_follow_resume: String get() = Tr.s(2962) - fun gpui_follow_held(page: Any): String = Tr.f(2963, arrayOf(page)) - val android_mgmt_all: String get() = Tr.s(2964) - val android_mgmt_judged: String get() = Tr.s(2965) - val android_mgmt_fix: String get() = Tr.s(2966) - val android_mgmt_sent: String get() = Tr.s(2967) - val android_mcp: String get() = Tr.s(2968) - val android_alerts_ask: String get() = Tr.s(2969) - val android_alerts_allow: String get() = Tr.s(2970) - val android_alerts_later: String get() = Tr.s(2971) - val android_viewerbg: String get() = Tr.s(2972) - val android_viewerbg_auto: String get() = Tr.s(2973) - val android_viewerbg_light: String get() = Tr.s(2974) - val android_viewerbg_dark: String get() = Tr.s(2975) - val android_viewerbg_custom: String get() = Tr.s(2976) - val android_viewerbg_hex: String get() = Tr.s(2977) - val android_viewerbg_note: String get() = Tr.s(2978) - val android_state_working: String get() = Tr.s(2979) - val android_state_inactive: String get() = Tr.s(2980) - val android_state_finished: String get() = Tr.s(2981) - val android_state_settled: String get() = Tr.s(2982) - val android_state_stalled: String get() = Tr.s(2983) - val android_state_monitoring: String get() = Tr.s(2984) - val android_ago_now: String get() = Tr.s(2985) - fun android_ago_m(n: Any): String = Tr.f(2986, arrayOf(n)) - fun android_ago_h(n: Any): String = Tr.f(2987, arrayOf(n)) - fun android_ago_d(n: Any): String = Tr.f(2988, arrayOf(n)) - val android_room_gone: String get() = Tr.s(2989) - fun android_conn_connecting(hub: Any): String = Tr.f(2990, arrayOf(hub)) - val android_conn_offline: String get() = Tr.s(2991) - val android_hub: String get() = Tr.s(2992) - val android_hub_add: String get() = Tr.s(2993) - val android_pair_repair: String get() = Tr.s(2994) - val android_pair_revoked: String get() = Tr.s(2995) - val android_pair_paste: String get() = Tr.s(2996) - val android_pair_photo: String get() = Tr.s(2997) - val android_pair_other: String get() = Tr.s(2998) - val android_pair_code_lead: String get() = Tr.s(2999) - val android_pair_code: String get() = Tr.s(3000) - val android_pair_code_bad: String get() = Tr.s(3001) - val android_pair_link_bad: String get() = Tr.s(3002) - val android_pair_ask: String get() = Tr.s(3003) - val android_pair_ask_note: String get() = Tr.s(3004) - val android_terminals: String get() = Tr.s(3005) - val android_search_hint: String get() = Tr.s(3006) - val android_projects_none: String get() = Tr.s(3007) - val android_project_add: String get() = Tr.s(3008) - val android_kind_uberbot: String get() = Tr.s(3009) - val android_kind_bot: String get() = Tr.s(3010) - val android_kind_room: String get() = Tr.s(3011) - fun android_thread_new_in(project: Any): String = Tr.f(3012, arrayOf(project)) - val android_threads_none: String get() = Tr.s(3013) - fun android_kids_hide(n: Number): String = Tr.f(3014, arrayOf(n)) - fun android_kids_show(n: Number): String = Tr.f(3015, arrayOf(n)) - fun android_work_head(word: Any): String = Tr.f(3016, arrayOf(word)) - fun android_lock_waiting(n: Any): String = Tr.f(3017, arrayOf(n)) - val android_state_head: String get() = Tr.s(3018) - val android_unsettle: String get() = Tr.s(3019) - val android_mic_off: String get() = Tr.s(3020) - val android_picture_bad: String get() = Tr.s(3021) - val android_buy_failed: String get() = Tr.s(3022) - val android_photo_bad: String get() = Tr.s(3023) - val android_camera_failed: String get() = Tr.s(3024) - val android_camera_off: String get() = Tr.s(3025) - val android_message_gone: String get() = Tr.s(3026) - val android_load_earlier: String get() = Tr.s(3027) - val android_thread_empty: String get() = Tr.s(3028) - val android_composer_hint: String get() = Tr.s(3029) - val android_pictures_old: String get() = Tr.s(3030) - val android_photo_choose: String get() = Tr.s(3031) - val android_photo_take: String get() = Tr.s(3032) - val android_failed_generic: String get() = Tr.s(3033) - val android_secret_new: String get() = Tr.s(3034) - fun android_secret_named(name: Any): String = Tr.f(3035, arrayOf(name)) - val android_secret_paste: String get() = Tr.s(3036) - val android_secret_refused: String get() = Tr.s(3037) - val android_secret_notneeded: String get() = Tr.s(3038) - val android_send_retry: String get() = Tr.s(3039) - val android_ask_open: String get() = Tr.s(3040) - val android_ask_done: String get() = Tr.s(3041) - val android_ask_answer: String get() = Tr.s(3042) - fun android_ask_answered(answer: Any): String = Tr.f(3043, arrayOf(answer)) - val android_hub_use: String get() = Tr.s(3044) - val native_hub_home: String get() = Tr.s(3045) - val native_hub_unreachable: String get() = Tr.s(3046) - val android_online: String get() = Tr.s(3047) - fun android_offline(why: Any): String = Tr.f(3048, arrayOf(why)) - val android_accounts: String get() = Tr.s(3049) - fun android_hub_forget_ask(hub: Any): String = Tr.f(3050, arrayOf(hub)) - val android_hub_forget_note: String get() = Tr.s(3051) - val android_improve: String get() = Tr.s(3052) - val android_alerts_head: String get() = Tr.s(3053) - val android_alerts_note: String get() = Tr.s(3054) - val android_quiet_head: String get() = Tr.s(3055) - fun android_quiet_range(from: Any, to: Any): String = Tr.f(3056, arrayOf(from, to)) - val android_urgent_head: String get() = Tr.s(3057) - val android_quiet_note: String get() = Tr.s(3058) - val android_unpair: String get() = Tr.s(3059) - val android_updates_head: String get() = Tr.s(3060) - val android_option_beta: String get() = Tr.s(3061) - val android_folder_use: String get() = Tr.s(3062) - fun android_thread_new_title(project: Any): String = Tr.f(3063, arrayOf(project)) - val android_thread_new_hint: String get() = Tr.s(3064) - val android_start: String get() = Tr.s(3065) - val android_improve_ask: String get() = Tr.s(3066) - val android_improve_note: String get() = Tr.s(3067) - val android_improve_github: String get() = Tr.s(3068) - val android_project_head: String get() = Tr.s(3069) - val android_improve_thread: String get() = Tr.s(3070) - val android_improve_sent: String get() = Tr.s(3071) - val android_order_head: String get() = Tr.s(3072) - fun android_order_named(name: Any): String = Tr.f(3073, arrayOf(name)) - val android_buy_now: String get() = Tr.s(3074) - val android_design_change: String get() = Tr.s(3075) - val android_live_working: String get() = Tr.s(3076) - fun android_live_count(n: Number): String = Tr.f(3077, arrayOf(n)) - val android_connecting: String get() = Tr.s(3078) - val android_hub_unreachable: String get() = Tr.s(3079) - val android_pair_code_address: String get() = Tr.s(3080) - val android_pair_link_partial: String get() = Tr.s(3081) - val android_pair_link_none: String get() = Tr.s(3082) - fun android_fail_http(code: Any): String = Tr.f(3083, arrayOf(code)) - fun android_fail_reach(hub: Any): String = Tr.f(3084, arrayOf(hub)) - fun android_fail_timeout(hub: Any): String = Tr.f(3085, arrayOf(hub)) - fun android_fail_dns(hub: Any): String = Tr.f(3086, arrayOf(hub)) - val android_offline_word: String get() = Tr.s(3087) - val android_offline_cap: String get() = Tr.s(3088) - val android_proto_old: String get() = Tr.s(3089) - val android_hub_refused: String get() = Tr.s(3090) - val android_hub_noanswer: String get() = Tr.s(3091) - val android_thinking: String get() = Tr.s(3092) - val android_buy_it: String get() = Tr.s(3093) - val android_layers: String get() = Tr.s(3094) - val android_link_old: String get() = Tr.s(3095) - val android_link_nohere: String get() = Tr.s(3096) - val android_link_failed: String get() = Tr.s(3097) - val android_link_offline: String get() = Tr.s(3098) - val android_copied: String get() = Tr.s(3099) - fun android_history_title(n: Any): String = Tr.f(3100, arrayOf(n)) - fun android_settled_title(n: Any): String = Tr.f(3101, arrayOf(n)) - val android_dictate: String get() = Tr.s(3102) - val android_voice_spelling: String get() = Tr.s(3103) - val android_voice_head: String get() = Tr.s(3104) - val android_link_noapp: String get() = Tr.s(3105) - val android_star: String get() = Tr.s(3106) - val android_rescue_restart: String get() = Tr.s(3107) - val android_rescue_pairing: String get() = Tr.s(3108) - val android_rescue_asking: String get() = Tr.s(3109) - val android_rescue_norestart: String get() = Tr.s(3110) - val android_rescue_nostatus: String get() = Tr.s(3111) - val android_rescue_sent: String get() = Tr.s(3112) - val android_rescue_refused: String get() = Tr.s(3113) - val android_rescue_old: String get() = Tr.s(3114) - val android_rescue_unreachable: String get() = Tr.s(3115) - val android_rescue_noanswer: String get() = Tr.s(3116) - fun android_rescue_still(status: Any): String = Tr.f(3117, arrayOf(status)) - val android_rescue_waiting: String get() = Tr.s(3118) - fun android_rescue_is(status: Any): String = Tr.f(3119, arrayOf(status)) - val android_rescue_down: String get() = Tr.s(3120) - val android_rescue_safedegraded: String get() = Tr.s(3121) - val android_rescue_degraded: String get() = Tr.s(3122) - val android_rescue_safe: String get() = Tr.s(3123) - val android_rescue_up: String get() = Tr.s(3124) - val android_pair_local: String get() = Tr.s(3125) - val android_pair_wrong: String get() = Tr.s(3126) - val android_pair_expired: String get() = Tr.s(3127) - val android_pair_used: String get() = Tr.s(3128) - val android_pair_revokedcode: String get() = Tr.s(3129) - val android_pair_limited: String get() = Tr.s(3130) - val android_pair_required: String get() = Tr.s(3131) - val android_pair_unreachable: String get() = Tr.s(3132) - val android_pad_pen_hint: String get() = Tr.s(3133) - val android_pad_box_hint: String get() = Tr.s(3134) - val android_pad_eraser_hint: String get() = Tr.s(3135) - val android_pad_pen: String get() = Tr.s(3136) - val android_pad_box: String get() = Tr.s(3137) - val android_pad_eraser: String get() = Tr.s(3138) - val android_pad_paper: String get() = Tr.s(3139) - val android_undo: String get() = Tr.s(3140) - val android_pad_length: String get() = Tr.s(3141) - val android_machines_head: String get() = Tr.s(3142) - val android_devices_head: String get() = Tr.s(3143) - val android_mic_failed: String get() = Tr.s(3144) - val android_dictation_failed: String get() = Tr.s(3145) - val android_paste: String get() = Tr.s(3146) - val android_term_copy: String get() = Tr.s(3147) - fun android_terminals_in(project: Any): String = Tr.f(3148, arrayOf(project)) - val android_term_new: String get() = Tr.s(3149) - val android_terms_none: String get() = Tr.s(3150) - val android_term_failed: String get() = Tr.s(3151) - fun android_term_exited(code: Any): String = Tr.f(3152, arrayOf(code)) - val android_term_kind_shell: String get() = Tr.s(3153) - fun android_mesh_previous(why: Any): String = Tr.f(3154, arrayOf(why)) - val android_mesh_decoding: String get() = Tr.s(3155) - val android_mesh_bad: String get() = Tr.s(3156) - val android_viewer_a11y: String get() = Tr.s(3157) - val android_search_inthread: String get() = Tr.s(3158) - val android_thread_detach: String get() = Tr.s(3159) - val android_delete_more: String get() = Tr.s(3160) - val android_thread_rename: String get() = Tr.s(3161) - fun android_thread_delete_ask(title: Any): String = Tr.f(3162, arrayOf(title)) - val android_thread_delete: String get() = Tr.s(3163) - val android_keep: String get() = Tr.s(3164) - val android_badge_more: String get() = Tr.s(3165) - val android_project_remove_more: String get() = Tr.s(3166) - val android_project_rename: String get() = Tr.s(3167) - fun android_project_remove_ask(title: Any): String = Tr.f(3168, arrayOf(title)) - val android_searching: String get() = Tr.s(3169) - fun android_search_none(q: Any): String = Tr.f(3170, arrayOf(q)) - fun android_search_project(title: Any): String = Tr.f(3171, arrayOf(title)) - val android_history_head: String get() = Tr.s(3172) - val android_done: String get() = Tr.s(3173) - val android_you: String get() = Tr.s(3174) - val android_agent: String get() = Tr.s(3175) - fun android_room_post_to(room: Any): String = Tr.f(3176, arrayOf(room)) - val android_post: String get() = Tr.s(3177) - val android_find_head: String get() = Tr.s(3178) - val android_find_hint: String get() = Tr.s(3179) - fun android_find_none(q: Any): String = Tr.f(3180, arrayOf(q)) - val android_accounts_none: String get() = Tr.s(3181) - val android_account_name_hint: String get() = Tr.s(3182) - val android_account_add: String get() = Tr.s(3183) - val android_account: String get() = Tr.s(3184) - val android_signin_open: String get() = Tr.s(3185) - val android_copy_code: String get() = Tr.s(3186) - val android_code_paste: String get() = Tr.s(3187) - val android_code_send: String get() = Tr.s(3188) - val android_viewer_split: String get() = Tr.s(3189) - fun android_viewer_title(title: Any): String = Tr.f(3190, arrayOf(title)) - val android_viewer_board: String get() = Tr.s(3191) - val android_viewer_boards: String get() = Tr.s(3192) - val android_viewer_sheet: String get() = Tr.s(3193) - val android_viewer_sheets: String get() = Tr.s(3194) - fun android_viewer_sheets_n(n: Number): String = Tr.f(3195, arrayOf(n)) - fun ios_viewer_sheets_n(n: Number): String = Tr.f(3196, arrayOf(n)) - val android_viewer_change: String get() = Tr.s(3197) - val android_viewer_find: String get() = Tr.s(3198) - val android_viewer_noboard: String get() = Tr.s(3199) - val android_viewer_nosch: String get() = Tr.s(3200) - fun android_viewer_piece(at: Any): String = Tr.f(3201, arrayOf(at)) - val android_viewer_loading3d: String get() = Tr.s(3202) - val android_compare_close: String get() = Tr.s(3203) - val android_compare_none: String get() = Tr.s(3204) - val android_mech_none: String get() = Tr.s(3205) - val android_folder_empty: String get() = Tr.s(3206) - val android_file_bad: String get() = Tr.s(3207) - val android_file_noimage: String get() = Tr.s(3208) - fun android_file_nopreview(size: Any): String = Tr.f(3209, arrayOf(size)) - val android_pdf_bad: String get() = Tr.s(3210) - fun android_pdf_page(n: Any, total: Any): String = Tr.f(3211, arrayOf(n, total)) - val android_browser_takeover: String get() = Tr.s(3212) - val android_browser_keys: String get() = Tr.s(3213) - val android_browser_handback: String get() = Tr.s(3214) - val android_browser_page: String get() = Tr.s(3215) - val android_browser_none: String get() = Tr.s(3216) - val android_browser_driving: String get() = Tr.s(3217) - val android_changes_head: String get() = Tr.s(3218) - val android_diff_nogit: String get() = Tr.s(3219) - val android_diff_none: String get() = Tr.s(3220) - val android_checks_run: String get() = Tr.s(3221) - val android_nothing: String get() = Tr.s(3222) - val android_comments_none: String get() = Tr.s(3223) - val android_resolved: String get() = Tr.s(3224) - val android_reopen: String get() = Tr.s(3225) - val android_resolve: String get() = Tr.s(3226) - val android_comment_hint: String get() = Tr.s(3227) - fun android_probe_lit(n: Any): String = Tr.f(3228, arrayOf(n)) - fun android_fold_running(what: Any): String = Tr.f(3229, arrayOf(what)) - val android_hub_voice_unsupported_here: String get() = Tr.s(3230) - val android_hub_voice_mic_note_plain: String get() = Tr.s(3231) - fun android_hub_voice_mic_note_default(device: Any): String = Tr.f(3232, arrayOf(device)) - fun android_hub_voice_mic_note(device: Any): String = Tr.f(3233, arrayOf(device)) - val android_hub_voice_engine_pending: String get() = Tr.s(3234) - val android_hub_voice_dict_empty: String get() = Tr.s(3235) - val android_hub_voice_learned_empty: String get() = Tr.s(3236) - val android_hub_voice_pebble: String get() = Tr.s(3237) - val android_hub_voice_pebble_note: String get() = Tr.s(3238) - val android_hub_voice_noaudio_mic: String get() = Tr.s(3239) - val android_hub_voice_silent_mic: String get() = Tr.s(3240) - val android_hub_voice_skip: String get() = Tr.s(3241) - fun android_hub_voice_heard_many(word: Any, count: Any): String = Tr.f(3242, arrayOf(word, count)) - fun android_hub_voice_dropped(heard: Any): String = Tr.f(3243, arrayOf(heard)) - val android_hub_voice_err_copy: String get() = Tr.s(3244) - val android_hub_voice_err_busy: String get() = Tr.s(3245) - val android_hub_voice_err_setting: String get() = Tr.s(3246) - val android_hub_voice_err_action: String get() = Tr.s(3247) - val android_hub_voice_err_request: String get() = Tr.s(3248) - val android_hub_voice_err_term: String get() = Tr.s(3249) - val android_hub_voice_err_key: String get() = Tr.s(3250) - val android_hub_voice_err_write: String get() = Tr.s(3251) - val android_hub_voice_err_start: String get() = Tr.s(3252) - val android_hub_voice_err_stopped: String get() = Tr.s(3253) - val android_hub_voice_err_missing: String get() = Tr.s(3254) - fun android_hub_entry_step_files(files: Any): String = Tr.f(3255, arrayOf(files)) - fun android_hub_entry_step_base(files: Any): String = Tr.f(3256, arrayOf(files)) - val android_hub_entry_noreason: String get() = Tr.s(3257) - val android_hub_entry_retired: String get() = Tr.s(3258) - fun android_hub_viewer_layer(name: Any): String = Tr.f(3259, arrayOf(name)) - val android_hub_viewer_pads: String get() = Tr.s(3260) - val android_hub_viewer_vias: String get() = Tr.s(3261) - val android_hub_viewer_holes: String get() = Tr.s(3262) - val android_hub_viewer_margin: String get() = Tr.s(3263) - val android_hub_viewer_sch_page: String get() = Tr.s(3264) - val android_hub_viewer_sch_sheetfill: String get() = Tr.s(3265) - val android_hub_viewer_sch_bodyfill: String get() = Tr.s(3266) - val android_hub_viewer_sch_graphic: String get() = Tr.s(3267) - val android_hub_viewer_sch_note: String get() = Tr.s(3268) - val android_hub_viewer_sch_body: String get() = Tr.s(3269) - val android_hub_viewer_sch_pin: String get() = Tr.s(3270) - val android_hub_viewer_sch_pinname: String get() = Tr.s(3271) - val android_hub_viewer_sch_pinnumber: String get() = Tr.s(3272) - val android_hub_viewer_sch_field: String get() = Tr.s(3273) - val android_hub_viewer_sch_fieldother: String get() = Tr.s(3274) - val android_hub_viewer_sch_bus: String get() = Tr.s(3275) - val android_hub_viewer_sch_busentry: String get() = Tr.s(3276) - val android_hub_viewer_sch_wire: String get() = Tr.s(3277) - val android_hub_viewer_sch_noconnect: String get() = Tr.s(3278) - val android_hub_viewer_sch_junction: String get() = Tr.s(3279) - val android_hub_viewer_sch_sheetname: String get() = Tr.s(3280) - val android_hub_viewer_sch_sheetfile: String get() = Tr.s(3281) - val android_hub_viewer_sch_dnp: String get() = Tr.s(3282) - val android_hub_review_nokicad: String get() = Tr.s(3283) - val android_hub_review_wait: String get() = Tr.s(3284) - val android_hub_review_nosch: String get() = Tr.s(3285) - val android_hub_review_nofindings: String get() = Tr.s(3286) - fun android_hub_review_unticked(n: Any): String = Tr.f(3287, arrayOf(n)) - fun android_hub_review_customfailed(n: Any): String = Tr.f(3288, arrayOf(n)) - val android_hub_review_runthem: String get() = Tr.s(3289) - val android_hub_err_thread: String get() = Tr.s(3290) - val android_hub_err_project: String get() = Tr.s(3291) - val android_hub_err_room: String get() = Tr.s(3292) - val android_hub_err_method: String get() = Tr.s(3293) - val android_hub_err_attachment: String get() = Tr.s(3294) - val android_hub_err_noanswer: String get() = Tr.s(3295) - val android_hub_err_empty: String get() = Tr.s(3296) - val android_hub_err_oldapp: String get() = Tr.s(3297) - val android_hub_err_clientid: String get() = Tr.s(3298) - fun android_hub_err_images_max(n: Any): String = Tr.f(3299, arrayOf(n)) - val android_hub_err_images_kind: String get() = Tr.s(3300) - val android_hub_err_images_base64: String get() = Tr.s(3301) - val android_hub_err_images_size: String get() = Tr.s(3302) - val android_hub_err_images_store: String get() = Tr.s(3303) - val android_hub_err_folder_none: String get() = Tr.s(3304) - val android_hub_err_folder_read: String get() = Tr.s(3305) - val android_hub_err_notadded: String get() = Tr.s(3306) - val android_hub_err_nothread: String get() = Tr.s(3307) - val android_hub_err_env: String get() = Tr.s(3308) - val android_hub_err_channel: String get() = Tr.s(3309) - val android_hub_err_topic: String get() = Tr.s(3310) - val android_hub_err_tint: String get() = Tr.s(3311) - val android_hub_err_usage: String get() = Tr.s(3312) - val android_hub_err_nofolder: String get() = Tr.s(3313) - val android_hub_err_path: String get() = Tr.s(3314) - val android_hub_err_layer: String get() = Tr.s(3315) - val android_hub_err_compare: String get() = Tr.s(3316) - val android_hub_err_version: String get() = Tr.s(3317) - val android_hub_err_repo: String get() = Tr.s(3318) - val android_hub_err_toolbar: String get() = Tr.s(3319) - val android_hub_err_page: String get() = Tr.s(3320) - val android_hub_err_term_none: String get() = Tr.s(3321) - val android_hub_err_term_off: String get() = Tr.s(3322) - val android_hub_err_term_stopped: String get() = Tr.s(3323) - val android_hub_err_term_many: String get() = Tr.s(3324) - val android_hub_err_term_much: String get() = Tr.s(3325) - val android_hub_err_term_base64: String get() = Tr.s(3326) - val android_hub_err_busy: String get() = Tr.s(3327) - val android_hub_err_store: String get() = Tr.s(3328) - val android_hub_err_noagent: String get() = Tr.s(3329) - val android_hub_err_project_choose: String get() = Tr.s(3330) - val android_hub_err_project_retry: String get() = Tr.s(3331) - val android_hub_err_project_message: String get() = Tr.s(3332) - fun android_hub_err_project_already(root: Any): String = Tr.f(3333, arrayOf(root)) - fun android_hub_err_project_invalid(path: Any): String = Tr.f(3334, arrayOf(path)) - val android_hub_err_project_nofolder: String get() = Tr.s(3335) - val android_hub_err_project_unavailable: String get() = Tr.s(3336) - val android_hub_err_project_home: String get() = Tr.s(3337) - val android_hub_err_folder_gone: String get() = Tr.s(3338) - val android_hub_err_notfolder: String get() = Tr.s(3339) - val android_hub_err_file: String get() = Tr.s(3340) - val android_hub_err_utf8: String get() = Tr.s(3341) - val android_hub_err_parent: String get() = Tr.s(3342) - val android_hub_err_conversation: String get() = Tr.s(3343) - val android_hub_err_account_move: String get() = Tr.s(3344) - val android_hub_err_account_turn: String get() = Tr.s(3345) - val android_hub_err_account_agent: String get() = Tr.s(3346) - val android_hub_err_account_changed: String get() = Tr.s(3347) - val android_hub_err_account_none: String get() = Tr.s(3348) - val android_hub_err_intent_reload: String get() = Tr.s(3349) - val android_hub_err_intent_saving: String get() = Tr.s(3350) - val android_hub_err_intent_dir: String get() = Tr.s(3351) - val android_hub_err_intent_section: String get() = Tr.s(3352) - val android_hub_err_order_off: String get() = Tr.s(3353) - val android_hub_err_order_changed: String get() = Tr.s(3354) - val android_hub_err_order_upload: String get() = Tr.s(3355) - val android_hub_err_machine: String get() = Tr.s(3356) - fun android_hub_devices_used_by(name: Any): String = Tr.f(3357, arrayOf(name)) - val android_hub_devices_used: String get() = Tr.s(3358) - val android_hub_devices_revoked: String get() = Tr.s(3359) - fun android_hub_devices_expired(until: Any): String = Tr.f(3360, arrayOf(until)) - fun android_hub_devices_invite_failed(error: Any): String = Tr.f(3361, arrayOf(error)) - val android_hub_devices_add: String get() = Tr.s(3362) - val android_hub_devices_add_note: String get() = Tr.s(3363) - val android_hub_devices_retry: String get() = Tr.s(3364) - val android_hub_devices_lan: String get() = Tr.s(3365) - val android_hub_devices_lan_on: String get() = Tr.s(3366) - val android_hub_devices_lan_gone: String get() = Tr.s(3367) - fun android_hub_devices_lan_row(url: Any): String = Tr.f(3368, arrayOf(url)) - val android_hub_devices_lan_stop: String get() = Tr.s(3369) - val android_hub_devices_link_open: String get() = Tr.s(3370) - val android_hub_devices_link_used: String get() = Tr.s(3371) - fun android_hub_devices_link_open_by(name: Any): String = Tr.f(3372, arrayOf(name)) - fun android_hub_devices_link_used_by(name: Any): String = Tr.f(3373, arrayOf(name)) - val android_hub_devices_kind_tailnet: String get() = Tr.s(3374) - val android_hub_devices_kind_local: String get() = Tr.s(3375) - val android_hub_devices_tailnet_note: String get() = Tr.s(3376) - val android_hub_devices_lan_note: String get() = Tr.s(3377) - val android_hub_devices_reach: String get() = Tr.s(3378) - val android_hub_devices_lan_address: String get() = Tr.s(3379) - val android_hub_devices_another: String get() = Tr.s(3380) - fun android_hub_devices_qrnote(code: Any, hub: Any, until: Any): String = Tr.f(3381, arrayOf(code, hub, until)) - fun android_hub_devices_lan_offer(url: Any): String = Tr.f(3382, arrayOf(url)) - val android_hub_devices_lan_let: String get() = Tr.s(3383) - val android_hub_devices_only: String get() = Tr.s(3384) - val android_hub_devices_local_only: String get() = Tr.s(3385) - fun android_hub_devices_local_choose(kinds: Any): String = Tr.f(3386, arrayOf(kinds)) - fun android_hub_devices_lan_unknown(address: Any): String = Tr.f(3387, arrayOf(address)) - val android_hub_devices_lan_copy: String get() = Tr.s(3388) - fun android_hub_devices_lan_taken(address: Any): String = Tr.f(3389, arrayOf(address)) - val android_hub_devices_err_action: String get() = Tr.s(3390) - val android_hub_machines_none: String get() = Tr.s(3391) - fun android_hub_machines_paired(url: Any): String = Tr.f(3392, arrayOf(url)) - fun android_hub_machines_notyours(url: Any): String = Tr.f(3393, arrayOf(url)) - fun android_hub_machines_unpaired(url: Any): String = Tr.f(3394, arrayOf(url)) - fun android_hub_machines_via(url: Any, via: Any): String = Tr.f(3395, arrayOf(url, via)) - val android_hub_machines_rename: String get() = Tr.s(3396) - val android_hub_machines_rename_note: String get() = Tr.s(3397) - val android_hub_machines_rename_from: String get() = Tr.s(3398) - val android_hub_machines_rename_to: String get() = Tr.s(3399) - fun android_hub_machines_wants(name: Any): String = Tr.f(3400, arrayOf(name)) - fun android_hub_machines_request(url: Any, check: Any, left: Any): String = Tr.f(3401, arrayOf(url, check, left)) - val android_hub_machines_approve: String get() = Tr.s(3402) - fun android_hub_machines_waiting(check: Any): String = Tr.f(3403, arrayOf(check)) - fun android_hub_machines_pairing(address: Any): String = Tr.f(3404, arrayOf(address)) - fun android_hub_machines_status_linked(name: Any): String = Tr.f(3405, arrayOf(name)) - fun android_hub_machines_status_refused(error: Any): String = Tr.f(3406, arrayOf(error)) - fun android_hub_machines_found(url: Any): String = Tr.f(3407, arrayOf(url)) - fun android_hub_machines_found_other(url: Any): String = Tr.f(3408, arrayOf(url)) - val android_hub_machines_code_hint: String get() = Tr.s(3409) - val android_hub_machines_pair_title: String get() = Tr.s(3410) - val android_hub_machines_pair_note: String get() = Tr.s(3411) - val android_hub_machines_addr_hint: String get() = Tr.s(3412) - val android_hub_machines_code: String get() = Tr.s(3413) - val android_hub_machines_code_title: String get() = Tr.s(3414) - fun android_hub_machines_code_note(code: Any, address: Any, left: Any): String = Tr.f(3415, arrayOf(code, address, left)) - val android_hub_machines_code_another: String get() = Tr.s(3416) - val android_hub_machines_make: String get() = Tr.s(3417) - val android_hub_machines_make_note: String get() = Tr.s(3418) - val android_hub_machines_err_link: String get() = Tr.s(3419) - val android_hub_machines_err_which: String get() = Tr.s(3420) - fun android_hub_machines_err_called(name: Any): String = Tr.f(3421, arrayOf(name)) - fun android_hub_machines_err_taken(name: Any): String = Tr.f(3422, arrayOf(name)) - val android_hub_machines_err_invite: String get() = Tr.s(3423) - val android_hub_machines_err_codes: String get() = Tr.s(3424) - val android_hub_machines_err_record: String get() = Tr.s(3425) - val android_hub_machines_err_expired_answered: String get() = Tr.s(3426) - val android_hub_machines_err_secret: String get() = Tr.s(3427) - val android_hub_machines_err_approval: String get() = Tr.s(3428) - val android_hub_machines_err_expired: String get() = Tr.s(3429) - val android_hub_machines_err_address: String get() = Tr.s(3430) - val android_hub_machines_err_nocode: String get() = Tr.s(3431) - val android_hub_machines_err_already: String get() = Tr.s(3432) - fun android_hub_machines_err_noanswer(address: Any): String = Tr.f(3433, arrayOf(address)) - val android_hub_machines_err_nothing: String get() = Tr.s(3434) - val android_hub_machines_err_attempt: String get() = Tr.s(3435) - val android_hub_machines_err_invites: String get() = Tr.s(3436) - val android_hub_machines_err_invite_record: String get() = Tr.s(3437) - val android_hub_machines_err_invite_secret: String get() = Tr.s(3438) - val android_hub_machines_err_unusable: String get() = Tr.s(3439) - fun android_hub_machines_err_nolink(code: Any, body: Any): String = Tr.f(3440, arrayOf(code, body)) - val android_hub_machines_err_notlinked: String get() = Tr.s(3441) - val android_hub_machines_err_nocodeback: String get() = Tr.s(3442) - fun android_hub_machines_err_nocodegiven(code: Any, body: Any): String = Tr.f(3443, arrayOf(code, body)) - val android_hub_accounts_state_connected: String get() = Tr.s(3444) - val android_hub_accounts_state_expired: String get() = Tr.s(3445) - val android_hub_accounts_state_connecting: String get() = Tr.s(3446) - val android_hub_accounts_state_unchecked: String get() = Tr.s(3447) - val android_hub_accounts_state_none: String get() = Tr.s(3448) - fun android_hub_accounts_limit(window: Any, used: Any): String = Tr.f(3449, arrayOf(window, used)) - fun android_hub_accounts_limit_resets(window: Any, used: Any, `when`: Any): String = Tr.f(3450, arrayOf(window, used, `when`)) - fun android_hub_accounts_limit_stale(window: Any, used: Any): String = Tr.f(3451, arrayOf(window, used)) - fun android_hub_accounts_limit_resets_stale(window: Any, used: Any, `when`: Any): String = Tr.f(3452, arrayOf(window, used, `when`)) - fun android_hub_accounts_add(provider: Any): String = Tr.f(3453, arrayOf(provider)) - val android_hub_accounts_note: String get() = Tr.s(3454) - val android_hub_accounts_signin_starting: String get() = Tr.s(3455) - val android_hub_accounts_signin_paste: String get() = Tr.s(3456) - val android_hub_accounts_signin_device: String get() = Tr.s(3457) - val android_hub_accounts_signin_done: String get() = Tr.s(3458) - val android_hub_accounts_signin_expired: String get() = Tr.s(3459) - val android_hub_accounts_signin_cancelled: String get() = Tr.s(3460) - val android_hub_accounts_signin_failed: String get() = Tr.s(3461) - val android_hub_accounts_act_cancel: String get() = Tr.s(3462) - val android_hub_accounts_act_again: String get() = Tr.s(3463) - val android_hub_accounts_act_signin: String get() = Tr.s(3464) - fun android_hub_accounts_remove_ask(label: Any): String = Tr.f(3465, arrayOf(label)) - fun android_hub_accounts_hold_resets(`when`: Any): String = Tr.f(3466, arrayOf(`when`)) - val android_hub_accounts_hold: String get() = Tr.s(3467) - fun android_hub_accounts_alert_expired(provider: Any): String = Tr.f(3468, arrayOf(provider)) - fun android_hub_accounts_alert_needed(provider: Any, title: Any, why: Any): String = Tr.f(3469, arrayOf(provider, title, why)) - val android_hub_accounts_msg_expired: String get() = Tr.s(3470) - val android_hub_accounts_msg_expired_long: String get() = Tr.s(3471) - val android_hub_accounts_msg_generic: String get() = Tr.s(3472) - val android_hub_accounts_msg_nolimits: String get() = Tr.s(3473) - val android_hub_accounts_msg_nowindows: String get() = Tr.s(3474) - val android_hub_accounts_msg_signin: String get() = Tr.s(3475) - val android_hub_accounts_msg_directory: String get() = Tr.s(3476) - val android_hub_accounts_fail_code: String get() = Tr.s(3477) - val android_hub_accounts_fail_network: String get() = Tr.s(3478) - val android_hub_accounts_fail_storage: String get() = Tr.s(3479) - val android_hub_accounts_fail_cli: String get() = Tr.s(3480) - val android_hub_accounts_fail_dir: String get() = Tr.s(3481) - val android_hub_accounts_fail_verify: String get() = Tr.s(3482) - val android_hub_accounts_code_incomplete: String get() = Tr.s(3483) - val android_hub_accounts_code_other: String get() = Tr.s(3484) - val android_hub_accounts_msg_unverified: String get() = Tr.s(3485) - val android_hub_accounts_msg_registry: String get() = Tr.s(3486) - val android_hub_accounts_msg_identity: String get() = Tr.s(3487) - val android_hub_accounts_msg_subscription: String get() = Tr.s(3488) - fun android_hub_accounts_msg_refused(reason: Any): String = Tr.f(3489, arrayOf(reason)) - val android_hub_accounts_msg_toolarge: String get() = Tr.s(3490) - val android_hub_accounts_msg_closed: String get() = Tr.s(3491) - val android_hub_accounts_msg_timeout: String get() = Tr.s(3492) - val android_hub_accounts_msg_notusage: String get() = Tr.s(3493) - val android_hub_accounts_usage_unauthorized: String get() = Tr.s(3494) - val android_hub_accounts_usage_forbidden: String get() = Tr.s(3495) - val android_hub_accounts_usage_limited: String get() = Tr.s(3496) - fun android_hub_accounts_usage_code(code: Any): String = Tr.f(3497, arrayOf(code)) - val android_hub_accounts_err_gone: String get() = Tr.s(3498) - val android_hub_accounts_err_provider: String get() = Tr.s(3499) - val android_hub_accounts_err_add: String get() = Tr.s(3500) - val android_hub_accounts_err_gate: String get() = Tr.s(3501) - val android_hub_accounts_err_default: String get() = Tr.s(3502) - val android_hub_accounts_err_busy: String get() = Tr.s(3503) - val android_hub_accounts_err_select: String get() = Tr.s(3504) - val android_hub_accounts_err_check: String get() = Tr.s(3505) - fun android_hub_accounts_err_called(name: Any): String = Tr.f(3506, arrayOf(name)) - val android_hub_update_off: String get() = Tr.s(3507) - val android_hub_update_checking: String get() = Tr.s(3508) - fun android_hub_update_downloading(version: Any): String = Tr.f(3509, arrayOf(version)) - fun android_hub_update_waiting(version: Any): String = Tr.f(3510, arrayOf(version)) - fun android_hub_update_installing(version: Any): String = Tr.f(3511, arrayOf(version)) - val android_hub_update_failed: String get() = Tr.s(3512) - fun android_hub_update_row(version: Any): String = Tr.f(3513, arrayOf(version)) - fun android_hub_update_done(version: Any): String = Tr.f(3514, arrayOf(version)) - fun android_hub_update_rolledback(version: Any): String = Tr.f(3515, arrayOf(version)) - fun android_hub_update_rolledback_why(version: Any, why: Any): String = Tr.f(3516, arrayOf(version, why)) - fun android_hub_update_notstarted(version: Any): String = Tr.f(3517, arrayOf(version)) - val android_hub_update_turns: String get() = Tr.s(3518) - fun android_hub_update_err_feed(code: Any): String = Tr.f(3519, arrayOf(code)) - val android_hub_update_err_unpack: String get() = Tr.s(3520) - val android_hub_update_err_newer: String get() = Tr.s(3521) - val android_hub_update_err_nokey: String get() = Tr.s(3522) - val android_hub_update_err_untrusted: String get() = Tr.s(3523) - val android_hub_update_err_other: String get() = Tr.s(3524) - val android_hub_update_err_version: String get() = Tr.s(3525) - val android_hub_update_err_channel_tag: String get() = Tr.s(3526) - val android_hub_update_err_channel: String get() = Tr.s(3527) - val android_hub_update_err_file: String get() = Tr.s(3528) - val android_hub_update_err_checksum_bad: String get() = Tr.s(3529) - val android_hub_update_err_size_range: String get() = Tr.s(3530) - val android_hub_update_err_empty: String get() = Tr.s(3531) - val android_hub_update_err_listing: String get() = Tr.s(3532) - val android_hub_update_err_hardlink: String get() = Tr.s(3533) - val android_hub_update_err_link: String get() = Tr.s(3534) - fun android_hub_update_err_outside(name: Any): String = Tr.f(3535, arrayOf(name)) - val android_hub_update_err_norun: String get() = Tr.s(3536) - val android_hub_update_err_nohub: String get() = Tr.s(3537) - val android_hub_update_err_size: String get() = Tr.s(3538) - val android_hub_update_err_checksum: String get() = Tr.s(3539) - val android_hub_update_err_guard: String get() = Tr.s(3540) - val android_hub_update_err_guard_busy: String get() = Tr.s(3541) - fun android_hub_work_todo(count: Any): String = Tr.f(3542, arrayOf(count)) - fun android_hub_work_watch(title: Any): String = Tr.f(3543, arrayOf(title)) - fun android_hub_work_lock(name: Any): String = Tr.f(3544, arrayOf(name)) - val android_hub_work_release_done: String get() = Tr.s(3545) - val android_hub_work_flock: String get() = Tr.s(3546) - fun android_hub_work_position(n: Any, holder: Any): String = Tr.f(3547, arrayOf(n, holder)) - fun android_hub_work_position_job(n: Any, title: Any): String = Tr.f(3548, arrayOf(n, title)) - fun android_hub_work_job(title: Any): String = Tr.f(3549, arrayOf(title)) - val android_hub_work_subagent: String get() = Tr.s(3550) - val android_hub_work_said: String get() = Tr.s(3551) - fun android_hub_work_steps(n: Number): String = Tr.f(3552, arrayOf(n)) - fun android_hub_work_tokens(n: Any): String = Tr.f(3553, arrayOf(n)) - fun android_hub_work_tokens_k(n: Any): String = Tr.f(3554, arrayOf(n)) - fun android_hub_work_tokens_m(n: Any): String = Tr.f(3555, arrayOf(n)) - fun android_hub_work_where(harness: Any, typed: String, type: Any, remote: String, host: Any, wt: String, branch: Any): String = Tr.f(3556, arrayOf(harness, typed, type, remote, host, wt, branch)) - val android_hub_work_state_ended: String get() = Tr.s(3557) - val android_hub_work_word_launching: String get() = Tr.s(3558) - val android_hub_work_word_watching: String get() = Tr.s(3559) - val android_hub_work_word_timedout: String get() = Tr.s(3560) - val android_hub_work_word_cancelling: String get() = Tr.s(3561) - val android_hub_work_word_queued: String get() = Tr.s(3562) - val android_hub_work_word_unknown: String get() = Tr.s(3563) - val android_hub_work_word_completed: String get() = Tr.s(3564) - val android_hub_work_word_killed: String get() = Tr.s(3565) - fun android_hub_locks_outside(pid: Any): String = Tr.f(3566, arrayOf(pid)) - val android_hub_picker_notinstalled: String get() = Tr.s(3567) - val android_hub_picker_notinstalled_here: String get() = Tr.s(3568) - val android_hub_picker_notinstalled_agy: String get() = Tr.s(3569) - val android_hub_picker_cli: String get() = Tr.s(3570) - fun android_hub_picker_left(left: Any): String = Tr.f(3571, arrayOf(left)) - fun android_hub_picker_left_shared(left: Any): String = Tr.f(3572, arrayOf(left)) - val android_hub_picker_shared: String get() = Tr.s(3573) - val android_hub_picker_why_expired: String get() = Tr.s(3574) - val android_hub_picker_why_unchecked: String get() = Tr.s(3575) - val android_hub_picker_why_connecting: String get() = Tr.s(3576) - val android_hub_picker_why_none: String get() = Tr.s(3577) - fun android_hub_picker_window_fivehour(left: Any): String = Tr.f(3578, arrayOf(left)) - fun android_hub_picker_window_week(left: Any): String = Tr.f(3579, arrayOf(left)) - fun android_hub_picker_window_opus(left: Any): String = Tr.f(3580, arrayOf(left)) - fun android_hub_picker_window_sonnet(left: Any): String = Tr.f(3581, arrayOf(left)) - fun android_hub_picker_window(label: Any, left: Any): String = Tr.f(3582, arrayOf(label, left)) - fun android_hub_picker_resets(`when`: Any): String = Tr.f(3583, arrayOf(`when`)) - fun android_hub_picker_extra(used: Any): String = Tr.f(3584, arrayOf(used)) - fun android_hub_picker_extra_of(used: Any, limit: Any): String = Tr.f(3585, arrayOf(used, limit)) - val android_hub_picker_nolimit: String get() = Tr.s(3586) - val android_hub_status_blocked: String get() = Tr.s(3587) - val android_hub_order_step_details: String get() = Tr.s(3588) - val android_hub_order_step_quote: String get() = Tr.s(3589) - val android_hub_order_step_pay: String get() = Tr.s(3590) - val android_hub_order_step_made: String get() = Tr.s(3591) - val android_hub_order_step_shipped: String get() = Tr.s(3592) - val android_hub_order_line_asked: String get() = Tr.s(3593) - val android_hub_order_line_getting: String get() = Tr.s(3594) - val android_hub_order_line_reply: String get() = Tr.s(3595) - val android_hub_order_line_files: String get() = Tr.s(3596) - val android_hub_order_line_quoting: String get() = Tr.s(3597) - val android_hub_order_line_expired: String get() = Tr.s(3598) - val android_hub_order_line_failed: String get() = Tr.s(3599) - val android_hub_order_line_pilot: String get() = Tr.s(3600) - val android_hub_order_line_refunded: String get() = Tr.s(3601) - val android_hub_order_line_quoted: String get() = Tr.s(3602) - val android_hub_order_line_fix: String get() = Tr.s(3603) - val android_hub_order_line_paid: String get() = Tr.s(3604) - val android_hub_order_line_placed: String get() = Tr.s(3605) - val android_hub_order_line_shipped: String get() = Tr.s(3606) - fun android_hub_order_line_tracking(tracking: Any): String = Tr.f(3607, arrayOf(tracking)) - val android_hub_order_line_delivered: String get() = Tr.s(3608) - val android_hub_order_customs_ddp: String get() = Tr.s(3609) - val android_hub_order_customs: String get() = Tr.s(3610) - fun android_hub_order_buynow_total(total: Any): String = Tr.f(3611, arrayOf(total)) - fun android_hub_buy_from(price: Any): String = Tr.f(3612, arrayOf(price)) - fun android_hub_buy_last(price: Any): String = Tr.f(3613, arrayOf(price)) - val android_hub_buy_incomplete: String get() = Tr.s(3614) - val android_hub_buy_again: String get() = Tr.s(3615) - val android_hub_buy_ready: String get() = Tr.s(3616) - val android_hub_buy_ready_board: String get() = Tr.s(3617) - fun android_hub_buy_ready_boards(n: Any): String = Tr.f(3618, arrayOf(n)) - fun android_hub_buy_ready_parts(parts: Any): String = Tr.f(3619, arrayOf(parts)) - fun android_hub_buy_check(note: Any): String = Tr.f(3620, arrayOf(note)) - fun android_hub_buy_unavailable(error: Any): String = Tr.f(3621, arrayOf(error)) - fun android_hub_buy_unavailable_parts(error: Any, parts: Any): String = Tr.f(3622, arrayOf(error, parts)) - val android_hub_buy_ordered_paid: String get() = Tr.s(3623) - val android_hub_buy_ordered_placed: String get() = Tr.s(3624) - val android_hub_buy_ordered_shipped: String get() = Tr.s(3625) - val android_hub_buy_ordered_delivered: String get() = Tr.s(3626) - fun android_hub_buy_ordered(state: Any): String = Tr.f(3627, arrayOf(state)) - fun android_hub_buy_noestimate(name: Any, path: Any): String = Tr.f(3628, arrayOf(name, path)) - fun android_hub_buy_noestimate_why(name: Any, path: Any, why: Any): String = Tr.f(3629, arrayOf(name, path, why)) - val android_hub_buy_unreachable: String get() = Tr.s(3630) - fun android_hub_buy_said(code: Any): String = Tr.f(3631, arrayOf(code)) - val android_hub_ask_reject: String get() = Tr.s(3632) - val android_hub_ask_session: String get() = Tr.s(3633) - val android_hub_ask_decline: String get() = Tr.s(3634) - fun android_hub_ask_quote(detail: Any): String = Tr.f(3635, arrayOf(detail)) - val android_hub_guard_safe: String get() = Tr.s(3636) - fun android_hub_guard_safe_why(why: Any): String = Tr.f(3637, arrayOf(why)) - fun android_hub_guard_degraded(parts: Any): String = Tr.f(3638, arrayOf(parts)) - val android_hub_guard_temp: String get() = Tr.s(3639) - val android_hub_guard_disk: String get() = Tr.s(3640) - fun android_hub_guard_rolledback(build: Any, to: Any): String = Tr.f(3641, arrayOf(build, to)) - fun android_hub_guard_nostart(build: Any): String = Tr.f(3642, arrayOf(build)) - fun android_hub_guard_nostart_skip(build: Any, skip: Any): String = Tr.f(3643, arrayOf(build, skip)) - val android_hub_guard_down_retry: String get() = Tr.s(3644) - fun android_hub_guard_down(why: Any): String = Tr.f(3645, arrayOf(why)) - fun android_hub_guard_restarting(why: Any): String = Tr.f(3646, arrayOf(why)) - fun android_hub_guard_starting(build: Any): String = Tr.f(3647, arrayOf(build)) - fun android_hub_guard_safe_on(build: Any, why: Any): String = Tr.f(3648, arrayOf(build, why)) - fun android_hub_guard_safe_on_plain(build: Any): String = Tr.f(3649, arrayOf(build)) - fun android_hub_guard_running(build: Any): String = Tr.f(3650, arrayOf(build)) - val android_hub_guard_act_normal: String get() = Tr.s(3651) - val android_hub_guard_act_safe: String get() = Tr.s(3652) - val android_hub_guard_act_safe_note: String get() = Tr.s(3653) - fun android_hub_guard_act_rollback(build: Any): String = Tr.f(3654, arrayOf(build)) - fun android_hub_guard_act_rollback_note(build: Any): String = Tr.f(3655, arrayOf(build)) - val android_hub_guard_ans_noaction: String get() = Tr.s(3656) - fun android_hub_guard_ans_nobuild(build: Any): String = Tr.f(3657, arrayOf(build)) - val android_hub_guard_ans_noback: String get() = Tr.s(3658) - val android_hub_guard_ans_stopping: String get() = Tr.s(3659) - val android_hub_guard_ans_restarting: String get() = Tr.s(3660) - val android_hub_guard_ans_safe: String get() = Tr.s(3661) - val android_hub_guard_ans_rollingback: String get() = Tr.s(3662) - val android_hub_guard_ans_switching: String get() = Tr.s(3663) - fun android_hub_guard_ans_bad(build: Any): String = Tr.f(3664, arrayOf(build)) - val android_hub_guard_ans_updating: String get() = Tr.s(3665) - val android_hub_guard_ans_asked: String get() = Tr.s(3666) - val android_hub_guard_err_unreachable: String get() = Tr.s(3667) - val android_hub_guard_err_token: String get() = Tr.s(3668) - val android_hub_guard_err_disk: String get() = Tr.s(3669) - val android_hub_guard_err_here: String get() = Tr.s(3670) - val android_hub_guard_err_noanswer: String get() = Tr.s(3671) - val android_hub_guard_err_noguard: String get() = Tr.s(3672) - val android_hub_cmd_btw: String get() = Tr.s(3673) - val android_hub_cmd_give_desc: String get() = Tr.s(3674) - val android_hub_cmd_secret: String get() = Tr.s(3675) - val android_hub_cmd_intent: String get() = Tr.s(3676) - val android_hub_cmd_settle_desc: String get() = Tr.s(3677) - val android_hub_cmd_btw_empty: String get() = Tr.s(3678) - val android_hub_cmd_project: String get() = Tr.s(3679) - val android_hub_cmd_newproject: String get() = Tr.s(3680) - val android_hub_cmd_project_quote: String get() = Tr.s(3681) - val android_hub_cmd_project_existing: String get() = Tr.s(3682) - val android_hub_cmd_notcmd: String get() = Tr.s(3683) - val android_hub_link_screen: String get() = Tr.s(3684) - val android_hub_link_conversation: String get() = Tr.s(3685) - val android_hub_link_file: String get() = Tr.s(3686) - val android_hub_link_file_far: String get() = Tr.s(3687) - val android_hub_link_empty: String get() = Tr.s(3688) - val android_hub_link_unknown: String get() = Tr.s(3689) - val android_hub_link_project: String get() = Tr.s(3690) - val android_hub_link_project_far: String get() = Tr.s(3691) - val android_hub_link_thread: String get() = Tr.s(3692) - val android_hub_link_thread_far: String get() = Tr.s(3693) - val android_hub_link_noscreen: String get() = Tr.s(3694) - val android_hub_link_noproject: String get() = Tr.s(3695) - val android_hub_star_text: String get() = Tr.s(3696) - val android_hub_migrate_title: String get() = Tr.s(3697) - fun android_hub_migrate_body(step: String): String = Tr.f(3698, arrayOf(step)) - fun android_hub_migrate_writing(p: Any, pt: Any, t: Any, tt: Any, e: Any, et: Any): String = Tr.f(3699, arrayOf(p, pt, t, tt, e, et)) - fun android_hub_migrate_read(done: Any, total: Any): String = Tr.f(3700, arrayOf(done, total)) - fun android_hub_migrate_copied(n: Any): String = Tr.f(3701, arrayOf(n)) - fun android_hub_migrate_min(n: Any): String = Tr.f(3702, arrayOf(n)) - fun android_hub_migrate_sec(n: Any): String = Tr.f(3703, arrayOf(n)) - val android_hub_migrate_measuring: String get() = Tr.s(3704) - val android_hub_migrate_done: String get() = Tr.s(3705) - val android_hub_migrate_nothing: String get() = Tr.s(3706) - val android_hub_migrate_nothing_short: String get() = Tr.s(3707) - fun android_hub_migrate_took(n: Any): String = Tr.f(3708, arrayOf(n)) - val android_hub_migrate_keys: String get() = Tr.s(3709) - val android_hub_migrate_failed: String get() = Tr.s(3710) - fun android_hub_migrate_failed_body(why: Any): String = Tr.f(3711, arrayOf(why)) - fun android_hub_migrate_failed_body_from(why: Any, from: Any): String = Tr.f(3712, arrayOf(why, from)) - fun android_hub_migrate_unreadable(error: Any): String = Tr.f(3713, arrayOf(error)) - val android_hub_migrate_busy: String get() = Tr.s(3714) - fun android_hub_migrate_runs(n: Number): String = Tr.f(3715, arrayOf(n)) - fun android_hub_migrate_routines(n: Number): String = Tr.f(3716, arrayOf(n)) - val android_hub_migrate_machines: String get() = Tr.s(3717) - val android_hub_migrate_keystay: String get() = Tr.s(3718) - val android_hub_migrate_google: String get() = Tr.s(3719) - fun android_hub_migrate_clashes(n: Number): String = Tr.f(3720, arrayOf(n)) - val android_hub_migrate_fresh: String get() = Tr.s(3721) - val android_hub_migrate_running: String get() = Tr.s(3722) - fun android_hub_migrate_botfolder(name: Any, gb: Any, path: Any): String = Tr.f(3723, arrayOf(name, gb, path)) - fun android_hub_migrate_notcopied(path: Any, why: Any): String = Tr.f(3724, arrayOf(path, why)) - fun android_hub_migrate_signin(names: Any): String = Tr.f(3725, arrayOf(names)) - val android_hub_migrate_accounts: String get() = Tr.s(3726) - fun android_hub_migrate_vault(why: Any): String = Tr.f(3727, arrayOf(why)) - val android_hub_history_title: String get() = Tr.s(3728) - val android_hub_history_closed: String get() = Tr.s(3729) - val android_away: String get() = Tr.s(3730) - val android_open: String get() = Tr.s(3731) - val android_search_messages: String get() = Tr.s(3732) - val android_find_inthread: String get() = Tr.s(3733) - val android_find_error: String get() = Tr.s(3734) - val android_find_prev: String get() = Tr.s(3735) - val android_find_next: String get() = Tr.s(3736) - val android_find_nomatch: String get() = Tr.s(3737) - fun android_find_count(n: Number, total: Number): String = Tr.f(3738, arrayOf(n, total)) - val android_find_you: String get() = Tr.s(3739) - val android_find_agent: String get() = Tr.s(3740) - val android_sub_thread: String get() = Tr.s(3741) - fun android_sub_back(title: Any): String = Tr.f(3742, arrayOf(title)) - val android_sub_gone: String get() = Tr.s(3743) - fun android_sub_more(n: Number): String = Tr.f(3744, arrayOf(n)) - val android_sub_none: String get() = Tr.s(3745) - val android_sub_asked: String get() = Tr.s(3746) - val android_sub_tool: String get() = Tr.s(3747) - fun android_machine_on(name: Any): String = Tr.f(3748, arrayOf(name)) - fun android_handoff_from(title: Any): String = Tr.f(3749, arrayOf(title)) - fun android_handoff_note(note: Any): String = Tr.f(3750, arrayOf(note)) - val android_queue_unsent: String get() = Tr.s(3751) - fun android_mark_runs(machine: Any): String = Tr.f(3752, arrayOf(machine)) - fun android_mark_also(machines: Any): String = Tr.f(3753, arrayOf(machines)) - fun android_mark_newon(machine: Any): String = Tr.f(3754, arrayOf(machine)) - val android_google_signedin: String get() = Tr.s(3755) - val android_google_back: String get() = Tr.s(3756) - val android_improve_search: String get() = Tr.s(3757) - val android_improve_nomatch: String get() = Tr.s(3758) - val android_ring_head: String get() = Tr.s(3759) - val android_swarm_new: String get() = Tr.s(3760) - val android_swarm_topic: String get() = Tr.s(3761) - val android_swarm_goal: String get() = Tr.s(3762) - val android_swarm_seed: String get() = Tr.s(3763) - val android_swarm_member_add: String get() = Tr.s(3764) - fun android_swarm_member_n(n: Any): String = Tr.f(3765, arrayOf(n)) - val android_swarm_role: String get() = Tr.s(3766) - fun android_swarm_members(n: Number): String = Tr.f(3767, arrayOf(n)) - val android_swarm_pause: String get() = Tr.s(3768) - val android_swarm_resume: String get() = Tr.s(3769) - val android_swarm_stop: String get() = Tr.s(3770) - fun android_swarm_stop_ask(name: Any): String = Tr.f(3771, arrayOf(name)) - val android_swarm_stop_yes: String get() = Tr.s(3772) - val android_swarm_keep: String get() = Tr.s(3773) - fun android_swarm_remove_member(name: Any): String = Tr.f(3774, arrayOf(name)) - val android_swarm_state_active: String get() = Tr.s(3775) - val android_swarm_state_paused: String get() = Tr.s(3776) - val android_swarm_state_stopped: String get() = Tr.s(3777) - val android_swarm_state_done: String get() = Tr.s(3778) - val android_swarm_reason_circular: String get() = Tr.s(3779) - val android_swarm_reason_idle: String get() = Tr.s(3780) - val android_swarm_reason_budget: String get() = Tr.s(3781) - val android_swarm_reason_person: String get() = Tr.s(3782) - val android_swarm_reason_chatter: String get() = Tr.s(3783) - val android_swarm_tag_idea: String get() = Tr.s(3784) - val android_swarm_tag_critique: String get() = Tr.s(3785) - val android_swarm_tag_claim: String get() = Tr.s(3786) - val android_swarm_tag_done: String get() = Tr.s(3787) - val android_swarm_tag_question: String get() = Tr.s(3788) - val android_swarm_tag_synthesis: String get() = Tr.s(3789) - val android_swarm_waiting: String get() = Tr.s(3790) - fun android_swarm_held(why: Any): String = Tr.f(3791, arrayOf(why)) - val android_swarm_post_hint: String get() = Tr.s(3792) - val android_swarm_none: String get() = Tr.s(3793) - val android_swarm_gone: String get() = Tr.s(3794) - val android_swarm_provider: String get() = Tr.s(3795) - val android_swarm_model: String get() = Tr.s(3796) - fun android_buy_ask(project: Any): String = Tr.f(3797, arrayOf(project)) - val cat_cat: String get() = Tr.s(3798) - val cat_own: String get() = Tr.s(3799) - val cat_different: String get() = Tr.s(3800) - val cat_auto: String get() = Tr.s(3801) - val cat_color_bad: String get() = Tr.s(3802) - val android_copy_run: String get() = Tr.s(3803) - val android_copy_fullscreen: String get() = Tr.s(3804) - val android_term_chat_old: String get() = Tr.s(3805) - val android_browser_head: String get() = Tr.s(3806) - val android_clone_mode_folder: String get() = Tr.s(3807) - val android_clone_mode_git: String get() = Tr.s(3808) - val android_clone_repo_hint: String get() = Tr.s(3809) - val android_clone_private: String get() = Tr.s(3810) - val android_clone_signin: String get() = Tr.s(3811) - val android_clone_into: String get() = Tr.s(3812) - val android_clone_folder_change: String get() = Tr.s(3813) - val android_clone_folder_use: String get() = Tr.s(3814) - val android_clone_name_hint: String get() = Tr.s(3815) - val android_clone_thread: String get() = Tr.s(3816) - val android_clone_go: String get() = Tr.s(3817) - val android_clone_same: String get() = Tr.s(3818) - val android_clone_retry: String get() = Tr.s(3819) - val android_clone_loading: String get() = Tr.s(3820) - val android_clone_signin_code: String get() = Tr.s(3821) - val android_clone_signin_wait: String get() = Tr.s(3822) - val android_clone_signin_done: String get() = Tr.s(3823) - val android_clone_signin_failed: String get() = Tr.s(3824) - val android_clone_hint_nogh: String get() = Tr.s(3825) - val android_clone_hint_signedout: String get() = Tr.s(3826) - val android_clone_hint_error: String get() = Tr.s(3827) - val android_clone_phase_starting: String get() = Tr.s(3828) - val android_clone_phase_connecting: String get() = Tr.s(3829) - val android_clone_phase_counting: String get() = Tr.s(3830) - val android_clone_phase_compressing: String get() = Tr.s(3831) - val android_clone_phase_receiving: String get() = Tr.s(3832) - val android_clone_phase_resolving: String get() = Tr.s(3833) - val android_clone_phase_updating: String get() = Tr.s(3834) - val android_clone_phase_lfs: String get() = Tr.s(3835) - val android_clone_phase_adding: String get() = Tr.s(3836) - val android_clone_phase_cancelled: String get() = Tr.s(3837) - fun android_clone_busy(path: Any): String = Tr.f(3838, arrayOf(path)) - fun android_clone_file(path: Any): String = Tr.f(3839, arrayOf(path)) - val android_download_saved: String get() = Tr.s(3840) - fun android_download_of(have: Any, total: Any): String = Tr.f(3841, arrayOf(have, total)) - val android_download_share: String get() = Tr.s(3842) - val android_download_retry: String get() = Tr.s(3843) - val android_download_noapp: String get() = Tr.s(3844) - val android_download_button: String get() = Tr.s(3845) - fun ios_sections_running(n: Number): String = Tr.f(3846, arrayOf(n)) - val ios_alerts_ask: String get() = Tr.s(3847) - val ios_alerts_allow: String get() = Tr.s(3848) - val ios_alerts_later: String get() = Tr.s(3849) - val ios_viewerbg: String get() = Tr.s(3850) - val ios_viewerbg_auto: String get() = Tr.s(3851) - val ios_viewerbg_custom: String get() = Tr.s(3852) - val ios_viewerbg_color: String get() = Tr.s(3853) - val ios_viewerbg_note: String get() = Tr.s(3854) - fun ios_hub_use(hub: Any): String = Tr.f(3855, arrayOf(hub)) - val ios_thread_loading: String get() = Tr.s(3856) - val ios_hub_connecting: String get() = Tr.s(3857) - fun ios_project_remove_ask(title: Any): String = Tr.f(3858, arrayOf(title)) - val ios_side_room: String get() = Tr.s(3859) - val ios_side_bot: String get() = Tr.s(3860) - val ios_side_uber: String get() = Tr.s(3861) - fun ios_project_terms(project: Any): String = Tr.f(3862, arrayOf(project)) - fun ios_project_newthread(project: Any): String = Tr.f(3863, arrayOf(project)) - fun ios_lock_waiting(n: Number): String = Tr.f(3864, arrayOf(n)) - fun ios_conn_connecting(hub: Any): String = Tr.f(3865, arrayOf(hub)) - val ios_conn_offline: String get() = Tr.s(3866) - fun ios_kids_hide(n: Number): String = Tr.f(3867, arrayOf(n)) - fun ios_kids_show(n: Number): String = Tr.f(3868, arrayOf(n)) - fun ios_model_label(model: Any): String = Tr.f(3869, arrayOf(model)) - val ios_model_default: String get() = Tr.s(3870) - val ios_start: String get() = Tr.s(3871) - val ios_starting: String get() = Tr.s(3872) - val ios_room_missing: String get() = Tr.s(3873) - val ios_secret_new: String get() = Tr.s(3874) - fun ios_secret_named(name: Any): String = Tr.f(3875, arrayOf(name)) - val ios_secret_refused: String get() = Tr.s(3876) - val ios_find_gone: String get() = Tr.s(3877) - val ios_thread: String get() = Tr.s(3878) - val ios_state_working: String get() = Tr.s(3879) - val ios_state_inactive: String get() = Tr.s(3880) - val ios_state_blocked: String get() = Tr.s(3881) - val ios_state_stalled: String get() = Tr.s(3882) - val ios_state_monitoring: String get() = Tr.s(3883) - val ios_state_finished: String get() = Tr.s(3884) - val ios_state_active: String get() = Tr.s(3885) - val ios_composer_hint: String get() = Tr.s(3886) - val ios_dictate_stop: String get() = Tr.s(3887) - val ios_dictate: String get() = Tr.s(3888) - val ios_attach_pictures: String get() = Tr.s(3889) - val ios_attach_pictures_no: String get() = Tr.s(3890) - val ios_draw_no: String get() = Tr.s(3891) - val ios_attach_no: String get() = Tr.s(3892) - val ios_command_failed: String get() = Tr.s(3893) - fun ios_work_head(word: Any): String = Tr.f(3894, arrayOf(word)) - val ios_fold_open: String get() = Tr.s(3895) - val ios_fold_shut: String get() = Tr.s(3896) - val ios_step_design: String get() = Tr.s(3897) - val ios_ask_asks: String get() = Tr.s(3898) - val ios_ask_asked: String get() = Tr.s(3899) - fun ios_ask_answered(answer: Any): String = Tr.f(3900, arrayOf(answer)) - val ios_improve_sent: String get() = Tr.s(3901) - val ios_on: String get() = Tr.s(3902) - val ios_off: String get() = Tr.s(3903) - val ios_system: String get() = Tr.s(3904) - val ios_light: String get() = Tr.s(3905) - val ios_dark: String get() = Tr.s(3906) - val ios_conn_online: String get() = Tr.s(3907) - val ios_conn_connectingword: String get() = Tr.s(3908) - val ios_conn_offlineword: String get() = Tr.s(3909) - fun ios_version(version: Any, build: Any): String = Tr.f(3910, arrayOf(version, build)) - fun ios_hub_forget_ask(hub: Any): String = Tr.f(3911, arrayOf(hub)) - val ios_hub_this: String get() = Tr.s(3912) - val ios_update_stable: String get() = Tr.s(3913) - val ios_update_beta: String get() = Tr.s(3914) - val ios_order: String get() = Tr.s(3915) - fun ios_order_named(name: Any): String = Tr.f(3916, arrayOf(name)) - val ios_invite_machine: String get() = Tr.s(3917) - val ios_invite_device: String get() = Tr.s(3918) - fun ios_link_used(`when`: Any, who: Any, mark: String): String = Tr.f(3919, arrayOf(`when`, who, mark)) - val ios_link_amachine: String get() = Tr.s(3920) - val ios_link_adevice: String get() = Tr.s(3921) - val ios_link_revoked_never: String get() = Tr.s(3922) - fun ios_link_revoked_with(who: Any): String = Tr.f(3923, arrayOf(who)) - val ios_link_machine_linked: String get() = Tr.s(3924) - val ios_link_device_paired: String get() = Tr.s(3925) - val ios_link_expired: String get() = Tr.s(3926) - fun ios_link_open(time: Any): String = Tr.f(3927, arrayOf(time)) - fun ios_hub_address(address: Any): String = Tr.f(3928, arrayOf(address)) - val ios_share: String get() = Tr.s(3929) - fun ios_link_revoke_used(kind: String, name: Any): String = Tr.f(3930, arrayOf(kind, name)) - val ios_unnamed: String get() = Tr.s(3931) - val ios_link_revoke_open: String get() = Tr.s(3932) - val ios_devices_loadfail: String get() = Tr.s(3933) - val ios_invite_creating: String get() = Tr.s(3934) - val ios_invite_fail: String get() = Tr.s(3935) - val ios_invite_ready: String get() = Tr.s(3936) - val ios_invite_fail_conn: String get() = Tr.s(3937) - val ios_revoke_device_fail: String get() = Tr.s(3938) - val ios_revoke_link_fail: String get() = Tr.s(3939) - val ios_pair_repair: String get() = Tr.s(3940) - val ios_pair_connect_title: String get() = Tr.s(3941) - val ios_pair_paste: String get() = Tr.s(3942) - val ios_pair_paste_hint: String get() = Tr.s(3943) - val ios_pair_invalid: String get() = Tr.s(3944) - fun ios_thread_delete_ask(title: Any): String = Tr.f(3945, arrayOf(title)) - fun ios_search_none(query: Any): String = Tr.f(3946, arrayOf(query)) - val ios_you: String get() = Tr.s(3947) - val ios_agent: String get() = Tr.s(3948) - fun ios_room_post_to(room: Any): String = Tr.f(3949, arrayOf(room)) - fun ios_find_none(query: Any): String = Tr.f(3950, arrayOf(query)) - val ios_ago_now: String get() = Tr.s(3951) - fun ios_ago_m(n: Any): String = Tr.f(3952, arrayOf(n)) - fun ios_ago_h(n: Any): String = Tr.f(3953, arrayOf(n)) - fun ios_ago_d(n: Any): String = Tr.f(3954, arrayOf(n)) - val ios_mic_off: String get() = Tr.s(3955) - val ios_mic_failed: String get() = Tr.s(3956) - val ios_link_update: String get() = Tr.s(3957) - val ios_link_nothere: String get() = Tr.s(3958) - val ios_hub_notconnected: String get() = Tr.s(3959) - fun ios_preview_none(size: Any): String = Tr.f(3960, arrayOf(size)) - val ios_review_resolved: String get() = Tr.s(3961) - val ios_review_reopen: String get() = Tr.s(3962) - val ios_review_resolve: String get() = Tr.s(3963) - fun ios_settled_count(n: Any): String = Tr.f(3964, arrayOf(n)) - fun ios_history_count(n: Any): String = Tr.f(3965, arrayOf(n)) - fun ios_pad_colour(n: Any): String = Tr.f(3966, arrayOf(n)) - val ios_pad_pen: String get() = Tr.s(3967) - val ios_pad_box: String get() = Tr.s(3968) - val ios_pad_eraser: String get() = Tr.s(3969) - val ios_hub_restart: String get() = Tr.s(3970) - val ios_hub_refused_pairing: String get() = Tr.s(3971) - val ios_hub_asking: String get() = Tr.s(3972) - val ios_hub_restart_none: String get() = Tr.s(3973) - val ios_hub_status_fail: String get() = Tr.s(3974) - val ios_hub_sent: String get() = Tr.s(3975) - val ios_hub_refused: String get() = Tr.s(3976) - val ios_hub_cannot: String get() = Tr.s(3977) - val ios_hub_machine_unreachable: String get() = Tr.s(3978) - val ios_hub_noanswer: String get() = Tr.s(3979) - fun ios_hub_still(status: Any): String = Tr.f(3980, arrayOf(status)) - val ios_hub_waiting: String get() = Tr.s(3981) - fun ios_hub_is(status: Any): String = Tr.f(3982, arrayOf(status)) - val ios_hub_down: String get() = Tr.s(3983) - val ios_hub_up_safe_degraded: String get() = Tr.s(3984) - val ios_hub_up_degraded: String get() = Tr.s(3985) - val ios_hub_up_safe: String get() = Tr.s(3986) - val ios_hub_up: String get() = Tr.s(3987) - val ios_star: String get() = Tr.s(3988) - val ios_pad_length_example: String get() = Tr.s(3989) - val ios_pair_code_field: String get() = Tr.s(3990) - val ios_accounts: String get() = Tr.s(3991) - val ios_devices_add: String get() = Tr.s(3992) - val ios_hub_add: String get() = Tr.s(3993) - val ios_accounts_addsignin: String get() = Tr.s(3994) - val ios_devices_intro: String get() = Tr.s(3995) - val ios_project_add_first: String get() = Tr.s(3996) - val ios_settings_alerts: String get() = Tr.s(3997) - val ios_settings_sound: String get() = Tr.s(3998) - val ios_pair_ask_note: String get() = Tr.s(3999) - val ios_projects_none_note: String get() = Tr.s(4000) - val ios_review_comment_field: String get() = Tr.s(4001) - val ios_project_badge: String get() = Tr.s(4002) - val ios_order_buy: String get() = Tr.s(4003) - val ios_diff_head: String get() = Tr.s(4004) - val ios_photo_choose: String get() = Tr.s(4005) - val ios_close_lower: String get() = Tr.s(4006) - val ios_compare_close: String get() = Tr.s(4007) - val ios_badge_colour: String get() = Tr.s(4008) - val ios_pair_code_connect: String get() = Tr.s(4009) - val ios_history: String get() = Tr.s(4010) - val ios_copied: String get() = Tr.s(4011) - val ios_copy_code: String get() = Tr.s(4012) - val ios_copy_run: String get() = Tr.s(4013) - val ios_term_fullscreen: String get() = Tr.s(4014) - val ios_delete_dots: String get() = Tr.s(4015) - val ios_devices: String get() = Tr.s(4016) - val ios_pad_hint_eraser: String get() = Tr.s(4017) - val ios_pad_hint_pen: String get() = Tr.s(4018) - val ios_pad_hint_box: String get() = Tr.s(4019) - val ios_pad_paper: String get() = Tr.s(4020) - val ios_pair_invite_incomplete: String get() = Tr.s(4021) - val ios_pair_enter: String get() = Tr.s(4022) - val ios_pair_code_needhub: String get() = Tr.s(4023) - val ios_devices_none: String get() = Tr.s(4024) - val ios_invite_expired: String get() = Tr.s(4025) - val ios_invite_expires: String get() = Tr.s(4026) - val ios_project_folder: String get() = Tr.s(4027) - val ios_quiet_from: String get() = Tr.s(4028) - val ios_term_gone: String get() = Tr.s(4029) - val ios_hub: String get() = Tr.s(4030) - val ios_hub_address_field: String get() = Tr.s(4031) - val ios_badge_icon: String get() = Tr.s(4032) - val ios_improvements: String get() = Tr.s(4033) - val ios_quiet_note: String get() = Tr.s(4034) - val ios_term_end: String get() = Tr.s(4035) - val ios_browser_keys: String get() = Tr.s(4036) - val ios_devices_lastseen: String get() = Tr.s(4037) - val ios_pad_length_ask: String get() = Tr.s(4038) - val ios_licences: String get() = Tr.s(4039) - val ios_links_none: String get() = Tr.s(4040) - val ios_thread_older: String get() = Tr.s(4041) - val ios_mech_loading: String get() = Tr.s(4042) - val ios_thread_detach: String get() = Tr.s(4043) - val ios_accounts_name: String get() = Tr.s(4044) - val ios_term_newshell: String get() = Tr.s(4045) - val ios_accounts_none: String get() = Tr.s(4046) - val ios_browser_none: String get() = Tr.s(4047) - val ios_diff_none: String get() = Tr.s(4048) - val ios_review_comments_none: String get() = Tr.s(4049) - val ios_mech_none: String get() = Tr.s(4050) - val ios_projects_none: String get() = Tr.s(4051) - val ios_notconnected: String get() = Tr.s(4052) - val ios_term_none: String get() = Tr.s(4053) - val ios_threads_none: String get() = Tr.s(4054) - val ios_secret_notneeded: String get() = Tr.s(4055) - val ios_notpaired: String get() = Tr.s(4056) - val ios_send_failed: String get() = Tr.s(4057) - val ios_compare_none: String get() = Tr.s(4058) - val ios_settings_alerts_note: String get() = Tr.s(4059) - val ios_pair_howto: String get() = Tr.s(4060) - val ios_improve_github: String get() = Tr.s(4061) - val ios_signin_open: String get() = Tr.s(4062) - val ios_devices_paired: String get() = Tr.s(4063) - val ios_links: String get() = Tr.s(4064) - val ios_pair_ask: String get() = Tr.s(4065) - val ios_paste: String get() = Tr.s(4066) - val ios_signin_code_field: String get() = Tr.s(4067) - val ios_secret_value: String get() = Tr.s(4068) - val ios_viewer_picked: String get() = Tr.s(4069) - val ios_room_post: String get() = Tr.s(4070) - val ios_quiet: String get() = Tr.s(4071) - val ios_reconnect: String get() = Tr.s(4072) - val ios_picture_remove: String get() = Tr.s(4073) - val ios_project_rename: String get() = Tr.s(4074) - val ios_revoke_ask: String get() = Tr.s(4075) - val ios_revoke_link_ask: String get() = Tr.s(4076) - val ios_review_run: String get() = Tr.s(4077) - val ios_find: String get() = Tr.s(4078) - val ios_search_field: String get() = Tr.s(4079) - val ios_signin_send: String get() = Tr.s(4080) - val ios_improve_send: String get() = Tr.s(4081) - val ios_term_shell: String get() = Tr.s(4082) - val ios_thread_empty: String get() = Tr.s(4083) - val ios_improve_send_note: String get() = Tr.s(4084) - val ios_state: String get() = Tr.s(4085) - val ios_photo_take: String get() = Tr.s(4086) - val ios_terminals: String get() = Tr.s(4087) - val ios_term_screen: String get() = Tr.s(4088) - val ios_voice_spelling: String get() = Tr.s(4089) - val ios_revoke_note: String get() = Tr.s(4090) - val ios_file_unread: String get() = Tr.s(4091) - val ios_hub_proto: String get() = Tr.s(4092) - val ios_hub_forget_note: String get() = Tr.s(4093) - val ios_diff_nogit: String get() = Tr.s(4094) - val ios_thread_actions: String get() = Tr.s(4095) - val ios_quiet_to: String get() = Tr.s(4096) - val ios_pair_code_type: String get() = Tr.s(4097) - val ios_pad_undo: String get() = Tr.s(4098) - val ios_updates: String get() = Tr.s(4099) - val ios_quiet_urgent: String get() = Tr.s(4100) - val ios_use: String get() = Tr.s(4101) - val ios_pair_fresh: String get() = Tr.s(4102) - val ios_newthread_hint: String get() = Tr.s(4103) - val ios_improve_ask: String get() = Tr.s(4104) - val ios_find_field: String get() = Tr.s(4105) - val ios_browser_driving: String get() = Tr.s(4106) - val ios_ask_answer: String get() = Tr.s(4107) - val ios_pair_wrongcode: String get() = Tr.s(4108) - val ios_pair_expired: String get() = Tr.s(4109) - val ios_pair_used: String get() = Tr.s(4110) - val ios_pair_revoked: String get() = Tr.s(4111) - val ios_pair_ratelimited: String get() = Tr.s(4112) - val ios_pair_storage: String get() = Tr.s(4113) - val ios_pair_required: String get() = Tr.s(4114) - val ios_pair_unreachable: String get() = Tr.s(4115) - val ios_connecting: String get() = Tr.s(4116) - val ios_offline: String get() = Tr.s(4117) - val ios_hub_refused_plain: String get() = Tr.s(4118) - val ios_thinking: String get() = Tr.s(4119) - val ios_tab_board: String get() = Tr.s(4120) - val ios_tab_schematic: String get() = Tr.s(4121) - val ios_tab_split: String get() = Tr.s(4122) - val ios_tab_mech: String get() = Tr.s(4123) - val ios_tab_files: String get() = Tr.s(4124) - val ios_tab_diff: String get() = Tr.s(4125) - val ios_tab_review: String get() = Tr.s(4126) - val ios_tab_browser: String get() = Tr.s(4127) - val ios_review_checks: String get() = Tr.s(4128) - val ios_review_bom: String get() = Tr.s(4129) - val ios_review_comments: String get() = Tr.s(4130) - val ios_board_none: String get() = Tr.s(4131) - val ios_schematic_none: String get() = Tr.s(4132) - fun ios_term_exited(code: Any): String = Tr.f(4133, arrayOf(code)) - val ios_term_failed: String get() = Tr.s(4134) - fun ios_island_more(n: Number): String = Tr.f(4135, arrayOf(n)) - val ios_island_stale: String get() = Tr.s(4136) - fun ios_plot_previous(why: Any): String = Tr.f(4137, arrayOf(why)) - val ios_plot_decoding: String get() = Tr.s(4138) - val ios_plot_undecodable: String get() = Tr.s(4139) - val ios_plot_badref: String get() = Tr.s(4140) - val ios_plot_badmodel: String get() = Tr.s(4141) - val ios_plot_incomplete: String get() = Tr.s(4142) - val ios_plot_unexpected: String get() = Tr.s(4143) - val ios_part_bad: String get() = Tr.s(4144) - val ios_part_placement: String get() = Tr.s(4145) - val ios_part_triangles: String get() = Tr.s(4146) - val ios_part_incomplete: String get() = Tr.s(4147) - val ios_part_unexpected: String get() = Tr.s(4148) - fun ios_parts_progress(done: Number, of: Number): String = Tr.f(4149, arrayOf(done, of)) - val ios_hub_timeout: String get() = Tr.s(4150) - val ios_pair_local: String get() = Tr.s(4151) - val ios_search_messages: String get() = Tr.s(4152) - fun ios_sub_of(thread: Any): String = Tr.f(4153, arrayOf(thread)) - val ios_sub_thread: String get() = Tr.s(4154) - val ios_sub_gone: String get() = Tr.s(4155) - fun ios_sub_more(n: Number): String = Tr.f(4156, arrayOf(n)) - val ios_sub_none: String get() = Tr.s(4157) - val ios_sub_title: String get() = Tr.s(4158) - val ios_sub_tool: String get() = Tr.s(4159) - val ios_sub_reported: String get() = Tr.s(4160) - val ios_sub_ended: String get() = Tr.s(4161) - val ios_state_completed: String get() = Tr.s(4162) - val ios_handoff_open: String get() = Tr.s(4163) - fun ios_handoff_from(title: Any): String = Tr.f(4164, arrayOf(title)) - fun ios_handoff_note(note: Any): String = Tr.f(4165, arrayOf(note)) - fun ios_machine_away(label: Any): String = Tr.f(4166, arrayOf(label)) - fun ios_machine_on(machine: Any): String = Tr.f(4167, arrayOf(machine)) - fun ios_machine_runs(machine: Any): String = Tr.f(4168, arrayOf(machine)) - val ios_machine_every: String get() = Tr.s(4169) - val ios_thread_marked: String get() = Tr.s(4170) - val ios_find_bar: String get() = Tr.s(4171) - val ios_find_prev: String get() = Tr.s(4172) - val ios_find_next: String get() = Tr.s(4173) - val ios_find_close: String get() = Tr.s(4174) - fun ios_find_count(at: Number, total: Number): String = Tr.f(4175, arrayOf(at, total)) - fun ios_find_countmore(at: Number, total: Number): String = Tr.f(4176, arrayOf(at, total)) - val ios_queue_unsent: String get() = Tr.s(4177) - val ios_queue_refused: String get() = Tr.s(4178) - val ios_queue_sending: String get() = Tr.s(4179) - fun ios_newon(machine: Any): String = Tr.f(4180, arrayOf(machine)) - fun ios_newon_away(machine: Any): String = Tr.f(4181, arrayOf(machine)) - fun ios_machine_also(machines: Any): String = Tr.f(4182, arrayOf(machines)) - val ios_voice_mic_note: String get() = Tr.s(4183) - fun ios_voice_mic_note_device(device: Any): String = Tr.f(4184, arrayOf(device)) - val ios_voice_dict_empty: String get() = Tr.s(4185) - val ios_voice_learned_empty: String get() = Tr.s(4186) - val ios_voice_pebble: String get() = Tr.s(4187) - val ios_voice_pebble_note: String get() = Tr.s(4188) - val ios_devices_add_note: String get() = Tr.s(4189) - val ios_buy: String get() = Tr.s(4190) - fun ios_buy_from(price: Any): String = Tr.f(4191, arrayOf(price)) - fun ios_buy_last(price: Any): String = Tr.f(4192, arrayOf(price)) - val ios_buy_incomplete: String get() = Tr.s(4193) - val ios_improve_search: String get() = Tr.s(4194) - val android_notify_head: String get() = Tr.s(4195) - val gpui_keysheet_note: String get() = Tr.s(4196) - val gpui_keys_help: String get() = Tr.s(4197) - val gpui_f2_welcome_body: String get() = Tr.s(4198) - fun gpui_f2_data_folder_note(home: Any): String = Tr.f(4199, arrayOf(home)) - val gpui_f2_choose_another: String get() = Tr.s(4200) - val gpui_f2_usage_note: String get() = Tr.s(4201) - val gpui_f2_v014: String get() = Tr.s(4202) - val gpui_f2_v014_copied: String get() = Tr.s(4203) - fun gpui_f2_v014_found(from: Any): String = Tr.f(4204, arrayOf(from)) - val gpui_f2_agents_body: String get() = Tr.s(4205) - fun gpui_f2_installing(note: Any): String = Tr.f(4206, arrayOf(note)) - fun gpui_f2_install_failed(note: Any): String = Tr.f(4207, arrayOf(note)) - val gpui_f2_installed: String get() = Tr.s(4208) - fun gpui_f2_version(v: Any): String = Tr.f(4209, arrayOf(v)) - fun gpui_f2_v_connected(v: Any): String = Tr.f(4210, arrayOf(v)) - fun gpui_f2_v_connected_as(v: Any, who: Any): String = Tr.f(4211, arrayOf(v, who)) - val gpui_f2_i_connected: String get() = Tr.s(4212) - fun gpui_f2_i_connected_as(who: Any): String = Tr.f(4213, arrayOf(who)) - fun gpui_f2_v_notconnected(v: Any): String = Tr.f(4214, arrayOf(v)) - val gpui_f2_i_notconnected: String get() = Tr.s(4215) - fun gpui_f2_v_runcmd(v: Any, cmd: Any): String = Tr.f(4216, arrayOf(v, cmd)) - fun gpui_f2_i_runcmd(cmd: Any): String = Tr.f(4217, arrayOf(cmd)) - val gpui_f2_more_agents: String get() = Tr.s(4218) - val gpui_f2_check_after: String get() = Tr.s(4219) - val gpui_f2_tools: String get() = Tr.s(4220) - val gpui_f2_tools_body: String get() = Tr.s(4221) - fun gpui_f2_kicad_ok(v: Any, path: Any): String = Tr.f(4222, arrayOf(v, path)) - fun gpui_f2_kicad_installing(v: Any, note: Any): String = Tr.f(4223, arrayOf(v, note)) - fun gpui_f2_kicad_auto(v: Any): String = Tr.f(4224, arrayOf(v)) - val gpui_f2_kicad_nopkg: String get() = Tr.s(4225) - val gpui_f2_freecad_notfound: String get() = Tr.s(4226) - val gpui_f2_locate_kicad: String get() = Tr.s(4227) - val gpui_f2_locate_freecad: String get() = Tr.s(4228) - fun gpui_f2_locate_note(tool: Any): String = Tr.f(4229, arrayOf(tool)) - fun gpui_f2_path_to(tool: Any): String = Tr.f(4230, arrayOf(tool)) - val gpui_f2_alwayson: String get() = Tr.s(4231) - val gpui_f2_alwayson_body: String get() = Tr.s(4232) - val gpui_f2_aon_here: String get() = Tr.s(4233) - val gpui_f2_aon_here_note: String get() = Tr.s(4234) - val gpui_f2_aon_boat: String get() = Tr.s(4235) - val gpui_f2_aon_boat_note: String get() = Tr.s(4236) - val gpui_f2_aon_machine: String get() = Tr.s(4237) - val gpui_f2_aon_machine_note: String get() = Tr.s(4238) - val gpui_f2_chosen: String get() = Tr.s(4239) - val gpui_f2_choose: String get() = Tr.s(4240) - val gpui_f2_coming: String get() = Tr.s(4241) - val gpui_f2_coming_note: String get() = Tr.s(4242) - val gpui_f2_project_body: String get() = Tr.s(4243) - val gpui_f2_first_message_note: String get() = Tr.s(4244) - val gpui_f2_what_agent: String get() = Tr.s(4245) - val gpui_f2_folder_note: String get() = Tr.s(4246) - val gpui_f2_pair_phone: String get() = Tr.s(4247) - val gpui_f2_pair_phone_note: String get() = Tr.s(4248) - val gpui_f2_pair_phone_shown: String get() = Tr.s(4249) - val gpui_f2_show_code: String get() = Tr.s(4250) - val gpui_f2_done_body: String get() = Tr.s(4251) - val gpui_f2_open_uber: String get() = Tr.s(4252) - val gpui_f2_setup_phone: String get() = Tr.s(4253) - val gpui_f2_setup_five: String get() = Tr.s(4254) - fun gpui_swarm_row(n: Number, w: Number): String = Tr.f(4255, arrayOf(n, w)) - fun gpui_swarm_held(why: Any): String = Tr.f(4256, arrayOf(why)) - fun gpui_swarm_state_why(state: Any, why: Any): String = Tr.f(4257, arrayOf(state, why)) - val gpui_swarm_new: String get() = Tr.s(4258) - val gpui_swarm_add_member: String get() = Tr.s(4259) - val gpui_swarm_start: String get() = Tr.s(4260) - val gpui_swarm_topic: String get() = Tr.s(4261) - val gpui_swarm_goal: String get() = Tr.s(4262) - val gpui_swarm_seed: String get() = Tr.s(4263) - val gpui_swarm_role: String get() = Tr.s(4264) - val gpui_swarm_remove: String get() = Tr.s(4265) - val gpui_swarm_over: String get() = Tr.s(4266) - val gpui_swarm_none: String get() = Tr.s(4267) - val ios_swarm_new: String get() = Tr.s(4268) - fun ios_swarm_new_in(project: Any): String = Tr.f(4269, arrayOf(project)) - fun ios_swarm_members(n: Number): String = Tr.f(4270, arrayOf(n)) - val ios_swarm_state_paused: String get() = Tr.s(4271) - val ios_swarm_state_removed: String get() = Tr.s(4272) - val ios_swarm_tag_idea: String get() = Tr.s(4273) - val ios_swarm_tag_critique: String get() = Tr.s(4274) - val ios_swarm_tag_claim: String get() = Tr.s(4275) - val ios_swarm_tag_synthesis: String get() = Tr.s(4276) - val ios_swarm_reason_circular: String get() = Tr.s(4277) - val ios_swarm_reason_budget: String get() = Tr.s(4278) - val ios_swarm_reason_person: String get() = Tr.s(4279) - val ios_swarm_reason_chatter: String get() = Tr.s(4280) - fun ios_swarm_held(why: Any): String = Tr.f(4281, arrayOf(why)) - val ios_swarm_topic: String get() = Tr.s(4282) - val ios_swarm_goal: String get() = Tr.s(4283) - val ios_swarm_seed: String get() = Tr.s(4284) - val ios_swarm_role: String get() = Tr.s(4285) - val ios_swarm_add: String get() = Tr.s(4286) - fun ios_swarm_remove_ask(name: Any): String = Tr.f(4287, arrayOf(name)) - val ios_swarm_stop_ask: String get() = Tr.s(4288) - val ios_swarm_post: String get() = Tr.s(4289) - val ios_image_save: String get() = Tr.s(4290) - val ios_image_saved: String get() = Tr.s(4291) - val ios_image_denied: String get() = Tr.s(4292) - val ios_image_failed: String get() = Tr.s(4293) - val ios_image_incoming: String get() = Tr.s(4294) - val ios_image_loadfail: String get() = Tr.s(4295) - val ios_image_unavailable: String get() = Tr.s(4296) - val native_permission_photos_add: String get() = Tr.s(4297) - fun ios_buy_ask(project: Any): String = Tr.f(4298, arrayOf(project)) - val ios_settings_accounts_usage: String get() = Tr.s(4299) - val ios_settings_machines_devices: String get() = Tr.s(4300) - val ios_settings_alerts_on: String get() = Tr.s(4301) - val ios_settings_alerts_off: String get() = Tr.s(4302) - fun ios_settings_accounts_n(n: Number): String = Tr.f(4303, arrayOf(n)) - val hub_acct_this_hubs_sign_in: String get() = Tr.s(4304) - val hub_acct_no_usage_reading_yet: String get() = Tr.s(4305) - val hub_acct_this_hubs_claude_sign_in: String get() = Tr.s(4306) - val hub_acct_this_hubs_codex_sign_in: String get() = Tr.s(4307) - val hub_acct_claude_cli_login: String get() = Tr.s(4308) - val hub_acct_codex_cli_login: String get() = Tr.s(4309) - val hub_acct_fable_weekly: String get() = Tr.s(4310) - fun ios_acct_also(names: Any): String = Tr.f(4311, arrayOf(names)) - val ios_clone_mode: String get() = Tr.s(4312) - val ios_clone_repo_hint: String get() = Tr.s(4313) - val ios_clone_signin: String get() = Tr.s(4314) - val ios_clone_change: String get() = Tr.s(4315) - val ios_clone_name: String get() = Tr.s(4316) - val ios_clone_thread: String get() = Tr.s(4317) - val ios_clone_go: String get() = Tr.s(4318) - fun ios_clone_into(dest: Any): String = Tr.f(4319, arrayOf(dest)) - val ios_clone_same: String get() = Tr.s(4320) - fun ios_clone_title(repo: Any): String = Tr.f(4321, arrayOf(repo)) - fun ios_clone_cloned(repo: Any): String = Tr.f(4322, arrayOf(repo)) - val ios_clone_cancelled: String get() = Tr.s(4323) - fun ios_clone_code(url: Any): String = Tr.f(4324, arrayOf(url)) - val ios_clone_signin_starting: String get() = Tr.s(4325) - val ios_clone_signin_done: String get() = Tr.s(4326) - val ios_clone_signin_open: String get() = Tr.s(4327) - val ios_clone_loading: String get() = Tr.s(4328) - val mobile_tab_inbox: String get() = Tr.s(4329) - val mobile_tab_crew: String get() = Tr.s(4330) - val mobile_tab_bench: String get() = Tr.s(4331) - val mobile_inbox_clear: String get() = Tr.s(4332) - val mobile_inbox_clear_note: String get() = Tr.s(4333) - val mobile_inbox_talk_bub: String get() = Tr.s(4334) - val mobile_inbox_jump_in: String get() = Tr.s(4335) - val mobile_inbox_open_bench: String get() = Tr.s(4336) - val mobile_badge_pcb: String get() = Tr.s(4337) - val mobile_pill_waiting: String get() = Tr.s(4338) - fun mobile_snooze_wakes(time: Any): String = Tr.f(4339, arrayOf(time)) - val mobile_bench_all: String get() = Tr.s(4340) - val mobile_snooze_for: String get() = Tr.s(4341) - val sidebar_sections_needs: String get() = Tr.s(4342) - val sidebar_sections_pinned: String get() = Tr.s(4343) - val sidebar_sections_active: String get() = Tr.s(4344) - val sidebar_sections_quiet: String get() = Tr.s(4345) - val sidebar_sections_quiet_hint: String get() = Tr.s(4346) - val sidebar_sections_running_word: String get() = Tr.s(4347) - val sidebar_sections_recent: String get() = Tr.s(4348) - val sidebar_sections_limit: String get() = Tr.s(4349) - val sidebar_sections_cut: String get() = Tr.s(4350) - val sidebar_sections_monitoring: String get() = Tr.s(4351) - val sidebar_sections_stopped: String get() = Tr.s(4352) - val sidebar_sections_done: String get() = Tr.s(4353) - val sidebar_sections_failed: String get() = Tr.s(4354) - val sidebar_sections_rename: String get() = Tr.s(4355) - val sidebar_sections_pin: String get() = Tr.s(4356) - val sidebar_sections_unpin: String get() = Tr.s(4357) - val sidebar_sections_quiet_make: String get() = Tr.s(4358) - val sidebar_sections_quiet_back: String get() = Tr.s(4359) - val sidebar_sections_quiet_hint2: String get() = Tr.s(4360) - fun gpui_sections_move_to(group: Any): String = Tr.f(4361, arrayOf(group)) - val sidebar_sections_move: String get() = Tr.s(4362) - val sidebar_sections_new_group: String get() = Tr.s(4363) - val sidebar_sections_new_group_title: String get() = Tr.s(4364) - fun sidebar_sections_remove_ask(project: Any): String = Tr.f(4365, arrayOf(project)) - fun gpui_sections_running(n: Number): String = Tr.f(4366, arrayOf(n)) - fun gpui_sections_rest(n: Number): String = Tr.f(4367, arrayOf(n)) - fun gpui_projects_mech(n: Any): String = Tr.f(4368, arrayOf(n)) - val gpui_open_folder: String get() = Tr.s(4369) - val gpui_picker_none: String get() = Tr.s(4370) - val gpui_picker_key_select: String get() = Tr.s(4371) - val gpui_picker_key_into: String get() = Tr.s(4372) - val gpui_picker_key_complete: String get() = Tr.s(4373) - val gpui_picker_key_open: String get() = Tr.s(4374) - val gpui_picker_added: String get() = Tr.s(4375) - fun gpui_picker_more_typed(n: Any): String = Tr.f(4376, arrayOf(n)) - val gpui_clone_tab: String get() = Tr.s(4377) - val gpui_clone_change: String get() = Tr.s(4378) - val gpui_clone_thread: String get() = Tr.s(4379) - val gpui_clone_retry: String get() = Tr.s(4380) - val gpui_clone_signin: String get() = Tr.s(4381) - val gpui_clone_back: String get() = Tr.s(4382) - val gpui_clone_open_thread: String get() = Tr.s(4383) - val gpui_clone_open_project: String get() = Tr.s(4384) - val gpui_clone_private: String get() = Tr.s(4385) - val gpui_clone_loading: String get() = Tr.s(4386) - val gpui_clone_signin_list: String get() = Tr.s(4387) - val gpui_clone_signin_code: String get() = Tr.s(4388) - val gpui_clone_signin_asking: String get() = Tr.s(4389) - val gpui_clone_signin_done: String get() = Tr.s(4390) - val gpui_clone_cancel: String get() = Tr.s(4391) - val gpui_picker_key_pick: String get() = Tr.s(4392) - val gpui_clone_phase_connecting: String get() = Tr.s(4393) - val gpui_clone_phase_receiving: String get() = Tr.s(4394) - val gpui_clone_phase_resolving: String get() = Tr.s(4395) - val gpui_clone_phase_updating: String get() = Tr.s(4396) - val gpui_clone_phase_counting: String get() = Tr.s(4397) - val gpui_clone_phase_compressing: String get() = Tr.s(4398) - val gpui_clone_phase_lfs: String get() = Tr.s(4399) - val gpui_clone_phase_adding: String get() = Tr.s(4400) - val gpui_clone_phase_starting: String get() = Tr.s(4401) - val gpui_assembly: String get() = Tr.s(4402) - val gpui_mech: String get() = Tr.s(4403) - val gpui_readme: String get() = Tr.s(4404) - val gpui_board: String get() = Tr.s(4405) - val gpui_schematic: String get() = Tr.s(4406) - val gpui_view_three_d: String get() = Tr.s(4407) - val gpui_files: String get() = Tr.s(4408) - val gpui_usage_bot: String get() = Tr.s(4409) - val gpui_usage_tokens: String get() = Tr.s(4410) - val gpui_usage_accounts_tip: String get() = Tr.s(4411) - val gpui_usage_feeds: String get() = Tr.s(4412) - val gpui_usage_lanes: String get() = Tr.s(4413) - val gpui_usage_turn_live: String get() = Tr.s(4414) - val gpui_usage_chat: String get() = Tr.s(4415) - val gpui_usage_today: String get() = Tr.s(4416) - val gpui_usage_prefs: String get() = Tr.s(4417) - val gpui_usage_handover: String get() = Tr.s(4418) - val gpui_usage_none_waiting: String get() = Tr.s(4419) - val gpui_usage_session: String get() = Tr.s(4420) - val gpui_usage_last_handover: String get() = Tr.s(4421) - val gpui_usage_triage: String get() = Tr.s(4422) - val gpui_usage_office: String get() = Tr.s(4423) - val gpui_usage_office_lower: String get() = Tr.s(4424) - val gpui_usage_compact: String get() = Tr.s(4425) - val gpui_usage_switch: String get() = Tr.s(4426) - val gpui_usage_note: String get() = Tr.s(4427) - val gpui_usage_lanes_note: String get() = Tr.s(4428) - val gpui_usage_lanes_routines: String get() = Tr.s(4429) - val gpui_usage_turns_many: String get() = Tr.s(4430) - val gpui_usage_turns_full: String get() = Tr.s(4431) - val gpui_usage_turns_one: String get() = Tr.s(4432) - fun gpui_usage_turns_n(n: Any): String = Tr.f(4433, arrayOf(n)) - fun gpui_usage_left(n: Any): String = Tr.f(4434, arrayOf(n)) - fun gpui_usage_of(a: Any, b: Any): String = Tr.f(4435, arrayOf(a, b)) - fun gpui_usage_context(n: Any): String = Tr.f(4436, arrayOf(n)) - val gpui_usage_noread: String get() = Tr.s(4437) - fun gpui_mgmt_bom_summary(parts: Number, lines: Number): String = Tr.f(4438, arrayOf(parts, lines)) - fun gpui_mgmt_bom_more(n: Number): String = Tr.f(4439, arrayOf(n)) - val gpui_mgmt_dock_right: String get() = Tr.s(4440) - val gpui_mgmt_dock_bottom: String get() = Tr.s(4441) - val gpui_mgmt_close: String get() = Tr.s(4442) - val gpui_mgmt_bom_saved: String get() = Tr.s(4443) - val gpui_mgmt_bom_reading: String get() = Tr.s(4444) - val gpui_mgmt_bom_nomatch: String get() = Tr.s(4445) - val gpui_mgmt_bom_nompn: String get() = Tr.s(4446) - val gpui_mgmt_filter: String get() = Tr.s(4447) - val gpui_mgmt_bom_noparts: String get() = Tr.s(4448) - val gpui_mgmt_bom_dnp: String get() = Tr.s(4449) - val gpui_mgmt_fab_tab: String get() = Tr.s(4450) - val gpui_mgmt_fab_drc_current: String get() = Tr.s(4451) - val gpui_mgmt_fab_drc_stale: String get() = Tr.s(4452) - val gpui_mgmt_fab_drc_update: String get() = Tr.s(4453) - val gpui_mgmt_fab_drc_none: String get() = Tr.s(4454) - val gpui_mgmt_fab_drc_write: String get() = Tr.s(4455) - val gpui_mgmt_fab_drc_noproject: String get() = Tr.s(4456) - val gpui_mgmt_fab_tier_extra: String get() = Tr.s(4457) - val gpui_mgmt_fab_tier_free: String get() = Tr.s(4458) - val gpui_mgmt_fab_reading: String get() = Tr.s(4459) - val gpui_mgmt_fab_thefab: String get() = Tr.s(4460) - val gpui_mgmt_fab_refresh: String get() = Tr.s(4461) - val gpui_mgmt_fab_apply: String get() = Tr.s(4462) - val gpui_mgmt_fab_changed: String get() = Tr.s(4463) - val gpui_mgmt_fab_seen: String get() = Tr.s(4464) - val gpui_mgmt_fab_limit: String get() = Tr.s(4465) - val gpui_mgmt_fab_free: String get() = Tr.s(4466) - val gpui_mgmt_fab_extra: String get() = Tr.s(4467) - val gpui_mgmt_fab_readcol: String get() = Tr.s(4468) - val gpui_mgmt_fab_derived: String get() = Tr.s(4469) - fun gpui_mgmt_fab_suggestion(what: Any, project: Any, fab: Any): String = Tr.f(4470, arrayOf(what, project, fab)) - fun gpui_mgmt_fab_read(rev: Any, day: Any): String = Tr.f(4471, arrayOf(rev, day)) - val gpui_mgmt_fab_reviewing: String get() = Tr.s(4472) - val gpui_mgmt_fab_noreview: String get() = Tr.s(4473) - val gpui_mgmt_fab_findings: String get() = Tr.s(4474) - val gpui_mgmt_fab_reviewbtn: String get() = Tr.s(4475) - val gpui_mgmt_fab_judge: String get() = Tr.s(4476) - val gpui_mgmt_plan_reading: String get() = Tr.s(4477) - val gpui_mgmt_plan_none: String get() = Tr.s(4478) - fun gpui_mgmt_plan_awaiting(n: Number): String = Tr.f(4479, arrayOf(n)) - val gpui_mgmt_plan_nothing: String get() = Tr.s(4480) - val gpui_mgmt_plan_saved: String get() = Tr.s(4481) - val gpui_mgmt_plan_all: String get() = Tr.s(4482) - val gpui_mgmt_plan_stop: String get() = Tr.s(4483) - val gpui_mgmt_plan_hide: String get() = Tr.s(4484) - val gpui_mgmt_plan_show: String get() = Tr.s(4485) - val gpui_mgmt_plan_done: String get() = Tr.s(4486) - val gpui_mgmt_plan_layer: String get() = Tr.s(4487) - val gpui_mgmt_plan_reject: String get() = Tr.s(4488) - val gpui_mgmt_plan_keysnote: String get() = Tr.s(4489) - fun gpui_mgmt_plan_reference(layer: Any): String = Tr.f(4490, arrayOf(layer)) - fun gpui_mgmt_plan_nets(n: Number): String = Tr.f(4491, arrayOf(n)) - val gpui_mgmt_plan_tab: String get() = Tr.s(4492) - val gpui_mgmt_plan_before: String get() = Tr.s(4493) - val gpui_mgmt_plan_onwords: String get() = Tr.s(4494) - val gpui_mgmt_plan_offwords: String get() = Tr.s(4495) - fun gpui_mgmt_plan_elsewhere(board: Any): String = Tr.f(4496, arrayOf(board)) - val gpui_mgmt_plan_openboard: String get() = Tr.s(4497) - val gpui_mgmt_plan_noboard: String get() = Tr.s(4498) - val gpui_mgmt_plan_drawn: String get() = Tr.s(4499) - val gpui_pick_planonce: String get() = Tr.s(4500) - val gpui_pick_planonce_note: String get() = Tr.s(4501) - val hub_view_board_unlisted: String get() = Tr.s(4502) - val gpui_mgmt_bom_stocknote: String get() = Tr.s(4503) - val hub_order_pick_more: String get() = Tr.s(4504) - val hub_order_pick_phone: String get() = Tr.s(4505) - val hub_order_pick_go: String get() = Tr.s(4506) - val gpui_plan_before_routing_desc: String get() = Tr.s(4507) - fun gpui_mgmt_bom_shared(others: Any): String = Tr.f(4508, arrayOf(others)) - fun gpui_mgmt_fab_review(must: Any, should: Any, notes: Any): String = Tr.f(4509, arrayOf(must, should, notes)) - fun gpui_mgmt_fab_stackup(id: Any, w: Any): String = Tr.f(4510, arrayOf(id, w)) - val gpui_mgmt_fab_proposed: String get() = Tr.s(4511) - val gpui_mgmt_fab_use: String get() = Tr.s(4512) - val gpui_keys_mgmt_bom: String get() = Tr.s(4513) - val gpui_keys_mgmt_checks: String get() = Tr.s(4514) - val gpui_keys_mgmt_life: String get() = Tr.s(4515) - val gpui_mgmt_checks_reading: String get() = Tr.s(4516) - val gpui_mgmt_checks_searching: String get() = Tr.s(4517) - val gpui_mgmt_checks_run: String get() = Tr.s(4518) - val gpui_mgmt_checks_running: String get() = Tr.s(4519) - fun gpui_mgmt_checks_behind(what: Any): String = Tr.f(4520, arrayOf(what)) - val gpui_mgmt_checks_stale: String get() = Tr.s(4521) - val gpui_mgmt_checks_liveunsaved: String get() = Tr.s(4522) - fun gpui_mgmt_checks_waiting(why: Any): String = Tr.f(4523, arrayOf(why)) - fun gpui_mgmt_checks_failed(why: Any): String = Tr.f(4524, arrayOf(why)) - val gpui_mgmt_checks_all: String get() = Tr.s(4525) - val gpui_mgmt_checks_errors: String get() = Tr.s(4526) - val gpui_mgmt_checks_warnings: String get() = Tr.s(4527) - val gpui_mgmt_checks_excluded: String get() = Tr.s(4528) - val gpui_mgmt_checks_fix: String get() = Tr.s(4529) - val gpui_mgmt_checks_reexport: String get() = Tr.s(4530) - fun gpui_mgmt_checks_more(n: Number): String = Tr.f(4531, arrayOf(n)) - val gpui_mgmt_checks_fewer: String get() = Tr.s(4532) - val gpui_mgmt_checks_none: String get() = Tr.s(4533) - val gpui_mgmt_checks_nomatch: String get() = Tr.s(4534) - val gpui_mgmt_checks_library: String get() = Tr.s(4535) - val gpui_mgmt_checks_withlib: String get() = Tr.s(4536) - val gpui_mgmt_checks_fullrun: String get() = Tr.s(4537) - val gpui_mgmt_checks_allsources: String get() = Tr.s(4538) - val gpui_mgmt_checks_judged: String get() = Tr.s(4539) - val gpui_mgmt_bom_dnp_tip: String get() = Tr.s(4540) - val gpui_mgmt_bom_writing: String get() = Tr.s(4541) - val gpui_mgmt_bom_inkicad: String get() = Tr.s(4542) - val gpui_mgmt_bom_saved_file: String get() = Tr.s(4543) - val gpui_mgmt_bom_fab: String get() = Tr.s(4544) - val gpui_mgmt_bom_mpn_ph: String get() = Tr.s(4545) - val gpui_mgmt_bom_fab_ph: String get() = Tr.s(4546) - fun gpui_mgmt_bom_each(price: Any, n: Any): String = Tr.f(4547, arrayOf(price, n)) - fun gpui_mgmt_bom_out(n: Any, need: Any): String = Tr.f(4548, arrayOf(n, need)) - fun gpui_mgmt_bom_low(n: Any): String = Tr.f(4549, arrayOf(n)) - fun gpui_mgmt_bom_in(n: Any): String = Tr.f(4550, arrayOf(n)) - fun gpui_mgmt_bom_cost(cost: Any): String = Tr.f(4551, arrayOf(cost)) - fun gpui_mgmt_bom_cost_least(cost: Any): String = Tr.f(4552, arrayOf(cost)) - val gpui_mgmt_bom_checking: String get() = Tr.s(4553) - val gpui_mgmt_bom_notknown: String get() = Tr.s(4554) - val gpui_mgmt_bom_stock: String get() = Tr.s(4555) - val gpui_mgmt_bom_alts: String get() = Tr.s(4556) - val gpui_mgmt_bom_alts_looking: String get() = Tr.s(4557) - val gpui_mgmt_bom_alts_none: String get() = Tr.s(4558) - val gpui_mgmt_bom_alts_use: String get() = Tr.s(4559) - val gpui_mgmt_bom_class_basic: String get() = Tr.s(4560) - val gpui_mgmt_bom_class_extended: String get() = Tr.s(4561) - val gpui_mgmt_bom_class_preferred: String get() = Tr.s(4562) - val gpui_mgmt_bom_notinstock: String get() = Tr.s(4563) - val gpui_mgmt_bom_off: String get() = Tr.s(4564) - fun gpui_mgmt_life_since(day: Any, n: Number): String = Tr.f(4565, arrayOf(day, n)) - fun gpui_mgmt_life_one(day: Any): String = Tr.f(4566, arrayOf(day)) - fun gpui_mgmt_life_now(cost: Any, n: Any, lines: Any): String = Tr.f(4567, arrayOf(cost, n, lines)) - fun gpui_mgmt_life_part_now(stock: Any, price: Any): String = Tr.f(4568, arrayOf(stock, price)) - fun gpui_mgmt_life_instock(lines: Any): String = Tr.f(4569, arrayOf(lines)) - val gpui_mgmt_life_board: String get() = Tr.s(4570) - val gpui_mgmt_life_price: String get() = Tr.s(4571) - val gpui_mgmt_life_active: String get() = Tr.s(4572) - val gpui_mgmt_life_nrnd: String get() = Tr.s(4573) - val gpui_mgmt_life_eol: String get() = Tr.s(4574) - val gpui_mgmt_life_unknown: String get() = Tr.s(4575) - val gpui_mgmt_life_nolines: String get() = Tr.s(4576) - val gpui_mgmt_life_noread: String get() = Tr.s(4577) - val gpui_mgmt_life_reading: String get() = Tr.s(4578) - val gpui_mgmt_life_nopart: String get() = Tr.s(4579) - val gpui_mgmt_life_tab: String get() = Tr.s(4580) - val gpui_mgmt_bom_paused: String get() = Tr.s(4581) - val gpui_mgmt_bom_paused_tip: String get() = Tr.s(4582) - val gpui_keys_mgmt_fab: String get() = Tr.s(4583) - val gpui_mgmt_bom_putback: String get() = Tr.s(4584) - val gpui_mgmt_bom_nochange: String get() = Tr.s(4585) - val gpui_mgmt_bom_deferred: String get() = Tr.s(4586) - val gpui_mgmt_bom_inkicad_save: String get() = Tr.s(4587) - val gpui_mgmt_bom_undo_tip: String get() = Tr.s(4588) - val gpui_mgmt_bom_undo: String get() = Tr.s(4589) - fun gpui_mgmt_checks_on(host: Any): String = Tr.f(4590, arrayOf(host)) - val gpui_gerbers: String get() = Tr.s(4591) - val gpui_gerbers_vs: String get() = Tr.s(4592) - val gpui_gerbers_vs_tip: String get() = Tr.s(4593) - val gpui_gerbers_gerbview: String get() = Tr.s(4594) - val gpui_gerbers_gerbview_tip: String get() = Tr.s(4595) - val gpui_mgmt_bom_saved_state: String get() = Tr.s(4596) - val gpui_mgmt_bom_live_tip: String get() = Tr.s(4597) - val gpui_mgmt_bom_saved_tip: String get() = Tr.s(4598) - val gpui_mgmt_bom_price: String get() = Tr.s(4599) - val gpui_mgmt_bom_class: String get() = Tr.s(4600) - fun gpui_mgmt_life_unknown_n(n: Any): String = Tr.f(4601, arrayOf(n)) - fun gpui_mgmt_life_unknown_tip(a: Any, b: Any): String = Tr.f(4602, arrayOf(a, b)) - fun gpui_mgmt_bom_stock_out(n: Any): String = Tr.f(4603, arrayOf(n)) - fun gpui_mgmt_bom_stock_low(n: Any): String = Tr.f(4604, arrayOf(n)) - val gpui_gerbers_boardonly: String get() = Tr.s(4605) - val gpui_gerbers_gerbersonly: String get() = Tr.s(4606) - fun gpui_mgmt_life_price_since(day: Any): String = Tr.f(4607, arrayOf(day)) - fun gpui_streamer_account(n: Any): String = Tr.f(4608, arrayOf(n)) - val gpui_streamer_mode: String get() = Tr.s(4609) - val gpui_streamer_section: String get() = Tr.s(4610) - val gpui_streamer_off: String get() = Tr.s(4611) - val gpui_streamer_on: String get() = Tr.s(4612) - val gpui_streamer_tip: String get() = Tr.s(4613) - val gpui_streamer_shared: String get() = Tr.s(4614) - val gpui_streamer_qr: String get() = Tr.s(4615) - val gpui_streamer_note: String get() = Tr.s(4616) - val gpui_streamer_share: String get() = Tr.s(4617) - val gpui_streamer_apps: String get() = Tr.s(4618) - val gpui_streamer_apps_note: String get() = Tr.s(4619) - val gpui_streamer_linux: String get() = Tr.s(4620) - val gpui_streamer_mac: String get() = Tr.s(4621) - val gpui_streamer_win: String get() = Tr.s(4622) - val gpui_f2_uber_title: String get() = Tr.s(4623) - val gpui_f2_uber_body: String get() = Tr.s(4624) - val gpui_f2_uber_say: String get() = Tr.s(4625) - val gpui_f2_uber_here: String get() = Tr.s(4626) - val gpui_f2_uber_err_name: String get() = Tr.s(4627) - val gpui_f2_uber_err_color: String get() = Tr.s(4628) - val gpui_f2_uber_color: String get() = Tr.s(4629) - val gpui_f2_uber_own: String get() = Tr.s(4630) - val gpui_f2_uber_custom: String get() = Tr.s(4631) - val gpui_f2_uber_hex: String get() = Tr.s(4632) - val gpui_f2_uber_use: String get() = Tr.s(4633) - val gpui_f2_uber_shuffle: String get() = Tr.s(4634) - val gpui_f2_uber_auto: String get() = Tr.s(4635) - val gpui_f2_uber_savename: String get() = Tr.s(4636) - val gpui_f2_uber_p_ginger: String get() = Tr.s(4637) - val gpui_f2_uber_p_cream: String get() = Tr.s(4638) - val gpui_f2_uber_p_smoke: String get() = Tr.s(4639) - val gpui_f2_uber_p_midnight: String get() = Tr.s(4640) - val gpui_f2_uber_p_cocoa: String get() = Tr.s(4641) - val gpui_f2_uber_p_sky: String get() = Tr.s(4642) - val gpui_f2_uber_p_lilac: String get() = Tr.s(4643) - val gpui_f2_uber_p_rose: String get() = Tr.s(4644) - val gpui_f2_uber_p_mint: String get() = Tr.s(4645) - val gpui_f2_uber_p_cherry: String get() = Tr.s(4646) - val gpui_simulation: String get() = Tr.s(4647) - val gpui_c_sheets_find: String get() = Tr.s(4648) - fun history_snap(turn: Any): String = Tr.f(4649, arrayOf(turn)) - val history_ref_snap: String get() = Tr.s(4650) - val thread_restore_action: String get() = Tr.s(4651) - val thread_restore_ask: String get() = Tr.s(4652) - val thread_restore_note: String get() = Tr.s(4653) - val thread_restore_go: String get() = Tr.s(4654) - val mouse_mouseandtrackpad0: String get() = Tr.s(4655) - val mouse_zoomdirection1: String get() = Tr.s(4656) - val mouse_appliestothewheelandatrackpads2: String get() = Tr.s(4657) - val mouse_normal3: String get() = Tr.s(4658) - val mouse_inverted4: String get() = Tr.s(4659) - val mouse_boardandschematic5: String get() = Tr.s(4660) - val mouse_k3dandstep6: String get() = Tr.s(4661) - val mouse_changedfromitspreseteachinputd7: String get() = Tr.s(4662) - val mouse_apresetsetseveryinputbeloweach8: String get() = Tr.s(4663) - val mouse_legacy10: String get() = Tr.s(4664) - val mouse_leftdrag11: String get() = Tr.s(4665) - val mouse_middledrag12: String get() = Tr.s(4666) - val mouse_rightdrag13: String get() = Tr.s(4667) - val mouse_shiftleftdrag14: String get() = Tr.s(4668) - val mouse_ctrlleftdrag15: String get() = Tr.s(4669) - val mouse_altleftdrag16: String get() = Tr.s(4670) - val mouse_wheel17: String get() = Tr.s(4671) - val mouse_shiftwheel18: String get() = Tr.s(4672) - val mouse_ctrlwheel19: String get() = Tr.s(4673) - val mouse_altwheel20: String get() = Tr.s(4674) - val mouse_nothing21: String get() = Tr.s(4675) - val mouse_pan22: String get() = Tr.s(4676) - val mouse_pansideways23: String get() = Tr.s(4677) - val mouse_panupanddown24: String get() = Tr.s(4678) - val mouse_zoom25: String get() = Tr.s(4679) - val mouse_rotate26: String get() = Tr.s(4680) - val mouse_roll27: String get() = Tr.s(4681) - val mouse_select28: String get() = Tr.s(4682) - val mouse_aclickwithoutmovingwithnokeyhe29: String get() = Tr.s(4683) - val mouse_leftbutton30: String get() = Tr.s(4684) - val mouse_middlebutton31: String get() = Tr.s(4685) - val mouse_rightbutton32: String get() = Tr.s(4686) - val mouse_twofingerscroll33: String get() = Tr.s(4687) - val mouse_atrackpadstwofingerswithctrlhe34: String get() = Tr.s(4688) - val mouse_pans35: String get() = Tr.s(4689) - val mouse_isthewheel36: String get() = Tr.s(4690) - val mouse_pinch37: String get() = Tr.s(4691) - val mouse_atrackpadpinch38: String get() = Tr.s(4692) - val mouse_zooms39: String get() = Tr.s(4693) - val mouse_chooseaninputforitabove41: String get() = Tr.s(4694) - val mouse_nothingissettopan42: String get() = Tr.s(4695) - val mouse_nothingissettozoom43: String get() = Tr.s(4696) - val mouse_nothingissettorotate44: String get() = Tr.s(4697) - val gpui_review_mark: String get() = Tr.s(4698) - val gpui_review_mark_tip: String get() = Tr.s(4699) - val gpui_review_why: String get() = Tr.s(4700) - val gpui_review_allow: String get() = Tr.s(4701) - val gpui_review_allow_tip: String get() = Tr.s(4702) - val gpui_review_off: String get() = Tr.s(4703) - val gpui_review_again: String get() = Tr.s(4704) - val gpui_review_again_tip: String get() = Tr.s(4705) - val gpui_rail_no_board: String get() = Tr.s(4706) - val gpui_rail_no_schematic: String get() = Tr.s(4707) - val gpui_rail_split_needs_both: String get() = Tr.s(4708) - val gpui_rail_no_mech: String get() = Tr.s(4709) - val gpui_panestate_next_board: String get() = Tr.s(4710) - val gpui_panestate_next_schematic: String get() = Tr.s(4711) - val gpui_panestate_next_solid: String get() = Tr.s(4712) - val gpui_panestate_empty_gerbers: String get() = Tr.s(4713) - val gpui_panestate_next_gerbers: String get() = Tr.s(4714) - val gpui_panestate_gerbers_noboard: String get() = Tr.s(4715) - val gpui_panestate_gerbers_noboard_next: String get() = Tr.s(4716) - val gpui_panestate_empty_mech: String get() = Tr.s(4717) - val gpui_panestate_next_mech: String get() = Tr.s(4718) - val gpui_panestate_loading_split: String get() = Tr.s(4719) - val gpui_panestate_retrying: String get() = Tr.s(4720) - val gpui_hub_view_notready: String get() = Tr.s(4721) - val gpui_hub_view_staleconn: String get() = Tr.s(4722) - val gpui_hub_view_unavailable: String get() = Tr.s(4723) - val settings_designmode_label: String get() = Tr.s(4724) - val settings_designmode_viewer: String get() = Tr.s(4725) - val settings_designmode_kicad: String get() = Tr.s(4726) - val settings_designmode_note: String get() = Tr.s(4727) - val review_empty_title: String get() = Tr.s(4728) - val review_empty_next: String get() = Tr.s(4729) - val viewer_diff_threadchanges: String get() = Tr.s(4730) - val viewer_layout_refusal_locked: String get() = Tr.s(4731) - val viewer_layout_refusal_toosmall: String get() = Tr.s(4732) - val viewer_layout_refusal_onekicad: String get() = Tr.s(4733) - val viewer_layout_refusal_incompatibleoverlay: String get() = Tr.s(4734) - val viewer_layout_refusal_notfound: String get() = Tr.s(4735) - val viewer_layout_refusal_nooverlay: String get() = Tr.s(4736) - val viewer_layout_refusal_invalidsource: String get() = Tr.s(4737) - val viewer_layout_refusal_sametile: String get() = Tr.s(4738) - val viewer_layout_refusal_invalidratio: String get() = Tr.s(4739) - val viewer_layout_refusal_duplicateid: String get() = Tr.s(4740) - val viewer_layout_refusal_unknownframe: String get() = Tr.s(4741) - val viewer_layout_refusal_invalidinput: String get() = Tr.s(4742) - val viewer_layout_refusal_toomany: String get() = Tr.s(4743) - val viewer_layout_refusal_toomanysources: String get() = Tr.s(4744) - val viewer_layout_refusal_unresolvedversion: String get() = Tr.s(4745) - val viewer_layout_refusal_nohistory: String get() = Tr.s(4746) - val viewer_layout_refusal_linked: String get() = Tr.s(4747) - val viewer_layout_refusal_notondevice: String get() = Tr.s(4748) - val viewer_layout_refusal_starting: String get() = Tr.s(4749) - val viewer_footprinteditor: String get() = Tr.s(4750) - val viewer_symboleditor: String get() = Tr.s(4751) - val web_clone_tab: String get() = Tr.s(4752) - val web_clone_repo_placeholder: String get() = Tr.s(4753) - val web_clone_private: String get() = Tr.s(4754) - val web_clone_signin: String get() = Tr.s(4755) - val web_clone_signin_wait: String get() = Tr.s(4756) - val web_clone_signin_enter: String get() = Tr.s(4757) - val web_clone_signin_done: String get() = Tr.s(4758) - val web_clone_copied: String get() = Tr.s(4759) - val web_clone_change_folder: String get() = Tr.s(4760) - val web_clone_folder_name: String get() = Tr.s(4761) - val web_clone_start_thread: String get() = Tr.s(4762) - fun web_clone_first(text: Any): String = Tr.f(4763, arrayOf(text)) - val web_clone_same: String get() = Tr.s(4764) - val web_clone_go: String get() = Tr.s(4765) - fun web_clone_cloning(repo: Any, dest: Any): String = Tr.f(4766, arrayOf(repo, dest)) - fun web_clone_cloned(repo: Any, dest: Any): String = Tr.f(4767, arrayOf(repo, dest)) - fun web_clone_stopped(repo: Any): String = Tr.f(4768, arrayOf(repo)) - val web_clone_retry: String get() = Tr.s(4769) - val web_clone_back: String get() = Tr.s(4770) - val web_clone_open_thread: String get() = Tr.s(4771) - val web_clone_open_project: String get() = Tr.s(4772) - fun web_clone_add_dir(dir: Any): String = Tr.f(4773, arrayOf(dir)) - fun web_clone_use_dir(dir: Any): String = Tr.f(4774, arrayOf(dir)) - val web_clone_up: String get() = Tr.s(4775) - val web_clone_loading: String get() = Tr.s(4776) - val web_clone_no_folders: String get() = Tr.s(4777) - fun gpui_c_kicad_opening(editor: Any, job: Any, secs: Any): String = Tr.f(4778, arrayOf(editor, job, secs)) - fun gpui_c_kicad_openingbare(editor: Any, secs: Any): String = Tr.f(4779, arrayOf(editor, secs)) - fun gpui_c_kicad_openfailed(editor: Any): String = Tr.f(4780, arrayOf(editor)) - val viewer_tile_rail_add: String get() = Tr.s(4781) - val viewer_tile_add: String get() = Tr.s(4782) - val viewer_tile_maximize: String get() = Tr.s(4783) - val viewer_tile_restore: String get() = Tr.s(4784) - val viewer_tile_focus: String get() = Tr.s(4785) - val viewer_tile_embedded: String get() = Tr.s(4786) - val viewer_tile_simulation_single: String get() = Tr.s(4787) - val viewer_tile_add_tip: String get() = Tr.s(4788) - val viewer_tile_left: String get() = Tr.s(4789) - val viewer_tile_right: String get() = Tr.s(4790) - val viewer_tile_top: String get() = Tr.s(4791) - val viewer_tile_bottom: String get() = Tr.s(4792) - val web_pair_subtitle: String get() = Tr.s(4793) - val web_pair_name: String get() = Tr.s(4794) - val web_pair_request: String get() = Tr.s(4795) - val web_pair_code: String get() = Tr.s(4796) - fun web_pair_approve_in(time: Any): String = Tr.f(4797, arrayOf(time)) - val web_pair_expired: String get() = Tr.s(4798) - val web_pair_approved: String get() = Tr.s(4799) - val web_pair_denied: String get() = Tr.s(4800) - val web_pair_cancelled: String get() = Tr.s(4801) - val web_pair_requesting: String get() = Tr.s(4802) - fun web_pair_failed(status: Any): String = Tr.f(4803, arrayOf(status)) - val web_pair_ratelimited: String get() = Tr.s(4804) - val web_pair_nocode: String get() = Tr.s(4805) - val web_pair_unreachable: String get() = Tr.s(4806) - val web_chat_loading: String get() = Tr.s(4807) - val web_chat_choose: String get() = Tr.s(4808) - val web_chat_empty: String get() = Tr.s(4809) - val web_chat_streaming: String get() = Tr.s(4810) - fun web_chat_finished(time: Any): String = Tr.f(4811, arrayOf(time)) - fun web_chat_finished_dur(time: Any, dur: Any): String = Tr.f(4812, arrayOf(time, dur)) - val web_chat_answer_placeholder: String get() = Tr.s(4813) - val web_chat_answer_btn: String get() = Tr.s(4814) - fun web_chat_answered(answer: Any): String = Tr.f(4815, arrayOf(answer)) - val web_chat_review_mode: String get() = Tr.s(4816) - val web_composer_attach: String get() = Tr.s(4817) - val web_composer_voice: String get() = Tr.s(4818) - fun web_composer_unsupported(type: Any): String = Tr.f(4819, arrayOf(type)) - fun web_composer_maximages(max: Any): String = Tr.f(4820, arrayOf(max)) - val web_logout_failed: String get() = Tr.s(4821) - val thread_context_title: String get() = Tr.s(4822) - val thread_context_instructions: String get() = Tr.s(4823) - val thread_context_system: String get() = Tr.s(4824) - val thread_context_skills: String get() = Tr.s(4825) - val thread_context_mcp: String get() = Tr.s(4826) - val thread_context_mcp_short: String get() = Tr.s(4827) - val thread_context_reading: String get() = Tr.s(4828) - val thread_context_none_instructions: String get() = Tr.s(4829) - val thread_context_none_mcp: String get() = Tr.s(4830) - val thread_context_native_note: String get() = Tr.s(4831) - val thread_context_copy: String get() = Tr.s(4832) - val thread_context_copied: String get() = Tr.s(4833) - val thread_context_base: String get() = Tr.s(4834) - val thread_context_injected_label: String get() = Tr.s(4835) - val thread_context_index: String get() = Tr.s(4836) - val thread_context_scope_user: String get() = Tr.s(4837) - val thread_context_scope_bundled: String get() = Tr.s(4838) - val thread_context_native: String get() = Tr.s(4839) - val thread_context_injected: String get() = Tr.s(4840) - val thread_context_cross: String get() = Tr.s(4841) - val thread_context_explicit: String get() = Tr.s(4842) - val thread_context_untrusted: String get() = Tr.s(4843) - val thread_context_invalid: String get() = Tr.s(4844) - val thread_context_trust: String get() = Tr.s(4845) - val thread_context_enable: String get() = Tr.s(4846) - val thread_context_disable: String get() = Tr.s(4847) - fun thread_context_size(bytes: Any, tokens: Any): String = Tr.f(4848, arrayOf(bytes, tokens)) - val thread_context_unreachable: String get() = Tr.s(4849) - val gpui_planmode_top_once: String get() = Tr.s(4850) - val gpui_planmode_top_planning: String get() = Tr.s(4851) - val gpui_planmode_top_pending: String get() = Tr.s(4852) - val gpui_planmode_top_executing: String get() = Tr.s(4853) - val gpui_planmode_tip: String get() = Tr.s(4854) - val gpui_planmode_chip_building: String get() = Tr.s(4855) - val gpui_planmode_chip_once: String get() = Tr.s(4856) - val gpui_planmode_bar_once: String get() = Tr.s(4857) - val gpui_planmode_bar_always: String get() = Tr.s(4858) - val gpui_planmode_bar_planning: String get() = Tr.s(4859) - val gpui_planmode_bar_pending: String get() = Tr.s(4860) - val gpui_planmode_bar_executing: String get() = Tr.s(4861) - val gpui_planmode_scope_once: String get() = Tr.s(4862) - val gpui_planmode_scope_always: String get() = Tr.s(4863) - val gpui_ask_plan_ready: String get() = Tr.s(4864) - val gpui_ask_plan_revise: String get() = Tr.s(4865) - val gpui_ask_plan_sendrev: String get() = Tr.s(4866) - val gpui_ask_plan_reviseph: String get() = Tr.s(4867) - val gpui_mgmt_plan_st_blocked: String get() = Tr.s(4868) - val gpui_mgmt_plan_st_routing: String get() = Tr.s(4869) - val gpui_mgmt_plan_st_awaiting: String get() = Tr.s(4870) - val gpui_mgmt_plan_st_verified: String get() = Tr.s(4871) - val gpui_mgmt_plan_st_routed: String get() = Tr.s(4872) - val gpui_mgmt_plan_st_approved: String get() = Tr.s(4873) - val gpui_mgmt_plan_st_partial: String get() = Tr.s(4874) - val gpui_mgmt_plan_st_rejected: String get() = Tr.s(4875) - val gpui_mgmt_plan_st_empty: String get() = Tr.s(4876) - val gpui_mgmt_plan_refused: String get() = Tr.s(4877) - val gpui_mgmt_plan_emptysub: String get() = Tr.s(4878) - val gpui_mgmt_plan_verify: String get() = Tr.s(4879) - val gpui_mgmt_plan_reqplain: String get() = Tr.s(4880) - fun gpui_mgmt_plan_requested(what: Any): String = Tr.f(4881, arrayOf(what)) - val gpui_mgmt_plan_stackup: String get() = Tr.s(4882) - val gpui_keys_planmode: String get() = Tr.s(4883) - val gpui_keys_mgmt_plan: String get() = Tr.s(4884) - fun web_plan_awaiting(n: Any): String = Tr.f(4885, arrayOf(n)) - val web_plan_net_one: String get() = Tr.s(4886) - fun web_plan_nets(n: Any): String = Tr.f(4887, arrayOf(n)) - val gpui_mgmt_plan_view_canvas: String get() = Tr.s(4888) - val gpui_mgmt_plan_view_split: String get() = Tr.s(4889) - val gpui_mgmt_plan_view_list: String get() = Tr.s(4890) - val gpui_mgmt_plan_grid_all: String get() = Tr.s(4891) - val gpui_mgmt_plan_grid_pair: String get() = Tr.s(4892) - val gpui_mgmt_plan_grid_single: String get() = Tr.s(4893) - val gpui_mgmt_plan_expand: String get() = Tr.s(4894) - val gpui_mgmt_plan_compact: String get() = Tr.s(4895) - val gpui_mgmt_plan_sync: String get() = Tr.s(4896) - val gpui_mgmt_plan_fit: String get() = Tr.s(4897) - val gpui_mgmt_plan_lock: String get() = Tr.s(4898) - val gpui_mgmt_plan_unlock: String get() = Tr.s(4899) - val gpui_mgmt_plan_layer_move: String get() = Tr.s(4900) - val gpui_mgmt_plan_width: String get() = Tr.s(4901) - val gpui_mgmt_plan_addnote: String get() = Tr.s(4902) - val gpui_mgmt_plan_note_placeholder: String get() = Tr.s(4903) - val gpui_mgmt_plan_hint: String get() = Tr.s(4904) - val gpui_mgmt_plan_rejectlayer: String get() = Tr.s(4905) - val gpui_mgmt_plan_edited: String get() = Tr.s(4906) - val gpui_mgmt_plan_locked: String get() = Tr.s(4907) - val gpui_mgmt_plan_noitems: String get() = Tr.s(4908) - val gpui_mgmt_plan_stackup_short: String get() = Tr.s(4909) - val gpui_mgmt_plan_layer_short: String get() = Tr.s(4910) - fun gpui_mgmt_plan_awaiting_short(n: Any): String = Tr.f(4911, arrayOf(n)) - fun gpui_mgmt_plan_done_of(done: Any, total: Any): String = Tr.f(4912, arrayOf(done, total)) - val gpui_planmode_chip_review: String get() = Tr.s(4913) - val mobile_plan_steer: String get() = Tr.s(4914) - val mobile_plan_details: String get() = Tr.s(4915) - val mobile_plan_reset: String get() = Tr.s(4916) - val mobile_plan_removepoint: String get() = Tr.s(4917) - val mobile_plan_touchhint: String get() = Tr.s(4918) - val mobile_plan_copied: String get() = Tr.s(4919) - fun mobile_plan_widthmm(v: Any): String = Tr.f(4920, arrayOf(v)) - fun mobile_plan_coord(x: Any, y: Any): String = Tr.f(4921, arrayOf(x, y)) - val provider_notice_head: String get() = Tr.s(4922) - val provider_notice_text_none: String get() = Tr.s(4923) - val provider_notice_text_signedout: String get() = Tr.s(4924) - val provider_notice_button: String get() = Tr.s(4925) - val provider_notice_senderr: String get() = Tr.s(4926) - fun provider_notice_senderr_remote(machine: Any): String = Tr.f(4927, arrayOf(machine)) - val web_settings_providers: String get() = Tr.s(4928) - val web_settings_providers_browser: String get() = Tr.s(4929) - fun order_lead_days(days: Number): String = Tr.f(4930, arrayOf(days)) - fun order_estimate_warnings(warnings: Any): String = Tr.f(4931, arrayOf(warnings)) - val web_home_open: String get() = Tr.s(4932) - val web_home_fold: String get() = Tr.s(4933) - val web_home_unfold: String get() = Tr.s(4934) - val web_home_loading: String get() = Tr.s(4935) - val web_home_error: String get() = Tr.s(4936) - fun web_home_lead(n: Any): String = Tr.f(4937, arrayOf(n)) - val web_home_lead_one: String get() = Tr.s(4938) - val web_ring_unavailable: String get() = Tr.s(4939) - val web_ring_loading: String get() = Tr.s(4940) - val web_ring_error: String get() = Tr.s(4941) - fun web_ring_count(n: Any): String = Tr.f(4942, arrayOf(n)) - val web_ring_count_one: String get() = Tr.s(4943) - fun web_ring_found(found: Any, total: Any, q: Any): String = Tr.f(4944, arrayOf(found, total, q)) - val web_ring_not_heard: String get() = Tr.s(4945) - val web_ring_app_words: String get() = Tr.s(4946) - fun web_ring_heard_by(model: Any): String = Tr.f(4947, arrayOf(model)) - fun web_ring_heard_by_sure(model: Any, conf: Any): String = Tr.f(4948, arrayOf(model, conf)) - val web_ring_state_sent: String get() = Tr.s(4949) - val web_ring_state_new: String get() = Tr.s(4950) - val web_ring_state_heard: String get() = Tr.s(4951) - val web_ring_state_failed: String get() = Tr.s(4952) - val web_ring_state_busy: String get() = Tr.s(4953) - val web_ring_no_words: String get() = Tr.s(4954) + val chats_new: String get() = Tr.s(2335) + val chats_new_noproject: String get() = Tr.s(2336) + val chats_title: String get() = Tr.s(2337) + val chats_move: String get() = Tr.s(2338) + val chats_move_none: String get() = Tr.s(2339) + val chats_old_tip: String get() = Tr.s(2340) + val gpui_e_files_max_mb: String get() = Tr.s(2341) + fun gpui_e_files_max_note(mb: Any): String = Tr.f(2342, arrayOf(mb)) + val gpui_e_dev_replay: String get() = Tr.s(2343) + val gpui_e_dev_replay_note: String get() = Tr.s(2344) + val gpui_e_dev_replay_button: String get() = Tr.s(2345) + val gpui_e_dev_star: String get() = Tr.s(2346) + val gpui_e_dev_star_show: String get() = Tr.s(2347) + val gpui_e_about_updates: String get() = Tr.s(2348) + val gpui_e_about_frames: String get() = Tr.s(2349) + val gpui_e_about_cef: String get() = Tr.s(2350) + val gpui_e_about_notices: String get() = Tr.s(2351) + fun gpui_e_about_notices_here(path: Any): String = Tr.f(2352, arrayOf(path)) + fun gpui_e_about_notices_hub(path: Any): String = Tr.f(2353, arrayOf(path)) + val gpui_e_open_folder: String get() = Tr.s(2354) + val gpui_e_agents_thinking: String get() = Tr.s(2355) + val gpui_e_agents_thinking_note: String get() = Tr.s(2356) + val gpui_e_agents_recall: String get() = Tr.s(2357) + val gpui_e_agents_recall_note: String get() = Tr.s(2358) + val gpui_e_order_comes: String get() = Tr.s(2359) + val gpui_e_devices_local_machine: String get() = Tr.s(2360) + val gpui_e_rules_standing: String get() = Tr.s(2361) + val gpui_e_rules_words: String get() = Tr.s(2362) + val gpui_e_rules_eg: String get() = Tr.s(2363) + val gpui_e_rules_add: String get() = Tr.s(2364) + val gpui_e_board_doing: String get() = Tr.s(2365) + val gpui_e_board_todo: String get() = Tr.s(2366) + val gpui_e_board_what: String get() = Tr.s(2367) + val gpui_e_board_eg: String get() = Tr.s(2368) + val gpui_e_board_add: String get() = Tr.s(2369) + val gpui_e_tz_phone_again: String get() = Tr.s(2370) + val gpui_e_tz_machine_again: String get() = Tr.s(2371) + val gpui_e_tz_phone_auto: String get() = Tr.s(2372) + val gpui_e_tz_machine_auto: String get() = Tr.s(2373) + val gpui_e_privacy_note: String get() = Tr.s(2374) + fun gpui_e_privacy_note_id(id: Any): String = Tr.f(2375, arrayOf(id)) + val gpui_e_privacy_share: String get() = Tr.s(2376) + val gpui_e_privacy_reset: String get() = Tr.s(2377) + val gpui_e_privacy_report: String get() = Tr.s(2378) + fun gpui_e_writing_model_note(model: Any): String = Tr.f(2379, arrayOf(model)) + fun gpui_e_kicad_none(platform: Any): String = Tr.f(2380, arrayOf(platform)) + fun gpui_e_kicad_installing(version: Any): String = Tr.f(2381, arrayOf(version)) + val gpui_e_kicad_starting: String get() = Tr.s(2382) + val gpui_e_kicad_ask: String get() = Tr.s(2383) + fun gpui_e_kicad_ask_note(version: Any, from: Any, into: Any): String = Tr.f(2384, arrayOf(version, from, into)) + fun gpui_e_kicad_offer(version: Any, from: Any): String = Tr.f(2385, arrayOf(version, from)) + val gpui_e_kicad_own: String get() = Tr.s(2386) + val gpui_e_kicad_notfound: String get() = Tr.s(2387) + fun gpui_e_kicad_found_version(version: Any, path: Any): String = Tr.f(2388, arrayOf(version, path)) + fun gpui_e_kicad_found_stock(version: Any, path: Any): String = Tr.f(2389, arrayOf(version, path)) + fun gpui_e_kicad_offer_stock(version: Any, pin: Any, from: Any): String = Tr.f(2390, arrayOf(version, pin, from)) + fun gpui_e_kicad_found(path: Any): String = Tr.f(2391, arrayOf(path)) + fun gpui_e_kicad_just(version: Any, path: Any): String = Tr.f(2392, arrayOf(version, path)) + fun gpui_e_kicad_passed(version: Any, path: Any, set: Any): String = Tr.f(2393, arrayOf(version, path, set)) + val gpui_e_kicad_checking: String get() = Tr.s(2394) + val gpui_e_kicad_path_hint: String get() = Tr.s(2395) + val gpui_e_freecad_notfound: String get() = Tr.s(2396) + val gpui_e_freecad_notat: String get() = Tr.s(2397) + val gpui_e_freecad_path_hint: String get() = Tr.s(2398) + val gpui_e_keys_kept: String get() = Tr.s(2399) + val gpui_e_keys_again: String get() = Tr.s(2400) + val gpui_e_keys_forget_it: String get() = Tr.s(2401) + val gpui_e_keys_note: String get() = Tr.s(2402) + val gpui_e_fallback_unavailable: String get() = Tr.s(2403) + val gpui_e_fallback_provider: String get() = Tr.s(2404) + val gpui_e_fallback_provider_note: String get() = Tr.s(2405) + val gpui_e_fallback_add: String get() = Tr.s(2406) + fun gpui_e_usage_line(turns: Number, input: Any, cread: Any, cwrite: Any, output: Any, cost: Any): String = Tr.f(2407, arrayOf(turns, input, cread, cwrite, output, cost)) + val gpui_e_cost_not_reported: String get() = Tr.s(2408) + val gpui_e_usage_title: String get() = Tr.s(2409) + val gpui_e_usage_none: String get() = Tr.s(2410) + val gpui_e_usage_unknown: String get() = Tr.s(2411) + val gpui_e_usage_all: String get() = Tr.s(2412) + val gpui_e_page_back: String get() = Tr.s(2413) + fun gpui_e_rules_on_refuses(tool: Any): String = Tr.f(2414, arrayOf(tool)) + fun gpui_e_rules_off_refuses(tool: Any): String = Tr.f(2415, arrayOf(tool)) + fun gpui_e_rules_on_refuses_word(tool: Any, word: Any): String = Tr.f(2416, arrayOf(tool, word)) + fun gpui_e_rules_off_refuses_word(tool: Any, word: Any): String = Tr.f(2417, arrayOf(tool, word)) + fun gpui_e_rules_on_using(tool: Any): String = Tr.f(2418, arrayOf(tool)) + fun gpui_e_rules_off_using(tool: Any): String = Tr.f(2419, arrayOf(tool)) + fun gpui_e_board_doing_due(due: Any): String = Tr.f(2420, arrayOf(due)) + fun gpui_e_board_blocked_due(due: Any): String = Tr.f(2421, arrayOf(due)) + fun gpui_e_board_todo_due(due: Any): String = Tr.f(2422, arrayOf(due)) + fun gpui_e_board_done_due(due: Any): String = Tr.f(2423, arrayOf(due)) + fun gpui_e_tz_zone_set(zone: Any): String = Tr.f(2424, arrayOf(zone)) + fun gpui_e_tz_zone_phone(zone: Any): String = Tr.f(2425, arrayOf(zone)) + fun gpui_e_tz_zone_machine(zone: Any): String = Tr.f(2426, arrayOf(zone)) + fun gpui_e_tz_zone_none(zone: Any): String = Tr.f(2427, arrayOf(zone)) + fun gpui_e_subs_done(n: Any): String = Tr.f(2428, arrayOf(n)) + fun gpui_e_lock_starting(who: Any): String = Tr.f(2429, arrayOf(who)) + fun gpui_e_lock_position(n: Any, who: Any): String = Tr.f(2430, arrayOf(n, who)) + fun gpui_e_subs_where(harness: Any): String = Tr.f(2431, arrayOf(harness)) + fun gpui_e_picker_already(path: Any): String = Tr.f(2432, arrayOf(path)) + fun gpui_e_picker_create(path: Any): String = Tr.f(2433, arrayOf(path)) + fun gpui_e_picker_notdir(path: Any): String = Tr.f(2434, arrayOf(path)) + val gpui_e_picker_hint: String get() = Tr.s(2435) + val gpui_e_fab_nogoal: String get() = Tr.s(2436) + fun gpui_e_fab_unavailable_line(error: Any, line: Any): String = Tr.f(2437, arrayOf(error, line)) + fun gpui_e_fab_buy_label(label: Any): String = Tr.f(2438, arrayOf(label)) + val gpui_e_tools_back: String get() = Tr.s(2439) + val gpui_e_tools_back_tip: String get() = Tr.s(2440) + val gpui_e_status_working: String get() = Tr.s(2441) + val gpui_e_status_inactive: String get() = Tr.s(2442) + val gpui_e_status_finished: String get() = Tr.s(2443) + val gpui_e_status_waiting: String get() = Tr.s(2444) + val gpui_e_status_blocked: String get() = Tr.s(2445) + fun gpui_e_acct_saved(who: Any): String = Tr.f(2446, arrayOf(who)) + fun gpui_e_acct_cli(who: Any): String = Tr.f(2447, arrayOf(who)) + fun gpui_e_acct_window_resets(label: Any, left: Any, `when`: Any): String = Tr.f(2448, arrayOf(label, left, `when`)) + fun gpui_e_acct_default_left(left: Any): String = Tr.f(2449, arrayOf(left)) + fun gpui_e_acct_profile_left(name: Any, left: Any): String = Tr.f(2450, arrayOf(name, left)) + fun gpui_e_acct_extra_off(used: Any): String = Tr.f(2451, arrayOf(used)) + fun gpui_e_acct_extra_of_off(used: Any, limit: Any): String = Tr.f(2452, arrayOf(used, limit)) + fun gpui_e_acct_extra_off_why(used: Any, reason: Any): String = Tr.f(2453, arrayOf(used, reason)) + fun gpui_e_acct_extra_of_off_why(used: Any, limit: Any, reason: Any): String = Tr.f(2454, arrayOf(used, limit, reason)) + val gpui_e_tok_noreading: String get() = Tr.s(2455) + fun gpui_e_tok_notby(provider: Any): String = Tr.f(2456, arrayOf(provider)) + fun gpui_e_tok_ofwindow(used: Any, window: Any, pct: Any): String = Tr.f(2457, arrayOf(used, window, pct)) + fun gpui_e_tok_rate(rate: Any): String = Tr.f(2458, arrayOf(rate)) + val gpui_e_tok_held: String get() = Tr.s(2459) + val gpui_e_tok_room: String get() = Tr.s(2460) + val gpui_e_tok_noturn: String get() = Tr.s(2461) + val gpui_e_tok_tokens_label: String get() = Tr.s(2462) + val gpui_e_tok_nottold: String get() = Tr.s(2463) + val gpui_e_tok_input: String get() = Tr.s(2464) + val gpui_e_tok_cread: String get() = Tr.s(2465) + val gpui_e_tok_cwrite: String get() = Tr.s(2466) + val gpui_e_tok_output: String get() = Tr.s(2467) + fun gpui_e_tok_output_reasoning(n: Any, r: Any): String = Tr.f(2468, arrayOf(n, r)) + val gpui_e_tok_cost: String get() = Tr.s(2469) + val gpui_e_tok_notreported: String get() = Tr.s(2470) + val gpui_e_tok_speed: String get() = Tr.s(2471) + val gpui_e_tok_modeltime: String get() = Tr.s(2472) + fun gpui_e_tok_modeltime_steps(time: Any, n: Number): String = Tr.f(2473, arrayOf(time, n)) + val gpui_e_tok_turntime: String get() = Tr.s(2474) + val gpui_e_tok_noturns: String get() = Tr.s(2475) + val gpui_e_tok_turns: String get() = Tr.s(2476) + fun gpui_e_tok_turns_unknown(n: Any, m: Any): String = Tr.f(2477, arrayOf(n, m)) + val gpui_e_tok_hits: String get() = Tr.s(2478) + fun gpui_e_tok_hits_of(pct: Any): String = Tr.f(2479, arrayOf(pct)) + fun gpui_e_tok_cost_some(cost: Any, n: Any): String = Tr.f(2480, arrayOf(cost, n)) + val gpui_e_tok_avg: String get() = Tr.s(2481) + val gpui_e_tok_last: String get() = Tr.s(2482) + val gpui_e_tok_bymodel: String get() = Tr.s(2483) + fun gpui_e_tok_model_line(`in`: Any, out: Any, cread: Any, cwrite: Any): String = Tr.f(2484, arrayOf(`in`, out, cread, cwrite)) + fun gpui_e_tok_model_line_web(`in`: Any, out: Any, cread: Any, cwrite: Any, n: Any): String = Tr.f(2485, arrayOf(`in`, out, cread, cwrite, n)) + val gpui_e_tok_speed_note: String get() = Tr.s(2486) + val gpui_e_viewer_noproject: String get() = Tr.s(2487) + val gpui_e_viewer_remote_files: String get() = Tr.s(2488) + val gpui_e_viewer_remote_parts: String get() = Tr.s(2489) + val gpui_e_viewer_noparts: String get() = Tr.s(2490) + val gpui_e_order_how: String get() = Tr.s(2491) + val gpui_e_fallback_note: String get() = Tr.s(2492) + val gpui_e_fallback_model: String get() = Tr.s(2493) + fun gpui_e_usage_line_nocost(turns: Number, input: Any, cread: Any, cwrite: Any, output: Any): String = Tr.f(2494, arrayOf(turns, input, cread, cwrite, output)) + fun gpui_e_acct_weekly_resets(left: Any, `when`: Any): String = Tr.f(2495, arrayOf(left, `when`)) + fun gpui_e_acct_hour5_resets(left: Any, `when`: Any): String = Tr.f(2496, arrayOf(left, `when`)) + fun gpui_e_acct_opus_resets(left: Any, `when`: Any): String = Tr.f(2497, arrayOf(left, `when`)) + fun gpui_e_acct_sonnet_resets(left: Any, `when`: Any): String = Tr.f(2498, arrayOf(left, `when`)) + val notify_which_alerts_reach_you_quiet: String get() = Tr.s(2499) + val notify_notifications: String get() = Tr.s(2500) + val notify_phones: String get() = Tr.s(2501) + val notify_only_your_uberbot_pushes_to: String get() = Tr.s(2502) + val notify_quiet_hours: String get() = Tr.s(2503) + val notify_a_push_waits_until_the: String get() = Tr.s(2504) + val notify_quiet_from_and_until: String get() = Tr.s(2505) + val notify_hh_mm_hours: String get() = Tr.s(2506) + val notify_times_are_hh_mm_hours: String get() = Tr.s(2507) + val notify_quiet_hours_are_hh_mm: String get() = Tr.s(2508) + val notify_urgent_asks_come_through: String get() = Tr.s(2509) + val notify_an_approval_or_a_question: String get() = Tr.s(2510) + val notify_iphones_that_hear_a_push: String get() = Tr.s(2511) + val notify_none_yet_an_iphone_registers: String get() = Tr.s(2512) + val notify_muted_hears_only_what_urgent: String get() = Tr.s(2513) + val notify_hears_alerts: String get() = Tr.s(2514) + val notify_hears: String get() = Tr.s(2515) + val notify_muted: String get() = Tr.s(2516) + val gpui_e_failover_failover_order: String get() = Tr.s(2517) + val gpui_e_failover_applies_to_all_threads_bots: String get() = Tr.s(2518) + val gpui_e_failover_not_installed_on_this_machine: String get() = Tr.s(2519) + val gpui_e_failover_its_own_sign_in_on: String get() = Tr.s(2520) + val gpui_e_failover_account: String get() = Tr.s(2521) + fun gpui_e_failover_accounts_the_one_with_the(n: Any): String = Tr.f(2522, arrayOf(n)) + val gpui_e_failover_default_order: String get() = Tr.s(2523) + val gpui_e_failover_use_the_default_order: String get() = Tr.s(2524) + val gpui_e_failover_choose_an_installed_provider_and: String get() = Tr.s(2525) + val gpui_e_failover_add_to_the_order: String get() = Tr.s(2526) + val ring_ring: String get() = Tr.s(2527) + val ring_pebble_index_ring: String get() = Tr.s(2528) + val ring_test_event: String get() = Tr.s(2529) + val ring_recordings: String get() = Tr.s(2530) + val ring_search_what_you_said: String get() = Tr.s(2531) + val ring_copy_header: String get() = Tr.s(2532) + val ring_copy_both: String get() = Tr.s(2533) + val ring_set_up_again: String get() = Tr.s(2534) + val ring_show_all: String get() = Tr.s(2535) + val ring_hear_again_local: String get() = Tr.s(2536) + val ring_hear_again_openai: String get() = Tr.s(2537) + val ring_what_happened: String get() = Tr.s(2538) + val ring_send_again: String get() = Tr.s(2539) + val ring_no_recordings_yet: String get() = Tr.s(2540) + val hub_acct_claude_sync: String get() = Tr.s(2541) + val hub_acct_add_a_claude_sync_token: String get() = Tr.s(2542) + val hub_acct_connected_sync_token: String get() = Tr.s(2543) + val hub_acct_sync_token_ended: String get() = Tr.s(2544) + fun hub_acct_sync_token_ends(`when`: Any): String = Tr.f(2545, arrayOf(`when`)) + val gpui_e_telemetry_notice: String get() = Tr.s(2546) + val voice_cmd_sending: String get() = Tr.s(2547) + val voice_cmd_cleared: String get() = Tr.s(2548) + val voice_cmd_sent: String get() = Tr.s(2549) + val voice_cmd_undo: String get() = Tr.s(2550) + val settings_voice_cmd_send: String get() = Tr.s(2551) + fun settings_voice_cmd_send_note(phrase: Any, now: Any): String = Tr.f(2552, arrayOf(phrase, now)) + val settings_voice_cmd_off: String get() = Tr.s(2553) + val settings_voice_cmd_hint: String get() = Tr.s(2554) + val settings_voice_cmd_default: String get() = Tr.s(2555) + val settings_voice_cmds: String get() = Tr.s(2556) + val settings_voice_cmds_note: String get() = Tr.s(2557) + val voice_cmd_scratch: String get() = Tr.s(2558) + val voice_cmd_newline: String get() = Tr.s(2559) + val voice_cmd_cancel: String get() = Tr.s(2560) + val settings_voice_auto: String get() = Tr.s(2561) + val settings_voice_auto_note: String get() = Tr.s(2562) + fun voice_cmd_secs(s: Any): String = Tr.f(2563, arrayOf(s)) + val voice_eot_sending: String get() = Tr.s(2564) + val voice_eot_hold: String get() = Tr.s(2565) + val settings_voice_eot: String get() = Tr.s(2566) + val settings_voice_eot_note: String get() = Tr.s(2567) + val settings_voice_eot_eager: String get() = Tr.s(2568) + fun settings_voice_eot_eager_note(now: Any): String = Tr.f(2569, arrayOf(now)) + fun settings_voice_eot_eager_learned(now: Any, nudge: Any, sent: Any, undone: Any): String = Tr.f(2570, arrayOf(now, nudge, sent, undone)) + val settings_voice_eot_reset: String get() = Tr.s(2571) + val settings_voice_jev: String get() = Tr.s(2572) + val settings_voice_jev_set: String get() = Tr.s(2573) + val settings_voice_jev_unset: String get() = Tr.s(2574) + val settings_voice_jev_key: String get() = Tr.s(2575) + val settings_voice_jev_use: String get() = Tr.s(2576) + val settings_voice_jev_test: String get() = Tr.s(2577) + val settings_voice_jev_model: String get() = Tr.s(2578) + val settings_voice_jev_check: String get() = Tr.s(2579) + fun settings_voice_jev_failed(e: Any): String = Tr.f(2580, arrayOf(e)) + fun settings_voice_jev_result(a: Any, ams: Any, b: Any, bms: Any): String = Tr.f(2581, arrayOf(a, ams, b, bms)) + fun settings_voice_jev_last(ms: Any): String = Tr.f(2582, arrayOf(ms)) + fun settings_voice_jev_fallback(e: Any): String = Tr.f(2583, arrayOf(e)) + fun voice_eot_eager_label(t: Any): String = Tr.f(2584, arrayOf(t)) + fun voice_eot_default_label(t: Any): String = Tr.f(2585, arrayOf(t)) + fun voice_eot_patient_label(t: Any): String = Tr.f(2586, arrayOf(t)) + val voice_always_listening: String get() = Tr.s(2587) + val voice_always_paused: String get() = Tr.s(2588) + val voice_always_muted: String get() = Tr.s(2589) + val keys_always: String get() = Tr.s(2590) + val voice_always_status: String get() = Tr.s(2591) + fun voice_always_note_paused(why: Any): String = Tr.f(2592, arrayOf(why)) + val settings_voice_always: String get() = Tr.s(2593) + val settings_voice_always_note: String get() = Tr.s(2594) + val settings_voice_always_start: String get() = Tr.s(2595) + val settings_voice_always_start_note: String get() = Tr.s(2596) + val settings_voice_always_word1: String get() = Tr.s(2597) + val settings_voice_always_word2: String get() = Tr.s(2598) + val settings_voice_always_ms: String get() = Tr.s(2599) + val settings_voice_always_pause: String get() = Tr.s(2600) + val settings_voice_always_pause_note: String get() = Tr.s(2601) + fun settings_voice_always_pause_note2(apps: Any): String = Tr.f(2602, arrayOf(apps)) + val settings_voice_always_ignore: String get() = Tr.s(2603) + val settings_voice_always_lock: String get() = Tr.s(2604) + val settings_voice_always_call: String get() = Tr.s(2605) + val settings_voice_always_away: String get() = Tr.s(2606) + val settings_voice_always_saveapps: String get() = Tr.s(2607) + val settings_voice_always_target: String get() = Tr.s(2608) + val settings_voice_always_target_note: String get() = Tr.s(2609) + val settings_voice_always_open: String get() = Tr.s(2610) + val settings_voice_speaker: String get() = Tr.s(2611) + fun settings_voice_speaker_on(n: Any): String = Tr.f(2612, arrayOf(n)) + fun settings_voice_speaker_learning(n: Any, k: Any): String = Tr.f(2613, arrayOf(n, k)) + val settings_voice_speaker_reenrol: String get() = Tr.s(2614) + val voice_always_pill_listening: String get() = Tr.s(2615) + val voice_always_pill_paused: String get() = Tr.s(2616) + val voice_always_pill_listen: String get() = Tr.s(2617) + fun voice_mark_tip(stt: Any, conf: Any): String = Tr.f(2618, arrayOf(stt, conf)) + fun voice_mark_unsure(words: Any): String = Tr.f(2619, arrayOf(words)) + val voice_mark_edited: String get() = Tr.s(2620) + val gpui_side_old_chats_that_belong_to: String get() = Tr.s(2621) + val gpui_side_group_projects: String get() = Tr.s(2622) + val gpui_side_on_projects_with_nothing_going: String get() = Tr.s(2623) + val gpui_side_no_group: String get() = Tr.s(2624) + val gpui_e_freecad_install: String get() = Tr.s(2625) + val gpui_e_freecad_ask: String get() = Tr.s(2626) + val gpui_e_freecad_installing: String get() = Tr.s(2627) + val gpui_e_freecad_page: String get() = Tr.s(2628) + fun gpui_e_freecad_ask_note(into: Any): String = Tr.f(2629, arrayOf(into)) + val gpui_e_freecad_offer: String get() = Tr.s(2630) + val gpui_e_picker_clone_hint: String get() = Tr.s(2631) + fun gpui_e_picker_clone_typed(origin: Any): String = Tr.f(2632, arrayOf(origin)) + val settings_git_page: String get() = Tr.s(2633) + val settings_git_autopush: String get() = Tr.s(2634) + val settings_git_autopush_note: String get() = Tr.s(2635) + val settings_git_notice: String get() = Tr.s(2636) + val settings_git_offbranch: String get() = Tr.s(2637) + val settings_git_offbranch_note: String get() = Tr.s(2638) + val settings_browser_start: String get() = Tr.s(2639) + val settings_browser_start_note: String get() = Tr.s(2640) + val settings_browser_opens: String get() = Tr.s(2641) + val settings_browser_reset: String get() = Tr.s(2642) + val settings_browser_blank: String get() = Tr.s(2643) + fun settings_browser_now_default(url: Any): String = Tr.f(2644, arrayOf(url)) + val settings_browser_now_blank: String get() = Tr.s(2645) + fun settings_browser_now(url: Any): String = Tr.f(2646, arrayOf(url)) + val settings_browser_bad: String get() = Tr.s(2647) + val gpui_f_group_install: String get() = Tr.s(2648) + val gpui_f_group_agents: String get() = Tr.s(2649) + val gpui_f_group_cad: String get() = Tr.s(2650) + val gpui_f_group_devices: String get() = Tr.s(2651) + val gpui_f_group_first: String get() = Tr.s(2652) + val gpui_f_group_tour: String get() = Tr.s(2653) + fun gpui_f_counter(i: Number, n: Number): String = Tr.f(2654, arrayOf(i, n)) + fun gpui_f_progress(d: Number, n: Number): String = Tr.f(2655, arrayOf(d, n)) + val gpui_f_next: String get() = Tr.s(2656) + val gpui_f_skip_step: String get() = Tr.s(2657) + val gpui_f_finish_later: String get() = Tr.s(2658) + val gpui_f_end_setup: String get() = Tr.s(2659) + val gpui_f_finish_setup: String get() = Tr.s(2660) + val gpui_f_welcome: String get() = Tr.s(2661) + val gpui_f_welcome_body: String get() = Tr.s(2662) + val gpui_f_installed: String get() = Tr.s(2663) + fun gpui_f_install_body_linux(version: Any): String = Tr.f(2664, arrayOf(version)) + fun gpui_f_install_body_darwin(version: Any): String = Tr.f(2665, arrayOf(version)) + fun gpui_f_install_body_windows(version: Any): String = Tr.f(2666, arrayOf(version)) + val gpui_f_program: String get() = Tr.s(2667) + val gpui_f_terminal_command: String get() = Tr.s(2668) + fun gpui_f_found_at(path: Any): String = Tr.f(2669, arrayOf(path)) + val gpui_f_path_fix: String get() = Tr.s(2670) + val gpui_f_path_fix_windows: String get() = Tr.s(2671) + val gpui_f_updates: String get() = Tr.s(2672) + val gpui_f_updates_note: String get() = Tr.s(2673) + val gpui_f_home_title: String get() = Tr.s(2674) + val gpui_f_home_body: String get() = Tr.s(2675) + val gpui_f_data_folder: String get() = Tr.s(2676) + fun gpui_f_hub_listens(addr: Any): String = Tr.f(2677, arrayOf(addr)) + val gpui_f_other_folder: String get() = Tr.s(2678) + val gpui_f_other_folder_note: String get() = Tr.s(2679) + val gpui_f_choose_folder: String get() = Tr.s(2680) + fun gpui_f_installing(label: Any): String = Tr.f(2681, arrayOf(label)) + val gpui_f_starting: String get() = Tr.s(2682) + fun gpui_f_did_not_install(label: Any): String = Tr.f(2683, arrayOf(label)) + fun gpui_f_install_label(label: Any): String = Tr.f(2684, arrayOf(label)) + val gpui_f_winget_note: String get() = Tr.s(2685) + val gpui_f_runs_codex: String get() = Tr.s(2686) + val gpui_f_runs_vendor: String get() = Tr.s(2687) + fun gpui_f_get_label(label: Any): String = Tr.f(2688, arrayOf(label)) + val gpui_f_opens_download: String get() = Tr.s(2689) + val gpui_f_checking: String get() = Tr.s(2690) + val gpui_f_import_title: String get() = Tr.s(2691) + val gpui_f_import_copied: String get() = Tr.s(2692) + fun gpui_f_import_body(from: Any): String = Tr.f(2693, arrayOf(from)) + val gpui_f_import_nothing: String get() = Tr.s(2694) + val gpui_f_import_nothing_note: String get() = Tr.s(2695) + val gpui_f_import_what: String get() = Tr.s(2696) + val gpui_f_import_notcounted: String get() = Tr.s(2697) + val gpui_f_import_count: String get() = Tr.s(2698) + val gpui_f_import_counting: String get() = Tr.s(2699) + val gpui_f_import_reading: String get() = Tr.s(2700) + val gpui_f_import_nothing_new: String get() = Tr.s(2701) + val gpui_f_import_here_already: String get() = Tr.s(2702) + val gpui_f_import_count_again: String get() = Tr.s(2703) + val gpui_f_import_comes: String get() = Tr.s(2704) + val gpui_f_import_import: String get() = Tr.s(2705) + val gpui_f_import_import_note: String get() = Tr.s(2706) + val gpui_f_import_withkeys: String get() = Tr.s(2707) + val gpui_f_import_withkeys_note: String get() = Tr.s(2708) + val gpui_f_import_importing: String get() = Tr.s(2709) + fun gpui_f_import_events(done: Number, of: Number): String = Tr.f(2710, arrayOf(done, of)) + val gpui_f_import_imported: String get() = Tr.s(2711) + val gpui_f_import_nothing_came: String get() = Tr.s(2712) + val gpui_f_import_again: String get() = Tr.s(2713) + val gpui_f_import_again_note: String get() = Tr.s(2714) + val gpui_f_import_stopped: String get() = Tr.s(2715) + fun gpui_f_import_n_projects(n: Number): String = Tr.f(2716, arrayOf(n)) + fun gpui_f_import_n_threads(t: Number, m: Number): String = Tr.f(2717, arrayOf(t, m)) + fun gpui_f_import_n_newmsgs(m: Number): String = Tr.f(2718, arrayOf(m)) + fun gpui_f_import_n_bots(b: Number, m: Number): String = Tr.f(2719, arrayOf(b, m)) + fun gpui_f_import_n_rooms(r: Number, p: Number): String = Tr.f(2720, arrayOf(r, p)) + fun gpui_f_import_n_routines(n: Number): String = Tr.f(2721, arrayOf(n)) + fun gpui_f_import_n_settings(n: Number): String = Tr.f(2722, arrayOf(n)) + fun gpui_f_import_n_devices(n: Number): String = Tr.f(2723, arrayOf(n)) + fun gpui_f_import_n_subagents(n: Number): String = Tr.f(2724, arrayOf(n)) + val gpui_f_import_nothing_new_dot: String get() = Tr.s(2725) + val gpui_f_note_mailruns: String get() = Tr.s(2726) + fun gpui_f_note_mailruns_text(n: Number): String = Tr.f(2727, arrayOf(n)) + val gpui_f_note_routines: String get() = Tr.s(2728) + fun gpui_f_note_routines_text(n: Number): String = Tr.f(2729, arrayOf(n)) + val gpui_f_note_machines: String get() = Tr.s(2730) + val gpui_f_note_machines_text: String get() = Tr.s(2731) + val gpui_f_note_keys: String get() = Tr.s(2732) + val gpui_f_note_keys_text: String get() = Tr.s(2733) + val gpui_f_note_google: String get() = Tr.s(2734) + val gpui_f_note_google_text: String get() = Tr.s(2735) + val gpui_f_note_clashes: String get() = Tr.s(2736) + fun gpui_f_note_clashes_text(n: Number): String = Tr.f(2737, arrayOf(n)) + val gpui_f_note_fresh: String get() = Tr.s(2738) + val gpui_f_note_fresh_text: String get() = Tr.s(2739) + val gpui_f_note_running: String get() = Tr.s(2740) + val gpui_f_note_running_text: String get() = Tr.s(2741) + val gpui_f_note_botfolder: String get() = Tr.s(2742) + fun gpui_f_note_botfolder_text(name: Any, gb: Any, path: Any): String = Tr.f(2743, arrayOf(name, gb, path)) + val gpui_f_note_notcopied: String get() = Tr.s(2744) + fun gpui_f_note_notcopied_text(path: Any, why: Any): String = Tr.f(2745, arrayOf(path, why)) + val gpui_f_note_signin: String get() = Tr.s(2746) + fun gpui_f_note_signin_text(names: Any): String = Tr.f(2747, arrayOf(names)) + val gpui_f_note_accounts_text: String get() = Tr.s(2748) + fun gpui_f_note_vault_text(why: Any): String = Tr.f(2749, arrayOf(why)) + fun gpui_f_ov_counts(p: Number, pn: Number, t: Number, tn: Number, e: Number, en: Number): String = Tr.f(2750, arrayOf(p, pn, t, tn, e, en)) + fun gpui_f_ov_mb(done: Number, total: Number): String = Tr.f(2751, arrayOf(done, total)) + fun gpui_f_ov_files(n: Number): String = Tr.f(2752, arrayOf(n)) + fun gpui_f_ov_now(what: Any): String = Tr.f(2753, arrayOf(what)) + fun gpui_f_ov_min(n: Number): String = Tr.f(2754, arrayOf(n)) + fun gpui_f_ov_s(n: Number): String = Tr.f(2755, arrayOf(n)) + val gpui_f_ov_measuring: String get() = Tr.s(2756) + val gpui_f_ov_title: String get() = Tr.s(2757) + fun gpui_f_ov_body(what: Any): String = Tr.f(2758, arrayOf(what)) + fun gpui_f_ov_took(n: Number): String = Tr.f(2759, arrayOf(n)) + val gpui_f_ov_here: String get() = Tr.s(2760) + fun gpui_f_ov_failed_in(why: Any, from: Any): String = Tr.f(2761, arrayOf(why, from)) + fun gpui_f_ov_failed(why: Any): String = Tr.f(2762, arrayOf(why)) + val gpui_f_usage_title: String get() = Tr.s(2763) + val gpui_f_usage_body: String get() = Tr.s(2764) + val gpui_f_usage_share: String get() = Tr.s(2765) + val gpui_f_usage_saved: String get() = Tr.s(2766) + val gpui_f_usage_choose: String get() = Tr.s(2767) + fun gpui_f_agent_found_signed(path: Any): String = Tr.f(2768, arrayOf(path)) + fun gpui_f_agent_found_signed_who(path: Any, who: Any): String = Tr.f(2769, arrayOf(path, who)) + fun gpui_f_agent_found_notsigned(path: Any): String = Tr.f(2770, arrayOf(path)) + fun gpui_f_agent_found_howsign(path: Any, cmd: Any): String = Tr.f(2771, arrayOf(path, cmd)) + fun gpui_f_agent_version(version: Any, path: Any): String = Tr.f(2772, arrayOf(version, path)) + fun gpui_f_agent_version_signed(version: Any, path: Any): String = Tr.f(2773, arrayOf(version, path)) + fun gpui_f_agent_version_signed_who(version: Any, path: Any, who: Any): String = Tr.f(2774, arrayOf(version, path, who)) + fun gpui_f_agent_version_notsigned(version: Any, path: Any): String = Tr.f(2775, arrayOf(version, path)) + fun gpui_f_agent_version_howsign(version: Any, path: Any, cmd: Any): String = Tr.f(2776, arrayOf(version, path, cmd)) + val gpui_f_not_installed: String get() = Tr.s(2777) + val gpui_f_or_terminal: String get() = Tr.s(2778) + fun gpui_f_no_install_button(cmd: Any): String = Tr.f(2779, arrayOf(cmd)) + val gpui_f_check_again: String get() = Tr.s(2780) + val gpui_f_check_again_note: String get() = Tr.s(2781) + val gpui_f_check_again_one: String get() = Tr.s(2782) + val gpui_f_claude_title: String get() = Tr.s(2783) + val gpui_f_claude_body: String get() = Tr.s(2784) + val gpui_f_codex_title: String get() = Tr.s(2785) + val gpui_f_codex_body: String get() = Tr.s(2786) + val gpui_f_others_title: String get() = Tr.s(2787) + val gpui_f_others_body: String get() = Tr.s(2788) + fun gpui_f_tool_runs(name: Any, version: Any, path: Any): String = Tr.f(2789, arrayOf(name, version, path)) + fun gpui_f_tool_broken(path: Any, why: Any): String = Tr.f(2790, arrayOf(path, why)) + fun gpui_f_tool_notfound(name: Any): String = Tr.f(2791, arrayOf(name)) + val gpui_f_kicad_body: String get() = Tr.s(2792) + fun gpui_f_kicad_ok_v(version: Any, cli: Any): String = Tr.f(2793, arrayOf(version, cli)) + fun gpui_f_kicad_ok(cli: Any): String = Tr.f(2794, arrayOf(cli)) + val gpui_f_releases: String get() = Tr.s(2795) + fun gpui_f_kicad_auto(version: Any): String = Tr.f(2796, arrayOf(version)) + fun gpui_f_kicad_offer_stock_v(version: Any): String = Tr.f(2797, arrayOf(version)) + val gpui_f_kicad_offer_stock: String get() = Tr.s(2798) + fun gpui_f_kicad_offer_old_v(version: Any): String = Tr.f(2799, arrayOf(version)) + val gpui_f_kicad_offer_old: String get() = Tr.s(2800) + fun gpui_f_kicad_offer_broken_v(version: Any): String = Tr.f(2801, arrayOf(version)) + val gpui_f_kicad_offer_broken: String get() = Tr.s(2802) + fun gpui_f_kicad_nopackage(computer: Any): String = Tr.f(2803, arrayOf(computer)) + fun gpui_f_kicad_found_stock_v(version: Any, cli: Any): String = Tr.f(2804, arrayOf(version, cli)) + fun gpui_f_kicad_found_stock(cli: Any): String = Tr.f(2805, arrayOf(cli)) + fun gpui_f_kicad_found_v(version: Any, cli: Any): String = Tr.f(2806, arrayOf(version, cli)) + fun gpui_f_kicad_found_plain(cli: Any): String = Tr.f(2807, arrayOf(cli)) + val gpui_f_kicad_found: String get() = Tr.s(2808) + val gpui_f_stock_kicad: String get() = Tr.s(2809) + val gpui_f_stock_kicad_note: String get() = Tr.s(2810) + val gpui_f_download_kicad: String get() = Tr.s(2811) + val gpui_f_locate: String get() = Tr.s(2812) + val gpui_f_locate_kicad: String get() = Tr.s(2813) + val gpui_f_use_path: String get() = Tr.s(2814) + val gpui_f_hint_kicad: String get() = Tr.s(2815) + val gpui_f_freecad_body: String get() = Tr.s(2816) + val gpui_f_locate_freecad: String get() = Tr.s(2817) + val gpui_f_hint_freecad: String get() = Tr.s(2818) + val gpui_f_debian: String get() = Tr.s(2819) + val gpui_f_local_code: String get() = Tr.s(2820) + val gpui_f_only_this: String get() = Tr.s(2821) + val gpui_f_machine_title: String get() = Tr.s(2822) + val gpui_f_machine_body: String get() = Tr.s(2823) + val gpui_f_ts_on: String get() = Tr.s(2824) + val gpui_f_ts_off: String get() = Tr.s(2825) + val gpui_f_ts_none: String get() = Tr.s(2826) + val gpui_f_linked_machines: String get() = Tr.s(2827) + val gpui_f_none_yet: String get() = Tr.s(2828) + fun gpui_f_n_linked(n: Number): String = Tr.f(2829, arrayOf(n)) + val gpui_f_phone_title: String get() = Tr.s(2830) + val gpui_f_phone_body: String get() = Tr.s(2831) + val gpui_f_pairing_link: String get() = Tr.s(2832) + val gpui_f_make_another: String get() = Tr.s(2833) + fun gpui_f_short_code(code: Any): String = Tr.f(2834, arrayOf(code)) + val gpui_f_add_device: String get() = Tr.s(2835) + fun gpui_f_invite_failed(e: Any): String = Tr.f(2836, arrayOf(e)) + val gpui_f_invite_note: String get() = Tr.s(2837) + val gpui_f_show_qr: String get() = Tr.s(2838) + val gpui_f_android_app: String get() = Tr.s(2839) + val gpui_f_android_note: String get() = Tr.s(2840) + val gpui_f_download_apk: String get() = Tr.s(2841) + val gpui_f_iphone_app: String get() = Tr.s(2842) + val gpui_f_iphone_note: String get() = Tr.s(2843) + val gpui_f_ts_phone: String get() = Tr.s(2844) + val gpui_f_ts_phone_note: String get() = Tr.s(2845) + val gpui_f_app_store: String get() = Tr.s(2846) + val gpui_f_google_play: String get() = Tr.s(2847) + val gpui_f_paired_devices: String get() = Tr.s(2848) + fun gpui_f_n_paired(n: Number): String = Tr.f(2849, arrayOf(n)) + val gpui_f_remote_title: String get() = Tr.s(2850) + val gpui_f_cont_on: String get() = Tr.s(2851) + val gpui_f_cont_off: String get() = Tr.s(2852) + val gpui_f_remote_body_package: String get() = Tr.s(2853) + fun gpui_f_remote_body_channel(channel: Any): String = Tr.f(2854, arrayOf(channel)) + val gpui_f_cont_restart: String get() = Tr.s(2855) + val gpui_f_open_page: String get() = Tr.s(2856) + val gpui_f_open_page_note: String get() = Tr.s(2857) + val gpui_f_network_updates: String get() = Tr.s(2858) + val gpui_f_project_title: String get() = Tr.s(2859) + val gpui_f_project_body: String get() = Tr.s(2860) + val gpui_f_add_another: String get() = Tr.s(2861) + val gpui_f_path_folder: String get() = Tr.s(2862) + val gpui_f_add_project: String get() = Tr.s(2863) + val gpui_f_create_project: String get() = Tr.s(2864) + val gpui_f_full_path: String get() = Tr.s(2865) + val gpui_f_thread_title: String get() = Tr.s(2866) + val gpui_f_thread_body: String get() = Tr.s(2867) + fun gpui_f_new_thread_in(project: Any): String = Tr.f(2868, arrayOf(project)) + val gpui_f_new_thread_note: String get() = Tr.s(2869) + val gpui_f_start_thread: String get() = Tr.s(2870) + val gpui_f_first_message: String get() = Tr.s(2871) + val gpui_f_project_first: String get() = Tr.s(2872) + val gpui_f_go_project: String get() = Tr.s(2873) + fun gpui_f_n_so_far(n: Number): String = Tr.f(2874, arrayOf(n)) + val gpui_f_tour_viewers: String get() = Tr.s(2875) + val gpui_f_tour_viewers_body: String get() = Tr.s(2876) + val gpui_f_key_side: String get() = Tr.s(2877) + val gpui_f_key_diff: String get() = Tr.s(2878) + val gpui_f_tour_threed: String get() = Tr.s(2879) + val gpui_f_tour_threed_body: String get() = Tr.s(2880) + val gpui_f_key_threed: String get() = Tr.s(2881) + val gpui_f_tour_mech: String get() = Tr.s(2882) + val gpui_f_tour_mech_body: String get() = Tr.s(2883) + val gpui_f_tour_browser_body: String get() = Tr.s(2884) + val gpui_f_tour_thread: String get() = Tr.s(2885) + fun gpui_f_tour_thread_body(m: Any): String = Tr.f(2886, arrayOf(m)) + val gpui_f_tour_bots_body: String get() = Tr.s(2887) + val gpui_f_make_bot: String get() = Tr.s(2888) + val gpui_f_opens_form: String get() = Tr.s(2889) + val gpui_f_new_bot: String get() = Tr.s(2890) + val gpui_f_tour_space: String get() = Tr.s(2891) + val gpui_f_tour_space_body: String get() = Tr.s(2892) + val gpui_f_tour_rooms_body: String get() = Tr.s(2893) + val gpui_f_make_room: String get() = Tr.s(2894) + val gpui_f_new_room: String get() = Tr.s(2895) + val gpui_f_tour_routines_body: String get() = Tr.s(2896) + val gpui_f_tour_palette: String get() = Tr.s(2897) + fun gpui_f_tour_palette_body(m: Any): String = Tr.f(2898, arrayOf(m)) + val gpui_f_key_agent: String get() = Tr.s(2899) + val gpui_f_key_prevnext: String get() = Tr.s(2900) + fun gpui_f_key_prevnext_keys(m: Any): String = Tr.f(2901, arrayOf(m)) + val gpui_f_key_uber: String get() = Tr.s(2902) + val gpui_f_try_it: String get() = Tr.s(2903) + val gpui_f_try_palette: String get() = Tr.s(2904) + val gpui_f_open_palette: String get() = Tr.s(2905) + val gpui_f_try_settings: String get() = Tr.s(2906) + val gpui_f_open_settings: String get() = Tr.s(2907) + fun gpui_f_tour_settings_body(pages: Any): String = Tr.f(2908, arrayOf(pages)) + val gpui_f_uber_title: String get() = Tr.s(2909) + fun gpui_f_uber_is(name: Any): String = Tr.f(2910, arrayOf(name)) + val gpui_f_uber_pick: String get() = Tr.s(2911) + val gpui_f_uber_create: String get() = Tr.s(2912) + fun gpui_f_uber_make(name: Any): String = Tr.f(2913, arrayOf(name)) + val gpui_f_uber_create_btn: String get() = Tr.s(2914) + val gpui_f_all_set: String get() = Tr.s(2915) + val gpui_f_still_open: String get() = Tr.s(2916) + val gpui_f_skipped_dot: String get() = Tr.s(2917) + val gpui_f_not_done_dot: String get() = Tr.s(2918) + val gpui_f_skipped: String get() = Tr.s(2919) + val gpui_f_not_done: String get() = Tr.s(2920) + val gpui_f_setup_finished: String get() = Tr.s(2921) + fun gpui_f_setup_finished_note(d: Number, n: Number): String = Tr.f(2922, arrayOf(d, n)) + val gpui_f_run_again: String get() = Tr.s(2923) + val gpui_f_setup_unfinished: String get() = Tr.s(2924) + val gpui_f_resume: String get() = Tr.s(2925) + val gpui_f_start_again: String get() = Tr.s(2926) + val gpui_f_setup_note: String get() = Tr.s(2927) + val gpui_f_run_setup: String get() = Tr.s(2928) + val gpui_f_name_bpkicad: String get() = Tr.s(2929) + val gpui_f_name_kicad: String get() = Tr.s(2930) + val gpui_f_name_freecad: String get() = Tr.s(2931) + val gpui_f_name_claude: String get() = Tr.s(2932) + val gpui_f_name_codex: String get() = Tr.s(2933) + val gpui_f_name_grok: String get() = Tr.s(2934) + val gpui_f_name_muse: String get() = Tr.s(2935) + val gpui_f_name_opencode: String get() = Tr.s(2936) + val gpui_f_name_pi: String get() = Tr.s(2937) + val gpui_f_name_omp: String get() = Tr.s(2938) + val gpui_f_name_fedora: String get() = Tr.s(2939) + val gpui_f_name_arch: String get() = Tr.s(2940) + val gpui_f_name_homebrew: String get() = Tr.s(2941) + val gpui_f_name_winget: String get() = Tr.s(2942) + fun gpui_f_fold_tools(n: Number, tools: Any): String = Tr.f(2943, arrayOf(n, tools)) + fun gpui_f_fold_tools_steps(n: Number, tools: Any, d: Number): String = Tr.f(2944, arrayOf(n, tools, d)) + fun gpui_f_fold_steps(n: Number, d: Number): String = Tr.f(2945, arrayOf(n, d)) + fun gpui_f_fold_live(n: Number, what: Any): String = Tr.f(2946, arrayOf(n, what)) + fun gpui_f_fold_live_steps(n: Number, d: Number, what: Any): String = Tr.f(2947, arrayOf(n, d, what)) + val gpui_f_restart: String get() = Tr.s(2948) + val gpui_f_not_read: String get() = Tr.s(2949) + val gpui_f_needs: String get() = Tr.s(2950) + fun gpui_f_needs_head(head: Any): String = Tr.f(2951, arrayOf(head)) + val gpui_f_type_here: String get() = Tr.s(2952) + val gpui_f_or_type: String get() = Tr.s(2953) + val gpui_f_quote_files: String get() = Tr.s(2954) + val gpui_f_dictate: String get() = Tr.s(2955) + val gpui_f_inactive: String get() = Tr.s(2956) + fun gpui_f_tool_runs_nover(name: Any, path: Any): String = Tr.f(2957, arrayOf(name, path)) + val gpui_f2_aon_boat_learn: String get() = Tr.s(2958) + val gpui_f2_uberbot_what: String get() = Tr.s(2959) + val gpui_acct_account_name_optional: String get() = Tr.s(2960) + val gpui_follow_button: String get() = Tr.s(2961) + val gpui_follow_button_tip: String get() = Tr.s(2962) + fun gpui_follow_route(page: Any, net: Any, near: Any): String = Tr.f(2963, arrayOf(page, net, near)) + fun gpui_follow_edit(page: Any, what: Any): String = Tr.f(2964, arrayOf(page, what)) + fun gpui_follow_near(ref: Any): String = Tr.f(2965, arrayOf(ref)) + val gpui_follow_wait: String get() = Tr.s(2966) + val gpui_follow_paused: String get() = Tr.s(2967) + val gpui_follow_resume: String get() = Tr.s(2968) + fun gpui_follow_held(page: Any): String = Tr.f(2969, arrayOf(page)) + val android_mgmt_all: String get() = Tr.s(2970) + val android_mgmt_judged: String get() = Tr.s(2971) + val android_mgmt_fix: String get() = Tr.s(2972) + val android_mgmt_sent: String get() = Tr.s(2973) + val android_mcp: String get() = Tr.s(2974) + val android_alerts_ask: String get() = Tr.s(2975) + val android_alerts_allow: String get() = Tr.s(2976) + val android_alerts_later: String get() = Tr.s(2977) + val android_viewerbg: String get() = Tr.s(2978) + val android_viewerbg_auto: String get() = Tr.s(2979) + val android_viewerbg_light: String get() = Tr.s(2980) + val android_viewerbg_dark: String get() = Tr.s(2981) + val android_viewerbg_custom: String get() = Tr.s(2982) + val android_viewerbg_hex: String get() = Tr.s(2983) + val android_viewerbg_note: String get() = Tr.s(2984) + val android_state_working: String get() = Tr.s(2985) + val android_state_inactive: String get() = Tr.s(2986) + val android_state_finished: String get() = Tr.s(2987) + val android_state_settled: String get() = Tr.s(2988) + val android_state_stalled: String get() = Tr.s(2989) + val android_state_monitoring: String get() = Tr.s(2990) + val android_ago_now: String get() = Tr.s(2991) + fun android_ago_m(n: Any): String = Tr.f(2992, arrayOf(n)) + fun android_ago_h(n: Any): String = Tr.f(2993, arrayOf(n)) + fun android_ago_d(n: Any): String = Tr.f(2994, arrayOf(n)) + val android_room_gone: String get() = Tr.s(2995) + fun android_conn_connecting(hub: Any): String = Tr.f(2996, arrayOf(hub)) + val android_conn_offline: String get() = Tr.s(2997) + val android_hub: String get() = Tr.s(2998) + val android_hub_add: String get() = Tr.s(2999) + val android_pair_repair: String get() = Tr.s(3000) + val android_pair_revoked: String get() = Tr.s(3001) + val android_pair_paste: String get() = Tr.s(3002) + val android_pair_photo: String get() = Tr.s(3003) + val android_pair_other: String get() = Tr.s(3004) + val android_pair_code_lead: String get() = Tr.s(3005) + val android_pair_code: String get() = Tr.s(3006) + val android_pair_code_bad: String get() = Tr.s(3007) + val android_pair_link_bad: String get() = Tr.s(3008) + val android_pair_ask: String get() = Tr.s(3009) + val android_pair_ask_note: String get() = Tr.s(3010) + val android_terminals: String get() = Tr.s(3011) + val android_search_hint: String get() = Tr.s(3012) + val android_projects_none: String get() = Tr.s(3013) + val android_project_add: String get() = Tr.s(3014) + val android_kind_uberbot: String get() = Tr.s(3015) + val android_kind_bot: String get() = Tr.s(3016) + val android_kind_room: String get() = Tr.s(3017) + fun android_thread_new_in(project: Any): String = Tr.f(3018, arrayOf(project)) + val android_threads_none: String get() = Tr.s(3019) + fun android_kids_hide(n: Number): String = Tr.f(3020, arrayOf(n)) + fun android_kids_show(n: Number): String = Tr.f(3021, arrayOf(n)) + fun android_work_head(word: Any): String = Tr.f(3022, arrayOf(word)) + fun android_lock_waiting(n: Any): String = Tr.f(3023, arrayOf(n)) + val android_state_head: String get() = Tr.s(3024) + val android_unsettle: String get() = Tr.s(3025) + val android_mic_off: String get() = Tr.s(3026) + val android_picture_bad: String get() = Tr.s(3027) + val android_buy_failed: String get() = Tr.s(3028) + val android_photo_bad: String get() = Tr.s(3029) + val android_camera_failed: String get() = Tr.s(3030) + val android_camera_off: String get() = Tr.s(3031) + val android_message_gone: String get() = Tr.s(3032) + val android_load_earlier: String get() = Tr.s(3033) + val android_thread_empty: String get() = Tr.s(3034) + val android_composer_hint: String get() = Tr.s(3035) + val android_pictures_old: String get() = Tr.s(3036) + val android_photo_choose: String get() = Tr.s(3037) + val android_photo_take: String get() = Tr.s(3038) + val android_failed_generic: String get() = Tr.s(3039) + val android_secret_new: String get() = Tr.s(3040) + fun android_secret_named(name: Any): String = Tr.f(3041, arrayOf(name)) + val android_secret_paste: String get() = Tr.s(3042) + val android_secret_refused: String get() = Tr.s(3043) + val android_secret_notneeded: String get() = Tr.s(3044) + val android_send_retry: String get() = Tr.s(3045) + val android_ask_open: String get() = Tr.s(3046) + val android_ask_done: String get() = Tr.s(3047) + val android_ask_answer: String get() = Tr.s(3048) + fun android_ask_answered(answer: Any): String = Tr.f(3049, arrayOf(answer)) + val android_hub_use: String get() = Tr.s(3050) + val native_hub_home: String get() = Tr.s(3051) + val native_hub_unreachable: String get() = Tr.s(3052) + val android_online: String get() = Tr.s(3053) + fun android_offline(why: Any): String = Tr.f(3054, arrayOf(why)) + val android_accounts: String get() = Tr.s(3055) + fun android_hub_forget_ask(hub: Any): String = Tr.f(3056, arrayOf(hub)) + val android_hub_forget_note: String get() = Tr.s(3057) + val android_improve: String get() = Tr.s(3058) + val android_alerts_head: String get() = Tr.s(3059) + val android_alerts_note: String get() = Tr.s(3060) + val android_quiet_head: String get() = Tr.s(3061) + fun android_quiet_range(from: Any, to: Any): String = Tr.f(3062, arrayOf(from, to)) + val android_urgent_head: String get() = Tr.s(3063) + val android_quiet_note: String get() = Tr.s(3064) + val android_unpair: String get() = Tr.s(3065) + val android_updates_head: String get() = Tr.s(3066) + val android_option_beta: String get() = Tr.s(3067) + val android_folder_use: String get() = Tr.s(3068) + fun android_thread_new_title(project: Any): String = Tr.f(3069, arrayOf(project)) + val android_thread_new_hint: String get() = Tr.s(3070) + val android_start: String get() = Tr.s(3071) + val android_improve_ask: String get() = Tr.s(3072) + val android_improve_note: String get() = Tr.s(3073) + val android_improve_github: String get() = Tr.s(3074) + val android_project_head: String get() = Tr.s(3075) + val android_improve_thread: String get() = Tr.s(3076) + val android_improve_sent: String get() = Tr.s(3077) + val android_order_head: String get() = Tr.s(3078) + fun android_order_named(name: Any): String = Tr.f(3079, arrayOf(name)) + val android_buy_now: String get() = Tr.s(3080) + val android_design_change: String get() = Tr.s(3081) + val android_live_working: String get() = Tr.s(3082) + fun android_live_count(n: Number): String = Tr.f(3083, arrayOf(n)) + val android_connecting: String get() = Tr.s(3084) + val android_hub_unreachable: String get() = Tr.s(3085) + val android_pair_code_address: String get() = Tr.s(3086) + val android_pair_link_partial: String get() = Tr.s(3087) + val android_pair_link_none: String get() = Tr.s(3088) + fun android_fail_http(code: Any): String = Tr.f(3089, arrayOf(code)) + fun android_fail_reach(hub: Any): String = Tr.f(3090, arrayOf(hub)) + fun android_fail_timeout(hub: Any): String = Tr.f(3091, arrayOf(hub)) + fun android_fail_dns(hub: Any): String = Tr.f(3092, arrayOf(hub)) + val android_offline_word: String get() = Tr.s(3093) + val android_offline_cap: String get() = Tr.s(3094) + val android_proto_old: String get() = Tr.s(3095) + val android_hub_refused: String get() = Tr.s(3096) + val android_hub_noanswer: String get() = Tr.s(3097) + val android_thinking: String get() = Tr.s(3098) + val android_buy_it: String get() = Tr.s(3099) + val android_layers: String get() = Tr.s(3100) + val android_link_old: String get() = Tr.s(3101) + val android_link_nohere: String get() = Tr.s(3102) + val android_link_failed: String get() = Tr.s(3103) + val android_link_offline: String get() = Tr.s(3104) + val android_copied: String get() = Tr.s(3105) + fun android_history_title(n: Any): String = Tr.f(3106, arrayOf(n)) + fun android_settled_title(n: Any): String = Tr.f(3107, arrayOf(n)) + val android_dictate: String get() = Tr.s(3108) + val android_voice_spelling: String get() = Tr.s(3109) + val android_voice_head: String get() = Tr.s(3110) + val android_link_noapp: String get() = Tr.s(3111) + val android_star: String get() = Tr.s(3112) + val android_rescue_restart: String get() = Tr.s(3113) + val android_rescue_pairing: String get() = Tr.s(3114) + val android_rescue_asking: String get() = Tr.s(3115) + val android_rescue_norestart: String get() = Tr.s(3116) + val android_rescue_nostatus: String get() = Tr.s(3117) + val android_rescue_sent: String get() = Tr.s(3118) + val android_rescue_refused: String get() = Tr.s(3119) + val android_rescue_old: String get() = Tr.s(3120) + val android_rescue_unreachable: String get() = Tr.s(3121) + val android_rescue_noanswer: String get() = Tr.s(3122) + fun android_rescue_still(status: Any): String = Tr.f(3123, arrayOf(status)) + val android_rescue_waiting: String get() = Tr.s(3124) + fun android_rescue_is(status: Any): String = Tr.f(3125, arrayOf(status)) + val android_rescue_down: String get() = Tr.s(3126) + val android_rescue_safedegraded: String get() = Tr.s(3127) + val android_rescue_degraded: String get() = Tr.s(3128) + val android_rescue_safe: String get() = Tr.s(3129) + val android_rescue_up: String get() = Tr.s(3130) + val android_pair_local: String get() = Tr.s(3131) + val android_pair_wrong: String get() = Tr.s(3132) + val android_pair_expired: String get() = Tr.s(3133) + val android_pair_used: String get() = Tr.s(3134) + val android_pair_revokedcode: String get() = Tr.s(3135) + val android_pair_limited: String get() = Tr.s(3136) + val android_pair_required: String get() = Tr.s(3137) + val android_pair_unreachable: String get() = Tr.s(3138) + val android_pad_pen_hint: String get() = Tr.s(3139) + val android_pad_box_hint: String get() = Tr.s(3140) + val android_pad_eraser_hint: String get() = Tr.s(3141) + val android_pad_pen: String get() = Tr.s(3142) + val android_pad_box: String get() = Tr.s(3143) + val android_pad_eraser: String get() = Tr.s(3144) + val android_pad_paper: String get() = Tr.s(3145) + val android_undo: String get() = Tr.s(3146) + val android_pad_length: String get() = Tr.s(3147) + val android_machines_head: String get() = Tr.s(3148) + val android_devices_head: String get() = Tr.s(3149) + val android_mic_failed: String get() = Tr.s(3150) + val android_dictation_failed: String get() = Tr.s(3151) + val android_paste: String get() = Tr.s(3152) + val android_term_copy: String get() = Tr.s(3153) + fun android_terminals_in(project: Any): String = Tr.f(3154, arrayOf(project)) + val android_term_new: String get() = Tr.s(3155) + val android_terms_none: String get() = Tr.s(3156) + val android_term_failed: String get() = Tr.s(3157) + fun android_term_exited(code: Any): String = Tr.f(3158, arrayOf(code)) + val android_term_kind_shell: String get() = Tr.s(3159) + fun android_mesh_previous(why: Any): String = Tr.f(3160, arrayOf(why)) + val android_mesh_decoding: String get() = Tr.s(3161) + val android_mesh_bad: String get() = Tr.s(3162) + val android_viewer_a11y: String get() = Tr.s(3163) + val android_search_inthread: String get() = Tr.s(3164) + val android_thread_detach: String get() = Tr.s(3165) + val android_delete_more: String get() = Tr.s(3166) + val android_thread_rename: String get() = Tr.s(3167) + fun android_thread_delete_ask(title: Any): String = Tr.f(3168, arrayOf(title)) + val android_thread_delete: String get() = Tr.s(3169) + val android_keep: String get() = Tr.s(3170) + val android_badge_more: String get() = Tr.s(3171) + val android_project_remove_more: String get() = Tr.s(3172) + val android_project_rename: String get() = Tr.s(3173) + fun android_project_remove_ask(title: Any): String = Tr.f(3174, arrayOf(title)) + val android_searching: String get() = Tr.s(3175) + fun android_search_none(q: Any): String = Tr.f(3176, arrayOf(q)) + fun android_search_project(title: Any): String = Tr.f(3177, arrayOf(title)) + val android_history_head: String get() = Tr.s(3178) + val android_done: String get() = Tr.s(3179) + val android_you: String get() = Tr.s(3180) + val android_agent: String get() = Tr.s(3181) + fun android_room_post_to(room: Any): String = Tr.f(3182, arrayOf(room)) + val android_post: String get() = Tr.s(3183) + val android_find_head: String get() = Tr.s(3184) + val android_find_hint: String get() = Tr.s(3185) + fun android_find_none(q: Any): String = Tr.f(3186, arrayOf(q)) + val android_accounts_none: String get() = Tr.s(3187) + val android_account_name_hint: String get() = Tr.s(3188) + val android_account_add: String get() = Tr.s(3189) + val android_account: String get() = Tr.s(3190) + val android_signin_open: String get() = Tr.s(3191) + val android_copy_code: String get() = Tr.s(3192) + val android_code_paste: String get() = Tr.s(3193) + val android_code_send: String get() = Tr.s(3194) + val android_viewer_split: String get() = Tr.s(3195) + fun android_viewer_title(title: Any): String = Tr.f(3196, arrayOf(title)) + val android_viewer_board: String get() = Tr.s(3197) + val android_viewer_boards: String get() = Tr.s(3198) + val android_viewer_sheet: String get() = Tr.s(3199) + val android_viewer_sheets: String get() = Tr.s(3200) + fun android_viewer_sheets_n(n: Number): String = Tr.f(3201, arrayOf(n)) + fun ios_viewer_sheets_n(n: Number): String = Tr.f(3202, arrayOf(n)) + val android_viewer_change: String get() = Tr.s(3203) + val android_viewer_find: String get() = Tr.s(3204) + val android_viewer_noboard: String get() = Tr.s(3205) + val android_viewer_nosch: String get() = Tr.s(3206) + fun android_viewer_piece(at: Any): String = Tr.f(3207, arrayOf(at)) + val android_viewer_loading3d: String get() = Tr.s(3208) + val android_compare_close: String get() = Tr.s(3209) + val android_compare_none: String get() = Tr.s(3210) + val android_mech_none: String get() = Tr.s(3211) + val android_folder_empty: String get() = Tr.s(3212) + val android_file_bad: String get() = Tr.s(3213) + val android_file_noimage: String get() = Tr.s(3214) + fun android_file_nopreview(size: Any): String = Tr.f(3215, arrayOf(size)) + val android_pdf_bad: String get() = Tr.s(3216) + fun android_pdf_page(n: Any, total: Any): String = Tr.f(3217, arrayOf(n, total)) + val android_browser_takeover: String get() = Tr.s(3218) + val android_browser_keys: String get() = Tr.s(3219) + val android_browser_handback: String get() = Tr.s(3220) + val android_browser_page: String get() = Tr.s(3221) + val android_browser_none: String get() = Tr.s(3222) + val android_browser_driving: String get() = Tr.s(3223) + val android_changes_head: String get() = Tr.s(3224) + val android_diff_nogit: String get() = Tr.s(3225) + val android_diff_none: String get() = Tr.s(3226) + val android_checks_run: String get() = Tr.s(3227) + val android_nothing: String get() = Tr.s(3228) + val android_comments_none: String get() = Tr.s(3229) + val android_resolved: String get() = Tr.s(3230) + val android_reopen: String get() = Tr.s(3231) + val android_resolve: String get() = Tr.s(3232) + val android_comment_hint: String get() = Tr.s(3233) + fun android_probe_lit(n: Any): String = Tr.f(3234, arrayOf(n)) + fun android_fold_running(what: Any): String = Tr.f(3235, arrayOf(what)) + val android_hub_voice_unsupported_here: String get() = Tr.s(3236) + val android_hub_voice_mic_note_plain: String get() = Tr.s(3237) + fun android_hub_voice_mic_note_default(device: Any): String = Tr.f(3238, arrayOf(device)) + fun android_hub_voice_mic_note(device: Any): String = Tr.f(3239, arrayOf(device)) + val android_hub_voice_engine_pending: String get() = Tr.s(3240) + val android_hub_voice_dict_empty: String get() = Tr.s(3241) + val android_hub_voice_learned_empty: String get() = Tr.s(3242) + val android_hub_voice_pebble: String get() = Tr.s(3243) + val android_hub_voice_pebble_note: String get() = Tr.s(3244) + val android_hub_voice_noaudio_mic: String get() = Tr.s(3245) + val android_hub_voice_silent_mic: String get() = Tr.s(3246) + val android_hub_voice_skip: String get() = Tr.s(3247) + fun android_hub_voice_heard_many(word: Any, count: Any): String = Tr.f(3248, arrayOf(word, count)) + fun android_hub_voice_dropped(heard: Any): String = Tr.f(3249, arrayOf(heard)) + val android_hub_voice_err_copy: String get() = Tr.s(3250) + val android_hub_voice_err_busy: String get() = Tr.s(3251) + val android_hub_voice_err_setting: String get() = Tr.s(3252) + val android_hub_voice_err_action: String get() = Tr.s(3253) + val android_hub_voice_err_request: String get() = Tr.s(3254) + val android_hub_voice_err_term: String get() = Tr.s(3255) + val android_hub_voice_err_key: String get() = Tr.s(3256) + val android_hub_voice_err_write: String get() = Tr.s(3257) + val android_hub_voice_err_start: String get() = Tr.s(3258) + val android_hub_voice_err_stopped: String get() = Tr.s(3259) + val android_hub_voice_err_missing: String get() = Tr.s(3260) + fun android_hub_entry_step_files(files: Any): String = Tr.f(3261, arrayOf(files)) + fun android_hub_entry_step_base(files: Any): String = Tr.f(3262, arrayOf(files)) + val android_hub_entry_noreason: String get() = Tr.s(3263) + val android_hub_entry_retired: String get() = Tr.s(3264) + fun android_hub_viewer_layer(name: Any): String = Tr.f(3265, arrayOf(name)) + val android_hub_viewer_pads: String get() = Tr.s(3266) + val android_hub_viewer_vias: String get() = Tr.s(3267) + val android_hub_viewer_holes: String get() = Tr.s(3268) + val android_hub_viewer_margin: String get() = Tr.s(3269) + val android_hub_viewer_sch_page: String get() = Tr.s(3270) + val android_hub_viewer_sch_sheetfill: String get() = Tr.s(3271) + val android_hub_viewer_sch_bodyfill: String get() = Tr.s(3272) + val android_hub_viewer_sch_graphic: String get() = Tr.s(3273) + val android_hub_viewer_sch_note: String get() = Tr.s(3274) + val android_hub_viewer_sch_body: String get() = Tr.s(3275) + val android_hub_viewer_sch_pin: String get() = Tr.s(3276) + val android_hub_viewer_sch_pinname: String get() = Tr.s(3277) + val android_hub_viewer_sch_pinnumber: String get() = Tr.s(3278) + val android_hub_viewer_sch_field: String get() = Tr.s(3279) + val android_hub_viewer_sch_fieldother: String get() = Tr.s(3280) + val android_hub_viewer_sch_bus: String get() = Tr.s(3281) + val android_hub_viewer_sch_busentry: String get() = Tr.s(3282) + val android_hub_viewer_sch_wire: String get() = Tr.s(3283) + val android_hub_viewer_sch_noconnect: String get() = Tr.s(3284) + val android_hub_viewer_sch_junction: String get() = Tr.s(3285) + val android_hub_viewer_sch_sheetname: String get() = Tr.s(3286) + val android_hub_viewer_sch_sheetfile: String get() = Tr.s(3287) + val android_hub_viewer_sch_dnp: String get() = Tr.s(3288) + val android_hub_review_nokicad: String get() = Tr.s(3289) + val android_hub_review_wait: String get() = Tr.s(3290) + val android_hub_review_nosch: String get() = Tr.s(3291) + val android_hub_review_nofindings: String get() = Tr.s(3292) + fun android_hub_review_unticked(n: Any): String = Tr.f(3293, arrayOf(n)) + fun android_hub_review_customfailed(n: Any): String = Tr.f(3294, arrayOf(n)) + val android_hub_review_runthem: String get() = Tr.s(3295) + val android_hub_err_thread: String get() = Tr.s(3296) + val android_hub_err_project: String get() = Tr.s(3297) + val android_hub_err_room: String get() = Tr.s(3298) + val android_hub_err_method: String get() = Tr.s(3299) + val android_hub_err_attachment: String get() = Tr.s(3300) + val android_hub_err_noanswer: String get() = Tr.s(3301) + val android_hub_err_empty: String get() = Tr.s(3302) + val android_hub_err_oldapp: String get() = Tr.s(3303) + val android_hub_err_clientid: String get() = Tr.s(3304) + fun android_hub_err_images_max(n: Any): String = Tr.f(3305, arrayOf(n)) + val android_hub_err_images_kind: String get() = Tr.s(3306) + val android_hub_err_images_base64: String get() = Tr.s(3307) + val android_hub_err_images_size: String get() = Tr.s(3308) + val android_hub_err_images_store: String get() = Tr.s(3309) + val android_hub_err_folder_none: String get() = Tr.s(3310) + val android_hub_err_folder_read: String get() = Tr.s(3311) + val android_hub_err_notadded: String get() = Tr.s(3312) + val android_hub_err_nothread: String get() = Tr.s(3313) + val android_hub_err_env: String get() = Tr.s(3314) + val android_hub_err_channel: String get() = Tr.s(3315) + val android_hub_err_topic: String get() = Tr.s(3316) + val android_hub_err_tint: String get() = Tr.s(3317) + val android_hub_err_usage: String get() = Tr.s(3318) + val android_hub_err_nofolder: String get() = Tr.s(3319) + val android_hub_err_path: String get() = Tr.s(3320) + val android_hub_err_layer: String get() = Tr.s(3321) + val android_hub_err_compare: String get() = Tr.s(3322) + val android_hub_err_version: String get() = Tr.s(3323) + val android_hub_err_repo: String get() = Tr.s(3324) + val android_hub_err_toolbar: String get() = Tr.s(3325) + val android_hub_err_page: String get() = Tr.s(3326) + val android_hub_err_term_none: String get() = Tr.s(3327) + val android_hub_err_term_off: String get() = Tr.s(3328) + val android_hub_err_term_stopped: String get() = Tr.s(3329) + val android_hub_err_term_many: String get() = Tr.s(3330) + val android_hub_err_term_much: String get() = Tr.s(3331) + val android_hub_err_term_base64: String get() = Tr.s(3332) + val android_hub_err_busy: String get() = Tr.s(3333) + val android_hub_err_store: String get() = Tr.s(3334) + val android_hub_err_noagent: String get() = Tr.s(3335) + val android_hub_err_project_choose: String get() = Tr.s(3336) + val android_hub_err_project_retry: String get() = Tr.s(3337) + val android_hub_err_project_message: String get() = Tr.s(3338) + fun android_hub_err_project_already(root: Any): String = Tr.f(3339, arrayOf(root)) + fun android_hub_err_project_invalid(path: Any): String = Tr.f(3340, arrayOf(path)) + val android_hub_err_project_nofolder: String get() = Tr.s(3341) + val android_hub_err_project_unavailable: String get() = Tr.s(3342) + val android_hub_err_project_home: String get() = Tr.s(3343) + val android_hub_err_folder_gone: String get() = Tr.s(3344) + val android_hub_err_notfolder: String get() = Tr.s(3345) + val android_hub_err_file: String get() = Tr.s(3346) + val android_hub_err_utf8: String get() = Tr.s(3347) + val android_hub_err_parent: String get() = Tr.s(3348) + val android_hub_err_conversation: String get() = Tr.s(3349) + val android_hub_err_account_move: String get() = Tr.s(3350) + val android_hub_err_account_turn: String get() = Tr.s(3351) + val android_hub_err_account_agent: String get() = Tr.s(3352) + val android_hub_err_account_changed: String get() = Tr.s(3353) + val android_hub_err_account_none: String get() = Tr.s(3354) + val android_hub_err_intent_reload: String get() = Tr.s(3355) + val android_hub_err_intent_saving: String get() = Tr.s(3356) + val android_hub_err_intent_dir: String get() = Tr.s(3357) + val android_hub_err_intent_section: String get() = Tr.s(3358) + val android_hub_err_order_off: String get() = Tr.s(3359) + val android_hub_err_order_changed: String get() = Tr.s(3360) + val android_hub_err_order_upload: String get() = Tr.s(3361) + val android_hub_err_machine: String get() = Tr.s(3362) + fun android_hub_devices_used_by(name: Any): String = Tr.f(3363, arrayOf(name)) + val android_hub_devices_used: String get() = Tr.s(3364) + val android_hub_devices_revoked: String get() = Tr.s(3365) + fun android_hub_devices_expired(until: Any): String = Tr.f(3366, arrayOf(until)) + fun android_hub_devices_invite_failed(error: Any): String = Tr.f(3367, arrayOf(error)) + val android_hub_devices_add: String get() = Tr.s(3368) + val android_hub_devices_add_note: String get() = Tr.s(3369) + val android_hub_devices_retry: String get() = Tr.s(3370) + val android_hub_devices_lan: String get() = Tr.s(3371) + val android_hub_devices_lan_on: String get() = Tr.s(3372) + val android_hub_devices_lan_gone: String get() = Tr.s(3373) + fun android_hub_devices_lan_row(url: Any): String = Tr.f(3374, arrayOf(url)) + val android_hub_devices_lan_stop: String get() = Tr.s(3375) + val android_hub_devices_link_open: String get() = Tr.s(3376) + val android_hub_devices_link_used: String get() = Tr.s(3377) + fun android_hub_devices_link_open_by(name: Any): String = Tr.f(3378, arrayOf(name)) + fun android_hub_devices_link_used_by(name: Any): String = Tr.f(3379, arrayOf(name)) + val android_hub_devices_kind_tailnet: String get() = Tr.s(3380) + val android_hub_devices_kind_local: String get() = Tr.s(3381) + val android_hub_devices_tailnet_note: String get() = Tr.s(3382) + val android_hub_devices_lan_note: String get() = Tr.s(3383) + val android_hub_devices_reach: String get() = Tr.s(3384) + val android_hub_devices_lan_address: String get() = Tr.s(3385) + val android_hub_devices_another: String get() = Tr.s(3386) + fun android_hub_devices_qrnote(code: Any, hub: Any, until: Any): String = Tr.f(3387, arrayOf(code, hub, until)) + fun android_hub_devices_lan_offer(url: Any): String = Tr.f(3388, arrayOf(url)) + val android_hub_devices_lan_let: String get() = Tr.s(3389) + val android_hub_devices_only: String get() = Tr.s(3390) + val android_hub_devices_local_only: String get() = Tr.s(3391) + fun android_hub_devices_local_choose(kinds: Any): String = Tr.f(3392, arrayOf(kinds)) + fun android_hub_devices_lan_unknown(address: Any): String = Tr.f(3393, arrayOf(address)) + val android_hub_devices_lan_copy: String get() = Tr.s(3394) + fun android_hub_devices_lan_taken(address: Any): String = Tr.f(3395, arrayOf(address)) + val android_hub_devices_err_action: String get() = Tr.s(3396) + val android_hub_machines_none: String get() = Tr.s(3397) + fun android_hub_machines_paired(url: Any): String = Tr.f(3398, arrayOf(url)) + fun android_hub_machines_notyours(url: Any): String = Tr.f(3399, arrayOf(url)) + fun android_hub_machines_unpaired(url: Any): String = Tr.f(3400, arrayOf(url)) + fun android_hub_machines_via(url: Any, via: Any): String = Tr.f(3401, arrayOf(url, via)) + val android_hub_machines_rename: String get() = Tr.s(3402) + val android_hub_machines_rename_note: String get() = Tr.s(3403) + val android_hub_machines_rename_from: String get() = Tr.s(3404) + val android_hub_machines_rename_to: String get() = Tr.s(3405) + fun android_hub_machines_wants(name: Any): String = Tr.f(3406, arrayOf(name)) + fun android_hub_machines_request(url: Any, check: Any, left: Any): String = Tr.f(3407, arrayOf(url, check, left)) + val android_hub_machines_approve: String get() = Tr.s(3408) + fun android_hub_machines_waiting(check: Any): String = Tr.f(3409, arrayOf(check)) + fun android_hub_machines_pairing(address: Any): String = Tr.f(3410, arrayOf(address)) + fun android_hub_machines_status_linked(name: Any): String = Tr.f(3411, arrayOf(name)) + fun android_hub_machines_status_refused(error: Any): String = Tr.f(3412, arrayOf(error)) + fun android_hub_machines_found(url: Any): String = Tr.f(3413, arrayOf(url)) + fun android_hub_machines_found_other(url: Any): String = Tr.f(3414, arrayOf(url)) + val android_hub_machines_code_hint: String get() = Tr.s(3415) + val android_hub_machines_pair_title: String get() = Tr.s(3416) + val android_hub_machines_pair_note: String get() = Tr.s(3417) + val android_hub_machines_addr_hint: String get() = Tr.s(3418) + val android_hub_machines_code: String get() = Tr.s(3419) + val android_hub_machines_code_title: String get() = Tr.s(3420) + fun android_hub_machines_code_note(code: Any, address: Any, left: Any): String = Tr.f(3421, arrayOf(code, address, left)) + val android_hub_machines_code_another: String get() = Tr.s(3422) + val android_hub_machines_make: String get() = Tr.s(3423) + val android_hub_machines_make_note: String get() = Tr.s(3424) + val android_hub_machines_err_link: String get() = Tr.s(3425) + val android_hub_machines_err_which: String get() = Tr.s(3426) + fun android_hub_machines_err_called(name: Any): String = Tr.f(3427, arrayOf(name)) + fun android_hub_machines_err_taken(name: Any): String = Tr.f(3428, arrayOf(name)) + val android_hub_machines_err_invite: String get() = Tr.s(3429) + val android_hub_machines_err_codes: String get() = Tr.s(3430) + val android_hub_machines_err_record: String get() = Tr.s(3431) + val android_hub_machines_err_expired_answered: String get() = Tr.s(3432) + val android_hub_machines_err_secret: String get() = Tr.s(3433) + val android_hub_machines_err_approval: String get() = Tr.s(3434) + val android_hub_machines_err_expired: String get() = Tr.s(3435) + val android_hub_machines_err_address: String get() = Tr.s(3436) + val android_hub_machines_err_nocode: String get() = Tr.s(3437) + val android_hub_machines_err_already: String get() = Tr.s(3438) + fun android_hub_machines_err_noanswer(address: Any): String = Tr.f(3439, arrayOf(address)) + val android_hub_machines_err_nothing: String get() = Tr.s(3440) + val android_hub_machines_err_attempt: String get() = Tr.s(3441) + val android_hub_machines_err_invites: String get() = Tr.s(3442) + val android_hub_machines_err_invite_record: String get() = Tr.s(3443) + val android_hub_machines_err_invite_secret: String get() = Tr.s(3444) + val android_hub_machines_err_unusable: String get() = Tr.s(3445) + fun android_hub_machines_err_nolink(code: Any, body: Any): String = Tr.f(3446, arrayOf(code, body)) + val android_hub_machines_err_notlinked: String get() = Tr.s(3447) + val android_hub_machines_err_nocodeback: String get() = Tr.s(3448) + fun android_hub_machines_err_nocodegiven(code: Any, body: Any): String = Tr.f(3449, arrayOf(code, body)) + val android_hub_accounts_state_connected: String get() = Tr.s(3450) + val android_hub_accounts_state_expired: String get() = Tr.s(3451) + val android_hub_accounts_state_connecting: String get() = Tr.s(3452) + val android_hub_accounts_state_unchecked: String get() = Tr.s(3453) + val android_hub_accounts_state_none: String get() = Tr.s(3454) + fun android_hub_accounts_limit(window: Any, used: Any): String = Tr.f(3455, arrayOf(window, used)) + fun android_hub_accounts_limit_resets(window: Any, used: Any, `when`: Any): String = Tr.f(3456, arrayOf(window, used, `when`)) + fun android_hub_accounts_limit_stale(window: Any, used: Any): String = Tr.f(3457, arrayOf(window, used)) + fun android_hub_accounts_limit_resets_stale(window: Any, used: Any, `when`: Any): String = Tr.f(3458, arrayOf(window, used, `when`)) + fun android_hub_accounts_add(provider: Any): String = Tr.f(3459, arrayOf(provider)) + val android_hub_accounts_note: String get() = Tr.s(3460) + val android_hub_accounts_signin_starting: String get() = Tr.s(3461) + val android_hub_accounts_signin_paste: String get() = Tr.s(3462) + val android_hub_accounts_signin_device: String get() = Tr.s(3463) + val android_hub_accounts_signin_done: String get() = Tr.s(3464) + val android_hub_accounts_signin_expired: String get() = Tr.s(3465) + val android_hub_accounts_signin_cancelled: String get() = Tr.s(3466) + val android_hub_accounts_signin_failed: String get() = Tr.s(3467) + val android_hub_accounts_act_cancel: String get() = Tr.s(3468) + val android_hub_accounts_act_again: String get() = Tr.s(3469) + val android_hub_accounts_act_signin: String get() = Tr.s(3470) + fun android_hub_accounts_remove_ask(label: Any): String = Tr.f(3471, arrayOf(label)) + fun android_hub_accounts_hold_resets(`when`: Any): String = Tr.f(3472, arrayOf(`when`)) + val android_hub_accounts_hold: String get() = Tr.s(3473) + fun android_hub_accounts_alert_expired(provider: Any): String = Tr.f(3474, arrayOf(provider)) + fun android_hub_accounts_alert_needed(provider: Any, title: Any, why: Any): String = Tr.f(3475, arrayOf(provider, title, why)) + val android_hub_accounts_msg_expired: String get() = Tr.s(3476) + val android_hub_accounts_msg_expired_long: String get() = Tr.s(3477) + val android_hub_accounts_msg_generic: String get() = Tr.s(3478) + val android_hub_accounts_msg_nolimits: String get() = Tr.s(3479) + val android_hub_accounts_msg_nowindows: String get() = Tr.s(3480) + val android_hub_accounts_msg_signin: String get() = Tr.s(3481) + val android_hub_accounts_msg_directory: String get() = Tr.s(3482) + val android_hub_accounts_fail_code: String get() = Tr.s(3483) + val android_hub_accounts_fail_network: String get() = Tr.s(3484) + val android_hub_accounts_fail_storage: String get() = Tr.s(3485) + val android_hub_accounts_fail_cli: String get() = Tr.s(3486) + val android_hub_accounts_fail_dir: String get() = Tr.s(3487) + val android_hub_accounts_fail_verify: String get() = Tr.s(3488) + val android_hub_accounts_code_incomplete: String get() = Tr.s(3489) + val android_hub_accounts_code_other: String get() = Tr.s(3490) + val android_hub_accounts_msg_unverified: String get() = Tr.s(3491) + val android_hub_accounts_msg_registry: String get() = Tr.s(3492) + val android_hub_accounts_msg_identity: String get() = Tr.s(3493) + val android_hub_accounts_msg_subscription: String get() = Tr.s(3494) + fun android_hub_accounts_msg_refused(reason: Any): String = Tr.f(3495, arrayOf(reason)) + val android_hub_accounts_msg_toolarge: String get() = Tr.s(3496) + val android_hub_accounts_msg_closed: String get() = Tr.s(3497) + val android_hub_accounts_msg_timeout: String get() = Tr.s(3498) + val android_hub_accounts_msg_notusage: String get() = Tr.s(3499) + val android_hub_accounts_usage_unauthorized: String get() = Tr.s(3500) + val android_hub_accounts_usage_forbidden: String get() = Tr.s(3501) + val android_hub_accounts_usage_limited: String get() = Tr.s(3502) + fun android_hub_accounts_usage_code(code: Any): String = Tr.f(3503, arrayOf(code)) + val android_hub_accounts_err_gone: String get() = Tr.s(3504) + val android_hub_accounts_err_provider: String get() = Tr.s(3505) + val android_hub_accounts_err_add: String get() = Tr.s(3506) + val android_hub_accounts_err_gate: String get() = Tr.s(3507) + val android_hub_accounts_err_default: String get() = Tr.s(3508) + val android_hub_accounts_err_busy: String get() = Tr.s(3509) + val android_hub_accounts_err_select: String get() = Tr.s(3510) + val android_hub_accounts_err_check: String get() = Tr.s(3511) + fun android_hub_accounts_err_called(name: Any): String = Tr.f(3512, arrayOf(name)) + val android_hub_update_off: String get() = Tr.s(3513) + val android_hub_update_checking: String get() = Tr.s(3514) + fun android_hub_update_downloading(version: Any): String = Tr.f(3515, arrayOf(version)) + fun android_hub_update_waiting(version: Any): String = Tr.f(3516, arrayOf(version)) + fun android_hub_update_installing(version: Any): String = Tr.f(3517, arrayOf(version)) + val android_hub_update_failed: String get() = Tr.s(3518) + fun android_hub_update_row(version: Any): String = Tr.f(3519, arrayOf(version)) + fun android_hub_update_done(version: Any): String = Tr.f(3520, arrayOf(version)) + fun android_hub_update_rolledback(version: Any): String = Tr.f(3521, arrayOf(version)) + fun android_hub_update_rolledback_why(version: Any, why: Any): String = Tr.f(3522, arrayOf(version, why)) + fun android_hub_update_notstarted(version: Any): String = Tr.f(3523, arrayOf(version)) + val android_hub_update_turns: String get() = Tr.s(3524) + fun android_hub_update_err_feed(code: Any): String = Tr.f(3525, arrayOf(code)) + val android_hub_update_err_unpack: String get() = Tr.s(3526) + val android_hub_update_err_newer: String get() = Tr.s(3527) + val android_hub_update_err_nokey: String get() = Tr.s(3528) + val android_hub_update_err_untrusted: String get() = Tr.s(3529) + val android_hub_update_err_other: String get() = Tr.s(3530) + val android_hub_update_err_version: String get() = Tr.s(3531) + val android_hub_update_err_channel_tag: String get() = Tr.s(3532) + val android_hub_update_err_channel: String get() = Tr.s(3533) + val android_hub_update_err_file: String get() = Tr.s(3534) + val android_hub_update_err_checksum_bad: String get() = Tr.s(3535) + val android_hub_update_err_size_range: String get() = Tr.s(3536) + val android_hub_update_err_empty: String get() = Tr.s(3537) + val android_hub_update_err_listing: String get() = Tr.s(3538) + val android_hub_update_err_hardlink: String get() = Tr.s(3539) + val android_hub_update_err_link: String get() = Tr.s(3540) + fun android_hub_update_err_outside(name: Any): String = Tr.f(3541, arrayOf(name)) + val android_hub_update_err_norun: String get() = Tr.s(3542) + val android_hub_update_err_nohub: String get() = Tr.s(3543) + val android_hub_update_err_size: String get() = Tr.s(3544) + val android_hub_update_err_checksum: String get() = Tr.s(3545) + val android_hub_update_err_guard: String get() = Tr.s(3546) + val android_hub_update_err_guard_busy: String get() = Tr.s(3547) + fun android_hub_work_todo(count: Any): String = Tr.f(3548, arrayOf(count)) + fun android_hub_work_watch(title: Any): String = Tr.f(3549, arrayOf(title)) + fun android_hub_work_lock(name: Any): String = Tr.f(3550, arrayOf(name)) + val android_hub_work_release_done: String get() = Tr.s(3551) + val android_hub_work_flock: String get() = Tr.s(3552) + fun android_hub_work_position(n: Any, holder: Any): String = Tr.f(3553, arrayOf(n, holder)) + fun android_hub_work_position_job(n: Any, title: Any): String = Tr.f(3554, arrayOf(n, title)) + fun android_hub_work_job(title: Any): String = Tr.f(3555, arrayOf(title)) + val android_hub_work_subagent: String get() = Tr.s(3556) + val android_hub_work_said: String get() = Tr.s(3557) + fun android_hub_work_steps(n: Number): String = Tr.f(3558, arrayOf(n)) + fun android_hub_work_tokens(n: Any): String = Tr.f(3559, arrayOf(n)) + fun android_hub_work_tokens_k(n: Any): String = Tr.f(3560, arrayOf(n)) + fun android_hub_work_tokens_m(n: Any): String = Tr.f(3561, arrayOf(n)) + fun android_hub_work_where(harness: Any, typed: String, type: Any, remote: String, host: Any, wt: String, branch: Any): String = Tr.f(3562, arrayOf(harness, typed, type, remote, host, wt, branch)) + val android_hub_work_state_ended: String get() = Tr.s(3563) + val android_hub_work_word_launching: String get() = Tr.s(3564) + val android_hub_work_word_watching: String get() = Tr.s(3565) + val android_hub_work_word_timedout: String get() = Tr.s(3566) + val android_hub_work_word_cancelling: String get() = Tr.s(3567) + val android_hub_work_word_queued: String get() = Tr.s(3568) + val android_hub_work_word_unknown: String get() = Tr.s(3569) + val android_hub_work_word_completed: String get() = Tr.s(3570) + val android_hub_work_word_killed: String get() = Tr.s(3571) + fun android_hub_locks_outside(pid: Any): String = Tr.f(3572, arrayOf(pid)) + val android_hub_picker_notinstalled: String get() = Tr.s(3573) + val android_hub_picker_notinstalled_here: String get() = Tr.s(3574) + val android_hub_picker_notinstalled_agy: String get() = Tr.s(3575) + val android_hub_picker_cli: String get() = Tr.s(3576) + fun android_hub_picker_left(left: Any): String = Tr.f(3577, arrayOf(left)) + fun android_hub_picker_left_shared(left: Any): String = Tr.f(3578, arrayOf(left)) + val android_hub_picker_shared: String get() = Tr.s(3579) + val android_hub_picker_why_expired: String get() = Tr.s(3580) + val android_hub_picker_why_unchecked: String get() = Tr.s(3581) + val android_hub_picker_why_connecting: String get() = Tr.s(3582) + val android_hub_picker_why_none: String get() = Tr.s(3583) + fun android_hub_picker_window_fivehour(left: Any): String = Tr.f(3584, arrayOf(left)) + fun android_hub_picker_window_week(left: Any): String = Tr.f(3585, arrayOf(left)) + fun android_hub_picker_window_opus(left: Any): String = Tr.f(3586, arrayOf(left)) + fun android_hub_picker_window_sonnet(left: Any): String = Tr.f(3587, arrayOf(left)) + fun android_hub_picker_window(label: Any, left: Any): String = Tr.f(3588, arrayOf(label, left)) + fun android_hub_picker_resets(`when`: Any): String = Tr.f(3589, arrayOf(`when`)) + fun android_hub_picker_extra(used: Any): String = Tr.f(3590, arrayOf(used)) + fun android_hub_picker_extra_of(used: Any, limit: Any): String = Tr.f(3591, arrayOf(used, limit)) + val android_hub_picker_nolimit: String get() = Tr.s(3592) + val android_hub_status_blocked: String get() = Tr.s(3593) + val android_hub_order_step_details: String get() = Tr.s(3594) + val android_hub_order_step_quote: String get() = Tr.s(3595) + val android_hub_order_step_pay: String get() = Tr.s(3596) + val android_hub_order_step_made: String get() = Tr.s(3597) + val android_hub_order_step_shipped: String get() = Tr.s(3598) + val android_hub_order_line_asked: String get() = Tr.s(3599) + val android_hub_order_line_getting: String get() = Tr.s(3600) + val android_hub_order_line_reply: String get() = Tr.s(3601) + val android_hub_order_line_files: String get() = Tr.s(3602) + val android_hub_order_line_quoting: String get() = Tr.s(3603) + val android_hub_order_line_expired: String get() = Tr.s(3604) + val android_hub_order_line_failed: String get() = Tr.s(3605) + val android_hub_order_line_pilot: String get() = Tr.s(3606) + val android_hub_order_line_refunded: String get() = Tr.s(3607) + val android_hub_order_line_quoted: String get() = Tr.s(3608) + val android_hub_order_line_fix: String get() = Tr.s(3609) + val android_hub_order_line_paid: String get() = Tr.s(3610) + val android_hub_order_line_placed: String get() = Tr.s(3611) + val android_hub_order_line_shipped: String get() = Tr.s(3612) + fun android_hub_order_line_tracking(tracking: Any): String = Tr.f(3613, arrayOf(tracking)) + val android_hub_order_line_delivered: String get() = Tr.s(3614) + val android_hub_order_customs_ddp: String get() = Tr.s(3615) + val android_hub_order_customs: String get() = Tr.s(3616) + fun android_hub_order_buynow_total(total: Any): String = Tr.f(3617, arrayOf(total)) + fun android_hub_buy_from(price: Any): String = Tr.f(3618, arrayOf(price)) + fun android_hub_buy_last(price: Any): String = Tr.f(3619, arrayOf(price)) + val android_hub_buy_incomplete: String get() = Tr.s(3620) + val android_hub_buy_again: String get() = Tr.s(3621) + val android_hub_buy_ready: String get() = Tr.s(3622) + val android_hub_buy_ready_board: String get() = Tr.s(3623) + fun android_hub_buy_ready_boards(n: Any): String = Tr.f(3624, arrayOf(n)) + fun android_hub_buy_ready_parts(parts: Any): String = Tr.f(3625, arrayOf(parts)) + fun android_hub_buy_check(note: Any): String = Tr.f(3626, arrayOf(note)) + fun android_hub_buy_unavailable(error: Any): String = Tr.f(3627, arrayOf(error)) + fun android_hub_buy_unavailable_parts(error: Any, parts: Any): String = Tr.f(3628, arrayOf(error, parts)) + val android_hub_buy_ordered_paid: String get() = Tr.s(3629) + val android_hub_buy_ordered_placed: String get() = Tr.s(3630) + val android_hub_buy_ordered_shipped: String get() = Tr.s(3631) + val android_hub_buy_ordered_delivered: String get() = Tr.s(3632) + fun android_hub_buy_ordered(state: Any): String = Tr.f(3633, arrayOf(state)) + fun android_hub_buy_noestimate(name: Any, path: Any): String = Tr.f(3634, arrayOf(name, path)) + fun android_hub_buy_noestimate_why(name: Any, path: Any, why: Any): String = Tr.f(3635, arrayOf(name, path, why)) + val android_hub_buy_unreachable: String get() = Tr.s(3636) + fun android_hub_buy_said(code: Any): String = Tr.f(3637, arrayOf(code)) + val android_hub_ask_reject: String get() = Tr.s(3638) + val android_hub_ask_session: String get() = Tr.s(3639) + val android_hub_ask_decline: String get() = Tr.s(3640) + fun android_hub_ask_quote(detail: Any): String = Tr.f(3641, arrayOf(detail)) + val android_hub_guard_safe: String get() = Tr.s(3642) + fun android_hub_guard_safe_why(why: Any): String = Tr.f(3643, arrayOf(why)) + fun android_hub_guard_degraded(parts: Any): String = Tr.f(3644, arrayOf(parts)) + val android_hub_guard_temp: String get() = Tr.s(3645) + val android_hub_guard_disk: String get() = Tr.s(3646) + fun android_hub_guard_rolledback(build: Any, to: Any): String = Tr.f(3647, arrayOf(build, to)) + fun android_hub_guard_nostart(build: Any): String = Tr.f(3648, arrayOf(build)) + fun android_hub_guard_nostart_skip(build: Any, skip: Any): String = Tr.f(3649, arrayOf(build, skip)) + val android_hub_guard_down_retry: String get() = Tr.s(3650) + fun android_hub_guard_down(why: Any): String = Tr.f(3651, arrayOf(why)) + fun android_hub_guard_restarting(why: Any): String = Tr.f(3652, arrayOf(why)) + fun android_hub_guard_starting(build: Any): String = Tr.f(3653, arrayOf(build)) + fun android_hub_guard_safe_on(build: Any, why: Any): String = Tr.f(3654, arrayOf(build, why)) + fun android_hub_guard_safe_on_plain(build: Any): String = Tr.f(3655, arrayOf(build)) + fun android_hub_guard_running(build: Any): String = Tr.f(3656, arrayOf(build)) + val android_hub_guard_act_normal: String get() = Tr.s(3657) + val android_hub_guard_act_safe: String get() = Tr.s(3658) + val android_hub_guard_act_safe_note: String get() = Tr.s(3659) + fun android_hub_guard_act_rollback(build: Any): String = Tr.f(3660, arrayOf(build)) + fun android_hub_guard_act_rollback_note(build: Any): String = Tr.f(3661, arrayOf(build)) + val android_hub_guard_ans_noaction: String get() = Tr.s(3662) + fun android_hub_guard_ans_nobuild(build: Any): String = Tr.f(3663, arrayOf(build)) + val android_hub_guard_ans_noback: String get() = Tr.s(3664) + val android_hub_guard_ans_stopping: String get() = Tr.s(3665) + val android_hub_guard_ans_restarting: String get() = Tr.s(3666) + val android_hub_guard_ans_safe: String get() = Tr.s(3667) + val android_hub_guard_ans_rollingback: String get() = Tr.s(3668) + val android_hub_guard_ans_switching: String get() = Tr.s(3669) + fun android_hub_guard_ans_bad(build: Any): String = Tr.f(3670, arrayOf(build)) + val android_hub_guard_ans_updating: String get() = Tr.s(3671) + val android_hub_guard_ans_asked: String get() = Tr.s(3672) + val android_hub_guard_err_unreachable: String get() = Tr.s(3673) + val android_hub_guard_err_token: String get() = Tr.s(3674) + val android_hub_guard_err_disk: String get() = Tr.s(3675) + val android_hub_guard_err_here: String get() = Tr.s(3676) + val android_hub_guard_err_noanswer: String get() = Tr.s(3677) + val android_hub_guard_err_noguard: String get() = Tr.s(3678) + val android_hub_cmd_btw: String get() = Tr.s(3679) + val android_hub_cmd_give_desc: String get() = Tr.s(3680) + val android_hub_cmd_secret: String get() = Tr.s(3681) + val android_hub_cmd_intent: String get() = Tr.s(3682) + val android_hub_cmd_settle_desc: String get() = Tr.s(3683) + val android_hub_cmd_btw_empty: String get() = Tr.s(3684) + val android_hub_cmd_project: String get() = Tr.s(3685) + val android_hub_cmd_newproject: String get() = Tr.s(3686) + val android_hub_cmd_project_quote: String get() = Tr.s(3687) + val android_hub_cmd_project_existing: String get() = Tr.s(3688) + val android_hub_cmd_notcmd: String get() = Tr.s(3689) + val android_hub_link_screen: String get() = Tr.s(3690) + val android_hub_link_conversation: String get() = Tr.s(3691) + val android_hub_link_file: String get() = Tr.s(3692) + val android_hub_link_file_far: String get() = Tr.s(3693) + val android_hub_link_empty: String get() = Tr.s(3694) + val android_hub_link_unknown: String get() = Tr.s(3695) + val android_hub_link_project: String get() = Tr.s(3696) + val android_hub_link_project_far: String get() = Tr.s(3697) + val android_hub_link_thread: String get() = Tr.s(3698) + val android_hub_link_thread_far: String get() = Tr.s(3699) + val android_hub_link_noscreen: String get() = Tr.s(3700) + val android_hub_link_noproject: String get() = Tr.s(3701) + val android_hub_star_text: String get() = Tr.s(3702) + val android_hub_migrate_title: String get() = Tr.s(3703) + fun android_hub_migrate_body(step: String): String = Tr.f(3704, arrayOf(step)) + fun android_hub_migrate_writing(p: Any, pt: Any, t: Any, tt: Any, e: Any, et: Any): String = Tr.f(3705, arrayOf(p, pt, t, tt, e, et)) + fun android_hub_migrate_read(done: Any, total: Any): String = Tr.f(3706, arrayOf(done, total)) + fun android_hub_migrate_copied(n: Any): String = Tr.f(3707, arrayOf(n)) + fun android_hub_migrate_min(n: Any): String = Tr.f(3708, arrayOf(n)) + fun android_hub_migrate_sec(n: Any): String = Tr.f(3709, arrayOf(n)) + val android_hub_migrate_measuring: String get() = Tr.s(3710) + val android_hub_migrate_done: String get() = Tr.s(3711) + val android_hub_migrate_nothing: String get() = Tr.s(3712) + val android_hub_migrate_nothing_short: String get() = Tr.s(3713) + fun android_hub_migrate_took(n: Any): String = Tr.f(3714, arrayOf(n)) + val android_hub_migrate_keys: String get() = Tr.s(3715) + val android_hub_migrate_failed: String get() = Tr.s(3716) + fun android_hub_migrate_failed_body(why: Any): String = Tr.f(3717, arrayOf(why)) + fun android_hub_migrate_failed_body_from(why: Any, from: Any): String = Tr.f(3718, arrayOf(why, from)) + fun android_hub_migrate_unreadable(error: Any): String = Tr.f(3719, arrayOf(error)) + val android_hub_migrate_busy: String get() = Tr.s(3720) + fun android_hub_migrate_runs(n: Number): String = Tr.f(3721, arrayOf(n)) + fun android_hub_migrate_routines(n: Number): String = Tr.f(3722, arrayOf(n)) + val android_hub_migrate_machines: String get() = Tr.s(3723) + val android_hub_migrate_keystay: String get() = Tr.s(3724) + val android_hub_migrate_google: String get() = Tr.s(3725) + fun android_hub_migrate_clashes(n: Number): String = Tr.f(3726, arrayOf(n)) + val android_hub_migrate_fresh: String get() = Tr.s(3727) + val android_hub_migrate_running: String get() = Tr.s(3728) + fun android_hub_migrate_botfolder(name: Any, gb: Any, path: Any): String = Tr.f(3729, arrayOf(name, gb, path)) + fun android_hub_migrate_notcopied(path: Any, why: Any): String = Tr.f(3730, arrayOf(path, why)) + fun android_hub_migrate_signin(names: Any): String = Tr.f(3731, arrayOf(names)) + val android_hub_migrate_accounts: String get() = Tr.s(3732) + fun android_hub_migrate_vault(why: Any): String = Tr.f(3733, arrayOf(why)) + val android_hub_history_title: String get() = Tr.s(3734) + val android_hub_history_closed: String get() = Tr.s(3735) + val android_away: String get() = Tr.s(3736) + val android_open: String get() = Tr.s(3737) + val android_search_messages: String get() = Tr.s(3738) + val android_find_inthread: String get() = Tr.s(3739) + val android_find_error: String get() = Tr.s(3740) + val android_find_prev: String get() = Tr.s(3741) + val android_find_next: String get() = Tr.s(3742) + val android_find_nomatch: String get() = Tr.s(3743) + fun android_find_count(n: Number, total: Number): String = Tr.f(3744, arrayOf(n, total)) + val android_find_you: String get() = Tr.s(3745) + val android_find_agent: String get() = Tr.s(3746) + val android_sub_thread: String get() = Tr.s(3747) + fun android_sub_back(title: Any): String = Tr.f(3748, arrayOf(title)) + val android_sub_gone: String get() = Tr.s(3749) + fun android_sub_more(n: Number): String = Tr.f(3750, arrayOf(n)) + val android_sub_none: String get() = Tr.s(3751) + val android_sub_asked: String get() = Tr.s(3752) + val android_sub_tool: String get() = Tr.s(3753) + fun android_machine_on(name: Any): String = Tr.f(3754, arrayOf(name)) + fun android_handoff_from(title: Any): String = Tr.f(3755, arrayOf(title)) + fun android_handoff_note(note: Any): String = Tr.f(3756, arrayOf(note)) + val android_queue_unsent: String get() = Tr.s(3757) + fun android_mark_runs(machine: Any): String = Tr.f(3758, arrayOf(machine)) + fun android_mark_also(machines: Any): String = Tr.f(3759, arrayOf(machines)) + fun android_mark_newon(machine: Any): String = Tr.f(3760, arrayOf(machine)) + val android_google_signedin: String get() = Tr.s(3761) + val android_google_back: String get() = Tr.s(3762) + val android_improve_search: String get() = Tr.s(3763) + val android_improve_nomatch: String get() = Tr.s(3764) + val android_ring_head: String get() = Tr.s(3765) + val android_swarm_new: String get() = Tr.s(3766) + val android_swarm_topic: String get() = Tr.s(3767) + val android_swarm_goal: String get() = Tr.s(3768) + val android_swarm_seed: String get() = Tr.s(3769) + val android_swarm_member_add: String get() = Tr.s(3770) + fun android_swarm_member_n(n: Any): String = Tr.f(3771, arrayOf(n)) + val android_swarm_role: String get() = Tr.s(3772) + fun android_swarm_members(n: Number): String = Tr.f(3773, arrayOf(n)) + val android_swarm_pause: String get() = Tr.s(3774) + val android_swarm_resume: String get() = Tr.s(3775) + val android_swarm_stop: String get() = Tr.s(3776) + fun android_swarm_stop_ask(name: Any): String = Tr.f(3777, arrayOf(name)) + val android_swarm_stop_yes: String get() = Tr.s(3778) + val android_swarm_keep: String get() = Tr.s(3779) + fun android_swarm_remove_member(name: Any): String = Tr.f(3780, arrayOf(name)) + val android_swarm_state_active: String get() = Tr.s(3781) + val android_swarm_state_paused: String get() = Tr.s(3782) + val android_swarm_state_stopped: String get() = Tr.s(3783) + val android_swarm_state_done: String get() = Tr.s(3784) + val android_swarm_reason_circular: String get() = Tr.s(3785) + val android_swarm_reason_idle: String get() = Tr.s(3786) + val android_swarm_reason_budget: String get() = Tr.s(3787) + val android_swarm_reason_person: String get() = Tr.s(3788) + val android_swarm_reason_chatter: String get() = Tr.s(3789) + val android_swarm_tag_idea: String get() = Tr.s(3790) + val android_swarm_tag_critique: String get() = Tr.s(3791) + val android_swarm_tag_claim: String get() = Tr.s(3792) + val android_swarm_tag_done: String get() = Tr.s(3793) + val android_swarm_tag_question: String get() = Tr.s(3794) + val android_swarm_tag_synthesis: String get() = Tr.s(3795) + val android_swarm_waiting: String get() = Tr.s(3796) + fun android_swarm_held(why: Any): String = Tr.f(3797, arrayOf(why)) + val android_swarm_post_hint: String get() = Tr.s(3798) + val android_swarm_none: String get() = Tr.s(3799) + val android_swarm_gone: String get() = Tr.s(3800) + val android_swarm_provider: String get() = Tr.s(3801) + val android_swarm_model: String get() = Tr.s(3802) + fun android_buy_ask(project: Any): String = Tr.f(3803, arrayOf(project)) + val cat_cat: String get() = Tr.s(3804) + val cat_own: String get() = Tr.s(3805) + val cat_different: String get() = Tr.s(3806) + val cat_auto: String get() = Tr.s(3807) + val cat_color_bad: String get() = Tr.s(3808) + val android_copy_run: String get() = Tr.s(3809) + val android_copy_fullscreen: String get() = Tr.s(3810) + val android_term_chat_old: String get() = Tr.s(3811) + val android_browser_head: String get() = Tr.s(3812) + val android_clone_mode_folder: String get() = Tr.s(3813) + val android_clone_mode_git: String get() = Tr.s(3814) + val android_clone_repo_hint: String get() = Tr.s(3815) + val android_clone_private: String get() = Tr.s(3816) + val android_clone_signin: String get() = Tr.s(3817) + val android_clone_into: String get() = Tr.s(3818) + val android_clone_folder_change: String get() = Tr.s(3819) + val android_clone_folder_use: String get() = Tr.s(3820) + val android_clone_name_hint: String get() = Tr.s(3821) + val android_clone_thread: String get() = Tr.s(3822) + val android_clone_go: String get() = Tr.s(3823) + val android_clone_same: String get() = Tr.s(3824) + val android_clone_retry: String get() = Tr.s(3825) + val android_clone_loading: String get() = Tr.s(3826) + val android_clone_signin_code: String get() = Tr.s(3827) + val android_clone_signin_wait: String get() = Tr.s(3828) + val android_clone_signin_done: String get() = Tr.s(3829) + val android_clone_signin_failed: String get() = Tr.s(3830) + val android_clone_hint_nogh: String get() = Tr.s(3831) + val android_clone_hint_signedout: String get() = Tr.s(3832) + val android_clone_hint_error: String get() = Tr.s(3833) + val android_clone_phase_starting: String get() = Tr.s(3834) + val android_clone_phase_connecting: String get() = Tr.s(3835) + val android_clone_phase_counting: String get() = Tr.s(3836) + val android_clone_phase_compressing: String get() = Tr.s(3837) + val android_clone_phase_receiving: String get() = Tr.s(3838) + val android_clone_phase_resolving: String get() = Tr.s(3839) + val android_clone_phase_updating: String get() = Tr.s(3840) + val android_clone_phase_lfs: String get() = Tr.s(3841) + val android_clone_phase_adding: String get() = Tr.s(3842) + val android_clone_phase_cancelled: String get() = Tr.s(3843) + fun android_clone_busy(path: Any): String = Tr.f(3844, arrayOf(path)) + fun android_clone_file(path: Any): String = Tr.f(3845, arrayOf(path)) + val android_download_saved: String get() = Tr.s(3846) + fun android_download_of(have: Any, total: Any): String = Tr.f(3847, arrayOf(have, total)) + val android_download_share: String get() = Tr.s(3848) + val android_download_retry: String get() = Tr.s(3849) + val android_download_noapp: String get() = Tr.s(3850) + val android_download_button: String get() = Tr.s(3851) + fun ios_sections_running(n: Number): String = Tr.f(3852, arrayOf(n)) + val ios_alerts_ask: String get() = Tr.s(3853) + val ios_alerts_allow: String get() = Tr.s(3854) + val ios_alerts_later: String get() = Tr.s(3855) + val ios_viewerbg: String get() = Tr.s(3856) + val ios_viewerbg_auto: String get() = Tr.s(3857) + val ios_viewerbg_custom: String get() = Tr.s(3858) + val ios_viewerbg_color: String get() = Tr.s(3859) + val ios_viewerbg_note: String get() = Tr.s(3860) + fun ios_hub_use(hub: Any): String = Tr.f(3861, arrayOf(hub)) + val ios_thread_loading: String get() = Tr.s(3862) + val ios_hub_connecting: String get() = Tr.s(3863) + fun ios_project_remove_ask(title: Any): String = Tr.f(3864, arrayOf(title)) + val ios_side_room: String get() = Tr.s(3865) + val ios_side_bot: String get() = Tr.s(3866) + val ios_side_uber: String get() = Tr.s(3867) + fun ios_project_terms(project: Any): String = Tr.f(3868, arrayOf(project)) + fun ios_project_newthread(project: Any): String = Tr.f(3869, arrayOf(project)) + fun ios_lock_waiting(n: Number): String = Tr.f(3870, arrayOf(n)) + fun ios_conn_connecting(hub: Any): String = Tr.f(3871, arrayOf(hub)) + val ios_conn_offline: String get() = Tr.s(3872) + fun ios_kids_hide(n: Number): String = Tr.f(3873, arrayOf(n)) + fun ios_kids_show(n: Number): String = Tr.f(3874, arrayOf(n)) + fun ios_model_label(model: Any): String = Tr.f(3875, arrayOf(model)) + val ios_model_default: String get() = Tr.s(3876) + val ios_start: String get() = Tr.s(3877) + val ios_starting: String get() = Tr.s(3878) + val ios_room_missing: String get() = Tr.s(3879) + val ios_secret_new: String get() = Tr.s(3880) + fun ios_secret_named(name: Any): String = Tr.f(3881, arrayOf(name)) + val ios_secret_refused: String get() = Tr.s(3882) + val ios_find_gone: String get() = Tr.s(3883) + val ios_thread: String get() = Tr.s(3884) + val ios_state_working: String get() = Tr.s(3885) + val ios_state_inactive: String get() = Tr.s(3886) + val ios_state_blocked: String get() = Tr.s(3887) + val ios_state_stalled: String get() = Tr.s(3888) + val ios_state_monitoring: String get() = Tr.s(3889) + val ios_state_finished: String get() = Tr.s(3890) + val ios_state_active: String get() = Tr.s(3891) + val ios_composer_hint: String get() = Tr.s(3892) + val ios_dictate_stop: String get() = Tr.s(3893) + val ios_dictate: String get() = Tr.s(3894) + val ios_attach_pictures: String get() = Tr.s(3895) + val ios_attach_pictures_no: String get() = Tr.s(3896) + val ios_draw_no: String get() = Tr.s(3897) + val ios_attach_no: String get() = Tr.s(3898) + val ios_command_failed: String get() = Tr.s(3899) + fun ios_work_head(word: Any): String = Tr.f(3900, arrayOf(word)) + val ios_fold_open: String get() = Tr.s(3901) + val ios_fold_shut: String get() = Tr.s(3902) + val ios_step_design: String get() = Tr.s(3903) + val ios_ask_asks: String get() = Tr.s(3904) + val ios_ask_asked: String get() = Tr.s(3905) + fun ios_ask_answered(answer: Any): String = Tr.f(3906, arrayOf(answer)) + val ios_improve_sent: String get() = Tr.s(3907) + val ios_on: String get() = Tr.s(3908) + val ios_off: String get() = Tr.s(3909) + val ios_system: String get() = Tr.s(3910) + val ios_light: String get() = Tr.s(3911) + val ios_dark: String get() = Tr.s(3912) + val ios_conn_online: String get() = Tr.s(3913) + val ios_conn_connectingword: String get() = Tr.s(3914) + val ios_conn_offlineword: String get() = Tr.s(3915) + fun ios_version(version: Any, build: Any): String = Tr.f(3916, arrayOf(version, build)) + fun ios_hub_forget_ask(hub: Any): String = Tr.f(3917, arrayOf(hub)) + val ios_hub_this: String get() = Tr.s(3918) + val ios_update_stable: String get() = Tr.s(3919) + val ios_update_beta: String get() = Tr.s(3920) + val ios_order: String get() = Tr.s(3921) + fun ios_order_named(name: Any): String = Tr.f(3922, arrayOf(name)) + val ios_invite_machine: String get() = Tr.s(3923) + val ios_invite_device: String get() = Tr.s(3924) + fun ios_link_used(`when`: Any, who: Any, mark: String): String = Tr.f(3925, arrayOf(`when`, who, mark)) + val ios_link_amachine: String get() = Tr.s(3926) + val ios_link_adevice: String get() = Tr.s(3927) + val ios_link_revoked_never: String get() = Tr.s(3928) + fun ios_link_revoked_with(who: Any): String = Tr.f(3929, arrayOf(who)) + val ios_link_machine_linked: String get() = Tr.s(3930) + val ios_link_device_paired: String get() = Tr.s(3931) + val ios_link_expired: String get() = Tr.s(3932) + fun ios_link_open(time: Any): String = Tr.f(3933, arrayOf(time)) + fun ios_hub_address(address: Any): String = Tr.f(3934, arrayOf(address)) + val ios_share: String get() = Tr.s(3935) + fun ios_link_revoke_used(kind: String, name: Any): String = Tr.f(3936, arrayOf(kind, name)) + val ios_unnamed: String get() = Tr.s(3937) + val ios_link_revoke_open: String get() = Tr.s(3938) + val ios_devices_loadfail: String get() = Tr.s(3939) + val ios_invite_creating: String get() = Tr.s(3940) + val ios_invite_fail: String get() = Tr.s(3941) + val ios_invite_ready: String get() = Tr.s(3942) + val ios_invite_fail_conn: String get() = Tr.s(3943) + val ios_revoke_device_fail: String get() = Tr.s(3944) + val ios_revoke_link_fail: String get() = Tr.s(3945) + val ios_pair_repair: String get() = Tr.s(3946) + val ios_pair_connect_title: String get() = Tr.s(3947) + val ios_pair_paste: String get() = Tr.s(3948) + val ios_pair_paste_hint: String get() = Tr.s(3949) + val ios_pair_invalid: String get() = Tr.s(3950) + fun ios_thread_delete_ask(title: Any): String = Tr.f(3951, arrayOf(title)) + fun ios_search_none(query: Any): String = Tr.f(3952, arrayOf(query)) + val ios_you: String get() = Tr.s(3953) + val ios_agent: String get() = Tr.s(3954) + fun ios_room_post_to(room: Any): String = Tr.f(3955, arrayOf(room)) + fun ios_find_none(query: Any): String = Tr.f(3956, arrayOf(query)) + val ios_ago_now: String get() = Tr.s(3957) + fun ios_ago_m(n: Any): String = Tr.f(3958, arrayOf(n)) + fun ios_ago_h(n: Any): String = Tr.f(3959, arrayOf(n)) + fun ios_ago_d(n: Any): String = Tr.f(3960, arrayOf(n)) + val ios_mic_off: String get() = Tr.s(3961) + val ios_mic_failed: String get() = Tr.s(3962) + val ios_link_update: String get() = Tr.s(3963) + val ios_link_nothere: String get() = Tr.s(3964) + val ios_hub_notconnected: String get() = Tr.s(3965) + fun ios_preview_none(size: Any): String = Tr.f(3966, arrayOf(size)) + val ios_review_resolved: String get() = Tr.s(3967) + val ios_review_reopen: String get() = Tr.s(3968) + val ios_review_resolve: String get() = Tr.s(3969) + fun ios_settled_count(n: Any): String = Tr.f(3970, arrayOf(n)) + fun ios_history_count(n: Any): String = Tr.f(3971, arrayOf(n)) + fun ios_pad_colour(n: Any): String = Tr.f(3972, arrayOf(n)) + val ios_pad_pen: String get() = Tr.s(3973) + val ios_pad_box: String get() = Tr.s(3974) + val ios_pad_eraser: String get() = Tr.s(3975) + val ios_hub_restart: String get() = Tr.s(3976) + val ios_hub_refused_pairing: String get() = Tr.s(3977) + val ios_hub_asking: String get() = Tr.s(3978) + val ios_hub_restart_none: String get() = Tr.s(3979) + val ios_hub_status_fail: String get() = Tr.s(3980) + val ios_hub_sent: String get() = Tr.s(3981) + val ios_hub_refused: String get() = Tr.s(3982) + val ios_hub_cannot: String get() = Tr.s(3983) + val ios_hub_machine_unreachable: String get() = Tr.s(3984) + val ios_hub_noanswer: String get() = Tr.s(3985) + fun ios_hub_still(status: Any): String = Tr.f(3986, arrayOf(status)) + val ios_hub_waiting: String get() = Tr.s(3987) + fun ios_hub_is(status: Any): String = Tr.f(3988, arrayOf(status)) + val ios_hub_down: String get() = Tr.s(3989) + val ios_hub_up_safe_degraded: String get() = Tr.s(3990) + val ios_hub_up_degraded: String get() = Tr.s(3991) + val ios_hub_up_safe: String get() = Tr.s(3992) + val ios_hub_up: String get() = Tr.s(3993) + val ios_star: String get() = Tr.s(3994) + val ios_pad_length_example: String get() = Tr.s(3995) + val ios_pair_code_field: String get() = Tr.s(3996) + val ios_accounts: String get() = Tr.s(3997) + val ios_devices_add: String get() = Tr.s(3998) + val ios_hub_add: String get() = Tr.s(3999) + val ios_accounts_addsignin: String get() = Tr.s(4000) + val ios_devices_intro: String get() = Tr.s(4001) + val ios_project_add_first: String get() = Tr.s(4002) + val ios_settings_alerts: String get() = Tr.s(4003) + val ios_settings_sound: String get() = Tr.s(4004) + val ios_pair_ask_note: String get() = Tr.s(4005) + val ios_projects_none_note: String get() = Tr.s(4006) + val ios_review_comment_field: String get() = Tr.s(4007) + val ios_project_badge: String get() = Tr.s(4008) + val ios_order_buy: String get() = Tr.s(4009) + val ios_diff_head: String get() = Tr.s(4010) + val ios_photo_choose: String get() = Tr.s(4011) + val ios_close_lower: String get() = Tr.s(4012) + val ios_compare_close: String get() = Tr.s(4013) + val ios_badge_colour: String get() = Tr.s(4014) + val ios_pair_code_connect: String get() = Tr.s(4015) + val ios_history: String get() = Tr.s(4016) + val ios_copied: String get() = Tr.s(4017) + val ios_copy_code: String get() = Tr.s(4018) + val ios_copy_run: String get() = Tr.s(4019) + val ios_term_fullscreen: String get() = Tr.s(4020) + val ios_delete_dots: String get() = Tr.s(4021) + val ios_devices: String get() = Tr.s(4022) + val ios_pad_hint_eraser: String get() = Tr.s(4023) + val ios_pad_hint_pen: String get() = Tr.s(4024) + val ios_pad_hint_box: String get() = Tr.s(4025) + val ios_pad_paper: String get() = Tr.s(4026) + val ios_pair_invite_incomplete: String get() = Tr.s(4027) + val ios_pair_enter: String get() = Tr.s(4028) + val ios_pair_code_needhub: String get() = Tr.s(4029) + val ios_devices_none: String get() = Tr.s(4030) + val ios_invite_expired: String get() = Tr.s(4031) + val ios_invite_expires: String get() = Tr.s(4032) + val ios_project_folder: String get() = Tr.s(4033) + val ios_quiet_from: String get() = Tr.s(4034) + val ios_term_gone: String get() = Tr.s(4035) + val ios_hub: String get() = Tr.s(4036) + val ios_hub_address_field: String get() = Tr.s(4037) + val ios_badge_icon: String get() = Tr.s(4038) + val ios_improvements: String get() = Tr.s(4039) + val ios_quiet_note: String get() = Tr.s(4040) + val ios_term_end: String get() = Tr.s(4041) + val ios_browser_keys: String get() = Tr.s(4042) + val ios_devices_lastseen: String get() = Tr.s(4043) + val ios_pad_length_ask: String get() = Tr.s(4044) + val ios_licences: String get() = Tr.s(4045) + val ios_links_none: String get() = Tr.s(4046) + val ios_thread_older: String get() = Tr.s(4047) + val ios_mech_loading: String get() = Tr.s(4048) + val ios_thread_detach: String get() = Tr.s(4049) + val ios_accounts_name: String get() = Tr.s(4050) + val ios_term_newshell: String get() = Tr.s(4051) + val ios_accounts_none: String get() = Tr.s(4052) + val ios_browser_none: String get() = Tr.s(4053) + val ios_diff_none: String get() = Tr.s(4054) + val ios_review_comments_none: String get() = Tr.s(4055) + val ios_mech_none: String get() = Tr.s(4056) + val ios_projects_none: String get() = Tr.s(4057) + val ios_notconnected: String get() = Tr.s(4058) + val ios_term_none: String get() = Tr.s(4059) + val ios_threads_none: String get() = Tr.s(4060) + val ios_secret_notneeded: String get() = Tr.s(4061) + val ios_notpaired: String get() = Tr.s(4062) + val ios_send_failed: String get() = Tr.s(4063) + val ios_compare_none: String get() = Tr.s(4064) + val ios_settings_alerts_note: String get() = Tr.s(4065) + val ios_pair_howto: String get() = Tr.s(4066) + val ios_improve_github: String get() = Tr.s(4067) + val ios_signin_open: String get() = Tr.s(4068) + val ios_devices_paired: String get() = Tr.s(4069) + val ios_links: String get() = Tr.s(4070) + val ios_pair_ask: String get() = Tr.s(4071) + val ios_paste: String get() = Tr.s(4072) + val ios_signin_code_field: String get() = Tr.s(4073) + val ios_secret_value: String get() = Tr.s(4074) + val ios_viewer_picked: String get() = Tr.s(4075) + val ios_room_post: String get() = Tr.s(4076) + val ios_quiet: String get() = Tr.s(4077) + val ios_reconnect: String get() = Tr.s(4078) + val ios_picture_remove: String get() = Tr.s(4079) + val ios_project_rename: String get() = Tr.s(4080) + val ios_revoke_ask: String get() = Tr.s(4081) + val ios_revoke_link_ask: String get() = Tr.s(4082) + val ios_review_run: String get() = Tr.s(4083) + val ios_find: String get() = Tr.s(4084) + val ios_search_field: String get() = Tr.s(4085) + val ios_signin_send: String get() = Tr.s(4086) + val ios_improve_send: String get() = Tr.s(4087) + val ios_term_shell: String get() = Tr.s(4088) + val ios_thread_empty: String get() = Tr.s(4089) + val ios_improve_send_note: String get() = Tr.s(4090) + val ios_state: String get() = Tr.s(4091) + val ios_photo_take: String get() = Tr.s(4092) + val ios_terminals: String get() = Tr.s(4093) + val ios_term_screen: String get() = Tr.s(4094) + val ios_voice_spelling: String get() = Tr.s(4095) + val ios_revoke_note: String get() = Tr.s(4096) + val ios_file_unread: String get() = Tr.s(4097) + val ios_hub_proto: String get() = Tr.s(4098) + val ios_hub_forget_note: String get() = Tr.s(4099) + val ios_diff_nogit: String get() = Tr.s(4100) + val ios_thread_actions: String get() = Tr.s(4101) + val ios_quiet_to: String get() = Tr.s(4102) + val ios_pair_code_type: String get() = Tr.s(4103) + val ios_pad_undo: String get() = Tr.s(4104) + val ios_updates: String get() = Tr.s(4105) + val ios_quiet_urgent: String get() = Tr.s(4106) + val ios_use: String get() = Tr.s(4107) + val ios_pair_fresh: String get() = Tr.s(4108) + val ios_newthread_hint: String get() = Tr.s(4109) + val ios_improve_ask: String get() = Tr.s(4110) + val ios_find_field: String get() = Tr.s(4111) + val ios_browser_driving: String get() = Tr.s(4112) + val ios_ask_answer: String get() = Tr.s(4113) + val ios_pair_wrongcode: String get() = Tr.s(4114) + val ios_pair_expired: String get() = Tr.s(4115) + val ios_pair_used: String get() = Tr.s(4116) + val ios_pair_revoked: String get() = Tr.s(4117) + val ios_pair_ratelimited: String get() = Tr.s(4118) + val ios_pair_storage: String get() = Tr.s(4119) + val ios_pair_required: String get() = Tr.s(4120) + val ios_pair_unreachable: String get() = Tr.s(4121) + val ios_connecting: String get() = Tr.s(4122) + val ios_offline: String get() = Tr.s(4123) + val ios_hub_refused_plain: String get() = Tr.s(4124) + val ios_thinking: String get() = Tr.s(4125) + val ios_tab_board: String get() = Tr.s(4126) + val ios_tab_schematic: String get() = Tr.s(4127) + val ios_tab_split: String get() = Tr.s(4128) + val ios_tab_mech: String get() = Tr.s(4129) + val ios_tab_files: String get() = Tr.s(4130) + val ios_tab_diff: String get() = Tr.s(4131) + val ios_tab_review: String get() = Tr.s(4132) + val ios_tab_browser: String get() = Tr.s(4133) + val ios_review_checks: String get() = Tr.s(4134) + val ios_review_bom: String get() = Tr.s(4135) + val ios_review_comments: String get() = Tr.s(4136) + val ios_board_none: String get() = Tr.s(4137) + val ios_schematic_none: String get() = Tr.s(4138) + fun ios_term_exited(code: Any): String = Tr.f(4139, arrayOf(code)) + val ios_term_failed: String get() = Tr.s(4140) + fun ios_island_more(n: Number): String = Tr.f(4141, arrayOf(n)) + val ios_island_stale: String get() = Tr.s(4142) + fun ios_plot_previous(why: Any): String = Tr.f(4143, arrayOf(why)) + val ios_plot_decoding: String get() = Tr.s(4144) + val ios_plot_undecodable: String get() = Tr.s(4145) + val ios_plot_badref: String get() = Tr.s(4146) + val ios_plot_badmodel: String get() = Tr.s(4147) + val ios_plot_incomplete: String get() = Tr.s(4148) + val ios_plot_unexpected: String get() = Tr.s(4149) + val ios_part_bad: String get() = Tr.s(4150) + val ios_part_placement: String get() = Tr.s(4151) + val ios_part_triangles: String get() = Tr.s(4152) + val ios_part_incomplete: String get() = Tr.s(4153) + val ios_part_unexpected: String get() = Tr.s(4154) + fun ios_parts_progress(done: Number, of: Number): String = Tr.f(4155, arrayOf(done, of)) + val ios_hub_timeout: String get() = Tr.s(4156) + val ios_pair_local: String get() = Tr.s(4157) + val ios_search_messages: String get() = Tr.s(4158) + fun ios_sub_of(thread: Any): String = Tr.f(4159, arrayOf(thread)) + val ios_sub_thread: String get() = Tr.s(4160) + val ios_sub_gone: String get() = Tr.s(4161) + fun ios_sub_more(n: Number): String = Tr.f(4162, arrayOf(n)) + val ios_sub_none: String get() = Tr.s(4163) + val ios_sub_title: String get() = Tr.s(4164) + val ios_sub_tool: String get() = Tr.s(4165) + val ios_sub_reported: String get() = Tr.s(4166) + val ios_sub_ended: String get() = Tr.s(4167) + val ios_state_completed: String get() = Tr.s(4168) + val ios_handoff_open: String get() = Tr.s(4169) + fun ios_handoff_from(title: Any): String = Tr.f(4170, arrayOf(title)) + fun ios_handoff_note(note: Any): String = Tr.f(4171, arrayOf(note)) + fun ios_machine_away(label: Any): String = Tr.f(4172, arrayOf(label)) + fun ios_machine_on(machine: Any): String = Tr.f(4173, arrayOf(machine)) + fun ios_machine_runs(machine: Any): String = Tr.f(4174, arrayOf(machine)) + val ios_machine_every: String get() = Tr.s(4175) + val ios_thread_marked: String get() = Tr.s(4176) + val ios_find_bar: String get() = Tr.s(4177) + val ios_find_prev: String get() = Tr.s(4178) + val ios_find_next: String get() = Tr.s(4179) + val ios_find_close: String get() = Tr.s(4180) + fun ios_find_count(at: Number, total: Number): String = Tr.f(4181, arrayOf(at, total)) + fun ios_find_countmore(at: Number, total: Number): String = Tr.f(4182, arrayOf(at, total)) + val ios_queue_unsent: String get() = Tr.s(4183) + val ios_queue_refused: String get() = Tr.s(4184) + val ios_queue_sending: String get() = Tr.s(4185) + fun ios_newon(machine: Any): String = Tr.f(4186, arrayOf(machine)) + fun ios_newon_away(machine: Any): String = Tr.f(4187, arrayOf(machine)) + fun ios_machine_also(machines: Any): String = Tr.f(4188, arrayOf(machines)) + val ios_voice_mic_note: String get() = Tr.s(4189) + fun ios_voice_mic_note_device(device: Any): String = Tr.f(4190, arrayOf(device)) + val ios_voice_dict_empty: String get() = Tr.s(4191) + val ios_voice_learned_empty: String get() = Tr.s(4192) + val ios_voice_pebble: String get() = Tr.s(4193) + val ios_voice_pebble_note: String get() = Tr.s(4194) + val ios_devices_add_note: String get() = Tr.s(4195) + val ios_buy: String get() = Tr.s(4196) + fun ios_buy_from(price: Any): String = Tr.f(4197, arrayOf(price)) + fun ios_buy_last(price: Any): String = Tr.f(4198, arrayOf(price)) + val ios_buy_incomplete: String get() = Tr.s(4199) + val ios_improve_search: String get() = Tr.s(4200) + val android_notify_head: String get() = Tr.s(4201) + val gpui_keysheet_note: String get() = Tr.s(4202) + val gpui_keys_help: String get() = Tr.s(4203) + val gpui_f2_welcome_body: String get() = Tr.s(4204) + fun gpui_f2_data_folder_note(home: Any): String = Tr.f(4205, arrayOf(home)) + val gpui_f2_choose_another: String get() = Tr.s(4206) + val gpui_f2_usage_note: String get() = Tr.s(4207) + val gpui_f2_v014: String get() = Tr.s(4208) + val gpui_f2_v014_copied: String get() = Tr.s(4209) + fun gpui_f2_v014_found(from: Any): String = Tr.f(4210, arrayOf(from)) + val gpui_f2_agents_body: String get() = Tr.s(4211) + fun gpui_f2_installing(note: Any): String = Tr.f(4212, arrayOf(note)) + fun gpui_f2_install_failed(note: Any): String = Tr.f(4213, arrayOf(note)) + val gpui_f2_installed: String get() = Tr.s(4214) + fun gpui_f2_version(v: Any): String = Tr.f(4215, arrayOf(v)) + fun gpui_f2_v_connected(v: Any): String = Tr.f(4216, arrayOf(v)) + fun gpui_f2_v_connected_as(v: Any, who: Any): String = Tr.f(4217, arrayOf(v, who)) + val gpui_f2_i_connected: String get() = Tr.s(4218) + fun gpui_f2_i_connected_as(who: Any): String = Tr.f(4219, arrayOf(who)) + fun gpui_f2_v_notconnected(v: Any): String = Tr.f(4220, arrayOf(v)) + val gpui_f2_i_notconnected: String get() = Tr.s(4221) + fun gpui_f2_v_runcmd(v: Any, cmd: Any): String = Tr.f(4222, arrayOf(v, cmd)) + fun gpui_f2_i_runcmd(cmd: Any): String = Tr.f(4223, arrayOf(cmd)) + val gpui_f2_more_agents: String get() = Tr.s(4224) + val gpui_f2_check_after: String get() = Tr.s(4225) + val gpui_f2_tools: String get() = Tr.s(4226) + val gpui_f2_tools_body: String get() = Tr.s(4227) + fun gpui_f2_kicad_ok(v: Any, path: Any): String = Tr.f(4228, arrayOf(v, path)) + fun gpui_f2_kicad_installing(v: Any, note: Any): String = Tr.f(4229, arrayOf(v, note)) + fun gpui_f2_kicad_auto(v: Any): String = Tr.f(4230, arrayOf(v)) + val gpui_f2_kicad_nopkg: String get() = Tr.s(4231) + val gpui_f2_freecad_notfound: String get() = Tr.s(4232) + val gpui_f2_locate_kicad: String get() = Tr.s(4233) + val gpui_f2_locate_freecad: String get() = Tr.s(4234) + fun gpui_f2_locate_note(tool: Any): String = Tr.f(4235, arrayOf(tool)) + fun gpui_f2_path_to(tool: Any): String = Tr.f(4236, arrayOf(tool)) + val gpui_f2_alwayson: String get() = Tr.s(4237) + val gpui_f2_alwayson_body: String get() = Tr.s(4238) + val gpui_f2_aon_here: String get() = Tr.s(4239) + val gpui_f2_aon_here_note: String get() = Tr.s(4240) + val gpui_f2_aon_boat: String get() = Tr.s(4241) + val gpui_f2_aon_boat_note: String get() = Tr.s(4242) + val gpui_f2_aon_machine: String get() = Tr.s(4243) + val gpui_f2_aon_machine_note: String get() = Tr.s(4244) + val gpui_f2_chosen: String get() = Tr.s(4245) + val gpui_f2_choose: String get() = Tr.s(4246) + val gpui_f2_coming: String get() = Tr.s(4247) + val gpui_f2_coming_note: String get() = Tr.s(4248) + val gpui_f2_project_body: String get() = Tr.s(4249) + val gpui_f2_first_message_note: String get() = Tr.s(4250) + val gpui_f2_what_agent: String get() = Tr.s(4251) + val gpui_f2_folder_note: String get() = Tr.s(4252) + val gpui_f2_pair_phone: String get() = Tr.s(4253) + val gpui_f2_pair_phone_note: String get() = Tr.s(4254) + val gpui_f2_pair_phone_shown: String get() = Tr.s(4255) + val gpui_f2_show_code: String get() = Tr.s(4256) + val gpui_f2_done_body: String get() = Tr.s(4257) + val gpui_f2_open_uber: String get() = Tr.s(4258) + val gpui_f2_setup_phone: String get() = Tr.s(4259) + val gpui_f2_setup_five: String get() = Tr.s(4260) + fun gpui_swarm_row(n: Number, w: Number): String = Tr.f(4261, arrayOf(n, w)) + fun gpui_swarm_held(why: Any): String = Tr.f(4262, arrayOf(why)) + fun gpui_swarm_state_why(state: Any, why: Any): String = Tr.f(4263, arrayOf(state, why)) + val gpui_swarm_new: String get() = Tr.s(4264) + val gpui_swarm_add_member: String get() = Tr.s(4265) + val gpui_swarm_start: String get() = Tr.s(4266) + val gpui_swarm_topic: String get() = Tr.s(4267) + val gpui_swarm_goal: String get() = Tr.s(4268) + val gpui_swarm_seed: String get() = Tr.s(4269) + val gpui_swarm_role: String get() = Tr.s(4270) + val gpui_swarm_remove: String get() = Tr.s(4271) + val gpui_swarm_over: String get() = Tr.s(4272) + val gpui_swarm_none: String get() = Tr.s(4273) + val ios_swarm_new: String get() = Tr.s(4274) + fun ios_swarm_new_in(project: Any): String = Tr.f(4275, arrayOf(project)) + fun ios_swarm_members(n: Number): String = Tr.f(4276, arrayOf(n)) + val ios_swarm_state_paused: String get() = Tr.s(4277) + val ios_swarm_state_removed: String get() = Tr.s(4278) + val ios_swarm_tag_idea: String get() = Tr.s(4279) + val ios_swarm_tag_critique: String get() = Tr.s(4280) + val ios_swarm_tag_claim: String get() = Tr.s(4281) + val ios_swarm_tag_synthesis: String get() = Tr.s(4282) + val ios_swarm_reason_circular: String get() = Tr.s(4283) + val ios_swarm_reason_budget: String get() = Tr.s(4284) + val ios_swarm_reason_person: String get() = Tr.s(4285) + val ios_swarm_reason_chatter: String get() = Tr.s(4286) + fun ios_swarm_held(why: Any): String = Tr.f(4287, arrayOf(why)) + val ios_swarm_topic: String get() = Tr.s(4288) + val ios_swarm_goal: String get() = Tr.s(4289) + val ios_swarm_seed: String get() = Tr.s(4290) + val ios_swarm_role: String get() = Tr.s(4291) + val ios_swarm_add: String get() = Tr.s(4292) + fun ios_swarm_remove_ask(name: Any): String = Tr.f(4293, arrayOf(name)) + val ios_swarm_stop_ask: String get() = Tr.s(4294) + val ios_swarm_post: String get() = Tr.s(4295) + val ios_image_save: String get() = Tr.s(4296) + val ios_image_saved: String get() = Tr.s(4297) + val ios_image_denied: String get() = Tr.s(4298) + val ios_image_failed: String get() = Tr.s(4299) + val ios_image_incoming: String get() = Tr.s(4300) + val ios_image_loadfail: String get() = Tr.s(4301) + val ios_image_unavailable: String get() = Tr.s(4302) + val native_permission_photos_add: String get() = Tr.s(4303) + fun ios_buy_ask(project: Any): String = Tr.f(4304, arrayOf(project)) + val ios_settings_accounts_usage: String get() = Tr.s(4305) + val ios_settings_machines_devices: String get() = Tr.s(4306) + val ios_settings_alerts_on: String get() = Tr.s(4307) + val ios_settings_alerts_off: String get() = Tr.s(4308) + fun ios_settings_accounts_n(n: Number): String = Tr.f(4309, arrayOf(n)) + val hub_acct_this_hubs_sign_in: String get() = Tr.s(4310) + val hub_acct_no_usage_reading_yet: String get() = Tr.s(4311) + val hub_acct_this_hubs_claude_sign_in: String get() = Tr.s(4312) + val hub_acct_this_hubs_codex_sign_in: String get() = Tr.s(4313) + val hub_acct_claude_cli_login: String get() = Tr.s(4314) + val hub_acct_codex_cli_login: String get() = Tr.s(4315) + val hub_acct_fable_weekly: String get() = Tr.s(4316) + fun ios_acct_also(names: Any): String = Tr.f(4317, arrayOf(names)) + val ios_clone_mode: String get() = Tr.s(4318) + val ios_clone_repo_hint: String get() = Tr.s(4319) + val ios_clone_signin: String get() = Tr.s(4320) + val ios_clone_change: String get() = Tr.s(4321) + val ios_clone_name: String get() = Tr.s(4322) + val ios_clone_thread: String get() = Tr.s(4323) + val ios_clone_go: String get() = Tr.s(4324) + fun ios_clone_into(dest: Any): String = Tr.f(4325, arrayOf(dest)) + val ios_clone_same: String get() = Tr.s(4326) + fun ios_clone_title(repo: Any): String = Tr.f(4327, arrayOf(repo)) + fun ios_clone_cloned(repo: Any): String = Tr.f(4328, arrayOf(repo)) + val ios_clone_cancelled: String get() = Tr.s(4329) + fun ios_clone_code(url: Any): String = Tr.f(4330, arrayOf(url)) + val ios_clone_signin_starting: String get() = Tr.s(4331) + val ios_clone_signin_done: String get() = Tr.s(4332) + val ios_clone_signin_open: String get() = Tr.s(4333) + val ios_clone_loading: String get() = Tr.s(4334) + val mobile_tab_inbox: String get() = Tr.s(4335) + val mobile_tab_crew: String get() = Tr.s(4336) + val mobile_tab_bench: String get() = Tr.s(4337) + val mobile_inbox_clear: String get() = Tr.s(4338) + val mobile_inbox_clear_note: String get() = Tr.s(4339) + val mobile_inbox_talk_bub: String get() = Tr.s(4340) + val mobile_inbox_jump_in: String get() = Tr.s(4341) + val mobile_inbox_open_bench: String get() = Tr.s(4342) + val mobile_badge_pcb: String get() = Tr.s(4343) + val mobile_pill_waiting: String get() = Tr.s(4344) + fun mobile_snooze_wakes(time: Any): String = Tr.f(4345, arrayOf(time)) + val mobile_bench_all: String get() = Tr.s(4346) + val mobile_snooze_for: String get() = Tr.s(4347) + val sidebar_sections_needs: String get() = Tr.s(4348) + val sidebar_sections_pinned: String get() = Tr.s(4349) + val sidebar_sections_active: String get() = Tr.s(4350) + val sidebar_sections_quiet: String get() = Tr.s(4351) + val sidebar_sections_quiet_hint: String get() = Tr.s(4352) + val sidebar_sections_running_word: String get() = Tr.s(4353) + val sidebar_sections_recent: String get() = Tr.s(4354) + val sidebar_sections_limit: String get() = Tr.s(4355) + val sidebar_sections_cut: String get() = Tr.s(4356) + val sidebar_sections_monitoring: String get() = Tr.s(4357) + val sidebar_sections_stopped: String get() = Tr.s(4358) + val sidebar_sections_done: String get() = Tr.s(4359) + val sidebar_sections_failed: String get() = Tr.s(4360) + val sidebar_sections_rename: String get() = Tr.s(4361) + val sidebar_sections_pin: String get() = Tr.s(4362) + val sidebar_sections_unpin: String get() = Tr.s(4363) + val sidebar_sections_quiet_make: String get() = Tr.s(4364) + val sidebar_sections_quiet_back: String get() = Tr.s(4365) + val sidebar_sections_quiet_hint2: String get() = Tr.s(4366) + fun gpui_sections_move_to(group: Any): String = Tr.f(4367, arrayOf(group)) + val sidebar_sections_move: String get() = Tr.s(4368) + val sidebar_sections_new_group: String get() = Tr.s(4369) + val sidebar_sections_new_group_title: String get() = Tr.s(4370) + fun sidebar_sections_remove_ask(project: Any): String = Tr.f(4371, arrayOf(project)) + fun gpui_sections_running(n: Number): String = Tr.f(4372, arrayOf(n)) + fun gpui_sections_rest(n: Number): String = Tr.f(4373, arrayOf(n)) + fun gpui_projects_mech(n: Any): String = Tr.f(4374, arrayOf(n)) + val gpui_open_folder: String get() = Tr.s(4375) + val gpui_picker_none: String get() = Tr.s(4376) + val gpui_picker_key_select: String get() = Tr.s(4377) + val gpui_picker_key_into: String get() = Tr.s(4378) + val gpui_picker_key_complete: String get() = Tr.s(4379) + val gpui_picker_key_open: String get() = Tr.s(4380) + val gpui_picker_added: String get() = Tr.s(4381) + fun gpui_picker_more_typed(n: Any): String = Tr.f(4382, arrayOf(n)) + val gpui_clone_tab: String get() = Tr.s(4383) + val gpui_clone_change: String get() = Tr.s(4384) + val gpui_clone_thread: String get() = Tr.s(4385) + val gpui_clone_retry: String get() = Tr.s(4386) + val gpui_clone_signin: String get() = Tr.s(4387) + val gpui_clone_back: String get() = Tr.s(4388) + val gpui_clone_open_thread: String get() = Tr.s(4389) + val gpui_clone_open_project: String get() = Tr.s(4390) + val gpui_clone_private: String get() = Tr.s(4391) + val gpui_clone_loading: String get() = Tr.s(4392) + val gpui_clone_signin_list: String get() = Tr.s(4393) + val gpui_clone_signin_code: String get() = Tr.s(4394) + val gpui_clone_signin_asking: String get() = Tr.s(4395) + val gpui_clone_signin_done: String get() = Tr.s(4396) + val gpui_clone_cancel: String get() = Tr.s(4397) + val gpui_picker_key_pick: String get() = Tr.s(4398) + val gpui_clone_phase_connecting: String get() = Tr.s(4399) + val gpui_clone_phase_receiving: String get() = Tr.s(4400) + val gpui_clone_phase_resolving: String get() = Tr.s(4401) + val gpui_clone_phase_updating: String get() = Tr.s(4402) + val gpui_clone_phase_counting: String get() = Tr.s(4403) + val gpui_clone_phase_compressing: String get() = Tr.s(4404) + val gpui_clone_phase_lfs: String get() = Tr.s(4405) + val gpui_clone_phase_adding: String get() = Tr.s(4406) + val gpui_clone_phase_starting: String get() = Tr.s(4407) + val gpui_assembly: String get() = Tr.s(4408) + val gpui_mech: String get() = Tr.s(4409) + val gpui_readme: String get() = Tr.s(4410) + val gpui_board: String get() = Tr.s(4411) + val gpui_schematic: String get() = Tr.s(4412) + val gpui_view_three_d: String get() = Tr.s(4413) + val gpui_files: String get() = Tr.s(4414) + val gpui_usage_bot: String get() = Tr.s(4415) + val gpui_usage_tokens: String get() = Tr.s(4416) + val gpui_usage_accounts_tip: String get() = Tr.s(4417) + val gpui_usage_feeds: String get() = Tr.s(4418) + val gpui_usage_lanes: String get() = Tr.s(4419) + val gpui_usage_turn_live: String get() = Tr.s(4420) + val gpui_usage_chat: String get() = Tr.s(4421) + val gpui_usage_today: String get() = Tr.s(4422) + val gpui_usage_prefs: String get() = Tr.s(4423) + val gpui_usage_handover: String get() = Tr.s(4424) + val gpui_usage_none_waiting: String get() = Tr.s(4425) + val gpui_usage_session: String get() = Tr.s(4426) + val gpui_usage_last_handover: String get() = Tr.s(4427) + val gpui_usage_triage: String get() = Tr.s(4428) + val gpui_usage_office: String get() = Tr.s(4429) + val gpui_usage_office_lower: String get() = Tr.s(4430) + val gpui_usage_compact: String get() = Tr.s(4431) + val gpui_usage_switch: String get() = Tr.s(4432) + val gpui_usage_note: String get() = Tr.s(4433) + val gpui_usage_lanes_note: String get() = Tr.s(4434) + val gpui_usage_lanes_routines: String get() = Tr.s(4435) + val gpui_usage_turns_many: String get() = Tr.s(4436) + val gpui_usage_turns_full: String get() = Tr.s(4437) + val gpui_usage_turns_one: String get() = Tr.s(4438) + fun gpui_usage_turns_n(n: Any): String = Tr.f(4439, arrayOf(n)) + fun gpui_usage_left(n: Any): String = Tr.f(4440, arrayOf(n)) + fun gpui_usage_of(a: Any, b: Any): String = Tr.f(4441, arrayOf(a, b)) + fun gpui_usage_context(n: Any): String = Tr.f(4442, arrayOf(n)) + val gpui_usage_noread: String get() = Tr.s(4443) + fun gpui_mgmt_bom_summary(parts: Number, lines: Number): String = Tr.f(4444, arrayOf(parts, lines)) + fun gpui_mgmt_bom_more(n: Number): String = Tr.f(4445, arrayOf(n)) + val gpui_mgmt_dock_right: String get() = Tr.s(4446) + val gpui_mgmt_dock_bottom: String get() = Tr.s(4447) + val gpui_mgmt_close: String get() = Tr.s(4448) + val gpui_mgmt_bom_saved: String get() = Tr.s(4449) + val gpui_mgmt_bom_reading: String get() = Tr.s(4450) + val gpui_mgmt_bom_nomatch: String get() = Tr.s(4451) + val gpui_mgmt_bom_nompn: String get() = Tr.s(4452) + val gpui_mgmt_filter: String get() = Tr.s(4453) + val gpui_mgmt_bom_noparts: String get() = Tr.s(4454) + val gpui_mgmt_bom_dnp: String get() = Tr.s(4455) + val gpui_mgmt_fab_tab: String get() = Tr.s(4456) + val gpui_mgmt_fab_drc_current: String get() = Tr.s(4457) + val gpui_mgmt_fab_drc_stale: String get() = Tr.s(4458) + val gpui_mgmt_fab_drc_update: String get() = Tr.s(4459) + val gpui_mgmt_fab_drc_none: String get() = Tr.s(4460) + val gpui_mgmt_fab_drc_write: String get() = Tr.s(4461) + val gpui_mgmt_fab_drc_noproject: String get() = Tr.s(4462) + val gpui_mgmt_fab_tier_extra: String get() = Tr.s(4463) + val gpui_mgmt_fab_tier_free: String get() = Tr.s(4464) + val gpui_mgmt_fab_reading: String get() = Tr.s(4465) + val gpui_mgmt_fab_thefab: String get() = Tr.s(4466) + val gpui_mgmt_fab_refresh: String get() = Tr.s(4467) + val gpui_mgmt_fab_apply: String get() = Tr.s(4468) + val gpui_mgmt_fab_changed: String get() = Tr.s(4469) + val gpui_mgmt_fab_seen: String get() = Tr.s(4470) + val gpui_mgmt_fab_limit: String get() = Tr.s(4471) + val gpui_mgmt_fab_free: String get() = Tr.s(4472) + val gpui_mgmt_fab_extra: String get() = Tr.s(4473) + val gpui_mgmt_fab_readcol: String get() = Tr.s(4474) + val gpui_mgmt_fab_derived: String get() = Tr.s(4475) + fun gpui_mgmt_fab_suggestion(what: Any, project: Any, fab: Any): String = Tr.f(4476, arrayOf(what, project, fab)) + fun gpui_mgmt_fab_read(rev: Any, day: Any): String = Tr.f(4477, arrayOf(rev, day)) + val gpui_mgmt_fab_reviewing: String get() = Tr.s(4478) + val gpui_mgmt_fab_noreview: String get() = Tr.s(4479) + val gpui_mgmt_fab_findings: String get() = Tr.s(4480) + val gpui_mgmt_fab_reviewbtn: String get() = Tr.s(4481) + val gpui_mgmt_fab_judge: String get() = Tr.s(4482) + val gpui_mgmt_plan_reading: String get() = Tr.s(4483) + val gpui_mgmt_plan_none: String get() = Tr.s(4484) + fun gpui_mgmt_plan_awaiting(n: Number): String = Tr.f(4485, arrayOf(n)) + val gpui_mgmt_plan_nothing: String get() = Tr.s(4486) + val gpui_mgmt_plan_saved: String get() = Tr.s(4487) + val gpui_mgmt_plan_all: String get() = Tr.s(4488) + val gpui_mgmt_plan_stop: String get() = Tr.s(4489) + val gpui_mgmt_plan_hide: String get() = Tr.s(4490) + val gpui_mgmt_plan_show: String get() = Tr.s(4491) + val gpui_mgmt_plan_done: String get() = Tr.s(4492) + val gpui_mgmt_plan_layer: String get() = Tr.s(4493) + val gpui_mgmt_plan_reject: String get() = Tr.s(4494) + val gpui_mgmt_plan_keysnote: String get() = Tr.s(4495) + fun gpui_mgmt_plan_reference(layer: Any): String = Tr.f(4496, arrayOf(layer)) + fun gpui_mgmt_plan_nets(n: Number): String = Tr.f(4497, arrayOf(n)) + val gpui_mgmt_plan_tab: String get() = Tr.s(4498) + val gpui_mgmt_plan_before: String get() = Tr.s(4499) + val gpui_mgmt_plan_onwords: String get() = Tr.s(4500) + val gpui_mgmt_plan_offwords: String get() = Tr.s(4501) + fun gpui_mgmt_plan_elsewhere(board: Any): String = Tr.f(4502, arrayOf(board)) + val gpui_mgmt_plan_openboard: String get() = Tr.s(4503) + val gpui_mgmt_plan_noboard: String get() = Tr.s(4504) + val gpui_mgmt_plan_drawn: String get() = Tr.s(4505) + val gpui_pick_planonce: String get() = Tr.s(4506) + val gpui_pick_planonce_note: String get() = Tr.s(4507) + val hub_view_board_unlisted: String get() = Tr.s(4508) + val gpui_mgmt_bom_stocknote: String get() = Tr.s(4509) + val hub_order_pick_more: String get() = Tr.s(4510) + val hub_order_pick_phone: String get() = Tr.s(4511) + val hub_order_pick_go: String get() = Tr.s(4512) + val gpui_plan_before_routing_desc: String get() = Tr.s(4513) + fun gpui_mgmt_bom_shared(others: Any): String = Tr.f(4514, arrayOf(others)) + fun gpui_mgmt_fab_review(must: Any, should: Any, notes: Any): String = Tr.f(4515, arrayOf(must, should, notes)) + fun gpui_mgmt_fab_stackup(id: Any, w: Any): String = Tr.f(4516, arrayOf(id, w)) + val gpui_mgmt_fab_proposed: String get() = Tr.s(4517) + val gpui_mgmt_fab_use: String get() = Tr.s(4518) + val gpui_keys_mgmt_bom: String get() = Tr.s(4519) + val gpui_keys_mgmt_checks: String get() = Tr.s(4520) + val gpui_keys_mgmt_life: String get() = Tr.s(4521) + val gpui_mgmt_checks_reading: String get() = Tr.s(4522) + val gpui_mgmt_checks_searching: String get() = Tr.s(4523) + val gpui_mgmt_checks_run: String get() = Tr.s(4524) + val gpui_mgmt_checks_running: String get() = Tr.s(4525) + fun gpui_mgmt_checks_behind(what: Any): String = Tr.f(4526, arrayOf(what)) + val gpui_mgmt_checks_stale: String get() = Tr.s(4527) + val gpui_mgmt_checks_liveunsaved: String get() = Tr.s(4528) + fun gpui_mgmt_checks_waiting(why: Any): String = Tr.f(4529, arrayOf(why)) + fun gpui_mgmt_checks_failed(why: Any): String = Tr.f(4530, arrayOf(why)) + val gpui_mgmt_checks_all: String get() = Tr.s(4531) + val gpui_mgmt_checks_errors: String get() = Tr.s(4532) + val gpui_mgmt_checks_warnings: String get() = Tr.s(4533) + val gpui_mgmt_checks_excluded: String get() = Tr.s(4534) + val gpui_mgmt_checks_fix: String get() = Tr.s(4535) + val gpui_mgmt_checks_reexport: String get() = Tr.s(4536) + fun gpui_mgmt_checks_more(n: Number): String = Tr.f(4537, arrayOf(n)) + val gpui_mgmt_checks_fewer: String get() = Tr.s(4538) + val gpui_mgmt_checks_none: String get() = Tr.s(4539) + val gpui_mgmt_checks_nomatch: String get() = Tr.s(4540) + val gpui_mgmt_checks_library: String get() = Tr.s(4541) + val gpui_mgmt_checks_withlib: String get() = Tr.s(4542) + val gpui_mgmt_checks_fullrun: String get() = Tr.s(4543) + val gpui_mgmt_checks_allsources: String get() = Tr.s(4544) + val gpui_mgmt_checks_judged: String get() = Tr.s(4545) + val gpui_mgmt_bom_dnp_tip: String get() = Tr.s(4546) + val gpui_mgmt_bom_writing: String get() = Tr.s(4547) + val gpui_mgmt_bom_inkicad: String get() = Tr.s(4548) + val gpui_mgmt_bom_saved_file: String get() = Tr.s(4549) + val gpui_mgmt_bom_fab: String get() = Tr.s(4550) + val gpui_mgmt_bom_mpn_ph: String get() = Tr.s(4551) + val gpui_mgmt_bom_fab_ph: String get() = Tr.s(4552) + fun gpui_mgmt_bom_each(price: Any, n: Any): String = Tr.f(4553, arrayOf(price, n)) + fun gpui_mgmt_bom_out(n: Any, need: Any): String = Tr.f(4554, arrayOf(n, need)) + fun gpui_mgmt_bom_low(n: Any): String = Tr.f(4555, arrayOf(n)) + fun gpui_mgmt_bom_in(n: Any): String = Tr.f(4556, arrayOf(n)) + fun gpui_mgmt_bom_cost(cost: Any): String = Tr.f(4557, arrayOf(cost)) + fun gpui_mgmt_bom_cost_least(cost: Any): String = Tr.f(4558, arrayOf(cost)) + val gpui_mgmt_bom_checking: String get() = Tr.s(4559) + val gpui_mgmt_bom_notknown: String get() = Tr.s(4560) + val gpui_mgmt_bom_stock: String get() = Tr.s(4561) + val gpui_mgmt_bom_alts: String get() = Tr.s(4562) + val gpui_mgmt_bom_alts_looking: String get() = Tr.s(4563) + val gpui_mgmt_bom_alts_none: String get() = Tr.s(4564) + val gpui_mgmt_bom_alts_use: String get() = Tr.s(4565) + val gpui_mgmt_bom_class_basic: String get() = Tr.s(4566) + val gpui_mgmt_bom_class_extended: String get() = Tr.s(4567) + val gpui_mgmt_bom_class_preferred: String get() = Tr.s(4568) + val gpui_mgmt_bom_notinstock: String get() = Tr.s(4569) + val gpui_mgmt_bom_off: String get() = Tr.s(4570) + fun gpui_mgmt_life_since(day: Any, n: Number): String = Tr.f(4571, arrayOf(day, n)) + fun gpui_mgmt_life_one(day: Any): String = Tr.f(4572, arrayOf(day)) + fun gpui_mgmt_life_now(cost: Any, n: Any, lines: Any): String = Tr.f(4573, arrayOf(cost, n, lines)) + fun gpui_mgmt_life_part_now(stock: Any, price: Any): String = Tr.f(4574, arrayOf(stock, price)) + fun gpui_mgmt_life_instock(lines: Any): String = Tr.f(4575, arrayOf(lines)) + val gpui_mgmt_life_board: String get() = Tr.s(4576) + val gpui_mgmt_life_price: String get() = Tr.s(4577) + val gpui_mgmt_life_active: String get() = Tr.s(4578) + val gpui_mgmt_life_nrnd: String get() = Tr.s(4579) + val gpui_mgmt_life_eol: String get() = Tr.s(4580) + val gpui_mgmt_life_unknown: String get() = Tr.s(4581) + val gpui_mgmt_life_nolines: String get() = Tr.s(4582) + val gpui_mgmt_life_noread: String get() = Tr.s(4583) + val gpui_mgmt_life_reading: String get() = Tr.s(4584) + val gpui_mgmt_life_nopart: String get() = Tr.s(4585) + val gpui_mgmt_life_tab: String get() = Tr.s(4586) + val gpui_mgmt_bom_paused: String get() = Tr.s(4587) + val gpui_mgmt_bom_paused_tip: String get() = Tr.s(4588) + val gpui_keys_mgmt_fab: String get() = Tr.s(4589) + val gpui_mgmt_bom_putback: String get() = Tr.s(4590) + val gpui_mgmt_bom_nochange: String get() = Tr.s(4591) + val gpui_mgmt_bom_deferred: String get() = Tr.s(4592) + val gpui_mgmt_bom_inkicad_save: String get() = Tr.s(4593) + val gpui_mgmt_bom_undo_tip: String get() = Tr.s(4594) + val gpui_mgmt_bom_undo: String get() = Tr.s(4595) + fun gpui_mgmt_checks_on(host: Any): String = Tr.f(4596, arrayOf(host)) + val gpui_gerbers: String get() = Tr.s(4597) + val gpui_gerbers_vs: String get() = Tr.s(4598) + val gpui_gerbers_vs_tip: String get() = Tr.s(4599) + val gpui_gerbers_gerbview: String get() = Tr.s(4600) + val gpui_gerbers_gerbview_tip: String get() = Tr.s(4601) + val gpui_mgmt_bom_saved_state: String get() = Tr.s(4602) + val gpui_mgmt_bom_live_tip: String get() = Tr.s(4603) + val gpui_mgmt_bom_saved_tip: String get() = Tr.s(4604) + val gpui_mgmt_bom_price: String get() = Tr.s(4605) + val gpui_mgmt_bom_class: String get() = Tr.s(4606) + fun gpui_mgmt_life_unknown_n(n: Any): String = Tr.f(4607, arrayOf(n)) + fun gpui_mgmt_life_unknown_tip(a: Any, b: Any): String = Tr.f(4608, arrayOf(a, b)) + fun gpui_mgmt_bom_stock_out(n: Any): String = Tr.f(4609, arrayOf(n)) + fun gpui_mgmt_bom_stock_low(n: Any): String = Tr.f(4610, arrayOf(n)) + val gpui_gerbers_boardonly: String get() = Tr.s(4611) + val gpui_gerbers_gerbersonly: String get() = Tr.s(4612) + fun gpui_mgmt_life_price_since(day: Any): String = Tr.f(4613, arrayOf(day)) + fun gpui_streamer_account(n: Any): String = Tr.f(4614, arrayOf(n)) + val gpui_streamer_mode: String get() = Tr.s(4615) + val gpui_streamer_section: String get() = Tr.s(4616) + val gpui_streamer_off: String get() = Tr.s(4617) + val gpui_streamer_on: String get() = Tr.s(4618) + val gpui_streamer_tip: String get() = Tr.s(4619) + val gpui_streamer_shared: String get() = Tr.s(4620) + val gpui_streamer_qr: String get() = Tr.s(4621) + val gpui_streamer_note: String get() = Tr.s(4622) + val gpui_streamer_share: String get() = Tr.s(4623) + val gpui_streamer_apps: String get() = Tr.s(4624) + val gpui_streamer_apps_note: String get() = Tr.s(4625) + val gpui_streamer_linux: String get() = Tr.s(4626) + val gpui_streamer_mac: String get() = Tr.s(4627) + val gpui_streamer_win: String get() = Tr.s(4628) + val gpui_f2_uber_title: String get() = Tr.s(4629) + val gpui_f2_uber_body: String get() = Tr.s(4630) + val gpui_f2_uber_say: String get() = Tr.s(4631) + val gpui_f2_uber_here: String get() = Tr.s(4632) + val gpui_f2_uber_err_name: String get() = Tr.s(4633) + val gpui_f2_uber_err_color: String get() = Tr.s(4634) + val gpui_f2_uber_color: String get() = Tr.s(4635) + val gpui_f2_uber_own: String get() = Tr.s(4636) + val gpui_f2_uber_custom: String get() = Tr.s(4637) + val gpui_f2_uber_hex: String get() = Tr.s(4638) + val gpui_f2_uber_use: String get() = Tr.s(4639) + val gpui_f2_uber_shuffle: String get() = Tr.s(4640) + val gpui_f2_uber_auto: String get() = Tr.s(4641) + val gpui_f2_uber_savename: String get() = Tr.s(4642) + val gpui_f2_uber_p_ginger: String get() = Tr.s(4643) + val gpui_f2_uber_p_cream: String get() = Tr.s(4644) + val gpui_f2_uber_p_smoke: String get() = Tr.s(4645) + val gpui_f2_uber_p_midnight: String get() = Tr.s(4646) + val gpui_f2_uber_p_cocoa: String get() = Tr.s(4647) + val gpui_f2_uber_p_sky: String get() = Tr.s(4648) + val gpui_f2_uber_p_lilac: String get() = Tr.s(4649) + val gpui_f2_uber_p_rose: String get() = Tr.s(4650) + val gpui_f2_uber_p_mint: String get() = Tr.s(4651) + val gpui_f2_uber_p_cherry: String get() = Tr.s(4652) + val gpui_simulation: String get() = Tr.s(4653) + val gpui_c_sheets_find: String get() = Tr.s(4654) + fun history_snap(turn: Any): String = Tr.f(4655, arrayOf(turn)) + val history_ref_snap: String get() = Tr.s(4656) + val thread_restore_action: String get() = Tr.s(4657) + val thread_restore_ask: String get() = Tr.s(4658) + val thread_restore_note: String get() = Tr.s(4659) + val thread_restore_go: String get() = Tr.s(4660) + val mouse_mouseandtrackpad0: String get() = Tr.s(4661) + val mouse_zoomdirection1: String get() = Tr.s(4662) + val mouse_appliestothewheelandatrackpads2: String get() = Tr.s(4663) + val mouse_normal3: String get() = Tr.s(4664) + val mouse_inverted4: String get() = Tr.s(4665) + val mouse_boardandschematic5: String get() = Tr.s(4666) + val mouse_k3dandstep6: String get() = Tr.s(4667) + val mouse_changedfromitspreseteachinputd7: String get() = Tr.s(4668) + val mouse_apresetsetseveryinputbeloweach8: String get() = Tr.s(4669) + val mouse_legacy10: String get() = Tr.s(4670) + val mouse_leftdrag11: String get() = Tr.s(4671) + val mouse_middledrag12: String get() = Tr.s(4672) + val mouse_rightdrag13: String get() = Tr.s(4673) + val mouse_shiftleftdrag14: String get() = Tr.s(4674) + val mouse_ctrlleftdrag15: String get() = Tr.s(4675) + val mouse_altleftdrag16: String get() = Tr.s(4676) + val mouse_wheel17: String get() = Tr.s(4677) + val mouse_shiftwheel18: String get() = Tr.s(4678) + val mouse_ctrlwheel19: String get() = Tr.s(4679) + val mouse_altwheel20: String get() = Tr.s(4680) + val mouse_nothing21: String get() = Tr.s(4681) + val mouse_pan22: String get() = Tr.s(4682) + val mouse_pansideways23: String get() = Tr.s(4683) + val mouse_panupanddown24: String get() = Tr.s(4684) + val mouse_zoom25: String get() = Tr.s(4685) + val mouse_rotate26: String get() = Tr.s(4686) + val mouse_roll27: String get() = Tr.s(4687) + val mouse_select28: String get() = Tr.s(4688) + val mouse_aclickwithoutmovingwithnokeyhe29: String get() = Tr.s(4689) + val mouse_leftbutton30: String get() = Tr.s(4690) + val mouse_middlebutton31: String get() = Tr.s(4691) + val mouse_rightbutton32: String get() = Tr.s(4692) + val mouse_twofingerscroll33: String get() = Tr.s(4693) + val mouse_atrackpadstwofingerswithctrlhe34: String get() = Tr.s(4694) + val mouse_pans35: String get() = Tr.s(4695) + val mouse_isthewheel36: String get() = Tr.s(4696) + val mouse_pinch37: String get() = Tr.s(4697) + val mouse_atrackpadpinch38: String get() = Tr.s(4698) + val mouse_zooms39: String get() = Tr.s(4699) + val mouse_chooseaninputforitabove41: String get() = Tr.s(4700) + val mouse_nothingissettopan42: String get() = Tr.s(4701) + val mouse_nothingissettozoom43: String get() = Tr.s(4702) + val mouse_nothingissettorotate44: String get() = Tr.s(4703) + val gpui_review_mark: String get() = Tr.s(4704) + val gpui_review_mark_tip: String get() = Tr.s(4705) + val gpui_review_why: String get() = Tr.s(4706) + val gpui_review_allow: String get() = Tr.s(4707) + val gpui_review_allow_tip: String get() = Tr.s(4708) + val gpui_review_off: String get() = Tr.s(4709) + val gpui_review_again: String get() = Tr.s(4710) + val gpui_review_again_tip: String get() = Tr.s(4711) + val gpui_rail_no_board: String get() = Tr.s(4712) + val gpui_rail_no_schematic: String get() = Tr.s(4713) + val gpui_rail_split_needs_both: String get() = Tr.s(4714) + val gpui_rail_no_mech: String get() = Tr.s(4715) + val gpui_panestate_next_board: String get() = Tr.s(4716) + val gpui_panestate_next_schematic: String get() = Tr.s(4717) + val gpui_panestate_next_solid: String get() = Tr.s(4718) + val gpui_panestate_empty_gerbers: String get() = Tr.s(4719) + val gpui_panestate_next_gerbers: String get() = Tr.s(4720) + val gpui_panestate_gerbers_noboard: String get() = Tr.s(4721) + val gpui_panestate_gerbers_noboard_next: String get() = Tr.s(4722) + val gpui_panestate_empty_mech: String get() = Tr.s(4723) + val gpui_panestate_next_mech: String get() = Tr.s(4724) + val gpui_panestate_loading_split: String get() = Tr.s(4725) + val gpui_panestate_retrying: String get() = Tr.s(4726) + val gpui_hub_view_notready: String get() = Tr.s(4727) + val gpui_hub_view_staleconn: String get() = Tr.s(4728) + val gpui_hub_view_unavailable: String get() = Tr.s(4729) + val settings_designmode_label: String get() = Tr.s(4730) + val settings_designmode_viewer: String get() = Tr.s(4731) + val settings_designmode_kicad: String get() = Tr.s(4732) + val settings_designmode_note: String get() = Tr.s(4733) + val review_empty_title: String get() = Tr.s(4734) + val review_empty_next: String get() = Tr.s(4735) + val viewer_diff_threadchanges: String get() = Tr.s(4736) + val viewer_layout_refusal_locked: String get() = Tr.s(4737) + val viewer_layout_refusal_toosmall: String get() = Tr.s(4738) + val viewer_layout_refusal_onekicad: String get() = Tr.s(4739) + val viewer_layout_refusal_incompatibleoverlay: String get() = Tr.s(4740) + val viewer_layout_refusal_notfound: String get() = Tr.s(4741) + val viewer_layout_refusal_nooverlay: String get() = Tr.s(4742) + val viewer_layout_refusal_invalidsource: String get() = Tr.s(4743) + val viewer_layout_refusal_sametile: String get() = Tr.s(4744) + val viewer_layout_refusal_invalidratio: String get() = Tr.s(4745) + val viewer_layout_refusal_duplicateid: String get() = Tr.s(4746) + val viewer_layout_refusal_unknownframe: String get() = Tr.s(4747) + val viewer_layout_refusal_invalidinput: String get() = Tr.s(4748) + val viewer_layout_refusal_toomany: String get() = Tr.s(4749) + val viewer_layout_refusal_toomanysources: String get() = Tr.s(4750) + val viewer_layout_refusal_unresolvedversion: String get() = Tr.s(4751) + val viewer_layout_refusal_nohistory: String get() = Tr.s(4752) + val viewer_layout_refusal_linked: String get() = Tr.s(4753) + val viewer_layout_refusal_notondevice: String get() = Tr.s(4754) + val viewer_layout_refusal_starting: String get() = Tr.s(4755) + val viewer_footprinteditor: String get() = Tr.s(4756) + val viewer_symboleditor: String get() = Tr.s(4757) + val web_clone_tab: String get() = Tr.s(4758) + val web_clone_repo_placeholder: String get() = Tr.s(4759) + val web_clone_private: String get() = Tr.s(4760) + val web_clone_signin: String get() = Tr.s(4761) + val web_clone_signin_wait: String get() = Tr.s(4762) + val web_clone_signin_enter: String get() = Tr.s(4763) + val web_clone_signin_done: String get() = Tr.s(4764) + val web_clone_copied: String get() = Tr.s(4765) + val web_clone_change_folder: String get() = Tr.s(4766) + val web_clone_folder_name: String get() = Tr.s(4767) + val web_clone_start_thread: String get() = Tr.s(4768) + fun web_clone_first(text: Any): String = Tr.f(4769, arrayOf(text)) + val web_clone_same: String get() = Tr.s(4770) + val web_clone_go: String get() = Tr.s(4771) + fun web_clone_cloning(repo: Any, dest: Any): String = Tr.f(4772, arrayOf(repo, dest)) + fun web_clone_cloned(repo: Any, dest: Any): String = Tr.f(4773, arrayOf(repo, dest)) + fun web_clone_stopped(repo: Any): String = Tr.f(4774, arrayOf(repo)) + val web_clone_retry: String get() = Tr.s(4775) + val web_clone_back: String get() = Tr.s(4776) + val web_clone_open_thread: String get() = Tr.s(4777) + val web_clone_open_project: String get() = Tr.s(4778) + fun web_clone_add_dir(dir: Any): String = Tr.f(4779, arrayOf(dir)) + fun web_clone_use_dir(dir: Any): String = Tr.f(4780, arrayOf(dir)) + val web_clone_up: String get() = Tr.s(4781) + val web_clone_loading: String get() = Tr.s(4782) + val web_clone_no_folders: String get() = Tr.s(4783) + fun gpui_c_kicad_opening(editor: Any, job: Any, secs: Any): String = Tr.f(4784, arrayOf(editor, job, secs)) + fun gpui_c_kicad_openingbare(editor: Any, secs: Any): String = Tr.f(4785, arrayOf(editor, secs)) + fun gpui_c_kicad_openfailed(editor: Any): String = Tr.f(4786, arrayOf(editor)) + val viewer_tile_rail_add: String get() = Tr.s(4787) + val viewer_tile_add: String get() = Tr.s(4788) + val viewer_tile_maximize: String get() = Tr.s(4789) + val viewer_tile_restore: String get() = Tr.s(4790) + val viewer_tile_focus: String get() = Tr.s(4791) + val viewer_tile_embedded: String get() = Tr.s(4792) + val viewer_tile_simulation_single: String get() = Tr.s(4793) + val viewer_tile_add_tip: String get() = Tr.s(4794) + val viewer_tile_left: String get() = Tr.s(4795) + val viewer_tile_right: String get() = Tr.s(4796) + val viewer_tile_top: String get() = Tr.s(4797) + val viewer_tile_bottom: String get() = Tr.s(4798) + val web_pair_subtitle: String get() = Tr.s(4799) + val web_pair_name: String get() = Tr.s(4800) + val web_pair_request: String get() = Tr.s(4801) + val web_pair_code: String get() = Tr.s(4802) + fun web_pair_approve_in(time: Any): String = Tr.f(4803, arrayOf(time)) + val web_pair_expired: String get() = Tr.s(4804) + val web_pair_approved: String get() = Tr.s(4805) + val web_pair_denied: String get() = Tr.s(4806) + val web_pair_cancelled: String get() = Tr.s(4807) + val web_pair_requesting: String get() = Tr.s(4808) + fun web_pair_failed(status: Any): String = Tr.f(4809, arrayOf(status)) + val web_pair_ratelimited: String get() = Tr.s(4810) + val web_pair_nocode: String get() = Tr.s(4811) + val web_pair_unreachable: String get() = Tr.s(4812) + val web_chat_loading: String get() = Tr.s(4813) + val web_chat_choose: String get() = Tr.s(4814) + val web_chat_empty: String get() = Tr.s(4815) + val web_chat_streaming: String get() = Tr.s(4816) + fun web_chat_finished(time: Any): String = Tr.f(4817, arrayOf(time)) + fun web_chat_finished_dur(time: Any, dur: Any): String = Tr.f(4818, arrayOf(time, dur)) + val web_chat_answer_placeholder: String get() = Tr.s(4819) + val web_chat_answer_btn: String get() = Tr.s(4820) + fun web_chat_answered(answer: Any): String = Tr.f(4821, arrayOf(answer)) + val web_chat_review_mode: String get() = Tr.s(4822) + val web_composer_attach: String get() = Tr.s(4823) + val web_composer_voice: String get() = Tr.s(4824) + fun web_composer_unsupported(type: Any): String = Tr.f(4825, arrayOf(type)) + fun web_composer_maximages(max: Any): String = Tr.f(4826, arrayOf(max)) + val web_logout_failed: String get() = Tr.s(4827) + val thread_context_title: String get() = Tr.s(4828) + val thread_context_instructions: String get() = Tr.s(4829) + val thread_context_system: String get() = Tr.s(4830) + val thread_context_skills: String get() = Tr.s(4831) + val thread_context_mcp: String get() = Tr.s(4832) + val thread_context_mcp_short: String get() = Tr.s(4833) + val thread_context_reading: String get() = Tr.s(4834) + val thread_context_none_instructions: String get() = Tr.s(4835) + val thread_context_none_mcp: String get() = Tr.s(4836) + val thread_context_native_note: String get() = Tr.s(4837) + val thread_context_copy: String get() = Tr.s(4838) + val thread_context_copied: String get() = Tr.s(4839) + val thread_context_base: String get() = Tr.s(4840) + val thread_context_injected_label: String get() = Tr.s(4841) + val thread_context_index: String get() = Tr.s(4842) + val thread_context_scope_user: String get() = Tr.s(4843) + val thread_context_scope_bundled: String get() = Tr.s(4844) + val thread_context_native: String get() = Tr.s(4845) + val thread_context_injected: String get() = Tr.s(4846) + val thread_context_cross: String get() = Tr.s(4847) + val thread_context_explicit: String get() = Tr.s(4848) + val thread_context_untrusted: String get() = Tr.s(4849) + val thread_context_invalid: String get() = Tr.s(4850) + val thread_context_trust: String get() = Tr.s(4851) + val thread_context_enable: String get() = Tr.s(4852) + val thread_context_disable: String get() = Tr.s(4853) + fun thread_context_size(bytes: Any, tokens: Any): String = Tr.f(4854, arrayOf(bytes, tokens)) + val thread_context_unreachable: String get() = Tr.s(4855) + val gpui_planmode_top_once: String get() = Tr.s(4856) + val gpui_planmode_top_planning: String get() = Tr.s(4857) + val gpui_planmode_top_pending: String get() = Tr.s(4858) + val gpui_planmode_top_executing: String get() = Tr.s(4859) + val gpui_planmode_tip: String get() = Tr.s(4860) + val gpui_planmode_chip_building: String get() = Tr.s(4861) + val gpui_planmode_chip_once: String get() = Tr.s(4862) + val gpui_planmode_bar_once: String get() = Tr.s(4863) + val gpui_planmode_bar_always: String get() = Tr.s(4864) + val gpui_planmode_bar_planning: String get() = Tr.s(4865) + val gpui_planmode_bar_pending: String get() = Tr.s(4866) + val gpui_planmode_bar_executing: String get() = Tr.s(4867) + val gpui_planmode_scope_once: String get() = Tr.s(4868) + val gpui_planmode_scope_always: String get() = Tr.s(4869) + val gpui_ask_plan_ready: String get() = Tr.s(4870) + val gpui_ask_plan_revise: String get() = Tr.s(4871) + val gpui_ask_plan_sendrev: String get() = Tr.s(4872) + val gpui_ask_plan_reviseph: String get() = Tr.s(4873) + val gpui_mgmt_plan_st_blocked: String get() = Tr.s(4874) + val gpui_mgmt_plan_st_routing: String get() = Tr.s(4875) + val gpui_mgmt_plan_st_awaiting: String get() = Tr.s(4876) + val gpui_mgmt_plan_st_verified: String get() = Tr.s(4877) + val gpui_mgmt_plan_st_routed: String get() = Tr.s(4878) + val gpui_mgmt_plan_st_approved: String get() = Tr.s(4879) + val gpui_mgmt_plan_st_partial: String get() = Tr.s(4880) + val gpui_mgmt_plan_st_rejected: String get() = Tr.s(4881) + val gpui_mgmt_plan_st_empty: String get() = Tr.s(4882) + val gpui_mgmt_plan_refused: String get() = Tr.s(4883) + val gpui_mgmt_plan_emptysub: String get() = Tr.s(4884) + val gpui_mgmt_plan_verify: String get() = Tr.s(4885) + val gpui_mgmt_plan_reqplain: String get() = Tr.s(4886) + fun gpui_mgmt_plan_requested(what: Any): String = Tr.f(4887, arrayOf(what)) + val gpui_mgmt_plan_stackup: String get() = Tr.s(4888) + val gpui_keys_planmode: String get() = Tr.s(4889) + val gpui_keys_mgmt_plan: String get() = Tr.s(4890) + fun web_plan_awaiting(n: Any): String = Tr.f(4891, arrayOf(n)) + val web_plan_net_one: String get() = Tr.s(4892) + fun web_plan_nets(n: Any): String = Tr.f(4893, arrayOf(n)) + val gpui_mgmt_plan_view_canvas: String get() = Tr.s(4894) + val gpui_mgmt_plan_view_split: String get() = Tr.s(4895) + val gpui_mgmt_plan_view_list: String get() = Tr.s(4896) + val gpui_mgmt_plan_grid_all: String get() = Tr.s(4897) + val gpui_mgmt_plan_grid_pair: String get() = Tr.s(4898) + val gpui_mgmt_plan_grid_single: String get() = Tr.s(4899) + val gpui_mgmt_plan_expand: String get() = Tr.s(4900) + val gpui_mgmt_plan_compact: String get() = Tr.s(4901) + val gpui_mgmt_plan_sync: String get() = Tr.s(4902) + val gpui_mgmt_plan_fit: String get() = Tr.s(4903) + val gpui_mgmt_plan_lock: String get() = Tr.s(4904) + val gpui_mgmt_plan_unlock: String get() = Tr.s(4905) + val gpui_mgmt_plan_layer_move: String get() = Tr.s(4906) + val gpui_mgmt_plan_width: String get() = Tr.s(4907) + val gpui_mgmt_plan_addnote: String get() = Tr.s(4908) + val gpui_mgmt_plan_note_placeholder: String get() = Tr.s(4909) + val gpui_mgmt_plan_hint: String get() = Tr.s(4910) + val gpui_mgmt_plan_rejectlayer: String get() = Tr.s(4911) + val gpui_mgmt_plan_edited: String get() = Tr.s(4912) + val gpui_mgmt_plan_locked: String get() = Tr.s(4913) + val gpui_mgmt_plan_noitems: String get() = Tr.s(4914) + val gpui_mgmt_plan_stackup_short: String get() = Tr.s(4915) + val gpui_mgmt_plan_layer_short: String get() = Tr.s(4916) + fun gpui_mgmt_plan_awaiting_short(n: Any): String = Tr.f(4917, arrayOf(n)) + fun gpui_mgmt_plan_done_of(done: Any, total: Any): String = Tr.f(4918, arrayOf(done, total)) + val gpui_planmode_chip_review: String get() = Tr.s(4919) + val mobile_plan_steer: String get() = Tr.s(4920) + val mobile_plan_details: String get() = Tr.s(4921) + val mobile_plan_reset: String get() = Tr.s(4922) + val mobile_plan_removepoint: String get() = Tr.s(4923) + val mobile_plan_touchhint: String get() = Tr.s(4924) + val mobile_plan_copied: String get() = Tr.s(4925) + fun mobile_plan_widthmm(v: Any): String = Tr.f(4926, arrayOf(v)) + fun mobile_plan_coord(x: Any, y: Any): String = Tr.f(4927, arrayOf(x, y)) + val provider_notice_head: String get() = Tr.s(4928) + val provider_notice_text_none: String get() = Tr.s(4929) + val provider_notice_text_signedout: String get() = Tr.s(4930) + val provider_notice_button: String get() = Tr.s(4931) + val provider_notice_senderr: String get() = Tr.s(4932) + fun provider_notice_senderr_remote(machine: Any): String = Tr.f(4933, arrayOf(machine)) + val web_settings_providers: String get() = Tr.s(4934) + val web_settings_providers_browser: String get() = Tr.s(4935) + fun order_lead_days(days: Number): String = Tr.f(4936, arrayOf(days)) + fun order_estimate_warnings(warnings: Any): String = Tr.f(4937, arrayOf(warnings)) + val web_home_open: String get() = Tr.s(4938) + val web_home_fold: String get() = Tr.s(4939) + val web_home_unfold: String get() = Tr.s(4940) + val web_home_loading: String get() = Tr.s(4941) + val web_home_error: String get() = Tr.s(4942) + fun web_home_lead(n: Any): String = Tr.f(4943, arrayOf(n)) + val web_home_lead_one: String get() = Tr.s(4944) + val web_ring_unavailable: String get() = Tr.s(4945) + val web_ring_loading: String get() = Tr.s(4946) + val web_ring_error: String get() = Tr.s(4947) + fun web_ring_count(n: Any): String = Tr.f(4948, arrayOf(n)) + val web_ring_count_one: String get() = Tr.s(4949) + fun web_ring_found(found: Any, total: Any, q: Any): String = Tr.f(4950, arrayOf(found, total, q)) + val web_ring_not_heard: String get() = Tr.s(4951) + val web_ring_app_words: String get() = Tr.s(4952) + fun web_ring_heard_by(model: Any): String = Tr.f(4953, arrayOf(model)) + fun web_ring_heard_by_sure(model: Any, conf: Any): String = Tr.f(4954, arrayOf(model, conf)) + val web_ring_state_sent: String get() = Tr.s(4955) + val web_ring_state_new: String get() = Tr.s(4956) + val web_ring_state_heard: String get() = Tr.s(4957) + val web_ring_state_failed: String get() = Tr.s(4958) + val web_ring_state_busy: String get() = Tr.s(4959) + val web_ring_no_words: String get() = Tr.s(4960) } diff --git a/mobile/ios/Shared/TrCatalog.swift b/mobile/ios/Shared/TrCatalog.swift index e6c119a819..9b27fc6f07 100644 --- a/mobile/ios/Shared/TrCatalog.swift +++ b/mobile/ios/Shared/TrCatalog.swift @@ -2834,6 +2834,12 @@ gpui.star.dont.ask Don't ask again 今後表示しない No preguntar de nuevo gpui.star.why Stars help other hardware designers find Backplane, and tell us what to keep building. スターは、ほかのハードウェア設計者がBackplaneを見つける助けになり、私たちが何を作り続けるべきかを知る手がかりにもなります。 Las estrellas ayudan a otros diseñadores de hardware a encontrar Backplane y nos indican qué seguir construyendo. gpui.projects.unpushed {n, plural, one {# commit not pushed to {upstream}} other {# commits not pushed to {upstream}}} {upstream} にプッシュしていないコミット: {n} 件 {n, plural, one {# commit sin enviar a {upstream}} other {# commits sin enviar a {upstream}}} gpui.projects.push Push プッシュ Enviar +chats.new New chat 新しいチャット Chat nuevo +chats.new.noproject New chat (no project) 新しいチャット(プロジェクトなし) Chat nuevo (sin proyecto) +chats.title Chats チャット Chats +chats.move Move to project… プロジェクトに移動… Mover a un proyecto… +chats.move.none No project to move it to. Add a project first. 移動先のプロジェクトがありません。先にプロジェクトを追加してください。 No hay ningún proyecto al que moverlo. Añade uno primero. +chats.old.tip Older chats that belong to no project, kept as they are. New chat starts a new one. プロジェクトに属さない以前のチャットです。そのまま残っています。新しいチャットから新しく始められます。 Chats antiguos sin proyecto, tal como estaban. Chat nuevo empieza uno. gpui.e.files.max.mb Largest attachment (MB) 添付の上限(MB) Adjunto más grande (MB) gpui.e.files.max.note A file sent with a message, or shown from this hub, may be up to {mb} MB. Files stream from disk, so a large one costs disk space, not memory. メッセージで送るファイルやこのハブから表示するファイルは{mb} MBまでです。ファイルはディスクから順に読むので、大きなファイルはメモリではなくディスク容量を使います。 Un archivo enviado con un mensaje, o mostrado desde este hub, puede pesar hasta {mb} MB. Los archivos se transmiten desde disco, así que uno grande consume espacio en disco, no memoria. gpui.e.dev.replay Replay first run 初回起動をやり直す Repetir primer inicio diff --git a/native/gpui/src/keys.rs b/native/gpui/src/keys.rs index 3bf1c8e618..35d754411b 100644 --- a/native/gpui/src/keys.rs +++ b/native/gpui/src/keys.rs @@ -6,7 +6,7 @@ use crate::i18n::{tr, trs}; use gpui::{actions, prelude::*, *}; use serde_json::Value; -actions!(keys, [NewThread, OpenDiff, OpenFiles, StopTurn, ModelPicker, PrevThread, NextThread, UberChat, AlwaysOn, SettleThread, FocusComposer, CycleLayers, PerfOverlay, +actions!(keys, [NewThread, NewChat, OpenDiff, OpenFiles, StopTurn, ModelPicker, PrevThread, NextThread, UberChat, AlwaysOn, SettleThread, FocusComposer, CycleLayers, PerfOverlay, AccountMenu, Account1, Account2, Account3, Account4, Account5, Account6, Account7, Account8, Account9, PickUp, PickDown, PickLeft, PickRight, PickTab, PickBackTab, PickEnter, Project1, Project2, Project3, Project4, Project5, Project6, Project7, Project8, Project9, @@ -76,6 +76,7 @@ pub const TABLE: &[Entry] = &[ /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("uber", "Uberbot chat", "Sidebar", "secondary-shift-u", Rebind), /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("always", "Always-on dictation: listen or mute", "Window", "secondary-shift-m", Rebind), /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("new", "New thread", "Timeline", "secondary-n", Rebind), + /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("new-chat", "New chat (no project)", "Sidebar", "secondary-shift-n", Rebind), /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("settle", "Settle or unsettle the thread", "Timeline", "secondary-shift-s", Rebind), /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("stop", "Stop the running turn", "Timeline", "ctrl-.", Rebind), /* i18n-ok: key contexts, and the table's words are drawn by Settings through trs */ e("diff", "Diff", "Viewer", "secondary-d", Rebind), @@ -147,10 +148,16 @@ pub fn show(key: &str, mac: bool) -> String { pub fn mac() -> bool { cfg!(target_os = "macos") } /// The key of a shortcut for the person to read, "" when it has none. pub fn hint(l: &Local, id: &str) -> String { match find(id) { Some(x) if x.kind == Fixed => show(x.key, mac()), Some(_) => show(&l.key(id), mac()), None => String::new() } } +/// The place of the chats that belong to no project (the hub's `sidebar::CHATS`): `new-thread` with it starts one, in a folder of its own. +pub const CHATS: &str = "chats"; +impl Backplane { + /// New chat: a thread in no project, opened as soon as the hub has made it. No picker, nothing to choose. + pub(crate) fn new_chat(&mut self, cx: &mut Context) { self.arm_new(); let _ = self.tx.try_send(Command::Action("new-thread".into(), CHATS.into())); cx.notify(); } +} /// The shortcut a palette item or tool does, by the hub's action and value (`current`: the open thread's project, for New thread). pub fn id_for(action: &str, value: &str, current: &str) -> &'static str { match (action, value) { - ("new-thread", v) if !v.is_empty() && v == current => "new", ("diff", _) => "diff", ("interrupt", _) => "stop", ("settle" | "unsettle", _) => "settle", + ("new-thread", CHATS) => "new-chat", ("new-thread", v) if !v.is_empty() && v == current => "new", ("diff", _) => "diff", ("interrupt", _) => "stop", ("settle" | "unsettle", _) => "settle", ("view-kind", "files") => "files", _ => "", } } @@ -168,7 +175,7 @@ pub fn bindings(l: &Local) -> Vec { KeyBinding::new(&k("close"), crate::ClosePopup, None), KeyBinding::new("secondary-c", crate::CopySelection, Some(NOT_MAC_COMPOSER)), KeyBinding::new(&k("sidebar"), crate::ToggleSidebarKey, None), KeyBinding::new(&k("search"), crate::FocusSearchKey, None), KeyBinding::new(&k("palette"), crate::OpenPaletteKey, None), KeyBinding::new("secondary-shift-p", crate::OpenPaletteKey, None), - KeyBinding::new(&k("new"), NewThread, None), KeyBinding::new(&k("diff"), OpenDiff, None), KeyBinding::new(&k("files"), OpenFiles, None), + KeyBinding::new(&k("new"), NewThread, None), KeyBinding::new(&k("new-chat"), NewChat, None), KeyBinding::new(&k("diff"), OpenDiff, None), KeyBinding::new(&k("files"), OpenFiles, None), KeyBinding::new(&k("stop"), StopTurn, None), KeyBinding::new(&k("models"), ModelPicker, None), KeyBinding::new(&k("account"), AccountMenu, None), KeyBinding::new(&k("prev"), PrevThread, None), KeyBinding::new(&k("next"), NextThread, None), KeyBinding::new(&k("uber"), UberChat, None), KeyBinding::new(&k("always"), AlwaysOn, None), KeyBinding::new(&k("settle"), SettleThread, None), KeyBinding::new(&k("layers"), CycleLayers, Some(NOT_FIELD)), KeyBinding::new(&k("perf"), PerfOverlay, None), @@ -472,6 +479,7 @@ pub fn attach(el: Div, picker: bool, cx: &mut Context) -> Div { let pid = new_target(&this.data, &this.selected, this.project_page.as_deref()); if !pid.is_empty() { this.arm_new(); let _ = this.tx.try_send(Command::Action("new-thread".into(), pid)); cx.notify(); } }); + let el = on!(el, NewChat, |this: &mut Backplane, _, cx: &mut Context| this.new_chat(cx)); let el = on!(el, OpenDiff, |this: &mut Backplane, _, cx: &mut Context| this.key_rail("diff", "", cx)); let el = on!(el, OpenFiles, |this: &mut Backplane, _, cx: &mut Context| this.key_rail("view-kind", "files", cx)); let el = on!(el, StopTurn, |this: &mut Backplane, _, cx: &mut Context| if has_tool(&this.data, "interrupt") { let _ = this.tx.try_send(Command::Action("interrupt".into(), String::new())); cx.notify(); }); @@ -882,7 +890,7 @@ mod tests { crate::screens::viewer::forget_press(); } #[test] fn hints_follow_the_hubs_actions() { - assert_eq!(id_for("diff", "", ""), "diff"); assert_eq!(id_for("interrupt", "", ""), "stop"); assert_eq!(id_for("new-thread", "p1", "p1"), "new"); assert_eq!(id_for("new-thread", "p2", "p1"), ""); + assert_eq!(id_for("diff", "", ""), "diff"); assert_eq!(id_for("interrupt", "", ""), "stop"); assert_eq!(id_for("new-thread", "p1", "p1"), "new"); assert_eq!(id_for("new-thread", "p2", "p1"), ""); assert_eq!(id_for("new-thread", CHATS, "p1"), "new-chat", "New chat says its key in the palette"); assert_eq!(hint(&Local::default(), "stop"), show("ctrl-.", mac())); assert_eq!(rail_letter("3d"), "3"); } } diff --git a/native/gpui/src/screens/ctxmenu.rs b/native/gpui/src/screens/ctxmenu.rs index e00c09203b..daa03baafd 100644 --- a/native/gpui/src/screens/ctxmenu.rs +++ b/native/gpui/src/screens/ctxmenu.rs @@ -64,6 +64,12 @@ pub fn image_items(path: &str) -> Vec { v } +/// A chat's Move to project…: the hub's `menu` item `move`, whose `sub` lists the projects (each sends `row-move-project`); none when the hub sent +/// none (a thread of a project, an older hub, no project to move to). +pub fn move_item(menu: &Value) -> Option { + let m = menu.as_array()?.iter().find(|x| x["id"] == "move" && x["sub"].as_array().map_or(false, |a| !a.is_empty()))?; + section_items(&Value::Array(vec![m.clone()])).into_iter().next() +} /// The items for a thread row of the sidebar (`t` is its row, `project` the raw id of the project it is in). pub fn thread_items(t: &Value, project: &str) -> Vec { let qid = s(t, "id"); @@ -73,7 +79,10 @@ pub fn thread_items(t: &Value, project: &str) -> Vec { // a row of the sections (the hub's `menu`): Settle or Unsettle, by hand (the clock never settles a pinned thread) else if let Some(m) = t["menu"].as_array().and_then(|m| m.iter().find(|x| matches!(x["id"].as_str(), Some("settle" | "unsettle")))) { v.push(item(&s(m, "label"), &s(m, "action"), &s(m, "value"), false)); } /* i18n-ok: menu labels, tested; drawn through trs in render */ for o in t["trail"].as_array().into_iter().flatten().flat_map(|x| x["options"].as_array().into_iter().flatten()) { v.push(item(&format!("Snooze {}", s(o, "label").to_lowercase()), "row-snooze", &s(o, "value"), false)); } - /* i18n-ok: menu labels, tested; drawn through trs in render */ if t["canChild"].as_bool().unwrap_or(true) { v.push(item("New subthread", "thread-child", &format!("{}|{}", raw(&qid), project), false)); } + // a chat in no project (the hub's `chat`): Move to project… (the hub's `menu` item, a second menu of the projects), and no subthread: it has no project to be under + let chat = t["chat"] == true; + v.extend(move_item(&t["menu"])); + /* i18n-ok: menu labels, tested; drawn through trs in render */ if !chat && t["canChild"].as_bool().unwrap_or(true) { v.push(item("New subthread", "thread-child", &format!("{}|{}", raw(&qid), project), false)); } /* i18n-ok: menu labels, tested; drawn through trs in render */ if t["depth"].as_u64().unwrap_or(0) > 0 { v.push(item("Move to top level", "row-detach", raw(&qid), false)); } /* i18n-ok: menu labels, tested; drawn through trs in render */ if t["depth"].is_u64() && !project.is_empty() { v.push(item("Move under\u{2026}", LOCAL_MOVE, &format!("{}|{}", raw(&qid), project), false)); } /* i18n-ok: menu labels, tested; drawn through trs in render */ v.push(item("Rename", "row-rename", raw(&qid), false)); @@ -116,10 +125,16 @@ pub fn title_items(data: &Value) -> Vec { /* i18n-ok: menu labels, drawn through trs in render */ let mut v = vec![item("Find in thread", LOCAL_SEARCH, &rid, false), item("Rename", "row-rename", &rid, false), item("Regenerate title", "row-retitle", &rid, false)]; /* i18n-ok: menu labels, drawn through trs in render */ if !project.is_empty() && row.map_or(false, |r| r["canChild"].as_bool().unwrap_or(true)) { v.push(item("New subthread", "thread-child", &format!("{rid}|{project}"), false)); } /* i18n-ok: menu labels, drawn through trs in render */ if row.map_or(false, |r| r["depth"].as_u64().unwrap_or(0) > 0) { v.push(item("Move to top level", "row-detach", &rid, false)); } + // a chat in no project: Move to project… here too (the hub's `thread.menu` or its row's) + v.extend(move_item(&thread["menu"]).or_else(|| chat_row(data, &rid).and_then(|r| move_item(&r["menu"])))); /* i18n-ok: menu label translated in render */ v.push(item("Context & Prompt", "local:thread-context", &rid, false)); v.extend(super::tools::context_items(thread)); v } +/// The row of a chat in no project in the sections (`id` "chats"), by its raw id. +pub fn chat_row<'a>(data: &'a Value, rid: &str) -> Option<&'a Value> { + data["sections"].as_array()?.iter().filter(|s| s["id"] == crate::keys::CHATS).flat_map(|s| s["rows"].as_array().into_iter().flatten()).find(|t| raw(t["id"].as_str().unwrap_or("")) == rid) +} /// The items for a project's header. /// A project that is also on linked machines (the hub's `newOn`): one New thread per machine, this one first, each naming its machine. pub fn new_items(pid_raw: &str, new_on: &Value) -> Vec { @@ -316,6 +331,23 @@ mod tests { use super::*; use core::prelude::v1::test; fn j(s: &str) -> Value { serde_json::from_str(s).unwrap() } /// The composer's machine picker opens at its line: under it when there is room, over it near the window's bottom edge (never clipped). + #[test] fn a_chat_in_no_project_moves_to_a_project_from_its_menu_and_has_no_subthread() { + let sep = '\u{1f}'; + let t = serde_json::json!({"id": "h|c1", "title": "quick question", "chat": true, "depth": 0, "menu": [ + {"id": "pin", "label": "Pin", "action": "row-pin", "value": "h|c1"}, {"id": "settle", "label": "Settle", "action": "row-settle", "value": "h|c1"}, + {"id": "move", "label": "Move to project\u{2026}", "sub": [{"label": "amp", "action": "row-move-project", "value": format!("h|c1{sep}p1")}, {"label": "psu", "action": "row-move-project", "value": format!("h|c1{sep}p2")}]}]}); + let it = thread_items(&t, ""); + assert!(!it.iter().any(|i| i.action == "thread-child" || i.action == LOCAL_MOVE), "no project to be under"); + let mv = it.iter().find(|i| i.label == "Move to project\u{2026}").expect("the hub's Move item"); assert_eq!(mv.action, LOCAL_SUB); + let sub = sub_items(&mv.value); + assert_eq!(sub.iter().map(|i| (i.label.as_str(), i.action.as_str(), i.value.as_str())).collect::>(), [("amp", "row-move-project", "h|c1\u{1f}p1"), ("psu", "row-move-project", "h|c1\u{1f}p2")]); + // the open chat's ▾ menu has it too, from its row in the Chats section + let d = serde_json::json!({"thread": {"id": "h|c1"}, "sections": [{"id": "chats", "kind": "threads", "rows": [t.clone()]}]}); + assert!(title_items(&d).iter().any(|i| i.action == LOCAL_SUB && i.label == "Move to project\u{2026}")); + // a thread of a project, or a chat with no project to go to: nothing + assert!(move_item(&serde_json::json!([{"id": "pin", "label": "Pin", "action": "row-pin", "value": "h|t1"}])).is_none()); + assert!(move_item(&serde_json::json!([{"id": "move", "label": "Move to project\u{2026}", "sub": []}])).is_none()); + } #[test] fn a_menu_from_a_control_opens_at_it_and_above_it_near_the_bottom() { let b = |x: f32, y: f32| Bounds { origin: point(px(x), px(y)), size: size(px(120.), px(16.)) }; assert_eq!(anchored(b(500., 300.), px(1000.), 3), point(px(500.), px(320.)), "under it"); diff --git a/native/gpui/src/screens/palette.rs b/native/gpui/src/screens/palette.rs index 70efda960c..82999eea93 100644 --- a/native/gpui/src/screens/palette.rs +++ b/native/gpui/src/screens/palette.rs @@ -110,6 +110,8 @@ fn items(data: &Value, can_embed: bool) -> Vec { v.push(Item { label: trs("Fold or unfold the sidebar"), place: String::new(), kind: "action", what: Do::Sidebar, row: Value::Null }); // always here, whatever the hub sends or fails to send: these do not go through it (hubbar.rs) for a in ["restart", "safe", "rollback"] { v.push(Item { label: trs(super::hubbar::label_of(a)), place: String::new(), kind: "action", what: Do::Hub(a.into()), row: Value::Null }); } + // a chat in no project: always offered, whatever is open (the hub makes its folder) + v.push(Item { label: trs("New chat (no project)"), place: String::new(), kind: "action", what: Do::Action("new-thread".into(), crate::keys::CHATS.into()), row: Value::Null }); for p in data["projects"].as_array().into_iter().flatten() { let (pid, ptitle) = (string(p, "id"), string(p, "title")); let raw = pid.rsplit_once('|').map_or(pid.as_str(), |(_, r)| r).to_string(); @@ -419,6 +421,7 @@ mod tests { assert!(!all.iter().any(|i| i.what == Do::Action("delete".into(), String::new())), "Delete asks first and is not a palette action"); let r = found(all.clone(), "pow", 10); assert_eq!(r[0].label, "Power budget"); assert!(found(all.clone(), "zzzz", 10).is_empty()); + let r = found(all.clone(), "new chat", 10); assert_eq!(r[0].what, Do::Action("new-thread".into(), "chats".into()), "a chat in no project, from anywhere"); let r = found(all, "new thr", 10); assert_eq!(r[0].what, Do::Action("new-thread".into(), "p1".into()), "the project's raw id"); } #[test] fn opened_empty_the_threads_waiting_on_the_person_come_first() { diff --git a/native/gpui/src/screens/sections.rs b/native/gpui/src/screens/sections.rs index 9526af0dd9..5699908af0 100644 --- a/native/gpui/src/screens/sections.rs +++ b/native/gpui/src/screens/sections.rs @@ -1,6 +1,7 @@ //! The sidebar's sections (docs/ALWAYS-ON.md section 8), as the hub presents them (`sections`: present/sections.rs): Needs you, Pinned, //! Active, the groups and Quiet. Drawn generically: a section is a head (its title, a count, a chevron when it folds) and its rows, a thread //! row (`kind` "threads") or a project row with its visible threads under it ("projects"). Bub is drawn above by the window as before. +//! The Chats section (`id` "chats": the threads in no project) is a "threads" section whose head has a + (New chat). //! The hub decides everything shown; this only draws and sends `side-section`, `project-page`, `project-pin`, `project-fold`, `group-rename-start`, `group-move`. //! A project row's chevron (and Left/Right while the sidebar has the keyboard) folds its threads away; the hub keeps the fold per project. use crate::i18n::{tf, trs}; @@ -23,7 +24,7 @@ pub fn find<'a>(data: &'a Value, pid: &str) -> Option<&'a Value> { } /// The head of a section: its title, its count when it folds or lists threads, a chevron when it folds. -fn head(cx: &mut Context, light: bool, s: &Value, ctl: &mut Vec) -> AnyElement { +fn head(this: &Backplane, cx: &mut Context, light: bool, s: &Value, ctl: &mut Vec) -> AnyElement { let c = |n: &str| theme::color(light, n); let (id, title, fold, open) = (string(s, "id"), string(s, "title"), s["fold"] == true, s["open"] == true); let n = s["count"].as_u64().unwrap_or(0); @@ -39,6 +40,12 @@ fn head(cx: &mut Context, light: bool, s: &Value, ctl: &mut Vec continue, "threads" => { - rows.push(head(cx, light, s, ctl)); + rows.push(head(self, cx, light, s, ctl)); for t in s["rows"].as_array().into_iter().flatten() { // a swarm that waits on the person: its own row (screens/swarm.rs), which opens the swarm's page if t["kind"] == "swarm" { rows.extend(crate::screens::swarm::side_rows(cx, light, &serde_json::json!({"swarms": [t]}), &open_room, ctl)); continue } @@ -149,7 +156,8 @@ impl Backplane { // a stop says so by its dot alone (the right column is the title's); an ask keeps its red word (approval, question) let mut t = t.clone(); if matches!(t["want"].as_str(), Some("failed" | "stopped")) { t["want"] = serde_json::json!(""); } // Running lists every project's work in one place, so each row names its project (faint, after the title) - let sub = string(&t, "project"); + // (a chat's section already says what it is: no "Chats" after every title) + let sub = if t["chat"] == true { String::new() } else { string(&t, "project") }; if t["settle"].as_str().map_or(false, |v| !v.is_empty()) { let v = string(&t, "settle"); ctl.push(CtlEntry { id: format!("settle:{}", v.rsplit('|').next().unwrap_or("")), label: "Settle".into() /* i18n-ok: a ctl label */, ctl: Ctl::Node("row-settle".into(), v) }); } rows.push(self.side_thread(cx, light, &t, "", if sub.is_empty() { " " } else { &sub }, t["off"] == true, ctl)); } @@ -157,7 +165,7 @@ impl Backplane { _ => { let empty = s["rows"].as_array().map_or(true, |r| r.is_empty()); if s["id"] == "active" && empty && s["fold"] != true { continue } - rows.push(head(cx, light, s, ctl)); + rows.push(head(self, cx, light, s, ctl)); let faded = s["id"] == "quiet"; for p in s["rows"].as_array().into_iter().flatten() { rows.push(project(self, cx, light, p, faded, ctl)); diff --git a/native/gpui/src/ui.rs b/native/gpui/src/ui.rs index 8d2dc9fbfe..e8e2939e2b 100644 --- a/native/gpui/src/ui.rs +++ b/native/gpui/src/ui.rs @@ -772,7 +772,7 @@ impl Backplane { let (n, open) = (history["count"].as_u64().unwrap_or(0), history["open"] == true); /* i18n-ok: a ctl label */ ctl.push(CtlEntry { id: "side-history".into(), label: "Chats with no project".into(), ctl: Ctl::Node("flag".into(), "conversation-history".into()) }); rows.push(with_rect(div().id("side-history"), || "side-history".to_string()).flex().items_center().gap_2().pl(px(6.)).pr_3().pt_3().pb_1().text_size(crate::scale::tpx(11.)).text_color(c("dim")).cursor_pointer().hover(|s| s.text_color(c("text"))) - .tooltip(crate::keys::tip(&crate::i18n::trs("Old chats that belong to no project. New ones start in a project."), "", light)) + .tooltip(crate::keys::tip(&crate::i18n::trs("Older chats that belong to no project, kept as they are. New chat starts a new one."), "", light)) .child(ic(light, if open { "chevron-down" } else { "chevron-right" }, 14., "dim")).child(div().flex_1().min_w_0().overflow_hidden().whitespace_nowrap().child(tf("gpui.b.history.count", &[("n", n.into())]).to_uppercase())) .on_click(cx.listener(|this, _, _, cx| { let _ = this.tx.try_send(Command::Action("flag".into(), "conversation-history".into())); cx.notify(); })).into_any_element()); } @@ -1293,7 +1293,10 @@ impl Render for Backplane { .when(!side_shown && !kscreen, |d| d.child(div().id("side-strip").w(px(44.)).h_full().flex_shrink_0().overflow_hidden().bg(c("bg")).border_r_1().border_color(c("rule")).flex().flex_col().children(self.side_strip(cx, light)))) .child(div().w(px(if side_shown { self.local.sidebar_px as f32 } else { 0. })).overflow_hidden().h_full().flex_shrink_0().relative().child(art::probe("sidebar")).children(crate::perf::mark("sidebar")).bg(c("bg")).when(side_shown, |d| d.border_r_1()).border_color(c("rule")).flex().flex_col() .child(crate::screens::hubpick::picker(self, cx, light, &mut ctl)) - /* i18n-ok: ctl labels and ui: ids the drivers press */ .child(div().flex().items_center().gap_2().h(crate::scale::tpx(crate::screens::siderow::FOLD_ROW)).px_2().child(with_rect(div().id("fold-sidebar"), || "ui:Fold sidebar".to_string()).cursor_pointer().tooltip(crate::keys::tip("Fold the sidebar", &crate::keys::hint(&self.local, "sidebar"), light)).child(ic(light, "chevron-left", 16., "dim")).on_click(cx.listener(|this, _, _, cx| this.side_flip(cx)))).child(crate::screens::projects::search_box(light, &self.screens.projects)).child(with_rect(div().id("add-project"), || "ui:Add project".to_string()).cursor_pointer().on_click(cx.listener(|this, _, _, cx| { let _ = this.tx.try_send(crate::screens::projects::open_cmd()); cx.notify(); })).child(ic(light, "plus", 16., "dim")))) + /* i18n-ok: ctl labels and ui: ids the drivers press */ .child(div().flex().items_center().gap_2().h(crate::scale::tpx(crate::screens::siderow::FOLD_ROW)).px_2().child(with_rect(div().id("fold-sidebar"), || "ui:Fold sidebar".to_string()).cursor_pointer().tooltip(crate::keys::tip("Fold the sidebar", &crate::keys::hint(&self.local, "sidebar"), light)).child(ic(light, "chevron-left", 16., "dim")).on_click(cx.listener(|this, _, _, cx| this.side_flip(cx)))).child(crate::screens::projects::search_box(light, &self.screens.projects)) + // New chat: a thread in no project, in one press (its key is in the tip); beside it, Add project + /* i18n-ok: a ui: id the drivers press; the tip is drawn through tr */ .child(with_rect(div().id("new-chat"), || "ui:New chat".to_string()).cursor_pointer().tooltip(crate::keys::tip("New chat (no project)", &crate::keys::hint(&self.local, "new-chat"), light)).on_click(cx.listener(|this, _, _, cx| this.new_chat(cx))).child(ic(light, "square-pen", 16., "dim"))) + /* i18n-ok: a ui: id the drivers press; the tip is drawn through tr */ .child(with_rect(div().id("add-project"), || "ui:Add project".to_string()).cursor_pointer().tooltip(crate::keys::tip("Add project", "", light)).on_click(cx.listener(|this, _, _, cx| { let _ = this.tx.try_send(crate::screens::projects::open_cmd()); cx.notify(); })).child(ic(light, "plus", 16., "dim")))) // linked machines: All, this one, each other one (the hub filters the list below) .children(crate::screens::machines::switch(cx, light, &self.data["machines"], &mut ctl)) .child(self.screens.parts.el(Backplane::sidebar_part, StyleRefinement::default().flex_1().min_h_0(), cx)) diff --git a/web/dist/assets/app.js b/web/dist/assets/app.js index 4d8958236d..8ac8e1819e 100644 --- a/web/dist/assets/app.js +++ b/web/dist/assets/app.js @@ -1,17 +1,17 @@ -function vn(e=Date.now(),t=Math.random){let n=Math.floor(t()*1099511627776).toString(36);return`w${e}-${n}`.replace(/[^A-Za-z0-9_-]/g,"").slice(0,64)}function Ci(e){return e==="done"||e==="failed"||e==="cancelled"}function xi(e,t){if(!e||e.id!==t.id)return!0;let n=Ci(e.state),i=Ci(t.state);if(n!==i)return i;return(t.ended??0)>=(e.ended??0)}function Pi(e){if(e.state!=="done")return!1;if(typeof e.hold==="boolean")return!e.hold;return(e.notes??[]).length===0}var jt={en:{"agy.signout":"Sign out","android.hub.machines.approve":"Approve","android.load.earlier":"load earlier","approval.dismiss":"Dismiss","approval.implement":"Implement","ask.plan":"Proposed plan","bots.new":"New bot","bots.rooms":"Rooms","bots.tab.browser":"Browser","common.cancel":"Cancel","common.close":"Close","common.copy":"Copy","common.delete":"Delete","common.refresh":"Refresh","common.remove":"Remove","common.save":"Save","common.search":"Search","composer.model.tip":"Choose the model and effort","composer.placeholder":"Ask anything: @bot, >thread, %project, #room, $skill, /btw","composer.send":"Send","composer.stop":"Stop","gpui.acct.connected":"Connected","gpui.acct.not.connected":"Not connected","gpui.acct.sign.in.expired":"Sign-in expired","gpui.ask.plan.ready":"Ready for review","gpui.ask.plan.revise":"Revise","gpui.ask.plan.reviseph":"What should change in the plan?","gpui.ask.plan.sendrev":"Send revision","gpui.assembly":"Assembly","gpui.b.in.reply.to":"↩ In reply to: {quote}","gpui.b.replying.to":"↩ Replying to: {line}","gpui.bots.recall.off":"Off","gpui.bots.recall.on":"On","gpui.c.solid.big.next":"Loading it may take a while and a lot of memory.","gpui.c.solid.load.big":"Load it anyway","gpui.c.solid.loading.big":"Loading it anyway…","gpui.c.term.collapse":"Collapse","gpui.c.term.expand":"Expand","gpui.commands":"Commands","gpui.e.open.folder":"Open folder","gpui.filter.projects.and.threads":"Filter projects and threads","gpui.fold.or.unfold.the.sidebar":"Fold or unfold the sidebar","gpui.follow.paused":"Following paused","gpui.follow.wait":"Following: waiting for the agent's next edit","gpui.gerbers":"Gerbers","gpui.goal.notes":"GOAL & NOTES","gpui.improvements":"Improvements","gpui.jump.to.a.thread.run":"Jump to a thread, run a command or find what was said","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"no MPN","gpui.mgmt.checks.all":"All","gpui.mgmt.checks.fix":"Fix with agent","gpui.mgmt.checks.run":"Run","gpui.mgmt.close":"Close the panel","gpui.mgmt.fab.apply":"Apply","gpui.mgmt.fab.changed":"Changed since you last looked","gpui.mgmt.fab.derived":"* worked out from the fab's page (a mil in mm, a ring from a diameter). Dimmed: the rigid board's value, where this board's page says nothing else. A date opens the page it was read from.","gpui.mgmt.fab.extra":"Costs more","gpui.mgmt.fab.findings":"Findings","gpui.mgmt.fab.free":"Base price","gpui.mgmt.fab.judge":"Datasheets","gpui.mgmt.fab.limit":"Limit","gpui.mgmt.fab.readcol":"Read","gpui.mgmt.fab.refresh":"Refresh","gpui.mgmt.fab.reviewbtn":"Review","gpui.mgmt.fab.seen":"Seen","gpui.mgmt.fab.thefab":"The fab","gpui.mgmt.fab.use":"Use","gpui.mgmt.life.nopart":"No reading of this part yet.","gpui.mgmt.life.reading":"Reading its history…","gpui.mgmt.plan.addnote":"Add note","gpui.mgmt.plan.all":"Approve all","gpui.mgmt.plan.before":"Plan before routing","gpui.mgmt.plan.compact":"Compact","gpui.mgmt.plan.done":"done","gpui.mgmt.plan.drawn":"The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them.","gpui.mgmt.plan.edited":"Edited","gpui.mgmt.plan.elsewhere":"A routing plan for {board} awaits your approval","gpui.mgmt.plan.emptysub":"Layers, corridors, and planes appear here once a plan is proposed.","gpui.mgmt.plan.expand":"Expand","gpui.mgmt.plan.fit":"Fit","gpui.mgmt.plan.grid.all":"All layers","gpui.mgmt.plan.grid.pair":"Side by side","gpui.mgmt.plan.grid.single":"Single","gpui.mgmt.plan.hide":"Hide done","gpui.mgmt.plan.hint":"Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove","gpui.mgmt.plan.keysnote":"On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.","gpui.mgmt.plan.layer":"Approve layer","gpui.mgmt.plan.layer.short":"Layer","gpui.mgmt.plan.lock":"Lock","gpui.mgmt.plan.locked":"Locked","gpui.mgmt.plan.noboard":"No routing plan for this board.","gpui.mgmt.plan.noitems":"No corridors or planes on this layer","gpui.mgmt.plan.note.placeholder":"Steering note for router…","gpui.mgmt.plan.nothing":"Nothing awaits your approval","gpui.mgmt.plan.offwords":"Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here.","gpui.mgmt.plan.onwords":"Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve.","gpui.mgmt.plan.reading":"Reading the routing plan…","gpui.mgmt.plan.reference":"over {layer}","gpui.mgmt.plan.refused":"KiCad refused","gpui.mgmt.plan.reject":"Reject","gpui.mgmt.plan.rejectlayer":"Reject layer","gpui.mgmt.plan.reqplain":"Approval requested","gpui.mgmt.plan.requested":"Approval requested: {what}","gpui.mgmt.plan.saved":"saved plan","gpui.mgmt.plan.show":"Show done","gpui.mgmt.plan.st.approved":"Approved","gpui.mgmt.plan.st.awaiting":"Awaiting review","gpui.mgmt.plan.st.blocked":"Blocked","gpui.mgmt.plan.st.empty":"Empty","gpui.mgmt.plan.st.partial":"Partial","gpui.mgmt.plan.st.rejected":"Rejected","gpui.mgmt.plan.st.routed":"Routed","gpui.mgmt.plan.st.routing":"Routing","gpui.mgmt.plan.st.verified":"Verified","gpui.mgmt.plan.stackup.short":"Stackup","gpui.mgmt.plan.stop":"Stop routing","gpui.mgmt.plan.sync":"Link zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Unlock","gpui.mgmt.plan.verify":"Verify","gpui.mgmt.plan.view.canvas":"Canvas","gpui.mgmt.plan.view.list":"List","gpui.mgmt.plan.view.split":"Split","gpui.mgmt.plan.width":"Width","gpui.next.thread":"Next thread","gpui.no.goal.yet.ask.an":"No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.","gpui.no.models":"No models","gpui.no.threads.yet":"No threads yet.","gpui.nothing.matches":"Nothing matches","gpui.picker.favorite.add":"Add to favorites","gpui.picker.favorite.remove":"Remove from favorites","gpui.picker.favorites":"Favorites","gpui.planmode.bar.always":"Plan mode — explores and proposes a plan before editing","gpui.planmode.bar.executing":"Building the approved plan","gpui.planmode.bar.once":"Plan mode (1 turn) — explores and proposes a plan before editing","gpui.planmode.bar.pending":"Proposed plan awaits review below","gpui.planmode.bar.planning":"Planning — drafting a plan before edits","gpui.planmode.chip.building":"Building","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Always","gpui.planmode.scope.once":"1 turn","gpui.planmode.tip":"Plan before acting (1 turn, always, or off)","gpui.planmode.top.executing":"Building plan","gpui.planmode.top.once":"Plan (1 turn)","gpui.planmode.top.pending":"Review plan","gpui.planmode.top.planning":"Planning","gpui.previous.thread":"Previous thread","gpui.projects.boards":"BOARDS ({n})","gpui.projects.mech":"MECHANICAL ({n})","gpui.projects.threads":"THREADS ({n})","gpui.projects.to.order":"TO ORDER ({n})","gpui.rail.no.board":"No board in this project","gpui.rail.no.mech":"No mechanical parts in this project","gpui.rail.no.schematic":"No schematic in this project","gpui.rail.split.needs.both":"Split needs a board and a schematic","gpui.search.models":"Search models","gpui.settings.group.agents":"Agents and tools","gpui.settings.group.general":"General","home.away":"Home ({name}) is away","home.away.queued":"Home ({name}) is away · {n} queued","home.away.since":"Home ({name}) is away since {time}","home.away.since.queued":"Home ({name}) is away since {time} · {n} queued","home.machine":"Home machine","home.move.failed":"Home move failed","home.move.failed.note":"Home move failed: {note}","home.move.here":"Make this machine the home","home.moving":"Moving home to {to}…","home.moving.step":"Moving home to {to}: {step}","hub.back.crash":"Backplane is back after it stopped unexpectedly","hub.restarting":"Restarting Backplane…","hub.restarting.build":"Restarting Backplane… (new build {build})","hub.stopped":"Backplane stopped","ios.hub.address.field":"Hub address","menu.pin":"Pin","menu.settle":"Settle","menu.unpin":"Unpin","menu.wake":"Wake","model.col.agent":"Agent","model.col.effort":"Effort","native.pair.connect":"Connect","native.thread.model":"Model","notify.settled":"Settled","palette.archive":"Archive thread","palette.command.placeholder":"Type a command or a thread","palette.diff":"Diff: what this thread changed","palette.newthread":"New thread","palette.settings":"Settings","palette.terminal":"Terminal","palette.unarchive":"Unarchive thread","phone.unsettle":"Unsettle","provider.notice.button":"Open Settings → Accounts","provider.notice.head":"No AI provider connected","provider.notice.senderr":"No AI provider connected yet. Open Settings → Accounts to connect Claude, Codex, Antigravity, or another provider.","provider.notice.senderr.remote":"No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.","provider.notice.text.none":"Connect Claude, Codex, Antigravity, or another provider to start chatting.","provider.notice.text.signedout":"Sign in to Claude, Codex, or another provider in Settings → Accounts to start chatting.","reply.action":"Reply","reply.cancel":"Cancel reply","reply.to":"In reply to:","ring.hear.again.local":"Hear again (local)","ring.hear.again.openai":"Hear again (OpenAI)","ring.no.recordings.yet":"No recordings yet.","ring.recordings":"Recordings","ring.ring":"Ring","ring.search.what.you.said":"Search what you said","ring.show.all":"Show all","ring.what.happened":"What happened","rooms.new":"New room","secret.you":"You","settings.appearance":"Appearance","settings.lang":"Language","settings.lang.auto":"Automatic","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Theme","settings.theme.dark":"Dark","settings.theme.light":"Light","sheet.rename":"Rename thread","sidebar.add.project":"Add project","sidebar.search.projects":"Search projects","thread.context.base":"Backplane","thread.context.copied":"Prompt copied.","thread.context.copy":"Copy prompt","thread.context.disable":"Disable","thread.context.enable":"Enable","thread.context.index":"Available skills index","thread.context.injected.label":"Injected project instructions","thread.context.instructions":"Instructions","thread.context.mcp":"Project MCPs","thread.context.native.note":"Backplane’s launch prompt. Native files are loaded by the provider.","thread.context.none.instructions":"No project instructions found.","thread.context.none.mcp":"No project MCP configurations found.","thread.context.reading":"Reading thread context…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Skills","thread.context.system":"System Prompt","thread.context.title":"Context & Prompt","thread.context.trust":"Trust and enable","thread.new":"New thread","tools.pinned":"Pinned","tools.retry":"Retry","tour.title.bots":"Bots","viewer.board":"Board","viewer.diff":"Diff","viewer.files":"Files","viewer.mech":"Mech","viewer.review":"Review","viewer.schematic":"Schematic","viewer.solid":"3D","web.chat.answer.btn":"Answer","web.chat.answer.placeholder":"Type answer…","web.chat.answered":"Answered: {answer}","web.chat.choose":"Choose a project thread on the left to begin.","web.chat.empty":"No messages yet. Type below to start a turn.","web.chat.finished":"Finished {time}","web.chat.finished.dur":"Finished {time} · {dur}","web.chat.loading":"Loading messages…","web.chat.review.mode":"Review mode","web.chat.streaming":"Streaming…","web.clone.add.dir":"Add {dir}","web.clone.back":"Back","web.clone.change.folder":"Change folder","web.clone.cloned":"Cloned {repo} into {dest}","web.clone.cloning":"Cloning {repo} into {dest}","web.clone.copied":"Copied","web.clone.first":"First message: {text}","web.clone.folder.name":"Folder name","web.clone.go":"Clone","web.clone.loading":"Loading…","web.clone.no.folders":"No folders here","web.clone.open.project":"Open the project","web.clone.open.thread":"Open the thread","web.clone.private":"private","web.clone.repo.placeholder":"https or ssh URL, or owner/repo","web.clone.retry":"Try again","web.clone.same":"Already cloned there: it is added as it is.","web.clone.signin":"Sign in to GitHub","web.clone.signin.done":"Signed in to GitHub","web.clone.signin.enter":"Enter this code on GitHub:","web.clone.signin.wait":"Starting GitHub sign-in…","web.clone.start.thread":"Start a thread","web.clone.stopped":"Stopped cloning {repo}","web.clone.tab":"Clone from git","web.clone.up":"Up","web.clone.use.dir":"Use {dir}","web.composer.attach":"Attach image","web.composer.maximages":"At most {max} images per message.","web.composer.unsupported":"Unsupported image type: {type}","web.composer.voice":"Voice dictation","web.home.error":"Could not load this project.","web.home.fold":"Hide threads","web.home.lead":"Lead time: {n} days","web.home.lead.one":"Lead time: 1 day","web.home.loading":"Loading project…","web.home.open":"Open project home","web.home.unfold":"Show threads","web.logout.failed":"Could not confirm sign-out. Try again.","web.pair.approve.in":"Approve on desktop or paired phone · expires in {time}","web.pair.approved":"Approved. Opening Backplane…","web.pair.cancelled":"Cancelled.","web.pair.code":"Comparison code","web.pair.denied":"Pairing request was denied.","web.pair.expired":"Pairing code expired. Request a new code to try again.","web.pair.failed":"Pairing request failed ({status})","web.pair.name":"Browser name","web.pair.nocode":"Hub did not return a comparison code.","web.pair.ratelimited":"Too many pairing attempts. Wait a moment and try again.","web.pair.request":"Request pairing","web.pair.requesting":"Requesting pairing code…","web.pair.subtitle":"Pair this browser with your hub. Approve the 6-digit code in Backplane › Settings › Devices.","web.pair.unreachable":"Could not reach the hub. Check your tailnet connection.","web.plan.awaiting":"{n} awaiting approval","web.plan.net.one":"1 net","web.plan.nets":"{n} nets","web.ring.app.words":"The Pebble app's words","web.ring.count":"{n} recordings","web.ring.count.one":"1 recording","web.ring.error":"Could not load recordings.","web.ring.found":"{found} of {total} have “{q}”.","web.ring.heard.by":"Heard by {model}","web.ring.heard.by.sure":"Heard by {model}, {conf}% sure","web.ring.loading":"Loading recordings…","web.ring.no.words":"(no words)","web.ring.not.heard":"Not heard","web.ring.state.busy":"being heard now","web.ring.state.failed":"not given to Pebble","web.ring.state.heard":"waiting to go to Pebble","web.ring.state.new":"waiting to be heard","web.ring.state.sent":"given to Pebble","web.ring.unavailable":"This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app.","web.settings.providers":"AI providers","web.settings.providers.browser":"Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."},es:{"agy.signout":"Cerrar sesión","android.hub.machines.approve":"Aprobar","android.load.earlier":"cargar anteriores","approval.dismiss":"Descartar","approval.implement":"Implementar","ask.plan":"Plan propuesto","bots.new":"Nuevo bot","bots.rooms":"Salas","bots.tab.browser":"Navegador","common.cancel":"Cancelar","common.close":"Cerrar","common.copy":"Copiar","common.delete":"Eliminar","common.refresh":"Actualizar","common.remove":"Quitar","common.save":"Guardar","common.search":"Buscar","composer.model.tip":"Elegir el modelo y el esfuerzo","composer.placeholder":"Pregunta lo que sea: @bot, >hilo, %proyecto, #sala, $skill, /btw","composer.send":"Enviar","composer.stop":"Detener","gpui.acct.connected":"Conectado","gpui.acct.not.connected":"No conectado","gpui.acct.sign.in.expired":"Sesión caducada","gpui.ask.plan.ready":"Listo para revisar","gpui.ask.plan.revise":"Revisar","gpui.ask.plan.reviseph":"¿Qué debería cambiar en el plan?","gpui.ask.plan.sendrev":"Enviar revisión","gpui.assembly":"Ensamblaje","gpui.b.in.reply.to":"↩ En respuesta a: {quote}","gpui.b.replying.to":"↩ Respondiendo a: {line}","gpui.bots.recall.off":"Desactivado","gpui.bots.recall.on":"Activado","gpui.c.solid.big.next":"Cargarlo puede tardar y usar mucha memoria.","gpui.c.solid.load.big":"Cargarlo de todos modos","gpui.c.solid.loading.big":"Cargándolo de todos modos…","gpui.c.term.collapse":"Contraer","gpui.c.term.expand":"Expandir","gpui.commands":"Comandos","gpui.e.open.folder":"Abrir carpeta","gpui.filter.projects.and.threads":"Filtrar proyectos e hilos","gpui.fold.or.unfold.the.sidebar":"Plegar o desplegar la barra lateral","gpui.follow.paused":"Seguimiento en pausa","gpui.follow.wait":"Siguiendo: esperando la próxima edición del agente","gpui.gerbers":"Gerbers","gpui.goal.notes":"OBJETIVO Y NOTAS","gpui.improvements":"Mejoras","gpui.jump.to.a.thread.run":"Saltar a un hilo, ejecutar un comando o buscar lo dicho","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"sin MPN","gpui.mgmt.checks.all":"Todas","gpui.mgmt.checks.fix":"Corregir con agente","gpui.mgmt.checks.run":"Ejecutar","gpui.mgmt.close":"Cerrar el panel","gpui.mgmt.fab.apply":"Aplicar","gpui.mgmt.fab.changed":"Cambió desde la última vez que miraste","gpui.mgmt.fab.derived":"* calculado desde la página del fabricante (un mil en mm, un anillo desde un diámetro). Atenuado: el valor de la placa rígida, cuando la página de esta placa no dice otra cosa. Una fecha abre la página de la que se leyó.","gpui.mgmt.fab.extra":"Cuesta más","gpui.mgmt.fab.findings":"Hallazgos","gpui.mgmt.fab.free":"Precio base","gpui.mgmt.fab.judge":"Hojas de datos","gpui.mgmt.fab.limit":"Límite","gpui.mgmt.fab.readcol":"Leído","gpui.mgmt.fab.refresh":"Actualizar","gpui.mgmt.fab.reviewbtn":"Revisar","gpui.mgmt.fab.seen":"Visto","gpui.mgmt.fab.thefab":"El fabricante","gpui.mgmt.fab.use":"Usar","gpui.mgmt.life.nopart":"Sin lectura de esta pieza aún.","gpui.mgmt.life.reading":"Leyendo su historial…","gpui.mgmt.plan.addnote":"Añadir nota","gpui.mgmt.plan.all":"Aprobar todo","gpui.mgmt.plan.before":"Planificar antes de rutear","gpui.mgmt.plan.compact":"Compacto","gpui.mgmt.plan.done":"hecho","gpui.mgmt.plan.drawn":"Los corredores y planos del plan se dibujan en la placa mientras este panel está abierto. Ciérralo para ocultarlos.","gpui.mgmt.plan.edited":"Editado","gpui.mgmt.plan.elsewhere":"Un plan de ruteo para {board} espera tu aprobación","gpui.mgmt.plan.emptysub":"Las capas, corredores y planos aparecerán aquí cuando se proponga un plan.","gpui.mgmt.plan.expand":"Expandir","gpui.mgmt.plan.fit":"Ajustar","gpui.mgmt.plan.grid.all":"Todas las capas","gpui.mgmt.plan.grid.pair":"Lado a lado","gpui.mgmt.plan.grid.single":"Única","gpui.mgmt.plan.hide":"Ocultar hechos","gpui.mgmt.plan.hint":"Arrastra vértices para guiar · Clic en + del borde para insertar · Clic derecho en vértice para quitar","gpui.mgmt.plan.keysnote":"En esta versión de KiCad, aprueba desde este panel: en la vista de plan las teclas A, R y W de KiCad aún no son del plan (A abre Añadir Huella). Actualiza KiCad.","gpui.mgmt.plan.layer":"Aprobar capa","gpui.mgmt.plan.layer.short":"Capa","gpui.mgmt.plan.lock":"Bloquear","gpui.mgmt.plan.locked":"Bloqueado","gpui.mgmt.plan.noboard":"No hay plan de ruteo para esta placa.","gpui.mgmt.plan.noitems":"Sin corredores ni planos en esta capa","gpui.mgmt.plan.note.placeholder":"Nota de guiado para el router…","gpui.mgmt.plan.nothing":"Nada espera tu aprobación","gpui.mgmt.plan.offwords":"Los agentes rutean como les pidas. Actívalo para que primero propongan un plan de ruteo y ruteen solo lo que apruebes aquí.","gpui.mgmt.plan.onwords":"Antes de rutear una placa con 4 o más capas de cobre o más de 60 redes, el agente propone aquí corredores y regiones de plano. Solo rutea lo que apruebes.","gpui.mgmt.plan.reading":"Leyendo el plan de ruteo…","gpui.mgmt.plan.reference":"sobre {layer}","gpui.mgmt.plan.refused":"KiCad lo rechazó","gpui.mgmt.plan.reject":"Rechazar","gpui.mgmt.plan.rejectlayer":"Rechazar capa","gpui.mgmt.plan.reqplain":"Aprobación solicitada","gpui.mgmt.plan.requested":"Aprobación solicitada: {what}","gpui.mgmt.plan.saved":"plan guardado","gpui.mgmt.plan.show":"Mostrar hechos","gpui.mgmt.plan.st.approved":"Aprobado","gpui.mgmt.plan.st.awaiting":"Esperando revisión","gpui.mgmt.plan.st.blocked":"Bloqueado","gpui.mgmt.plan.st.empty":"Vacío","gpui.mgmt.plan.st.partial":"Parcial","gpui.mgmt.plan.st.rejected":"Rechazado","gpui.mgmt.plan.st.routed":"Ruteado","gpui.mgmt.plan.st.routing":"Ruteando","gpui.mgmt.plan.st.verified":"Verificado","gpui.mgmt.plan.stackup.short":"Apilamiento","gpui.mgmt.plan.stop":"Detener ruteo","gpui.mgmt.plan.sync":"Vincular zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Desbloquear","gpui.mgmt.plan.verify":"Verificar","gpui.mgmt.plan.view.canvas":"Lienzo","gpui.mgmt.plan.view.list":"Lista","gpui.mgmt.plan.view.split":"Dividido","gpui.mgmt.plan.width":"Ancho","gpui.next.thread":"Hilo siguiente","gpui.no.goal.yet.ask.an":"Sin objetivo aún. Pide a un agente que escriba para qué es este proyecto, o edita .backplane/intent.md.","gpui.no.models":"Sin modelos","gpui.no.threads.yet":"Sin hilos aún.","gpui.nothing.matches":"Nada coincide","gpui.picker.favorite.add":"Añadir a favoritos","gpui.picker.favorite.remove":"Quitar de favoritos","gpui.picker.favorites":"Favoritos","gpui.planmode.bar.always":"Modo plan — explora y propone un plan antes de editar","gpui.planmode.bar.executing":"Ejecutando el plan aprobado","gpui.planmode.bar.once":"Modo plan (1 turno) — explora y propone un plan antes de editar","gpui.planmode.bar.pending":"El plan propuesto espera revisión abajo","gpui.planmode.bar.planning":"Planificando — redactando un plan antes de editar","gpui.planmode.chip.building":"Ejecutando","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Siempre","gpui.planmode.scope.once":"1 turno","gpui.planmode.tip":"Planificar antes de actuar (1 turno, siempre u off)","gpui.planmode.top.executing":"Ejecutando plan","gpui.planmode.top.once":"Plan (1 turno)","gpui.planmode.top.pending":"Revisar plan","gpui.planmode.top.planning":"Planificando","gpui.previous.thread":"Hilo anterior","gpui.projects.boards":"PLACAS ({n})","gpui.projects.mech":"MECÁNICO ({n})","gpui.projects.threads":"HILOS ({n})","gpui.projects.to.order":"POR PEDIR ({n})","gpui.rail.no.board":"Este proyecto no tiene placa","gpui.rail.no.mech":"Este proyecto no tiene piezas mecánicas","gpui.rail.no.schematic":"Este proyecto no tiene esquema","gpui.rail.split.needs.both":"La vista dividida requiere una placa y un esquema","gpui.search.models":"Buscar modelos","gpui.settings.group.agents":"Agentes y herramientas","gpui.settings.group.general":"General","home.away":"El inicio ({name}) no está disponible","home.away.queued":"El inicio ({name}) no está disponible · {n} en cola","home.away.since":"El inicio ({name}) no está disponible desde las {time}","home.away.since.queued":"El inicio ({name}) no está disponible desde las {time} · {n} en cola","home.machine":"Máquina de inicio","home.move.failed":"No se pudo mover el inicio","home.move.failed.note":"No se pudo mover el inicio: {note}","home.move.here":"Hacer de esta máquina el inicio","home.moving":"Moviendo el inicio a {to}…","home.moving.step":"Moviendo el inicio a {to}: {step}","hub.back.crash":"Backplane volvió tras detenerse de forma inesperada","hub.restarting":"Reiniciando Backplane…","hub.restarting.build":"Reiniciando Backplane… (nueva compilación {build})","hub.stopped":"Backplane se detuvo","ios.hub.address.field":"Dirección del hub","menu.pin":"Fijar","menu.settle":"Cerrar","menu.unpin":"Desfijar","menu.wake":"Despertar","model.col.agent":"Agente","model.col.effort":"Esfuerzo","native.pair.connect":"Conectar","native.thread.model":"Modelo","notify.settled":"Cerrado","palette.archive":"Archivar hilo","palette.command.placeholder":"Escribe un comando o un hilo","palette.diff":"Diff: qué cambió este hilo","palette.newthread":"Nuevo hilo","palette.settings":"Ajustes","palette.terminal":"Terminal","palette.unarchive":"Desarchivar hilo","phone.unsettle":"Reabrir","provider.notice.button":"Abrir Configuración → Cuentas","provider.notice.head":"No hay ningún proveedor de IA conectado","provider.notice.senderr":"Aún no hay ningún proveedor de IA conectado. Abre Configuración → Cuentas para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.senderr.remote":"No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.text.none":"Conecta Claude, Codex, Antigravity u otro proveedor para empezar a chatear.","provider.notice.text.signedout":"Inicia sesión en Claude, Codex u otro proveedor en Configuración → Cuentas para empezar a chatear.","reply.action":"Responder","reply.cancel":"Cancelar respuesta","reply.to":"En respuesta a:","ring.hear.again.local":"Escuchar de nuevo (local)","ring.hear.again.openai":"Escuchar de nuevo (OpenAI)","ring.no.recordings.yet":"Sin grabaciones aún.","ring.recordings":"Grabaciones","ring.ring":"Anillo","ring.search.what.you.said":"Buscar lo que dijiste","ring.show.all":"Mostrar todo","ring.what.happened":"Qué ocurrió","rooms.new":"Nueva sala","secret.you":"Tú","settings.appearance":"Apariencia","settings.lang":"Idioma","settings.lang.auto":"Automático","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Tema","settings.theme.dark":"Oscuro","settings.theme.light":"Claro","sheet.rename":"Renombrar hilo","sidebar.add.project":"Añadir proyecto","sidebar.search.projects":"Buscar proyectos","thread.context.base":"Backplane","thread.context.copied":"Se copiaron las instrucciones.","thread.context.copy":"Copiar instrucciones","thread.context.disable":"Desactivar","thread.context.enable":"Activar","thread.context.index":"Índice de habilidades disponibles","thread.context.injected.label":"Instrucciones del proyecto añadidas","thread.context.instructions":"Instrucciones","thread.context.mcp":"MCP del proyecto","thread.context.native.note":"Instrucciones de inicio de Backplane. El proveedor carga los archivos nativos.","thread.context.none.instructions":"No se encontraron instrucciones del proyecto.","thread.context.none.mcp":"No se encontraron configuraciones MCP del proyecto.","thread.context.reading":"Leyendo el contexto del hilo…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Habilidades","thread.context.system":"Instrucciones del sistema","thread.context.title":"Contexto e instrucciones","thread.context.trust":"Confiar y activar","thread.new":"Nuevo hilo","tools.pinned":"Fijado","tools.retry":"Reintentar","tour.title.bots":"Bots","viewer.board":"Placa","viewer.diff":"Diff","viewer.files":"Archivos","viewer.mech":"Mech","viewer.review":"Revisión","viewer.schematic":"Esquemático","viewer.solid":"3D","web.chat.answer.btn":"Responder","web.chat.answer.placeholder":"Escribe una respuesta…","web.chat.answered":"Respondido: {answer}","web.chat.choose":"Elige un hilo de proyecto a la izquierda para empezar.","web.chat.empty":"Aún no hay mensajes. Escribe abajo para iniciar un turno.","web.chat.finished":"Terminado {time}","web.chat.finished.dur":"Terminado {time} · {dur}","web.chat.loading":"Cargando mensajes…","web.chat.review.mode":"Modo de revisión","web.chat.streaming":"Transmitiendo…","web.clone.add.dir":"Añadir {dir}","web.clone.back":"Atrás","web.clone.change.folder":"Cambiar carpeta","web.clone.cloned":"{repo} clonado en {dest}","web.clone.cloning":"Clonando {repo} en {dest}","web.clone.copied":"Copiado","web.clone.first":"Primer mensaje: {text}","web.clone.folder.name":"Nombre de la carpeta","web.clone.go":"Clonar","web.clone.loading":"Cargando…","web.clone.no.folders":"No hay carpetas aquí","web.clone.open.project":"Abrir el proyecto","web.clone.open.thread":"Abrir el hilo","web.clone.private":"privado","web.clone.repo.placeholder":"URL https o ssh, o propietario/repositorio","web.clone.retry":"Reintentar","web.clone.same":"Ya está clonado ahí: se añade tal cual.","web.clone.signin":"Iniciar sesión en GitHub","web.clone.signin.done":"Sesión iniciada en GitHub","web.clone.signin.enter":"Introduce este código en GitHub:","web.clone.signin.wait":"Iniciando sesión en GitHub…","web.clone.start.thread":"Empezar un hilo","web.clone.stopped":"Se detuvo la clonación de {repo}","web.clone.tab":"Clonar desde git","web.clone.up":"Subir","web.clone.use.dir":"Usar {dir}","web.composer.attach":"Adjuntar imagen","web.composer.maximages":"Como máximo {max} imágenes por mensaje.","web.composer.unsupported":"Tipo de imagen no compatible: {type}","web.composer.voice":"Dictado por voz","web.home.error":"No se pudo cargar este proyecto.","web.home.fold":"Ocultar hilos","web.home.lead":"Plazo de entrega: {n} días","web.home.lead.one":"Plazo de entrega: 1 día","web.home.loading":"Cargando el proyecto…","web.home.open":"Abrir la página del proyecto","web.home.unfold":"Mostrar hilos","web.logout.failed":"No se pudo confirmar el cierre de sesión. Inténtalo de nuevo.","web.pair.approve.in":"Aprueba en el escritorio o en un teléfono vinculado · caduca en {time}","web.pair.approved":"Aprobado. Abriendo Backplane…","web.pair.cancelled":"Cancelado.","web.pair.code":"Código de comparación","web.pair.denied":"Se rechazó la solicitud de vinculación.","web.pair.expired":"El código de vinculación caducó. Solicita uno nuevo para intentarlo otra vez.","web.pair.failed":"Falló la solicitud de vinculación ({status})","web.pair.name":"Nombre del navegador","web.pair.nocode":"El hub no devolvió un código de comparación.","web.pair.ratelimited":"Demasiados intentos de vinculación. Espera un momento e inténtalo de nuevo.","web.pair.request":"Solicitar vinculación","web.pair.requesting":"Solicitando código de vinculación…","web.pair.subtitle":"Vincula este navegador con tu hub. Aprueba el código de 6 dígitos en Backplane › Ajustes › Dispositivos.","web.pair.unreachable":"No se pudo conectar con el hub. Comprueba tu conexión de tailnet.","web.plan.awaiting":"{n} esperando aprobación","web.plan.net.one":"1 red","web.plan.nets":"{n} redes","web.ring.app.words":"Las palabras de la aplicación Pebble","web.ring.count":"{n} grabaciones","web.ring.count.one":"1 grabación","web.ring.error":"No se pudieron cargar las grabaciones.","web.ring.found":"{found} de {total} contienen “{q}”.","web.ring.heard.by":"Transcrito por {model}","web.ring.heard.by.sure":"Transcrito por {model}, {conf}% de certeza","web.ring.loading":"Cargando grabaciones…","web.ring.no.words":"(sin palabras)","web.ring.not.heard":"Sin transcribir","web.ring.state.busy":"transcribiéndose ahora","web.ring.state.failed":"no entregada a Pebble","web.ring.state.heard":"en espera de entrega a Pebble","web.ring.state.new":"en espera de transcripción","web.ring.state.sent":"entregada a Pebble","web.ring.unavailable":"Este hub aún no muestra las notas del anillo en un navegador. Actualízalo o abre Configuración › Anillo en la aplicación de escritorio.","web.settings.providers":"Proveedores de IA","web.settings.providers.browser":"Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas."},ja:{"agy.signout":"サインアウト","android.hub.machines.approve":"承認","android.load.earlier":"以前のメッセージを読み込む","approval.dismiss":"閉じる","approval.implement":"実装","ask.plan":"提案されたプラン","bots.new":"新しいボット","bots.rooms":"ルーム","bots.tab.browser":"ブラウザ","common.cancel":"キャンセル","common.close":"閉じる","common.copy":"コピー","common.delete":"削除","common.refresh":"更新","common.remove":"削除","common.save":"保存","common.search":"検索","composer.model.tip":"モデルと推論の強さを選択","composer.placeholder":"何でも質問:@bot、>thread、%project、#room、$skill、/btw","composer.send":"送信","composer.stop":"停止","gpui.acct.connected":"接続済み","gpui.acct.not.connected":"未接続","gpui.acct.sign.in.expired":"サインインの期限切れ","gpui.ask.plan.ready":"確認待ち","gpui.ask.plan.revise":"修正","gpui.ask.plan.reviseph":"計画のどこを変更しますか?","gpui.ask.plan.sendrev":"修正を送る","gpui.assembly":"アセンブリ","gpui.b.in.reply.to":"↩ 返信先:{quote}","gpui.b.replying.to":"↩ 返信中:{line}","gpui.bots.recall.off":"オフ","gpui.bots.recall.on":"オン","gpui.c.solid.big.next":"読み込みには時間と多くのメモリがかかることがあります。","gpui.c.solid.load.big":"それでも読み込む","gpui.c.solid.loading.big":"それでも読み込み中…","gpui.c.term.collapse":"折りたたむ","gpui.c.term.expand":"展開","gpui.commands":"コマンド","gpui.e.open.folder":"フォルダを開く","gpui.filter.projects.and.threads":"プロジェクトとスレッドを絞り込む","gpui.fold.or.unfold.the.sidebar":"サイドバーを折りたたむ/開く","gpui.follow.paused":"追従を一時停止中","gpui.follow.wait":"追従中: エージェントの次の編集を待っています","gpui.gerbers":"ガーバー","gpui.goal.notes":"目標とメモ","gpui.improvements":"改善","gpui.jump.to.a.thread.run":"スレッドへ移動、コマンドを実行、または発言を検索","gpui.mgmt.bom.dnp":"実装しない","gpui.mgmt.bom.nompn":"MPNなし","gpui.mgmt.checks.all":"すべて","gpui.mgmt.checks.fix":"エージェントに直してもらう","gpui.mgmt.checks.run":"実行","gpui.mgmt.close":"パネルを閉じる","gpui.mgmt.fab.apply":"適用","gpui.mgmt.fab.changed":"前回見てから変わったところ","gpui.mgmt.fab.derived":"* 製造元のページから計算した値です(milをmmに、径からランドを)。薄い色の項目はリジッド基板の値です(この基板のページに記載がないもの)。日付を押すと読んだページが開きます。","gpui.mgmt.fab.extra":"追加料金","gpui.mgmt.fab.findings":"指摘","gpui.mgmt.fab.free":"基本料金","gpui.mgmt.fab.judge":"データシート","gpui.mgmt.fab.limit":"項目","gpui.mgmt.fab.readcol":"読んだ日","gpui.mgmt.fab.refresh":"再読み込み","gpui.mgmt.fab.reviewbtn":"レビュー","gpui.mgmt.fab.seen":"確認済み","gpui.mgmt.fab.thefab":"製造元","gpui.mgmt.fab.use":"使う","gpui.mgmt.life.nopart":"この部品の記録はまだありません。","gpui.mgmt.life.reading":"履歴を読んでいます…","gpui.mgmt.plan.addnote":"メモを追加","gpui.mgmt.plan.all":"すべて承認","gpui.mgmt.plan.before":"配線前に計画する","gpui.mgmt.plan.compact":"標準","gpui.mgmt.plan.done":"完了","gpui.mgmt.plan.drawn":"計画の配線経路とプレーンは、このパネルを開いている間だけ基板上に表示されます。閉じると消えます。","gpui.mgmt.plan.edited":"編集済み","gpui.mgmt.plan.elsewhere":"{board}の配線計画が承認を待っています","gpui.mgmt.plan.emptysub":"計画が提案されると、レイヤー・コリドー・ベタ領域がここに表示されます。","gpui.mgmt.plan.expand":"拡大","gpui.mgmt.plan.fit":"全体表示","gpui.mgmt.plan.grid.all":"全レイヤー","gpui.mgmt.plan.grid.pair":"並べて表示","gpui.mgmt.plan.grid.single":"単一","gpui.mgmt.plan.hide":"完了を隠す","gpui.mgmt.plan.hint":"頂点をドラッグして誘導 · 辺の + をクリックで追加 · 頂点を右クリックで削除","gpui.mgmt.plan.keysnote":"このバージョンのKiCadでは、このパネルから承認してください。プランビューでのKiCadのA・R・Wキーはまだ計画のものではありません(Aはフットプリントの追加を開きます)。KiCadを更新してください。","gpui.mgmt.plan.layer":"層を承認","gpui.mgmt.plan.layer.short":"レイヤー","gpui.mgmt.plan.lock":"ロック","gpui.mgmt.plan.locked":"ロック中","gpui.mgmt.plan.noboard":"この基板の配線計画はありません。","gpui.mgmt.plan.noitems":"このレイヤーにコリドーまたはプレーンがありません","gpui.mgmt.plan.note.placeholder":"ルーターへの指示メモ…","gpui.mgmt.plan.nothing":"承認待ちはありません","gpui.mgmt.plan.offwords":"エージェントは指示どおりに配線します。オンにすると、まず配線計画を提案し、ここで承認したものだけを配線します。","gpui.mgmt.plan.onwords":"銅箔層が4層以上、またはネットが60本を超える基板では、配線の前にエージェントがここで配線経路とプレーン領域を提案します。承認したものだけを配線します。","gpui.mgmt.plan.reading":"配線計画を読んでいます…","gpui.mgmt.plan.reference":"基準 {layer}","gpui.mgmt.plan.refused":"KiCad が拒否しました","gpui.mgmt.plan.reject":"却下","gpui.mgmt.plan.rejectlayer":"レイヤーを却下","gpui.mgmt.plan.reqplain":"承認が求められています","gpui.mgmt.plan.requested":"承認が求められています: {what}","gpui.mgmt.plan.saved":"保存された計画","gpui.mgmt.plan.show":"完了を表示","gpui.mgmt.plan.st.approved":"承認済み","gpui.mgmt.plan.st.awaiting":"承認待ち","gpui.mgmt.plan.st.blocked":"ブロック","gpui.mgmt.plan.st.empty":"空","gpui.mgmt.plan.st.partial":"一部完了","gpui.mgmt.plan.st.rejected":"却下","gpui.mgmt.plan.st.routed":"配線済み","gpui.mgmt.plan.st.routing":"配線中","gpui.mgmt.plan.st.verified":"検証済み","gpui.mgmt.plan.stackup.short":"スタックアップ","gpui.mgmt.plan.stop":"配線を止める","gpui.mgmt.plan.sync":"ズーム連動","gpui.mgmt.plan.tab":"計画","gpui.mgmt.plan.unlock":"ロック解除","gpui.mgmt.plan.verify":"検証","gpui.mgmt.plan.view.canvas":"キャンバス","gpui.mgmt.plan.view.list":"リスト","gpui.mgmt.plan.view.split":"分割","gpui.mgmt.plan.width":"幅","gpui.next.thread":"次のスレッド","gpui.no.goal.yet.ask.an":"目標はまだありません。このプロジェクトの目的をエージェントに書いてもらうか、.backplane/intent.md を編集してください。","gpui.no.models":"モデルがありません","gpui.no.threads.yet":"スレッドはまだありません。","gpui.nothing.matches":"一致するものはありません","gpui.picker.favorite.add":"お気に入りに追加","gpui.picker.favorite.remove":"お気に入りから外す","gpui.picker.favorites":"お気に入り","gpui.planmode.bar.always":"計画モード — 編集前に調査して計画を提案します","gpui.planmode.bar.executing":"承認された計画を実行しています","gpui.planmode.bar.once":"計画モード (1回) — 編集前に調査して計画を提案します","gpui.planmode.bar.pending":"提案された計画が下のレビューを待っています","gpui.planmode.bar.planning":"計画中 — 編集前の計画を作成しています","gpui.planmode.chip.building":"実行中","gpui.planmode.chip.once":"計画 · 1回","gpui.planmode.scope.always":"常時","gpui.planmode.scope.once":"1回","gpui.planmode.tip":"実行前に計画を作成 (1回・常時・オフ)","gpui.planmode.top.executing":"計画を実行中","gpui.planmode.top.once":"計画 (1回)","gpui.planmode.top.pending":"計画を確認","gpui.planmode.top.planning":"計画中","gpui.previous.thread":"前のスレッド","gpui.projects.boards":"基板({n})","gpui.projects.mech":"機構部品({n})","gpui.projects.threads":"スレッド({n})","gpui.projects.to.order":"注文するもの({n})","gpui.rail.no.board":"このプロジェクトには基板がありません","gpui.rail.no.mech":"このプロジェクトには機械部品がありません","gpui.rail.no.schematic":"このプロジェクトには回路図がありません","gpui.rail.split.needs.both":"分割表示には基板と回路図が必要です","gpui.search.models":"モデルを検索","gpui.settings.group.agents":"エージェントとツール","gpui.settings.group.general":"一般","home.away":"ホーム({name})はオフラインです","home.away.queued":"ホーム({name})はオフラインです · {n} 件待機中","home.away.since":"ホーム({name})は {time} からオフラインです","home.away.since.queued":"ホーム({name})は {time} からオフラインです · {n} 件待機中","home.machine":"ホームマシン","home.move.failed":"ホームの移動に失敗しました","home.move.failed.note":"ホームの移動に失敗しました: {note}","home.move.here":"このマシンをホームにする","home.moving":"ホームを {to} へ移動中…","home.moving.step":"ホームを {to} へ移動中: {step}","hub.back.crash":"予期せず停止したBackplaneが戻りました","hub.restarting":"Backplaneを再起動しています…","hub.restarting.build":"Backplaneを再起動しています…(新しいビルド {build})","hub.stopped":"Backplaneは停止しました","ios.hub.address.field":"ハブのアドレス","menu.pin":"ピン留め","menu.settle":"完了","menu.unpin":"ピン留めを解除","menu.wake":"再開","model.col.agent":"エージェント","model.col.effort":"推論の強さ","native.pair.connect":"接続","native.thread.model":"モデル","notify.settled":"完了","palette.archive":"スレッドをアーカイブ","palette.command.placeholder":"コマンドまたはスレッドを入力","palette.diff":"差分:このスレッドの変更","palette.newthread":"新しいスレッド","palette.settings":"設定","palette.terminal":"ターミナル","palette.unarchive":"スレッドのアーカイブを解除","phone.unsettle":"未完了に戻す","provider.notice.button":"設定 → アカウントを開く","provider.notice.head":"AI プロバイダーが接続されていません","provider.notice.senderr":"AI プロバイダーがまだ接続されていません。設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.senderr.remote":"{machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.none":"チャットを始めるには、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.signedout":"チャットを始めるには、設定 → アカウントで Claude、Codex などのプロバイダーにサインインしてください。","reply.action":"返信","reply.cancel":"返信をやめる","reply.to":"返信先:","ring.hear.again.local":"もう一度聞き取る (ローカル)","ring.hear.again.openai":"もう一度聞き取る (OpenAI)","ring.no.recordings.yet":"録音はまだありません。","ring.recordings":"録音","ring.ring":"リング","ring.search.what.you.said":"話した内容を検索","ring.show.all":"すべて表示","ring.what.happened":"どうなったか","rooms.new":"新しいルーム","secret.you":"あなた","settings.appearance":"外観","settings.lang":"言語","settings.lang.auto":"自動","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"テーマ","settings.theme.dark":"ダーク","settings.theme.light":"ライト","sheet.rename":"スレッド名を変更","sidebar.add.project":"プロジェクトを追加","sidebar.search.projects":"プロジェクトを検索","thread.context.base":"Backplane","thread.context.copied":"プロンプトをコピーしました。","thread.context.copy":"プロンプトをコピー","thread.context.disable":"無効にする","thread.context.enable":"有効にする","thread.context.index":"利用可能なスキルの一覧","thread.context.injected.label":"追加されたプロジェクトの指示","thread.context.instructions":"指示","thread.context.mcp":"プロジェクトの MCP","thread.context.native.note":"Backplane が起動時に渡すプロンプトです。ネイティブファイルはプロバイダーが読み込みます。","thread.context.none.instructions":"プロジェクトの指示が見つかりません。","thread.context.none.mcp":"プロジェクトの MCP 設定が見つかりません。","thread.context.reading":"スレッドのコンテキストを読み込み中…","thread.context.size":"{bytes} B・約{tokens}トークン","thread.context.skills":"スキル","thread.context.system":"システムプロンプト","thread.context.title":"コンテキストとプロンプト","thread.context.trust":"承認して有効にする","thread.new":"新しいスレッド","tools.pinned":"固定中","tools.retry":"再試行","tour.title.bots":"ボット","viewer.board":"基板","viewer.diff":"差分","viewer.files":"ファイル","viewer.mech":"Mech","viewer.review":"レビュー","viewer.schematic":"回路図","viewer.solid":"3D","web.chat.answer.btn":"回答","web.chat.answer.placeholder":"回答を入力…","web.chat.answered":"回答済み: {answer}","web.chat.choose":"左側からプロジェクトのスレッドを選んで開始してください。","web.chat.empty":"まだメッセージはありません。下に入力して開始してください。","web.chat.finished":"完了 {time}","web.chat.finished.dur":"完了 {time} · {dur}","web.chat.loading":"メッセージを読み込んでいます…","web.chat.review.mode":"レビューモード","web.chat.streaming":"受信中…","web.clone.add.dir":"{dir} を追加","web.clone.back":"戻る","web.clone.change.folder":"フォルダを変更","web.clone.cloned":"{repo} を {dest} にクローンしました","web.clone.cloning":"{repo} を {dest} にクローン中","web.clone.copied":"コピーしました","web.clone.first":"最初のメッセージ: {text}","web.clone.folder.name":"フォルダ名","web.clone.go":"クローン","web.clone.loading":"読み込み中…","web.clone.no.folders":"フォルダがありません","web.clone.open.project":"プロジェクトを開く","web.clone.open.thread":"スレッドを開く","web.clone.private":"非公開","web.clone.repo.placeholder":"https / ssh の URL、または owner/repo","web.clone.retry":"もう一度","web.clone.same":"すでにそこにクローンされています: そのまま追加します。","web.clone.signin":"GitHub にサインイン","web.clone.signin.done":"GitHub にサインインしました","web.clone.signin.enter":"このコードを GitHub に入力してください:","web.clone.signin.wait":"GitHub のサインインを開始しています…","web.clone.start.thread":"スレッドを開始","web.clone.stopped":"{repo} のクローンを中止しました","web.clone.tab":"git からクローン","web.clone.up":"上へ","web.clone.use.dir":"{dir} を使う","web.composer.attach":"画像を添付","web.composer.maximages":"1 件のメッセージに添付できる画像は最大 {max} 枚です。","web.composer.unsupported":"未対応の画像形式です: {type}","web.composer.voice":"音声入力","web.home.error":"このプロジェクトを読み込めませんでした。","web.home.fold":"スレッドを隠す","web.home.lead":"リードタイム: {n} 日","web.home.lead.one":"リードタイム: 1 日","web.home.loading":"プロジェクトを読み込み中…","web.home.open":"プロジェクトホームを開く","web.home.unfold":"スレッドを表示","web.logout.failed":"サインアウトを確認できませんでした。もう一度お試しください。","web.pair.approve.in":"デスクトップまたはペアリング済みの端末で承認してください · 有効期限 {time}","web.pair.approved":"承認されました。Backplane を開いています…","web.pair.cancelled":"キャンセルしました。","web.pair.code":"確認コード","web.pair.denied":"ペアリングのリクエストが拒否されました。","web.pair.expired":"ペアリングコードの有効期限が切れました。新しいコードをリクエストしてください。","web.pair.failed":"ペアリングのリクエストに失敗しました ({status})","web.pair.name":"ブラウザー名","web.pair.nocode":"ハブから確認コードが返されませんでした。","web.pair.ratelimited":"ペアリングの試行回数が多すぎます。しばらく待ってからやり直してください。","web.pair.request":"ペアリングをリクエスト","web.pair.requesting":"ペアリングコードをリクエストしています…","web.pair.subtitle":"このブラウザーをハブとペアリングします。Backplane › 設定 › デバイス で 6 桁のコードを承認してください。","web.pair.unreachable":"ハブに接続できませんでした。tailnet の接続を確認してください。","web.plan.awaiting":"{n} 件が承認待ち","web.plan.net.one":"1 ネット","web.plan.nets":"{n} ネット","web.ring.app.words":"Pebble アプリの文字起こし","web.ring.count":"録音 {n} 件","web.ring.count.one":"録音 1 件","web.ring.error":"録音を読み込めませんでした。","web.ring.found":"{total} 件中 {found} 件に「{q}」があります。","web.ring.heard.by":"{model} が認識","web.ring.heard.by.sure":"{model} が認識、確度 {conf}%","web.ring.loading":"録音を読み込み中…","web.ring.no.words":"(言葉なし)","web.ring.not.heard":"未認識","web.ring.state.busy":"認識中","web.ring.state.failed":"Pebble に渡せませんでした","web.ring.state.heard":"Pebble への受け渡し待ち","web.ring.state.new":"認識待ち","web.ring.state.sent":"Pebble に渡しました","web.ring.unavailable":"このハブはまだブラウザーにリングのメモを表示しません。ハブを更新するか、デスクトップアプリの設定 › リングを開いてください。","web.settings.providers":"AI プロバイダー","web.settings.providers.browser":"Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。"}};function Si(e,t){if(!t)return e;return e.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(n,i)=>Object.prototype.hasOwnProperty.call(t,i)?String(t[i]):n)}var ft=Nr(),yn=new Set,wn=new Map;for(let[e,t]of Object.entries(jt.en||{}))if(typeof t==="string"&&!wn.has(t))wn.set(t,e);function Nr(){let e=typeof navigator<"u"&&navigator.language?navigator.language.toLowerCase():"en";if(e.startsWith("ja"))return"ja";if(e.startsWith("es"))return"es";return"en"}function Li(){if(typeof document<"u"&&document.documentElement)document.documentElement.lang=ft}Li();function en(e){return yn.add(e),()=>{yn.delete(e)}}function vt(e){if(!e)return!1;let t=e.toLowerCase(),n=t.startsWith("ja")?"ja":t.startsWith("es")?"es":t.startsWith("en")?"en":"";if(!n)return!1;let i=n!==ft;if(ft=n,Li(),i)for(let s of yn)s(ft);return i}function Ai(){return ft}function m(e,t,n){let s=(jt[ft]||jt.en||{})[e]??jt.en?.[e]??t??e;return Si(s,n)}function pe(e){if(!e)return"";let t=wn.get(e);if(!t)return e;return m(t,e)}function X(e,t="",n=""){let i=document.createElement(e);if(t)i.className=t;if(n)i.textContent=n;return i}function We(e,t="",n){let i=X("button",t,e);if(i.type="button",n)i.addEventListener("click",n);return i}function Mr(e){let t=e.replace(/[\\/]+$/,"");if(!t)return e||"/";let n=t.split(/[\\/]/);return n[n.length-1]||t}function Tr(e,t){let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return e.endsWith(n)?e+t:e+n+t}class En{hub;actionLabel;action;root;pathInput;upBtn;listEl;errEl;actBtn;path="";parent=null;gen=0;busy=!1;constructor(e,t,n,i=[]){this.hub=e;this.actionLabel=t;this.action=n;this.root=X("div","bp-fb"),this.root.setAttribute("data-testid","folder-browser");let s=X("div","bp-fb-head");this.upBtn=We("↑","bp-btn-ghost bp-fb-up",()=>{if(this.parent)this.go(this.parent)}),this.upBtn.title=m("web.clone.up","Up"),this.upBtn.setAttribute("aria-label",m("web.clone.up","Up")),this.pathInput=X("input","bp-input bp-fb-path"),this.pathInput.spellcheck=!1,this.pathInput.setAttribute("data-testid","folder-path"),this.pathInput.addEventListener("keydown",(a)=>{if(a.key==="Enter"){a.preventDefault();let o=this.pathInput.value.trim();if(o)this.go(o)}}),s.append(this.upBtn,this.pathInput),this.listEl=X("div","bp-fb-list"),this.errEl=X("div","bp-ap-err bp-hidden");let r=X("div","bp-ap-foot");this.actBtn=We("","primary",()=>{this.run()}),this.actBtn.setAttribute("data-testid","folder-act"),r.append(...i,this.actBtn),this.root.append(s,this.listEl,this.errEl,r)}currentPath(){return this.path}async go(e){let t=++this.gen;this.setError(""),this.listEl.replaceChildren(X("div","bp-fb-empty",m("web.clone.loading","Loading…")));try{let n=await this.hub.rpc("dirs.list",{path:e});if(t!==this.gen)return;this.path=n.path,this.parent=n.parent??null,this.render(n.dirs??[])}catch(n){if(t!==this.gen)return;this.setError(pe(n instanceof Error?n.message:String(n))),this.render(null)}}refreshLocale(){this.upBtn.title=m("web.clone.up","Up"),this.updateAct()}render(e){if(this.pathInput.value=this.path,this.upBtn.disabled=!this.parent,this.updateAct(),e===null){this.listEl.replaceChildren();return}if(e.length===0){this.listEl.replaceChildren(X("div","bp-fb-empty",m("web.clone.no.folders","No folders here")));return}let t=document.createDocumentFragment();for(let n of e){let i=We("","bp-fb-row",()=>{this.go(Tr(this.path,n))});i.append(X("span","bp-fb-icon","▸"),X("span","bp-fb-name",n)),t.appendChild(i)}this.listEl.replaceChildren(t),this.listEl.scrollTop=0}updateAct(){this.actBtn.textContent=this.path?this.actionLabel(Mr(this.path)):this.actionLabel("…"),this.actBtn.disabled=!this.path||this.busy}async run(){if(!this.path||this.busy)return;this.busy=!0,this.updateAct(),this.setError("");try{await this.action(this.path)}catch(e){this.setError(pe(e instanceof Error?e.message:String(e)))}finally{this.busy=!1,this.updateAct()}}setError(e){this.errEl.textContent=e,this.errEl.classList.toggle("bp-hidden",!e)}}class kn{container;host;backdrop=null;bodyEl=null;tabsEl=null;mode="folder";repoText="";repoValue="";firstText="";wantThread=!0;userParent="";nameText="";nameTouched=!1;dest=null;destGen=0;destPending=!1;destTimer=null;repos=null;reposGen=0;reposTimer=null;showSuggest=!1;suggestIdx=-1;startErr="";starting=!1;picking=!1;jobId="";job=null;specs=new Map;signin=null;copied=!1;repoInput=null;suggestEl=null;destEl=null;signinEl=null;cloneBtn=null;jobEl=null;constructor(e,t){this.container=e;this.host=t}isOpen(){return this.backdrop!==null}open(e={}){let t=this.host.hub.hasFeature("clone"),n=!e.repo&&Boolean(this.jobId)&&(!this.job||this.job.state==="running"||this.job.state==="done");if(!this.backdrop)this.build();if(!n)this.jobId="",this.job=null,this.resetForm();if(e.repo!==void 0||e.text!==void 0)this.repoText=(e.repo??"").trim(),this.repoValue="",this.firstText=(e.text??"").trim();if(this.mode=t&&(e.mode==="clone"||n)?"clone":"folder",this.render(),n){if(this.job)this.maybeGo(this.job);this.reconcile()}else if(this.mode==="clone"&&this.repoText)this.askDest()}reconcile(){let e=this.jobId;if(!e)return;this.host.hub.rpc("clone.status",{id:e}).then((t)=>this.apply(t)).catch(()=>{})}close(){if(this.reposTimer!==null)window.clearTimeout(this.reposTimer);if(this.destTimer!==null)window.clearTimeout(this.destTimer);this.reposTimer=null,this.destTimer=null,this.backdrop?.remove(),this.backdrop=null,this.bodyEl=null,this.tabsEl=null}escape(){if(this.picking){this.picking=!1,this.render();return}if(this.showSuggest){this.showSuggest=!1,this.renderSuggest();return}this.close()}refreshLocale(){if(this.backdrop)this.render()}handleFrame(e){if(e.k==="clone"){let t=e.clone;if(t)this.apply(t)}else if(e.k==="clone.repos"){if(this.isOpen()&&this.mode==="clone"&&!this.jobId)this.askRepos(0)}else if(e.k==="clone.signin"){if(!this.signin)return;let t=this.signin.state;if(this.signin=e.signin??null,this.signin?.state==="cancelled")this.signin=null;if(t!=="done"&&this.signin?.state==="done")this.askRepos(0);this.renderSignin()}}build(){let e=X("div","bp-modal-backdrop");e.setAttribute("data-testid","add-project");let t=X("div","bp-modal bp-ap"),n=X("div","bp-modal-head"),i=X("h2","",m("sidebar.add.project","Add project")),s=We("×","icon",()=>this.close());s.title=m("common.close","Close"),s.setAttribute("aria-label",m("common.close","Close")),n.append(i,s),this.tabsEl=X("div","bp-ap-tabs"),this.bodyEl=X("div","bp-modal-body bp-ap-body"),t.append(n,this.tabsEl,this.bodyEl),e.appendChild(t),e.addEventListener("mousedown",(r)=>{if(r.target===e)this.close()}),this.container.appendChild(e),this.backdrop=e}resetForm(){this.repoText="",this.repoValue="",this.firstText="",this.wantThread=!0,this.userParent="",this.nameText="",this.nameTouched=!1,this.dest=null,this.destPending=!1,this.repos=null,this.showSuggest=!1,this.suggestIdx=-1,this.startErr="",this.starting=!1,this.picking=!1,this.signin=null,this.copied=!1}render(){if(!this.bodyEl||!this.tabsEl||!this.backdrop)return;let e=this.backdrop.querySelector(".bp-modal-head h2");if(e)e.textContent=m("sidebar.add.project","Add project");if(this.renderTabs(),this.repoInput=null,this.suggestEl=null,this.destEl=null,this.signinEl=null,this.cloneBtn=null,this.jobEl=null,this.mode==="folder")this.renderFolder();else if(this.jobId&&this.job)this.renderJobView();else if(this.picking)this.renderPickParent();else this.renderCloneForm()}renderTabs(){if(!this.tabsEl)return;if(!this.host.hub.hasFeature("clone")){this.tabsEl.classList.add("bp-hidden");return}this.tabsEl.classList.remove("bp-hidden");let e=(t,n)=>{let i=We(n,"bp-ap-tab"+(this.mode===t?" on":""),()=>{if(this.mode===t)return;if(this.mode=t,this.render(),t==="clone"&&!this.jobId&&this.repos===null)this.askRepos(0)});return i.setAttribute("data-testid",`ap-tab-${t}`),i.setAttribute("aria-pressed",String(this.mode===t)),i};this.tabsEl.replaceChildren(e("folder",m("gpui.e.open.folder","Open folder")),e("clone",m("web.clone.tab","Clone from git")))}renderFolder(){let e=new En(this.host.hub,(t)=>m("web.clone.add.dir","Add {dir}",{dir:t}),async(t)=>{let n=await this.host.hub.rpc("project.add",{path:t},30000);if(this.close(),n.project)this.host.onProjectAdded(n.project)});this.bodyEl.replaceChildren(e.root),e.go("")}renderCloneForm(){let e=this.bodyEl,t=X("div","bp-ap-form"),n=X("div","bp-ap-repo"),i=X("input","bp-input");i.type="text",i.spellcheck=!1,i.autocomplete="off",i.placeholder=m("web.clone.repo.placeholder","https or ssh URL, or owner/repo"),i.setAttribute("aria-label",m("web.clone.repo.placeholder","https or ssh URL, or owner/repo")),i.setAttribute("data-testid","clone-repo"),i.value=this.repoText,i.addEventListener("input",()=>{if(this.repoText=i.value,this.repoValue="",this.showSuggest=!0,this.suggestIdx=-1,this.startErr="",!this.nameTouched)this.nameText="";this.askRepos(200),this.askDest(250)}),i.addEventListener("focus",()=>{if(this.showSuggest=!0,this.repos===null)this.askRepos(0);else this.renderSuggest()}),i.addEventListener("blur",()=>{window.setTimeout(()=>{if(document.activeElement!==i)this.showSuggest=!1,this.renderSuggest()},120)}),i.addEventListener("keydown",(p)=>this.repoKey(p)),this.repoInput=i,this.suggestEl=X("div","bp-ap-suggest bp-hidden"),this.suggestEl.setAttribute("data-testid","clone-suggest"),n.append(i,this.suggestEl),this.signinEl=X("div","bp-ap-signin bp-hidden"),this.signinEl.setAttribute("data-testid","clone-signin"),this.destEl=X("div","bp-ap-dest"),this.destEl.setAttribute("data-testid","clone-dest");let s=X("label","bp-ap-check"),r=X("input");r.type="checkbox",r.checked=this.wantThread,r.setAttribute("data-testid","clone-thread"),r.addEventListener("change",()=>{this.wantThread=r.checked}),s.append(r,X("span","",m("web.clone.start.thread","Start a thread")));let a=[n,this.signinEl,this.destEl,s];if(this.firstText)a.push(X("div","bp-ap-first bp-dim",m("web.clone.first","First message: {text}",{text:this.firstText})));let o=X("div","bp-ap-err"+(this.startErr?"":" bp-hidden"),this.startErr);o.setAttribute("data-testid","clone-start-error");let c=X("div","bp-ap-foot");this.cloneBtn=We(m("web.clone.go","Clone"),"primary",()=>{this.startClone()}),this.cloneBtn.setAttribute("data-testid","clone-go"),c.append(this.cloneBtn),a.push(o,c),t.append(...a),e.replaceChildren(t),this.renderSuggest(),this.renderSignin(),this.renderDest(),window.setTimeout(()=>{if(this.repoInput===i&&!this.repoText)i.focus()},0)}repoKey(e){let t=this.repos?.repos??[],n=this.showSuggest&&t.length>0;if(e.key==="ArrowDown"&&n)e.preventDefault(),this.suggestIdx=Math.min(t.length-1,this.suggestIdx+1),this.renderSuggest();else if(e.key==="ArrowUp"&&n)e.preventDefault(),this.suggestIdx=Math.max(-1,this.suggestIdx-1),this.renderSuggest();else if(e.key==="Enter"){e.preventDefault();let i=n&&this.suggestIdx>=0?t[this.suggestIdx]:void 0;if(i)this.pickRepo(i);else if(this.canStart())this.startClone()}}pickRepo(e){if(this.repoText=e.name,this.repoValue=e.value,this.showSuggest=!1,this.suggestIdx=-1,this.startErr="",!this.nameTouched)this.nameText="";if(this.repoInput)this.repoInput.value=e.name;this.renderSuggest(),this.askDest()}repoArg(){return this.repoValue||this.repoText.trim()}askRepos(e){if(this.reposTimer!==null)window.clearTimeout(this.reposTimer);this.reposTimer=window.setTimeout(()=>{this.reposTimer=null;let t=++this.reposGen,n=this.repoValue?"":this.repoText.trim();this.host.hub.rpc("clone.repos",{q:n,limit:12},30000).then((i)=>{if(t!==this.reposGen)return;this.repos=i,this.renderSuggest(),this.renderSignin()}).catch(()=>{if(t!==this.reposGen)return;this.repos={repos:[],state:"error",hint:"Couldn't list your GitHub repositories."},this.renderSuggest()})},e)}renderSuggest(){let e=this.suggestEl;if(!e)return;let t=this.repos,n=t?.repos??[],i=[];if(this.showSuggest&&!this.repoValue){if(n.forEach((s,r)=>{let a=We("","bp-ap-sug"+(r===this.suggestIdx?" active":""));a.setAttribute("data-testid","clone-suggestion"),a.addEventListener("mousedown",(c)=>c.preventDefault()),a.addEventListener("click",()=>this.pickRepo(s));let o=X("div","bp-ap-sug-top");if(o.append(X("span","bp-ap-sug-name",s.name)),s.private)o.append(X("span","bp-ap-tag",m("web.clone.private","private")));if(a.append(o),s.description)a.append(X("div","bp-ap-sug-desc",s.description));i.push(a)}),n.length===0&&t){if(t.loading)i.push(X("div","bp-ap-sug-note",m("web.clone.loading","Loading…")));else if(t.hint){let s=X("div","bp-ap-sug-note");if(s.append(X("span","",pe(t.hint))),t.state==="signedout"){let r=We(m("web.clone.signin","Sign in to GitHub"),"bp-btn-line",()=>{this.startSignin()});r.addEventListener("mousedown",(a)=>a.preventDefault()),r.setAttribute("data-testid","clone-signin-btn"),s.append(r)}i.push(s)}}}e.replaceChildren(...i),e.classList.toggle("bp-hidden",i.length===0)}askDest(e=0){if(this.destTimer!==null)window.clearTimeout(this.destTimer);this.destPending=!0,this.updateCloneBtn(),this.destTimer=window.setTimeout(()=>{this.destTimer=null;let t=++this.destGen,n=this.repoArg();if(!n){this.dest=null,this.destPending=!1,this.renderDest();return}let i={repo:n};if(this.userParent)i.parent=this.userParent;if(this.nameTouched&&this.nameText.trim())i.name=this.nameText.trim();else if(this.userParent)i.name="";this.host.hub.rpc("clone.dest",i).then((s)=>{if(t!==this.destGen)return;if(this.dest=s,this.destPending=!1,!this.nameTouched&&s.folder)this.nameText=s.folder;this.renderDest()}).catch((s)=>{if(t!==this.destGen)return;this.dest={ok:!1,error:s instanceof Error?s.message:String(s)},this.destPending=!1,this.renderDest()})},e)}renderDest(){let e=this.destEl;if(!e)return;let t=this.dest,n=[];if(t&&!t.repo){if(t.error&&this.repoText.trim())n.push(this.errLine(pe(t.error)))}else if(t){let a=X("div","bp-ap-where"),o=X("span","bp-ap-dest-path",t.destShown||t.dest||t.defaultParentShown||"");o.setAttribute("data-testid","clone-dest-shown");let c=We(m("web.clone.change.folder","Change folder"),"bp-btn-line",()=>{this.picking=!0,this.render()});c.setAttribute("data-testid","clone-change-folder"),a.append(o,c),n.push(a);let p=X("label","bp-ap-name");p.append(X("span","bp-ap-lbl",m("web.clone.folder.name","Folder name")));let l=X("input","bp-input");if(l.type="text",l.spellcheck=!1,l.value=this.nameText,l.setAttribute("data-testid","clone-name"),l.addEventListener("input",()=>{this.nameText=l.value,this.nameTouched=l.value.trim()!=="",this.startErr="",this.askDest(250)}),l.addEventListener("keydown",(h)=>{if(h.key==="Enter"&&this.canStart())h.preventDefault(),this.startClone()}),p.append(l),n.push(p),!t.ok&&t.error)n.push(this.errLine(pe(t.error)));else if(t.same)n.push(X("div","bp-ap-note bp-dim",m("web.clone.same","Already cloned there: it is added as it is.")))}let i=document.activeElement,s=i&&e.contains(i)&&i.getAttribute("data-testid")==="clone-name",r=s?i.selectionStart:null;if(e.replaceChildren(...n),e.classList.toggle("bp-hidden",n.length===0),s){let a=e.querySelector('[data-testid="clone-name"]');if(a){if(a.focus(),r!==null)a.setSelectionRange(r,r)}}this.updateCloneBtn()}errLine(e){let t=X("div","bp-ap-err",e);return t.setAttribute("data-testid","clone-dest-error"),t}canStart(){return Boolean(this.dest?.ok&&this.dest.repo&&!this.destPending&&!this.starting&&this.repoArg())}updateCloneBtn(){if(this.cloneBtn)this.cloneBtn.disabled=!this.canStart()}renderPickParent(){let e=this.dest?.parent||this.userParent||this.dest?.defaultParent||"",t=We(m("web.clone.back","Back"),"bp-btn-line",()=>{this.picking=!1,this.render()}),n=new En(this.host.hub,(i)=>m("web.clone.use.dir","Use {dir}",{dir:i}),async(i)=>{this.userParent=i,this.picking=!1,this.render(),this.askDest()},[t]);this.bodyEl.replaceChildren(n.root),n.go(e)}async startClone(){if(!this.canStart()||!this.dest)return;this.starting=!0,this.startErr="",this.updateCloneBtn();let e={repo:this.repoArg(),thread:this.wantThread,text:this.firstText},t=vn();this.jobId=t,this.job=null,this.specs.set(t,e);try{let n=await this.host.hub.rpc("clone.start",{id:t,repo:e.repo,parent:this.dest.parent??"",name:this.dest.folder??this.nameText.trim(),thread:e.thread,text:e.text});this.starting=!1,this.apply(n)}catch(n){this.starting=!1;let i=pe(n instanceof Error?n.message:String(n));if(this.jobId===t&&!this.job){let s=await this.host.hub.rpc("clone.status",{id:t}).catch(()=>null);if(s&&s.id===t){this.apply(s);return}}if(this.jobId===t&&!this.job){if(this.jobId="",this.startErr=i,this.mode==="clone")this.render()}}}async retry(e,t){let n=this.specs.get(e.id)??{repo:e.origin||e.repo||"",thread:!0,text:""},i=vn(),s=this.jobId;this.jobId=i,this.specs.set(i,n),t.disabled=!0;try{let r=await this.host.hub.rpc("clone.start",{id:i,repo:n.repo,dest:e.dest??"",thread:n.thread,text:n.text});this.apply(r)}catch(r){let a=pe(r instanceof Error?r.message:String(r));if(this.jobId!==i)return;if(!this.job||this.job.id!==i){let o=await this.host.hub.rpc("clone.status",{id:i}).catch(()=>null);if(o&&o.id===i){this.apply(o);return}}if(this.jobId===i&&(!this.job||this.job.id!==i))this.jobId=s,t.disabled=!1,this.showJobError(a)}}apply(e){if(!e||e.id!==this.jobId)return;if(!xi(this.job,e))return;if(this.job=e,this.copied=!1,this.isOpen()&&this.mode==="clone")if(this.jobEl&&this.jobEl.isConnected)this.renderJob();else this.render();this.maybeGo(e)}maybeGo(e){if(this.isOpen()&&e.id===this.jobId&&Pi(e))this.goTo(e)}renderJobView(){this.jobEl=X("div","bp-ap-job"),this.jobEl.setAttribute("data-testid","clone-job"),this.signinEl=X("div","bp-ap-signin bp-hidden"),this.signinEl.setAttribute("data-testid","clone-signin"),this.bodyEl.replaceChildren(this.jobEl,this.signinEl),this.renderJob(),this.renderSignin()}renderJob(){let e=this.jobEl,t=this.job;if(!e||!t)return;let n=t.destShown||t.dest||"",i=t.repo||"",s=t.state==="done"?m("web.clone.cloned","Cloned {repo} into {dest}",{repo:i,dest:n}):t.state==="cancelled"?m("web.clone.stopped","Stopped cloning {repo}",{repo:i}):m("web.clone.cloning","Cloning {repo} into {dest}",{repo:i,dest:n}),r=[X("div","bp-ap-job-title",s)];if(t.state==="running"){let a=X("div","bp-ap-phase",pe(t.phase||""));a.setAttribute("data-testid","clone-phase");let o=X("div","bp-ap-bar"+(typeof t.pct==="number"?"":" indeterminate")),c=X("div","bp-ap-bar-fill");if(typeof t.pct==="number")c.style.width=`${Math.max(0,Math.min(100,t.pct))}%`;if(o.appendChild(c),o.setAttribute("role","progressbar"),typeof t.pct==="number")o.setAttribute("aria-valuenow",String(t.pct));if(r.push(a,o),t.detail)r.push(X("div","bp-ap-detail bp-dim",t.detail));let p=X("div","bp-ap-foot"),l=We(m("common.cancel","Cancel"),"bp-btn-line",()=>{this.host.hub.rpc("clone.cancel",{id:t.id}).then((h)=>this.apply(h)).catch(()=>{})});l.setAttribute("data-testid","clone-cancel"),p.append(l),r.push(p)}else if(t.state==="failed"||t.state==="cancelled"){if(t.state==="failed"&&t.error){let p=X("div","bp-ap-err",pe(t.error));p.setAttribute("data-testid","clone-error"),r.push(p)}let a=X("div","bp-ap-foot"),o=We(m("web.clone.back","Back"),"bp-btn-line",()=>{this.jobId="",this.job=null,this.signin=null,this.render(),this.askDest()});if(a.append(o),t.signin){let p=We(m("web.clone.signin","Sign in to GitHub"),"bp-btn-line",()=>{this.startSignin()});p.setAttribute("data-testid","clone-signin-btn"),a.append(p)}let c=We(m("web.clone.retry","Try again"),"primary",()=>{this.retry(t,c)});c.setAttribute("data-testid","clone-retry"),a.append(c),r.push(a)}else if(t.state==="done"){let a=t.notes??[];if(a.length>0){let l=X("ul","bp-ap-notes");l.setAttribute("data-testid","clone-notes");for(let h of a)l.appendChild(X("li","",pe(h)));r.push(l)}let o=X("div","bp-ap-foot"),c=t.thread?m("web.clone.open.thread","Open the thread"):m("web.clone.open.project","Open the project"),p=We(c,"primary",()=>this.goTo(t));p.setAttribute("data-testid","clone-open"),o.append(p),r.push(o)}e.replaceChildren(...r)}showJobError(e){if(!this.jobEl)return;this.jobEl.querySelector(".bp-ap-job-err")?.remove();let t=X("div","bp-ap-err bp-ap-job-err",e);this.jobEl.appendChild(t)}goTo(e){this.jobId="",this.job=null,this.close(),this.host.onCloneDone(e)}async startSignin(){this.signin={state:"starting"},this.copied=!1,this.renderSignin();try{let e=await this.host.hub.rpc("clone.signin",{restart:!0},30000);if(!this.signin||this.signin.state==="starting")this.signin=e}catch(e){this.signin={state:"failed",error:e instanceof Error?e.message:String(e)}}if(this.signin?.state==="done")this.askRepos(0);this.renderSignin()}renderSignin(){let e=this.signinEl;if(!e)return;let t=this.signin,n=[];if(t&&t.state){if(t.state==="starting"||t.state==="waiting"&&!t.code)n.push(X("div","bp-dim",m("web.clone.signin.wait","Starting GitHub sign-in…")));else if(t.state==="waiting"){n.push(X("div","",m("web.clone.signin.enter","Enter this code on GitHub:")));let i=X("div","bp-ap-code-row"),s=X("span","bp-ap-code",t.code||"");s.setAttribute("data-testid","clone-signin-code");let r=We(this.copied?m("web.clone.copied","Copied"):m("common.copy","Copy"),"bp-btn-line",()=>{navigator.clipboard?.writeText(t.code||"").then(()=>{this.copied=!0,this.renderSignin()}).catch(()=>{})});if(i.append(s,r),n.push(i),t.url){let a=X("a","bp-ap-link",t.url);a.href=t.url,a.target="_blank",a.rel="noopener noreferrer",a.setAttribute("data-testid","clone-signin-url"),n.push(a)}}else if(t.state==="done")n.push(X("div","bp-ok",m("web.clone.signin.done","Signed in to GitHub")));else if(t.state==="failed")n.push(X("div","bp-ap-err",pe(t.error||"")))}e.replaceChildren(...n),e.classList.toggle("bp-hidden",n.length===0)}}function Br(e){try{let t=new URL(e,window.location.origin);if(t.protocol==="https:"||t.protocol==="http:")return t.href}catch{}return null}function Ht(e,t){let n=/(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[([^\]]+)\]\(([^)]+)\))/g,i=0,s;while((s=n.exec(t))!==null){if(s.index>i)e.appendChild(document.createTextNode(t.slice(i,s.index)));let r=s[0];if(r.startsWith("`")&&r.endsWith("`")){let a=document.createElement("code");a.className="bp-code-inline",a.textContent=r.slice(1,-1),e.appendChild(a)}else if(r.startsWith("**")&&r.endsWith("**")){let a=document.createElement("strong");a.textContent=r.slice(2,-2),e.appendChild(a)}else if(r.startsWith("*")&&r.endsWith("*")){let a=document.createElement("em");a.textContent=r.slice(1,-1),e.appendChild(a)}else if(r.startsWith("[")){let a=s[2]??"",o=Br(s[3]??"");if(o){let c=document.createElement("a");c.href=o,c.target="_blank",c.rel="noopener noreferrer",c.textContent=a,e.appendChild(c)}else e.appendChild(document.createTextNode(a))}i=n.lastIndex}if(i=(e.ended??0)}function Li(e){if(e.state!=="done")return!1;if(typeof e.hold==="boolean")return!e.hold;return(e.notes??[]).length===0}var Ft={en:{"agy.signout":"Sign out","android.hub.machines.approve":"Approve","android.load.earlier":"load earlier","approval.dismiss":"Dismiss","approval.implement":"Implement","ask.plan":"Proposed plan","bots.new":"New bot","bots.rooms":"Rooms","bots.tab.browser":"Browser","chats.move":"Move to project…","chats.move.none":"No project to move it to. Add a project first.","chats.new.noproject":"New chat (no project)","chats.title":"Chats","common.cancel":"Cancel","common.close":"Close","common.copy":"Copy","common.delete":"Delete","common.refresh":"Refresh","common.remove":"Remove","common.save":"Save","common.search":"Search","composer.model.tip":"Choose the model and effort","composer.placeholder":"Ask anything: @bot, >thread, %project, #room, $skill, /btw","composer.send":"Send","composer.stop":"Stop","gpui.acct.connected":"Connected","gpui.acct.not.connected":"Not connected","gpui.acct.sign.in.expired":"Sign-in expired","gpui.ask.plan.ready":"Ready for review","gpui.ask.plan.revise":"Revise","gpui.ask.plan.reviseph":"What should change in the plan?","gpui.ask.plan.sendrev":"Send revision","gpui.assembly":"Assembly","gpui.b.in.reply.to":"↩ In reply to: {quote}","gpui.b.replying.to":"↩ Replying to: {line}","gpui.bots.recall.off":"Off","gpui.bots.recall.on":"On","gpui.c.solid.big.next":"Loading it may take a while and a lot of memory.","gpui.c.solid.load.big":"Load it anyway","gpui.c.solid.loading.big":"Loading it anyway…","gpui.c.term.collapse":"Collapse","gpui.c.term.expand":"Expand","gpui.commands":"Commands","gpui.e.open.folder":"Open folder","gpui.filter.projects.and.threads":"Filter projects and threads","gpui.fold.or.unfold.the.sidebar":"Fold or unfold the sidebar","gpui.follow.paused":"Following paused","gpui.follow.wait":"Following: waiting for the agent's next edit","gpui.gerbers":"Gerbers","gpui.goal.notes":"GOAL & NOTES","gpui.improvements":"Improvements","gpui.jump.to.a.thread.run":"Jump to a thread, run a command or find what was said","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"no MPN","gpui.mgmt.checks.all":"All","gpui.mgmt.checks.fix":"Fix with agent","gpui.mgmt.checks.run":"Run","gpui.mgmt.close":"Close the panel","gpui.mgmt.fab.apply":"Apply","gpui.mgmt.fab.changed":"Changed since you last looked","gpui.mgmt.fab.derived":"* worked out from the fab's page (a mil in mm, a ring from a diameter). Dimmed: the rigid board's value, where this board's page says nothing else. A date opens the page it was read from.","gpui.mgmt.fab.extra":"Costs more","gpui.mgmt.fab.findings":"Findings","gpui.mgmt.fab.free":"Base price","gpui.mgmt.fab.judge":"Datasheets","gpui.mgmt.fab.limit":"Limit","gpui.mgmt.fab.readcol":"Read","gpui.mgmt.fab.refresh":"Refresh","gpui.mgmt.fab.reviewbtn":"Review","gpui.mgmt.fab.seen":"Seen","gpui.mgmt.fab.thefab":"The fab","gpui.mgmt.fab.use":"Use","gpui.mgmt.life.nopart":"No reading of this part yet.","gpui.mgmt.life.reading":"Reading its history…","gpui.mgmt.plan.addnote":"Add note","gpui.mgmt.plan.all":"Approve all","gpui.mgmt.plan.before":"Plan before routing","gpui.mgmt.plan.compact":"Compact","gpui.mgmt.plan.done":"done","gpui.mgmt.plan.drawn":"The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them.","gpui.mgmt.plan.edited":"Edited","gpui.mgmt.plan.elsewhere":"A routing plan for {board} awaits your approval","gpui.mgmt.plan.emptysub":"Layers, corridors, and planes appear here once a plan is proposed.","gpui.mgmt.plan.expand":"Expand","gpui.mgmt.plan.fit":"Fit","gpui.mgmt.plan.grid.all":"All layers","gpui.mgmt.plan.grid.pair":"Side by side","gpui.mgmt.plan.grid.single":"Single","gpui.mgmt.plan.hide":"Hide done","gpui.mgmt.plan.hint":"Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove","gpui.mgmt.plan.keysnote":"On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.","gpui.mgmt.plan.layer":"Approve layer","gpui.mgmt.plan.layer.short":"Layer","gpui.mgmt.plan.lock":"Lock","gpui.mgmt.plan.locked":"Locked","gpui.mgmt.plan.noboard":"No routing plan for this board.","gpui.mgmt.plan.noitems":"No corridors or planes on this layer","gpui.mgmt.plan.note.placeholder":"Steering note for router…","gpui.mgmt.plan.nothing":"Nothing awaits your approval","gpui.mgmt.plan.offwords":"Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here.","gpui.mgmt.plan.onwords":"Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve.","gpui.mgmt.plan.reading":"Reading the routing plan…","gpui.mgmt.plan.reference":"over {layer}","gpui.mgmt.plan.refused":"KiCad refused","gpui.mgmt.plan.reject":"Reject","gpui.mgmt.plan.rejectlayer":"Reject layer","gpui.mgmt.plan.reqplain":"Approval requested","gpui.mgmt.plan.requested":"Approval requested: {what}","gpui.mgmt.plan.saved":"saved plan","gpui.mgmt.plan.show":"Show done","gpui.mgmt.plan.st.approved":"Approved","gpui.mgmt.plan.st.awaiting":"Awaiting review","gpui.mgmt.plan.st.blocked":"Blocked","gpui.mgmt.plan.st.empty":"Empty","gpui.mgmt.plan.st.partial":"Partial","gpui.mgmt.plan.st.rejected":"Rejected","gpui.mgmt.plan.st.routed":"Routed","gpui.mgmt.plan.st.routing":"Routing","gpui.mgmt.plan.st.verified":"Verified","gpui.mgmt.plan.stackup.short":"Stackup","gpui.mgmt.plan.stop":"Stop routing","gpui.mgmt.plan.sync":"Link zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Unlock","gpui.mgmt.plan.verify":"Verify","gpui.mgmt.plan.view.canvas":"Canvas","gpui.mgmt.plan.view.list":"List","gpui.mgmt.plan.view.split":"Split","gpui.mgmt.plan.width":"Width","gpui.next.thread":"Next thread","gpui.no.goal.yet.ask.an":"No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.","gpui.no.models":"No models","gpui.no.threads.yet":"No threads yet.","gpui.nothing.matches":"Nothing matches","gpui.picker.favorite.add":"Add to favorites","gpui.picker.favorite.remove":"Remove from favorites","gpui.picker.favorites":"Favorites","gpui.planmode.bar.always":"Plan mode — explores and proposes a plan before editing","gpui.planmode.bar.executing":"Building the approved plan","gpui.planmode.bar.once":"Plan mode (1 turn) — explores and proposes a plan before editing","gpui.planmode.bar.pending":"Proposed plan awaits review below","gpui.planmode.bar.planning":"Planning — drafting a plan before edits","gpui.planmode.chip.building":"Building","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Always","gpui.planmode.scope.once":"1 turn","gpui.planmode.tip":"Plan before acting (1 turn, always, or off)","gpui.planmode.top.executing":"Building plan","gpui.planmode.top.once":"Plan (1 turn)","gpui.planmode.top.pending":"Review plan","gpui.planmode.top.planning":"Planning","gpui.previous.thread":"Previous thread","gpui.projects.boards":"BOARDS ({n})","gpui.projects.mech":"MECHANICAL ({n})","gpui.projects.threads":"THREADS ({n})","gpui.projects.to.order":"TO ORDER ({n})","gpui.rail.no.board":"No board in this project","gpui.rail.no.mech":"No mechanical parts in this project","gpui.rail.no.schematic":"No schematic in this project","gpui.rail.split.needs.both":"Split needs a board and a schematic","gpui.search.models":"Search models","gpui.settings.group.agents":"Agents and tools","gpui.settings.group.general":"General","home.away":"Home ({name}) is away","home.away.queued":"Home ({name}) is away · {n} queued","home.away.since":"Home ({name}) is away since {time}","home.away.since.queued":"Home ({name}) is away since {time} · {n} queued","home.machine":"Home machine","home.move.failed":"Home move failed","home.move.failed.note":"Home move failed: {note}","home.move.here":"Make this machine the home","home.moving":"Moving home to {to}…","home.moving.step":"Moving home to {to}: {step}","hub.back.crash":"Backplane is back after it stopped unexpectedly","hub.restarting":"Restarting Backplane…","hub.restarting.build":"Restarting Backplane… (new build {build})","hub.stopped":"Backplane stopped","ios.hub.address.field":"Hub address","menu.pin":"Pin","menu.settle":"Settle","menu.unpin":"Unpin","menu.wake":"Wake","model.col.agent":"Agent","model.col.effort":"Effort","native.pair.connect":"Connect","native.thread.model":"Model","notify.settled":"Settled","palette.archive":"Archive thread","palette.command.placeholder":"Type a command or a thread","palette.diff":"Diff: what this thread changed","palette.newthread":"New thread","palette.settings":"Settings","palette.terminal":"Terminal","palette.unarchive":"Unarchive thread","phone.unsettle":"Unsettle","provider.notice.button":"Open Settings → Accounts","provider.notice.head":"No AI provider connected","provider.notice.senderr":"No AI provider connected yet. Open Settings → Accounts to connect Claude, Codex, Antigravity, or another provider.","provider.notice.senderr.remote":"No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.","provider.notice.text.none":"Connect Claude, Codex, Antigravity, or another provider to start chatting.","provider.notice.text.signedout":"Sign in to Claude, Codex, or another provider in Settings → Accounts to start chatting.","reply.action":"Reply","reply.cancel":"Cancel reply","reply.to":"In reply to:","ring.hear.again.local":"Hear again (local)","ring.hear.again.openai":"Hear again (OpenAI)","ring.no.recordings.yet":"No recordings yet.","ring.recordings":"Recordings","ring.ring":"Ring","ring.search.what.you.said":"Search what you said","ring.show.all":"Show all","ring.what.happened":"What happened","rooms.new":"New room","secret.you":"You","settings.appearance":"Appearance","settings.lang":"Language","settings.lang.auto":"Automatic","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Theme","settings.theme.dark":"Dark","settings.theme.light":"Light","sheet.rename":"Rename thread","sidebar.add.project":"Add project","sidebar.search.projects":"Search projects","thread.context.base":"Backplane","thread.context.copied":"Prompt copied.","thread.context.copy":"Copy prompt","thread.context.disable":"Disable","thread.context.enable":"Enable","thread.context.index":"Available skills index","thread.context.injected.label":"Injected project instructions","thread.context.instructions":"Instructions","thread.context.mcp":"Project MCPs","thread.context.native.note":"Backplane’s launch prompt. Native files are loaded by the provider.","thread.context.none.instructions":"No project instructions found.","thread.context.none.mcp":"No project MCP configurations found.","thread.context.reading":"Reading thread context…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Skills","thread.context.system":"System Prompt","thread.context.title":"Context & Prompt","thread.context.trust":"Trust and enable","thread.new":"New thread","tools.pinned":"Pinned","tools.retry":"Retry","tour.title.bots":"Bots","viewer.board":"Board","viewer.diff":"Diff","viewer.files":"Files","viewer.mech":"Mech","viewer.review":"Review","viewer.schematic":"Schematic","viewer.solid":"3D","web.chat.answer.btn":"Answer","web.chat.answer.placeholder":"Type answer…","web.chat.answered":"Answered: {answer}","web.chat.choose":"Choose a project thread on the left to begin.","web.chat.empty":"No messages yet. Type below to start a turn.","web.chat.finished":"Finished {time}","web.chat.finished.dur":"Finished {time} · {dur}","web.chat.loading":"Loading messages…","web.chat.review.mode":"Review mode","web.chat.streaming":"Streaming…","web.clone.add.dir":"Add {dir}","web.clone.back":"Back","web.clone.change.folder":"Change folder","web.clone.cloned":"Cloned {repo} into {dest}","web.clone.cloning":"Cloning {repo} into {dest}","web.clone.copied":"Copied","web.clone.first":"First message: {text}","web.clone.folder.name":"Folder name","web.clone.go":"Clone","web.clone.loading":"Loading…","web.clone.no.folders":"No folders here","web.clone.open.project":"Open the project","web.clone.open.thread":"Open the thread","web.clone.private":"private","web.clone.repo.placeholder":"https or ssh URL, or owner/repo","web.clone.retry":"Try again","web.clone.same":"Already cloned there: it is added as it is.","web.clone.signin":"Sign in to GitHub","web.clone.signin.done":"Signed in to GitHub","web.clone.signin.enter":"Enter this code on GitHub:","web.clone.signin.wait":"Starting GitHub sign-in…","web.clone.start.thread":"Start a thread","web.clone.stopped":"Stopped cloning {repo}","web.clone.tab":"Clone from git","web.clone.up":"Up","web.clone.use.dir":"Use {dir}","web.composer.attach":"Attach image","web.composer.maximages":"At most {max} images per message.","web.composer.unsupported":"Unsupported image type: {type}","web.composer.voice":"Voice dictation","web.home.error":"Could not load this project.","web.home.fold":"Hide threads","web.home.lead":"Lead time: {n} days","web.home.lead.one":"Lead time: 1 day","web.home.loading":"Loading project…","web.home.open":"Open project home","web.home.unfold":"Show threads","web.logout.failed":"Could not confirm sign-out. Try again.","web.pair.approve.in":"Approve on desktop or paired phone · expires in {time}","web.pair.approved":"Approved. Opening Backplane…","web.pair.cancelled":"Cancelled.","web.pair.code":"Comparison code","web.pair.denied":"Pairing request was denied.","web.pair.expired":"Pairing code expired. Request a new code to try again.","web.pair.failed":"Pairing request failed ({status})","web.pair.name":"Browser name","web.pair.nocode":"Hub did not return a comparison code.","web.pair.ratelimited":"Too many pairing attempts. Wait a moment and try again.","web.pair.request":"Request pairing","web.pair.requesting":"Requesting pairing code…","web.pair.subtitle":"Pair this browser with your hub. Approve the 6-digit code in Backplane › Settings › Devices.","web.pair.unreachable":"Could not reach the hub. Check your tailnet connection.","web.plan.awaiting":"{n} awaiting approval","web.plan.net.one":"1 net","web.plan.nets":"{n} nets","web.ring.app.words":"The Pebble app's words","web.ring.count":"{n} recordings","web.ring.count.one":"1 recording","web.ring.error":"Could not load recordings.","web.ring.found":"{found} of {total} have “{q}”.","web.ring.heard.by":"Heard by {model}","web.ring.heard.by.sure":"Heard by {model}, {conf}% sure","web.ring.loading":"Loading recordings…","web.ring.no.words":"(no words)","web.ring.not.heard":"Not heard","web.ring.state.busy":"being heard now","web.ring.state.failed":"not given to Pebble","web.ring.state.heard":"waiting to go to Pebble","web.ring.state.new":"waiting to be heard","web.ring.state.sent":"given to Pebble","web.ring.unavailable":"This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app.","web.settings.providers":"AI providers","web.settings.providers.browser":"Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."},es:{"agy.signout":"Cerrar sesión","android.hub.machines.approve":"Aprobar","android.load.earlier":"cargar anteriores","approval.dismiss":"Descartar","approval.implement":"Implementar","ask.plan":"Plan propuesto","bots.new":"Nuevo bot","bots.rooms":"Salas","bots.tab.browser":"Navegador","chats.move":"Mover a un proyecto…","chats.move.none":"No hay ningún proyecto al que moverlo. Añade uno primero.","chats.new.noproject":"Chat nuevo (sin proyecto)","chats.title":"Chats","common.cancel":"Cancelar","common.close":"Cerrar","common.copy":"Copiar","common.delete":"Eliminar","common.refresh":"Actualizar","common.remove":"Quitar","common.save":"Guardar","common.search":"Buscar","composer.model.tip":"Elegir el modelo y el esfuerzo","composer.placeholder":"Pregunta lo que sea: @bot, >hilo, %proyecto, #sala, $skill, /btw","composer.send":"Enviar","composer.stop":"Detener","gpui.acct.connected":"Conectado","gpui.acct.not.connected":"No conectado","gpui.acct.sign.in.expired":"Sesión caducada","gpui.ask.plan.ready":"Listo para revisar","gpui.ask.plan.revise":"Revisar","gpui.ask.plan.reviseph":"¿Qué debería cambiar en el plan?","gpui.ask.plan.sendrev":"Enviar revisión","gpui.assembly":"Ensamblaje","gpui.b.in.reply.to":"↩ En respuesta a: {quote}","gpui.b.replying.to":"↩ Respondiendo a: {line}","gpui.bots.recall.off":"Desactivado","gpui.bots.recall.on":"Activado","gpui.c.solid.big.next":"Cargarlo puede tardar y usar mucha memoria.","gpui.c.solid.load.big":"Cargarlo de todos modos","gpui.c.solid.loading.big":"Cargándolo de todos modos…","gpui.c.term.collapse":"Contraer","gpui.c.term.expand":"Expandir","gpui.commands":"Comandos","gpui.e.open.folder":"Abrir carpeta","gpui.filter.projects.and.threads":"Filtrar proyectos e hilos","gpui.fold.or.unfold.the.sidebar":"Plegar o desplegar la barra lateral","gpui.follow.paused":"Seguimiento en pausa","gpui.follow.wait":"Siguiendo: esperando la próxima edición del agente","gpui.gerbers":"Gerbers","gpui.goal.notes":"OBJETIVO Y NOTAS","gpui.improvements":"Mejoras","gpui.jump.to.a.thread.run":"Saltar a un hilo, ejecutar un comando o buscar lo dicho","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"sin MPN","gpui.mgmt.checks.all":"Todas","gpui.mgmt.checks.fix":"Corregir con agente","gpui.mgmt.checks.run":"Ejecutar","gpui.mgmt.close":"Cerrar el panel","gpui.mgmt.fab.apply":"Aplicar","gpui.mgmt.fab.changed":"Cambió desde la última vez que miraste","gpui.mgmt.fab.derived":"* calculado desde la página del fabricante (un mil en mm, un anillo desde un diámetro). Atenuado: el valor de la placa rígida, cuando la página de esta placa no dice otra cosa. Una fecha abre la página de la que se leyó.","gpui.mgmt.fab.extra":"Cuesta más","gpui.mgmt.fab.findings":"Hallazgos","gpui.mgmt.fab.free":"Precio base","gpui.mgmt.fab.judge":"Hojas de datos","gpui.mgmt.fab.limit":"Límite","gpui.mgmt.fab.readcol":"Leído","gpui.mgmt.fab.refresh":"Actualizar","gpui.mgmt.fab.reviewbtn":"Revisar","gpui.mgmt.fab.seen":"Visto","gpui.mgmt.fab.thefab":"El fabricante","gpui.mgmt.fab.use":"Usar","gpui.mgmt.life.nopart":"Sin lectura de esta pieza aún.","gpui.mgmt.life.reading":"Leyendo su historial…","gpui.mgmt.plan.addnote":"Añadir nota","gpui.mgmt.plan.all":"Aprobar todo","gpui.mgmt.plan.before":"Planificar antes de rutear","gpui.mgmt.plan.compact":"Compacto","gpui.mgmt.plan.done":"hecho","gpui.mgmt.plan.drawn":"Los corredores y planos del plan se dibujan en la placa mientras este panel está abierto. Ciérralo para ocultarlos.","gpui.mgmt.plan.edited":"Editado","gpui.mgmt.plan.elsewhere":"Un plan de ruteo para {board} espera tu aprobación","gpui.mgmt.plan.emptysub":"Las capas, corredores y planos aparecerán aquí cuando se proponga un plan.","gpui.mgmt.plan.expand":"Expandir","gpui.mgmt.plan.fit":"Ajustar","gpui.mgmt.plan.grid.all":"Todas las capas","gpui.mgmt.plan.grid.pair":"Lado a lado","gpui.mgmt.plan.grid.single":"Única","gpui.mgmt.plan.hide":"Ocultar hechos","gpui.mgmt.plan.hint":"Arrastra vértices para guiar · Clic en + del borde para insertar · Clic derecho en vértice para quitar","gpui.mgmt.plan.keysnote":"En esta versión de KiCad, aprueba desde este panel: en la vista de plan las teclas A, R y W de KiCad aún no son del plan (A abre Añadir Huella). Actualiza KiCad.","gpui.mgmt.plan.layer":"Aprobar capa","gpui.mgmt.plan.layer.short":"Capa","gpui.mgmt.plan.lock":"Bloquear","gpui.mgmt.plan.locked":"Bloqueado","gpui.mgmt.plan.noboard":"No hay plan de ruteo para esta placa.","gpui.mgmt.plan.noitems":"Sin corredores ni planos en esta capa","gpui.mgmt.plan.note.placeholder":"Nota de guiado para el router…","gpui.mgmt.plan.nothing":"Nada espera tu aprobación","gpui.mgmt.plan.offwords":"Los agentes rutean como les pidas. Actívalo para que primero propongan un plan de ruteo y ruteen solo lo que apruebes aquí.","gpui.mgmt.plan.onwords":"Antes de rutear una placa con 4 o más capas de cobre o más de 60 redes, el agente propone aquí corredores y regiones de plano. Solo rutea lo que apruebes.","gpui.mgmt.plan.reading":"Leyendo el plan de ruteo…","gpui.mgmt.plan.reference":"sobre {layer}","gpui.mgmt.plan.refused":"KiCad lo rechazó","gpui.mgmt.plan.reject":"Rechazar","gpui.mgmt.plan.rejectlayer":"Rechazar capa","gpui.mgmt.plan.reqplain":"Aprobación solicitada","gpui.mgmt.plan.requested":"Aprobación solicitada: {what}","gpui.mgmt.plan.saved":"plan guardado","gpui.mgmt.plan.show":"Mostrar hechos","gpui.mgmt.plan.st.approved":"Aprobado","gpui.mgmt.plan.st.awaiting":"Esperando revisión","gpui.mgmt.plan.st.blocked":"Bloqueado","gpui.mgmt.plan.st.empty":"Vacío","gpui.mgmt.plan.st.partial":"Parcial","gpui.mgmt.plan.st.rejected":"Rechazado","gpui.mgmt.plan.st.routed":"Ruteado","gpui.mgmt.plan.st.routing":"Ruteando","gpui.mgmt.plan.st.verified":"Verificado","gpui.mgmt.plan.stackup.short":"Apilamiento","gpui.mgmt.plan.stop":"Detener ruteo","gpui.mgmt.plan.sync":"Vincular zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Desbloquear","gpui.mgmt.plan.verify":"Verificar","gpui.mgmt.plan.view.canvas":"Lienzo","gpui.mgmt.plan.view.list":"Lista","gpui.mgmt.plan.view.split":"Dividido","gpui.mgmt.plan.width":"Ancho","gpui.next.thread":"Hilo siguiente","gpui.no.goal.yet.ask.an":"Sin objetivo aún. Pide a un agente que escriba para qué es este proyecto, o edita .backplane/intent.md.","gpui.no.models":"Sin modelos","gpui.no.threads.yet":"Sin hilos aún.","gpui.nothing.matches":"Nada coincide","gpui.picker.favorite.add":"Añadir a favoritos","gpui.picker.favorite.remove":"Quitar de favoritos","gpui.picker.favorites":"Favoritos","gpui.planmode.bar.always":"Modo plan — explora y propone un plan antes de editar","gpui.planmode.bar.executing":"Ejecutando el plan aprobado","gpui.planmode.bar.once":"Modo plan (1 turno) — explora y propone un plan antes de editar","gpui.planmode.bar.pending":"El plan propuesto espera revisión abajo","gpui.planmode.bar.planning":"Planificando — redactando un plan antes de editar","gpui.planmode.chip.building":"Ejecutando","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Siempre","gpui.planmode.scope.once":"1 turno","gpui.planmode.tip":"Planificar antes de actuar (1 turno, siempre u off)","gpui.planmode.top.executing":"Ejecutando plan","gpui.planmode.top.once":"Plan (1 turno)","gpui.planmode.top.pending":"Revisar plan","gpui.planmode.top.planning":"Planificando","gpui.previous.thread":"Hilo anterior","gpui.projects.boards":"PLACAS ({n})","gpui.projects.mech":"MECÁNICO ({n})","gpui.projects.threads":"HILOS ({n})","gpui.projects.to.order":"POR PEDIR ({n})","gpui.rail.no.board":"Este proyecto no tiene placa","gpui.rail.no.mech":"Este proyecto no tiene piezas mecánicas","gpui.rail.no.schematic":"Este proyecto no tiene esquema","gpui.rail.split.needs.both":"La vista dividida requiere una placa y un esquema","gpui.search.models":"Buscar modelos","gpui.settings.group.agents":"Agentes y herramientas","gpui.settings.group.general":"General","home.away":"El inicio ({name}) no está disponible","home.away.queued":"El inicio ({name}) no está disponible · {n} en cola","home.away.since":"El inicio ({name}) no está disponible desde las {time}","home.away.since.queued":"El inicio ({name}) no está disponible desde las {time} · {n} en cola","home.machine":"Máquina de inicio","home.move.failed":"No se pudo mover el inicio","home.move.failed.note":"No se pudo mover el inicio: {note}","home.move.here":"Hacer de esta máquina el inicio","home.moving":"Moviendo el inicio a {to}…","home.moving.step":"Moviendo el inicio a {to}: {step}","hub.back.crash":"Backplane volvió tras detenerse de forma inesperada","hub.restarting":"Reiniciando Backplane…","hub.restarting.build":"Reiniciando Backplane… (nueva compilación {build})","hub.stopped":"Backplane se detuvo","ios.hub.address.field":"Dirección del hub","menu.pin":"Fijar","menu.settle":"Cerrar","menu.unpin":"Desfijar","menu.wake":"Despertar","model.col.agent":"Agente","model.col.effort":"Esfuerzo","native.pair.connect":"Conectar","native.thread.model":"Modelo","notify.settled":"Cerrado","palette.archive":"Archivar hilo","palette.command.placeholder":"Escribe un comando o un hilo","palette.diff":"Diff: qué cambió este hilo","palette.newthread":"Nuevo hilo","palette.settings":"Ajustes","palette.terminal":"Terminal","palette.unarchive":"Desarchivar hilo","phone.unsettle":"Reabrir","provider.notice.button":"Abrir Configuración → Cuentas","provider.notice.head":"No hay ningún proveedor de IA conectado","provider.notice.senderr":"Aún no hay ningún proveedor de IA conectado. Abre Configuración → Cuentas para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.senderr.remote":"No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.text.none":"Conecta Claude, Codex, Antigravity u otro proveedor para empezar a chatear.","provider.notice.text.signedout":"Inicia sesión en Claude, Codex u otro proveedor en Configuración → Cuentas para empezar a chatear.","reply.action":"Responder","reply.cancel":"Cancelar respuesta","reply.to":"En respuesta a:","ring.hear.again.local":"Escuchar de nuevo (local)","ring.hear.again.openai":"Escuchar de nuevo (OpenAI)","ring.no.recordings.yet":"Sin grabaciones aún.","ring.recordings":"Grabaciones","ring.ring":"Anillo","ring.search.what.you.said":"Buscar lo que dijiste","ring.show.all":"Mostrar todo","ring.what.happened":"Qué ocurrió","rooms.new":"Nueva sala","secret.you":"Tú","settings.appearance":"Apariencia","settings.lang":"Idioma","settings.lang.auto":"Automático","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Tema","settings.theme.dark":"Oscuro","settings.theme.light":"Claro","sheet.rename":"Renombrar hilo","sidebar.add.project":"Añadir proyecto","sidebar.search.projects":"Buscar proyectos","thread.context.base":"Backplane","thread.context.copied":"Se copiaron las instrucciones.","thread.context.copy":"Copiar instrucciones","thread.context.disable":"Desactivar","thread.context.enable":"Activar","thread.context.index":"Índice de habilidades disponibles","thread.context.injected.label":"Instrucciones del proyecto añadidas","thread.context.instructions":"Instrucciones","thread.context.mcp":"MCP del proyecto","thread.context.native.note":"Instrucciones de inicio de Backplane. El proveedor carga los archivos nativos.","thread.context.none.instructions":"No se encontraron instrucciones del proyecto.","thread.context.none.mcp":"No se encontraron configuraciones MCP del proyecto.","thread.context.reading":"Leyendo el contexto del hilo…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Habilidades","thread.context.system":"Instrucciones del sistema","thread.context.title":"Contexto e instrucciones","thread.context.trust":"Confiar y activar","thread.new":"Nuevo hilo","tools.pinned":"Fijado","tools.retry":"Reintentar","tour.title.bots":"Bots","viewer.board":"Placa","viewer.diff":"Diff","viewer.files":"Archivos","viewer.mech":"Mech","viewer.review":"Revisión","viewer.schematic":"Esquemático","viewer.solid":"3D","web.chat.answer.btn":"Responder","web.chat.answer.placeholder":"Escribe una respuesta…","web.chat.answered":"Respondido: {answer}","web.chat.choose":"Elige un hilo de proyecto a la izquierda para empezar.","web.chat.empty":"Aún no hay mensajes. Escribe abajo para iniciar un turno.","web.chat.finished":"Terminado {time}","web.chat.finished.dur":"Terminado {time} · {dur}","web.chat.loading":"Cargando mensajes…","web.chat.review.mode":"Modo de revisión","web.chat.streaming":"Transmitiendo…","web.clone.add.dir":"Añadir {dir}","web.clone.back":"Atrás","web.clone.change.folder":"Cambiar carpeta","web.clone.cloned":"{repo} clonado en {dest}","web.clone.cloning":"Clonando {repo} en {dest}","web.clone.copied":"Copiado","web.clone.first":"Primer mensaje: {text}","web.clone.folder.name":"Nombre de la carpeta","web.clone.go":"Clonar","web.clone.loading":"Cargando…","web.clone.no.folders":"No hay carpetas aquí","web.clone.open.project":"Abrir el proyecto","web.clone.open.thread":"Abrir el hilo","web.clone.private":"privado","web.clone.repo.placeholder":"URL https o ssh, o propietario/repositorio","web.clone.retry":"Reintentar","web.clone.same":"Ya está clonado ahí: se añade tal cual.","web.clone.signin":"Iniciar sesión en GitHub","web.clone.signin.done":"Sesión iniciada en GitHub","web.clone.signin.enter":"Introduce este código en GitHub:","web.clone.signin.wait":"Iniciando sesión en GitHub…","web.clone.start.thread":"Empezar un hilo","web.clone.stopped":"Se detuvo la clonación de {repo}","web.clone.tab":"Clonar desde git","web.clone.up":"Subir","web.clone.use.dir":"Usar {dir}","web.composer.attach":"Adjuntar imagen","web.composer.maximages":"Como máximo {max} imágenes por mensaje.","web.composer.unsupported":"Tipo de imagen no compatible: {type}","web.composer.voice":"Dictado por voz","web.home.error":"No se pudo cargar este proyecto.","web.home.fold":"Ocultar hilos","web.home.lead":"Plazo de entrega: {n} días","web.home.lead.one":"Plazo de entrega: 1 día","web.home.loading":"Cargando el proyecto…","web.home.open":"Abrir la página del proyecto","web.home.unfold":"Mostrar hilos","web.logout.failed":"No se pudo confirmar el cierre de sesión. Inténtalo de nuevo.","web.pair.approve.in":"Aprueba en el escritorio o en un teléfono vinculado · caduca en {time}","web.pair.approved":"Aprobado. Abriendo Backplane…","web.pair.cancelled":"Cancelado.","web.pair.code":"Código de comparación","web.pair.denied":"Se rechazó la solicitud de vinculación.","web.pair.expired":"El código de vinculación caducó. Solicita uno nuevo para intentarlo otra vez.","web.pair.failed":"Falló la solicitud de vinculación ({status})","web.pair.name":"Nombre del navegador","web.pair.nocode":"El hub no devolvió un código de comparación.","web.pair.ratelimited":"Demasiados intentos de vinculación. Espera un momento e inténtalo de nuevo.","web.pair.request":"Solicitar vinculación","web.pair.requesting":"Solicitando código de vinculación…","web.pair.subtitle":"Vincula este navegador con tu hub. Aprueba el código de 6 dígitos en Backplane › Ajustes › Dispositivos.","web.pair.unreachable":"No se pudo conectar con el hub. Comprueba tu conexión de tailnet.","web.plan.awaiting":"{n} esperando aprobación","web.plan.net.one":"1 red","web.plan.nets":"{n} redes","web.ring.app.words":"Las palabras de la aplicación Pebble","web.ring.count":"{n} grabaciones","web.ring.count.one":"1 grabación","web.ring.error":"No se pudieron cargar las grabaciones.","web.ring.found":"{found} de {total} contienen “{q}”.","web.ring.heard.by":"Transcrito por {model}","web.ring.heard.by.sure":"Transcrito por {model}, {conf}% de certeza","web.ring.loading":"Cargando grabaciones…","web.ring.no.words":"(sin palabras)","web.ring.not.heard":"Sin transcribir","web.ring.state.busy":"transcribiéndose ahora","web.ring.state.failed":"no entregada a Pebble","web.ring.state.heard":"en espera de entrega a Pebble","web.ring.state.new":"en espera de transcripción","web.ring.state.sent":"entregada a Pebble","web.ring.unavailable":"Este hub aún no muestra las notas del anillo en un navegador. Actualízalo o abre Configuración › Anillo en la aplicación de escritorio.","web.settings.providers":"Proveedores de IA","web.settings.providers.browser":"Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas."},ja:{"agy.signout":"サインアウト","android.hub.machines.approve":"承認","android.load.earlier":"以前のメッセージを読み込む","approval.dismiss":"閉じる","approval.implement":"実装","ask.plan":"提案されたプラン","bots.new":"新しいボット","bots.rooms":"ルーム","bots.tab.browser":"ブラウザ","chats.move":"プロジェクトに移動…","chats.move.none":"移動先のプロジェクトがありません。先にプロジェクトを追加してください。","chats.new.noproject":"新しいチャット(プロジェクトなし)","chats.title":"チャット","common.cancel":"キャンセル","common.close":"閉じる","common.copy":"コピー","common.delete":"削除","common.refresh":"更新","common.remove":"削除","common.save":"保存","common.search":"検索","composer.model.tip":"モデルと推論の強さを選択","composer.placeholder":"何でも質問:@bot、>thread、%project、#room、$skill、/btw","composer.send":"送信","composer.stop":"停止","gpui.acct.connected":"接続済み","gpui.acct.not.connected":"未接続","gpui.acct.sign.in.expired":"サインインの期限切れ","gpui.ask.plan.ready":"確認待ち","gpui.ask.plan.revise":"修正","gpui.ask.plan.reviseph":"計画のどこを変更しますか?","gpui.ask.plan.sendrev":"修正を送る","gpui.assembly":"アセンブリ","gpui.b.in.reply.to":"↩ 返信先:{quote}","gpui.b.replying.to":"↩ 返信中:{line}","gpui.bots.recall.off":"オフ","gpui.bots.recall.on":"オン","gpui.c.solid.big.next":"読み込みには時間と多くのメモリがかかることがあります。","gpui.c.solid.load.big":"それでも読み込む","gpui.c.solid.loading.big":"それでも読み込み中…","gpui.c.term.collapse":"折りたたむ","gpui.c.term.expand":"展開","gpui.commands":"コマンド","gpui.e.open.folder":"フォルダを開く","gpui.filter.projects.and.threads":"プロジェクトとスレッドを絞り込む","gpui.fold.or.unfold.the.sidebar":"サイドバーを折りたたむ/開く","gpui.follow.paused":"追従を一時停止中","gpui.follow.wait":"追従中: エージェントの次の編集を待っています","gpui.gerbers":"ガーバー","gpui.goal.notes":"目標とメモ","gpui.improvements":"改善","gpui.jump.to.a.thread.run":"スレッドへ移動、コマンドを実行、または発言を検索","gpui.mgmt.bom.dnp":"実装しない","gpui.mgmt.bom.nompn":"MPNなし","gpui.mgmt.checks.all":"すべて","gpui.mgmt.checks.fix":"エージェントに直してもらう","gpui.mgmt.checks.run":"実行","gpui.mgmt.close":"パネルを閉じる","gpui.mgmt.fab.apply":"適用","gpui.mgmt.fab.changed":"前回見てから変わったところ","gpui.mgmt.fab.derived":"* 製造元のページから計算した値です(milをmmに、径からランドを)。薄い色の項目はリジッド基板の値です(この基板のページに記載がないもの)。日付を押すと読んだページが開きます。","gpui.mgmt.fab.extra":"追加料金","gpui.mgmt.fab.findings":"指摘","gpui.mgmt.fab.free":"基本料金","gpui.mgmt.fab.judge":"データシート","gpui.mgmt.fab.limit":"項目","gpui.mgmt.fab.readcol":"読んだ日","gpui.mgmt.fab.refresh":"再読み込み","gpui.mgmt.fab.reviewbtn":"レビュー","gpui.mgmt.fab.seen":"確認済み","gpui.mgmt.fab.thefab":"製造元","gpui.mgmt.fab.use":"使う","gpui.mgmt.life.nopart":"この部品の記録はまだありません。","gpui.mgmt.life.reading":"履歴を読んでいます…","gpui.mgmt.plan.addnote":"メモを追加","gpui.mgmt.plan.all":"すべて承認","gpui.mgmt.plan.before":"配線前に計画する","gpui.mgmt.plan.compact":"標準","gpui.mgmt.plan.done":"完了","gpui.mgmt.plan.drawn":"計画の配線経路とプレーンは、このパネルを開いている間だけ基板上に表示されます。閉じると消えます。","gpui.mgmt.plan.edited":"編集済み","gpui.mgmt.plan.elsewhere":"{board}の配線計画が承認を待っています","gpui.mgmt.plan.emptysub":"計画が提案されると、レイヤー・コリドー・ベタ領域がここに表示されます。","gpui.mgmt.plan.expand":"拡大","gpui.mgmt.plan.fit":"全体表示","gpui.mgmt.plan.grid.all":"全レイヤー","gpui.mgmt.plan.grid.pair":"並べて表示","gpui.mgmt.plan.grid.single":"単一","gpui.mgmt.plan.hide":"完了を隠す","gpui.mgmt.plan.hint":"頂点をドラッグして誘導 · 辺の + をクリックで追加 · 頂点を右クリックで削除","gpui.mgmt.plan.keysnote":"このバージョンのKiCadでは、このパネルから承認してください。プランビューでのKiCadのA・R・Wキーはまだ計画のものではありません(Aはフットプリントの追加を開きます)。KiCadを更新してください。","gpui.mgmt.plan.layer":"層を承認","gpui.mgmt.plan.layer.short":"レイヤー","gpui.mgmt.plan.lock":"ロック","gpui.mgmt.plan.locked":"ロック中","gpui.mgmt.plan.noboard":"この基板の配線計画はありません。","gpui.mgmt.plan.noitems":"このレイヤーにコリドーまたはプレーンがありません","gpui.mgmt.plan.note.placeholder":"ルーターへの指示メモ…","gpui.mgmt.plan.nothing":"承認待ちはありません","gpui.mgmt.plan.offwords":"エージェントは指示どおりに配線します。オンにすると、まず配線計画を提案し、ここで承認したものだけを配線します。","gpui.mgmt.plan.onwords":"銅箔層が4層以上、またはネットが60本を超える基板では、配線の前にエージェントがここで配線経路とプレーン領域を提案します。承認したものだけを配線します。","gpui.mgmt.plan.reading":"配線計画を読んでいます…","gpui.mgmt.plan.reference":"基準 {layer}","gpui.mgmt.plan.refused":"KiCad が拒否しました","gpui.mgmt.plan.reject":"却下","gpui.mgmt.plan.rejectlayer":"レイヤーを却下","gpui.mgmt.plan.reqplain":"承認が求められています","gpui.mgmt.plan.requested":"承認が求められています: {what}","gpui.mgmt.plan.saved":"保存された計画","gpui.mgmt.plan.show":"完了を表示","gpui.mgmt.plan.st.approved":"承認済み","gpui.mgmt.plan.st.awaiting":"承認待ち","gpui.mgmt.plan.st.blocked":"ブロック","gpui.mgmt.plan.st.empty":"空","gpui.mgmt.plan.st.partial":"一部完了","gpui.mgmt.plan.st.rejected":"却下","gpui.mgmt.plan.st.routed":"配線済み","gpui.mgmt.plan.st.routing":"配線中","gpui.mgmt.plan.st.verified":"検証済み","gpui.mgmt.plan.stackup.short":"スタックアップ","gpui.mgmt.plan.stop":"配線を止める","gpui.mgmt.plan.sync":"ズーム連動","gpui.mgmt.plan.tab":"計画","gpui.mgmt.plan.unlock":"ロック解除","gpui.mgmt.plan.verify":"検証","gpui.mgmt.plan.view.canvas":"キャンバス","gpui.mgmt.plan.view.list":"リスト","gpui.mgmt.plan.view.split":"分割","gpui.mgmt.plan.width":"幅","gpui.next.thread":"次のスレッド","gpui.no.goal.yet.ask.an":"目標はまだありません。このプロジェクトの目的をエージェントに書いてもらうか、.backplane/intent.md を編集してください。","gpui.no.models":"モデルがありません","gpui.no.threads.yet":"スレッドはまだありません。","gpui.nothing.matches":"一致するものはありません","gpui.picker.favorite.add":"お気に入りに追加","gpui.picker.favorite.remove":"お気に入りから外す","gpui.picker.favorites":"お気に入り","gpui.planmode.bar.always":"計画モード — 編集前に調査して計画を提案します","gpui.planmode.bar.executing":"承認された計画を実行しています","gpui.planmode.bar.once":"計画モード (1回) — 編集前に調査して計画を提案します","gpui.planmode.bar.pending":"提案された計画が下のレビューを待っています","gpui.planmode.bar.planning":"計画中 — 編集前の計画を作成しています","gpui.planmode.chip.building":"実行中","gpui.planmode.chip.once":"計画 · 1回","gpui.planmode.scope.always":"常時","gpui.planmode.scope.once":"1回","gpui.planmode.tip":"実行前に計画を作成 (1回・常時・オフ)","gpui.planmode.top.executing":"計画を実行中","gpui.planmode.top.once":"計画 (1回)","gpui.planmode.top.pending":"計画を確認","gpui.planmode.top.planning":"計画中","gpui.previous.thread":"前のスレッド","gpui.projects.boards":"基板({n})","gpui.projects.mech":"機構部品({n})","gpui.projects.threads":"スレッド({n})","gpui.projects.to.order":"注文するもの({n})","gpui.rail.no.board":"このプロジェクトには基板がありません","gpui.rail.no.mech":"このプロジェクトには機械部品がありません","gpui.rail.no.schematic":"このプロジェクトには回路図がありません","gpui.rail.split.needs.both":"分割表示には基板と回路図が必要です","gpui.search.models":"モデルを検索","gpui.settings.group.agents":"エージェントとツール","gpui.settings.group.general":"一般","home.away":"ホーム({name})はオフラインです","home.away.queued":"ホーム({name})はオフラインです · {n} 件待機中","home.away.since":"ホーム({name})は {time} からオフラインです","home.away.since.queued":"ホーム({name})は {time} からオフラインです · {n} 件待機中","home.machine":"ホームマシン","home.move.failed":"ホームの移動に失敗しました","home.move.failed.note":"ホームの移動に失敗しました: {note}","home.move.here":"このマシンをホームにする","home.moving":"ホームを {to} へ移動中…","home.moving.step":"ホームを {to} へ移動中: {step}","hub.back.crash":"予期せず停止したBackplaneが戻りました","hub.restarting":"Backplaneを再起動しています…","hub.restarting.build":"Backplaneを再起動しています…(新しいビルド {build})","hub.stopped":"Backplaneは停止しました","ios.hub.address.field":"ハブのアドレス","menu.pin":"ピン留め","menu.settle":"完了","menu.unpin":"ピン留めを解除","menu.wake":"再開","model.col.agent":"エージェント","model.col.effort":"推論の強さ","native.pair.connect":"接続","native.thread.model":"モデル","notify.settled":"完了","palette.archive":"スレッドをアーカイブ","palette.command.placeholder":"コマンドまたはスレッドを入力","palette.diff":"差分:このスレッドの変更","palette.newthread":"新しいスレッド","palette.settings":"設定","palette.terminal":"ターミナル","palette.unarchive":"スレッドのアーカイブを解除","phone.unsettle":"未完了に戻す","provider.notice.button":"設定 → アカウントを開く","provider.notice.head":"AI プロバイダーが接続されていません","provider.notice.senderr":"AI プロバイダーがまだ接続されていません。設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.senderr.remote":"{machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.none":"チャットを始めるには、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.signedout":"チャットを始めるには、設定 → アカウントで Claude、Codex などのプロバイダーにサインインしてください。","reply.action":"返信","reply.cancel":"返信をやめる","reply.to":"返信先:","ring.hear.again.local":"もう一度聞き取る (ローカル)","ring.hear.again.openai":"もう一度聞き取る (OpenAI)","ring.no.recordings.yet":"録音はまだありません。","ring.recordings":"録音","ring.ring":"リング","ring.search.what.you.said":"話した内容を検索","ring.show.all":"すべて表示","ring.what.happened":"どうなったか","rooms.new":"新しいルーム","secret.you":"あなた","settings.appearance":"外観","settings.lang":"言語","settings.lang.auto":"自動","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"テーマ","settings.theme.dark":"ダーク","settings.theme.light":"ライト","sheet.rename":"スレッド名を変更","sidebar.add.project":"プロジェクトを追加","sidebar.search.projects":"プロジェクトを検索","thread.context.base":"Backplane","thread.context.copied":"プロンプトをコピーしました。","thread.context.copy":"プロンプトをコピー","thread.context.disable":"無効にする","thread.context.enable":"有効にする","thread.context.index":"利用可能なスキルの一覧","thread.context.injected.label":"追加されたプロジェクトの指示","thread.context.instructions":"指示","thread.context.mcp":"プロジェクトの MCP","thread.context.native.note":"Backplane が起動時に渡すプロンプトです。ネイティブファイルはプロバイダーが読み込みます。","thread.context.none.instructions":"プロジェクトの指示が見つかりません。","thread.context.none.mcp":"プロジェクトの MCP 設定が見つかりません。","thread.context.reading":"スレッドのコンテキストを読み込み中…","thread.context.size":"{bytes} B・約{tokens}トークン","thread.context.skills":"スキル","thread.context.system":"システムプロンプト","thread.context.title":"コンテキストとプロンプト","thread.context.trust":"承認して有効にする","thread.new":"新しいスレッド","tools.pinned":"固定中","tools.retry":"再試行","tour.title.bots":"ボット","viewer.board":"基板","viewer.diff":"差分","viewer.files":"ファイル","viewer.mech":"Mech","viewer.review":"レビュー","viewer.schematic":"回路図","viewer.solid":"3D","web.chat.answer.btn":"回答","web.chat.answer.placeholder":"回答を入力…","web.chat.answered":"回答済み: {answer}","web.chat.choose":"左側からプロジェクトのスレッドを選んで開始してください。","web.chat.empty":"まだメッセージはありません。下に入力して開始してください。","web.chat.finished":"完了 {time}","web.chat.finished.dur":"完了 {time} · {dur}","web.chat.loading":"メッセージを読み込んでいます…","web.chat.review.mode":"レビューモード","web.chat.streaming":"受信中…","web.clone.add.dir":"{dir} を追加","web.clone.back":"戻る","web.clone.change.folder":"フォルダを変更","web.clone.cloned":"{repo} を {dest} にクローンしました","web.clone.cloning":"{repo} を {dest} にクローン中","web.clone.copied":"コピーしました","web.clone.first":"最初のメッセージ: {text}","web.clone.folder.name":"フォルダ名","web.clone.go":"クローン","web.clone.loading":"読み込み中…","web.clone.no.folders":"フォルダがありません","web.clone.open.project":"プロジェクトを開く","web.clone.open.thread":"スレッドを開く","web.clone.private":"非公開","web.clone.repo.placeholder":"https / ssh の URL、または owner/repo","web.clone.retry":"もう一度","web.clone.same":"すでにそこにクローンされています: そのまま追加します。","web.clone.signin":"GitHub にサインイン","web.clone.signin.done":"GitHub にサインインしました","web.clone.signin.enter":"このコードを GitHub に入力してください:","web.clone.signin.wait":"GitHub のサインインを開始しています…","web.clone.start.thread":"スレッドを開始","web.clone.stopped":"{repo} のクローンを中止しました","web.clone.tab":"git からクローン","web.clone.up":"上へ","web.clone.use.dir":"{dir} を使う","web.composer.attach":"画像を添付","web.composer.maximages":"1 件のメッセージに添付できる画像は最大 {max} 枚です。","web.composer.unsupported":"未対応の画像形式です: {type}","web.composer.voice":"音声入力","web.home.error":"このプロジェクトを読み込めませんでした。","web.home.fold":"スレッドを隠す","web.home.lead":"リードタイム: {n} 日","web.home.lead.one":"リードタイム: 1 日","web.home.loading":"プロジェクトを読み込み中…","web.home.open":"プロジェクトホームを開く","web.home.unfold":"スレッドを表示","web.logout.failed":"サインアウトを確認できませんでした。もう一度お試しください。","web.pair.approve.in":"デスクトップまたはペアリング済みの端末で承認してください · 有効期限 {time}","web.pair.approved":"承認されました。Backplane を開いています…","web.pair.cancelled":"キャンセルしました。","web.pair.code":"確認コード","web.pair.denied":"ペアリングのリクエストが拒否されました。","web.pair.expired":"ペアリングコードの有効期限が切れました。新しいコードをリクエストしてください。","web.pair.failed":"ペアリングのリクエストに失敗しました ({status})","web.pair.name":"ブラウザー名","web.pair.nocode":"ハブから確認コードが返されませんでした。","web.pair.ratelimited":"ペアリングの試行回数が多すぎます。しばらく待ってからやり直してください。","web.pair.request":"ペアリングをリクエスト","web.pair.requesting":"ペアリングコードをリクエストしています…","web.pair.subtitle":"このブラウザーをハブとペアリングします。Backplane › 設定 › デバイス で 6 桁のコードを承認してください。","web.pair.unreachable":"ハブに接続できませんでした。tailnet の接続を確認してください。","web.plan.awaiting":"{n} 件が承認待ち","web.plan.net.one":"1 ネット","web.plan.nets":"{n} ネット","web.ring.app.words":"Pebble アプリの文字起こし","web.ring.count":"録音 {n} 件","web.ring.count.one":"録音 1 件","web.ring.error":"録音を読み込めませんでした。","web.ring.found":"{total} 件中 {found} 件に「{q}」があります。","web.ring.heard.by":"{model} が認識","web.ring.heard.by.sure":"{model} が認識、確度 {conf}%","web.ring.loading":"録音を読み込み中…","web.ring.no.words":"(言葉なし)","web.ring.not.heard":"未認識","web.ring.state.busy":"認識中","web.ring.state.failed":"Pebble に渡せませんでした","web.ring.state.heard":"Pebble への受け渡し待ち","web.ring.state.new":"認識待ち","web.ring.state.sent":"Pebble に渡しました","web.ring.unavailable":"このハブはまだブラウザーにリングのメモを表示しません。ハブを更新するか、デスクトップアプリの設定 › リングを開いてください。","web.settings.providers":"AI プロバイダー","web.settings.providers.browser":"Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。"}};function Ai(e,t){if(!t)return e;return e.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(n,i)=>Object.prototype.hasOwnProperty.call(t,i)?String(t[i]):n)}var Ct=Br(),Cn=new Set,kn=new Map;for(let[e,t]of Object.entries(Ft.en||{}))if(typeof t==="string"&&!kn.has(t))kn.set(t,e);function Br(){let e=typeof navigator<"u"&&navigator.language?navigator.language.toLowerCase():"en";if(e.startsWith("ja"))return"ja";if(e.startsWith("es"))return"es";return"en"}function Ni(){if(typeof document<"u"&&document.documentElement)document.documentElement.lang=Ct}Ni();function rn(e){return Cn.add(e),()=>{Cn.delete(e)}}function kt(e){if(!e)return!1;let t=e.toLowerCase(),n=t.startsWith("ja")?"ja":t.startsWith("es")?"es":t.startsWith("en")?"en":"";if(!n)return!1;let i=n!==Ct;if(Ct=n,Ni(),i)for(let s of Cn)s(Ct);return i}function Mi(){return Ct}function u(e,t,n){let s=(Ft[Ct]||Ft.en||{})[e]??Ft.en?.[e]??t??e;return Ai(s,n)}function he(e){if(!e)return"";let t=kn.get(e);if(!t)return e;return u(t,e)}function X(e,t="",n=""){let i=document.createElement(e);if(t)i.className=t;if(n)i.textContent=n;return i}function _e(e,t="",n){let i=X("button",t,e);if(i.type="button",n)i.addEventListener("click",n);return i}function Ir(e){let t=e.replace(/[\\/]+$/,"");if(!t)return e||"/";let n=t.split(/[\\/]/);return n[n.length-1]||t}function Rr(e,t){let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return e.endsWith(n)?e+t:e+n+t}class xn{hub;actionLabel;action;root;pathInput;upBtn;listEl;errEl;actBtn;path="";parent=null;gen=0;busy=!1;constructor(e,t,n,i=[]){this.hub=e;this.actionLabel=t;this.action=n;this.root=X("div","bp-fb"),this.root.setAttribute("data-testid","folder-browser");let s=X("div","bp-fb-head");this.upBtn=_e("↑","bp-btn-ghost bp-fb-up",()=>{if(this.parent)this.go(this.parent)}),this.upBtn.title=u("web.clone.up","Up"),this.upBtn.setAttribute("aria-label",u("web.clone.up","Up")),this.pathInput=X("input","bp-input bp-fb-path"),this.pathInput.spellcheck=!1,this.pathInput.setAttribute("data-testid","folder-path"),this.pathInput.addEventListener("keydown",(o)=>{if(o.key==="Enter"){o.preventDefault();let a=this.pathInput.value.trim();if(a)this.go(a)}}),s.append(this.upBtn,this.pathInput),this.listEl=X("div","bp-fb-list"),this.errEl=X("div","bp-ap-err bp-hidden");let r=X("div","bp-ap-foot");this.actBtn=_e("","primary",()=>{this.run()}),this.actBtn.setAttribute("data-testid","folder-act"),r.append(...i,this.actBtn),this.root.append(s,this.listEl,this.errEl,r)}currentPath(){return this.path}async go(e){let t=++this.gen;this.setError(""),this.listEl.replaceChildren(X("div","bp-fb-empty",u("web.clone.loading","Loading…")));try{let n=await this.hub.rpc("dirs.list",{path:e});if(t!==this.gen)return;this.path=n.path,this.parent=n.parent??null,this.render(n.dirs??[])}catch(n){if(t!==this.gen)return;this.setError(he(n instanceof Error?n.message:String(n))),this.render(null)}}refreshLocale(){this.upBtn.title=u("web.clone.up","Up"),this.updateAct()}render(e){if(this.pathInput.value=this.path,this.upBtn.disabled=!this.parent,this.updateAct(),e===null){this.listEl.replaceChildren();return}if(e.length===0){this.listEl.replaceChildren(X("div","bp-fb-empty",u("web.clone.no.folders","No folders here")));return}let t=document.createDocumentFragment();for(let n of e){let i=_e("","bp-fb-row",()=>{this.go(Rr(this.path,n))});i.append(X("span","bp-fb-icon","▸"),X("span","bp-fb-name",n)),t.appendChild(i)}this.listEl.replaceChildren(t),this.listEl.scrollTop=0}updateAct(){this.actBtn.textContent=this.path?this.actionLabel(Ir(this.path)):this.actionLabel("…"),this.actBtn.disabled=!this.path||this.busy}async run(){if(!this.path||this.busy)return;this.busy=!0,this.updateAct(),this.setError("");try{await this.action(this.path)}catch(e){this.setError(he(e instanceof Error?e.message:String(e)))}finally{this.busy=!1,this.updateAct()}}setError(e){this.errEl.textContent=e,this.errEl.classList.toggle("bp-hidden",!e)}}class Pn{container;host;backdrop=null;bodyEl=null;tabsEl=null;mode="folder";repoText="";repoValue="";firstText="";wantThread=!0;userParent="";nameText="";nameTouched=!1;dest=null;destGen=0;destPending=!1;destTimer=null;repos=null;reposGen=0;reposTimer=null;showSuggest=!1;suggestIdx=-1;startErr="";starting=!1;picking=!1;jobId="";job=null;specs=new Map;signin=null;copied=!1;repoInput=null;suggestEl=null;destEl=null;signinEl=null;cloneBtn=null;jobEl=null;constructor(e,t){this.container=e;this.host=t}isOpen(){return this.backdrop!==null}open(e={}){let t=this.host.hub.hasFeature("clone"),n=!e.repo&&Boolean(this.jobId)&&(!this.job||this.job.state==="running"||this.job.state==="done");if(!this.backdrop)this.build();if(!n)this.jobId="",this.job=null,this.resetForm();if(e.repo!==void 0||e.text!==void 0)this.repoText=(e.repo??"").trim(),this.repoValue="",this.firstText=(e.text??"").trim();if(this.mode=t&&(e.mode==="clone"||n)?"clone":"folder",this.render(),n){if(this.job)this.maybeGo(this.job);this.reconcile()}else if(this.mode==="clone"&&this.repoText)this.askDest()}reconcile(){let e=this.jobId;if(!e)return;this.host.hub.rpc("clone.status",{id:e}).then((t)=>this.apply(t)).catch(()=>{})}close(){if(this.reposTimer!==null)window.clearTimeout(this.reposTimer);if(this.destTimer!==null)window.clearTimeout(this.destTimer);this.reposTimer=null,this.destTimer=null,this.backdrop?.remove(),this.backdrop=null,this.bodyEl=null,this.tabsEl=null}escape(){if(this.picking){this.picking=!1,this.render();return}if(this.showSuggest){this.showSuggest=!1,this.renderSuggest();return}this.close()}refreshLocale(){if(this.backdrop)this.render()}handleFrame(e){if(e.k==="clone"){let t=e.clone;if(t)this.apply(t)}else if(e.k==="clone.repos"){if(this.isOpen()&&this.mode==="clone"&&!this.jobId)this.askRepos(0)}else if(e.k==="clone.signin"){if(!this.signin)return;let t=this.signin.state;if(this.signin=e.signin??null,this.signin?.state==="cancelled")this.signin=null;if(t!=="done"&&this.signin?.state==="done")this.askRepos(0);this.renderSignin()}}build(){let e=X("div","bp-modal-backdrop");e.setAttribute("data-testid","add-project");let t=X("div","bp-modal bp-ap"),n=X("div","bp-modal-head"),i=X("h2","",u("sidebar.add.project","Add project")),s=_e("×","icon",()=>this.close());s.title=u("common.close","Close"),s.setAttribute("aria-label",u("common.close","Close")),n.append(i,s),this.tabsEl=X("div","bp-ap-tabs"),this.bodyEl=X("div","bp-modal-body bp-ap-body"),t.append(n,this.tabsEl,this.bodyEl),e.appendChild(t),e.addEventListener("mousedown",(r)=>{if(r.target===e)this.close()}),this.container.appendChild(e),this.backdrop=e}resetForm(){this.repoText="",this.repoValue="",this.firstText="",this.wantThread=!0,this.userParent="",this.nameText="",this.nameTouched=!1,this.dest=null,this.destPending=!1,this.repos=null,this.showSuggest=!1,this.suggestIdx=-1,this.startErr="",this.starting=!1,this.picking=!1,this.signin=null,this.copied=!1}render(){if(!this.bodyEl||!this.tabsEl||!this.backdrop)return;let e=this.backdrop.querySelector(".bp-modal-head h2");if(e)e.textContent=u("sidebar.add.project","Add project");if(this.renderTabs(),this.repoInput=null,this.suggestEl=null,this.destEl=null,this.signinEl=null,this.cloneBtn=null,this.jobEl=null,this.mode==="folder")this.renderFolder();else if(this.jobId&&this.job)this.renderJobView();else if(this.picking)this.renderPickParent();else this.renderCloneForm()}renderTabs(){if(!this.tabsEl)return;if(!this.host.hub.hasFeature("clone")){this.tabsEl.classList.add("bp-hidden");return}this.tabsEl.classList.remove("bp-hidden");let e=(t,n)=>{let i=_e(n,"bp-ap-tab"+(this.mode===t?" on":""),()=>{if(this.mode===t)return;if(this.mode=t,this.render(),t==="clone"&&!this.jobId&&this.repos===null)this.askRepos(0)});return i.setAttribute("data-testid",`ap-tab-${t}`),i.setAttribute("aria-pressed",String(this.mode===t)),i};this.tabsEl.replaceChildren(e("folder",u("gpui.e.open.folder","Open folder")),e("clone",u("web.clone.tab","Clone from git")))}renderFolder(){let e=new xn(this.host.hub,(t)=>u("web.clone.add.dir","Add {dir}",{dir:t}),async(t)=>{let n=await this.host.hub.rpc("project.add",{path:t},30000);if(this.close(),n.project)this.host.onProjectAdded(n.project)});this.bodyEl.replaceChildren(e.root),e.go("")}renderCloneForm(){let e=this.bodyEl,t=X("div","bp-ap-form"),n=X("div","bp-ap-repo"),i=X("input","bp-input");i.type="text",i.spellcheck=!1,i.autocomplete="off",i.placeholder=u("web.clone.repo.placeholder","https or ssh URL, or owner/repo"),i.setAttribute("aria-label",u("web.clone.repo.placeholder","https or ssh URL, or owner/repo")),i.setAttribute("data-testid","clone-repo"),i.value=this.repoText,i.addEventListener("input",()=>{if(this.repoText=i.value,this.repoValue="",this.showSuggest=!0,this.suggestIdx=-1,this.startErr="",!this.nameTouched)this.nameText="";this.askRepos(200),this.askDest(250)}),i.addEventListener("focus",()=>{if(this.showSuggest=!0,this.repos===null)this.askRepos(0);else this.renderSuggest()}),i.addEventListener("blur",()=>{window.setTimeout(()=>{if(document.activeElement!==i)this.showSuggest=!1,this.renderSuggest()},120)}),i.addEventListener("keydown",(p)=>this.repoKey(p)),this.repoInput=i,this.suggestEl=X("div","bp-ap-suggest bp-hidden"),this.suggestEl.setAttribute("data-testid","clone-suggest"),n.append(i,this.suggestEl),this.signinEl=X("div","bp-ap-signin bp-hidden"),this.signinEl.setAttribute("data-testid","clone-signin"),this.destEl=X("div","bp-ap-dest"),this.destEl.setAttribute("data-testid","clone-dest");let s=X("label","bp-ap-check"),r=X("input");r.type="checkbox",r.checked=this.wantThread,r.setAttribute("data-testid","clone-thread"),r.addEventListener("change",()=>{this.wantThread=r.checked}),s.append(r,X("span","",u("web.clone.start.thread","Start a thread")));let o=[n,this.signinEl,this.destEl,s];if(this.firstText)o.push(X("div","bp-ap-first bp-dim",u("web.clone.first","First message: {text}",{text:this.firstText})));let a=X("div","bp-ap-err"+(this.startErr?"":" bp-hidden"),this.startErr);a.setAttribute("data-testid","clone-start-error");let c=X("div","bp-ap-foot");this.cloneBtn=_e(u("web.clone.go","Clone"),"primary",()=>{this.startClone()}),this.cloneBtn.setAttribute("data-testid","clone-go"),c.append(this.cloneBtn),o.push(a,c),t.append(...o),e.replaceChildren(t),this.renderSuggest(),this.renderSignin(),this.renderDest(),window.setTimeout(()=>{if(this.repoInput===i&&!this.repoText)i.focus()},0)}repoKey(e){let t=this.repos?.repos??[],n=this.showSuggest&&t.length>0;if(e.key==="ArrowDown"&&n)e.preventDefault(),this.suggestIdx=Math.min(t.length-1,this.suggestIdx+1),this.renderSuggest();else if(e.key==="ArrowUp"&&n)e.preventDefault(),this.suggestIdx=Math.max(-1,this.suggestIdx-1),this.renderSuggest();else if(e.key==="Enter"){e.preventDefault();let i=n&&this.suggestIdx>=0?t[this.suggestIdx]:void 0;if(i)this.pickRepo(i);else if(this.canStart())this.startClone()}}pickRepo(e){if(this.repoText=e.name,this.repoValue=e.value,this.showSuggest=!1,this.suggestIdx=-1,this.startErr="",!this.nameTouched)this.nameText="";if(this.repoInput)this.repoInput.value=e.name;this.renderSuggest(),this.askDest()}repoArg(){return this.repoValue||this.repoText.trim()}askRepos(e){if(this.reposTimer!==null)window.clearTimeout(this.reposTimer);this.reposTimer=window.setTimeout(()=>{this.reposTimer=null;let t=++this.reposGen,n=this.repoValue?"":this.repoText.trim();this.host.hub.rpc("clone.repos",{q:n,limit:12},30000).then((i)=>{if(t!==this.reposGen)return;this.repos=i,this.renderSuggest(),this.renderSignin()}).catch(()=>{if(t!==this.reposGen)return;this.repos={repos:[],state:"error",hint:"Couldn't list your GitHub repositories."},this.renderSuggest()})},e)}renderSuggest(){let e=this.suggestEl;if(!e)return;let t=this.repos,n=t?.repos??[],i=[];if(this.showSuggest&&!this.repoValue){if(n.forEach((s,r)=>{let o=_e("","bp-ap-sug"+(r===this.suggestIdx?" active":""));o.setAttribute("data-testid","clone-suggestion"),o.addEventListener("mousedown",(c)=>c.preventDefault()),o.addEventListener("click",()=>this.pickRepo(s));let a=X("div","bp-ap-sug-top");if(a.append(X("span","bp-ap-sug-name",s.name)),s.private)a.append(X("span","bp-ap-tag",u("web.clone.private","private")));if(o.append(a),s.description)o.append(X("div","bp-ap-sug-desc",s.description));i.push(o)}),n.length===0&&t){if(t.loading)i.push(X("div","bp-ap-sug-note",u("web.clone.loading","Loading…")));else if(t.hint){let s=X("div","bp-ap-sug-note");if(s.append(X("span","",he(t.hint))),t.state==="signedout"){let r=_e(u("web.clone.signin","Sign in to GitHub"),"bp-btn-line",()=>{this.startSignin()});r.addEventListener("mousedown",(o)=>o.preventDefault()),r.setAttribute("data-testid","clone-signin-btn"),s.append(r)}i.push(s)}}}e.replaceChildren(...i),e.classList.toggle("bp-hidden",i.length===0)}askDest(e=0){if(this.destTimer!==null)window.clearTimeout(this.destTimer);this.destPending=!0,this.updateCloneBtn(),this.destTimer=window.setTimeout(()=>{this.destTimer=null;let t=++this.destGen,n=this.repoArg();if(!n){this.dest=null,this.destPending=!1,this.renderDest();return}let i={repo:n};if(this.userParent)i.parent=this.userParent;if(this.nameTouched&&this.nameText.trim())i.name=this.nameText.trim();else if(this.userParent)i.name="";this.host.hub.rpc("clone.dest",i).then((s)=>{if(t!==this.destGen)return;if(this.dest=s,this.destPending=!1,!this.nameTouched&&s.folder)this.nameText=s.folder;this.renderDest()}).catch((s)=>{if(t!==this.destGen)return;this.dest={ok:!1,error:s instanceof Error?s.message:String(s)},this.destPending=!1,this.renderDest()})},e)}renderDest(){let e=this.destEl;if(!e)return;let t=this.dest,n=[];if(t&&!t.repo){if(t.error&&this.repoText.trim())n.push(this.errLine(he(t.error)))}else if(t){let o=X("div","bp-ap-where"),a=X("span","bp-ap-dest-path",t.destShown||t.dest||t.defaultParentShown||"");a.setAttribute("data-testid","clone-dest-shown");let c=_e(u("web.clone.change.folder","Change folder"),"bp-btn-line",()=>{this.picking=!0,this.render()});c.setAttribute("data-testid","clone-change-folder"),o.append(a,c),n.push(o);let p=X("label","bp-ap-name");p.append(X("span","bp-ap-lbl",u("web.clone.folder.name","Folder name")));let l=X("input","bp-input");if(l.type="text",l.spellcheck=!1,l.value=this.nameText,l.setAttribute("data-testid","clone-name"),l.addEventListener("input",()=>{this.nameText=l.value,this.nameTouched=l.value.trim()!=="",this.startErr="",this.askDest(250)}),l.addEventListener("keydown",(h)=>{if(h.key==="Enter"&&this.canStart())h.preventDefault(),this.startClone()}),p.append(l),n.push(p),!t.ok&&t.error)n.push(this.errLine(he(t.error)));else if(t.same)n.push(X("div","bp-ap-note bp-dim",u("web.clone.same","Already cloned there: it is added as it is.")))}let i=document.activeElement,s=i&&e.contains(i)&&i.getAttribute("data-testid")==="clone-name",r=s?i.selectionStart:null;if(e.replaceChildren(...n),e.classList.toggle("bp-hidden",n.length===0),s){let o=e.querySelector('[data-testid="clone-name"]');if(o){if(o.focus(),r!==null)o.setSelectionRange(r,r)}}this.updateCloneBtn()}errLine(e){let t=X("div","bp-ap-err",e);return t.setAttribute("data-testid","clone-dest-error"),t}canStart(){return Boolean(this.dest?.ok&&this.dest.repo&&!this.destPending&&!this.starting&&this.repoArg())}updateCloneBtn(){if(this.cloneBtn)this.cloneBtn.disabled=!this.canStart()}renderPickParent(){let e=this.dest?.parent||this.userParent||this.dest?.defaultParent||"",t=_e(u("web.clone.back","Back"),"bp-btn-line",()=>{this.picking=!1,this.render()}),n=new xn(this.host.hub,(i)=>u("web.clone.use.dir","Use {dir}",{dir:i}),async(i)=>{this.userParent=i,this.picking=!1,this.render(),this.askDest()},[t]);this.bodyEl.replaceChildren(n.root),n.go(e)}async startClone(){if(!this.canStart()||!this.dest)return;this.starting=!0,this.startErr="",this.updateCloneBtn();let e={repo:this.repoArg(),thread:this.wantThread,text:this.firstText},t=En();this.jobId=t,this.job=null,this.specs.set(t,e);try{let n=await this.host.hub.rpc("clone.start",{id:t,repo:e.repo,parent:this.dest.parent??"",name:this.dest.folder??this.nameText.trim(),thread:e.thread,text:e.text});this.starting=!1,this.apply(n)}catch(n){this.starting=!1;let i=he(n instanceof Error?n.message:String(n));if(this.jobId===t&&!this.job){let s=await this.host.hub.rpc("clone.status",{id:t}).catch(()=>null);if(s&&s.id===t){this.apply(s);return}}if(this.jobId===t&&!this.job){if(this.jobId="",this.startErr=i,this.mode==="clone")this.render()}}}async retry(e,t){let n=this.specs.get(e.id)??{repo:e.origin||e.repo||"",thread:!0,text:""},i=En(),s=this.jobId;this.jobId=i,this.specs.set(i,n),t.disabled=!0;try{let r=await this.host.hub.rpc("clone.start",{id:i,repo:n.repo,dest:e.dest??"",thread:n.thread,text:n.text});this.apply(r)}catch(r){let o=he(r instanceof Error?r.message:String(r));if(this.jobId!==i)return;if(!this.job||this.job.id!==i){let a=await this.host.hub.rpc("clone.status",{id:i}).catch(()=>null);if(a&&a.id===i){this.apply(a);return}}if(this.jobId===i&&(!this.job||this.job.id!==i))this.jobId=s,t.disabled=!1,this.showJobError(o)}}apply(e){if(!e||e.id!==this.jobId)return;if(!Si(this.job,e))return;if(this.job=e,this.copied=!1,this.isOpen()&&this.mode==="clone")if(this.jobEl&&this.jobEl.isConnected)this.renderJob();else this.render();this.maybeGo(e)}maybeGo(e){if(this.isOpen()&&e.id===this.jobId&&Li(e))this.goTo(e)}renderJobView(){this.jobEl=X("div","bp-ap-job"),this.jobEl.setAttribute("data-testid","clone-job"),this.signinEl=X("div","bp-ap-signin bp-hidden"),this.signinEl.setAttribute("data-testid","clone-signin"),this.bodyEl.replaceChildren(this.jobEl,this.signinEl),this.renderJob(),this.renderSignin()}renderJob(){let e=this.jobEl,t=this.job;if(!e||!t)return;let n=t.destShown||t.dest||"",i=t.repo||"",s=t.state==="done"?u("web.clone.cloned","Cloned {repo} into {dest}",{repo:i,dest:n}):t.state==="cancelled"?u("web.clone.stopped","Stopped cloning {repo}",{repo:i}):u("web.clone.cloning","Cloning {repo} into {dest}",{repo:i,dest:n}),r=[X("div","bp-ap-job-title",s)];if(t.state==="running"){let o=X("div","bp-ap-phase",he(t.phase||""));o.setAttribute("data-testid","clone-phase");let a=X("div","bp-ap-bar"+(typeof t.pct==="number"?"":" indeterminate")),c=X("div","bp-ap-bar-fill");if(typeof t.pct==="number")c.style.width=`${Math.max(0,Math.min(100,t.pct))}%`;if(a.appendChild(c),a.setAttribute("role","progressbar"),typeof t.pct==="number")a.setAttribute("aria-valuenow",String(t.pct));if(r.push(o,a),t.detail)r.push(X("div","bp-ap-detail bp-dim",t.detail));let p=X("div","bp-ap-foot"),l=_e(u("common.cancel","Cancel"),"bp-btn-line",()=>{this.host.hub.rpc("clone.cancel",{id:t.id}).then((h)=>this.apply(h)).catch(()=>{})});l.setAttribute("data-testid","clone-cancel"),p.append(l),r.push(p)}else if(t.state==="failed"||t.state==="cancelled"){if(t.state==="failed"&&t.error){let p=X("div","bp-ap-err",he(t.error));p.setAttribute("data-testid","clone-error"),r.push(p)}let o=X("div","bp-ap-foot"),a=_e(u("web.clone.back","Back"),"bp-btn-line",()=>{this.jobId="",this.job=null,this.signin=null,this.render(),this.askDest()});if(o.append(a),t.signin){let p=_e(u("web.clone.signin","Sign in to GitHub"),"bp-btn-line",()=>{this.startSignin()});p.setAttribute("data-testid","clone-signin-btn"),o.append(p)}let c=_e(u("web.clone.retry","Try again"),"primary",()=>{this.retry(t,c)});c.setAttribute("data-testid","clone-retry"),o.append(c),r.push(o)}else if(t.state==="done"){let o=t.notes??[];if(o.length>0){let l=X("ul","bp-ap-notes");l.setAttribute("data-testid","clone-notes");for(let h of o)l.appendChild(X("li","",he(h)));r.push(l)}let a=X("div","bp-ap-foot"),c=t.thread?u("web.clone.open.thread","Open the thread"):u("web.clone.open.project","Open the project"),p=_e(c,"primary",()=>this.goTo(t));p.setAttribute("data-testid","clone-open"),a.append(p),r.push(a)}e.replaceChildren(...r)}showJobError(e){if(!this.jobEl)return;this.jobEl.querySelector(".bp-ap-job-err")?.remove();let t=X("div","bp-ap-err bp-ap-job-err",e);this.jobEl.appendChild(t)}goTo(e){this.jobId="",this.job=null,this.close(),this.host.onCloneDone(e)}async startSignin(){this.signin={state:"starting"},this.copied=!1,this.renderSignin();try{let e=await this.host.hub.rpc("clone.signin",{restart:!0},30000);if(!this.signin||this.signin.state==="starting")this.signin=e}catch(e){this.signin={state:"failed",error:e instanceof Error?e.message:String(e)}}if(this.signin?.state==="done")this.askRepos(0);this.renderSignin()}renderSignin(){let e=this.signinEl;if(!e)return;let t=this.signin,n=[];if(t&&t.state){if(t.state==="starting"||t.state==="waiting"&&!t.code)n.push(X("div","bp-dim",u("web.clone.signin.wait","Starting GitHub sign-in…")));else if(t.state==="waiting"){n.push(X("div","",u("web.clone.signin.enter","Enter this code on GitHub:")));let i=X("div","bp-ap-code-row"),s=X("span","bp-ap-code",t.code||"");s.setAttribute("data-testid","clone-signin-code");let r=_e(this.copied?u("web.clone.copied","Copied"):u("common.copy","Copy"),"bp-btn-line",()=>{navigator.clipboard?.writeText(t.code||"").then(()=>{this.copied=!0,this.renderSignin()}).catch(()=>{})});if(i.append(s,r),n.push(i),t.url){let o=X("a","bp-ap-link",t.url);o.href=t.url,o.target="_blank",o.rel="noopener noreferrer",o.setAttribute("data-testid","clone-signin-url"),n.push(o)}}else if(t.state==="done")n.push(X("div","bp-ok",u("web.clone.signin.done","Signed in to GitHub")));else if(t.state==="failed")n.push(X("div","bp-ap-err",he(t.error||"")))}e.replaceChildren(...n),e.classList.toggle("bp-hidden",n.length===0)}}function jr(e){try{let t=new URL(e,window.location.origin);if(t.protocol==="https:"||t.protocol==="http:")return t.href}catch{}return null}function $t(e,t){let n=/(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[([^\]]+)\]\(([^)]+)\))/g,i=0,s;while((s=n.exec(t))!==null){if(s.index>i)e.appendChild(document.createTextNode(t.slice(i,s.index)));let r=s[0];if(r.startsWith("`")&&r.endsWith("`")){let o=document.createElement("code");o.className="bp-code-inline",o.textContent=r.slice(1,-1),e.appendChild(o)}else if(r.startsWith("**")&&r.endsWith("**")){let o=document.createElement("strong");o.textContent=r.slice(2,-2),e.appendChild(o)}else if(r.startsWith("*")&&r.endsWith("*")){let o=document.createElement("em");o.textContent=r.slice(1,-1),e.appendChild(o)}else if(r.startsWith("[")){let o=s[2]??"",a=jr(s[3]??"");if(a){let c=document.createElement("a");c.href=a,c.target="_blank",c.rel="noopener noreferrer",c.textContent=o,e.appendChild(c)}else e.appendChild(document.createTextNode(o))}i=n.lastIndex}if(i{navigator.clipboard?.writeText(l).then(()=>{f.textContent="✓",window.setTimeout(()=>{f.textContent=b},1200)}).catch(()=>{})}),d.append(u,f);let v=document.createElement("pre"),y=document.createElement("code");y.textContent=l,v.appendChild(y),h.append(d,v),t.appendChild(h);continue}if(!s.trim()){i++;continue}let r=/^(#{1,4})\s+(.+)$/.exec(s);if(r){let c=document.createElement(`h${Math.min(4,r[1].length+1)}`);c.className="bp-md-h",Ht(c,r[2]),t.appendChild(c),i++;continue}if(s.startsWith("> ")){let c=document.createElement("blockquote");c.className="bp-md-quote";let p=[];while(i "))p.push(n[i].slice(2)),i++;Ht(c,p.join(` -`)),t.appendChild(c);continue}if(/^\s*[-*]\s+/.test(s)){let c=document.createElement("ul");c.className="bp-md-list";while(i ")&&!/^\s*[-*]\s+/.test(n[i])&&!/^\s*\d+\.\s+/.test(n[i]))a.push(n[i]),i++;let o=document.createElement("p");o.className="bp-md-p";for(let c=0;c0)o.appendChild(document.createElement("br"));Ht(o,a[c])}t.appendChild(o)}return t}var Ir=new Set(["(","[",'"',"'","`"]);function Rr(e){return/[\p{L}\p{N}\-_\/+\[]/u.test(e)}function jr(e){return/[\p{L}\p{N}\-_\/]/u.test(e)}function Hr(e){return/[\p{L}\p{N}]/u.test(e)}function Ni(e,t){if(!e)return[];let n=(t??[]).filter((r)=>r.kind==="model"&&r.word&&r.label);if(n.length===0)return[{kind:"text",text:e}];let i=[],s=0;while(sa)r=l,a=h,o=c;break}p=l+1}}if(o===null)break;if(r>s)i.push({kind:"text",text:e.slice(s,r)});i.push({kind:"model",word:o.word,label:o.label}),s=a}if(s3600000)return"";let t=Math.max(1,Math.round(e/1000));if(t<60)return`${t}s`;let n=Math.floor(t/60),i=t%60;return i>0?`${n}m ${i}s`:`${n}m`}function $r(e,t){let n=document.createDocumentFragment(),i=Ni(e,t),s=m("native.thread.model","Model").toLowerCase();for(let r of i){if(r.kind==="text"){n.appendChild(document.createTextNode(r.text));continue}let a=document.createElement("span");a.className="bp-ref-chip bp-ref-model",a.title=r.word,a.setAttribute("data-ref-word",r.word);let o=document.createElement("span");o.className="bp-ref-sigil",o.textContent="&";let c=document.createElement("span");c.className="bp-ref-label",c.textContent=r.label;let p=document.createElement("span");p.className="bp-ref-kind",p.textContent=s,a.append(o,c,p),n.appendChild(a)}return n}function Or(e){e.addEventListener("copy",(t)=>{let n=typeof window<"u"?window.getSelection():null;if(!n||n.rangeCount===0||n.isCollapsed)return;let i=n.getRangeAt(0);if(!e.contains(i.commonAncestorContainer))return;let s=i.commonAncestorContainer,o=(s.nodeType===Node.ELEMENT_NODE?s:s.parentElement)?.closest(".bp-ref-chip[data-ref-word]")?.getAttribute("data-ref-word"),c;if(o)c=o;else{let p=i.cloneContents(),l=p.querySelectorAll(".bp-ref-chip[data-ref-word]");if(l.length===0)return;for(let d of l){let u=d.getAttribute("data-ref-word")||d.textContent||"";d.replaceWith(document.createTextNode(u))}let h=p.querySelectorAll(".bp-entry");for(let d=1;d{if(!this.loadingOlder&&this.hasMore)this.loadingOlder=!0,this.cb.onLoadOlder()}),this.scrollEl.addEventListener("scroll",()=>{if(this.pinnedToBottom=this.isNearBottom(),this.hasMore&&!this.loadingOlder&&this.scrollEl.scrollTop<48)this.loadingOlder=!0,this.cb.onLoadOlder()}),typeof ResizeObserver<"u"){let n=0;new ResizeObserver(()=>{let s=this.scrollEl.clientHeight;if(n>0&&s!==n&&this.pinnedToBottom)this.scrollToBottom();n=s}).observe(this.scrollEl)}this.listEl=document.createElement("div"),this.listEl.className="bp-timeline-list",Or(this.scrollEl),this.scrollEl.append(this.olderBtn,this.listEl),e.append(this.bannerEl,this.scrollEl)}setLoading(e){this.thread=e,this.entries=[],this.hasMore=!1,this.loadingOlder=!1,this.review=null,this.unanswered=null,this.btwNote=null,this.liveNodes.clear(),this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear(),this.renderBanners(),this.olderBtn.classList.add("bp-hidden");let t=document.createElement("div");t.className="bp-empty-state",t.textContent=m("web.chat.loading","Loading messages…"),this.listEl.replaceChildren(t)}setError(e,t,n){this.thread=e,this.entries=[],this.hasMore=!1,this.loadingOlder=!1,this.review=null,this.unanswered=null,this.btwNote=null,this.liveNodes.clear(),this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear(),this.renderBanners(),this.olderBtn.classList.add("bp-hidden");let i=document.createElement("div");i.className="bp-empty-state";let s=document.createElement("div");s.className="bp-bad",s.textContent=t;let r=document.createElement("button");r.type="button",r.textContent=m("tools.retry","Retry"),r.addEventListener("click",n),i.append(s,r),this.listEl.replaceChildren(i)}getEntries(){return this.entries.slice()}refreshLocale(){let e=this.scrollEl.scrollTop;if(this.olderBtn.textContent=m("android.load.earlier","Load earlier"),this.renderBanners(),this.thread&&this.entries.length>0)this.renderEntries(!1);this.scrollEl.scrollTop=e}setThread(e,t,n,i,s){if((this.thread?.id??"")!==(e?.id??""))this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear();this.thread=e,this.entries=t.filter((r)=>!Cn(r)),this.hasMore=n,this.loadingOlder=!1,this.review=i,this.unanswered=s,this.btwNote=null,this.renderBanners(),this.renderEntries(!0)}updateThreadMeta(e){if(!this.thread||this.thread.id!==e.id)return;this.thread=e}setReview(e){this.review=e,this.renderBanners()}setUnanswered(e){this.unanswered=e,this.renderBanners()}setNoProvider(e){this.noProvider=e,this.renderBanners()}showBtw(e,t){this.btwNote={q:e,a:t},this.renderBanners()}prependEntries(e,t){this.loadingOlder=!1;let n=this.scrollEl.scrollHeight,i=new Set(this.entries.map((r)=>r.id)),s=e.filter((r)=>!Cn(r)&&!i.has(r.id));this.entries=[...s,...this.entries],this.hasMore=t,this.renderEntries(!1),this.scrollEl.scrollTop+=this.scrollEl.scrollHeight-n}clearLoadingOlder(){this.loadingOlder=!1}upsertEntry(e){if(Cn(e))return;let t=this.isNearBottom()||e.kind==="user"&&Boolean(e.clientId),n=this.entries.findIndex((i)=>i.id===e.id);if(n<0&&e.clientId)n=this.entries.findIndex((i)=>i.clientId&&i.clientId===e.clientId);if(n>=0)this.entries[n]=e;else this.entries.push(e);this.renderEntries(t)}goTo(e){let t=this.scrollEl.querySelector(`[data-entry-id="${CSS.escape(e)}"]`);if(!t)return!1;return t.scrollIntoView({block:"center",behavior:"smooth"}),t.classList.remove("bp-entry-flash"),t.offsetWidth,t.classList.add("bp-entry-flash"),window.setTimeout(()=>t.classList.remove("bp-entry-flash"),1200),!0}removeEntry(e){let t=this.entries.filter((n)=>n.id!==e);if(t.length!==this.entries.length)this.entries=t,this.renderEntries(!1)}appendLiveText(e,t,n){let i=this.isNearBottom(),s=this.entries.find((a)=>a.id===e);if(!s){s={id:e,kind:"assistant",text:t,at:n,live:!0},this.entries.push(s),this.renderEntries(i);return}s.text+=t,s.live=!0;let r=this.liveNodes.get(e);if(r){if(r.replaceChildren(Dt(s.text)),i)this.scrollToBottom()}else this.renderEntries(i)}isNearBottom(){let e=this.scrollEl;return e.scrollHeight-e.scrollTop-e.clientHeight<80}scrollToBottom(){this.pinnedToBottom=!0,this.scrollEl.scrollTop=this.scrollEl.scrollHeight}renderBanners(){let e=document.createDocumentFragment();if(this.noProvider&&!this.thread?.id.includes("~")){let t=document.createElement("div");t.className="bp-banner bp-no-provider",t.setAttribute("data-testid","no-provider-banner");let n=document.createElement("div");n.className="bp-no-provider-body";let i=document.createElement("strong");if(i.textContent=pe(this.noProvider.head),n.appendChild(i),this.noProvider.text){let a=document.createElement("span");a.className="bp-dim",a.textContent=pe(this.noProvider.text),n.appendChild(a)}let s=document.createElement("div");s.className="bp-banner-actions";let r=document.createElement("button");r.type="button",r.className="primary",r.setAttribute("data-testid","no-provider-accounts-btn"),r.textContent=pe(this.noProvider.button),r.addEventListener("click",()=>this.cb.onOpenAccounts?.()),s.appendChild(r),t.append(n,s),e.appendChild(t)}if(this.review&&(this.review.text||this.review.button)){let t=document.createElement("div");t.className="bp-banner bp-review-bar",t.setAttribute("data-testid","review-bar");let n=document.createElement("span");if(n.textContent=this.review.text||m("web.chat.review.mode","Review mode"),t.appendChild(n),this.review.button){let i=document.createElement("button");i.type="button",i.textContent=this.review.button,i.addEventListener("click",()=>this.cb.onToggleReview(!(this.review?.on??!0))),t.appendChild(i)}e.appendChild(t)}if(this.unanswered&&(this.unanswered.head||this.unanswered.text)){let t=document.createElement("div");t.className="bp-banner bp-unanswered",t.setAttribute("data-testid","unanswered-notice");let n=document.createElement("div");if(n.className="bp-unanswered-body",this.unanswered.head){let i=document.createElement("strong");i.textContent=this.unanswered.head,n.appendChild(i)}if(this.unanswered.text){let i=document.createElement("span");i.textContent=this.unanswered.text,n.appendChild(i)}if(t.appendChild(n),this.unanswered.buttons?.length){let i=document.createElement("div");i.className="bp-banner-actions";for(let s of this.unanswered.buttons){let r=document.createElement("button");if(r.type="button",s.primary)r.className="primary";r.textContent=s.label,r.addEventListener("click",()=>this.cb.onUnansweredAction(s.action,s.value)),i.appendChild(r)}t.appendChild(i)}e.appendChild(t)}if(this.btwNote){let t=document.createElement("div");t.className="bp-banner bp-btw-banner";let n=document.createElement("div"),i=document.createElement("div");i.className="bp-dim",i.textContent=`/btw ${this.btwNote.q}`;let s=document.createElement("div");s.appendChild(Dt(this.btwNote.a)),n.append(i,s);let r=document.createElement("button");r.type="button",r.className="icon",r.textContent="×",r.addEventListener("click",()=>{this.btwNote=null,this.renderBanners()}),t.append(n,r),e.appendChild(t)}this.bannerEl.replaceChildren(e)}makeEntryActions(e,t,n){let i=document.createElement("div");i.className="bp-entry-foot"+(t?" user":"");let s=document.createElement("button");s.type="button",s.className="bp-entry-act";let r=m("common.copy","Copy"),a=document.createElement("span");a.textContent=r,s.append(Ft(["M9 9h11v11H9z","M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"]),a),s.addEventListener("click",()=>{navigator.clipboard?.writeText(e.text||"").then(()=>{a.textContent="✓",window.setTimeout(()=>{a.textContent=r},1000)}).catch(()=>{})});let o=document.createElement("button");o.type="button",o.className="bp-entry-act";let c=document.createElement("span");c.textContent=m("reply.action","Reply"),o.append(Ft(["M9 17l-5-5 5-5","M20 18v-2a4 4 0 0 0-4-4H4"]),c),o.addEventListener("click",()=>this.cb.onReplyEntry(e));let p=!e.live&&!e.id.startsWith("local-")&&!e.id.startsWith("live:"),l=document.createElement("span");l.className="bp-entry-time";let h=Dr(e.at);if(t)l.textContent=h,i.append(s,...p?[o]:[],l);else{let d=n&&e.at?Fr(xn(e.at)-xn(n)):"",u=h?d?m("web.chat.finished.dur","Finished {time} · {dur}",{time:h,dur:d}):m("web.chat.finished","Finished {time}",{time:h}):"";l.textContent=e.live?m("web.chat.streaming","Streaming…"):u,i.append(l,s,...p?[o]:[])}return i}closePlanRevise(){let e=this.planRevisingId;if(!e)return!1;this.planRevisingId="";let t=this.scrollEl.scrollTop;return this.renderEntries(!1),this.scrollEl.scrollTop=t,this.listEl.querySelector(`[data-testid="ask-${CSS.escape(e)}"] [data-testid="plan-revise"]`)?.focus(),!0}renderEntries(e){let t=null,n=typeof document<"u"?document.activeElement:null;if(n instanceof HTMLTextAreaElement&&n.classList.contains("bp-plan-revise-input")&&this.listEl.contains(n)&&this.planRevisingId)this.planReviseDrafts.set(this.planRevisingId,n.value),t={askId:this.planRevisingId,start:n.selectionStart,end:n.selectionEnd,dir:n.selectionDirection};this.olderBtn.classList.toggle("bp-hidden",!this.hasMore),this.liveNodes.clear();let i=document.createDocumentFragment();if(!this.thread){let r=document.createElement("div");r.className="bp-empty-state",r.textContent=m("web.chat.choose","Choose a project thread on the left to begin."),i.appendChild(r),this.listEl.replaceChildren(i);return}if(this.entries.length===0){let r=document.createElement("div");r.className="bp-empty-state",r.textContent=m("web.chat.empty","No messages yet. Type below to start a turn."),i.appendChild(r),this.listEl.replaceChildren(i);return}let s=0;for(let r of this.entries){if(r.kind==="user"&&r.at)s=r.at;let a=document.createElement("article");if(a.className=`bp-entry bp-entry-${r.kind}`+(r.live?" is-live":""),a.setAttribute("data-entry-id",r.id),r.kind==="tool"&&r.tool){let l=document.createElement("div");l.className=`bp-tool-pill bp-tool-${r.tool.state||"done"}`;let h=document.createElement("span");if(h.className="bp-tool-name",h.textContent=r.tool.name,l.appendChild(h),r.tool.summary){let d=document.createElement("span");d.className="bp-tool-summary",d.textContent=r.tool.summary,l.appendChild(d)}a.appendChild(l),i.appendChild(a);continue}if(r.kind==="ask"&&r.ask){let l=r.ask;if(l.kind==="plan"){a.appendChild(this.renderPlanAsk(l)),i.appendChild(a);continue}let h=document.createElement("div");h.className="bp-ask-card",h.setAttribute("data-testid",`ask-${l.id}`);let d=document.createElement("div");if(d.className="bp-ask-q",d.textContent=l.question,h.appendChild(d),l.state==="open"){let u=document.createElement("div");if(u.className="bp-ask-opts",l.options&&l.options.length>0)for(let f of l.options){let b=document.createElement("button");b.type="button",b.textContent=f.label,b.addEventListener("click",()=>this.cb.onAnswerAsk(l.id,f.id)),u.appendChild(b)}else{let f=document.createElement("input");f.type="text",f.className="bp-input",f.placeholder=m("web.chat.answer.placeholder","Type answer…");let b=document.createElement("button");b.type="button",b.className="primary",b.textContent=m("web.chat.answer.btn","Answer"),b.addEventListener("click",()=>{if(f.value.trim())this.cb.onAnswerAsk(l.id,f.value.trim())}),u.append(f,b)}h.appendChild(u)}else{let u=document.createElement("div");u.className="bp-ask-answered",u.textContent=m("web.chat.answered","Answered: {answer}",{answer:l.answered??""}),h.appendChild(u)}a.appendChild(h),i.appendChild(a);continue}let o=Boolean(r.text&&r.text.trim().length>0),c=Boolean(r.images&&r.images.length>0),p=Boolean(r.attachments&&r.attachments.length>0);if(!o&&!c&&!p&&!r.live)continue;if(r.replyTo?.quote){let l=document.createElement("div");l.className="bp-reply-quote",l.textContent=m("gpui.b.in.reply.to","↩ In reply to: {quote}",{quote:r.replyTo.quote});let h=r.replyTo.id;l.setAttribute("role","button"),l.tabIndex=0,l.setAttribute("data-testid","entry-reply-quote");let d=()=>{if(this.cb.onGoToEntry)this.cb.onGoToEntry(h);else this.goTo(h)};l.addEventListener("click",d),l.addEventListener("keydown",(u)=>{if(u.key==="Enter"||u.key===" ")u.preventDefault(),d()}),a.appendChild(l)}if(o||r.live){let l=document.createElement("div");if(l.className="bp-entry-body",r.kind==="user")l.appendChild($r(r.text||"",r.refs));else l.appendChild(Dt(r.text||""));if(r.live)this.liveNodes.set(r.id,l);a.appendChild(l)}if(p&&r.attachments){let l=document.createElement("div");l.className="bp-entry-images";for(let h of r.attachments)if(h.previewUrl){let d=document.createElement("img");d.className="bp-reply-img",d.src=h.previewUrl,d.alt=h.name||"attachment",l.appendChild(d)}else if(h.path||h.name){let d=document.createElement("span");d.className="bp-tool-pill",d.textContent=h.name||h.path||"image",l.appendChild(d)}if(l.childElementCount>0)a.appendChild(l)}if(r.images&&r.images.length>0){let l=document.createElement("div");l.className="bp-entry-images";for(let h of r.images){let d=document.createElement("img");d.className="bp-reply-img",d.alt=h;let u=`${r.id}|${h}`,f=this.imageCache.get(u);if(f)d.src=f;else this.cb.onLoadImage(r.id,h).then((b)=>{if(!b)return;let v=b.url??(b.mime&&b.data?`data:${b.mime};base64,${b.data}`:"");if(!v)return;this.imageCache.set(u,v),d.src=v});l.appendChild(d)}a.appendChild(l)}a.appendChild(this.makeEntryActions(r,r.kind==="user",r.kind==="assistant"?s:void 0)),i.appendChild(a)}if(this.listEl.replaceChildren(i),t&&this.planRevisingId===t.askId){let r=this.listEl.querySelector(`[data-testid="ask-${CSS.escape(t.askId)}"] .bp-plan-revise-input`);if(r){if(r.focus({preventScroll:!0}),t.start!==null&&t.end!==null)r.setSelectionRange(t.start,t.end,t.dir??void 0)}}if(e&&!t)this.scrollToBottom()}renderPlanAsk(e){let t=this.planExpanded.has(e.id),n=e.state==="open"&&this.planRevisingId===e.id,i=document.createElement("div");i.className="bp-ask-card bp-ask-plan",i.setAttribute("data-testid",`ask-${e.id}`);let s=document.createElement("div");s.className="bp-plan-head";let r=Ft(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"]);r.classList.add("bp-plan-head-ic");let a=document.createElement("span");if(a.className="bp-plan-title",a.textContent=!e.head||e.head==="Proposed plan"?m("ask.plan","Proposed plan"):pe(e.head),s.append(r,a),e.state==="open"){let l=document.createElement("span");l.className="bp-plan-badge",l.textContent=m("gpui.ask.plan.ready","Ready for review"),s.appendChild(l)}let o=document.createElement("span");if(o.className="bp-mgmt-flex1",s.appendChild(o),e.question){let l=document.createElement("button");l.type="button",l.className="bp-plan-head-btn";let h=m("common.copy","Copy"),d=document.createElement("span");d.textContent=h,l.append(Ft(["M9 9h11v11H9z","M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"]),d),l.addEventListener("click",()=>{navigator.clipboard?.writeText(e.question).then(()=>{l.classList.add("copied"),d.textContent=m("web.clone.copied","Copied"),window.setTimeout(()=>{l.classList.remove("copied"),d.textContent=h},1200)}).catch(()=>{})}),s.appendChild(l)}let c=document.createElement("button");c.type="button",c.className="bp-plan-head-btn",c.setAttribute("data-testid","plan-expand"),c.textContent=t?m("gpui.c.term.collapse","Collapse"):m("gpui.c.term.expand","Expand"),c.addEventListener("click",()=>{if(this.planExpanded.has(e.id))this.planExpanded.delete(e.id);else this.planExpanded.add(e.id);let l=this.scrollEl.scrollTop;this.renderEntries(!1),this.scrollEl.scrollTop=l}),s.appendChild(c),i.appendChild(s);let p=document.createElement("div");if(p.className="bp-plan-body"+(t?" is-expanded":""),p.setAttribute("data-testid","plan-body"),p.appendChild(Dt(e.question||"")),i.appendChild(p),e.state==="open"){let l=document.createElement("div");l.className="bp-plan-actions";let h=e.options?.find((b)=>b.id==="implement"||b.id.endsWith("|implement")),d=document.createElement("button");if(d.type="button",d.className="primary",d.setAttribute("data-testid","plan-implement"),d.textContent=h?.label&&h.label!=="Implement"?pe(h.label):m("approval.implement","Implement"),d.addEventListener("click",()=>{this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,h?.id??"implement")}),l.appendChild(d),e.revise!==!1){let b=document.createElement("button");b.type="button",b.className="bp-plan-revise-btn"+(n?" active":""),b.setAttribute("data-testid","plan-revise"),b.append(Ft(["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"]),document.createTextNode(m("gpui.ask.plan.revise","Revise"))),b.addEventListener("click",()=>{let v=this.planRevisingId!==e.id;this.planRevisingId=v?e.id:"";let y=this.scrollEl.scrollTop;if(this.renderEntries(!1),this.scrollEl.scrollTop=y,v)this.listEl.querySelector(`[data-testid="ask-${CSS.escape(e.id)}"] .bp-plan-revise-input`)?.focus()}),l.appendChild(b)}let u=e.options?.find((b)=>b.id==="dismiss"||b.id.endsWith("|dismiss")),f=document.createElement("button");if(f.type="button",f.className="bp-plan-dismiss-btn",f.setAttribute("data-testid","plan-dismiss"),f.textContent=u?.label&&u.label!=="Dismiss"?pe(u.label):m("approval.dismiss","Dismiss"),f.addEventListener("click",()=>{this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,u?.id??"dismiss")}),l.appendChild(f),i.appendChild(l),n){let b=document.createElement("div");b.className="bp-plan-revise",b.setAttribute("data-testid","plan-revise-drawer");let v=document.createElement("textarea");v.rows=2,v.className="bp-input bp-plan-revise-input",v.placeholder=m("gpui.ask.plan.reviseph","What should change in the plan?"),v.value=this.planReviseDrafts.get(e.id)??"";let y=document.createElement("button");y.type="button",y.className="bp-plan-revise-send",y.setAttribute("data-testid","plan-revise-send"),y.textContent=m("gpui.ask.plan.sendrev","Send revision"),y.disabled=v.value.trim().length===0;let w=()=>{let N=v.value.trim();if(!N)return;this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,`revise:${N}`)},C=()=>{this.closePlanRevise()};b.addEventListener("keydown",(N)=>{if(N.key==="Escape")N.preventDefault(),N.stopPropagation(),C()}),v.addEventListener("input",()=>{this.planReviseDrafts.set(e.id,v.value),y.disabled=v.value.trim().length===0}),v.addEventListener("keydown",(N)=>{if(N.key==="Enter"&&!N.shiftKey)N.preventDefault(),w()}),y.addEventListener("click",w);let L=document.createElement("button");L.type="button",L.className="bp-btn-ghost",L.textContent=m("common.cancel","Cancel"),L.addEventListener("click",C),b.append(v,y,L),i.appendChild(b)}}else{let l=document.createElement("div");l.className="bp-ask-answered",l.textContent=m("web.chat.answered","Answered: {answer}",{answer:e.answered??""}),i.appendChild(l)}return i}}var Gr={claude:"Claude Code",codex:"Codex CLI",grok:"Grok CLI",muse:"Muse Code",antigravity:"Google Antigravity",opencode:"OpenCode",pi:"Pi",omp:"Oh My Pi"};var Ti=/[\x00-\x1f\x7f]/,Vr=/\s/;function wt(e){return e.trim().replace(/^@+/,"").toLowerCase()}function ht(e,t){if(Ti.test(e)||Ti.test(t))return"";let n=wt(e),i=t.trim();if(!n||!i||n.includes("/")||Vr.test(n))return"";if(n.length+1+i.length>200)return"";return`${n}/${i}`}function Bi(e){let t=e.indexOf("/");if(t<=0)return null;let n=e.slice(0,t),i=e.slice(t+1);if(!ht(n,i))return null;return{provider:wt(n),model:i.trim()}}function lt(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let i of e){if(typeof i!=="string")continue;let s=Bi(i);if(!s)continue;let r=`${s.provider}/${s.model}`;if(!n.has(r)){if(n.add(r),t.push(r),t.length>=64)break}}return t}function Sn(e,t,n,i){let s=ht(t,n),r=lt(e);if(!s)return{keys:r,starred:!1};let a=r.indexOf(s),o=i!==void 0?i:a<0;if(o&&a<0){if(r.length>=64)return{keys:r,starred:!1};r.push(s)}else if(!o&&a>=0)r.splice(a,1);return{keys:r,starred:o}}function tt(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:null}function yt(e){return Array.isArray(e)?e:[]}function Le(e){return typeof e==="string"?e:""}function Ur(e){return Gr[e]??e}function Ii(e,t,n,i){let s=new Map;for(let a of e)s.set(a.provider,a);let r=[];for(let a of lt(t)){let o=Bi(a);if(!o)continue;let c=s.get(o.provider),p=Boolean(c&&c.models.some((u)=>u.value!=="")),l=c?.models.find((u)=>u.value===o.model),h=l?l.ok&&(c?.ok??!0):c?.ok??!0,d=l?.why||c?.why||"";if(h&&p&&!l)h=!1,d="not available on this machine";r.push({key:a,provider:o.provider,model:o.model,label:l?.label||o.model,note:l?.note||"",on:o.provider===n&&o.model===i,ok:h,why:d})}return r}function Ri(e,t=[]){let n=tt(e),i=tt(n?.picker)??n??{},s=yt(i.sections).map(tt).filter((x)=>Boolean(x)),r=(x)=>s.find((Y)=>Le(Y.action)===x),a=r("provider"),o=r("model"),c=r("effort"),p=yt(a?.choices).map(tt).filter((x)=>Boolean(x)),l=yt(o?.choices).map(tt).filter((x)=>Boolean(x)),h=yt(c?.choices).map(tt).filter((x)=>Boolean(x)),d=Le(i.chip),u=Le(p.find((x)=>x.on===!0)?.value)||d.split("/")[0]?.trim()||"claude",f=wt(u)||"claude",b=Le(l.find((x)=>x.on===!0)?.value),v=Le(h.find((x)=>x.on===!0)?.value),y=h.map((x)=>({value:Le(x.value),label:Le(x.label)||"auto",on:x.on===!0})),w=tt(i.agents),C=[],L=new Set,N=(x)=>{let Y=wt(x);if(Y&&!L.has(Y))L.add(Y),C.push(Y)};for(let x of p)N(Le(x.value)||Le(x.label));if(w)for(let x of Object.keys(w))N(x);N(f);let A=C.map((x)=>{let Y=p.find((ee)=>wt(Le(ee.value)||Le(ee.label))===x),se=tt(w?.[x]),ne=se?se.ok!==!1:Y?Y.ok!==!1:!0,he=Le(se?.why)||Le(Y?.why),Se=yt(se?.models).map(tt).filter((ee)=>Boolean(ee)),ke;if(Se.length>0)ke=Se.map((ee)=>{let re=Le(ee.value),R=Le(ee.label)||(re===""?"default":re),ue=Le(ee.note);return{value:re,label:R,note:ue,on:x===f&&re===b,ok:ee.ok!==!1&&ne,why:Le(ee.why)||he}});else if(x===f&&l.length>0)ke=l.map((ee)=>{let re=Le(ee.value),R=Le(ee.label);return{value:re,label:re===""?"default":re,note:R&&R!==re?R:"",on:ee.on===!0,ok:ee.ok!==!1&&ne,why:Le(ee.why)||he}});else if(ne)ke=[{value:"",label:"default",note:"",on:x===f&&b==="",ok:!0,why:""}];else ke=[];if(x===f&&b&&!ke.some((ee)=>ee.value===b)){let ee=l.find((R)=>Le(R.value)===b),re=Le(ee?.label);ke.push({value:b,label:b,note:re&&re!==b?re:"",on:!0,ok:!0,why:""})}return{provider:x,label:Ur(x),ok:ne,why:he,models:ke}}),B=Array.isArray(i.favoriteKeys),M=yt(i.favorites).map(tt).filter((x)=>Boolean(x)),j=B?lt(i.favoriteKeys):M.length>0?lt(M.map((x)=>Le(x.key)||ht(Le(x.provider),Le(x.model)))):lt(t),O=M.length>0?M.map((x)=>{let Y=wt(Le(x.provider)),se=Le(x.model).trim(),ne=ht(Y,se);if(!ne)return null;return{key:ne,provider:Y,model:se,label:Le(x.label)||se,note:Le(x.note),on:x.on===!0||Y===f&&se===b,ok:x.ok!==!1,why:Le(x.why)}}).filter((x)=>Boolean(x)):Ii(A,j,f,b);return{chip:d,provider:f,model:b,effort:v,efforts:y,providers:A,favoriteKeys:j,favorites:O}}function $t(e,t){let n=lt(t);return{...e,favoriteKeys:n,favorites:Ii(e.providers,n,e.provider,e.model)}}function ji(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean),i=(o)=>{if(n.length===0)return!0;let c=o.toLowerCase();return n.every((p)=>c.includes(p))},s=new Set(e.favoriteKeys),r=e.favorites.filter((o)=>i(`${o.provider} ${o.model} ${o.label} ${o.note}`)),a=[];for(let o of e.providers){let c=o.models.filter((p)=>i(`${o.provider} ${o.label} ${p.value} ${p.label} ${p.note}`)).map((p)=>{let l=p.value?ht(o.provider,p.value):"";return{...p,provider:o.provider,starrable:p.value!=="",starred:Boolean(l&&s.has(l))}});if(c.length>0||n.length===0&&!o.ok&&o.why)a.push({provider:o.provider,label:o.label,ok:o.ok,why:o.why,models:c})}return{favorites:r,groups:a,efforts:e.efforts}}var Hi={claude:{viewBox:"0 0 24 24",d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},codex:{viewBox:"0 0 256 260",d:"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695l-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218l-.052-32.434Z"},grok:{viewBox:"0 0 24 24",d:"M9.497 15.122 L16.811 9.491 C17.169 9.215 17.682 9.323 17.852 9.751 C18.752 12.013 18.35 14.73 16.561 16.596 C14.772 18.462 12.283 18.871 10.007 17.939 L7.522 19.139 C11.087 21.68 15.416 21.052 18.121 18.229 C20.267 15.991 20.931 12.941 20.31 10.19 L20.315 10.196 C19.414 6.155 20.537 4.54 22.837 1.237 C22.891 1.159 22.946 1.08 23 1 L19.974 4.156 L19.974 4.146 L9.495 15.124 M7.987 16.49 C5.429 13.941 5.87 9.996 8.053 7.721 C9.667 6.037 12.313 5.35 14.622 6.361 L17.102 5.166 C16.655 4.829 16.082 4.467 15.425 4.213 C12.455 2.938 8.9 3.573 6.485 6.088 C4.163 8.51 3.433 12.234 4.687 15.411 C5.624 17.786 4.088 19.466 2.541 21.162 C1.993 21.763 1.443 22.364 1 23 L7.985 16.492"},muse:{viewBox:"0 0 24 24",d:"M10.73.032c-1.333 0-2.032 1.016-2.032 2.285 0 2.223 2.127 4.953 4.318 4.953 1.301 0 2-.953 2-2.254 0-2.254-2.095-4.984-4.286-4.984m8.413 2.984c-1.968 0-3.397 2.73-3.397 4.825 0 1.556.794 3.016 2.254 3.016 2 0 3.365-2.762 3.365-4.794 0-1.523-.762-3.047-2.222-3.047M4.857 4.159c-1.968 0-3.778 1.016-3.778 2.54 0 1.65 2.16 2.793 4.254 2.793 1.873 0 3.778-.92 3.778-2.508 0-1.682-2.159-2.825-4.254-2.825m-.222 6.476C2.413 10.635 0 13.175 0 15.397c0 1.301.825 2.159 2.095 2.159 2.19 0 4.603-2.508 4.603-4.794 0-1.27-.761-2.127-2.063-2.127m16.667.698c-2.223 0-5.016 1.62-5.016 3.651 0 1.238 1.047 2.19 2.698 2.19 2.159 0 5.016-1.587 5.016-3.682 0-1.302-1.08-2.159-2.698-2.159M7.619 16c-1.524 0-2.38 1.746-2.38 3.429 0 2.063 1.269 4.54 3.047 4.54 1.524 0 2.38-1.81 2.38-3.461C10.667 18.57 9.46 16 7.62 16m6.571 1.016c-1.333 0-2.476.667-2.476 2.032 0 2.095 2.667 4.063 4.92 4.063 1.366 0 2.54-.73 2.54-2.063 0-2.032-2.698-4.032-4.984-4.032"},antigravity:{viewBox:"0 0 24 24",d:"M20.197 20.618 C21.318 21.459 23 20.898 21.459 19.357 C16.834 14.873 17.815 2.541 12.07 2.541 C6.325 2.541 7.306 14.873 2.682 19.357 C1 21.038 2.822 21.459 3.943 20.618 C8.287 17.675 8.006 12.49 12.07 12.49 C16.134 12.49 15.853 17.675 20.197 20.618 Z"},opencode:{viewBox:"0 0 24 24",d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},pi:{viewBox:"0 0 24 24",d:"M0 0v24h6v-6h6v-6H6V6h6v6h6V0Zm18 12v12h6V12Z"},omp:{viewBox:"0 0 24 24",d:"M1.44 3.86 L22.56 3.86 C23 3.86 23 3.86 23 4.3 L23 6.06 C23 6.5 23 6.5 22.56 6.5 L1.44 6.5 C1 6.5 1 6.5 1 6.06 L1 4.3 C1 3.86 1 3.86 1.44 3.86 Z M4.74 6.5 L6.5 6.5 C6.94 6.5 6.94 6.5 6.94 6.94 L6.94 19.7 C6.94 20.14 6.94 20.14 6.5 20.14 L4.74 20.14 C4.3 20.14 4.3 20.14 4.3 19.7 L4.3 6.94 C4.3 6.5 4.3 6.5 4.74 6.5 Z M15.74 6.5 L17.5 6.5 C17.94 6.5 17.94 6.5 17.94 6.94 L17.94 13.32 C17.94 13.76 17.94 13.76 17.5 13.76 L15.74 13.76 C15.3 13.76 15.3 13.76 15.3 13.32 L15.3 6.94 C15.3 6.5 15.3 6.5 15.74 6.5 Z M15.08 14.64 L18.16 14.64 C18.82 14.64 18.82 14.64 18.82 15.3 L18.82 17.5 C18.82 18.16 18.82 18.16 18.16 18.16 L15.08 18.16 C14.42 18.16 14.42 18.16 14.42 17.5 L14.42 15.3 C14.42 14.64 14.42 14.64 15.08 14.64 Z"}};var Et="http://www.w3.org/2000/svg",Di=4,Fi=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function tn(e){let t=document.createElementNS(Et,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","15"),t.setAttribute("height","15"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("aria-hidden","true");for(let n of e){let i=document.createElementNS(Et,"path");i.setAttribute("d",n),t.appendChild(i)}return t}function Ln(){return tn(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"])}function $i(){return tn(["M6 4l14 8-14 8z"])}function Oi(e){let t=document.createElementNS(Et,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill",e?"currentColor":"none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");let n=document.createElementNS(Et,"path");return n.setAttribute("d","M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5-4.8-4.6 6.6-.9z"),t.appendChild(n),t}function Gi(e){let t=(e||"").toLowerCase();if(t.includes("claude")||t.includes("anthropic"))return{mark:"claude",glyph:"A",color:"#d97757",title:"Claude"};if(t.includes("codex")||t.includes("openai"))return{mark:"codex",glyph:"O",color:"#10a37f",title:"Codex"};if(t.includes("gemini")||t.includes("antigravity")||t==="agy")return{mark:"antigravity",glyph:"G",color:"#4285f4",title:"Antigravity"};if(t.includes("grok"))return{mark:"grok",glyph:"X",color:"#6b7280",title:"Grok"};if(t.includes("muse"))return{mark:"muse",glyph:"M",color:"#8b5cf6",title:"Muse"};if(t.includes("opencode"))return{mark:"opencode",glyph:"C",color:"#2563eb",title:"OpenCode"};if(t.includes("omp")||t.includes("oh-my-pi"))return{mark:"omp",glyph:"Ω",color:"#c026d3",title:"Oh My Pi"};if(t==="pi"||t.startsWith("pi/")||t.startsWith("@pi"))return{mark:"pi",glyph:"π",color:"#db2777",title:"Pi"};return{glyph:"●",color:"var(--accent)",title:e||"Model"}}function Vi(e){let t=Hi[e];if(!t||!t.d)return null;let n=document.createElementNS(Et,"svg");n.setAttribute("viewBox",t.viewBox||"0 0 24 24"),n.setAttribute("width","14"),n.setAttribute("height","14"),n.setAttribute("fill","currentColor"),n.setAttribute("aria-hidden","true");let i=document.createElementNS(Et,"path");return i.setAttribute("d",t.d),n.appendChild(i),n}class An{popupEl;attachStripEl;planBarEl;fileInput;textarea;memoryEl;memoryFill;memoryText;modelBtn;providerMarkEl;modelTextEl;ctxEl;modelPickerEl;modelSearchInput;modelPickerBodyEl;modelPickerEffortsEl;modelPickerOpen=!1;modelPickerLoading=!1;modelPickerSnap=null;modelPickerQuery="";modelPickerFocusIdx=-1;onDocMouseDown;planChipBtn;planChipIconHost;planChipLbl;attachBtn;voiceBtn;sendBtn;stopBtn;errorEl;replyEl;cb;commands=[];popupMode="none";filteredSlash=[];mentionItems=[];popupIdx=0;enabled=!1;attachments=[];planMode=null;constructor(e,t){this.cb=t;let n=document.createElement("div");n.className="bp-composer",n.setAttribute("data-testid","composer");let i=document.createElement("div");i.className="bp-composer-inner",this.popupEl=document.createElement("div"),this.popupEl.className="bp-composer-popup bp-hidden",this.popupEl.setAttribute("data-testid","slash-menu"),this.errorEl=document.createElement("div"),this.errorEl.className="bp-composer-err bp-hidden",this.replyEl=document.createElement("div"),this.replyEl.className="bp-reply-strip bp-hidden",this.replyEl.setAttribute("data-testid","composer-reply"),this.attachStripEl=document.createElement("div"),this.attachStripEl.className="bp-attach-strip bp-hidden",this.attachStripEl.setAttribute("data-testid","composer-attachments"),this.planBarEl=document.createElement("div"),this.planBarEl.className="bp-plan-bar bp-hidden",this.planBarEl.setAttribute("data-testid","composer-plan-bar"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.accept="image/png,image/jpeg,image/webp,image/gif",this.fileInput.multiple=!0,this.fileInput.className="bp-hidden",this.fileInput.setAttribute("data-testid","composer-file-input"),this.fileInput.addEventListener("change",()=>{if(this.fileInput.files)this.addFiles(Array.from(this.fileInput.files));this.fileInput.value=""}),this.textarea=document.createElement("textarea"),this.textarea.className="bp-composer-input",this.textarea.rows=2,this.textarea.placeholder=m("composer.placeholder","Ask anything: @bot, >thread, %project, #room, $skill, /btw"),this.textarea.setAttribute("data-testid","composer-input");let s=document.createElement("div");s.className="bp-composer-bar";let r=document.createElement("button");r.type="button",r.className="bp-composer-model",r.setAttribute("data-testid","composer-model-chip"),r.setAttribute("aria-haspopup","dialog"),r.setAttribute("aria-expanded","false"),r.title=m("composer.model.tip","Choose the model and effort"),this.modelBtn=r,this.providerMarkEl=document.createElement("span"),this.providerMarkEl.className="bp-provider-mark",this.providerMarkEl.textContent="●",this.modelTextEl=document.createElement("span"),this.modelTextEl.className="bp-model-text",this.modelTextEl.textContent="default",this.ctxEl=document.createElement("span"),this.ctxEl.className="bp-ctx-pct bp-hidden",this.ctxEl.setAttribute("data-testid","composer-ctx");let a=document.createElement("span");a.className="bp-model-caret",a.textContent="▾",r.append(this.providerMarkEl,this.modelTextEl,this.ctxEl,a),r.addEventListener("click",()=>{this.toggleModelPicker()}),this.modelPickerEl=document.createElement("div"),this.modelPickerEl.className="bp-model-picker bp-hidden",this.modelPickerEl.setAttribute("data-testid","model-picker"),this.modelPickerEl.setAttribute("role","dialog");let o=document.createElement("div");o.className="bp-mp-search-wrap",this.modelSearchInput=document.createElement("input"),this.modelSearchInput.type="search",this.modelSearchInput.className="bp-mp-search",this.modelSearchInput.placeholder=m("gpui.search.models","Search models"),this.modelSearchInput.setAttribute("data-testid","model-picker-search"),this.modelSearchInput.addEventListener("input",()=>{this.modelPickerQuery=this.modelSearchInput.value,this.modelPickerFocusIdx=-1,this.renderModelPicker()}),this.modelSearchInput.addEventListener("keydown",(l)=>{if(l.key==="Escape"){l.preventDefault(),l.stopPropagation(),this.closeModelPicker(),this.textarea.focus();return}if(l.key==="ArrowDown"||l.key==="ArrowUp"){let h=this.modelPickerFocusableButtons();if(h.length===0)return;l.preventDefault();let d=l.key==="ArrowDown"?1:-1;this.modelPickerFocusIdx=this.modelPickerFocusIdx<0?d>0?0:h.length-1:(this.modelPickerFocusIdx+d+h.length)%h.length,this.updateModelPickerKbdFocus(h);return}if(l.key==="Enter"){let h=this.modelPickerFocusableButtons(),d=this.modelPickerFocusIdx>=0&&this.modelPickerFocusIdxthis.cb.onCyclePlanMode?.()),this.memoryEl=document.createElement("div"),this.memoryEl.className="bp-composer-memory bp-hidden",this.memoryEl.setAttribute("data-testid","composer-memory");let c=document.createElement("div");c.className="bp-memory-meter",this.memoryFill=document.createElement("div"),this.memoryFill.className="bp-memory-fill",c.appendChild(this.memoryFill),this.memoryText=document.createElement("span"),this.memoryEl.append(c,this.memoryText);let p=document.createElement("div");p.className="bp-composer-btns",this.attachBtn=document.createElement("button"),this.attachBtn.type="button",this.attachBtn.className="icon bp-composer-tool",this.attachBtn.title=m("web.composer.attach","Attach image"),this.attachBtn.setAttribute("aria-label",m("web.composer.attach","Attach image")),this.attachBtn.setAttribute("data-testid","composer-attach"),this.attachBtn.appendChild(tn(["M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"])),this.attachBtn.addEventListener("click",()=>this.fileInput.click()),this.voiceBtn=document.createElement("button"),this.voiceBtn.type="button",this.voiceBtn.className="icon bp-composer-tool",this.voiceBtn.title=m("web.composer.voice","Voice dictation"),this.voiceBtn.setAttribute("aria-label",m("web.composer.voice","Voice dictation")),this.voiceBtn.setAttribute("data-testid","composer-voice"),this.voiceBtn.appendChild(tn(["M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z","M19 10v2a7 7 0 0 1-14 0v-2","M12 19v4","M8 23h8"])),this.voiceBtn.addEventListener("click",()=>this.cb.onToggleVoice?.()),this.stopBtn=document.createElement("button"),this.stopBtn.type="button",this.stopBtn.className="primary stop bp-hidden",this.stopBtn.textContent=m("composer.stop","Stop"),this.stopBtn.setAttribute("data-testid","composer-stop"),this.stopBtn.addEventListener("click",()=>this.cb.onInterrupt()),this.sendBtn=document.createElement("button"),this.sendBtn.type="button",this.sendBtn.className="primary bp-send-btn",this.sendBtn.textContent=m("composer.send","Send"),this.sendBtn.setAttribute("data-testid","composer-send"),this.sendBtn.addEventListener("click",()=>this.submit()),p.append(this.attachBtn,this.voiceBtn,this.stopBtn,this.sendBtn),s.append(r,this.planChipBtn,this.memoryEl,p),i.append(this.modelPickerEl,this.popupEl,this.errorEl,this.replyEl,this.attachStripEl,this.planBarEl,this.fileInput,this.textarea,s),n.appendChild(i),e.appendChild(n),this.onDocMouseDown=(l)=>{if(!this.modelPickerEl.isConnected){document.removeEventListener("mousedown",this.onDocMouseDown);return}if(!this.modelPickerOpen)return;let h=l.target;if(h&&(this.modelPickerEl.contains(h)||this.modelBtn.contains(h)))return;this.closeModelPicker()},document.addEventListener("mousedown",this.onDocMouseDown),this.textarea.addEventListener("paste",(l)=>{let h=l.clipboardData?.items;if(!h)return;let d=[];for(let u=0;u0)l.preventDefault(),this.addFiles(d)}),this.textarea.addEventListener("input",()=>{this.autoGrow(),this.clearError(),this.updatePopups()}),this.textarea.addEventListener("keydown",(l)=>{if(this.popupMode!=="none"){let h=this.popupMode==="slash"?this.filteredSlash.length:this.mentionItems.length;if(l.key==="ArrowDown"){l.preventDefault(),this.popupIdx=(this.popupIdx+1)%Math.max(1,h),this.renderPopup();return}if(l.key==="ArrowUp"){l.preventDefault(),this.popupIdx=(this.popupIdx-1+Math.max(1,h))%Math.max(1,h),this.renderPopup();return}if(l.key==="Tab"||l.key==="Enter"&&!l.shiftKey&&this.shouldCompleteOnEnter()){l.preventDefault(),this.applyPopupChoice(this.popupIdx);return}if(l.key==="Escape"){l.preventDefault(),this.closePopup();return}}if(l.key==="Tab"&&l.shiftKey&&this.planMode!==null){l.preventDefault(),this.cb.onCyclePlanMode?.();return}if(l.key==="Enter"&&!l.shiftKey)l.preventDefault(),this.submit()})}setCommands(e){this.commands=e.map((t)=>({...t,word:t.word.replace(/^\//,"")}))}setModelChip(e,t,n){let i=Gi(t),s=i.mark?Vi(i.mark):null;if(s)this.providerMarkEl.replaceChildren(s);else this.providerMarkEl.textContent=i.glyph;if(this.providerMarkEl.style.color=i.color,this.providerMarkEl.title=i.title,this.modelTextEl.textContent=e||"default",typeof n==="number"&&Number.isFinite(n)&&n>=0)this.ctxEl.textContent=`ctx ${Math.round(n)}%`,this.ctxEl.classList.remove("bp-hidden");else this.ctxEl.textContent="",this.ctxEl.classList.add("bp-hidden")}setFeatures(e,t){this.attachBtn.classList.toggle("bp-hidden",!e),this.voiceBtn.classList.toggle("bp-hidden",!t)}setVoiceRecording(e){this.voiceBtn.classList.toggle("recording",e),this.voiceBtn.setAttribute("aria-pressed",e?"true":"false")}setVoiceLevel(e){this.voiceBtn.setAttribute("data-level",String(e))}getDraft(){return this.textarea.value}getCaret(){return this.textarea.selectionStart??this.textarea.value.length}setMemory(e){if(this.memoryEl.classList.toggle("bp-hidden",!e),!e)return;let t=e.total??0,n=t>0?Math.min(1,(e.done??0)/t):1;this.memoryFill.style.width=`${Math.round(n*100)}%`,this.memoryFill.dataset.state=e.state??"",this.memoryText.textContent=e.line??"",this.memoryEl.title=[e.status,e.lines,e.viewLine].filter(Boolean).join(` -`)}setPlanMode(e){if(this.planMode=e,this.textarea.classList.remove("is-plan","is-plan-exec"),this.sendBtn.classList.remove("is-plan","is-plan-exec"),this.planChipBtn.classList.remove("is-plan","is-exec"),this.planBarEl.classList.remove("is-exec"),!e){this.planChipBtn.classList.add("bp-hidden"),this.planChipBtn.setAttribute("aria-pressed","false"),this.planBarEl.classList.add("bp-hidden"),this.planBarEl.replaceChildren(),this.sendBtn.textContent=m("composer.send","Send");return}let t=e.phase,n=t!=="off",i=t==="armed"||t==="planning"||t==="pending",s=t==="executing";this.planChipBtn.classList.remove("bp-hidden"),this.planChipBtn.classList.toggle("is-plan",i),this.planChipBtn.classList.toggle("is-exec",s),this.planChipBtn.setAttribute("aria-pressed",n?"true":"false");let r=`${m("gpui.planmode.tip","Plan before acting (1 turn, always, or off)")} · Shift+Tab`;if(this.planChipBtn.title=r,this.planChipBtn.setAttribute("aria-label",r),this.planChipIconHost.replaceChildren(s?$i():Ln()),this.planChipLbl.textContent=s?m("gpui.planmode.chip.building","Building"):t==="pending"?m("gpui.mgmt.fab.reviewbtn","Review"):i&&e.once?m("gpui.planmode.chip.once","Plan · 1t"):m("gpui.mgmt.plan.tab","Plan"),this.textarea.classList.toggle("is-plan",i),this.textarea.classList.toggle("is-plan-exec",s),this.sendBtn.classList.toggle("is-plan",i),this.sendBtn.classList.toggle("is-plan-exec",s),this.sendBtn.textContent=i?m("gpui.mgmt.plan.tab","Plan"):m("composer.send","Send"),!n){this.planBarEl.classList.add("bp-hidden"),this.planBarEl.replaceChildren();return}this.planBarEl.classList.remove("bp-hidden"),this.planBarEl.classList.toggle("is-exec",s);let a=document.createElement("span");a.className="bp-plan-bar-ic",a.appendChild(s?$i():Ln());let o=document.createElement("span");o.className="bp-plan-bar-text",o.textContent=t==="armed"&&e.once?m("gpui.planmode.bar.once","Plan mode (1 turn) — explores and proposes a plan before editing"):t==="armed"?m("gpui.planmode.bar.always","Plan mode — explores and proposes a plan before editing"):t==="planning"?m("gpui.planmode.bar.planning","Planning — drafting a plan before edits"):t==="pending"?m("gpui.planmode.bar.pending","Proposed plan awaits review below"):m("gpui.planmode.bar.executing","Building the approved plan");let c=[a,o];if(t==="armed"||t==="planning"){let p=document.createElement("div");p.className="bp-plan-scopes";let l=(h,d,u,f)=>{let b=document.createElement("button");return b.type="button",b.className="bp-plan-scope-btn"+(d?" active":""),b.textContent=h,b.disabled=!this.enabled,b.setAttribute("data-testid",f),b.addEventListener("click",()=>this.cb.onSetPlanMode?.(u)),b};p.append(l(m("gpui.planmode.scope.once","1 turn"),e.once,"once","plan-scope-once"),l(m("gpui.planmode.scope.always","Always"),!e.once,"always","plan-scope-always"),l(m("gpui.bots.recall.off","Off"),!1,"off","plan-scope-off")),c.push(p)}this.planBarEl.replaceChildren(...c)}setState(e,t){if(this.enabled=e,this.textarea.disabled=!e,this.sendBtn.disabled=!e,this.attachBtn.disabled=!e,this.voiceBtn.disabled=!e,this.modelBtn.disabled=!e,!e)this.closeModelPicker();this.planChipBtn.disabled=!e,this.planBarEl.querySelectorAll(".bp-plan-scope-btn").forEach((n)=>{n.disabled=!e}),this.stopBtn.classList.toggle("bp-hidden",!t)}destroy(){document.removeEventListener("mousedown",this.onDocMouseDown)}isModelPickerOpen(){return this.modelPickerOpen}closeModelPicker(){if(!this.modelPickerOpen)return;this.modelPickerOpen=!1,this.modelPickerFocusIdx=-1,this.modelPickerEl.classList.add("bp-hidden"),this.modelBtn.classList.remove("is-open"),this.modelBtn.setAttribute("aria-expanded","false")}modelPickerFocusableButtons(){return Array.from(this.modelPickerBodyEl.querySelectorAll(".bp-mp-row-main:not(:disabled)"))}updateModelPickerKbdFocus(e){e.forEach((t,n)=>{let i=n===this.modelPickerFocusIdx;if(t.classList.toggle("is-kbd",i),i)t.scrollIntoView({block:"nearest"})})}updateFavoriteModels(e){if(!this.modelPickerSnap)return;if(this.modelPickerSnap=$t(this.modelPickerSnap,e),this.modelPickerOpen)this.renderModelPicker()}async toggleModelPicker(){if(!this.enabled)return;if(this.modelPickerOpen){this.closeModelPicker();return}this.closePopup(),this.modelPickerOpen=!0,this.modelPickerQuery="",this.modelPickerFocusIdx=-1,this.modelSearchInput.value="",this.modelPickerEl.classList.remove("bp-hidden"),this.modelBtn.classList.add("is-open"),this.modelBtn.setAttribute("aria-expanded","true"),this.modelPickerLoading=!0,this.renderModelPicker(),this.modelSearchInput.focus(),await this.reloadModelPicker()}async reloadModelPicker(){if(!this.cb.onLoadModelPicker){this.modelPickerLoading=!1,this.renderModelPicker();return}try{let e=await this.cb.onLoadModelPicker();if(!this.modelPickerOpen)return;this.modelPickerSnap=Ri(e,this.cb.getFavoriteModels?.()??[])}catch{}finally{if(this.modelPickerLoading=!1,this.modelPickerOpen)this.renderModelPicker()}}async toggleFavoriteInPicker(e,t){if(!this.modelPickerSnap)return;let n=this.modelPickerSnap,i=ht(e,t);if(!i)return;let s=n.favoriteKeys.includes(i),r=Sn(n.favoriteKeys,e,t);if(r.keys.length===n.favoriteKeys.length&&r.starred===s)return;if(this.modelPickerSnap=$t(n,r.keys),this.renderModelPicker(),!this.cb.onToggleFavorite)return;try{let a=await this.cb.onToggleFavorite(e,t,r.starred);if(Array.isArray(a)&&this.modelPickerSnap){if(this.modelPickerSnap=$t(this.modelPickerSnap,lt(a)),this.modelPickerOpen)this.renderModelPicker()}}catch(a){if(this.modelPickerSnap){let o=this.cb.getFavoriteModels?.(),c=Array.isArray(o)?lt(o):Sn(this.modelPickerSnap.favoriteKeys,e,t,!r.starred).keys;if(this.modelPickerSnap=$t(this.modelPickerSnap,c),this.modelPickerOpen)this.renderModelPicker()}this.showError(a instanceof Error&&a.message?a.message:"Could not update favorite model")}}renderProviderGlyph(e){let t=Gi(e),n=document.createElement("span");n.className="bp-mp-mark",n.style.color=t.color,n.title=t.title;let i=t.mark?Vi(t.mark):null;if(i)n.appendChild(i);else n.textContent=t.glyph;return n}makeStarButton(e,t,n,i="model-star"){let s=document.createElement("button");s.type="button",s.className="bp-mp-star"+(n?" is-starred":"");let r=n?m("gpui.picker.favorite.remove","Remove from favorites"):m("gpui.picker.favorite.add","Add to favorites");return s.title=r,s.setAttribute("aria-label",r),s.setAttribute("aria-pressed",n?"true":"false"),s.setAttribute("data-testid",`${i}-${e}-${t}`),s.appendChild(Oi(n)),s.addEventListener("click",(a)=>{a.preventDefault(),a.stopPropagation(),this.toggleFavoriteInPicker(e,t)}),s}renderModelPicker(){if(!this.modelPickerOpen)return;if(this.modelPickerFocusIdx=-1,!this.modelPickerSnap){let i=document.createElement("div");i.className="bp-mp-empty",i.textContent=this.modelPickerLoading?"…":m("gpui.no.models","No models"),this.modelPickerBodyEl.replaceChildren(i),this.modelPickerEffortsEl.classList.add("bp-hidden"),this.modelPickerEffortsEl.replaceChildren();return}let e=ji(this.modelPickerSnap,this.modelPickerQuery),t=document.createDocumentFragment();if(e.favorites.length>0){let i=document.createElement("div");i.className="bp-mp-section bp-mp-favorites",i.setAttribute("data-testid","model-picker-favorites");let s=document.createElement("div");s.className="bp-mp-head";let r=document.createElement("span");r.className="bp-mp-head-star",r.appendChild(Oi(!0));let a=document.createElement("span");a.textContent=m("gpui.picker.favorites","Favorites"),s.append(r,a),i.appendChild(s);for(let o of e.favorites){let c=document.createElement("div");c.className="bp-mp-row"+(o.on?" is-active":"")+(!o.ok?" is-disabled":""),c.setAttribute("data-testid",`model-fav-row-${o.provider}-${o.model}`);let p=document.createElement("button");if(p.type="button",p.className="bp-mp-row-main",p.disabled=!o.ok,!o.ok&&o.why)p.title=o.why;let l=document.createElement("span");l.className="bp-mp-check",l.textContent=o.on?"✓":"";let h=document.createElement("span");h.className="bp-mp-name",h.textContent=o.label;let d=document.createElement("span");d.className="bp-mp-note",d.textContent=!o.ok&&o.why?pe(o.why):o.note&&o.note!==o.label?pe(o.note):o.provider,p.append(l,this.renderProviderGlyph(o.provider),h,d),p.addEventListener("click",()=>{if(!o.ok)return;this.closeModelPicker(),this.textarea.focus(),this.cb.onSelectModel?.(o.provider,o.model)}),c.append(p,this.makeStarButton(o.provider,o.model,!0,"model-fav-star")),i.appendChild(c)}t.appendChild(i)}let n=document.createElement("div");if(n.className="bp-mp-groups",n.setAttribute("data-testid","model-picker-groups"),e.groups.length===0){let i=document.createElement("div");i.className="bp-mp-empty",i.textContent=this.modelPickerQuery.trim()?m("gpui.nothing.matches","Nothing matches"):m("gpui.no.models","No models"),n.appendChild(i)}else for(let i of e.groups){let s=document.createElement("div");s.className="bp-mp-group";let r=document.createElement("div");r.className="bp-mp-group-head";let a=document.createElement("span");if(a.className="bp-mp-group-title",a.textContent=i.label,r.append(this.renderProviderGlyph(i.provider),a),!i.ok&&i.why){let o=document.createElement("span");o.className="bp-mp-group-why",o.textContent=pe(i.why),r.appendChild(o)}s.appendChild(r);for(let o of i.models){let c=document.createElement("div");c.className="bp-mp-row"+(o.on?" is-active":"")+(!o.ok?" is-disabled":""),c.setAttribute("data-testid",`model-row-${i.provider}-${o.value||"default"}`);let p=document.createElement("button");if(p.type="button",p.className="bp-mp-row-main",p.disabled=!o.ok,!o.ok&&o.why)p.title=o.why;let l=document.createElement("span");l.className="bp-mp-check",l.textContent=o.on?"✓":"";let h=document.createElement("span");h.className="bp-mp-name",h.textContent=o.label;let d=document.createElement("span");if(d.className="bp-mp-note",d.textContent=o.note&&o.note!==o.label?pe(o.note):"",p.append(l,h,d),p.addEventListener("click",()=>{if(!o.ok)return;this.closeModelPicker(),this.textarea.focus(),this.cb.onSelectModel?.(i.provider,o.value)}),c.appendChild(p),o.starrable)c.appendChild(this.makeStarButton(i.provider,o.value,o.starred));s.appendChild(c)}n.appendChild(s)}if(t.appendChild(n),this.modelPickerBodyEl.replaceChildren(t),e.efforts.length>0){let i=document.createDocumentFragment(),s=document.createElement("span");s.className="bp-mp-efforts-lbl",s.textContent=m("model.col.effort","Effort"),i.appendChild(s);for(let r of e.efforts){let a=document.createElement("button");a.type="button",a.className="bp-mp-effort"+(r.on?" active":""),a.textContent=r.label,a.addEventListener("click",()=>{Promise.resolve(this.cb.onSelectEffort?.(r.value)).then(()=>{if(this.modelPickerOpen)this.reloadModelPicker()})}),i.appendChild(a)}this.modelPickerEffortsEl.replaceChildren(i),this.modelPickerEffortsEl.classList.remove("bp-hidden")}else this.modelPickerEffortsEl.classList.add("bp-hidden"),this.modelPickerEffortsEl.replaceChildren()}setDraft(e){this.textarea.value=e,this.autoGrow(),this.textarea.focus()}setReply(e,t,n){if(!e){this.replyEl.replaceChildren(),this.replyEl.classList.add("bp-hidden");return}let i=document.createElement("button");i.type="button",i.className="bp-reply-strip-body",i.setAttribute("data-testid","composer-reply-go");let s=document.createElement("span");s.className="bp-reply-strip-who",s.textContent=e.who;let r=document.createElement("span");if(r.className="bp-reply-strip-line",r.textContent=m("gpui.b.replying.to","↩ Replying to: {line}",{line:e.line}),i.append(s,r),t)i.addEventListener("click",t);let a=document.createElement("button");a.type="button",a.className="icon bp-reply-strip-drop",a.textContent="×";let o=m("reply.cancel","Cancel reply");if(a.title=o,a.setAttribute("aria-label",o),a.setAttribute("data-testid","composer-reply-drop"),n)a.addEventListener("click",n);this.replyEl.replaceChildren(i,a),this.replyEl.classList.remove("bp-hidden"),this.textarea.focus()}prependDraft(e){let t=this.textarea.value;this.textarea.value=t?`${e} -${t}`:e,this.autoGrow(),this.textarea.focus()}showError(e,t){let n=document.createElement("span");if(n.textContent=pe(e),t){let i=document.createElement("button");i.type="button",i.className="bp-composer-err-act",i.setAttribute("data-testid","composer-err-accounts"),i.textContent=t.label,i.addEventListener("click",t.onClick),this.errorEl.replaceChildren(n,i)}else this.errorEl.replaceChildren(n);this.errorEl.classList.remove("bp-hidden")}clearError(){this.errorEl.replaceChildren(),this.errorEl.classList.add("bp-hidden")}focus(){this.textarea.focus()}refreshLocale(){if(this.textarea.placeholder=m("composer.placeholder","Ask anything: @bot, >thread, %project, #room, $skill, /btw"),this.attachBtn.title=m("web.composer.attach","Attach image"),this.attachBtn.setAttribute("aria-label",m("web.composer.attach","Attach image")),this.voiceBtn.title=m("web.composer.voice","Voice dictation"),this.voiceBtn.setAttribute("aria-label",m("web.composer.voice","Voice dictation")),this.modelBtn.title=m("composer.model.tip","Choose the model and effort"),this.modelSearchInput.placeholder=m("gpui.search.models","Search models"),this.sendBtn.textContent=m("composer.send","Send"),this.stopBtn.textContent=m("composer.stop","Stop"),this.setPlanMode(this.planMode),this.modelPickerOpen)this.renderModelPicker()}autoGrow(){this.textarea.style.height="auto",this.textarea.style.height=`${Math.min(180,Math.max(54,this.textarea.scrollHeight))}px`}shouldCompleteOnEnter(){if(this.popupMode==="mention")return!0;if(this.popupMode==="slash"){let e=this.textarea.value;return e.startsWith("/")&&!e.includes(" ")}return!1}updatePopups(){let e=this.textarea.value;if(e.startsWith("/")&&!e.includes(" ")&&!e.includes(` -`)){let n=e.slice(1).toLowerCase();if(this.filteredSlash=this.commands.filter((i)=>i.word.toLowerCase().startsWith(n)),this.filteredSlash.length>0){this.popupMode="slash",this.popupIdx=Math.min(this.popupIdx,this.filteredSlash.length-1),this.renderPopup();return}}let t=/(?:^|\s)([@>%#])([a-zA-Z0-9._-]{1,32})$/.exec(e.slice(0,this.textarea.selectionStart));if(t){let n=t[1],i=t[2];this.cb.onQueryMentions(i,n).then((s)=>{if(s.length>0)this.mentionItems=s,this.popupMode="mention",this.popupIdx=0,this.renderPopup();else if(this.popupMode==="mention")this.closePopup()});return}this.closePopup()}closePopup(){this.popupMode="none",this.popupEl.classList.add("bp-hidden"),this.popupEl.replaceChildren()}renderPopup(){let e=document.createDocumentFragment();if(this.popupMode==="slash")this.filteredSlash.forEach((t,n)=>{let i=document.createElement("button");i.type="button",i.className="bp-popup-row"+(n===this.popupIdx?" active":""),i.setAttribute("data-testid",`slash-item-${t.word}`);let s=document.createElement("span");s.className="bp-popup-name",s.textContent=`/${t.word}`;let r=document.createElement("span");r.className="bp-popup-desc",r.textContent=t.desc||t.label,i.append(s,r),i.addEventListener("mousedown",(a)=>{a.preventDefault(),this.applyPopupChoice(n)}),e.appendChild(i)});else if(this.popupMode==="mention")this.mentionItems.forEach((t,n)=>{let i=document.createElement("button");i.type="button",i.className="bp-popup-row"+(n===this.popupIdx?" active":"");let s=document.createElement("span");s.className="bp-popup-name",s.textContent=t.word||`${t.sigil}${t.label}`;let r=document.createElement("span");r.className="bp-popup-desc",r.textContent=t.detail||t.label,i.append(s,r),i.addEventListener("mousedown",(a)=>{a.preventDefault(),this.applyPopupChoice(n)}),e.appendChild(i)});this.popupEl.replaceChildren(e),this.popupEl.classList.remove("bp-hidden")}applyPopupChoice(e){if(this.popupMode==="slash"){let t=this.filteredSlash[e];if(t)this.textarea.value=`/${t.word} `,this.autoGrow(),this.textarea.focus();this.closePopup()}else if(this.popupMode==="mention"){let t=this.mentionItems[e];if(t){let n=this.textarea.selectionStart,i=this.textarea.value.slice(0,n),s=this.textarea.value.slice(n),r=i.replace(/([@>%#][a-zA-Z0-9._-]{1,32})$/,`${t.word} `);this.textarea.value=r+s,this.textarea.selectionStart=this.textarea.selectionEnd=r.length,this.textarea.focus()}this.closePopup()}}async addFiles(e){this.clearError();for(let t of e){if(!Fi.has(t.type)){this.showError(m("web.composer.unsupported","Unsupported image type: {type}",{type:t.type||t.name}));continue}if(this.attachments.length>=Di){this.showError(m("web.composer.maximages","At most {max} images per message.",{max:Di}));break}let n=await new Promise((s,r)=>{let a=new FileReader;a.onload=()=>s(String(a.result||"")),a.onerror=()=>r(Error("read failed")),a.readAsDataURL(t)}).catch(()=>""),i=n.indexOf(",");if(i<0)continue;this.attachments.push({name:t.name||`image-${this.attachments.length+1}.png`,mime:t.type,data:n.slice(i+1),previewUrl:n})}this.renderAttachments()}renderAttachments(){if(this.attachments.length===0){this.attachStripEl.classList.add("bp-hidden"),this.attachStripEl.replaceChildren();return}let e=document.createDocumentFragment();this.attachments.forEach((t,n)=>{let i=document.createElement("div");i.className="bp-attach-chip";let s=document.createElement("img");s.src=t.previewUrl,s.alt=t.name,s.className="bp-attach-thumb";let r=document.createElement("button");r.type="button",r.className="icon bp-attach-rm",r.textContent="×",r.title=m("common.remove","Remove"),r.addEventListener("click",()=>{this.attachments.splice(n,1),this.renderAttachments()}),i.append(s,r),e.appendChild(i)}),this.attachStripEl.replaceChildren(e),this.attachStripEl.classList.remove("bp-hidden")}submit(){if(!this.enabled)return;let e=this.textarea.value.trim();if(!e&&this.attachments.length===0)return;if(this.closePopup(),this.clearError(),e.startsWith("/")&&this.attachments.length===0){let n=e.slice(1).split(/\s+/)[0]?.toLowerCase()??"";if(this.commands.some((i)=>i.word.toLowerCase()===n)){this.textarea.value="",this.autoGrow(),this.cb.onRunCommand(e);return}}let t=this.attachments.map(({name:n,mime:i,data:s})=>({name:n,mime:i,data:s}));this.attachments=[],this.renderAttachments(),this.textarea.value="",this.autoGrow(),this.cb.onSend(e,t)}}async function Ui(e,t=fetch){let n=await t("/auth/web/logout",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:"{}"});if(n.status!==200||(await n.json()).state!=="revoked")throw Error("Logout was not confirmed");e()}var Wr=new Set(["bom","checks","life","plan","fab"]);function nn(e){if(!e||!Array.isArray(e.panels))return[];return e.panels.filter((t)=>t&&typeof t.id==="string"&&Wr.has(t.id))}function Ji(e){let t=e?.badge?.n??0;if(!Number.isFinite(t)||t<=0)return null;return{text:t>99?"99+":String(Math.floor(t)),tone:e?.badge?.tone==="bad"?"bad":"warn"}}function sn(e,t=22){let n=e.join(", ");if(n.length<=t)return n;let i="";for(let s=0;s0?` +${o}`.length:0)>t)return i?`${i} +${e.length-s}`:`${e[0]} +${e.length-1}`;i=a}return i}function kt(e){if(!Number.isFinite(e)||e<0)return"?";if(e<1000)return String(Math.round(e));if(e<1e6){let n=e/1000;return n<10?`${n.toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(n)}k`}let t=e/1e6;return t<10?`${t.toFixed(1).replace(/\.0$/,"")}M`:`${Math.round(t)}M`}function Ct(e){if(!Number.isFinite(e))return"";if(e>=1)return`$${e.toFixed(2)}`;let t=e.toFixed(4).replace(/0+$/,"");return(t.split(".")[1]??"").length<2?`$${e.toFixed(2)}`:`$${t}`}var _r=new Set(["0201","0402","0603","0805","1206","1210","1812","2010","2512"]),zr=new Set(["QFN","DFN","SOT","SOIC","SOP","SSOP","TSSOP","MSOP","QFP","LQFP","TQFP","BGA","WLCSP","SOD","TO","SON","LGA"]);function Yi(e){if(!e)return"";let t=e.indexOf(":"),i=(t>=0?e.slice(t+1):e).split("_");for(let a of i)if(_r.has(a))return a;let s=i[0]??"",r=s.replace(/[^a-zA-Z].*$/,"").toUpperCase();if(zr.has(r)){let a=s.split("-");if(a.length>=2&&/^\d+$/.test(a[1]))return`${a[0]}-${a[1]}`;return a[0]}return i.slice(0,2).join("_")}function Xi(e){let t=e?.status??"";if(!t)return null;let n=typeof e?.stock==="number"?e.stock:-1;if(t==="checking")return{text:"…",tone:"faint"};if(t==="unknown")return{text:"?",tone:"faint"};if(t==="out")return{text:`out ${kt(Math.max(n,0))}`,tone:"bad"};if(t==="low")return{text:`low ${kt(n)}`,tone:"warn"};return{text:kt(n),tone:"ok"}}function Qi(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;return e.filter((i)=>{let s=[(i.refs??[]).join(" "),i.value??"",i.footprint??"",i.mpn??"",i.fab??""].join(" ").toLowerCase();return n.every((r)=>r==="dnp"&&Boolean(i.dnp)||s.includes(r))})}function Zi(e,t){if(!t)return e;return e.filter((n)=>n.source===t)}function Mn(e){if(e==="active")return{label:"Active",tone:"ok"};if(e==="nrnd")return{label:"NRND",tone:"warn"};if(e==="eol")return{label:"EOL",tone:"bad"};return{label:"Unknown",tone:"faint"}}function rn(e){if(!Number.isFinite(e)||e<=0)return"";let t=new Date(e*1000),n=t.getUTCFullYear(),i=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0");return`${n}-${i}-${s}`}function es(e){return e.state==="routed"||e.state==="verified"}function ts(e){switch(e.state){case"approved":return"✓";case"edited":return"✎";case"verified":return"✓✓";case"routed":return"100%";case"rejected":case"failed":return"✗";case"routing":return typeof e.routed==="number"&&typeof e.total==="number"&&e.total>0?`${e.routed}/${e.total}`:"…";case"blocked":return`⚠ ${Math.max(1,e.problems??1)}`;default:return""}}function ns(e){switch(e.status){case"blocked":return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};case"routing":return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};case"awaiting":return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};case"verified":return{key:"gpui.mgmt.plan.st.verified",label:"Verified",tone:"ok"};case"routed":return{key:"gpui.mgmt.plan.st.routed",label:"Routed",tone:"ok"};case"ready":return{key:"gpui.mgmt.plan.st.approved",label:"Approved",tone:"accent"};case"partial":return{key:"gpui.mgmt.plan.st.partial",label:"Partial",tone:"warn"};case"rejected":return{key:"gpui.mgmt.plan.st.rejected",label:"Rejected",tone:"bad"};default:if((e.blocked??0)>0)return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};if(e.routing)return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};if((e.awaiting??0)>0)return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};return{key:"gpui.mgmt.plan.st.empty",label:"Empty",tone:"faint"}}}function is(e){let t=e.done??0,n=e.approved??0,i=e.awaiting??0,s=e.blocked??0,r=0;if(typeof e.total!=="number"){for(let a of e.layers??[])for(let o of a.items??[])if(o.state==="routed"||o.state==="verified")t+=1;else if(o.state==="routing")r+=1;else if(o.state==="approved")n+=1}else if(e.routing)r=Math.max(0,e.total-(t+n+i+s));return[{count:t,tone:"ok"},{count:r,tone:"accent"},{count:n,tone:"input"},{count:i,tone:"warn"},{count:s,tone:"bad"}]}function ss(e){switch(e){case"current":return{text:"The fab's limits are in the DRC rules",button:null};case"stale":return{text:"The DRC rules have older fab limits",button:"Update"};case"none":return{text:"The fab's limits are not in the DRC rules",button:"Write"};default:return{text:"No KiCad project for DRC rules",button:null}}}function rs(e){return e==="extra"?"costs-more limits":"base-price limits"}function Tn(e,t){return e.watchGen===t.watchGen&&e.editGen===t.editGen&&e.project!==""&&e.project===t.project&&e.editId!==""&&e.editId===t.editId}function as(e){return{project:e.project,refs:e.refs.slice(),field:e.field,value:e.was}}function Bn(e,t){return e.watchGen===t.watchGen&&e.project!==""&&e.project===t.project&&e.threadId!==""&&e.threadId===t.threadId&&e.threadGen===t.threadGen}var Wi=["#f59e0b","#38bdf8","#c084fc","#2dd4bf","#ef4444","#a3e635","#f97316","#ec4899"],_i=["#14b8a6","#f59e0b","#c084fc","#22c55e","#38bdf8","#ef4444","#e879f9","#84cc16"];function os(e){let t=2166136261;for(let n=0;n>>0;return t}function Ot(e,t=""){let n=t.trim().toLowerCase();if(n&&n!=="#5a7a9a"&&n!=="#8a8a8a")return t;let i=e.toUpperCase();if(i.includes("3V3A")||i.includes("AVDD")||i.includes("VDDA"))return"#38bdf8";if(i.includes("1V8")||i.includes("1.8V"))return"#c084fc";if(i.includes("2V5")||i.includes("2.5V"))return"#a3e635";if(i.includes("3V3")||i.includes("3.3V")||i.includes("VCC"))return"#f59e0b";if(i.includes("5V")||i.startsWith("+5"))return"#ef4444";if(i.includes("12V")||i.includes("24V"))return"#f97316";if(i.includes("VBAT")||i.includes("VIN"))return"#ec4899";if(i.includes("GND"))return"#2dd4bf";return Wi[os(i)%Wi.length]}function xt(e,t=""){let n=t.trim().toLowerCase();if(n&&n!=="#8a8a8a")return t;return _i[os(e)%_i.length]}function ls(e,t,n,i=14){let s=Math.max(1,Math.abs(e[2]-e[0])),r=Math.max(1,Math.abs(e[3]-e[1])),a=Math.max(20,t-i*2),o=Math.max(20,n-i*2),c=Math.max(0.05,Math.min(200,Math.min(a/s,o/r)));return{cx:(e[0]+e[2])*0.5,cy:(e[1]+e[3])*0.5,scale:c,fitted:c,touched:!1}}function qe(e,t,n,i,s){return[i*0.5+(t-e.cx)*e.scale,s*0.5+(n-e.cy)*e.scale]}function an(e,t,n,i,s){let r=Math.max(0.0001,e.scale);return[e.cx+(t-i*0.5)/r,e.cy+(n-s*0.5)/r]}function cs(e,t,n){let i=Math.max(0.0001,e.scale);return{...e,cx:e.cx-t/i,cy:e.cy-n/i,touched:!0}}function ds(e,t,n,i,s,r){let a=Math.max(0.02,e.fitted*0.35),o=Math.max(40,e.fitted*24),c=Math.max(a,Math.min(o,e.scale*t)),[p,l]=an(e,n,i,s,r);return{...e,cx:p-(n-s*0.5)/c,cy:l-(i-r*0.5)/c,scale:c,touched:!0}}function ps(e,t,n,i){let s=e.map((a)=>[a[0],a[1]]);if(s.length===0)return[n];let r=i&&t+1>=s.length?s.length:Math.min(t+1,s.length);return s.splice(r,0,[n[0],n[1]]),s}function In(e,t,n){let i=n?3:2;if(e.length<=i||t<0||t>=e.length)return null;let s=e.map((r)=>[r[0],r[1]]);return s.splice(t,1),s}function qr(e,t,n,i,s,r){let a=s-n,o=r-i,c=a*a+o*o;if(c<0.000001)return(e-n)*(e-n)+(t-i)*(t-i);let p=Math.max(0,Math.min(1,((e-n)*a+(t-i)*o)/c)),l=n+p*a,h=i+p*o;return(e-l)*(e-l)+(t-h)*(t-h)}function zi(e,t,n){if(n.length<3)return!1;let i=!1;for(let s=0,r=n.length-1;st!==p>t&&e<(c-a)*(t-o)/(p-o+0.000000000001)+a)i=!i}return i}function Rn(e,t){return Math.max(5,Math.min(32,e*t))}function on(e,t,n,i,s,r,a,o,c){if(i){for(let d of e){if(d.layer!==n||d.id!==i||d.locked)continue;let u=d.path??[];for(let f=0;f=3)for(let f=0;f=0;d--){let u=t[d];if(u.layer!==n)continue;let f=u.outline??[];if(!zi(l,h,f))continue;if(!(u.holes??[]).some((v)=>zi(l,h,v)))return{kind:"region",id:u.id}}return null}function Pt(e){let t=null,n=null,i=[];for(let r of e){if(!r.layer)continue;i.push(r.layer);let a=r.items??[],o=a.filter((p)=>p.kind==="corridor").length,c=a.filter((p)=>p.kind==="plane").length;if((o>0||r.role==="signal")&&(!t||o>t.count))t={count:o,layer:r.layer};if((c>0||r.role==="power"||r.role==="plane")&&(!n||c>n.count))n={count:c,layer:r.layer}}let s=[];if(t)s.push(t.layer);if(n&&!s.includes(n.layer))s.push(n.layer);for(let r of i){if(s.length>=2)break;if(!s.includes(r))s.push(r)}return s}function qi(e,t){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=Math.max(0,Math.min(1,t)),i=0;for(let a=1;a=s&&o>0.000000001){let c=(s-r)/o;return[e[a-1][0]+(e[a][0]-e[a-1][0])*c,e[a-1][1]+(e[a][1]-e[a-1][1])*c]}r+=o}return e[e.length-1]}function ut(e,t,n){for(let i of t??[])if(i.layer===e&&i.title)return i.title;for(let i of n??[])if(i.layer===e&&i.title)return i.title;return e}function hs(e,t,n){if(e==="split"&&n.length>0)return t.filter((i)=>n.includes(i.layer));return t}function Nn(e,t){return!(e[2]<=t[0]||e[0]>=t[2]||e[3]<=t[1]||e[1]>=t[3])}function Ki(e,t,n){if(n.length<3)return!1;let i=!1;for(let s=0,r=n.length-1;st!==p>t&&e<(c-a)*(t-o)/(p-o+0.000000000001)+a)i=!i}return i}function us(e,t){if(e.length<3)return null;let n=1/0,i=1/0,s=-1/0,r=-1/0,a=0,o=0;for(let p of e)n=Math.min(n,p[0]),i=Math.min(i,p[1]),s=Math.max(s,p[0]),r=Math.max(r,p[1]),a+=p[0],o+=p[1];let c=[[(n+s)*0.5,(i+r)*0.5],[a/e.length,o/e.length]];for(let p of[0.5,0.25,0.75,0.125,0.875])for(let l of[0.5,0.25,0.75,0.125,0.875])c.push([n+(s-n)*l,i+(r-i)*p]);for(let p of c)if(Ki(p[0],p[1],e)&&!t.some((l)=>Ki(p[0],p[1],l)))return p;return null}function ms(e,t,n,i,s,r){let a=[];for(let l of e){let h=l.nets??0,d=l.path??[];if(h<=0||d.length<2)continue;let u=0;for(let f=1;f{let d=l.sel||l.hov?1:0,u=h.sel||h.hov?1:0;if(u!==d)return u-d;if(h.nets!==l.nets)return h.nets-l.nets;return l.b.id.localeCompare(h.b.id)});let o=[],c=[],p=(l,h,d,u,f)=>[l-d*0.5-f,h-u*0.5-f,l+d*0.5+f,h+u*0.5+f];for(let l of a){let h=l.b.name||"",d=String(l.nets),u=h?`${h} · ${l.nets}`:d,f=(l.sel||l.hov||l.pxLen>=95)&&h?[u,d]:[d],b=null,v=(w,C)=>Math.max(C*0.5+3,Math.min(Math.max(C*0.5+3,n-C*0.5-3),w)),y=(w,C)=>Math.max(C*0.5+3,Math.min(Math.max(C*0.5+3,i-C*0.5-3),w));e:for(let w of f){let C=Math.max(16,w.length*5.9+10),L=15;for(let N of[0.5,0.35,0.65,0.22,0.78]){let A=qi(l.pts,N);if(!A)continue;let[B,M]=qe(t,A[0],A[1],n,i),j=v(B,C),O=y(M,15),x=p(j,O,C,15,2);if(!o.some((Y)=>Nn(x,Y))){b={id:l.b.id,text:w,cx:j,cy:O,pw:C,ph:15,col:l.col,sel:l.sel};break e}}}if(!b){let w=qi(l.pts,0.5);if(w){let[C,L]=qe(t,w[0],w[1],n,i),N=Math.max(16,d.length*6.5+8),A=15,B=v(C,N);for(let M of[-18,18]){let j=y(L+M,15);if(!o.some((O)=>Nn(p(B,j,N,15,2),O))){b={id:l.b.id,text:d,cx:B,cy:j,pw:N,ph:15,col:l.col,sel:l.sel};break}}}}if(b)o.push(p(b.cx,b.cy,b.pw,b.ph,2)),c.push(b)}return c}function bs(e,t,n,i,s,r=[]){let a=new Set(s),o=[];for(let l of e){if(!l.r||!l.b||l.b.length!==4)continue;let[h,d]=qe(t,l.b[0],l.b[1],n,i),[u,f]=qe(t,l.b[2],l.b[3],n,i),b=Math.abs(u-h),v=Math.abs(f-d);if(b<13||v<9)continue;let y=(h+u)*0.5,w=(d+f)*0.5;if(y<8||y>n-8||w<8||w>i-8)continue;o.push({text:l.r,cx:y,cy:w,bw:l.r.length*5.8+4,bh:11,score:b*v+(a.has(l.r)?1e4:0)})}o.sort((l,h)=>h.score-l.score);let c=[...r],p=[];for(let l of o){let h=[l.cx-l.bw*0.5,l.cy-l.bh*0.5,l.cx+l.bw*0.5,l.cy+l.bh*0.5];if(!c.some((u)=>Nn(h,u)))c.push(h),p.push({text:l.text,cx:l.cx,cy:l.cy})}return p}function gs(e){if(!e||typeof e!=="object")return null;let t=e;if(t.panel&&typeof t.panel==="object")return t.panel;if(t.result&&typeof t.result==="object"){let n=t.result.panel;if(n&&typeof n==="object")return n}return null}function ln(e,t){if(!t||t.length===0)return e;let n=new Map;for(let r of e)if(r.layer)n.set(r.layer,r);let i=[],s=new Set;for(let r of t){if(!r.layer)continue;s.add(r.layer);let a=n.get(r.layer);if(a)i.push(a);else i.push({layer:r.layer,index:r.index,title:r.title||`L${r.index} · ${r.layer}`,subtitle:r.subtitle||"",role:r.role,status:"proposed",done:0,approved:0,total:0,items:[]})}for(let r of e)if(r.layer&&!s.has(r.layer))i.push(r);return i}function fs(e,t,n,i,s,r,a,o){return e===t&&n===i&&s===r&&(o===void 0||a>=o)}var vs="#111917",Kr="#16201d",Jr="rgba(212, 224, 219, 0.92)",Yr="rgba(61, 80, 73, 0.72)",Xr="rgba(82, 107, 97, 0.85)";var ys="#f59e0b",Qr="#eef5f2",ws="#ef4444";function mt(e,t){let n=e.trim().replace(/^#/,"");if(n.length===6){let i=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),r=parseInt(n.slice(4,6),16);if(!Number.isNaN(i)&&!Number.isNaN(s)&&!Number.isNaN(r))return`rgba(${i}, ${s}, ${r}, ${t})`}return`rgba(20, 184, 166, ${t})`}function Zr(e,t,n){let i=0.14,s=0.45,r=0.85,a=!1;switch(e){case"approved":case"routing":i=0.16,s=0.51,r=0.91;break;case"edited":i=0.2,s=0.56,r=0.95;break;case"routed":case"verified":i=0.08,s=0.26,r=0.59;break;case"rejected":case"failed":i=0.05,s=0.13,r=0.27;break;case"blocked":i=0.18,s=0.48,r=0.88,a=!0;break}if(t)i=Math.min(0.35,i+0.1),s=Math.min(0.71,s+0.12),r=1;else if(n)i=Math.min(0.28,i+0.06),s=Math.min(0.63,s+0.07);return{glow:i,body:s,core:r,bad:a}}function ea(e,t,n){let i=0.27,s=0.83,r=!1;switch(e){case"approved":case"routing":i=0.36,s=0.91;break;case"edited":i=0.38,s=0.95;break;case"routed":case"verified":i=0.16,s=0.54;break;case"rejected":case"failed":i=0.08,s=0.27;break;case"blocked":i=0.31,s=0.94,r=!0;break}if(t)i=Math.min(0.53,i+0.12),s=1;else if(n)i=Math.min(0.45,i+0.06),s=Math.min(1,s+0.1);return{fill:i,edge:s,bad:r}}function ta(e){let t=e.items??[];if(t.some((n)=>n.state==="blocked"||n.state==="failed"))return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};if(t.some((n)=>n.state==="routing"))return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};if(t.some((n)=>n.state==="proposed"||n.state==="edited"))return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};if(t.length>0&&t.every((n)=>n.state==="routed"||n.state==="verified"))return{key:"gpui.mgmt.plan.st.routed",label:"Routed",tone:"ok"};if(t.length>0&&t.every((n)=>n.state==="approved"||n.state==="routed"||n.state==="verified"))return{key:"gpui.mgmt.plan.st.approved",label:"Approved",tone:"accent"};return{key:"gpui.mgmt.plan.st.empty",label:"Empty",tone:"faint"}}class jn{root;cb;state=null;cards=new Map;renderedLayerKey="";sharedCam=null;layerCams=new Map;hover=null;selectedVertex=null;drag=null;downPos=null;rafPending=0;constructor(e){this.cb=e,this.root=document.createElement("div"),this.root.className="bp-plan-canvas-grid",this.root.tabIndex=0,this.root.setAttribute("data-testid","mgmt-plan-canvas-grid"),this.root.addEventListener("keydown",(t)=>this.onKeyDown(t))}isDragging(){return this.drag!==null}fitAll(){this.sharedCam=null,this.layerCams.clear(),this.scheduleDraw()}destroy(){if(this.rafPending)cancelAnimationFrame(this.rafPending),this.rafPending=0;for(let e of this.cards.values())e.ro.disconnect();this.cards.clear(),this.root.replaceChildren()}visibleLayers(e){let t=ln(e.layers,e.copperLayers);if(t.length===0)return[];if(e.gridMode==="all")return t;if(e.gridMode==="single"){let s=e.shownLayers.find((a)=>t.some((o)=>o.layer===a))??Pt(t)[0]??t[0]?.layer,r=t.find((a)=>a.layer===s);return r?[r]:[]}let n=e.shownLayers.length>0&&e.shownLayers.every((s)=>t.some((r)=>r.layer===s))?e.shownLayers.slice(0,2):Pt(t),i=[];for(let s of n){let r=t.find((a)=>a.layer===s);if(r)i.push(r)}return i.length>0?i:t.slice(0,2)}update(e,t){this.state=e;let n=this.visibleLayers(e);this.root.classList.toggle("two-cols",t&&n.length>1);let i=n.map((s)=>s.layer).join("|");if(i!==this.renderedLayerKey){this.renderedLayerKey=i;for(let s of this.cards.values())s.ro.disconnect();this.cards.clear(),this.root.replaceChildren();for(let s of n){let r=this.buildCard(s);this.cards.set(s.layer,r),this.root.appendChild(r.el)}}else for(let s of n){let r=this.cards.get(s.layer);if(r)this.syncCardHeaderAndLegend(r,s)}this.scheduleDraw()}effectiveBbox(e){let t=e.bbox;if(!t||t.length!==4||Math.abs(t[2]-t[0])<0.5||Math.abs(t[3]-t[1])<0.5)return[0,0,100,70];return t}getCam(e,t,n){let i=this.state,s=i?.syncZoom?this.sharedCam:this.layerCams.get(e)??null;if(s&&s.touched)return s;return ls(i?this.effectiveBbox(i.board):[0,0,100,70],t,n,14)}setCam(e,t){if(this.state?.syncZoom)this.sharedCam=t;else this.layerCams.set(e,t)}buildCard(e){let t=document.createElement("section");t.className="bp-plan-card",t.setAttribute("data-testid",`mgmt-plan-card-${e.layer}`);let n=document.createElement("div");n.className="bp-plan-card-head";let i=document.createElement("div");i.className="bp-plan-card-head-top";let s=document.createElement("span"),r=e.role==="power"||(e.items?.length??0)>0&&(e.items??[]).every((w)=>w.kind==="plane");s.className="bp-plan-card-bar "+(r?"pwr":"sig");let a=document.createElement("span");a.className="bp-plan-card-title";let o=document.createElement("span");o.className="bp-plan-status-badge";let c=document.createElement("button");c.type="button",c.className="bp-mgmt-btn bp-plan-mini-btn",c.textContent="✓",c.title=m("gpui.mgmt.plan.layer","Approve layer"),c.addEventListener("click",(w)=>{w.stopPropagation(),this.cb.onApproveLayer(e.layer,!0)});let p=document.createElement("button");p.type="button",p.className="bp-mgmt-btn bp-plan-mini-btn",p.textContent="✗",p.title=m("gpui.mgmt.plan.rejectlayer","Reject layer"),p.addEventListener("click",(w)=>{w.stopPropagation(),this.cb.onApproveLayer(e.layer,!1)}),i.append(s,a,o,c,p);let l=document.createElement("div");l.className="bp-plan-card-sub",n.append(i,l);let h=document.createElement("div");h.className="bp-plan-card-canvas-wrap";let d=document.createElement("canvas");d.className="bp-plan-card-canvas",d.setAttribute("data-testid",`mgmt-plan-canvas-${e.layer}`);let u=document.createElement("div");u.className="bp-plan-hover-hud bp-hidden",h.append(d,u);let f=document.createElement("div");f.className="bp-plan-legend bp-hidden",t.append(n,h,f);let b=d.getContext("2d"),v=new ResizeObserver(()=>this.scheduleDraw());v.observe(h),this.attachPointerListeners(d,e.layer);let y={layer:e.layer,el:t,canvas:d,ctx:b,legendEl:f,okBtn:c,noBtn:p,statusEl:o,titleEl:a,subtitleEl:l,hoverHudEl:u,ro:v};return this.syncCardHeaderAndLegend(y,e),y}syncCardHeaderAndLegend(e,t){e.titleEl.textContent=ut(t.layer,this.state?.copperLayers,this.state?.layers)||t.title||t.layer;let n=t.subtitle||t.stackup||"";e.subtitleEl.textContent=n,e.subtitleEl.classList.toggle("bp-hidden",!n);let i=t.items??[],s=ta(t);e.statusEl.className=`bp-plan-card-status tone-${s.tone==="warn"?"dim":s.tone}`,e.statusEl.textContent=i.length>0?m(s.key,s.label):"",e.statusEl.classList.toggle("bp-hidden",i.length===0);let r=i.some((o)=>o.state==="proposed"||o.state==="edited");if(e.okBtn)e.okBtn.classList.toggle("bp-hidden",!r);if(e.noBtn)e.noBtn.classList.toggle("bp-hidden",!r);let a=(this.state?.regions??[]).filter((o)=>o.layer===t.layer);if(a.length===0)e.legendEl.classList.add("bp-hidden"),e.legendEl.replaceChildren();else{e.legendEl.classList.remove("bp-hidden");let o=document.createDocumentFragment();for(let c of a){let p=document.createElement("button");p.type="button";let l=this.state?.selectedId===c.id;p.className="bp-plan-legend-chip"+(l?" active":"");let h=document.createElement("span");h.className="bp-plan-legend-sw",h.style.background=Ot(c.net||c.id,c.color||"");let d=document.createElement("span");d.textContent=c.net||c.id,p.append(h,d),p.addEventListener("click",()=>{this.cb.onSelect(c.id),this.cb.onFocusItem(c.id)}),o.appendChild(p)}e.legendEl.replaceChildren(o)}}attachPointerListeners(e,t){e.addEventListener("contextmenu",(i)=>i.preventDefault()),e.addEventListener("dblclick",()=>this.fitAll()),e.addEventListener("pointerdown",(i)=>{let s=this.state;if(!s)return;this.root.focus({preventScroll:!0});let r=e.getBoundingClientRect(),a=i.clientX-r.left,o=i.clientY-r.top,c=Math.max(1,r.width),p=Math.max(1,r.height),l=this.getCam(t,c,p),h=on(s.bands,s.regions,t,s.selectedId,l,c,p,a,o);if(i.button===2){if(h?.kind==="vertex"){let d=this.getItemPts(h.id,h.isPlane),u=In(d,h.idx,h.isPlane);if(u)this.selectedVertex=null,this.cb.onCommitFields(h.id,{[h.isPlane?"outline":"path"]:u})}return}if(i.button!==0)return;if(e.setPointerCapture(i.pointerId),this.downPos={x:i.clientX,y:i.clientY},h?.kind==="vertex"){let d=this.getItemPts(h.id,h.isPlane),u=d.map((f)=>[f[0],f[1]]);this.selectedVertex={id:h.id,idx:h.idx},this.drag={layer:t,kind:"vertex",id:h.id,isPlane:h.isPlane,idx:h.idx,pts:d.map((f)=>[f[0],f[1]]),origPts:u,moved:!1},this.scheduleDraw()}else if(h?.kind==="midpoint"){let d=this.getItemPts(h.id,h.isPlane),u=d.map((v)=>[v[0],v[1]]),f=ps(d,h.segIdx,h.pos,h.isPlane),b=h.isPlane&&h.segIdx+1>=d.length?f.length-1:Math.min(h.segIdx+1,f.length-1);this.selectedVertex={id:h.id,idx:b},this.patchLocalItem(h.id,h.isPlane,f),this.drag={layer:t,kind:"vertex",id:h.id,isPlane:h.isPlane,idx:b,pts:f,origPts:u,moved:!0},this.scheduleDraw()}else this.selectedVertex=null,this.drag={layer:t,kind:"pan",lastX:a,lastY:o}}),e.addEventListener("pointermove",(i)=>{let s=this.state;if(!s)return;let r=e.getBoundingClientRect(),a=i.clientX-r.left,o=i.clientY-r.top,c=Math.max(1,r.width),p=Math.max(1,r.height);if(this.drag&&this.drag.layer===t){if(this.drag.kind==="pan"){let L=this.getCam(t,c,p);this.setCam(t,cs(L,a-this.drag.lastX,o-this.drag.lastY)),this.drag.lastX=a,this.drag.lastY=o,this.scheduleDraw();return}if(this.downPos&&Math.hypot(i.clientX-this.downPos.x,i.clientY-this.downPos.y)<1.5&&!this.drag.moved)return;let b=this.getCam(t,c,p),[v,y]=an(b,a,o,c,p),w=[Math.round(v*1000)/1000,Math.round(y*1000)/1000];this.drag.moved=!0,this.drag.pts[this.drag.idx]=w;let C=this.drag.pts.map((L)=>[L[0],L[1]]);this.patchLocalItem(this.drag.id,this.drag.isPlane,C),this.scheduleDraw();return}let l=this.getCam(t,c,p),h=on(s.bands,s.regions,t,s.selectedId,l,c,p,a,o),d=this.hover?.hit?"id"in this.hover.hit?this.hover.hit.id:"":"",u=this.hover?.hit.kind??"",f=h?h.id:"";if(this.hover=h?{layer:t,hit:h}:null,e.style.cursor=h?"pointer":"crosshair",d!==f||(h?.kind??"")!==u)this.syncHoverHud(t),this.scheduleDraw()}),e.addEventListener("pointerleave",()=>{if(this.hover?.layer===t)this.hover=null,this.syncHoverHud(t),this.scheduleDraw()});let n=()=>{let i=this.drag;if(!i||i.layer!==t)return;if(this.drag=null,this.downPos=null,i.kind==="vertex"&&i.moved){let s=i.origPts.map((r)=>[r[0],r[1]]);this.patchLocalItem(i.id,i.isPlane,s)}this.cb.onDragEnd?.(),this.scheduleDraw()};e.addEventListener("pointercancel",n),e.addEventListener("lostpointercapture",n),e.addEventListener("pointerup",(i)=>{let s=this.state,r=this.drag,a=this.downPos;if(this.drag=null,this.downPos=null,e.hasPointerCapture(i.pointerId))e.releasePointerCapture(i.pointerId);if(r&&r.kind==="vertex"&&r.layer===t){if(r.moved)this.cb.onCommitFields(r.id,{[r.isPlane?"outline":"path"]:r.pts});else this.cb.onDragEnd?.(),this.scheduleDraw();return}if(s&&a&&Math.hypot(i.clientX-a.x,i.clientY-a.y)<4.5){let o=e.getBoundingClientRect(),c=i.clientX-o.left,p=i.clientY-o.top,l=Math.max(1,o.width),h=Math.max(1,o.height),d=this.getCam(t,l,h),u=on(s.bands,s.regions,t,s.selectedId,d,l,h,c,p);if(u&&(u.kind==="band"||u.kind==="region")){this.cb.onSelect(u.id),this.cb.onFocusItem(u.id);return}if(!u&&s.selectedId){this.cb.onSelect("");return}}this.cb.onDragEnd?.()}),e.addEventListener("wheel",(i)=>{i.preventDefault();let s=e.getBoundingClientRect(),r=i.clientX-s.left,a=i.clientY-s.top,o=Math.max(1,s.width),c=Math.max(1,s.height),p=this.getCam(t,o,c),l=Math.max(0.65,Math.min(1.55,1-i.deltaY*0.002));this.setCam(t,ds(p,l,r,a,o,c)),this.scheduleDraw()},{passive:!1})}patchLocalItem(e,t,n){let i=this.state;if(!i)return;if(t){let s=i.regions.find((r)=>r.id===e);if(s){if(s.outline=n,s.edited=!0,s.state==="proposed")s.state="edited"}}else{let s=i.bands.find((r)=>r.id===e);if(s){if(s.path=n,s.edited=!0,s.state==="proposed")s.state="edited"}}}getItemPts(e,t){let n=this.state;if(!n)return[];if(t)return(n.regions.find((i)=>i.id===e)?.outline??[]).map((i)=>[i[0],i[1]]);return(n.bands.find((i)=>i.id===e)?.path??[]).map((i)=>[i[0],i[1]])}syncHoverHud(e){let t=this.cards.get(e),n=this.state;if(!t||!n)return;if(!this.hover||this.hover.layer!==e){t.hoverHudEl.classList.add("bp-hidden"),t.hoverHudEl.textContent="";return}let i=this.hover.hit.id,s=n.bands.find((o)=>o.id===i),r=n.regions.find((o)=>o.id===i),a="";if(s)a=`${s.name||i} · ${s.nets??0}n · ${(s.width??1.5).toFixed(2)}mm`;else if(r)a=r.reference?`${r.net||i} · ${r.reference}`:r.net||i;if(!a)t.hoverHudEl.classList.add("bp-hidden");else t.hoverHudEl.classList.remove("bp-hidden"),t.hoverHudEl.textContent=a}onKeyDown(e){let t=this.state;if(!t)return;if(e.key==="0"||e.key==="Home"){e.preventDefault(),this.fitAll();return}if(e.key==="Escape"){this.selectedVertex=null,this.cb.onSelect("");return}if(!t.selectedId)return;let n=t.bands.find((a)=>a.id===t.selectedId),i=t.regions.find((a)=>a.id===t.selectedId),s=Boolean(n?.locked??i?.locked),r=e.key.toLowerCase();if(r==="a")e.preventDefault(),this.cb.onQuickApprove([t.selectedId],!0);else if(r==="r")e.preventDefault(),this.cb.onQuickApprove([t.selectedId],!1);else if(r==="l")e.preventDefault(),this.cb.onCommitFields(t.selectedId,{locked:!s});else if(r==="w"&&n&&!s){e.preventDefault();let a=e.shiftKey?-0.25:0.25,o=Math.round(Math.max(0.15,Math.min(25,(n.width??1.5)+a))*100)/100;this.cb.onCommitFields(t.selectedId,{width:o})}else if((e.key==="Delete"||e.key==="Backspace")&&!s&&this.selectedVertex?.id===t.selectedId){e.preventDefault();let a=Boolean(i),o=this.getItemPts(t.selectedId,a),c=In(o,this.selectedVertex.idx,a);if(c)this.selectedVertex=null,this.cb.onCommitFields(t.selectedId,{[a?"outline":"path"]:c})}}scheduleDraw(){if(this.rafPending)return;this.rafPending=requestAnimationFrame(()=>{this.rafPending=0,this.drawAll()})}drawAll(){let e=this.state;if(!e)return;let t=Math.max(0.45,Math.min(1.25,Math.abs(this.effectiveBbox(e.board)[3]-this.effectiveBbox(e.board)[1])/Math.max(1,Math.abs(this.effectiveBbox(e.board)[2]-this.effectiveBbox(e.board)[0]))));for(let n of this.cards.values()){let i=n.canvas.parentElement;if(!i)continue;let s=Math.max(120,Math.round(i.clientWidth)),r=Math.max(165,Math.min(250,Math.round(s*t)));n.canvas.style.height=`${r}px`;let a=Math.max(1,window.devicePixelRatio||1),o=Math.round(s*a),c=Math.round(r*a);if(n.canvas.width!==o||n.canvas.height!==c)n.canvas.width=o,n.canvas.height=c;n.ctx.setTransform(a,0,0,a,0,0),this.drawLayer(n.ctx,n.layer,s,r,e)}}drawLayer(e,t,n,i,s){let r=this.getCam(t,n,i),a=(b,v)=>qe(r,b,v,n,i);e.fillStyle=vs,e.fillRect(0,0,n,i);let o=(s.board.outline??[]).filter((b)=>b.length>=3);if(e.fillStyle=Kr,o.length>0){e.beginPath();for(let b of o){for(let v=0;vb.layer===t),p=this.hover?.layer===t?this.hover.hit:null;for(let b of c){let v=b.outline??[];if(v.length<3)continue;let y=s.selectedId===b.id,w=p?.id===b.id,C=ea(b.state||"proposed",y,w),L=Ot(b.net||b.id,b.color||"");e.beginPath();for(let A=0;AM)M=x;if(Y>j)j=Y}if(Math.abs(M-A)>=38&&Math.abs(j-B)>=18){let O=us(v,b.holes??[]);if(O){let[x,Y]=a(O[0],O[1]);e.fillStyle=mt(L,y?0.91:0.67),e.font="bold 10px ui-monospace, 'SFMono-Regular', Menlo, monospace",e.textAlign="center",e.textBaseline="middle",e.fillText(N,x,Y)}}}}if(e.strokeStyle=Jr,e.lineWidth=1.25,e.lineCap="round",e.lineJoin="round",o.length>0){e.beginPath();for(let b of o){for(let v=0;vb.layer===t),d=ms(h,r,n,i,s.selectedId,p?.id??""),u=d.map((b)=>[b.cx-b.pw*0.5-1,b.cy-b.ph*0.5-1,b.cx+b.pw*0.5+1,b.cy+b.ph*0.5+1]),f=[];for(let b of h){for(let v of b.from??[])f.push(v);for(let v of b.to??[])f.push(v)}e.fillStyle="rgba(143, 163, 155, 0.72)",e.font="9.5px ui-monospace, 'SFMono-Regular', Menlo, monospace",e.textAlign="center",e.textBaseline="middle";for(let b of bs(l,r,n,i,f,u))e.fillText(b.text,b.cx,b.cy);for(let b of h){let v=b.guides??[];if(v.length===0)continue;let y=s.selectedId===b.id||p?.id===b.id,w=xt(b.name||b.id,b.color||"");e.strokeStyle=mt(w,y?0.38:0.17),e.lineWidth=y?1:0.7,e.beginPath();for(let C of v){let[L,N]=a(C[0],C[1]),[A,B]=a(C[2],C[3]);e.moveTo(L,N),e.lineTo(A,B)}e.stroke()}for(let b of h){let v=b.path??[];if(v.length<2)continue;let y=s.selectedId===b.id,w=p?.id===b.id,C=Zr(b.state||"proposed",y,w),L=xt(b.name||b.id,b.color||""),N=Rn(b.width??1.5,r.scale),A=()=>{e.beginPath();for(let B=0;B{let w=y?v.length:Math.max(0,v.length-1);for(let C=0;Cn.id===e))return;if(this.openPanel!==e)this.togglePanel(e)}getTabs(){return nn(this.getStateInfo())}isOpen(){return this.openPanel!==""}closePanel(){if(!this.openPanel)return;if(this.openPanel="",this.project)this.cb.hub.rpc("mgmt.panel",{project:this.project,open:""}).catch(()=>{});this.render()}clear(){this.watchGen++,this.bomEditGen++,this.askedProject="",this.digest="",this.project="",this.openPanel="",this.errorMsg="",this.bomEditingId="",this.bomLastUndo=null,this.bomEditStatus="",this.checksStatus="",this.planStatus="",this.planSelectedId="",this.planStackupOpen=!1,this.planShownLayers=[],this.planOptimistic.clear(),this.planOptimisticRev=void 0,this.planHydratedKey="",this.planHydrateAskedKey="",this.planHydrateGen++,this.planHydratedRev=void 0,this.planRenderDeferred=!1,this.planHydratedBoard=null,this.planHydratedDraw=null,this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.planCanvas?.destroy(),this.planCanvas=null,this.planCommitFields=null,this.fabStatus="",this.render()}async watchProject(e){if(!e||!this.cb.hub.hasFeature("mgmt")){this.clear();return}if(e===this.askedProject&&this.digest){this.render();return}let t=++this.watchGen;if(this.askedProject=e,this.project!==e)this.bomEditGen++,this.digest="",this.project="",this.openPanel="",this.errorMsg="",this.bomSelectedId="",this.bomEditingId="",this.bomEditStatus="",this.bomLastUndo=null,this.checksSelectedId="",this.checksStatus="",this.planStatus="",this.planSelectedId="",this.planStackupOpen=!1,this.planShownLayers=[],this.planOptimistic.clear(),this.planOptimisticRev=void 0,this.planHydratedKey="",this.planHydrateAskedKey="",this.planHydrateGen++,this.planHydratedRev=void 0,this.planRenderDeferred=!1,this.planHydratedBoard=null,this.planHydratedDraw=null,this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.planCanvas?.destroy(),this.planCanvas=null,this.planCommitFields=null,this.fabStatus="",this.lifeSelectedKey="",this.lifePartSamples=null,this.render();try{let n=await this.cb.hub.rpc("mgmt.watch",{project:e});if(t!==this.watchGen)return;let i=typeof n.digest==="string"?n.digest:"";if(!i){this.render();return}if(this.digest=i,this.project=typeof n.project==="string"&&n.project?n.project:e,n.state&&typeof n.state==="object")this.infos.set(`mgmt.state.${i}`,n.state);if(n.data&&typeof n.data==="object"){for(let[s,r]of Object.entries(n.data))if(r&&typeof r==="object")this.infos.set(`mgmt.${s}.${i}`,r)}this.errorMsg="",this.render()}catch{if(t===this.watchGen)this.render()}}handleInfo(e){let t=!1;for(let[n,i]of Object.entries(e)){if(!n.startsWith("mgmt.")&&!n.startsWith("kicad.checks."))continue;if(i===""||i===null||i===void 0){if(this.infos.delete(n))t=!0;continue}if(typeof i==="string")try{let s=JSON.parse(i);if(s&&typeof s==="object")this.infos.set(n,s),t=!0}catch{}else if(typeof i==="object")this.infos.set(n,i),t=!0}if(t)this.render()}getStateInfo(){if(!this.digest)return null;return this.infos.get(`mgmt.state.${this.digest}`)??null}getPanelData(e){if(!this.digest)return null;return this.infos.get(`mgmt.${e}.${this.digest}`)??null}togglePanel(e){let t=this.openPanel===e?"":e;if(this.openPanel=t,this.errorMsg="",this.render(),this.project)this.cb.hub.rpc("mgmt.panel",{project:this.project,open:t}).catch((n)=>{this.errorMsg=n instanceof Error?n.message:"Could not update panel",this.render()})}render(){if(this.openPanel==="plan"&&this.planCanvas?.isDragging()){this.planRenderDeferred=!0;return}this.planRenderDeferred=!1;let e=this.getStateInfo(),t=nn(e);if(!this.digest||t.length===0){this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded"),this.stripEl.classList.add("bp-hidden"),this.panelEl.classList.add("bp-hidden"),this.panelEl.removeAttribute("data-testid"),this.panelEl.replaceChildren(),this.stripEl.replaceChildren(),this.cb.onOpenChange?.(!1);return}this.stripEl.classList.remove("bp-hidden");let n=document.createDocumentFragment(),i=document.createElement("div");i.className="bp-mgmt-tabs";for(let a of t){let o=document.createElement("button");o.type="button";let c=this.openPanel===a.id;o.className="bp-mgmt-tab"+(c?" active":""),o.setAttribute("data-testid",`mgmt-tab-${a.id}`),o.setAttribute("aria-pressed",c?"true":"false");let p=document.createElement("span");p.textContent=pe(a.label),o.appendChild(p);let l=this.getPanelData(a.id),h=Ji(l);if(h){let d=document.createElement("span");d.className=`bp-mgmt-badge bp-tone-${h.tone}`,d.textContent=h.text,o.appendChild(d)}o.addEventListener("click",()=>this.togglePanel(a.id)),i.appendChild(o)}if(n.appendChild(i),this.openPanel){let a=document.createElement("button");a.type="button",a.className="icon bp-mgmt-close",a.textContent="×",a.title=m("gpui.mgmt.close","Close the panel"),a.setAttribute("aria-label",m("gpui.mgmt.close","Close the panel")),a.setAttribute("data-testid","mgmt-close"),a.addEventListener("click",()=>this.closePanel()),n.appendChild(a)}if(this.stripEl.replaceChildren(n),!this.openPanel){this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded"),this.panelEl.classList.add("bp-hidden"),this.panelEl.removeAttribute("data-testid"),this.panelEl.replaceChildren(),this.cb.onOpenChange?.(!1);return}if(this.openPanel!=="plan")this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded");else this.panelEl.classList.toggle("bp-plan-expanded",this.planExpanded);this.panelEl.classList.remove("bp-hidden"),this.panelEl.setAttribute("data-testid",`mgmt-panel-${this.openPanel}`),this.cb.onOpenChange?.(!0);let s=this.openPanel==="plan"&&this.planCanvas!==null&&document.activeElement instanceof HTMLElement&&this.panelEl.contains(document.activeElement)&&(document.activeElement===this.planCanvas.root||this.planCanvas.root.contains(document.activeElement)),r=document.createDocumentFragment();if(this.errorMsg){let a=document.createElement("div");a.className="bp-mgmt-note bp-tone-bad",a.textContent=this.errorMsg,r.appendChild(a)}switch(this.openPanel){case"bom":r.appendChild(this.renderBom());break;case"checks":r.appendChild(this.renderChecks());break;case"life":r.appendChild(this.renderLife());break;case"plan":r.appendChild(this.renderPlan());break;case"fab":r.appendChild(this.renderFab());break}if(this.panelEl.replaceChildren(r),s)this.planCanvas?.root.focus({preventScroll:!0})}renderBom(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("bom");if(!t)return e.appendChild(this.makeEmpty("Reading the schematic…")),e;let n=Array.isArray(t.lines)?t.lines:[],i=document.createElement("div");i.className="bp-mgmt-head";let s=document.createElement("span");s.className="bp-dim",s.textContent=`${t.parts??0} parts · ${n.length} lines`;let r=document.createElement("span"),a=t.source==="kicad";if(r.className="bp-mgmt-pill"+(a?" accent":""),r.textContent=a?"live":"saved",i.append(s,r),(t.priced??0)>0&&(t.checking??0)===0&&typeof t.cost==="number"){let p=document.createElement("span");p.className="bp-dim",p.textContent=(t.priced??0)<(t.lookups??0)?`≥ ${Ct(t.cost)}/board`:`${Ct(t.cost)}/board`,i.appendChild(p)}if(t.paused){let p=document.createElement("span");p.className="bp-mgmt-faint",p.textContent="Stock check paused",i.appendChild(p)}if(e.appendChild(i),t.stock_note){let p=document.createElement("div");p.className="bp-mgmt-note bp-mgmt-faint",p.textContent=pe(t.stock_note),e.appendChild(p)}let o=this.bomEditingId?n.find((p)=>p.id===this.bomEditingId)??null:null;if(o)e.appendChild(this.renderBomEditor(o));else{let p=document.createElement("div");p.className="bp-mgmt-filter-row";let l=document.createElement("input");l.type="text",l.className="bp-mgmt-filter",l.placeholder="Filter BOM (ref, value, footprint, MPN, dnp)…",l.value=this.bomFilter,l.setAttribute("data-testid","mgmt-bom-filter"),l.addEventListener("input",()=>{this.bomFilter=l.value,this.renderBomRows(c,n)}),p.appendChild(l),e.appendChild(p)}let c=document.createElement("div");return c.className="bp-mgmt-rows",c.setAttribute("data-testid","mgmt-bom-rows"),this.renderBomRows(c,n),e.appendChild(c),e}renderBomRows(e,t){let n=Qi(t,this.bomFilter);if(n.length===0){e.replaceChildren(this.makeEmpty(t.length===0?"No parts found.":"No matching lines."));return}let i=t.some((r)=>Boolean(r.mpn)||Boolean(r.fab)),s=document.createDocumentFragment();for(let r of n){let a=Array.isArray(r.refs)?r.refs:[],o=document.createElement("div");o.className="bp-mgmt-row"+(this.bomSelectedId===r.id?" active":"")+(r.dnp?" faint":""),o.setAttribute("data-testid",`mgmt-bom-row-${r.id}`);let c=document.createElement("div");c.className="bp-mgmt-row-line";let p=document.createElement("span");if(p.className="bp-mgmt-strong bp-mgmt-flex1",p.textContent=sn(a,24),c.appendChild(p),r.dnp){let b=document.createElement("span");b.className="bp-mgmt-pill",b.textContent=m("gpui.mgmt.bom.dnp","DNP"),c.appendChild(b)}else{let b=Xi(r.stock);if(b){let v=document.createElement("span");v.className=`bp-tone-${b.tone}`,v.textContent=b.text,c.appendChild(v)}}let l=document.createElement("button");l.type="button",l.className="bp-mgmt-btn",l.textContent="Edit",l.addEventListener("click",(b)=>{b.stopPropagation(),this.bomEditGen++,this.bomEditingId=r.id,this.bomEditDraft=r.mpn??"",this.bomEditStatus="",this.bomLastUndo=null,this.render()}),c.appendChild(l);let h=document.createElement("div");h.className="bp-mgmt-row-sub";let d=[`${r.qty??a.length}×`,r.value??"",Yi(r.footprint??"")].filter(Boolean).join(" · "),u=document.createElement("span");u.className="bp-dim",u.textContent=d;let f=document.createElement("span");if(f.className="bp-mgmt-flex1",r.mpn)f.textContent=r.mpn;else if(i&&!r.dnp)f.className+=" bp-tone-warn",f.textContent=m("gpui.mgmt.bom.nompn","no MPN");if(h.append(u,f),!r.dnp&&typeof r.stock?.price==="number"){let b=document.createElement("span");b.className="bp-dim",b.textContent=Ct(r.stock.price),h.appendChild(b)}if(!r.dnp&&r.stock?.class){let b=document.createElement("span");b.className="bp-mgmt-faint",b.textContent=pe(r.stock.class),h.appendChild(b)}o.append(c,h),o.addEventListener("click",()=>{this.bomSelectedId=r.id,this.renderBomRows(e,t)}),s.appendChild(o)}e.replaceChildren(s)}renderBomEditor(e){let t=document.createElement("div");t.className="bp-mgmt-editor",t.setAttribute("data-testid","mgmt-bom-edit");let n=Array.isArray(e.refs)?e.refs:[],i=document.createElement("div");i.className="bp-mgmt-row-line";let s=document.createElement("span");s.className="bp-mgmt-strong",s.textContent=sn(n,30);let r=document.createElement("button");r.type="button",r.className="icon",r.textContent="×",r.addEventListener("click",()=>{this.bomEditGen++,this.bomEditingId="",this.bomLastUndo=null,this.bomEditStatus="",this.render()}),i.append(s,r);let a=document.createElement("input");a.type="text",a.className="bp-mgmt-filter",a.placeholder="MPN",a.value=this.bomEditDraft,a.addEventListener("input",()=>{this.bomEditDraft=a.value});let o=()=>({watchGen:this.watchGen,editGen:this.bomEditGen,project:this.project,editId:this.bomEditingId}),c=async(d,u=!1)=>{let f=o();this.bomEditStatus="Writing…",this.render();try{let b=await this.cb.hub.rpc("mgmt.bom.edit",d);if(!Tn(f,o()))return;this.bomLastUndo=!u&&(b.changed??0)>0?{project:d.project,editId:f.editId,refs:d.refs.slice(),field:d.field,was:typeof b.was==="string"?b.was:d.field==="mpn"?e.mpn??"":e.dnp?"yes":"no"}:null,this.bomEditStatus=u?"Restored":(b.changed??0)===0?"No change":b.via==="kicad"?"Updated in KiCad":"Saved to schematic"}catch(b){if(!Tn(f,o()))return;this.bomEditStatus=b instanceof Error?b.message:"Could not save edit"}this.render()},p=document.createElement("div");p.className="bp-mgmt-btn-row";let l=document.createElement("button");l.type="button",l.className="primary bp-mgmt-btn",l.textContent="Save MPN",l.addEventListener("click",()=>{c({project:this.project,refs:n.slice(),field:"mpn",value:this.bomEditDraft.trim()})});let h=document.createElement("button");if(h.type="button",h.className="bp-mgmt-btn",h.textContent=e.dnp?"Clear DNP":"Mark DNP",h.addEventListener("click",()=>{c({project:this.project,refs:n.slice(),field:"dnp",value:e.dnp?"no":"yes"})}),p.append(l,h),this.bomLastUndo&&this.bomLastUndo.project===this.project&&this.bomLastUndo.editId===this.bomEditingId){let d=this.bomLastUndo,u=document.createElement("button");u.type="button",u.className="bp-mgmt-btn",u.textContent="Undo",u.addEventListener("click",()=>{c(as(d),!0)}),p.appendChild(u)}if(t.append(i,a,p),this.bomEditStatus){let d=document.createElement("div");d.className="bp-mgmt-faint",d.textContent=this.bomEditStatus,t.appendChild(d)}return t}renderChecks(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("checks");if(!t)return e.appendChild(this.makeEmpty("Reading checks…")),e;let n=Array.isArray(t.groups)?t.groups:[],i=Array.from(new Set(n.map((d)=>d.source).filter(Boolean))),s=(d)=>t.sources?.[d]?.label||d.toUpperCase(),r=(d)=>t.sources?.[d]?.judged===!0,a=document.createElement("div");a.className="bp-mgmt-head bp-mgmt-scroll-x";let o=document.createElement("button");o.type="button",o.className="bp-mgmt-btn"+(this.checksSource===""?" active":""),o.textContent=m("gpui.mgmt.checks.all","All"),o.addEventListener("click",()=>{this.checksSource="",this.render()}),a.appendChild(o);for(let d of i){let u=document.createElement("button");u.type="button",u.className="bp-mgmt-btn"+(this.checksSource===d?" active":""),u.textContent=s(d)+(r(d)?" · judged":""),u.addEventListener("click",()=>{this.checksSource=this.checksSource===d?"":d,this.render()}),a.appendChild(u)}let c=document.createElement("span");c.className="bp-mgmt-flex1";let p=document.createElement("button");if(p.type="button",p.className="bp-mgmt-btn",p.textContent=m("gpui.mgmt.checks.run","Run"),p.addEventListener("click",()=>{let d=this.watchGen,u=this.project;this.checksStatus="Running checks…",this.render(),this.cb.hub.rpc("kicad.checks.run",{project:u}).then(()=>{if(d!==this.watchGen||u!==this.project)return;this.checksStatus="",this.render()}).catch((f)=>{if(d!==this.watchGen||u!==this.project)return;this.checksStatus=f instanceof Error?f.message:"Could not run checks",this.render()})}),a.append(c,p),e.appendChild(a),this.checksStatus){let d=document.createElement("div");d.className="bp-mgmt-note bp-dim",d.textContent=this.checksStatus,e.appendChild(d)}let l=document.createElement("div");l.className="bp-mgmt-rows",l.setAttribute("data-testid","mgmt-checks-rows");let h=Zi(n,this.checksSource);if(h.length===0)l.appendChild(this.makeEmpty("No check findings."));else for(let d of h){let u=d.severity==="error"?"bad":d.severity==="warning"?"warn":"faint",f=document.createElement("div");f.className="bp-mgmt-group-head";let b=document.createElement("span");b.className=`bp-mgmt-dot bp-tone-bg-${u}`;let v=document.createElement("span");v.className="bp-mgmt-flex1",v.textContent=`${s(d.source)} · ${d.rule}`;let y=document.createElement("span");y.className=`bp-tone-${u}`,y.textContent=String(d.n),f.append(b,v,y),l.appendChild(f);for(let w of d.rows??[]){let C=document.createElement("div");C.className="bp-mgmt-row"+(this.checksSelectedId===w.id?" active":"");let L=document.createElement("div");if(L.textContent=pe(w.title??""),C.appendChild(L),w.names||this.checksSelectedId===w.id){let N=document.createElement("div");N.className="bp-mgmt-row-sub";let A=document.createElement("span");if(A.className="bp-dim bp-mgmt-flex1",A.textContent=w.names??"",N.appendChild(A),this.checksSelectedId===w.id){let B=document.createElement("button");B.type="button",B.className="bp-mgmt-btn accent",B.textContent=m("gpui.mgmt.checks.fix","Fix with agent"),B.addEventListener("click",(M)=>{M.stopPropagation();let j={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};this.cb.hub.rpc("kicad.checks.fix",{project:j.project,id:w.id}).then((O)=>{let x={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};if(!Bn(j,x))return;if(O.text)this.cb.onSendText(O.text),this.checksStatus="Sent to agent",this.render()}).catch((O)=>{let x={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};if(!Bn(j,x))return;this.checksStatus=O instanceof Error?O.message:"Could not send finding",this.render()})}),N.appendChild(B)}C.appendChild(N)}C.addEventListener("click",()=>{this.checksSelectedId=w.id,this.cb.hub.rpc("kicad.checks.focus",{project:this.project,id:w.id}).catch(()=>{}),this.render()}),l.appendChild(C)}}return e.appendChild(l),e}renderLife(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("life");if(!t)return e.appendChild(this.makeEmpty("Reading lifecycle…")),e;let n=document.createElement("div");n.className="bp-mgmt-head";let i=t.counts??{};for(let c of["active","nrnd","eol"]){let p=i[c]??0,l=Mn(c),h=document.createElement("span");h.className=p>0?`bp-tone-${l.tone}`:"bp-mgmt-faint",h.textContent=`${l.label} ${p}`,n.appendChild(h)}if((i.unknown??0)>0){let c=document.createElement("span");c.className="bp-mgmt-faint",c.textContent=`${i.unknown} unknown`,n.appendChild(c)}if(t.since){let c=document.createElement("span");c.className="bp-mgmt-flex1";let p=document.createElement("span");p.className="bp-mgmt-faint",p.textContent=`since ${rn(t.since)} (${t.samples??0})`,n.append(c,p)}e.appendChild(n);let s=document.createElement("div");s.className="bp-mgmt-rows",s.setAttribute("data-testid","mgmt-life-rows");let r=t.bom?.cost??[],a=t.bom?.instock??[],o=t.bom?.lines??0;if(r.length===0)s.appendChild(this.makeEmpty(o===0?"No line has an MPN or fab part number to follow yet.":"No reading of the fab's stock yet: the BOM panel's lookups start it."));else{let c=r[r.length-1],p=a[a.length-1],l=document.createElement("div");l.className="bp-mgmt-note bp-dim",l.textContent=`Parts/board: ${Ct(c[1])} · ${Math.round(p?.[1]??0)}/${o} lines in stock (${rn(c[0])})`,s.appendChild(l)}for(let c of t.parts??[]){let p=this.lifeSelectedKey===c.key,l=Mn(c.lifecycle??"unknown"),h=document.createElement("div");h.className="bp-mgmt-row"+(p?" active":"");let d=document.createElement("div");d.className="bp-mgmt-row-line";let u=document.createElement("span");u.className="bp-mgmt-strong",u.textContent=sn(c.refs??[],14);let f=document.createElement("span");f.className="bp-mgmt-flex1 bp-dim",f.textContent=c.mpn||c.key;let b=document.createElement("span");if(b.className=`bp-tone-${l.tone}`,b.textContent=l.label,d.append(u,f,b),typeof c.stock==="number"){let v=document.createElement("span");v.className="bp-dim",v.textContent=kt(c.stock),d.appendChild(v)}if(h.appendChild(d),p){let v=document.createElement("div");if(v.className="bp-mgmt-row-sub bp-mgmt-faint",this.lifePartLoading)v.textContent=m("gpui.mgmt.life.reading","Reading its history…");else if(this.lifePartSamples&&this.lifePartSamples.length>0){let y=this.lifePartSamples[this.lifePartSamples.length-1];v.textContent=`${this.lifePartSamples.length} samples · latest ${y.at?rn(y.at):""}`+(typeof y.stock==="number"?` · stock ${kt(y.stock)}`:"")+(typeof y.price==="number"?` · ${Ct(y.price)}`:"")}else v.textContent=m("gpui.mgmt.life.nopart","No reading of this part yet.");h.appendChild(v)}h.addEventListener("click",()=>{if(this.lifeSelectedKey===c.key){this.lifeSelectedKey="",this.lifePartSamples=null,this.render();return}this.lifeSelectedKey=c.key,this.lifePartSamples=null,this.lifePartLoading=!0,this.render(),this.cb.hub.rpc("mgmt.life.part",{project:this.project,key:c.key}).then((v)=>{if(this.lifeSelectedKey!==c.key)return;this.lifePartLoading=!1,this.lifePartSamples=Array.isArray(v.samples)?v.samples:[],this.render()}).catch(()=>{if(this.lifeSelectedKey!==c.key)return;this.lifePartLoading=!1,this.lifePartSamples=[],this.render()})}),s.appendChild(h)}return e.appendChild(s),e}renderPlan(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("plan");if(!t)return e.appendChild(this.makeEmpty(m("gpui.mgmt.plan.reading","Reading the routing plan…"))),e;let n=(k,P)=>{let F=this.watchGen,I=this.project;this.planStatus="",this.cb.hub.rpc(k,{pro:I,...P}).catch((J)=>{if(F!==this.watchGen||I!==this.project)return;this.planOptimistic.clear(),this.planStatus=J instanceof Error?J.message:m("gpui.mgmt.plan.refused","KiCad refused"),this.render()})};if(t.revision!==this.planOptimisticRev)this.planOptimisticRev=t.revision,this.planOptimistic.clear();let i=`${this.project}:${t.revision??0}`;if(t.board_trimmed&&this.planHydrateAskedKey!==i&&this.project){this.planHydrateAskedKey=i;let k=this.watchGen,P=++this.planHydrateGen,F=this.project,I=t.revision??0;this.cb.hub.rpc("plan.get",{pro:F,board:!0}).then((J)=>{let ie=gs(J);if(!ie)return;let Ee=typeof ie.revision==="number"?ie.revision:I;if(!fs(k,this.watchGen,P,this.planHydrateGen,F,this.project,Ee,this.planHydratedRev))return;this.planHydratedRev=Ee,this.planHydratedKey=`${F}:${Ee}`,this.planHydratedBoard=ie.board??null,this.planHydratedDraw=ie.draw??null,this.render()}).catch(()=>{})}let s=t.on===!0,r=document.createElement("div");r.className="bp-plan-header";let a=document.createElement("div");a.className="bp-plan-toggle";let o=document.createElement("span");o.className="bp-mgmt-strong",o.textContent=m("gpui.mgmt.plan.before","Plan before routing"),o.title=s?m("gpui.mgmt.plan.onwords","Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve."):m("gpui.mgmt.plan.offwords","Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here."),a.appendChild(o);let c=t.awaiting??0,p=t.blocked??0,l=t.done??0,h=t.total??0,d=t.revision??0,u=t.empty?[]:is(t),f=u.reduce((k,P)=>k+P.count,0);if(!t.empty){let k=ns(t),P=document.createElement("span");if(P.className=`bp-plan-status-badge tone-${k.tone}`,P.textContent=m(k.key,k.label),a.appendChild(P),d>0){let I=document.createElement("span");I.className="bp-dim",I.textContent=`v${d}`,a.appendChild(I)}let F=document.createElement("span");if(F.className="bp-plan-header-counts bp-mgmt-flex1 "+(c>0?"bp-tone-warn":p>0?"bp-tone-bad":"bp-dim"),F.textContent=h>0?`${l}/${h} ${m("gpui.mgmt.plan.done","done")}`:c>0?m("web.plan.awaiting","{n} awaiting approval",{n:c}):m("gpui.mgmt.plan.nothing","Nothing awaits your approval"),a.appendChild(F),!t.live){let I=document.createElement("span");I.className="bp-mgmt-pill",I.textContent=m("gpui.mgmt.plan.saved","saved plan"),a.appendChild(I)}}else{let k=document.createElement("span");k.className="bp-mgmt-flex1",a.appendChild(k)}let b=document.createElement("button");b.type="button",b.className="bp-mgmt-btn bp-plan-chip-btn"+(s?" active":""),b.setAttribute("data-testid","mgmt-plan-on"),b.setAttribute("aria-pressed",s?"true":"false"),b.textContent=m("gpui.bots.recall.on","On"),b.addEventListener("click",()=>n("plan.enable",{on:!0}));let v=document.createElement("button");if(v.type="button",v.className="bp-mgmt-btn bp-plan-chip-btn"+(!s?" active":""),v.setAttribute("data-testid","mgmt-plan-off"),v.setAttribute("aria-pressed",!s?"true":"false"),v.textContent=m("gpui.bots.recall.off","Off"),v.addEventListener("click",()=>n("plan.enable",{on:!1})),a.append(b,v),r.appendChild(a),f>0){let k=document.createElement("div");k.className="bp-plan-segbar";for(let P of u){if(P.count<=0)continue;let F=document.createElement("div");F.className=`bp-plan-seg bp-tone-bg-${P.tone}`,F.style.flexGrow=String(P.count),k.appendChild(F)}r.appendChild(k)}e.appendChild(r);for(let k of t.elsewhere??[]){let P=document.createElement("div");P.className="bp-plan-elsewhere";let F=document.createElement("span");F.className="bp-tone-warn bp-mgmt-flex1",F.textContent=m("gpui.mgmt.plan.elsewhere","A routing plan for {board} awaits your approval",{board:k.name||k.rel||""}),P.appendChild(F),e.appendChild(P)}if(t.empty){let k=document.createElement("div");k.className="bp-mgmt-note";let P=document.createElement("div");P.className="bp-dim",P.textContent=m("gpui.mgmt.plan.noboard","No routing plan for this board.");let F=document.createElement("div");return F.className="bp-mgmt-faint",F.textContent=m("gpui.mgmt.plan.emptysub","Layers, corridors, and planes appear here once a plan is proposed."),k.append(P,F),e.appendChild(k),e}let y=t.stackup_summary??"",w=Array.isArray(t.impedances)?t.impedances:[],C=Boolean(y)||w.length>0,L=document.createElement("div");if(L.className="bp-mgmt-head",c>0){let k=document.createElement("button");k.type="button",k.className="primary bp-mgmt-btn",k.setAttribute("data-testid","mgmt-plan-approve-all"),k.textContent=m("gpui.mgmt.plan.all","Approve all"),k.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[],approve:!0})),L.appendChild(k)}if(t.routing){let k=document.createElement("button");k.type="button",k.className="bp-mgmt-btn",k.setAttribute("data-testid","mgmt-plan-stop"),k.textContent=m("gpui.mgmt.plan.stop","Stop routing"),k.addEventListener("click",()=>n("plan.stop",{})),L.appendChild(k)}if(t.live&&l>0){let k=document.createElement("button");k.type="button",k.className="bp-mgmt-btn",k.setAttribute("data-testid","mgmt-plan-verify"),k.textContent=m("gpui.mgmt.plan.verify","Verify"),k.addEventListener("click",()=>n("plan.verify",{})),L.appendChild(k)}let N=document.createElement("span");if(N.className="bp-mgmt-flex1",L.appendChild(N),C){let k=document.createElement("button");k.type="button",k.className="bp-mgmt-btn bp-plan-chip-btn"+(this.planStackupOpen?" active":""),k.setAttribute("data-testid","mgmt-plan-stackup-toggle"),k.setAttribute("aria-expanded",this.planStackupOpen?"true":"false"),k.textContent=`${m("gpui.mgmt.plan.stackup.short","Stackup")} ${this.planStackupOpen?"▾":"▸"}`,k.addEventListener("click",()=>{this.planStackupOpen=!this.planStackupOpen,this.render()}),L.appendChild(k)}let A=document.createElement("button");A.type="button",A.className="bp-mgmt-btn",A.setAttribute("data-testid","mgmt-plan-hide"),A.textContent=this.planHideDone?m("gpui.mgmt.plan.show","Show done"):m("gpui.mgmt.plan.hide","Hide done"),A.addEventListener("click",()=>{this.planHideDone=!this.planHideDone,this.render()}),L.appendChild(A),e.appendChild(L);let B=Array.isArray(t.asks)?t.asks:[];if(B.length>0){let k=B.map((ie)=>ie.what||"").filter(Boolean).join(", "),P=B[0]?.note||"",F=document.createElement("div");F.className="bp-plan-elsewhere";let I=document.createElement("div");I.className="bp-plan-ask-col";let J=document.createElement("div");if(J.className="bp-tone-warn",J.textContent=k?m("gpui.mgmt.plan.requested","Approval requested: {what}",{what:k}):m("gpui.mgmt.plan.reqplain","Approval requested"),I.appendChild(J),P){let ie=document.createElement("div");ie.className="bp-dim",ie.textContent=P,I.appendChild(ie)}F.appendChild(I),e.appendChild(F)}if(this.planStatus){let k=document.createElement("div");k.className="bp-mgmt-note bp-plan-err bp-tone-bad";let P=document.createElement("span");P.className="bp-mgmt-flex1",P.textContent=this.planStatus==="KiCad refused"?m("gpui.mgmt.plan.refused","KiCad refused"):pe(this.planStatus);let F=document.createElement("button");F.type="button",F.className="icon",F.textContent="×",F.title=m("common.close","Close"),F.addEventListener("click",()=>{this.planStatus="",this.render()}),k.append(P,F),e.appendChild(k)}if(t.keys_note){let k=document.createElement("div");k.className="bp-mgmt-note bp-dim";let P="On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.";k.textContent=t.keys_note===P?m("gpui.mgmt.plan.keysnote",P):pe(t.keys_note),e.appendChild(k)}if(C&&this.planStackupOpen){let k=document.createElement("div");if(k.className="bp-plan-stackup-body",k.setAttribute("data-testid","mgmt-plan-stackup-body"),y){let P=document.createElement("div");P.className="bp-dim",P.textContent=y,k.appendChild(P)}for(let P of w){let F=document.createElement("div");F.className="bp-mgmt-faint",F.textContent=`· ${P}`,k.appendChild(F)}e.appendChild(k)}let M=(k,P,F,I)=>{let J=document.createElement("button");return J.type="button",J.className="bp-mgmt-btn bp-plan-chip-btn"+(P?" active":""),J.setAttribute("data-testid",F),J.setAttribute("aria-pressed",P?"true":"false"),J.textContent=k,J.addEventListener("click",I),J},j=document.createElement("div");if(j.className="bp-plan-viewbar",j.append(M(m("gpui.mgmt.plan.view.canvas","Canvas"),this.planViewMode==="canvas","mgmt-plan-view-canvas",()=>{this.planViewMode="canvas",this.render()}),M(m("gpui.mgmt.plan.view.split","Split"),this.planViewMode==="split","mgmt-plan-view-split",()=>{this.planViewMode="split",this.render()}),M(m("gpui.mgmt.plan.view.list","List"),this.planViewMode==="list","mgmt-plan-view-list",()=>{this.planViewMode="list",this.render()})),this.planViewMode!=="list"){let k=document.createElement("span");k.className="bp-plan-sep";let P=document.createElement("span");P.className="bp-plan-sep";let F=document.createElement("button");F.type="button",F.className="bp-mgmt-btn bp-plan-mini-btn",F.setAttribute("data-testid","mgmt-plan-fit"),F.textContent=m("gpui.mgmt.plan.fit","Fit"),F.addEventListener("click",()=>this.planCanvas?.fitAll()),j.append(k,M(m("gpui.mgmt.plan.grid.pair","Side by side"),this.planGridMode==="pair","mgmt-plan-grid-pair",()=>{this.planGridMode="pair",this.render()}),M(m("gpui.mgmt.plan.grid.all","All layers"),this.planGridMode==="all","mgmt-plan-grid-all",()=>{this.planGridMode="all",this.render()}),M(m("gpui.mgmt.plan.grid.single","Single"),this.planGridMode==="single","mgmt-plan-grid-single",()=>{this.planGridMode="single",this.render()}),P,M(m("gpui.mgmt.plan.sync","Link zoom"),this.planSyncZoom,"mgmt-plan-sync",()=>{this.planSyncZoom=!this.planSyncZoom,this.render()}),F)}let O=document.createElement("span");O.className="bp-mgmt-flex1";let x=document.createElement("button");x.type="button",x.className="bp-mgmt-btn bp-plan-mini-btn",x.setAttribute("data-testid","mgmt-plan-expand"),x.textContent=this.planExpanded?m("gpui.mgmt.plan.compact","Compact"):m("gpui.mgmt.plan.expand","Expand"),x.addEventListener("click",()=>{this.planExpanded=!this.planExpanded,this.render()}),j.append(O,x),e.appendChild(j);let Y=Boolean(this.planHydratedBoard)&&this.planHydratedKey.startsWith(`${this.project}:`)&&(this.planHydratedKey===i||this.planHydratedRev!==void 0&&this.planHydratedRev>=(t.revision??0)),se=Y&&this.planHydratedBoard?this.planHydratedBoard:t.board??{bbox:[0,0,100,70],outline:[],parts:[]},ne=Y&&this.planHydratedDraw?this.planHydratedDraw:t.draw??{bands:[],regions:[]},he=(ne.bands??[]).map((k)=>{let P=this.planOptimistic.get(k.id);if(!P)return{...k};return{...k,...P,edited:!0,state:k.state==="proposed"?"edited":k.state}}),Se=(ne.regions??[]).map((k)=>{let P=this.planOptimistic.get(k.id);if(!P)return{...k};return{...k,...P,edited:!0,state:k.state==="proposed"?"edited":k.state}}),ke=[],ee=(t.layers??[]).map((k)=>{let P=[];for(let F of k.items??[]){let I=this.planOptimistic.get(F.id);if(!I){P.push(F);continue}let J={...F,width:typeof I.width==="number"?I.width:F.width,locked:typeof I.locked==="boolean"?I.locked:F.locked,edited:!0,state:F.state==="proposed"?"edited":F.state};if(typeof I.layer==="string"&&I.layer!==k.layer)ke.push({target:I.layer,item:J});else P.push(J)}return{...k,items:P}});for(let k of ke){let P=ee.find((F)=>F.layer===k.target);if(P)P.items=[...P.items??[],k.item]}let re=ln(ee,t.copper_layers),R=this.planGridMode==="all"?re.map((k)=>k.layer):this.planGridMode==="single"?[this.planShownLayers.find((k)=>re.some((P)=>P.layer===k))??Pt(re)[0]??re[0]?.layer??""].filter(Boolean):this.planShownLayers.length>0&&this.planShownLayers.every((k)=>re.some((P)=>P.layer===k))?this.planShownLayers.slice(0,2):Pt(re);if(this.planViewMode!=="list"&&this.planGridMode!=="all"&&re.length>1){let k=document.createElement("div");k.className="bp-plan-layerbar";for(let P of re){let F=R.includes(P.layer),I=(P.items??[]).length,J=ut(P.layer,t.copper_layers,re)||P.title||P.layer,ie=I>0?`${J} · ${I}`:J,Ee=M(ie,F,`mgmt-plan-layerpill-${P.layer}`,()=>{if(this.planGridMode==="single")this.planShownLayers=[P.layer];else if(this.planGridMode==="pair"){if(!R.includes(P.layer))this.planShownLayers=R.length>=2?[R[0],P.layer]:[...R,P.layer]}else this.planGridMode="single",this.planShownLayers=[P.layer];this.render()});if(I===0&&!F)Ee.classList.add("empty-layer");k.appendChild(Ee)}e.appendChild(k)}let ue=(k,P)=>{let F=this.planOptimistic.get(k)??{};if(this.planOptimistic.set(k,{...F,...P}),typeof P.layer==="string"){if(this.planGridMode==="single")this.planShownLayers=[P.layer];else if(this.planGridMode==="pair"&&!R.includes(P.layer))this.planShownLayers=R.length>=2?[R[0],P.layer]:[...R,P.layer]}let I=typeof t.revision==="number"?t.revision:void 0;this.render(),n("plan.update",{ops:[{op:"set",id:k,fields:P}],...I!==void 0?{base:I}:{}})};if(this.planCommitFields=ue,this.planSelectedId){let k="",P=null;for(let F of ee){let I=(F.items??[]).find((J)=>J.id===this.planSelectedId);if(I){k=F.layer,P=I;break}}if(P){let F=ut(k,t.copper_layers,re),I=document.createElement("div");I.className="bp-plan-inspector",I.setAttribute("data-testid","mgmt-plan-inspector");let J=document.createElement("div");J.className="bp-plan-ins-row";let ie=document.createElement("span");ie.className="bp-plan-ins-sw",ie.style.background=P.kind==="corridor"?xt(P.name||P.id,P.color||""):Ot(P.name||P.id,P.color||"");let Ee=document.createElement("span");Ee.className="bp-mgmt-strong",Ee.textContent=P.name||P.id;let D=document.createElement("span");if(D.className="bp-dim",D.textContent=F,J.append(ie,Ee,D),P.edited||P.state==="edited"){let q=document.createElement("span");q.className="bp-plan-ins-pill warn",q.textContent=m("gpui.mgmt.plan.edited","Edited"),J.appendChild(q)}if(P.locked){let q=document.createElement("span");q.className="bp-plan-ins-pill",q.textContent=m("gpui.mgmt.plan.locked","Locked"),J.appendChild(q)}let te=document.createElement("span");te.className="bp-mgmt-flex1",J.appendChild(te);let Me=document.createElement("button");if(Me.type="button",Me.className="bp-mgmt-btn bp-plan-mini-btn",Me.setAttribute("data-testid","mgmt-plan-lock"),Me.textContent=P.locked?m("gpui.mgmt.plan.unlock","Unlock"):m("gpui.mgmt.plan.lock","Lock"),Me.addEventListener("click",()=>ue(P.id,{locked:!P.locked})),J.appendChild(Me),P.state==="proposed"||P.state==="edited"){let q=document.createElement("button");q.type="button",q.className="primary bp-mgmt-btn bp-plan-mini-btn",q.textContent=m("android.hub.machines.approve","Approve"),q.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[P.id],approve:!0}));let fe=document.createElement("button");fe.type="button",fe.className="bp-mgmt-btn bp-plan-mini-btn",fe.textContent=m("gpui.mgmt.plan.reject","Reject"),fe.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[P.id],approve:!1})),J.append(q,fe)}let Ae=document.createElement("button");Ae.type="button",Ae.className="bp-mgmt-btn bp-plan-mini-btn",Ae.setAttribute("data-testid","mgmt-plan-note-toggle"),Ae.textContent=m("gpui.mgmt.plan.addnote","Add note"),Ae.addEventListener("click",()=>{this.planNoteOpen=!this.planNoteOpen,this.render()});let Te=document.createElement("button");if(Te.type="button",Te.className="icon",Te.textContent="×",Te.addEventListener("click",()=>{this.planSelectedId="",this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.render()}),J.append(Ae,Te),I.appendChild(J),!P.locked){let q=document.createElement("div");if(q.className="bp-plan-ins-row",P.kind==="corridor"){let oe=typeof P.width==="number"?P.width:1.5,He=document.createElement("span");He.className="bp-dim",He.textContent=m("gpui.mgmt.plan.width","Width");let De=document.createElement("button");De.type="button",De.className="bp-mgmt-btn bp-plan-mini-btn",De.setAttribute("data-testid","mgmt-plan-w-down"),De.textContent="-",De.addEventListener("click",()=>{let _e=Math.round(Math.max(0.15,oe-0.25)*100)/100;ue(P.id,{width:_e})});let Fe=document.createElement("span");Fe.className="bp-plan-ins-val",Fe.textContent=`${oe.toFixed(2)}mm`;let Be=document.createElement("button");Be.type="button",Be.className="bp-mgmt-btn bp-plan-mini-btn",Be.setAttribute("data-testid","mgmt-plan-w-up"),Be.textContent="+",Be.addEventListener("click",()=>{let _e=Math.round(Math.min(25,oe+0.25)*100)/100;ue(P.id,{width:_e})});let Ge=document.createElement("span");Ge.className="bp-plan-sep",q.append(He,De,Fe,Be,Ge)}let fe=(t.copper_layers??[]).length>0?(t.copper_layers??[]).map((oe)=>oe.layer):ee.map((oe)=>oe.layer);if(fe.length>0){let oe=document.createElement("span");oe.className="bp-dim",oe.textContent=m("gpui.mgmt.plan.layer.short","Layer"),q.appendChild(oe),q.appendChild(M(`${F} ${this.planMoveLayerOpen?"▴":"▾"}`,this.planMoveLayerOpen,"mgmt-plan-move-toggle",()=>{this.planMoveLayerOpen=!this.planMoveLayerOpen,this.render()}))}if(I.appendChild(q),this.planMoveLayerOpen&&fe.length>0){let oe=document.createElement("div");oe.className="bp-plan-ins-row";for(let He of fe){let De=ut(He,t.copper_layers,re);oe.appendChild(M(De,He===k,`mgmt-plan-move-${He}`,()=>{if(this.planMoveLayerOpen=!1,He!==k)ue(P.id,{layer:He});else this.render()}))}I.appendChild(oe)}}if(this.planNoteOpen){let q=document.createElement("form");q.className="bp-plan-note-form";let fe=document.createElement("input");fe.type="text",fe.className="bp-plan-note-input",fe.setAttribute("data-testid","mgmt-plan-note-input"),fe.placeholder=m("gpui.mgmt.plan.note.placeholder","Steering note for router…");let oe=document.createElement("button");oe.type="submit",oe.className="primary bp-mgmt-btn bp-plan-mini-btn",oe.setAttribute("data-testid","mgmt-plan-note-submit"),oe.textContent=m("gpui.mgmt.plan.addnote","Add note"),q.append(fe,oe),q.addEventListener("submit",(He)=>{He.preventDefault();let De=fe.value.trim();if(!De)return;fe.value="",this.planNoteOpen=!1;let Fe=typeof t.revision==="number"?t.revision:void 0;this.render(),n("plan.update",{ops:[{op:"note",target:P.id,text:De}],...Fe!==void 0?{base:Fe}:{}})}),I.appendChild(q)}if(this.planViewMode!=="list"&&!P.locked){let q=document.createElement("div");q.className="bp-plan-hint",q.textContent=m("gpui.mgmt.plan.hint","Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove"),I.appendChild(q)}e.appendChild(I)}}let le=document.createElement("div");le.className="bp-mgmt-rows"+(this.planViewMode==="split"?" bp-plan-split-list":""),le.setAttribute("data-testid","mgmt-plan-rows");let Q=m("gpui.mgmt.plan.done","done"),ge=hs(this.planViewMode,ee,R);if(this.planViewMode==="split"&&ge.length===0){let k=document.createElement("div");k.className="bp-dim",k.style.padding="6px 8px",k.style.fontSize="11px",k.textContent=m("gpui.mgmt.plan.noitems","No corridors or planes on this layer"),le.appendChild(k)}for(let k of ge){let P=k.items??[],F=ut(k.layer,t.copper_layers,re)||k.layer;if(this.planViewMode==="split"){if(ge.length>1){let I=document.createElement("div");I.className="bp-plan-split-divider";let J=k.role==="power"||k.role==="plane",ie=document.createElement("span");ie.className="bp-plan-card-bar "+(J?"pwr":"sig");let Ee=document.createElement("span");Ee.className="bp-mgmt-strong",Ee.textContent=F;let D=document.createElement("span");D.className="bp-dim",D.textContent=`${k.done??0}/${P.length} ${Q}`,I.append(ie,Ee,D),le.appendChild(I)}}else{let I=document.createElement("div");I.className="bp-mgmt-group-head bp-plan-layer-head";let J=document.createElement("div");J.className="bp-mgmt-row-line";let ie=document.createElement("span");ie.className="bp-mgmt-strong",ie.textContent=F;let Ee=document.createElement("span");if(Ee.className="bp-dim bp-mgmt-flex1",Ee.textContent=`${k.role?`${k.role} · `:""}${k.done??0}/${P.length} ${Q}`,J.append(ie,Ee),k.status!=="approved"&&P.length>0){let D=document.createElement("button");D.type="button",D.className="bp-mgmt-btn",D.textContent=m("gpui.mgmt.plan.layer","Approve layer"),D.addEventListener("click",()=>n("plan.approve",{layer:k.layer,ids:[],approve:!0}));let te=document.createElement("button");te.type="button",te.className="bp-mgmt-btn",te.textContent=m("gpui.mgmt.plan.reject","Reject"),te.addEventListener("click",()=>n("plan.approve",{layer:k.layer,ids:[],approve:!1})),J.append(D,te)}if(I.appendChild(J),k.stackup){let D=document.createElement("div");D.className="bp-plan-layer-stackup",D.textContent=k.stackup,I.appendChild(D)}le.appendChild(I)}for(let I of P){if(this.planHideDone&&es(I))continue;let J=this.planSelectedId===I.id,ie=document.createElement("div");ie.className="bp-mgmt-row bp-plan-row"+(J?" active":""),ie.setAttribute("data-testid",`mgmt-plan-row-${I.id}`);let Ee=document.createElement("div");Ee.className="bp-mgmt-row-line";let D=document.createElement("span");D.className=`bp-plan-swatch bp-plan-st-${I.state||"proposed"}`,D.style.setProperty("--swatch-color",I.color||"#8a8a8a");let te=document.createElement("span");te.className="bp-mgmt-flex1"+(I.state==="blocked"||I.state==="failed"?" bp-tone-bad":I.state==="edited"?" bp-tone-warn":I.state==="rejected"||I.state==="routed"||I.state==="verified"?" bp-dim":""),te.textContent=`${I.name||I.id}${I.locked?" \uD83D\uDD12":""}`;let Me=[];if(I.kind==="plane"){if(I.reference)Me.push(m("gpui.mgmt.plan.reference","over {layer}",{layer:I.reference}))}else{let q=I.nets??0;Me.push(q===1?m("web.plan.net.one","1 net"):m("web.plan.nets","{n} nets",{n:q}))}if(typeof I.width==="number"&&Number.isFinite(I.width))Me.push(`${I.width.toFixed(2)}mm`);if(I.impedance)Me.push(I.impedance);let Ae=Me.join(" · "),Te=document.createElement("span");if(Te.className="bp-plan-mark "+(I.state==="blocked"||I.state==="failed"?"bp-tone-bad":I.state==="verified"||I.state==="routed"?"bp-tone-ok":I.state==="approved"?"bp-tone-accent":"bp-dim"),Te.textContent=ts(I),Ee.append(D,te,Te),I.state==="proposed"||I.state==="edited"){let q=document.createElement("button");q.type="button",q.className="bp-mgmt-btn",q.textContent="✓",q.title=m("gpui.mgmt.plan.layer","Approve layer"),q.addEventListener("click",(oe)=>{oe.stopPropagation(),n("plan.approve",{layer:"",ids:[I.id],approve:!0})});let fe=document.createElement("button");fe.type="button",fe.className="bp-mgmt-btn",fe.textContent="✗",fe.title=m("gpui.mgmt.plan.reject","Reject"),fe.addEventListener("click",(oe)=>{oe.stopPropagation(),n("plan.approve",{layer:"",ids:[I.id],approve:!1})}),Ee.append(q,fe)}if(ie.appendChild(Ee),Ae){let q=document.createElement("div");q.className="bp-mgmt-row-sub bp-plan-detail bp-dim",q.textContent=Ae,ie.appendChild(q)}if(I.state==="routing"&&typeof I.total==="number"&&I.total>0){let q=document.createElement("div");q.className="bp-plan-microbar";let fe=document.createElement("div");fe.className="bp-plan-microbar-fill";let oe=Math.max(0,Math.min(100,Math.round((I.routed??0)/I.total*100)));fe.style.width=`${oe}%`,q.appendChild(fe),ie.appendChild(q)}if(I.problem_text){let q=document.createElement("div");q.className="bp-plan-problem",q.textContent=I.problem_text,ie.appendChild(q)}ie.addEventListener("click",()=>{this.planSelectedId=I.id,n("plan.focus",{id:I.id}),this.render()}),le.appendChild(ie)}}if(this.planViewMode!=="list"){if(!this.planCanvas)this.planCanvas=new jn({onSelect:(I)=>{if(this.planSelectedId=I,!I)this.planNoteOpen=!1;this.render()},onFocusItem:(I)=>{n("plan.focus",{id:I})},onDragEnd:()=>{if(this.planRenderDeferred)this.planRenderDeferred=!1,this.render()},onCommitFields:(I,J)=>{(this.planCommitFields??ue)(I,J)},onApproveLayer:(I,J)=>{n("plan.approve",{layer:I,ids:[],approve:J})},onQuickApprove:(I,J)=>{n("plan.approve",{layer:"",ids:I,approve:J})}});let k=this.panelEl.parentElement?.classList.contains("bp-has-viewer")===!1,P=this.planExpanded||this.panelEl.clientWidth>=540||k;this.planCanvas.update({gridMode:this.planGridMode,syncZoom:this.planSyncZoom,shownLayers:R,selectedId:this.planSelectedId,board:se,bands:he,regions:Se,layers:re,copperLayers:t.copper_layers},P);let F=document.createElement("div");F.className="bp-plan-canvas-scroll",F.appendChild(this.planCanvas.root),e.appendChild(F)}if(this.planViewMode!=="canvas")e.appendChild(le);if((t.draw?.bands?.length??0)>0||(t.draw?.regions?.length??0)>0){let k=document.createElement("div");k.className="bp-plan-footer",k.textContent=m("gpui.mgmt.plan.drawn","The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them."),e.appendChild(k)}return e}renderFab(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("fab");if(!t)return e.appendChild(this.makeEmpty("Reading the fab's profile…")),e;if(t.error){let w=document.createElement("div");return w.className="bp-mgmt-note bp-tone-warn",w.textContent=t.error,e.appendChild(w),e}let n=(w,C={})=>{let L=this.watchGen,N=this.project;this.fabStatus="",this.cb.hub.rpc("fab.profile",{pro:N,action:w,...C}).catch((A)=>{if(L!==this.watchGen||N!==this.project)return;this.fabStatus=A instanceof Error?A.message:"Fab action failed",this.render()})},i=document.createElement("div");i.className="bp-mgmt-head";let s=document.createElement("span");s.className="bp-mgmt-strong",s.textContent=m("gpui.mgmt.fab.thefab","The fab");let r=document.createElement("span");r.className="bp-dim bp-mgmt-flex1",r.textContent=`rev ${t.rev??0}${t.updated?` · ${t.updated}`:""}${t.board?` · ${t.board}`:""} · ${rs(t.tier??"")}`;let a=document.createElement("button");if(a.type="button",a.className="bp-mgmt-btn",a.textContent=m("gpui.mgmt.fab.refresh","Refresh"),a.addEventListener("click",()=>n("refresh")),i.append(s,r,a),e.appendChild(i),this.fabStatus){let w=document.createElement("div");w.className="bp-mgmt-note bp-tone-bad",w.textContent=this.fabStatus,e.appendChild(w)}let o=document.createElement("div");o.className="bp-mgmt-rows",o.setAttribute("data-testid","mgmt-fab-rows");let c=t.review,p=document.createElement("div");p.className="bp-mgmt-row";let l=document.createElement("div");l.className="bp-mgmt-row-line";let h=document.createElement("span"),d=(c?.counts?.error??0)>0;if(h.className="bp-mgmt-flex1 "+(d?"bp-tone-bad":"bp-dim"),h.textContent=c?.running?"Reviewing the design…":c?.at==null?"No design review yet":`${c.counts?.error??0} must-fix · ${c.counts?.warning??0} should-fix · ${c.counts?.info??0} notes${c.scope?` (${c.scope})`:""}`,l.appendChild(h),c?.at!=null){let w=document.createElement("button");w.type="button",w.className="bp-mgmt-btn",w.textContent=m("gpui.mgmt.fab.findings","Findings"),w.addEventListener("click",()=>this.togglePanel("checks")),l.appendChild(w)}if(!c?.running){let w=document.createElement("button");w.type="button",w.className="bp-mgmt-btn",w.textContent=m("gpui.mgmt.fab.reviewbtn","Review"),w.addEventListener("click",()=>n("review")),l.appendChild(w)}if(c?.judge){let w=document.createElement("button");w.type="button",w.className="bp-mgmt-btn",w.textContent=m("gpui.mgmt.fab.judge","Datasheets"),w.addEventListener("click",()=>{if(c.judge)this.cb.onSendText(c.judge)}),l.appendChild(w)}p.appendChild(l),o.appendChild(p);let u=ss(t.drc?.state??""),f=document.createElement("div");f.className="bp-mgmt-row";let b=document.createElement("div");b.className="bp-mgmt-row-line";let v=document.createElement("span");if(v.className="bp-mgmt-flex1 "+(u.button?"bp-tone-warn":"bp-dim"),v.textContent=u.text,b.appendChild(v),u.button){let w=document.createElement("button");w.type="button",w.className="bp-mgmt-btn",w.textContent=u.button,w.addEventListener("click",()=>n("drc")),b.appendChild(w)}f.appendChild(b),o.appendChild(f);for(let w of t.conflicts??[]){let C=document.createElement("div");C.className="bp-mgmt-row bp-tone-bad",C.textContent=w,o.appendChild(C)}for(let w of t.suggestions??[]){let C=document.createElement("div");C.className="bp-mgmt-row";let L=document.createElement("div");L.className="bp-mgmt-row-line";let N=document.createElement("span");N.className="bp-mgmt-flex1 bp-tone-warn",N.textContent=`${w.label||w.key}: board ${w.project??"?"} mm, fab ${w.fab??"?"} mm`;let A=document.createElement("button");A.type="button",A.className="bp-mgmt-btn",A.textContent=m("gpui.mgmt.fab.apply","Apply"),A.addEventListener("click",()=>n("apply",{key:w.key})),L.append(N,A),C.appendChild(L),o.appendChild(C)}if(t.stackup?.chosen){let w=document.createElement("div");w.className="bp-mgmt-row";let C=document.createElement("div");C.className="bp-mgmt-row-line";let L=t.stackup.by==="proposed",N=document.createElement("span");if(N.className="bp-mgmt-flex1 "+(L?"bp-tone-warn":"bp-dim"),N.textContent=`${L?"Proposed: ":""}${t.stackup.chosen}${t.stackup.outer_50_mm?` (50Ω ${t.stackup.outer_50_mm} mm)`:""}`,C.appendChild(N),L){let A=t.stackup.chosen,B=document.createElement("button");B.type="button",B.className="bp-mgmt-btn",B.textContent=m("gpui.mgmt.fab.use","Use"),B.addEventListener("click",()=>n("stackup",{id:A})),C.appendChild(B)}w.appendChild(C),o.appendChild(w)}if(Array.isArray(t.changed)&&t.changed.length>0){let w=document.createElement("div");w.className="bp-mgmt-row";let C=document.createElement("div");C.className="bp-mgmt-row-line";let L=document.createElement("span");L.className="bp-mgmt-flex1 bp-tone-warn",L.textContent=m("gpui.mgmt.fab.changed","Changed since you last looked");let N=document.createElement("button");N.type="button",N.className="bp-mgmt-btn",N.textContent=m("gpui.mgmt.fab.seen","Seen"),N.addEventListener("click",()=>n("seen")),C.append(L,N),w.appendChild(C);for(let A of t.changed.slice(0,12)){let B=document.createElement("div");B.className="bp-mgmt-faint",B.textContent=A,w.appendChild(B)}o.appendChild(w)}let y=Array.isArray(t.limits)?t.limits:[];if(y.length>0){let w=document.createElement("div");w.className="bp-mgmt-group-head";let C=document.createElement("span");C.className="bp-mgmt-flex1",C.textContent=m("gpui.mgmt.fab.limit","Limit");let L=document.createElement("span");L.className="bp-mgmt-col",L.textContent=m("gpui.mgmt.fab.free","Base price");let N=document.createElement("span");N.className="bp-mgmt-col",N.textContent=m("gpui.mgmt.fab.extra","Costs more");let A=document.createElement("span");A.className="bp-mgmt-col bp-mgmt-col-read",A.textContent=m("gpui.mgmt.fab.readcol","Read"),w.append(C,L,N,A),o.appendChild(w);for(let M of y){let j=document.createElement("div");j.className="bp-mgmt-row";let O=document.createElement("div");O.className="bp-mgmt-row-line";let x=document.createElement("span");x.className="bp-mgmt-flex1"+(M.changed?" bp-tone-warn":M.inherited?" bp-dim":""),x.textContent=`${M.changed?"• ":""}${M.label??""}`;let Y=document.createElement("span");Y.className="bp-mgmt-col",Y.textContent=M.free?.text||"—";let se=document.createElement("span");se.className="bp-mgmt-col bp-dim",se.textContent=M.extra?.text||"—";let ne=M.free&&typeof M.free==="object"?M.free:M.extra,he=ne?.fetched??"",Se=Boolean(he)&&ne?.confidence!=="published",ke=he?Se?`${he}*`:he:"—",ee=ne?.source??"",re;if(ee.startsWith("https://")&&he){let R=document.createElement("a");R.className="bp-mgmt-col bp-mgmt-col-read bp-mgmt-read-link",R.href=ee,R.target="_blank",R.rel="noopener noreferrer",R.textContent=ke,re=R}else{let R=document.createElement("span");R.className="bp-mgmt-col bp-mgmt-col-read bp-mgmt-faint",R.textContent=ke,re=R}O.append(x,Y,se,re),j.appendChild(O),o.appendChild(j)}let B=document.createElement("div");B.className="bp-mgmt-note bp-mgmt-faint",B.textContent=m("gpui.mgmt.fab.derived","* worked out from the fab's page. Dimmed: the rigid board's value. A date opens the source page."),o.appendChild(B)}return e.appendChild(o),e}makeEmpty(e){let t=document.createElement("div");return t.className="bp-mgmt-note bp-mgmt-faint",t.textContent=e,t}}var na={trs:(e)=>e,t:(e,t)=>t},ia=new Set(["/settle"]);function Es(e,t){let n=t.trim().toLowerCase();if(!n)return 1;let i=e.toLowerCase();if(i.startsWith(n))return 3;if(i.split(/[^a-z0-9]+/i).some((a)=>a.startsWith(n)))return 2;let r=0;for(let a=0;a0||e.status==="waiting")return{urgency:3,want:"waiting"};if(e.status==="asking")return{urgency:2,want:"question"};if(e.status==="failed"||e.state==="failed")return{urgency:1,want:"failed"};return{urgency:0,want:""}}function Cs(e){let t=e.status||e.state;if(t==="active"||t==="working")return"bp-dot-work";if(t==="finished")return"bp-dot-done";if(t==="waiting"||t==="asking"||t==="blocked"||t==="failed"||(e.waiting??0)>0)return"bp-dot-need";return"bp-dot-idle"}function xs(e,t){let n=t.trim().split(/\s+/)[0]?.toLowerCase()??"";if(!n)return null;let i=e.toLowerCase();if(i.length!==e.length)return null;let s=i.indexOf(n);if(s<0)return null;return[s,s+n.length]}function Ps(e,t=na){let{t:n,trs:i}=t,s=[],r=new Map;for(let o of e.projects)r.set(o.id,o.title||o.id);let a=e.threads.find((o)=>o.id===e.selectedThreadId)??null;for(let o of e.railItems){if(o.state==="disabled"||o.id==="commands")continue;if(!a&&o.id!=="terminal")continue;s.push({label:i(o.label),place:o.id==="terminal"?"":"viewer",kind:"action",shortcut:o.key?o.key.toUpperCase():void 0,action:{type:"rail",id:o.id}})}if(a)s.push({label:a.pinned?n("menu.unpin","Unpin"):n("menu.pin","Pin"),place:"",kind:"action",action:{type:"thread-act",action:a.pinned?"unpin":"pin"}}),s.push({label:a.settled?n("phone.unsettle","Unsettle"):n("menu.settle","Settle"),place:"",kind:"action",action:{type:"thread-act",action:a.settled?"unsettle":"settle"}}),s.push({label:a.archived?n("palette.unarchive","Unarchive"):n("palette.archive","Archive"),place:"",kind:"action",action:{type:"thread-act",action:a.archived?"unarchive":"archive"}}),s.push({label:n("sheet.rename","Rename thread"),place:"",kind:"action",action:{type:"rename"}}),s.push({label:n("gpui.previous.thread","Previous thread"),place:"",kind:"action",action:{type:"prev-thread"}}),s.push({label:n("gpui.next.thread","Next thread"),place:"",kind:"action",action:{type:"next-thread"}});if(a)for(let o of e.commands){if(!o.word)continue;let c=ia.has(o.word.toLowerCase());s.push({label:o.label?`${o.word} — ${o.label}`:o.word,place:o.desc||"command",kind:"command",action:{type:"command",word:o.word,runDirectly:c}})}s.push({label:n("gpui.improvements","Improvements"),place:"",kind:"action",action:{type:"improvements"}}),s.push({label:n("palette.settings","Settings"),place:"",kind:"action",action:{type:"settings"}}),s.push({label:n("gpui.fold.or.unfold.the.sidebar","Fold or unfold the sidebar"),place:"",kind:"action",action:{type:"sidebar"}});for(let o of e.projects)s.push({label:`New thread in ${o.title||o.id}`,place:"",kind:"action",action:{type:"new-thread",projectId:o.id}});for(let o of e.threads){let{urgency:c,want:p}=ks(o);s.push({label:o.title||"Untitled thread",place:o.project?r.get(o.project)??"":"",kind:"thread",urgency:c,want:p,dotClass:Cs(o),action:{type:"thread",id:o.id}})}for(let o of e.bots){if(!o.name||!o.thread)continue;s.push({label:o.name,place:"",kind:"bot",action:{type:"thread",id:o.thread}})}return s}function Ss(e,t,n,i=[],s=10,r=14){let a=t.trim(),o=a.length===0,c=e.slice();if(n?.threads&&n.threads.length>0){let d=new Map;for(let f of i)d.set(f.id,f.title||f.id);let u=new Set;for(let f of c)if(f.action.type==="thread")u.add(f.action.id);for(let f of n.threads){if(!f.id||u.has(f.id))continue;u.add(f.id);let{urgency:b,want:v}=ks(f);c.push({label:f.title||"Untitled thread",place:f.project?d.get(f.project)??"":"",kind:"thread",urgency:b,want:v,dotClass:Cs(f),action:{type:"thread",id:f.id}})}}let p=[];for(let d=0;d0)p.push({score:v,index:d,item:u})}p.sort((d,u)=>{if(o){let v=(u.item.urgency??0)-(d.item.urgency??0);if(v!==0)return v}if(u.score!==d.score)return u.score-d.score;let f=d.item.kind==="thread"?0:1,b=u.item.kind==="thread"?0:1;if(f!==b)return f-b;return d.index-u.index});let l=new Set,h=[];for(let d of p){let u=`${d.item.label}\x00${d.item.place}\x00${d.item.kind}`;if(l.has(u))continue;if(l.add(u),h.push(d.item),h.length>=s)break}if(n?.messages&&n.messages.length>0&&h.length{if(a.target===t)this.close()}),s.addEventListener("input",()=>{this.query=s.value,this.activeIdx=0,this.renderList(),this.scheduleSearch()}),s.addEventListener("keydown",(a)=>{if(a.key==="Escape")a.preventDefault(),a.stopPropagation(),this.close();else if(a.key==="ArrowDown"){if(a.preventDefault(),this.listed.length>0)this.activeIdx=(this.activeIdx+1)%this.listed.length,this.renderList(!0)}else if(a.key==="ArrowUp"){if(a.preventDefault(),this.listed.length>0)this.activeIdx=(this.activeIdx-1+this.listed.length)%this.listed.length,this.renderList(!0)}else if(a.key==="Enter")a.preventDefault(),this.runAt(this.activeIdx)}),this.backdrop=t,this.inputEl=s,this.listEl=r,this.root.appendChild(t),this.renderList(),this.query.trim().length>=2)this.scheduleSearch();s.focus()}close(){if(this.searchTimer!==null)window.clearTimeout(this.searchTimer),this.searchTimer=null;if(this.searchGen++,this.backdrop)this.backdrop.remove(),this.backdrop=null,this.inputEl=null,this.listEl=null;this.prevFocus?.focus(),this.prevFocus=null}scheduleSearch(){if(this.searchTimer!==null)window.clearTimeout(this.searchTimer),this.searchTimer=null;let e=this.query.trim();if(e.length<2){this.searchHits=null,this.searchHitsQuery="";return}if(e===this.searchHitsQuery)return;let t=++this.searchGen;this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.cb.onSearch(e).then((n)=>{if(t!==this.searchGen||!this.backdrop)return;if(this.query.trim()!==e)return;this.searchHits=n,this.searchHitsQuery=e,this.renderList()}).catch(()=>{})},180)}runAt(e){let t=this.listed[e];if(!t)return;this.close(),this.cb.onExecute(t.action)}renderList(e=!1){if(!this.listEl)return;let t=this.cb.getState(),n=Ps(t,{t:m,trs:pe}),i=this.query.trim()===this.searchHitsQuery?this.searchHits:null;if(this.listed=Ss(n,this.query,i,t.projects),this.activeIdx>=this.listed.length)this.activeIdx=Math.max(0,this.listed.length-1);if(this.listed.length===0){let a=document.createElement("div");a.className="bp-palette-empty",a.textContent=m("gpui.nothing.matches","Nothing matches"),this.listEl.replaceChildren(a);return}let s=document.createDocumentFragment(),r=null;for(let a=0;a0)p.appendChild(document.createTextNode(o.label.slice(0,d)));let f=document.createElement("strong");if(f.className="bp-palette-mark",f.textContent=o.label.slice(d,u),p.appendChild(f),u{if(this.activeIdx!==a)this.activeIdx=a,this.updateActiveClass()}),c.addEventListener("click",()=>this.runAt(a)),a===this.activeIdx)r=c;s.appendChild(c)}if(this.listEl.replaceChildren(s),e&&r)r.scrollIntoView({block:"nearest"})}updateActiveClass(){if(!this.listEl)return;let e=this.listEl.children;for(let t=0;t0?Math.floor(t.leadDays):0,i=[];for(let s of cn(t.warnings)){let r=nt(s).trim();if(r&&!i.includes(r))i.push(r)}return{project:nt(t.project),root:nt(t.root),intent:nt(t.intent),parts:cn(t.parts).map((s)=>Fn(s)).map((s)=>({name:nt(s.name),kind:nt(s.kind),path:nt(s.path)})).filter((s)=>s.name||s.path),boards:cn(t.boards).map(nt).filter(Boolean),mech:cn(t.mech).map((s)=>Fn(s)).map((s)=>({path:nt(s.path),name:nt(s.name),size:typeof s.size==="number"&&s.size>0?s.size:0})).filter((s)=>s.name||s.path),leadDays:n,warnings:i}}function $n(e){let t=[];for(let n of e.split(` -`)){let i=n.trimEnd();if(!i.trim())continue;if(t.length>=60)break;let s=i.trimStart();if(s.startsWith("#"))t.push({kind:"h",text:s.replace(/^#+/,"").trim()});else if(s.startsWith("- ")||s.startsWith("* "))t.push({kind:"li",text:s.slice(2).trim()});else t.push({kind:"p",text:s})}return t}function As(e){return!$n(e).some((t)=>t.kind!=="h"&&t.text.length>0)}function Ns(e){if(!Number.isFinite(e)||e<=0)return"";if(e<1024)return`${Math.floor(e)} B`;if(e<1048576)return`${(e/1024).toFixed(e<10240?1:0)} KB`;return`${(e/1048576).toFixed(1)} MB`}function On(e){let t=e.lastIndexOf("|");return t>=0?e.slice(t+1):e}function be(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n!==void 0)i.textContent=n;return i}class Gn{root;titleEl;rootEl;newBtn;newLbl;threadsEl;bodyEl;cb;projectId="";data=null;threads=null;error="";constructor(e,t){this.cb=t,this.root=be("section","bp-project-home bp-hidden"),this.root.setAttribute("data-testid","project-home");let n=be("div","bp-home-inner"),i=be("header","bp-home-head");this.titleEl=be("h1","bp-home-title"),this.titleEl.setAttribute("data-testid","project-home-title"),this.rootEl=be("div","bp-home-root"),i.append(this.titleEl,this.rootEl);let s=be("div","bp-home-bar");this.newBtn=be("button","primary bp-home-new"),this.newBtn.type="button",this.newBtn.setAttribute("data-testid","project-home-new-thread");let r=be("span","bp-home-new-plus","+");r.setAttribute("aria-hidden","true"),this.newLbl=be("span","",m("thread.new","New thread")),this.newBtn.append(r,this.newLbl),this.newBtn.addEventListener("click",()=>{if(this.projectId)this.cb.onNewThread(this.projectId)}),s.appendChild(this.newBtn),this.threadsEl=be("div","bp-home-threads"),this.bodyEl=be("div","bp-home-body"),n.append(i,s,this.threadsEl,this.bodyEl),this.root.appendChild(n),e.appendChild(this.root)}isOpen(){return this.projectId!==""}show(e){if(this.projectId!==e.id)this.data=null,this.threads=null,this.root.scrollTop=0;this.error="",this.projectId=e.id,this.titleEl.textContent=e.title||e.id,this.root.classList.remove("bp-hidden"),this.render()}hide(){this.projectId="",this.root.classList.add("bp-hidden")}setTitle(e){if(e)this.titleEl.textContent=e}setData(e){this.data=e,this.error="",this.render()}setThreads(e){this.threads=e,this.render()}setError(e){this.error=e,this.render()}refreshLocale(){if(this.newLbl.textContent=m("thread.new","New thread"),this.isOpen())this.render()}section(e){return be("h2","bp-home-section",e)}render(){this.rootEl.textContent=this.data?.root??"",this.rootEl.classList.toggle("bp-hidden",!this.data?.root),this.renderThreads(),this.renderBody()}renderThreads(){let e=document.createDocumentFragment(),t=this.threads;if(t){if(e.appendChild(this.section(m("gpui.projects.threads","THREADS ({n})",{n:t.length}))),t.length===0)e.appendChild(be("div","bp-home-empty",m("gpui.no.threads.yet","No threads yet.")));for(let n of t){let i=be("button","bp-home-row bp-home-thread"+(n.settled?" bp-dim":""));i.type="button",i.setAttribute("data-testid",`project-home-thread-${n.id}`);let s=be("span",`bp-dot ${n.dot}`);if(n.status)s.title=n.status;let r=be("span","bp-home-row-main",n.title||"Untitled thread"),a=be("span","bp-home-row-faint",n.age);i.append(s,r,a),i.addEventListener("click",()=>this.cb.onOpenThread(n.id)),e.appendChild(i)}}this.threadsEl.replaceChildren(e)}renderBody(){let e=document.createDocumentFragment(),t=this.data;if(this.error){let s=be("div","bp-home-error");s.setAttribute("data-testid","project-home-error"),s.appendChild(be("span","",this.error));let r=be("button","bp-btn-ghost",m("tools.retry","Retry"));r.type="button";let a=this.projectId;r.addEventListener("click",()=>this.cb.onRetry(a)),s.appendChild(r),e.appendChild(s)}if(!t){if(!this.error)e.appendChild(be("div","bp-home-empty",m("web.home.loading","Loading project…")));this.bodyEl.replaceChildren(e);return}e.appendChild(this.section(m("gpui.goal.notes","GOAL & NOTES")));let n=be("div","bp-home-intent");if(n.setAttribute("data-testid","project-home-intent"),As(t.intent))e.appendChild(be("div","bp-home-empty",m("gpui.no.goal.yet.ask.an","No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.")));else{for(let s of $n(t.intent))if(s.kind==="h")n.appendChild(be("div","bp-home-intent-h",s.text));else if(s.kind==="li"){let r=be("div","bp-home-intent-li"),a=be("span","bp-home-bullet","•");a.setAttribute("aria-hidden","true"),r.append(a,be("span","",s.text)),n.appendChild(r)}else n.appendChild(be("div","",s.text));e.appendChild(n)}let i=this.threads?.[0]?.id??"";if(t.mech.length>0)e.appendChild(this.section(m("gpui.projects.mech","MECHANICAL ({n})",{n:t.mech.length}))),t.mech.forEach((s,r)=>{let a=r===0&&t.mech.length>1,o=this.fileRow(i,"mech",`project-home-mech-${r}`);if(o.title=s.path,o.appendChild(be("span","bp-home-row-main",s.name||s.path)),a)o.appendChild(be("span","bp-home-row-accent",m("gpui.assembly","Assembly")));o.appendChild(be("span","bp-home-row-faint",Ns(s.size))),e.appendChild(o)});if(t.parts.length>0){e.appendChild(this.section(m("gpui.projects.to.order","TO ORDER ({n})",{n:t.parts.length})));let s=be("div","bp-home-order");if(s.setAttribute("data-testid","project-home-order"),t.parts.forEach((r,a)=>{let o=be("div","bp-home-row");o.setAttribute("data-testid",`project-home-part-${a}`),o.append(be("span","bp-home-row-main",r.name||r.path),be("span","bp-home-row-dim",r.kind),be("span","bp-home-row-faint",r.path)),s.appendChild(o)}),t.leadDays>0){let r=be("div","bp-home-order-note",t.leadDays===1?m("web.home.lead.one","Lead time: 1 day"):m("web.home.lead","Lead time: {n} days",{n:t.leadDays}));r.setAttribute("data-testid","project-home-lead"),s.appendChild(r)}for(let r of t.warnings){let a=be("div","bp-home-order-note warn",r);a.setAttribute("data-testid","project-home-warning"),s.appendChild(a)}e.appendChild(s)}if(t.boards.length>0)e.appendChild(this.section(m("gpui.projects.boards","BOARDS ({n})",{n:t.boards.length}))),t.boards.forEach((s,r)=>{let a=this.fileRow(i,"board",`project-home-board-${r}`);a.appendChild(be("span","bp-home-row-main",s)),e.appendChild(a)});this.bodyEl.replaceChildren(e)}fileRow(e,t,n){if(!e){let s=be("div","bp-home-row");return s.setAttribute("data-testid",n),s}let i=be("button","bp-home-row bp-home-open");return i.type="button",i.setAttribute("data-testid",n),i.addEventListener("click",()=>this.cb.onOpenViewer(e,t)),i}}function Vn(e){let t=null;if(typeof e==="string"){let i=e.trim();if(!i)return null;try{let s=JSON.parse(i);if(s&&typeof s==="object"&&!Array.isArray(s))t=s}catch{return null}}else if(e&&typeof e==="object"&&!Array.isArray(e))t=e;if(!t)return null;let n=typeof t.head==="string"?t.head.trim():"";if(!n)return null;return{reason:typeof t.reason==="string"?t.reason:"",head:n,text:typeof t.text==="string"?t.text:"",button:typeof t.button==="string"&&t.button.trim()?t.button:"Open Settings → Accounts",url:typeof t.url==="string"&&t.url.trim()?t.url:"backplane://settings/accounts"}}function sa(e){return e.startsWith("No AI provider connected yet.")}function Ms(e,t){if(t==="no_provider")return!0;if(t)return!1;return sa(e)}function it(e){return typeof e==="string"?e:""}function Un(e){return typeof e==="number"&&Number.isFinite(e)?e:0}function Ts(e){let t=e&&typeof e==="object"?e:{},n=[];for(let i of Array.isArray(t.notes)?t.notes:[]){if(!i||typeof i!=="object")continue;let s=i,r=it(s.id);if(!r)continue;n.push({id:r,said:Un(s.said),gesture:it(s.gesture),words:it(s.words),model:it(s.model),conf:typeof s.conf==="number"&&Number.isFinite(s.conf)?s.conf:null,unsure:it(s.unsure),state:it(s.state),error:it(s.error),thread:it(s.thread),play:it(s.play),heard:Un(s.heard)})}return{total:Math.max(Un(t.total),n.length),notes:n,busy:it(t.busy)}}function Bs(e){let t=/\/ring\/audio\/(n[0-9a-f]{16})(?:\.m4a)?\?k=([0-9a-fA-F]+)$/.exec(e);return t?`/ring/audio/${t[1]}?k=${t[2]}`:""}function Is(e){if(!e.model)return{key:"web.ring.not.heard",fallback:"Not heard"};if(e.model==="ring")return{key:"web.ring.app.words",fallback:"The Pebble app's words"};if(e.conf!==null)return{key:"web.ring.heard.by.sure",fallback:"Heard by {model}, {conf}% sure",vars:{model:e.model,conf:Math.round(e.conf)}};return{key:"web.ring.heard.by",fallback:"Heard by {model}",vars:{model:e.model}}}function Rs(e,t){if(t)return{key:"web.ring.state.busy",fallback:"being heard now"};switch(e){case"sent":return{key:"web.ring.state.sent",fallback:"given to Pebble"};case"new":return{key:"web.ring.state.new",fallback:"waiting to be heard"};case"heard":return{key:"web.ring.state.heard",fallback:"waiting to go to Pebble"};case"failed":return{key:"web.ring.state.failed",fallback:"not given to Pebble"};default:return{key:"",fallback:e}}}function js(e,t,n){if(e<=0)return{key:"ring.no.recordings.yet",fallback:"No recordings yet."};if(n.trim())return{key:"web.ring.found",fallback:"{found} of {total} have “{q}”.",vars:{found:t,total:e,q:n.trim()}};return e===1?{key:"web.ring.count.one",fallback:"1 recording"}:{key:"web.ring.count",fallback:"{n} recordings",vars:{n:e}}}var Hs="http://www.w3.org/2000/svg",Ds={terminal:["M4 17l6-6-6-6","M12 19h8"],search:["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.3-4.3"],"circuit-board":["M3 3h18v18H3z","M9 3v6h6","M9 21v-6","M15 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","M9 15a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],cpu:["M6 6h12v12H6z","M9 2v4","M15 2v4","M9 18v4","M15 18v4","M2 9h4","M2 15h4","M18 9h4","M18 15h4"],box:["M21 16V8l-9-5-9 5v8l9 5 9-5z","M3.3 7L12 12l8.7-5","M12 22V12"],gauge:["M12 14l4-4","M3.3 19a10 10 0 1 1 17.4 0"],"file-stack":["M16 2H6v12h10V2z","M20 6v12H10","M4 18h10v4H4z"],"layout-panel-left":["M3 3h18v18H3z","M10 3v18"],layers:["M12 2L2 7l10 5 10-5-10-5z","M2 12l10 5 10-5","M2 17l10 5 10-5"],wrench:["M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"],folder:["M3 6h6l2 2h10v11H3z"],diff:["M12 5v10","M7 10h10","M7 19h10"],"circle-check":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M9 12l2 2 4-4"],globe:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M2 12h20","M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20z"]};function ra(e){let t=document.createElementNS(Hs,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.75"),t.setAttribute("stroke-linecap","square"),t.setAttribute("stroke-linejoin","miter"),t.setAttribute("aria-hidden","true");let n=Ds[e]??Ds.folder;for(let i of n){let s=document.createElementNS(Hs,"path");s.setAttribute("d",i),t.appendChild(s)}return t}class Wn{el;items=[];activeId="";onPress;pagesRo=null;constructor(e,t){this.el=e,this.onPress=t,this.render()}setItems(e){this.items=e.slice(),this.render()}setActive(e){this.activeId=e,this.render()}renderButton(e){let t=e.state==="disabled",n=!t&&(e.state==="on"||this.activeId!==""&&e.id===this.activeId),i=pe(e.label),s=e.why?pe(e.why):"",r=document.createElement("button");if(r.type="button",r.className="bp-rail-btn"+(n?" active":"")+(t?" disabled":""),r.disabled=t,r.setAttribute("aria-pressed",n?"true":"false"),t){if(r.title=s||i,s)r.setAttribute("data-why",s)}else r.title=e.key?`${i} (${e.key.toUpperCase()})`:i;r.setAttribute("data-rail-id",e.id),r.setAttribute("data-testid",`rail-${e.id}`),r.appendChild(ra(e.icon));let a=document.createElement("span");if(a.className="bp-rail-lbl",a.textContent=i,r.appendChild(a),!t)r.addEventListener("click",()=>this.onPress(e.id));return r}render(){let e=this.items.filter((a)=>a.group!=="tools"),t=this.items.filter((a)=>a.group==="tools"),n=document.createElement("div");n.className="bp-rail-pages";let i;for(let a of e){if(i!==void 0&&a.group!==i){let o=document.createElement("div");o.className="bp-rail-rule",n.appendChild(o)}i=a.group,n.appendChild(this.renderButton(a))}let s=()=>{let a=n.scrollLeft>2,o=n.scrollLeft+n.clientWidth0){let a=document.createElement("div");a.className="bp-rail-tools";for(let o of t)a.appendChild(this.renderButton(o));r.appendChild(a)}this.el.replaceChildren(r)}}var aa=new Set(["resume","raise","retry","move","signin"]);function _n(e){if(!e||typeof e!=="object")return null;let t=e,n=(r)=>typeof r==="string"?r:"",i=(Array.isArray(t.actions)?t.actions:[]).filter((r)=>Boolean(r)&&typeof r==="object").map((r)=>({label:n(r.label),act:n(r.act),room:n(r.room),thread:n(r.thread)})),s={line:n(t.line),why:n(t.why),actions:i};return s.line||i.length?s:null}function dn(e,t){if(e.act==="board")return t&&e.room?{kind:"board",room:e.room}:null;if(e.act==="open")return e.thread?{kind:"thread",id:e.thread}:null;if(aa.has(e.act)){let n={room:e.room,action:e.act};if(e.thread)n.thread=e.thread;return{kind:"call",method:"swarm.act",params:n}}return null}function Fs(e){let t=e&&typeof e==="object"?e.open:void 0;if(typeof t!=="string")return null;let n=t.indexOf(":"),i=n<0?"":t.slice(n+1);if(!i)return null;if(t.startsWith("account:"))return{kind:"account",id:i};if(t.startsWith("thread:"))return{kind:"thread",id:i};return null}var qn=[{id:"general",label:"General"},{id:"ai",label:"Agents and tools"},{id:"connect",label:"Connect"}],St=[{id:"appearance",group:"general",title:"Appearance",subtitle:"Kept in this browser only. Never sent to the hub.",icon:"sun",keywords:["theme","dark","light","auto","color","language","locale","english","espanol","japanese"]},{id:"providers",group:"ai",title:"AI providers",subtitle:"Account sign-ins live in the desktop or mobile app.",icon:"cpu",keywords:["accounts","claude","codex","antigravity","grok","openai","anthropic","signin","login","model"]},{id:"ring",group:"ai",title:"Ring",subtitle:"Voice notes from your Pebble ring. Its webhook is set up in the desktop or mobile app.",icon:"mic",keywords:["pebble","index","voice","note","notes","recording","recordings","play","hear","transcribe","search"]},{id:"devices",group:"connect",title:"Devices & browser",subtitle:"This browser session and paired devices on this hub.",icon:"link",keywords:["sign out","logout","session","cookie","revoke","paired","phone","browser","pair"]},{id:"home",group:"connect",title:"Home machine",subtitle:"Which machine hosts your always-on hub and bots.",icon:"globe",keywords:["host","boat","move","online","away","queued","linked"]}];function $s(e){if(e==="dark"||e==="light"||e==="auto")return e;return"auto"}function Os(e){if(e==="en"||e==="es"||e==="ja"||e==="auto")return e;return"auto"}function Gt(e,t){if(e==="dark"||e==="light")return e;return t==="light"?"light":"dark"}function Gs(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function zn(e,t){if(t.length===0)return!0;let n=e.toLowerCase();return t.every((i)=>n.includes(i))}function Vs(e,t){let n=Gs(t);if(n.length===0)return[];return e.filter((i)=>{let s=[i.groupLabel,i.pageTitle,i.rowTitle,i.rowDetail,...i.keywords??[]].join(" ");return zn(s,n)})}function Kn(e,t,n){let i=Gs(n);if(i.length===0)return e.map((a)=>({page:a,hits:[]}));let s=new Map(qn.map((a)=>[a.id,a.label])),r=[];for(let a of e){let c=t.filter((l)=>l.pageId===a.id).filter((l)=>zn([l.rowTitle,l.rowDetail,l.pageTitle,l.groupLabel,...l.keywords??[]].join(" "),i));if(zn([s.get(a.group)??"",a.title,a.subtitle,...a.keywords].join(" "),i)||c.length>0){let l=[];for(let h of c){if(!l.includes(h.rowTitle))l.push(h.rowTitle);if(l.length>=2)break}r.push({page:a,hits:l})}}return r}function Jn(e){return e.key?m(e.key,e.fallback,e.vars):e.fallback}function oa(e){let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("width","15"),n.setAttribute("height","15"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.75"),n.setAttribute("stroke-linecap","square"),n.setAttribute("stroke-linejoin","miter"),n.setAttribute("aria-hidden","true");let i=(s,r)=>{let a=document.createElementNS("http://www.w3.org/2000/svg",s);for(let[o,c]of Object.entries(r))a.setAttribute(o,c);n.appendChild(a)};switch(e){case"sun":i("circle",{cx:"12",cy:"12",r:"4"}),i("path",{d:"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"});break;case"cpu":i("rect",{x:"5",y:"5",width:"14",height:"14"}),i("rect",{x:"9",y:"9",width:"6",height:"6"}),i("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3M2 9h3m-3 6h3M19 9h3m-3 6h3"});break;case"link":i("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),i("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"});break;case"mic":i("rect",{x:"9",y:"2",width:"6",height:"12"}),i("path",{d:"M5 11a7 7 0 0 0 14 0M12 18v4M8 22h8"});break;case"globe":i("circle",{cx:"12",cy:"12",r:"10"}),i("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"});break}return n}function la(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.75"),t.setAttribute("aria-hidden","true");let n=document.createElementNS("http://www.w3.org/2000/svg","circle");n.setAttribute("cx","11"),n.setAttribute("cy","11"),n.setAttribute("r","7");let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","m20 20-3.5-3.5"),t.append(n,i),t}function pn(e,t){switch(e){case"general":return m("gpui.settings.group.general",t);case"ai":return m("gpui.settings.group.agents",t);case"connect":return m("native.pair.connect",t)}}function pt(e,t){switch(e){case"appearance":return m("settings.appearance",t);case"providers":return m("web.settings.providers",t);case"ring":return m("ring.ring",t);case"devices":return t;case"home":return m("home.machine",t)}}class Yn{backdrop;titleEl;badgeEl;closeBtn;navListEl;searchInput;searchClearBtn;paneEl;cb;openState=!1;activePage="appearance";forceProviders=!1;query="";searchBrowseAll=!1;devicesLoaded=!1;devicesLoading=!1;devicesRows=[];devicesError="";loadGen=0;ringLoaded=!1;ringLoading=!1;ringList={total:0,notes:[],busy:""};ringCountEl=null;ringErrorEl=null;ringRows=new Map;ringShownQuery="";ringError="";ringQuery="";ringDraft="";ringGen=0;ringBusy=new Set;ringPolls=0;ringTimers=[];constructor(e,t){this.cb=t,this.backdrop=document.createElement("div"),this.backdrop.className="bp-modal-backdrop bp-hidden",this.backdrop.setAttribute("data-testid","settings-modal");let n=document.createElement("div");n.className="bp-modal bp-settings-modal",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby","bp-settings-title");let i=document.createElement("div");i.className="bp-modal-head";let s=document.createElement("div");s.className="bp-settings-head-title",this.titleEl=document.createElement("h2"),this.titleEl.id="bp-settings-title",this.titleEl.textContent=m("palette.settings","Settings"),this.badgeEl=document.createElement("span"),this.badgeEl.className="bp-settings-badge",this.badgeEl.textContent="Browser",s.append(this.titleEl,this.badgeEl),this.closeBtn=document.createElement("button"),this.closeBtn.type="button",this.closeBtn.className="icon",this.closeBtn.textContent="×",this.closeBtn.setAttribute("aria-label",m("common.close","Close")),this.closeBtn.addEventListener("click",()=>this.close()),i.append(s,this.closeBtn);let r=document.createElement("div");r.className="bp-settings-body";let a=document.createElement("aside");a.className="bp-settings-nav";let o=document.createElement("div");o.className="bp-settings-search";let c=document.createElement("span");c.className="bp-settings-search-icon",c.appendChild(la()),this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="bp-settings-search-input",this.searchInput.placeholder="Search settings…",this.searchInput.setAttribute("aria-label","Search settings"),this.searchInput.setAttribute("data-testid","settings-search"),this.searchClearBtn=document.createElement("button"),this.searchClearBtn.type="button",this.searchClearBtn.className="bp-settings-search-clear bp-hidden",this.searchClearBtn.textContent="×",this.searchClearBtn.title="Clear search",this.searchClearBtn.setAttribute("aria-label","Clear search"),o.append(c,this.searchInput,this.searchClearBtn),this.navListEl=document.createElement("nav"),this.navListEl.className="bp-settings-nav-list",this.navListEl.setAttribute("aria-label","Settings sections"),a.append(o,this.navListEl),this.paneEl=document.createElement("div"),this.paneEl.className="bp-settings-pane",r.append(a,this.paneEl),n.append(i,r),this.backdrop.appendChild(n),this.backdrop.addEventListener("click",(p)=>{if(p.target===this.backdrop)this.close()}),this.searchInput.addEventListener("input",()=>{this.query=this.searchInput.value,this.searchBrowseAll=this.query.trim().length>0,this.syncSearchClear(),this.render()}),this.searchInput.addEventListener("keydown",(p)=>{if(p.key==="Enter"){let l=Kn(St,this.buildSearchItems(),this.query);if(l.length>0)p.preventDefault(),this.activePage=l[0].page.id,this.searchBrowseAll=!1,this.render()}else if(p.key==="Escape"&&this.query.trim().length>0)p.preventDefault(),p.stopPropagation(),this.clearSearch()}),this.searchClearBtn.addEventListener("click",()=>{this.clearSearch(),this.searchInput.focus()}),e.appendChild(this.backdrop)}isOpen(){return this.openState}handleEscape(){if(!this.openState)return;if(this.query.trim().length>0)this.clearSearch(),this.searchInput.focus();else this.close()}async open(e){if(this.openState=!0,e)this.activePage=e;if(this.backdrop.classList.remove("bp-hidden"),this.render(),this.loadDevices(),this.activePage==="ring")this.loadRing();window.setTimeout(()=>{if(this.openState)this.searchInput.focus()},0)}async openToAccounts(){this.forceProviders=!0,this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),await this.open("providers")}close(){this.openState=!1,this.forceProviders=!1,this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),this.backdrop.classList.add("bp-hidden");for(let e of this.ringTimers)window.clearTimeout(e);if(this.ringTimers=[],this.ringBusy.clear(),this.ringPolls=0,this.activePage==="ring")this.paneEl.replaceChildren()}refreshLocale(){if(this.titleEl.textContent=m("palette.settings","Settings"),this.closeBtn.setAttribute("aria-label",m("common.close","Close")),this.openState)this.render()}async refresh(){if(!this.openState)return;this.render(),await this.loadDevices()}clearSearch(){this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),this.render()}syncSearchClear(){this.searchClearBtn.classList.toggle("bp-hidden",this.query.length===0)}async loadDevices(){let e=++this.loadGen;if(this.devicesLoading=!this.devicesLoaded,this.devicesLoading&&this.openState)this.renderPane();try{let t=await this.cb.onLoadDevices();if(e!==this.loadGen)return;this.devicesRows=t,this.devicesError="",this.devicesLoaded=!0}catch(t){if(e!==this.loadGen)return;let n=t instanceof Error&&t.message?t.message:"Not available from a browser";this.devicesError=`${n} — manage paired devices in Backplane › Settings › Devices on desktop or a paired phone.`,this.devicesRows=[],this.devicesLoaded=!0}finally{if(e===this.loadGen){if(this.devicesLoading=!1,this.openState)this.render()}}}async loadRing(){if(!this.cb.onRingList||!(this.cb.hasRing?.()??!1))return;let e=++this.ringGen;if(this.ringLoading=!this.ringLoaded,this.ringLoading)this.showRing();try{let t=await this.cb.onRingList(this.ringQuery);if(e!==this.ringGen)return;if(this.ringList=t,this.ringError="",!t.busy)this.ringBusy.clear();if(t.busy&&this.openState&&this.ringPolls<40)this.ringPolls++,this.ringLater(3000);else if(!t.busy)this.ringPolls=0}catch(t){if(e!==this.ringGen)return;this.ringError=t instanceof Error&&t.message?t.message:m("web.ring.error","Could not load recordings.")}finally{if(e===this.ringGen)this.ringLoaded=!0,this.ringLoading=!1,this.showRing()}}ringLater(e){let t=window.setTimeout(()=>{if(this.ringTimers=this.ringTimers.filter((n)=>n!==t),this.openState)this.loadRing()},e);this.ringTimers.push(t)}ringIsBusy(e){return this.ringBusy.has(e)||this.ringList.busy===e}showRing(){if(!this.openState||this.activePage!=="ring"||this.query.trim()&&this.searchBrowseAll)return;let e=this.ringList.notes.map((i)=>i.id),t=Array.from(this.ringRows.keys());if(!(this.ringCountEl?.isConnected===!0&&this.ringShownQuery===this.ringQuery&&e.length===t.length&&e.every((i,s)=>i===t[s]))){this.renderPane();return}if(this.ringCountEl)this.ringCountEl.textContent=this.ringCountLine();if(this.ringErrorEl)this.ringErrorEl.textContent=this.ringError,this.ringErrorEl.classList.toggle("bp-hidden",!this.ringError);for(let i of this.ringList.notes)this.fillRingNote(i)}ringCountLine(){return this.ringLoading?m("web.ring.loading","Loading recordings…"):Jn(js(this.ringList.total,this.ringList.notes.length,this.ringQuery))}fillRingNote(e){let t=this.ringRows.get(e.id);if(!t)return;let n=this.ringIsBusy(e.id);t.state.className="bp-status-pill "+(n?"accent":e.state==="sent"?"ok":e.state==="failed"?"bad":"warn"),t.state.textContent=Jn(Rs(e.state,n)),t.words.className="bp-ring-words"+(e.words?"":" bp-dim"),t.words.textContent=e.words||m("web.ring.no.words","(no words)"),t.meta.textContent=[Jn(Is(e)),e.unsure,e.error].filter(Boolean).join(" · ");for(let i of t.hear)i.disabled=n}async hearRing(e,t){if(!this.cb.onRingHear||this.ringIsBusy(e))return;this.ringBusy.add(e),this.ringError="",this.showRing();try{await this.cb.onRingHear(e,t),this.ringPolls=0,this.ringLater(1500)}catch(n){this.ringBusy.delete(e),this.ringError=n instanceof Error&&n.message?n.message:m("web.ring.error","Could not load recordings."),this.showRing()}}buildSearchItems(){let e=this.cb.onGetHome?.()??null,t=this.cb.onGetNoProvider?.()??null,n=pn("general","General"),i=pn("ai","Agents and tools"),s=pn("connect","Connect"),r=pt("appearance","Appearance"),a=pt("providers","AI providers"),o=pt("devices","Devices & browser"),c=pt("home","Home machine"),p=[{pageId:"appearance",pageTitle:r,groupLabel:n,rowTitle:m("settings.theme","Theme"),rowDetail:"Auto (follow hub), Dark, or Light in this browser.",keywords:["theme","dark","light","auto","appearance","colors"]},{pageId:"appearance",pageTitle:r,groupLabel:n,rowTitle:m("settings.lang","Language"),rowDetail:"Interface language for this browser.",keywords:["locale","english","espanol","japanese","language"]},{pageId:"providers",pageTitle:a,groupLabel:i,rowTitle:t?pe(t.head):"Provider connections",rowDetail:"Connect Claude, Codex, Antigravity, or other AI providers in Settings → Accounts.",keywords:["accounts","claude","codex","antigravity","grok","openai","signin"]},{pageId:"ring",pageTitle:pt("ring","Ring"),groupLabel:i,rowTitle:m("ring.recordings","Recordings"),rowDetail:"Read, search, play and hear again the voice notes from your Pebble ring.",keywords:["pebble","voice","note","recording","play","hear","transcribe"]},{pageId:"devices",pageTitle:o,groupLabel:s,rowTitle:"This browser",rowDetail:"Sign out and revoke this browser's session cookie.",keywords:["logout","sign out","session","cookie"]},{pageId:"devices",pageTitle:o,groupLabel:s,rowTitle:"Paired devices",rowDetail:this.devicesRows.map((l)=>`${l.title||l.head||""} ${l.detail||l.text||""}`).join(" ")||"Paired phones and browsers on this hub.",keywords:["phone","pair","revoke","browser"]},{pageId:"home",pageTitle:c,groupLabel:s,rowTitle:e?.name?`${e.name}`:c,rowDetail:"Which machine hosts your always-on hub and bots.",keywords:["boat","move","online","away","queued","machine"]}];for(let l of this.devicesRows){let h=l.title||l.head||"";if(h)p.push({pageId:"devices",pageTitle:o,groupLabel:s,rowTitle:h,rowDetail:l.detail||l.text||"",keywords:["paired","device"]})}return p}render(){this.renderNav(),this.renderPane()}renderNav(){let e=document.createDocumentFragment(),t=Kn(St,this.buildSearchItems(),this.query),n=this.cb.onGetNoProvider?.()??null,i=this.cb.onGetHome?.()??null;if(t.length===0){let r=document.createElement("div");r.className="bp-settings-nav-empty",r.setAttribute("data-testid","settings-nav-empty"),r.textContent="No matching settings",e.appendChild(r),this.navListEl.replaceChildren(e);return}let s="";for(let r of t){let a=r.page;if(a.group!==s){s=a.group;let d=qn.find((u)=>u.id===a.group);if(d){let u=document.createElement("div");u.className="bp-settings-group",u.textContent=pn(d.id,d.label),e.appendChild(u)}}let o=document.createElement("button");o.type="button";let c=!this.searchBrowseAll&&a.id===this.activePage;o.className="bp-settings-nav-item"+(c?" active":""),o.setAttribute("data-testid",`settings-nav-${a.id}`);let p=document.createElement("div");p.className="bp-settings-nav-row";let l=document.createElement("span");l.className="bp-settings-nav-icon",l.appendChild(oa(a.icon));let h=document.createElement("span");if(h.className="bp-settings-nav-label",h.textContent=pt(a.id,a.title),p.append(l,h),a.id==="providers"&&(n||this.forceProviders)){let d=document.createElement("span");d.className="bp-settings-nav-dot warn",d.title="Action needed",p.appendChild(d)}else if(a.id==="home"&&i){let d=document.createElement("span");d.className="bp-settings-nav-dot "+(i.moving?.state==="failed"?"bad":i.online?"ok":"warn"),p.appendChild(d)}if(o.appendChild(p),r.hits.length>0)for(let d of r.hits){let u=document.createElement("div");u.className="bp-settings-hit",u.textContent=d,o.appendChild(u)}o.addEventListener("click",()=>{if(this.activePage=a.id,this.searchBrowseAll=!1,this.render(),a.id==="ring")this.loadRing()}),e.appendChild(o)}this.navListEl.replaceChildren(e)}renderPane(){let e=document.createDocumentFragment(),t=this.query.trim();if(t&&this.searchBrowseAll){this.renderSearchResults(e,t),this.paneEl.replaceChildren(e);return}let n=St.find((a)=>a.id===this.activePage)??St[0],i=document.createElement("div");i.className="bp-settings-pane-head";let s=document.createElement("h3");s.textContent=pt(n.id,n.title);let r=document.createElement("div");switch(r.className="bp-settings-pane-sub",r.textContent=n.subtitle,i.append(s,r),e.appendChild(i),n.id){case"appearance":this.renderAppearancePage(e);break;case"providers":this.renderProvidersPage(e);break;case"ring":this.renderRingPage(e);break;case"devices":this.renderDevicesPage(e);break;case"home":this.renderHomePage(e);break}this.paneEl.replaceChildren(e)}renderSearchResults(e,t){let n=Vs(this.buildSearchItems(),t),i=document.createElement("div");i.className="bp-settings-pane-head";let s=document.createElement("h3");s.textContent="Search results";let r=document.createElement("div");if(r.className="bp-settings-pane-sub",r.textContent=n.length===0?`No settings match "${t}".`:`${n.length} matching ${n.length===1?"setting":"settings"} for "${t}"`,i.append(s,r),e.appendChild(i),n.length===0){let o=document.createElement("div");o.className="bp-settings-empty",o.textContent="Try searching for theme, language, providers, sign out, devices, or home.",e.appendChild(o);return}let a=Array.from(new Set(n.map((o)=>o.pageId)));for(let o of a){let c=St.find((u)=>u.id===o);if(!c)continue;let p=document.createElement("div");p.className="bp-settings-search-sec";let l=document.createElement("div");l.className="bp-settings-subhead",l.textContent=pt(c.id,c.title);let h=document.createElement("button");h.type="button",h.className="bp-settings-search-open",h.textContent="Open page ›",h.addEventListener("click",()=>{if(this.activePage=o,this.searchBrowseAll=!1,this.render(),o==="ring")this.loadRing()}),p.append(l,h),e.appendChild(p);let d=new Set(n.filter((u)=>u.pageId===o).map((u)=>u.rowTitle));if(o==="appearance")this.renderAppearancePage(e,d);else if(o==="providers")this.renderProvidersPage(e);else if(o==="ring"){let u=document.createElement("div");u.className="bp-settings-empty",u.textContent="Read, search, play and hear again the voice notes from your Pebble ring.",e.appendChild(u)}else if(o==="devices")this.renderDevicesPage(e,d);else if(o==="home")this.renderHomePage(e)}}renderAppearancePage(e,t){let n=this.cb.onGetThemePref?.()??"auto",i=this.cb.onGetHubTheme?.()??"dark",s=Gt(n,i),r=this.cb.onGetLocalePref?.()??"auto",a=m("settings.theme","Theme"),o=m("settings.lang","Language");if(!t||t.has(a)){let c=m("settings.theme.dark","Dark"),p=m("settings.theme.light","Light"),l=n==="auto"?`Following hub theme (${i==="light"?p:c}). Stored in this browser only.`:`Using ${s==="light"?p:c} in this browser. Select Auto to follow the hub.`;e.appendChild(this.makeSegmentedRow(a,l,[{value:"auto",label:"Auto"},{value:"dark",label:c},{value:"light",label:p}],n,"settings-theme",(h)=>{this.cb.onSetThemePref?.(h),this.render()}))}if(!t||t.has(o))e.appendChild(this.makeSegmentedRow(o,"Interface language for this browser. Automatic follows the hub or browser language.",[{value:"auto",label:m("settings.lang.auto","Automatic")},{value:"en",label:m("settings.lang.en","English")},{value:"es",label:m("settings.lang.es","Español")},{value:"ja",label:m("settings.lang.ja","日本語")}],r,"settings-locale",(c)=>{this.cb.onSetLocalePref?.(c),this.render()}))}makeSegmentedRow(e,t,n,i,s,r){let a=document.createElement("div");a.className="bp-settings-row";let o=document.createElement("div");o.className="bp-settings-row-info";let c=document.createElement("div");c.className="bp-settings-row-title",c.textContent=e;let p=document.createElement("div");p.className="bp-settings-row-detail",p.textContent=t,o.append(c,p);let l=document.createElement("div");l.className="bp-chip-group",l.setAttribute("role","group"),l.setAttribute("aria-label",e);for(let h of n){let d=document.createElement("button");d.type="button";let u=h.value===i;d.className="bp-chip"+(u?" active":""),d.textContent=h.label,d.setAttribute("aria-pressed",u?"true":"false"),d.setAttribute("data-testid",`${s}-${h.value}`),d.addEventListener("click",()=>r(h.value)),l.appendChild(d)}return a.append(o,l),a}renderProvidersPage(e){let t=this.cb.onGetNoProvider?.()??null,n=document.createElement("section");if(n.className="bp-settings-section",n.setAttribute("data-testid","settings-providers"),t||this.forceProviders){let i=document.createElement("div");i.className="bp-settings-notice warn";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title",r.textContent=t?pe(t.head):m("provider.notice.head","No AI provider connected");let a=document.createElement("div");a.className="bp-settings-row-detail",a.textContent=m("web.settings.providers.browser","Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."),s.append(r,a);let o=document.createElement("div");o.className="bp-set-btns";let c=document.createElement("a");c.className="bp-link-btn primary",c.href=t?.url||"backplane://settings/accounts",c.setAttribute("data-testid","settings-open-accounts"),c.textContent=t?pe(t.button):m("provider.notice.button","Open Settings → Accounts"),o.appendChild(c),i.append(s,o),n.appendChild(i)}else{let i=document.createElement("div");i.className="bp-settings-row";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title-wrap";let a=document.createElement("span");a.className="bp-settings-row-title",a.textContent="Provider connections";let o=document.createElement("span");o.className="bp-status-pill ok",o.textContent=m("gpui.acct.connected","Connected"),r.append(a,o);let c=document.createElement("div");c.className="bp-settings-row-detail",c.textContent="Provider sign-ins, fallback order, API keys, and usage limits are managed in the Backplane desktop or mobile app.",s.append(r,c);let p=document.createElement("div");p.className="bp-set-btns";let l=document.createElement("a");l.className="bp-link-btn",l.href="backplane://settings/accounts",l.setAttribute("data-testid","settings-open-accounts"),l.textContent=m("provider.notice.button","Open Settings → Accounts"),p.appendChild(l),i.append(s,p),n.appendChild(i)}e.appendChild(n)}renderDevicesPage(e,t){let n=!t||t.has("This browser"),i=!t||t.has("Paired devices")||this.devicesRows.some((a)=>t.has(a.title||a.head||""));if(n){let a=document.createElement("div");a.className="bp-settings-subhead",a.textContent="This browser",e.appendChild(a);let o=document.createElement("div");o.className="bp-settings-row";let c=document.createElement("div");c.className="bp-settings-row-info";let p=document.createElement("div");p.className="bp-settings-row-title",p.textContent="Browser session";let l=document.createElement("div");l.className="bp-settings-row-detail",l.textContent="Sign out and revoke this browser's session cookie.",c.append(p,l);let h=document.createElement("button");h.type="button",h.className="primary stop",h.textContent=m("agy.signout","Sign out"),h.setAttribute("data-testid","logout-btn"),h.addEventListener("click",()=>{h.disabled=!0,this.cb.onLogout().catch(()=>{l.setAttribute("role","alert"),l.className="bp-settings-row-detail bp-bad",l.textContent=m("web.logout.failed","Could not confirm sign-out. Try again."),h.disabled=!1})}),o.append(c,h),e.appendChild(o)}if(!i)return;let s=document.createElement("div");if(s.className="bp-settings-subhead",s.textContent="Paired devices",e.appendChild(s),this.devicesLoading){let a=document.createElement("div");a.className="bp-settings-empty",a.textContent="Loading paired devices…",e.appendChild(a);return}if(this.devicesError){let a=document.createElement("div");a.className="bp-settings-notice bad";let o=document.createElement("div");o.className="bp-settings-row-detail",o.textContent=this.devicesError,a.appendChild(o),e.appendChild(a);return}let r=!t||t.has("Paired devices")?this.devicesRows:this.devicesRows.filter((a)=>t.has(a.title||a.head||""));if(r.length===0){let a=document.createElement("div");a.className="bp-settings-empty",a.textContent="No paired devices listed.",e.appendChild(a)}else for(let a of r){let o=document.createElement("div");o.className="bp-settings-row";let c=document.createElement("div");c.className="bp-settings-row-info";let p=document.createElement("div");p.className="bp-settings-row-title-wrap";let l=document.createElement("span");l.className="bp-settings-row-title",l.textContent=a.title||a.head||"",p.appendChild(l);let h=a.detail||a.text||"";if(h){let d=document.createElement("span"),u=h.toLowerCase();d.className="bp-status-pill "+(u.includes("this browser")?"accent":"neutral"),d.textContent=h,p.appendChild(d)}if(c.appendChild(p),o.appendChild(c),a.buttons?.length){let d=document.createElement("div");d.className="bp-set-btns";for(let u of a.buttons){let f=document.createElement("button");if(f.type="button",u.primary)f.className="primary";if(u.danger)f.className="primary stop";f.textContent=u.label||m("common.remove","Remove"),f.addEventListener("click",()=>{f.disabled=!0,this.cb.onDevicesAct(u.action,u.value).finally(()=>{this.refresh()})}),d.appendChild(f)}o.appendChild(d)}e.appendChild(o)}if(!t){let a=document.createElement("div");a.className="bp-settings-footnote",a.textContent="Pair new browsers or phones, configure Tailscale HTTPS forwarding, or revoke access in desktop or mobile Settings → Devices.",e.appendChild(a)}}renderRingPage(e){let t=document.createElement("section");if(t.className="bp-settings-section",t.setAttribute("data-testid","settings-ring"),!this.cb.onRingList||!(this.cb.hasRing?.()??!1)){let o=document.createElement("div");o.className="bp-settings-empty",o.textContent=m("web.ring.unavailable","This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app."),t.appendChild(o),e.appendChild(t);return}let n=document.createElement("form");n.className="bp-ring-search";let i=document.createElement("input");i.type="search",i.className="bp-ring-search-input",i.placeholder=m("ring.search.what.you.said","Search what you said"),i.setAttribute("aria-label",m("ring.search.what.you.said","Search what you said")),i.setAttribute("data-testid","ring-search"),i.value=this.ringDraft,i.addEventListener("input",()=>{this.ringDraft=i.value});let s=document.createElement("button");if(s.type="submit",s.className="primary",s.textContent=m("common.search","Search"),n.append(i,s),this.ringQuery){let o=document.createElement("button");o.type="button",o.className="bp-btn-ghost",o.textContent=m("ring.show.all","Show all"),o.addEventListener("click",()=>{this.ringDraft="",this.ringQuery="",this.loadRing()}),n.appendChild(o)}n.addEventListener("submit",(o)=>{o.preventDefault(),this.ringQuery=this.ringDraft.trim(),this.loadRing()}),t.appendChild(n);let r=document.createElement("div");r.className="bp-settings-notice bad"+(this.ringError?"":" bp-hidden"),r.setAttribute("data-testid","ring-error"),r.textContent=this.ringError,t.appendChild(r),this.ringErrorEl=r;let a=document.createElement("div");a.className="bp-ring-count",a.setAttribute("data-testid","ring-count"),a.textContent=this.ringCountLine(),t.appendChild(a),this.ringCountEl=a,this.ringRows.clear(),this.ringShownQuery=this.ringQuery;for(let o of this.ringList.notes)t.appendChild(this.renderRingNote(o));e.appendChild(t)}renderRingNote(e){let t=document.createElement("div");t.className="bp-ring-note"+(e.state==="failed"?" bad":""),t.setAttribute("data-testid",`ring-note-${e.id}`);let n=document.createElement("div");n.className="bp-ring-note-head";let i=document.createElement("span");i.className="bp-settings-row-title";let s=e.said>0?new Date(e.said*1000).toLocaleString(Ai(),{dateStyle:"medium",timeStyle:"short"}):"";i.textContent=[s,e.gesture].filter(Boolean).join(" · ");let r=document.createElement("span");n.append(i,r);let a=document.createElement("div"),o=document.createElement("div");o.className="bp-settings-row-detail";let c=[],p=document.createElement("div");p.className="bp-ring-acts";let l=Bs(e.play);if(l){let h=document.createElement("audio");h.className="bp-ring-audio",h.controls=!0,h.preload="none",h.src=l,h.setAttribute("data-testid",`ring-audio-${e.id}`),p.appendChild(h);for(let[d,u]of[["local",m("ring.hear.again.local","Hear again (local)")],["openai",m("ring.hear.again.openai","Hear again (OpenAI)")]]){let f=document.createElement("button");f.type="button",f.className="bp-btn-ghost",f.textContent=u,f.setAttribute("data-testid",`ring-hear-${d}-${e.id}`),c.push(f),f.addEventListener("click",()=>{this.hearRing(e.id,d)}),p.appendChild(f)}}if(e.thread&&this.cb.onOpenThread){let h=document.createElement("button");h.type="button",h.className="bp-btn-ghost",h.textContent=m("ring.what.happened","What happened"),h.addEventListener("click",()=>{this.close(),this.cb.onOpenThread?.(e.thread)}),p.appendChild(h)}if(t.append(n,a,o),p.childElementCount>0)t.appendChild(p);return this.ringRows.set(e.id,{state:r,words:a,meta:o,hear:c}),this.fillRingNote(e),t}renderHomePage(e){let t=this.cb.onGetHome?.()??null,n=document.createElement("section");if(n.className="bp-settings-section",n.setAttribute("data-testid","settings-home"),!t){let d=document.createElement("div");d.className="bp-settings-empty",d.textContent="Single-hub mode — this hub is running locally without linked home machines.",n.appendChild(d),e.appendChild(n);return}let i=document.createElement("div");i.className="bp-settings-row";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title-wrap";let a=document.createElement("span");a.className="bp-settings-row-title",a.textContent=t.name||(t.kind==="boat"?"Boat":"This machine"),r.appendChild(a);let o=document.createElement("span");o.className="bp-status-pill neutral",o.textContent=t.kind==="local"?"This machine":t.kind==="boat"?"Boat":"Linked machine",r.appendChild(o);let c=document.createElement("span"),p="Online",l="ok";if(t.moving?.state==="moving")p="Moving",l="accent";else if(t.moving?.state==="failed")p="Move failed",l="bad";else if(!t.online)p="Away",l="warn";c.className=`bp-status-pill ${l}`,c.textContent=p,r.appendChild(c);let h=document.createElement("div");if(h.className="bp-settings-row-detail",t.moving?.state==="moving")h.textContent=t.moving.step?m("home.moving.step","Moving home to {to}: {step}").replace("{to}",t.moving.to).replace("{step}",t.moving.step):m("home.moving","Moving home to {to}…").replace("{to}",t.moving.to);else if(t.moving?.state==="failed")h.textContent=t.moving.note?m("home.move.failed.note","Home move failed: {note}").replace("{note}",t.moving.note):m("home.move.failed","Home move failed");else if(!t.online)h.textContent=t.queuedCount>0?m("home.away.queued","Home ({name}) is away · {n} queued").replace("{name}",t.name||"home").replace("{n}",String(t.queuedCount)):m("home.away","Home ({name}) is away").replace("{name}",t.name||"home");else h.textContent="Your active home hub is online and serving threads and bots.";if(s.append(r,h),i.appendChild(s),t.canMoveHere&&this.cb.onMoveHomeHere){let d=document.createElement("button");d.type="button",d.className="primary",d.textContent=m("home.move.here","Make this machine the home"),d.setAttribute("data-testid","home-move-here-btn"),d.addEventListener("click",()=>{d.disabled=!0,this.cb.onMoveHomeHere?.().finally(()=>{this.refresh()})}),i.appendChild(d)}n.appendChild(i),e.appendChild(n)}}function Pe(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n)i.textContent=n;return i}function Vt(e,t,n=!1){let i=Pe("button",n?"primary":"bp-btn-ghost",e);return i.type="button",i.addEventListener("click",t),i}function Xn(e){return Pe("pre","bp-context-code",e)}function ca(e){return Pe("span",`bp-context-badge ${e==="Native"||e==="Enabled"?"active":e==="Untrusted"||e==="Invalid"?"warn":""}`,pe(e))}function hn(e,t){let n=Pe("div","bp-context-row");return n.append(Pe("strong",void 0,e),ca(t)),n}class Qn{fetchContext;dialog=Pe("dialog","bp-context");title=Pe("h2");cwd=Pe("div","bp-context-path");tabs=Pe("div","bp-context-tabs");body=Pe("div","bp-context-body");notice=Pe("p","bp-context-notice");current;thread="";requestId=0;tab=0;busy=!1;constructor(e,t){this.fetchContext=t;let n=Pe("div","bp-context-head"),i=Pe("div");i.append(this.title,this.cwd),this.title.id="bp-context-title",this.dialog.setAttribute("aria-labelledby",this.title.id),this.notice.setAttribute("role","status"),n.append(i,Vt(m("common.refresh","Refresh"),()=>{this.load()}),Vt(m("common.close","Close"),()=>this.dialog.close())),this.dialog.append(n,this.tabs,this.notice,this.body),this.dialog.addEventListener("close",()=>{this.requestId++}),e.append(this.dialog)}open(e){if(this.thread=e,this.tab=0,this.current=void 0,this.busy=!1,this.title.textContent=m("thread.context.title","Context & Prompt"),this.cwd.textContent="",!this.dialog.open)this.dialog.showModal();this.render(),this.load()}async load(e){if(this.busy)return;let t=++this.requestId;this.busy=!0,this.notice.textContent=m("thread.context.reading","Reading thread context…"),this.render();try{let n=await this.fetchContext(this.thread,e);if(t!==this.requestId)return;this.current=n,this.cwd.textContent=n.cwd,this.notice.textContent=""}catch(n){if(t===this.requestId)this.notice.textContent=String(n)}finally{if(t===this.requestId)this.busy=!1,this.render()}}render(){let e=[m("thread.context.instructions","Instructions"),m("thread.context.system","System Prompt"),m("thread.context.skills","Skills"),m("thread.context.mcp","Project MCPs")];this.tabs.replaceChildren(...e.map((n,i)=>{let s=Vt(n,()=>{this.tab=i,this.render(),this.body.scrollTop=0,this.tabs.children[i].focus()});return s.setAttribute("aria-pressed",String(i===this.tab)),s})),this.body.replaceChildren();let t=this.current;if(!t)return;switch(this.tab){case 0:this.instructions(t.instructions);break;case 1:this.prompt(t);break;case 2:this.skills(t.skills);break;case 3:this.mcps(t.mcp);break}}instructions(e){if(!e.length)this.body.append(Pe("p","bp-dim",m("thread.context.none.instructions","No project instructions found.")));for(let t of e){let n=Pe("details","bp-context-card"),i=Pe("summary");if(i.append(hn(t.path,t.status),Pe("small","bp-dim",m("thread.context.size","{bytes} B · ≈{tokens} tokens",{bytes:t.bytes,tokens:t.estimated_tokens}))),n.append(i,Xn(t.preview)),t.note)n.append(Pe("small","bp-dim",t.note));this.body.append(n)}}prompt(e){let t=Pe("div","bp-context-row"),n=Vt(m("thread.context.copy","Copy prompt"),()=>{navigator.clipboard.writeText(e.prompt).then(()=>{this.notice.textContent=m("thread.context.copied","Prompt copied.")}).catch((i)=>{this.notice.textContent=String(i)})});t.append(Pe("p","bp-dim",m("thread.context.native.note","Backplane’s launch prompt. Native files are loaded by the provider.")),n),this.body.append(t);for(let[i,s]of[[m("thread.context.base","Backplane"),e.sections.base],[m("thread.context.injected.label","Injected project instructions"),e.sections.instructions],[m("thread.context.index","Available skills index"),e.sections.skills]])if(s)this.body.append(Pe("h3",void 0,i),Xn(s))}skills(e){for(let t of["Project","User","Bundled"]){let n=e.filter((i)=>i.scope===t);if(!n.length)continue;this.body.append(Pe("h3",void 0,pe(t)));for(let i of n){let s=Pe("article","bp-context-card");s.append(hn(i.name,i.status),Pe("p",void 0,i.description),Pe("small","bp-context-path",[i.source,i.provider,i.model].filter(Boolean).join(" · ")),Pe("small","bp-context-path",i.path)),this.body.append(s)}}}mcps(e){if(!e.length)this.body.append(Pe("p","bp-dim",m("thread.context.none.mcp","No project MCP configurations found.")));for(let t of e){let n=Pe("article","bp-context-card");n.append(hn(t.path,t.state));for(let s of t.servers){let r=s.url||[s.command,...s.args].map((a)=>JSON.stringify(a)).join(" ");if(n.append(hn(s.name,s.status),Xn(r)),s.cwd)n.append(Pe("small","bp-context-path",s.cwd))}if(t.error)n.append(Pe("p","bp-warn",t.error));let i=t.state==="Untrusted"?"trust":t.state==="Enabled"?"disable":t.state==="Disabled"?"enable":"";if(i){let s=i==="trust"?m("thread.context.trust","Trust and enable"):i==="disable"?m("thread.context.disable","Disable"):m("thread.context.enable","Enable"),r=Vt(s,()=>{this.load({action:i,path:t.path,sha256:t.sha256})},i==="trust");r.disabled=this.busy;let a=Pe("div","bp-context-actions");a.append(r),n.append(a)}this.body.append(n)}}}function da(e,t){if(e.settled)return!1;if(e.state==="done"||e.state==="stopped")return!1;if(!t)return!0;let n=e.working??0,i=Boolean(e.monitoring),s=Boolean(_n(e.need))||e.word==="needs";return(n>0||i)&&e.state!=="paused"||s}function pa(e){if(e.wake)return{icon:"◷",label:"Snoozed",tone:"dim"};let t=(e.label??"").trim(),n=(e.tone??"").trim();if(t){let s=t.toLowerCase();return{icon:s==="approve"||s==="sign in"?"!":s==="input"?"?":s==="failed"||s==="stopped"?"×":s==="working"||s==="running"?"▸":s==="waiting"?"◌":s==="done"?"✓":"•",label:t,tone:n==="bad"?s==="failed"||s==="stopped"?"bad-out":"bad":n==="run"?"run":n==="wait"?"wait":n==="ok"?"ok":"dim"}}let i=e.word||"";if(i==="needs"){if(e.want==="approval")return{icon:"!",label:"Approve",tone:"bad"};if(e.want==="sign-in")return{icon:"!",label:"Sign in",tone:"bad"};return{icon:"?",label:"Input",tone:"bad"}}if(i==="failed"||e.status==="failed"||e.state==="fail")return{icon:"×",label:"Failed",tone:"bad-out"};if(i==="cut"||i==="interrupted")return{icon:"×",label:"Stopped",tone:"bad-out"};if(i==="running"||e.status==="active"||e.status==="working"||e.state==="run")return{icon:"▸",label:"Working",tone:"run"};if(i==="monitoring"||i==="limit"||e.status==="waiting")return{icon:"◌",label:"Waiting",tone:"wait"};if(i==="done"||e.status==="finished")return{icon:"✓",label:"Done",tone:"ok"};return null}var Us="http://www.w3.org/2000/svg";function bt(e,t=14,n=""){let i=document.createElementNS(Us,"svg");if(i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("width",String(t)),i.setAttribute("height",String(t)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.75"),i.setAttribute("stroke-linecap","square"),i.setAttribute("stroke-linejoin","miter"),i.setAttribute("aria-hidden","true"),n)i.classList.add(...n.split(" "));for(let s of e){let r=document.createElementNS(Us,"path");r.setAttribute("d",s),i.appendChild(r)}return i}function Ws(){return bt(["M3 6h6l2 2h10v11H3z"],14,"bp-folder-icon")}function _s(e=14,t="bp-folder-icon bp-hw-icon"){return bt(["M3 3h18v18H3z","M9 3v6h6","M9 21v-6","M15 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","M9 15a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],e,t)}function ha(e=13){return bt(["M6 6h12v12H6z","M9 2v4","M15 2v4","M9 18v4","M15 18v4","M2 9h4","M2 15h4","M18 9h4","M18 15h4"],e)}function ua(e=15){return bt(["M4 10V4l4 3h8l4-3v6l-2 9H6z","M9 13h1","M14 13h1","M11 16h2"],e,"bp-cat-glyph")}function ma(e=11){return bt(["M4 12l5 5 11-11"],e)}function ba(e=11){return bt(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 6v6l4 2"],e)}function ga(e=11){return bt(["M12 17v5","M8 4h8l-1 5 3 3v2H6v-2l3-3z"],e,"bp-pin-icon")}function zs(e){if(!e)return"";let t=e<10000000000?e*1000:e,n=Math.max(0,Math.floor((Date.now()-t)/1000));if(n<60)return"now";if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400)return`${Math.floor(n/3600)}h`;return`${Math.floor(n/86400)}d`}function fa(e){let t=e.replace(/^@/,"").trim();if(!t)return"?";let n=t.split(/[\s_-]+/).filter(Boolean);if(n.length>=2)return(n[0][0]+n[1][0]).toUpperCase();return t.slice(0,2).toUpperCase()}function Zn(e){if(e==="wait"||e==="error")return"bp-mood-wait";if(e==="work"||e==="talk")return"bp-mood-work";return"bp-mood-idle"}function Qe(e){let t=e.lastIndexOf("|");return t>=0?e.slice(t+1):e}class ei{el;hostLabel;homeBanner;crewEl;filterInput;listEl;connEl;filterText="";allFilter="all";snoozeMenuRowId="";collapsedProjects=new Set;addShown=!1;sections=null;projects=[];selectedProjectId="";threads=[];bots=[];rooms=[];selectedThreadId="";cb;needErr=new Map;needBusy=new Set;constructor(e,t){this.el=e,this.cb=t;let n=document.createElement("div");n.className="bp-side-host";let i=document.createElement("div");i.className="bp-side-host-left",this.hostLabel=document.createElement("span"),this.hostLabel.textContent="This computer";let s=document.createElement("span");s.className="bp-dim",s.textContent="›",i.append(this.hostLabel,s);let r=document.createElement("button");r.type="button",r.className="icon bp-side-collapse",r.textContent="‹",r.title="Collapse sidebar",r.setAttribute("aria-label","Collapse sidebar"),r.setAttribute("data-testid","sidebar-collapse"),r.addEventListener("click",()=>this.cb.onCollapseSidebar?.()),n.append(i,r);let a=document.createElement("div");a.className="bp-side-head",this.filterInput=document.createElement("input"),this.filterInput.type="search",this.filterInput.className="bp-input bp-side-search";let o=m("sidebar.search.projects","Search projects, threads…");this.filterInput.placeholder=o,this.filterInput.setAttribute("aria-label",o),this.filterInput.setAttribute("data-testid","sidebar-filter"),this.filterInput.addEventListener("input",()=>{this.filterText=this.filterInput.value.trim().toLowerCase(),this.render()});let c=document.createElement("button");c.type="button",c.className="icon bp-side-add",c.textContent="+",c.title=m("thread.new","New thread"),c.setAttribute("aria-label",m("thread.new","New thread")),c.setAttribute("data-testid","sidebar-new-thread"),c.addEventListener("click",()=>{let l=this.firstProjectId();if(l)this.cb.onNewThread(l)}),a.append(this.filterInput,c),this.homeBanner=document.createElement("div"),this.homeBanner.className="bp-side-home bp-hidden",this.homeBanner.setAttribute("data-testid","home-away-banner"),this.homeBanner.style.padding="6px 10px",this.homeBanner.style.fontSize="11px",this.homeBanner.style.borderBottom="1px solid var(--line, #2a2a2a)",this.crewEl=document.createElement("div"),this.crewEl.className="bp-crew-band bp-hidden",this.crewEl.setAttribute("data-testid","sidebar-crew"),this.listEl=document.createElement("div"),this.listEl.className="bp-side-list",this.listEl.setAttribute("data-testid","sidebar-list");let p=document.createElement("div");p.className="bp-side-footer",this.connEl=document.createElement("span"),this.connEl.className="bp-conn-status",this.connEl.textContent="Connecting…",this.connEl.setAttribute("data-testid","conn-status"),p.appendChild(this.connEl),this.el.append(n,a,this.homeBanner,this.crewEl,this.listEl,p)}setHome(e){if(!e){this.homeBanner.classList.add("bp-hidden"),this.homeBanner.textContent="";return}let t="",n=!1;if(e.moving?.state==="moving")t=e.moving.step?m("home.moving.step","Moving home to {to}: {step}").replace("{to}",e.moving.to).replace("{step}",e.moving.step):m("home.moving","Moving home to {to}…").replace("{to}",e.moving.to);else if(e.moving?.state==="failed")t=e.moving.note?m("home.move.failed.note","Home move failed: {note}").replace("{note}",e.moving.note):m("home.move.failed","Home move failed"),n=!0;else if(!e.online){let i=e.name||"home",s="";if(e.awaySince&&e.awaySince>0){let r=new Date(e.awaySince);s=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`}if(s&&e.queuedCount>0)t=m("home.away.since.queued","Home ({name}) is away since {time} · {n} queued").replace("{name}",i).replace("{time}",s).replace("{n}",String(e.queuedCount));else if(s)t=m("home.away.since","Home ({name}) is away since {time}").replace("{name}",i).replace("{time}",s);else if(e.queuedCount>0)t=m("home.away.queued","Home ({name}) is away · {n} queued").replace("{name}",i).replace("{n}",String(e.queuedCount));else t=m("home.away","Home ({name}) is away").replace("{name}",i)}if(!t)this.homeBanner.classList.add("bp-hidden"),this.homeBanner.textContent="";else this.homeBanner.textContent=t,this.homeBanner.className=n?"bp-side-home bp-bad":"bp-side-home bp-dim",this.homeBanner.classList.remove("bp-hidden")}setHostName(e){this.hostLabel.textContent=e||"This computer"}setConnStatus(e,t){this.connEl.textContent=e,this.connEl.className=`bp-conn-status ${t}`.trim()}setData(e,t,n,i){this.projects=e,this.threads=t,this.bots=n,this.rooms=i,this.render()}setSections(e,t,n){this.sections=e,this.bots=t,this.rooms=n,this.render()}setSelected(e){this.selectedThreadId=e,this.render()}setSelectedProject(e){if(this.selectedProjectId===e)return;this.selectedProjectId=e,this.render()}makeFoldChevron(e,t){let n=document.createElement("button");n.type="button",n.className="bp-proj-chev"+(e?" folded":""),n.textContent=e?"▸":"▾";let i=e?m("web.home.unfold","Show threads"):m("web.home.fold","Hide threads");return n.title=i,n.setAttribute("aria-label",i),n.setAttribute("aria-expanded",e?"false":"true"),n.setAttribute("data-testid",`project-fold-${t}`),n}focusFilter(){this.filterInput.focus()}firstProjectId(){if(this.sections){for(let e of this.sections)if(e.kind==="projects"&&e.rows.length>0){let t=e.rows[0];if(t.id&&!t.off)return t.id}}return this.projects[0]?.id??""}refreshLocale(){let e=m("sidebar.search.projects","Search projects, threads…");this.filterInput.placeholder=e,this.filterInput.setAttribute("aria-label",e),this.render()}renderCrewBand(e){let t=this.bots.find((c)=>c.uber),n=this.bots.filter((c)=>!c.uber&&(!e||c.name.toLowerCase().includes(e))),i=this.rooms.filter((c)=>!e||c.name.toLowerCase().includes(e)),s=Boolean(t&&(!e||t.name.toLowerCase().includes(e))),r=n.length>0||Boolean(this.cb.onNewBot)&&!e,a=i.length>0||Boolean(this.cb.onNewRoom)&&!e;if(!s&&!r&&!a){this.crewEl.classList.add("bp-hidden"),this.crewEl.replaceChildren();return}let o=document.createDocumentFragment();if(s&&t){let c=document.createElement("button");c.type="button",c.className="bp-crew-uber"+(t.thread===this.selectedThreadId?" active":""),c.setAttribute("data-testid",`crew-uber-${t.id}`);let p=document.createElement("span");if(p.className=`bp-crew-uber-avatar ${Zn(t.mood)}`,t.color)p.style.color=t.color;p.appendChild(ua(14));let l=document.createElement("span");l.className="bp-crew-uber-meta";let h=document.createElement("span");if(h.className="bp-crew-uber-name",h.textContent=t.name,l.appendChild(h),t.note){let d=document.createElement("span");d.className=`bp-crew-uber-note ${Zn(t.mood)}`,d.textContent=t.note,l.appendChild(d)}if(c.append(p,l),t.mood==="wait"||t.mood==="error"){let d=document.createElement("span");d.className="bp-status-pill bp-pill-bad",d.textContent="? Input",c.appendChild(d)}c.addEventListener("click",()=>this.cb.onSelectBot(t)),o.appendChild(c)}if(r){let c=document.createElement("div");c.className="bp-crew-bots",c.setAttribute("data-testid","crew-bots");let p=document.createElement("span");p.className="bp-crew-lbl",p.textContent=m("tour.title.bots","Bots").toUpperCase(),c.appendChild(p);let l=document.createElement("div");l.className="bp-crew-bot-tiles";for(let h of n){let d=document.createElement("button");if(d.type="button",d.className=`bp-crew-bot-tile ${Zn(h.mood)}`+(h.thread===this.selectedThreadId?" active":""),d.title=h.note?`@${h.name} — ${h.note}`:`@${h.name}`,d.setAttribute("aria-label",`@${h.name}`),d.setAttribute("data-testid",`crew-bot-${h.id}`),h.color)d.style.setProperty("--bot-c",h.color);let u=document.createElement("span");if(u.className="bp-crew-bot-init",u.textContent=fa(h.name),d.appendChild(u),h.mood==="wait"||h.mood==="error"){let f=document.createElement("span");f.className="bp-crew-bot-wait",d.appendChild(f)}d.addEventListener("click",()=>this.cb.onSelectBot(h)),l.appendChild(d)}if(this.cb.onNewBot&&!e){let h=document.createElement("button");h.type="button",h.className="bp-crew-bot-tile bp-crew-add",h.textContent="+",h.title=m("bots.new","New bot"),h.setAttribute("aria-label",m("bots.new","New bot")),h.setAttribute("data-testid","crew-new-bot"),h.addEventListener("click",()=>this.cb.onNewBot?.()),l.appendChild(h)}c.appendChild(l),o.appendChild(c)}if(a){let c=document.createElement("div");c.className="bp-crew-rooms",c.setAttribute("data-testid","crew-rooms");for(let p of i){let l=document.createElement("button");l.type="button",l.className="bp-crew-room-chip",l.setAttribute("data-testid",`crew-room-${p.id}`);let h=document.createElement("span");h.className="bp-dim",h.textContent="#";let d=document.createElement("span");if(d.textContent=p.name,l.append(h,d),p.members!==void 0&&p.members>0){let u=document.createElement("span");u.className="bp-crew-room-cnt",u.textContent=String(p.members),l.appendChild(u)}l.title=p.members?`#${p.name} (${p.members})`:`#${p.name}`,l.addEventListener("click",()=>this.cb.onSelectRoom?.(p)),c.appendChild(l)}if(this.cb.onNewRoom&&!e){let p=document.createElement("button");p.type="button",p.className="bp-crew-room-chip bp-crew-add",p.textContent="+",p.title=m("rooms.new","New room"),p.setAttribute("aria-label",m("rooms.new","New room")),p.setAttribute("data-testid","crew-new-room"),p.addEventListener("click",()=>this.cb.onNewRoom?.()),c.appendChild(p)}o.appendChild(c)}this.crewEl.classList.remove("bp-hidden"),this.crewEl.replaceChildren(o)}projectsHead(e){let t=document.createElement("div");if(t.className="bp-side-section-head",!this.cb.onAddProject||this.addShown)return t.textContent=e,t;this.addShown=!0,t.classList.add("bp-side-section-row");let n=document.createElement("span");n.textContent=e;let i=document.createElement("button");i.type="button",i.className="bp-side-sec-plus bp-side-sec-btn",i.textContent="+";let s=m("sidebar.add.project","Add project");return i.title=s,i.setAttribute("aria-label",s),i.setAttribute("data-testid","sidebar-add-project"),i.addEventListener("click",(r)=>{r.stopPropagation(),this.cb.onAddProject?.()}),t.append(n,i),t}renderStatusPill(e,t){let n=document.createElement("span");if(n.className=`bp-status-pill bp-pill-${e.tone}`,n.textContent=`${e.icon} ${e.label}`,t)n.title=t;return n}renderRowActions(e){if(e.off)return null;let t=Array.isArray(e.snooze)&&e.snooze.length>0&&Boolean(this.cb.onSnoozeRow),n=Boolean(e.wake)&&Boolean(this.cb.onSnoozeRow),i=e.kind==="swarm",s=Boolean(e.settle)&&(!i||Boolean(this.cb.onSettleSwarm));if(!t&&!n&&!s)return null;let r=document.createElement("span");if(r.className="bp-row-acts",n&&e.wake){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-wake-btn",a.textContent=m("menu.wake","Wake"),a.title=m("menu.wake","Wake snoozed thread"),a.setAttribute("data-testid",`wake-row-${e.id}`),a.addEventListener("click",(o)=>{o.stopPropagation(),this.cb.onSnoozeRow?.(e.wake)}),r.appendChild(a)}if(t&&e.snooze){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-snooze-btn",a.title=m("menu.snooze","Snooze thread"),a.setAttribute("aria-label",m("menu.snooze","Snooze thread")),a.setAttribute("data-testid",`snooze-row-${e.id}`),a.appendChild(ba(11)),a.addEventListener("click",(o)=>{o.stopPropagation(),this.snoozeMenuRowId=this.snoozeMenuRowId===e.id?"":e.id,this.render()}),r.appendChild(a)}if(s&&e.settle){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-settle-btn",a.title=m("menu.settle","Settle"),a.setAttribute("aria-label",m("menu.settle","Settle")),a.setAttribute("data-testid",`settle-row-${e.id}`),a.appendChild(ma(11)),a.addEventListener("click",(o)=>{if(o.stopPropagation(),i)this.cb.onSettleSwarm?.(Qe(e.settle));else this.cb.onThreadAct(Qe(e.settle),"settle")}),r.appendChild(a)}return r}renderSectionThreadRow(e,t,n=!1){let i=document.createElement("div");i.className="bp-thread-row"+(n?" bp-inbox-row":"")+(!this.selectedProjectId&&(e.id===this.selectedThreadId||Qe(e.id)===this.selectedThreadId)?" active":"")+(e.off?" bp-dim":""),i.setAttribute("data-thread-id",e.id),i.setAttribute("data-testid",`thread-row-${e.id}`);let s=pa(e),r=this.renderRowActions(e);if(n){let l=document.createElement("div");l.className="bp-inbox-main";let h=document.createElement("div");h.className="bp-inbox-top";let d=document.createElement("div");if(d.className="bp-thread-title",d.textContent=e.title||"Untitled thread",h.appendChild(d),r)h.appendChild(r);let u=document.createElement("div");if(u.className="bp-inbox-meta",s)u.appendChild(this.renderStatusPill(s,e.say));if(e.project){let f=document.createElement("span");f.className="bp-inbox-proj",f.textContent=e.project,u.appendChild(f)}if(e.ago){let f=document.createElement("span");if(f.className="bp-thread-age",f.textContent=e.ago,e.pinned)f.title=m("tools.pinned","Pinned");u.appendChild(f)}l.append(h,u),i.appendChild(l)}else{if(t){let h=document.createElement("span");h.className="bp-tree-branch",h.setAttribute("aria-hidden","true"),i.appendChild(h)}if(s)i.appendChild(this.renderStatusPill(s,e.say));let l=document.createElement("div");if(l.className="bp-thread-title",l.textContent=e.title||"Untitled thread",i.appendChild(l),r)i.appendChild(r);if(e.ago){let h=document.createElement("span");if(h.className="bp-thread-age",h.textContent=e.ago,e.pinned)h.title=m("tools.pinned","Pinned");i.appendChild(h)}}let a=e.nav||e.id;if(!e.off&&a&&!a.startsWith("@room:"))i.addEventListener("click",()=>this.cb.onSelectThread(Qe(a)));let o=this.snoozeMenuRowId===e.id&&Array.isArray(e.snooze)&&e.snooze.length>0,c=e.kind==="swarm"?_n(e.need):null;if(!c&&!o)return i;let p=document.createElement("div");if(p.className="bp-need-wrap",p.appendChild(i),o&&e.snooze){let l=document.createElement("div");l.className="bp-snooze-bar"+(t?" nested":""),l.setAttribute("data-testid",`snooze-bar-${e.id}`);let h=document.createElement("span");h.className="bp-dim",h.textContent="Snooze:",l.appendChild(h);for(let d of e.snooze){let u=document.createElement("button");u.type="button",u.className="bp-snooze-opt",u.textContent=d.label,u.addEventListener("click",(f)=>{f.stopPropagation(),this.snoozeMenuRowId="",this.cb.onSnoozeRow?.(d.value),this.render()}),l.appendChild(u)}p.appendChild(l)}if(c){let l=document.createElement("div");l.className="bp-need"+(t?" nested":"")+(e.off?" bp-dim":""),l.setAttribute("data-testid",`need-${e.id}`);let h=document.createElement("span");h.className="bp-need-line",h.textContent=c.line,h.title=c.line,l.appendChild(h);for(let u of c.actions){if(!dn(u,Boolean(this.cb.hasRoomView)))continue;let f=document.createElement("button");f.type="button",f.className="bp-need-btn",f.textContent=u.label,f.setAttribute("data-testid",`need-${u.act}-${e.id}`),f.disabled=Boolean(e.off)||this.needBusy.has(e.id)||!this.cb.onNeedAct,f.addEventListener("click",(b)=>{b.stopPropagation();let v=this.cb.onNeedAct;if(!v)return;this.needErr.delete(e.id),this.needBusy.add(e.id),this.render(),v(u).catch((y)=>{this.needErr.set(e.id,y instanceof Error?y.message:String(y))}).finally(()=>{this.needBusy.delete(e.id),this.render()})}),l.appendChild(f)}p.appendChild(l);let d=this.needErr.get(e.id);if(d){let u=document.createElement("div");u.className="bp-need-err"+(t?" nested":""),u.textContent=d,p.appendChild(u)}}return p}renderHubSections(e,t){let n=this.sections??[],i=new Set;for(let a of n)if(a.kind==="threads")for(let o of a.rows)i.add(o.id),i.add(Qe(o.id));else if(a.kind==="projects")for(let o of a.rows)for(let c of o.threads??[])i.add(c.id),i.add(Qe(c.id));let s=this.selectedThreadId?this.threads.find((a)=>a.id===this.selectedThreadId)??null:null,r=!1;for(let a of n)if(a.kind==="projects"&&(a.rows.length>0||(a.count??0)>0))r=!0;for(let a of n){if(a.kind==="bub")continue;if(a.kind==="threads"){let o=Boolean(a.fold&&a.toggle),c=a.rows.filter((l)=>{if(!t)return!0;return`${l.title} ${l.project??""}`.toLowerCase().includes(t)});if(!o&&c.length===0)continue;if(o&&t&&c.length===0)continue;if(o&&!t&&(a.count??c.length)===0)continue;let p=document.createElement("section");if(p.className=`bp-side-section bp-side-inbox bp-sec-${a.id}`,p.setAttribute("data-section-id",a.id),o){let l=document.createElement("button");l.type="button",l.className="bp-side-section-head bp-side-section-toggle";let h=t?c.length:a.count??c.length,d=a.open||Boolean(t)?"▾":"▸";if(l.textContent=`${d} ${a.title.toUpperCase()} (${h})`,a.hint)l.title=a.hint;l.setAttribute("data-testid",`section-toggle-${a.id}`),l.addEventListener("click",()=>{if(a.toggle)this.cb.onToggleSection?.(a.toggle)}),p.appendChild(l)}else{let l=document.createElement("div");l.className="bp-side-section-head"+(a.id==="needs"?" bp-head-needs":a.id==="running"?" bp-head-running":""),l.textContent=`${a.title.toUpperCase()} ${c.length}`,p.appendChild(l)}if(!o||Boolean(a.open)||Boolean(t))for(let l of c)p.appendChild(this.renderSectionThreadRow(l,!1,!0));e.appendChild(p);continue}if(a.kind==="projects"){let o=a.rows,c=o.filter((d)=>{if(!t)return!0;if((d.title||d.id).toLowerCase().includes(t))return!0;if((d.threads??[]).some((u)=>u.title.toLowerCase().includes(t)))return!0;if((d.swarms??[]).some((u)=>u.title.toLowerCase().includes(t)))return!0;return!1}),p=Boolean(a.fold&&a.toggle);if(t&&c.length===0)continue;if(!p&&a.id!=="active"&&c.length===0)continue;let l=document.createElement("section");if(l.className=`bp-side-section bp-sec-${a.id}`,l.setAttribute("data-section-id",a.id),p){let d=document.createElement("button");d.type="button",d.className="bp-side-section-head bp-side-section-toggle";let u=t?c.length:a.count??c.length,f=a.open||Boolean(t)?"▾":"▸";if(d.textContent=`${f} ${a.title.toUpperCase()} (${u})`,a.hint)d.title=a.hint;d.setAttribute("data-testid",`section-toggle-${a.id}`),d.addEventListener("click",()=>{if(a.toggle)this.cb.onToggleSection?.(a.toggle)}),l.appendChild(d)}else l.appendChild(this.projectsHead(a.title.toUpperCase()));if(!p||Boolean(a.open)||Boolean(t)){if(a.id==="all"&&!t){let d=o.some((f)=>f.hasBoard||f.hasSchematic),u=o.some((f)=>!f.hasBoard&&!f.hasSchematic);if(d&&u){let f=document.createElement("div");f.className="bp-proj-filter",f.setAttribute("data-testid","all-projects-filter");let b=[{id:"all",label:"All"},{id:"hw",label:"Boards"},{id:"sw",label:"Code"}];for(let v of b){let y=document.createElement("button");y.type="button",y.className="bp-proj-filter-btn"+(this.allFilter===v.id?" active":""),y.textContent=v.label,y.addEventListener("click",()=>{this.allFilter=v.id,this.render()}),f.appendChild(y)}if(l.appendChild(f),this.allFilter==="hw")c=c.filter((v)=>v.hasBoard||v.hasSchematic);else if(this.allFilter==="sw")c=c.filter((v)=>!v.hasBoard&&!v.hasSchematic)}}if(a.id==="active"&&!r&&!t){let d=document.createElement("div");d.className="bp-side-empty",d.textContent="No projects yet.",l.appendChild(d)}for(let d of c){let u=document.createElement("div");if(u.className="bp-proj-group"+(d.off||a.id==="quiet"?" bp-dim":""),u.setAttribute("data-project-id",d.id),d.nav||d.key)u.setAttribute("data-project-key",d.nav||d.key||"");let f=document.createElement("div");f.className="bp-proj-head";let b=document.createElement("button");b.type="button",b.className="bp-proj-toggle";let y=Boolean(d.hasBoard||d.hasSchematic)?_s(14):Ws();if(d.css)y.style.color=d.css;let w=document.createElement("span");w.className="bp-proj-name",w.textContent=d.title||d.id,b.append(y,w);let C=d.fold==="project-fold"&&Boolean(d.nav),L=()=>{if(C)this.cb.onToggleProjectFold?.(d.nav)};if(!d.off&&this.cb.canOpenProject?.())b.title=m("web.home.open","Open project home");if(b.setAttribute("data-testid",`project-open-${d.id}`),this.selectedProjectId&&Qe(d.id)===this.selectedProjectId)f.classList.add("active");b.addEventListener("click",()=>{if(d.off||!this.cb.onOpenProject?.(d.id))L()});let N=this.makeFoldChevron(Boolean(d.folded),d.id);if(C)N.addEventListener("click",(x)=>{x.stopPropagation(),L()});else N.disabled=!0;f.appendChild(N);let A=document.createElement("div");if(A.className="bp-proj-meta",(d.needsCount??0)>0){let x=document.createElement("span");x.className="bp-proj-badge-need",x.textContent=String(d.needsCount),x.title=`${d.needsCount} needing you`,A.appendChild(x)}if((d.running??0)>0){let x=document.createElement("span");x.className="bp-proj-badge-run",x.textContent=String(d.running),x.title=`${d.running} running`,A.appendChild(x)}if(d.pinned&&a.id!=="pinned")A.appendChild(ga(11));let B=document.createElement("div");if(B.className="bp-proj-acts",!d.off&&this.cb.onQuickOpenViewer){if(d.hasBoard){let x=document.createElement("button");x.type="button",x.className="bp-proj-quick",x.title=m("viewer.board","Open Board"),x.setAttribute("aria-label",`Open Board (${d.title})`),x.setAttribute("data-testid",`quick-board-${d.id}`),x.appendChild(_s(13,"")),x.addEventListener("click",(Y)=>{Y.stopPropagation(),this.cb.onQuickOpenViewer?.(Qe(d.id),"board")}),B.appendChild(x)}if(d.hasSchematic){let x=document.createElement("button");x.type="button",x.className="bp-proj-quick",x.title=m("viewer.schematic","Open Schematic"),x.setAttribute("aria-label",`Open Schematic (${d.title})`),x.setAttribute("data-testid",`quick-sch-${d.id}`),x.appendChild(ha(13)),x.addEventListener("click",(Y)=>{Y.stopPropagation(),this.cb.onQuickOpenViewer?.(Qe(d.id),"schematic")}),B.appendChild(x)}}let M=document.createElement("button");if(M.type="button",M.className="icon bp-proj-add",M.title=m("thread.new","New thread"),M.textContent="+",M.setAttribute("data-testid",`new-thread-${d.id}`),d.off)M.disabled=!0;M.addEventListener("click",(x)=>{x.stopPropagation(),this.cb.onNewThread(Qe(d.id))}),B.appendChild(M),f.append(b,A,B),u.appendChild(f);let j=Boolean(t)&&(d.title||d.id).toLowerCase().includes(t),O=Boolean(d.folded&&!t);for(let x of d.swarms??[]){if(!da(x,O))continue;if(t&&!j&&!x.title.toLowerCase().includes(t))continue;u.appendChild(this.renderSectionThreadRow(x,!0))}if(!O){for(let x of d.threads??[]){if(t&&!j&&!x.title.toLowerCase().includes(t))continue;u.appendChild(this.renderSectionThreadRow(x,!0))}if(s&&s.project===Qe(d.id)&&!i.has(s.id)&&(!t||j||s.title.toLowerCase().includes(t)))u.appendChild(this.renderSectionThreadRow({id:s.id,title:s.title,status:s.status,state:s.state,ago:zs(s.updatedAt),pinned:s.pinned,nav:s.id},!0))}l.appendChild(u)}}e.appendChild(l)}}}render(){this.addShown=!1;let e=this.filterText;this.renderCrewBand(e);let t=document.createDocumentFragment();if(this.sections!==null)this.renderHubSections(t,e);else{let n=new Map;for(let i of this.threads){if(i.archived||i.swarm)continue;if(e){if(!`${i.title} ${i.preview??""}`.toLowerCase().includes(e))continue}let s=n.get(i.project)??[];s.push(i),n.set(i.project,s)}if(t.appendChild(this.projectsHead("RECENT")),this.projects.length===0&&this.threads.length===0){let i=document.createElement("div");i.className="bp-side-empty",i.textContent="No projects yet.",t.appendChild(i)}for(let i of this.projects){let s=n.get(i.id)??[];if(e&&s.length===0&&!i.title.toLowerCase().includes(e))continue;let r=document.createElement("section");r.className="bp-proj-group",r.setAttribute("data-project-id",i.id);let a=document.createElement("div");a.className="bp-proj-head";let o=document.createElement("button");o.type="button",o.className="bp-proj-toggle";let c=this.collapsedProjects.has(i.id)&&!e,p=Ws();if(i.css)p.style.color=i.css;let l=document.createElement("span");l.className="bp-proj-name",l.textContent=i.title||i.id,o.append(p,l);let h=()=>{if(this.collapsedProjects.has(i.id))this.collapsedProjects.delete(i.id);else this.collapsedProjects.add(i.id);this.render()};if(this.cb.canOpenProject?.())o.title=m("web.home.open","Open project home");if(o.setAttribute("data-testid",`project-open-${i.id}`),this.selectedProjectId&&i.id===this.selectedProjectId)a.classList.add("active");o.addEventListener("click",()=>{if(!this.cb.onOpenProject?.(i.id))h()});let d=this.makeFoldChevron(c,i.id);d.addEventListener("click",(f)=>{f.stopPropagation(),h()}),a.appendChild(d);let u=document.createElement("button");if(u.type="button",u.className="icon bp-proj-add",u.title=m("thread.new","New thread"),u.textContent="+",u.setAttribute("data-testid",`new-thread-${i.id}`),u.addEventListener("click",(f)=>{f.stopPropagation(),this.cb.onNewThread(i.id)}),a.append(o,u),r.appendChild(a),!c)for(let f of s)r.appendChild(this.renderSectionThreadRow({id:f.id,title:f.title,status:f.status,state:f.state,ago:zs(f.updatedAt),pinned:f.pinned,nav:f.id},!0));t.appendChild(r)}}this.listEl.replaceChildren(t)}}function va(e){try{return new URL(e,window.location.origin).searchParams.get("s")||""}catch{return""}}function Ut(e){if(!e)return;for(let t of e.getTracks())try{t.stop()}catch{}}function ya(e,t){if(t===16000){let r=new Int16Array(e.length);for(let a=0;a0?c/p:0));s[r]=l<0?l*32768:l*32767}return s}class ti{hub;cb;active=!1;starting=!1;sessionGen=0;activeGen=0;abortedGen=0;threadId="";sessionKey="";stream=null;audioCtx=null;processor=null;pendingPcm=[];postChain=Promise.resolve();stopDrain=Promise.resolve();mark=0;constructor(e,t){this.hub=e,this.cb=t}isRecording(){return this.active||this.starting}async toggle(){if(this.active||this.starting)await this.stop();else await this.start()}async start(){if(this.active||this.starting)return;let e=this.cb.getThreadId();if(!e)return;if(!navigator.mediaDevices?.getUserMedia){this.cb.showError("Microphone access is not available in this browser.");return}let t=++this.sessionGen;this.starting=!0,this.threadId=e,this.sessionKey="",this.pendingPcm=[],this.mark=this.cb.getCaret(),this.cb.setRecording(!0);let n;try{n=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{if(t===this.sessionGen)this.starting=!1,this.cb.setRecording(!1),this.cb.showError("Microphone permission denied.");return}if(t!==this.sessionGen||this.cb.getThreadId()!==e){Ut(n);return}if(this.stream=n,await this.stopDrain,t!==this.sessionGen||this.cb.getThreadId()!==e){if(Ut(n),this.stream===n)this.stream=null;return}try{let i=await this.hub.rpc("voice.start",{thread:e,draft:this.cb.getDraft(),caret:this.mark});if(t!==this.sessionGen||this.cb.getThreadId()!==e){if(Ut(n),this.stream===n)this.stream=null;if(!this.active&&!this.starting)this.hub.rpc("voice.stop",{thread:e}).catch(()=>{});return}let s=i.session||(i.path?va(i.path):"");if(!s)throw Error("Hub did not return a voice session.");this.sessionKey=s,this.activeGen=t,this.starting=!1,this.active=!0,this.startCapture(n,t)}catch(i){if(t===this.sessionGen)this.cleanupAudio(),this.starting=!1,this.active=!1,this.cb.setRecording(!1),this.cb.showError(i instanceof Error?i.message:"Could not start voice dictation.");else if(Ut(n),this.stream===n)this.stream=null}}async stop(){if(!this.active&&!this.starting)return;let e=this.activeGen,t=this.active,n=this.threadId,i=this.sessionKey;this.sessionGen++,this.starting=!1,this.active=!1,this.sessionKey="",this.cb.setRecording(!1),this.cb.setLevel(0),this.cleanupAudio();let r=this.stopDrain.then(async()=>{if(t&&i){let a=new Int16Array(this.pendingPcm);this.pendingPcm=[],this.enqueuePost(i,new Uint8Array(a.buffer),!0,e),await this.postChain}else this.pendingPcm=[];if(t&&n)await this.hub.rpc("voice.stop",{thread:n}).catch(()=>{})});this.stopDrain=r,await r}cancel(){if(!this.active&&!this.starting)return;let e=this.active,t=this.threadId;if(this.abortedGen=Math.max(this.abortedGen,this.sessionGen),this.sessionGen++,this.starting=!1,this.active=!1,this.sessionKey="",this.pendingPcm=[],this.cb.setRecording(!1),this.cb.setLevel(0),this.cleanupAudio(),e&&t&&this.hub.getState()==="connected")this.hub.rpc("voice.stop",{thread:t}).catch(()=>{})}handleFrame(e){let t=String(e.ev??""),n=String(e.thread??"");if(n&&this.cb.getThreadId()&&n!==this.cb.getThreadId())return;if(t==="draft"&&typeof e.text==="string")this.cb.setDraft(e.text),this.mark=e.text.length;else if(t==="edit"){let i=this.cb.getDraft(),s=Number(e.del??0),r=String(e.ins??""),a=Math.max(0,Math.min(i.length,this.mark)),o=Math.max(0,a-s),c=i.slice(0,o)+r+i.slice(a);this.mark=o+r.length,this.cb.setDraft(c)}else if(t==="level")this.cb.setLevel(Math.max(0,Math.min(100,Number(e.v??0))));else if(t==="view"){let i=e.view;if(i&&i.on===!1&&(this.active||this.starting))this.stop()}}startCapture(e,t){let i=new(window.AudioContext||window.webkitAudioContext),s=i.createMediaStreamSource(e),r=i.createScriptProcessor(4096,1,1);r.onaudioprocess=(a)=>{if(!this.active||t!==this.sessionGen||!this.sessionKey)return;let o=ya(a.inputBuffer.getChannelData(0),i.sampleRate);for(let c=0;c=3200){let c=new Int16Array(this.pendingPcm.splice(0,3200));this.enqueuePost(this.sessionKey,new Uint8Array(c.buffer),!1,t)}},s.connect(r),r.connect(i.destination),this.audioCtx=i,this.processor=r}enqueuePost(e,t,n,i){this.postChain=this.postChain.then(async()=>{if(i<=this.abortedGen)return;try{let s={"Content-Type":"application/octet-stream","X-Voice-Session":e};if(n)s["X-Voice-End"]="1";let r=await fetch("/voice/in",{method:"POST",credentials:"same-origin",headers:s,body:t});if(!r.ok&&!n&&i===this.sessionGen&&this.active)this.failUpload(`Voice upload failed (${r.status}).`)}catch{if(!n&&i===this.sessionGen&&this.active)this.failUpload("Voice upload failed.")}})}failUpload(e){this.abortedGen=Math.max(this.abortedGen,this.sessionGen),this.sessionGen++,this.active=!1,this.starting=!1,this.sessionKey="",this.pendingPcm=[],this.cleanupAudio(),this.cb.setRecording(!1),this.cb.setLevel(0),this.cb.showError(e)}cleanupAudio(){if(this.processor)this.processor.disconnect(),this.processor.onaudioprocess=null,this.processor=null;if(this.audioCtx)this.audioCtx.close().catch(()=>{}),this.audioCtx=null;Ut(this.stream),this.stream=null}}var qs=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Ks=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Js=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Ys=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wa=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Wt(e,t){let n=new Int32Array(16),i=0;for(let o=0;o0){if(n[c]++,c>i)i=c}}let s=new Int32Array(16),r=0;for(let o=1;o<=15;o++)s[o]=r,r+=n[o];let a=new Int32Array(r);for(let o=0;o0)a[s[c]++]=o}return{counts:n,symbols:a,maxBits:i}}var Ea=(()=>{let e=new Uint8Array(288);return e.fill(8,0,144),e.fill(9,144,256),e.fill(7,256,280),e.fill(8,280,288),Wt(e,288)})(),ka=(()=>{let e=new Uint8Array(32);return e.fill(5),Wt(e,32)})();class ni{win=new Uint8Array(32768);winPos=0;feed(e,t=16777216){let n=0,i=0,s=0,r=(h)=>{while(s=e.length)throw Error("truncated deflate frame");i|=e[n++]<>>=h,s-=h,d},a=(h)=>{let d=0,u=0,f=0;for(let b=1;b<=h.maxBits;b++){d|=r(1);let v=h.counts[b];if(d-v{let d=c+h;if(d>t)throw Error("inflated frame exceeds limit");if(d<=o.length)return;let u=o.length;while(u{p(1),o[c++]=h,this.win[this.winPos]=h,this.winPos=this.winPos+1&32767};while(n0){if(n>=e.length&&s<3)break;let h=r(1),d=r(2);if(d===0){if(i=0,s=0,n+4>e.length)throw Error("truncated stored block");let u=e[n]|e[n+1]<<8,f=e[n+2]|e[n+3]<<8;if(n+=4,(u^65535)!==f)throw Error("invalid stored block length");if(n+u>e.length)throw Error("truncated stored payload");p(u);for(let b=0;b=e.length)break}else if(d===1||d===2){let u=Ea,f=ka;if(d===2){let b=r(5)+257,v=r(5)+1,y=r(4)+4,w=new Uint8Array(19);for(let B=0;BL)throw Error("code length overflow");for(let O=0;OL)throw Error("code length overflow");A+=M}else if(B===18){let M=r(7)+11;if(A+M>L)throw Error("code length overflow");A+=M}else throw Error("invalid code length symbol")}u=Wt(N,b),f=Wt(N.subarray(b),v)}while(!0){let b=a(u);if(b<256)l(b);else if(b===256)break;else{let v=b-257;if(v>=qs.length)throw Error("invalid length symbol");let y=qs[v]+(Ks[v]?r(Ks[v]):0),w=a(f);if(w>=Js.length)throw Error("invalid distance symbol");let C=Js[w]+(Ys[w]?r(Ys[w]):0);p(y);let L=this.winPos-C&32767;for(let N=0;N{this.stateListeners.delete(e)}}onFrame(e){return this.frameListeners.add(e),()=>{this.frameListeners.delete(e)}}onBinary(e){return this.binaryListeners.add(e),()=>{this.binaryListeners.delete(e)}}rpc(e,t={},n=20000){return new Promise((i,s)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s(Error("Not connected to hub"));return}let r=this.nextId++,a=window.setTimeout(()=>{this.pending.delete(r),s(Error(`RPC timeout: ${e}`))},n);this.pending.set(r,{resolve:i,reject:s,timer:a}),this.ws.send(JSON.stringify({id:r,m:e,p:t}))})}setState(e){this.state=e;for(let t of this.stateListeners)t(e,this.hello)}rejectAllPending(e){for(let[,t]of this.pending)window.clearTimeout(t.timer),t.reject(Error(e));this.pending.clear()}openSocket(){if(this.closed)return;this.inflater=null;let t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?data=1&enc=json&z=deflate`,n=new WebSocket(t);n.binaryType="arraybuffer",this.ws=n;let i=(s)=>{let r;try{r=JSON.parse(s)}catch{return}if(r.t==="hub.restarting")this.restarting={reason:String(r.reason??""),build:String(r.build??""),text:String(r.text??""),at:Date.now()};if(r.t==="hello")this.restarting=null,this.hello=r,this.features=new Set(this.hello.features??[]),this.inflater=this.hello.z==="deflate"?new ni:null,this.reconnectDelay=500,this.setState("connected");else if(r.t==="reply"&&typeof r.id==="number"){let a=this.pending.get(r.id);if(a)if(this.pending.delete(r.id),window.clearTimeout(a.timer),r.ok)a.resolve(r.result??{});else{let o=r.error,c=typeof o==="string"?o:o&&typeof o==="object"&&("message"in o)?String(o.message):"Request failed",p=typeof r.errorCode==="string"?r.errorCode:void 0,l=typeof r.machine==="string"?r.machine:void 0,h=typeof r.thread==="string"?r.thread:void 0;a.reject(new _t(c,{code:p,machine:l,thread:h}))}return}for(let a of this.frameListeners)a(r)};n.addEventListener("message",(s)=>{if(s.data instanceof ArrayBuffer){if(this.inflater){let r;try{r=this.inflater.feed(new Uint8Array(s.data))}catch{n.close();return}if(r.length>0&&r[0]===123)i(this.textDecoder.decode(r));else{let a=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);for(let o of this.binaryListeners)o(a)}return}for(let r of this.binaryListeners)r(s.data);return}if(typeof s.data!=="string")return;i(s.data)}),n.addEventListener("close",(s)=>{if(this.ws===n)this.ws=null;if(this.rejectAllPending("Connection closed"),this.closed)return;if(s.code===4001||s.code===4401||s.code===1008){this.handleRevoked();return}this.probeSessionOrReconnect()}),n.addEventListener("error",()=>{})}async probeSessionOrReconnect(){try{let t=await fetch("/",{method:"GET",credentials:"same-origin",cache:"no-store"});if(t.status===401||t.status===403){this.handleRevoked();return}if(t.ok){if((await t.text()).includes('id="pair-root"')){this.handleRevoked();return}}}catch{}this.setState("reconnecting");let e=this.reconnectDelay;this.reconnectDelay=Math.min(8000,Math.round(this.reconnectDelay*1.6)),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.openSocket()},e)}handleRevoked(){this.closed=!0,this.setState("revoked"),window.location.replace("/")}}var Ca=new TextDecoder;function Xs(e){return e.length>7&&e[0]>=160&&e[0]<=183&&e[1]===1&&e[2]===100&&e[3]===112&&e[4]===108&&e[5]===111&&e[6]===116}function Qs(e){let t=0,n=0;function i(a){if(a<=23)return a;if(a===24){if(t>=e.length)return null;return e[t++]}if(a===25){if(t+2>e.length)return null;let o=e[t]<<8|e[t+1];return t+=2,o}if(a===26){if(t+4>e.length)return null;let o=(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0;return t+=4,o}return null}function s(a){if(n++,a>32||n>400000||t>=e.length)return null;let o=e[t++],c=o>>5,p=i(o&31);if(p===null)return null;switch(c){case 0:return p;case 1:return-1-p;case 2:{if(t+p>e.length)return null;let l=e.subarray(t,t+p);return t+=p,l}case 3:{if(t+p>e.length)return null;let l=Ca.decode(e.subarray(t,t+p));return t+=p,l}case 4:{if(p>e.length)return null;let l=Array(p);for(let h=0;h=this.b.length)return this.ok=!1,0;let n=this.b[this.i++],i=7*t;if(i>=28&&(n&240)!==0)return this.ok=!1,0;if(e=(e|(n&127)<>>0,n<128)return e}return this.ok=!1,0}nextI32(){let e=this.nextU32();return e>>>1^-(e&1)}}function er(e){let t=0xcbf29ce484222325n,n=0x100000001b3n,i=0xffffffffffffffffn;for(let s=0;stypeof e[b]==="number"?e[b]:v,n=t("l",0),i=t("c",0),s=t("a",255)/255,r=t("m",1),a=t("w",0),o=a/2,c=r===0&&a!==0,p=e.d instanceof Uint8Array?e.d:new Uint8Array(0),l=new Zs(p),h=[],d=[],u=0,f=0;while(l.more()){let b=l.nextU32(),v=h.length,y=1/0,w=1/0,C=-1/0,L=-1/0;if(r===2)u=u+l.nextI32()|0,f=f+l.nextI32()|0,h.push(u,f),y=C=u,w=L=f;else{let A=Math.min(l.nextU32(),1048576);for(let B=0;BC)C=u;if(fL)L=f}}let N=(h.length-v)/2;if(N>0){let A=r===2||N===1?2:r===0?0:1,B=r===0?0:o;d.push({info:b,x0:y-B,y0:w-B,x1:C+B,y1:L+B,at:v,n:N,kind:A})}}return{layer:n,color:i,alpha:s,mode:r,r:o,own:c,pts:new Float32Array(h),pieces:d}}function tr(e,t,n){let i=(a)=>Array.isArray(a)&&a.length>=4?[Number(a[0])||0,Number(a[1])||0,Number(a[2])||0,Number(a[3])||0]:[0,0,0,0],s=Array.isArray(e.cs)?e.cs:[],r=[];for(let a=0;a=0&&o0){n.delete(o.h),n.set(o.h,c);while(n.size>1024){let p=n.keys().next().value;if(p!==void 0)n.delete(p);else break}}}}return{key:typeof e.key==="string"?e.key:"",fam:typeof e.fam==="string"?e.fam:"",base:typeof e.base==="string"?e.base:"",box:i(e.box),edge:i(e.edge),thick:typeof e.thick==="number"?e.thick:1600,note:typeof e.note==="string"?e.note:"",warn:typeof e.warn==="number"?e.warn!==0:!1,chunks:r}}function nr(e,t,n,i=!0){if(n.width<=0||n.height<=0||n.naturalWidth<=0||n.naturalHeight<=0)return null;let s=Math.min(n.width/n.naturalWidth,n.height/n.naturalHeight),r=n.naturalWidth*s,a=n.naturalHeight*s,o=n.left+(n.width-r)/2,c=i?n.top:n.top+(n.height-a)/2,p=(e-o)/r,l=(t-c)/a;if(p<0||p>1||l<0||l>1)return null;return{x:Math.max(0,Math.min(1000,Math.round(p*1000))),y:Math.max(0,Math.min(1000,Math.round(l*1000)))}}var ir=[["Enter","Enter"],["Tab","Tab"],["Bksp","Backspace"],["Esc","Escape"],["↑","ArrowUp"],["↓","ArrowDown"],["←","ArrowLeft"],["→","ArrowRight"]];function sr(e){let t=e.trim();if(!t)return"";if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))return t;return`https://${t}`}class si{tail=Promise.resolve();enqueue(e){let t=this.tail.then(e,e);return this.tail=t.catch(()=>{}),t}}function rr(e,t,n){let i=!0,s=!1,r=!1,a="",o=!1,c=!1,p=-1,l=null,h=new si,d=document.createElement("div");d.className="bp-pane bp-browser-pane",d.setAttribute("data-testid","pane-browser");let u=document.createElement("div");u.className="bp-pane-bar bp-browser-nav";function f(Q,ge,k){let P=document.createElement("button");if(P.type="button",P.className="bp-v-btn",P.textContent=Q,P.setAttribute("data-testid",ge),k)P.title=k;return P}let b=f("←","browser-back","Back"),v=f("→","browser-forward","Forward"),y=f("↻","browser-reload","Reload"),w=document.createElement("form");w.className="bp-browser-url-form";let C=document.createElement("input");C.type="text",C.className="bp-browser-input",C.placeholder="https://…",C.autocomplete="off",C.spellcheck=!1,C.setAttribute("data-testid","browser-url");let L=f("Go","browser-go","Navigate");L.type="submit",w.append(C,L);let N=f("Take over","browser-takeover");N.classList.add("is-primary"),u.append(b,v,y,w,N);let A=document.createElement("div");A.className="bp-browser-drive-bar",A.hidden=!0;let B=document.createElement("div");B.className="bp-browser-keys-row";let M=document.createElement("input");M.type="text",M.className="bp-browser-input",M.placeholder="Type text or press Enter/Tab/Arrows…",M.autocomplete="off",M.spellcheck=!1,M.setAttribute("data-testid","browser-keys");let j=f("Send","browser-type-send");B.append(M,j);let O=document.createElement("div");O.className="bp-browser-quick-keys";for(let[Q,ge]of ir){let k=f(Q,`browser-key-${ge}`);k.addEventListener("click",()=>ee("press",{key:ge})),O.append(k)}A.append(B,O);let x=document.createElement("div");x.className="bp-browser-err",x.setAttribute("data-testid","browser-error"),x.hidden=!0;let Y=document.createElement("div");Y.className="bp-browser-stage",Y.setAttribute("data-testid","browser-stage");let se=document.createElement("img");se.className="bp-browser-img",se.alt="Hub browser screen",se.draggable=!1,se.hidden=!0,se.setAttribute("data-testid","browser-frame");let ne=document.createElement("div");ne.className="bp-pane-empty",ne.setAttribute("data-testid","browser-empty"),ne.textContent="Loading browser screen…",Y.append(se,ne);let he=document.createElement("div");he.className="bp-browser-hint",he.textContent="You have the page: click to tap, scroll to wheel, type in the key box. Hand it back when done.",he.hidden=!0,d.append(u,A,x,Y,he),e.replaceChildren(d);function Se(Q){x.textContent=Q,x.hidden=!Q}function ke(){A.hidden=!s,he.hidden=!s,N.textContent=s?"Hand back":"Take over",N.setAttribute("data-testid",s?"browser-handback":"browser-takeover"),N.classList.toggle("is-on",s),se.classList.toggle("is-driving",s)}function ee(Q,ge={},k){h.enqueue(async()=>{if(!i)return;Se("");try{if(await t.hub.rpc("browser",{thread:n,op:Q,...ge}),!i)return;k?.(),ue()}catch(P){if(!i)return;Se(P instanceof Error?P.message:String(P))}})}function re(Q){ee("toolbar",{command:Q},()=>{s=!0,ke()})}b.addEventListener("click",()=>re("back")),v.addEventListener("click",()=>re("forward")),y.addEventListener("click",()=>re("reload")),w.addEventListener("submit",(Q)=>{Q.preventDefault();let ge=sr(C.value);if(!ge)return;if(C.value=ge,!s)ee("takeover",{},()=>{s=!0,ke()});ee("navigate",{url:ge},()=>{s=!0,ke()})}),N.addEventListener("click",()=>{if(s)ee("handback",{},()=>{s=!1,ke()});else ee("takeover",{},()=>{s=!0,ke(),M.focus()})});function R(){let Q=M.value;if(!Q)return;M.value="",ee("type",{text:Q})}j.addEventListener("click",R),M.addEventListener("keydown",(Q)=>{if(!s)return;if(Q.key==="Enter"){if(Q.preventDefault(),M.value)R();ee("press",{key:"Enter"});return}if(Q.key==="Tab"||Q.key==="Escape"||Q.key==="ArrowUp"||Q.key==="ArrowDown"||Q.key==="ArrowLeft"||Q.key==="ArrowRight"||Q.key==="Backspace"&&M.value==="")Q.preventDefault(),ee("press",{key:Q.key})}),se.addEventListener("click",(Q)=>{if(!s||!r)return;let ge=se.getBoundingClientRect(),k=nr(Q.clientX,Q.clientY,{left:ge.left,top:ge.top,width:ge.width,height:ge.height,naturalWidth:se.naturalWidth,naturalHeight:se.naturalHeight});if(!k)return;ee("click",k)}),se.addEventListener("wheel",(Q)=>{if(!s||!r)return;Q.preventDefault();let ge=Math.round(Q.deltaX),k=Math.round(Q.deltaY);if(ge===0&&k===0)return;ee("scroll",{dx:ge,dy:k})},{passive:!1});async function ue(){if(!i)return;if(o){c=!0;return}o=!0;try{do{c=!1,l=new AbortController;let Q=await fetch(`/bots/${encodeURIComponent(n)}/screen.jpg`,{credentials:"same-origin",cache:"no-store",signal:l.signal});if(!i)return;if(Q.ok){let ge=await Q.blob();if(!i)return;let k=URL.createObjectURL(ge),P=a;if(a=k,se.src=k,se.hidden=!1,ne.hidden=!0,r=!0,P)URL.revokeObjectURL(P)}else if(!r)se.hidden=!0,ne.hidden=!1,ne.textContent="No browser page yet. An agent opens one when it needs the web."}while(i&&c)}catch{if(!i)return;if(!r)se.hidden=!0,ne.hidden=!1,ne.textContent="No browser page yet. An agent opens one when it needs the web."}finally{l=null,o=!1}}let le=t.hub.onFrame((Q)=>{if(!i)return;if(Q.t==="shot"&&Q.bot===n){if(typeof Q.n==="number"){if(Q.n===p)return;p=Q.n}ue()}});return ue(),{destroy(){if(i=!1,le(),l?.abort(),a)URL.revokeObjectURL(a),a=""}}}function U(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n!==void 0)i.textContent=n;return i}function un(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function or(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Pa(e){return["png","jpg","jpeg","gif","webp","svg","bmp","ico"].includes(e)}function ar(e){return["txt","md","markdown","json","toml","yaml","yml","xml","csv","tsv","rs","ts","tsx","js","mjs","cjs","jsx","css","html","htm","sh","bash","py","c","h","cc","cpp","hpp","go","java","kt","swift","rb","lua","sql","ini","cfg","conf","env","gitignore","lock","log","gbr","gtl","gbl","gts","gbs","gto","gbo","gm1","drl","pos","net","kicad_pro","kicad_prl","kicad_dru","kicad_sym","kicad_mod","kicad_wks"].includes(e)}function Sa(e){let t=or(e);if(t==="kicad_pcb")return"board";if(t==="kicad_sch")return"schematic";if(t==="step"||t==="stp"||t==="glb")return"mech";return null}function lr(e,t,n,i){let s=!0,r="",a="",o=U("div","bp-pane bp-files-pane");o.setAttribute("data-testid","pane-files");let c=U("div","bp-pane-bar"),p=U("div","bp-files-crumbs"),l=U("button","bp-v-btn","Refresh");l.type="button",l.addEventListener("click",()=>void v(r)),c.append(p,l);let h=U("div","bp-files-split"),d=U("div","bp-files-list");d.setAttribute("data-testid","files-list");let u=U("div","bp-files-preview");u.setAttribute("data-testid","files-preview"),u.append(U("div","bp-pane-empty","Select a file to preview")),h.append(d,u),o.append(c,h),e.replaceChildren(o);function f(){p.replaceChildren();let y=U("button","bp-crumb-btn","project");if(y.type="button",y.addEventListener("click",()=>void v("")),p.append(y),!r)return;let w=r.split("/").filter(Boolean),C="";for(let L of w){C=C?`${C}/${L}`:L;let N=C;p.append(U("span","bp-vh-sep","/"));let A=U("button","bp-crumb-btn",L);A.type="button",A.addEventListener("click",()=>void v(N)),p.append(A)}}async function b(y,w,C){a=y,u.replaceChildren();let L=U("div","bp-files-prev-head");L.append(U("span","bp-files-prev-name",y));let N=U("div","bp-files-prev-acts"),A=Sa(w);if(A){let O=U("button","bp-v-btn is-primary",`Open in ${A}`);O.type="button",O.setAttribute("data-testid","files-open-viewer"),O.addEventListener("click",()=>i(A,y)),N.append(O)}let B=`/files/get?thread=${encodeURIComponent(n)}&path=${encodeURIComponent(y)}`,M=U("a","bp-v-btn","Download");M.href=B,M.download=w,N.append(M),L.append(N),u.append(L);let j=or(w);if(Pa(j)){let O=U("div","bp-files-img-wrap"),x=document.createElement("img");x.className="bp-files-img",x.alt=w,x.src=B,O.append(x),u.append(O);return}if(C>524288&&!ar(j)){u.append(U("div","bp-pane-empty",`Binary file (${un(C)}). Use Download to save.`));return}if(ar(j)||C<=65536){let O=U("div","bp-pane-empty","Loading…");u.append(O);try{let x=await fetch(B,{credentials:"same-origin"});if(!s||a!==y)return;if(!x.ok){O.textContent=`Could not load file (${x.status})`;return}if((x.headers.get("content-type")||"").startsWith("image/")){O.remove();let le=document.createElement("img");le.className="bp-files-img",le.alt=w,le.src=B,u.append(le);return}let se=262144,ne=[],he=0,Se=!1;if(x.body){let le=x.body.getReader();try{while(!0){let{done:Q,value:ge}=await le.read();if(Q||!ge)break;if(he+ge.byteLength>se){let k=se-he;if(k>0)ne.push(ge.subarray(0,k)),he+=k;Se=!0,await le.cancel();break}ne.push(ge),he+=ge.byteLength}}finally{le.releaseLock()}}if(!s||a!==y)return;let ke=new Uint8Array(he),ee=0;for(let le of ne)ke.set(le,ee),ee+=le.byteLength;let re=!1;for(let le=0;leL.dir===N.dir?L.name.localeCompare(N.name):L.dir?-1:1),d.replaceChildren(),y){let L=U("button","bp-file-row is-dir");L.type="button",L.append(U("span","bp-file-icon","↰"),U("span","bp-file-name",".."));let N=y.includes("/")?y.slice(0,y.lastIndexOf("/")):"";L.addEventListener("click",()=>void v(N)),d.append(L)}if(C.length===0){d.append(U("div","bp-pane-empty","Empty folder"));return}for(let L of C){let N=y?`${y}/${L.name}`:L.name,A=U("button","bp-file-row"+(L.dir?" is-dir":"")+(N===a?" is-sel":""));A.type="button",A.setAttribute("data-testid",`file-row-${L.name}`),A.append(U("span","bp-file-icon",L.dir?"▸":"·"),U("span","bp-file-name",L.name),U("span","bp-file-size",L.dir?"":un(L.size))),A.addEventListener("click",()=>{if(L.dir)v(N);else d.querySelectorAll(".bp-file-row.is-sel").forEach((B)=>B.classList.remove("is-sel")),A.classList.add("is-sel"),b(N,L.name,L.size)}),d.append(A)}}catch(w){if(!s)return;d.replaceChildren(U("div","bp-pane-empty",w instanceof Error?w.message:String(w)))}}return v(""),{destroy(){s=!1}}}function cr(e,t,n){let i=!0,s=U("div","bp-pane bp-diff-pane");s.setAttribute("data-testid","pane-diff");let r=U("div","bp-pane-bar"),a=U("span","bp-diff-summary","Loading diff…"),o=U("button","bp-v-btn","Refresh");o.type="button",o.addEventListener("click",()=>void p()),r.append(a,o);let c=U("div","bp-diff-body");c.setAttribute("data-testid","diff-body"),s.append(r,c),e.replaceChildren(s);async function p(){a.textContent="Loading diff…",c.replaceChildren();try{let l=await t.hub.rpc("viewer.diff",{thread:n});if(!i)return;if(l?.nogit){a.textContent="Not a git repository",c.append(U("div","bp-pane-empty","This project is not a git repository."));return}let h=typeof l?.diff==="string"?l.diff:"";if(!h.trim()){a.textContent="Clean working tree",c.append(U("div","bp-pane-empty","No uncommitted changes."));return}let d=h.split(` -`),u=0,f=0,b=0,v=document.createDocumentFragment(),y=U("div","bp-diff-file");for(let w of d){if(w.startsWith("diff --git ")){if(y.childNodes.length>0)v.append(y);y=U("div","bp-diff-file"),u++;let C=w.match(/ b\/(.+)$/);y.append(U("div","bp-diff-file-head",C?C[1]:w));continue}if(w.startsWith("index ")||w.startsWith("--- ")||w.startsWith("+++ "))y.append(U("div","bp-diff-line is-meta",w));else if(w.startsWith("@@"))y.append(U("div","bp-diff-line is-hunk",w));else if(w.startsWith("+"))f++,y.append(U("div","bp-diff-line is-add",w));else if(w.startsWith("-"))b++,y.append(U("div","bp-diff-line is-del",w));else y.append(U("div","bp-diff-line",w))}if(y.childNodes.length>0)v.append(y);a.textContent=`${u||1} file${u===1?"":"s"} · +${f} -${b}`,c.append(v)}catch(l){if(!i)return;a.textContent="Diff unavailable",c.append(U("div","bp-pane-empty",l instanceof Error?l.message:String(l)))}}return p(),{destroy(){i=!1}}}function La(e,t){let n=t.rel||"",i=t.manifest||{},s=(p)=>`/files/get?thread=${encodeURIComponent(e)}&path=${encodeURIComponent(`${n}/${p}`)}`,r=(p)=>typeof p==="string"&&p!==""&&!p.startsWith("/")&&!p.split(/[\\/]/).includes(".."),a=(Array.isArray(i.drawings)?i.drawings:[]).filter((p)=>r(p?.file)),o=new Set(a.map((p)=>p.file)),c=a.map((p)=>({title:p.title||p.kind||p.file,file:p.file,url:s(p.file),drawing:!0}));for(let p of Array.isArray(i.files)?i.files:[])if(r(p)&&!o.has(p))c.push({title:p,file:p,url:s(p),drawing:!1});return c}function dr(e,t,n){let i=!0,s="checks",r=U("div","bp-pane bp-review-pane");r.setAttribute("data-testid","pane-review");let a=U("div","bp-pane-bar"),o=U("div","bp-review-tabs"),c=U("button","bp-v-btn is-on","Checks"),p=U("button","bp-v-btn","BOM"),l=U("button","bp-v-btn","Comments"),h=U("button","bp-v-btn","Release");h.setAttribute("data-testid","review-tab-release"),c.type=p.type=l.type=h.type="button",o.append(c,p,l,h);let d=U("button","bp-v-btn","Refresh");d.type="button",d.addEventListener("click",()=>void y()),a.append(o,d);let u=U("div","bp-review-body");u.setAttribute("data-testid","review-body"),r.append(a,u),e.replaceChildren(r);function f(w){s=w,c.classList.toggle("is-on",s==="checks"),p.classList.toggle("is-on",s==="bom"),l.classList.toggle("is-on",s==="comments"),h.classList.toggle("is-on",s==="release"),y()}c.addEventListener("click",()=>f("checks")),p.addEventListener("click",()=>f("bom")),l.addEventListener("click",()=>f("comments")),h.addEventListener("click",()=>f("release"));function b(w){let C=U("div","bp-review-md bp-review-release");C.setAttribute("data-testid","review-release");let L=w.manifest||{};C.append(U("h2","bp-review-h",w.tag||"Release")),C.append(U("p","bp-review-p",[L.commit?`Commit ${L.commit.slice(0,12)}`:"",L.date||""].filter(Boolean).join(" · ")));let N=La(n,w),A=(M,j)=>{if(j.length===0)return;C.append(U("h3","bp-review-h",M));let O=U("table","bp-review-table");for(let x of j){let Y=document.createElement("tr"),se=U("td",void 0,x.title);se.title=x.file;let ne=document.createElement("td"),he=U("a","bp-v-btn","Download");he.href=x.url,he.download=x.file.split("/").pop()||x.file,ne.append(he),Y.append(se,ne),O.append(Y)}C.append(O)};A("Drawings",N.filter((M)=>M.drawing));let B=Array.isArray(L.openFabNotes)?L.openFabNotes:[];if(B.length>0)C.append(U("div","bp-review-gate",`Open fabrication notes, not in the board (agree them with the fabricator): ${B.join(", ")}.`));if(A("Files",N.filter((M)=>!M.drawing)),w.rel){let M=U("a","bp-v-btn","Download all (.zip)");M.href=`/files/zip?thread=${encodeURIComponent(n)}&path=${encodeURIComponent(w.rel)}`,C.append(M)}return C}function v(w){let C=U("div","bp-review-md"),L=w.split(` -`),N=0;while(N{j.preventDefault();let O=B.value.trim();if(!O)return;M.disabled=!0,t.hub.rpc("review.comment",{thread:n,text:O}).then(()=>{B.value="",M.disabled=!1,y()},()=>{M.disabled=!1})}),u.append(A),N.length===0){u.append(U("div","bp-pane-empty","No review comments yet."));return}for(let j of N){let O=U("div","bp-review-comment"+(j.resolved?" is-resolved":"")),x=[j.by||"review",j.file,j.layer,j.item].filter(Boolean).join(" · ");O.append(U("div","bp-review-comment-meta",x),U("div","bp-review-comment-text",j.text)),u.append(O)}return}let w=await t.hub.rpc("review.page",{thread:n,page:s});if(!i)return;let C=w?.report||{};if(u.replaceChildren(),C.line||C.gate){let L=U("div","bp-review-gate",[C.gate,C.line].filter(Boolean).join(" · "));u.append(L)}if(C.err)u.append(U("div","bp-review-err",C.err));if(Array.isArray(C.tasks)&&C.tasks.length>0){let L=U("div","bp-review-tasks");C.tasks.forEach((N,A)=>{let B=U("label","bp-review-task"),M=document.createElement("input");M.type="checkbox",M.checked=!!(N.done??N.checked);let j=typeof N.index==="number"?N.index:A;M.addEventListener("change",()=>{t.hub.rpc("review.tick",{thread:n,index:j}).then(()=>void y(),()=>{})}),B.append(M,U("span",void 0,N.text||N.label||`Item ${A+1}`)),L.append(B)}),u.append(L)}if(s==="release"&&C.release&&C.release.manifest)u.append(b(C.release));else if(C.md&&C.md.trim())u.append(v(C.md));else if(!C.err&&(!C.tasks||C.tasks.length===0))u.append(U("div","bp-pane-empty",s==="release"?"No release yet. A release tags this design and makes its fabrication outputs and drawings in .backplane/releases.":`No ${s==="bom"?"BOM":"design checks"} report available.`))}catch(w){if(!i)return;u.replaceChildren(U("div","bp-pane-empty",w instanceof Error?w.message:String(w)))}}return y(),{destroy(){i=!1}}}function pr(e,t){let n=e>>>16&255,i=e>>>8&255,s=e&255;return t>=0.999?`rgb(${n},${i},${s})`:`rgba(${n},${i},${s},${t.toFixed(3)})`}class ri{canvas;ctx;frame=null;masks={off:0,dim:0,lift:255};highlights=new Set;lightTheme=!1;cx=0;cy=0;scale=0.0001;fittedKey="";fitW=0;fitH=0;userMoved=!1;dirty=!1;rafId=0;pointers=new Map;dragStart=null;pinchStart=null;resizeObs;cbs;constructor(e,t={}){this.cbs=t,this.canvas=document.createElement("canvas"),this.canvas.className="bp-viewer-canvas",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.touchAction="none",e.appendChild(this.canvas);let n=this.canvas.getContext("2d");if(!n)throw Error("Canvas2D unavailable");this.ctx=n,this.resizeObs=new ResizeObserver(()=>this.scheduleDraw()),this.resizeObs.observe(this.canvas),this.canvas.addEventListener("pointerdown",this.onPointerDown),this.canvas.addEventListener("pointermove",this.onPointerMove),this.canvas.addEventListener("pointerup",this.onPointerUp),this.canvas.addEventListener("pointercancel",this.onPointerUp),this.canvas.addEventListener("wheel",this.onWheel,{passive:!1}),this.canvas.addEventListener("dblclick",this.onDblClick)}setTheme(e){if(this.lightTheme!==e)this.lightTheme=e,this.scheduleDraw()}setFrame(e){if(this.frame=e,e&&e.key!==this.fittedKey)this.fittedKey=e.key,this.fit();else this.scheduleDraw()}setLayers(e){this.masks=e,this.scheduleDraw()}setHighlights(e){this.highlights.clear();for(let[t,n]of e)this.highlights.add(`${t}:${n}`);this.scheduleDraw()}presentMask(){if(!this.frame)return 0;let e=0;for(let t of this.frame.chunks)if(t.layer<32)e=(e|1<>>0;return e>>>0}presentColors(){let e=new Map;if(!this.frame)return e;for(let t of this.frame.chunks)if(!e.has(t.layer))e.set(t.layer,t.color);return e}applyFit(e,t){if(!this.frame||e<10||t<10)return;let n=this.frame.box,i=Math.max(n[2]-n[0],1000),s=Math.max(n[3]-n[1],1000);this.cx=(n[0]+n[2])*0.5,this.cy=(n[1]+n[3])*0.5,this.scale=Math.min(e/i,t/s)*0.92,this.fitW=e,this.fitH=t,this.userMoved=!1}fit(){if(!this.frame)return;this.userMoved=!1,this.fitW=0,this.fitH=0;let e=this.canvas.getBoundingClientRect();if(e.width>=10&&e.height>=10)this.applyFit(e.width,e.height);this.scheduleDraw()}zoomToBoxMm(e){let t=e[0]*1000,n=e[1]*1000,i=e[2]*1000,s=e[3]*1000,r=Math.max(i-t,1000),a=Math.max(s-n,1000),o=this.canvas.getBoundingClientRect(),c=Math.max(o.width,200),p=Math.max(o.height,200);this.cx=(t+i)*0.5,this.cy=(n+s)*0.5,this.scale=Math.min(c/r,p/a)*0.85,this.userMoved=!0,this.scheduleDraw()}scheduleDraw(){if(this.dirty)return;this.dirty=!0,this.rafId=requestAnimationFrame(()=>{this.dirty=!1,this.rafId=0,this.draw()})}draw(){let e=this.canvas.getBoundingClientRect(),t=Math.max(1,Math.round(e.width)),n=Math.max(1,Math.round(e.height)),i=Math.min(window.devicePixelRatio||1,2),s=Math.round(t*i),r=Math.round(n*i);if(this.canvas.width!==s||this.canvas.height!==r)this.canvas.width=s,this.canvas.height=r;let a=this.ctx;a.setTransform(i,0,0,i,0,0),a.fillStyle=this.lightTheme?"#f5f4ef":"#08090b",a.fillRect(0,0,t,n);let o=this.frame;if(!o)return;if(!this.userMoved&&t>=10&&n>=10&&(Math.abs(this.fitW-t)>2||Math.abs(this.fitH-n)>2))this.applyFit(t,n);let c=t*0.5,p=n*0.5,l=this.scale,h=this.cx,d=this.cy,u=h-c/l,f=h+c/l,b=d-p/l,v=d+p/l,{off:y,dim:w,lift:C}=this.masks,L=[],N=[];for(let B=0;B>>M&1)===1)continue;if(M===C)N.push(B);else L.push(B)}let A=L.concat(N);a.lineCap="round",a.lineJoin="round";for(let B=0;B>>j.layer&1)===1,x=j.alpha*(O?0.25:1);if(x<=0.01)continue;this.drawChunk(a,j,x,u,b,f,v,h,d,l,c,p)}if(this.highlights.size>0){a.fillStyle=this.lightTheme?"rgba(245,244,239,0.72)":"rgba(8,9,11,0.72)",a.fillRect(0,0,t,n);let B=this.lightTheme?"rgba(27,29,33,0.77)":"rgba(217,221,228,0.77)";for(let M=0;Mr||v.y1a)continue;if(v.n<3)continue;let y=(d[v.at]-o)*p+l,w=(d[v.at+1]-c)*p+h;e.moveTo(y,w);for(let C=1;C0)e.fill()}else if(t.mode===2){let f=Math.max(0.75,t.r*p);e.fillStyle=u,e.beginPath();let b=0;for(let v=0;vr||y.y1a)continue;let w=(d[y.at]-o)*p+l,C=(d[y.at+1]-c)*p+h;e.moveTo(w+f,C),e.arc(w,C,f,0,Math.PI*2),b++}if(b>0)e.fill()}else{e.strokeStyle=u,e.lineWidth=Math.max(1,t.r*2*p),e.beginPath();let f=0;for(let b=0;br||v.y1a)continue;let y=(d[v.at]-o)*p+l,w=(d[v.at+1]-c)*p+h;if(v.n===1)e.moveTo(y,w),e.lineTo(y+0.01,w);else{e.moveTo(y,w);for(let C=1;C0)e.stroke()}}drawLitPieces(e,t,n,i,s,r,a,o,c,p,l,h,d){let u=t.pts,f=pr(t.color,t.alpha);for(let b=0;ba||v.y1o)continue;let y=(u[v.at]-c)*l+h,w=(u[v.at+1]-p)*l+d;if(v.kind===2){let C=Math.max(1.5,t.r*l);e.fillStyle=f,e.beginPath(),e.arc(y,w,C,0,Math.PI*2),e.fill(),e.strokeStyle=i,e.lineWidth=1.5,e.stroke()}else if(v.kind===0&&v.n>=3){e.fillStyle=f,e.beginPath(),e.moveTo(y,w);for(let C=1;C=0;l--){let h=n.chunks[l];if(h.layer<32&&(p>>>h.layer&1)===1)continue;for(let d=0;du.x1+a||ru.y1+a)continue;let f=(u.x1-u.x0+1)*(u.y1-u.y0+1);if(f{if(this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.pointers.size===1)this.dragStart={x:e.clientX,y:e.clientY,cx:this.cx,cy:this.cy,moved:!1},this.pinchStart=null;else if(this.pointers.size===2){let[t,n]=Array.from(this.pointers.values());this.pinchStart={dist:Math.hypot(n.x-t.x,n.y-t.y)||1,midX:(t.x+n.x)*0.5,midY:(t.y+n.y)*0.5,scale:this.scale,cx:this.cx,cy:this.cy},this.dragStart=null}};onPointerMove=(e)=>{if(!this.pointers.has(e.pointerId))return;if(this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.pointers.size===2&&this.pinchStart){let[t,n]=Array.from(this.pointers.values()),i=Math.hypot(n.x-t.x,n.y-t.y)||1,s=(t.x+n.x)*0.5,r=(t.y+n.y)*0.5,a=i/this.pinchStart.dist,o=Math.max(0.0000001,Math.min(2,this.pinchStart.scale*a)),c=this.canvas.getBoundingClientRect(),p=this.pinchStart.midX-c.left-c.width*0.5,l=this.pinchStart.midY-c.top-c.height*0.5,h=s-c.left-c.width*0.5,d=r-c.top-c.height*0.5;this.scale=o,this.cx=this.pinchStart.cx+p/this.pinchStart.scale-h/o,this.cy=this.pinchStart.cy+l/this.pinchStart.scale-d/o,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw();return}if(this.dragStart&&this.pointers.size===1){let t=e.clientX-this.dragStart.x,n=e.clientY-this.dragStart.y;if(Math.hypot(t,n)>3)this.dragStart.moved=!0;if(this.dragStart.moved)this.cx=this.dragStart.cx-t/this.scale,this.cy=this.dragStart.cy-n/this.scale,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw()}};onPointerUp=(e)=>{let t=this.dragStart&&!this.dragStart.moved&&this.pointers.size===1;if(this.pointers.delete(e.pointerId),this.pointers.size<2)this.pinchStart=null;if(this.pointers.size===0)this.dragStart=null;if(t&&this.cbs.onPick){let n=this.canvas.getBoundingClientRect(),i=this.hitTest(e.clientX-n.left,e.clientY-n.top);this.cbs.onPick(i)}};onWheel=(e)=>{e.preventDefault();let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-t.width*0.5,i=e.clientY-t.top-t.height*0.5,s=e.deltaY<0?1.16:0.8620689655172414,r=Math.max(0.0000001,Math.min(2,this.scale*s));this.cx+=n/this.scale-n/r,this.cy+=i/this.scale-i/r,this.scale=r,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw()};onDblClick=()=>{this.fit()};destroy(){if(this.rafId)cancelAnimationFrame(this.rafId);this.resizeObs.disconnect(),this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("dblclick",this.onDblClick),this.canvas.remove()}}var hr=[{id:"fit",label:"Fit"},{id:"iso",label:"Iso"},{id:"top",label:"Top"},{id:"bottom",label:"Bottom"},{id:"front",label:"Front"},{id:"right",label:"Right"},{id:"back",label:"Back"},{id:"left",label:"Left"}];function ur(e){switch(e){case"top":return{yaw:0,pitch:Math.PI*0.499};case"bottom":return{yaw:0,pitch:-Math.PI*0.499};case"front":return{yaw:0,pitch:0};case"right":return{yaw:Math.PI*0.5,pitch:0};case"back":return{yaw:Math.PI,pitch:0};case"left":return{yaw:-Math.PI*0.5,pitch:0};case"iso":case"fit":default:return{yaw:0.6,pitch:0.7}}}function ai(e,t,n,i){if(!e||!t||!n||!i)return!1;if(!e.startsWith(t))return!1;let s=e.slice(t.length).split(` -`),r=(s[0]||"").split("\t");if(r[0]!=="git"||r[2]!==n)return!1;let a=s[1]||r.slice(4).join("\t");if(!a)return!1;let o=a.replace(/\\/g,"/"),c=i.replace(/\\/g,"/");if(c.startsWith("/")||/^[A-Za-z]:\//.test(c))return o===c;return o===c||o.endsWith(`/${c}`)}class oi{refs=[];index=-1;lastCommit="";highlightEdits=!1;playing=!1;setRefs(e){if(this.refs=e,this.index>=e.length)this.index=-1,this.highlightEdits=!1}isLive(){return this.index<0||this.index>=this.refs.length}activeRef(){return this.isLive()?null:this.refs[this.index]}step(e){if(this.refs.length===0)return!1;let t=this.index;if(e>0)this.index=Math.min(this.refs.length-1,this.index+1);else this.index=Math.max(-1,this.index-1);if(this.index===-1)this.playing=!1,this.highlightEdits=!1;else this.lastCommit=this.refs[this.index].commit,this.highlightEdits=!0;return this.index!==t}selectCommit(e){if(!e)return this.goLive();let t=this.refs.findIndex((i)=>i.commit===e);if(t<0)return!1;let n=this.index!==t||!this.highlightEdits;return this.index=t,this.lastCommit=e,this.highlightEdits=!0,n}goLive(){let e=this.index!==-1||this.playing||this.highlightEdits;return this.index=-1,this.playing=!1,this.highlightEdits=!1,e}toggleHighlight(){if(this.highlightEdits)return this.goLive(),!1;if(this.refs.length===0)return!1;let e=this.lastCommit?this.refs.findIndex((t)=>t.commit===this.lastCommit):0;return this.index=e>=0?e:0,this.lastCommit=this.refs[this.index].commit,this.highlightEdits=!0,!0}compareRequest(){let e=this.activeRef();if(!e||!this.highlightEdits)return null;return{commit:e.commit,bits:0}}}var Aa=`#version 300 es +`),h=document.createElement("div");h.className="bp-code-block";let d=document.createElement("div");d.className="bp-code-head";let m=document.createElement("span");m.className="bp-code-lang",m.textContent=c||"code";let f=document.createElement("button");f.type="button",f.className="bp-btn-ghost bp-code-copy";let b=u("common.copy","Copy");f.textContent=b,f.addEventListener("click",()=>{navigator.clipboard?.writeText(l).then(()=>{f.textContent="✓",window.setTimeout(()=>{f.textContent=b},1200)}).catch(()=>{})}),d.append(m,f);let v=document.createElement("pre"),w=document.createElement("code");w.textContent=l,v.appendChild(w),h.append(d,v),t.appendChild(h);continue}if(!s.trim()){i++;continue}let r=/^(#{1,4})\s+(.+)$/.exec(s);if(r){let c=document.createElement(`h${Math.min(4,r[1].length+1)}`);c.className="bp-md-h",$t(c,r[2]),t.appendChild(c),i++;continue}if(s.startsWith("> ")){let c=document.createElement("blockquote");c.className="bp-md-quote";let p=[];while(i "))p.push(n[i].slice(2)),i++;$t(c,p.join(` +`)),t.appendChild(c);continue}if(/^\s*[-*]\s+/.test(s)){let c=document.createElement("ul");c.className="bp-md-list";while(i ")&&!/^\s*[-*]\s+/.test(n[i])&&!/^\s*\d+\.\s+/.test(n[i]))o.push(n[i]),i++;let a=document.createElement("p");a.className="bp-md-p";for(let c=0;c0)a.appendChild(document.createElement("br"));$t(a,o[c])}t.appendChild(a)}return t}var Hr=new Set(["(","[",'"',"'","`"]);function Dr(e){return/[\p{L}\p{N}\-_\/+\[]/u.test(e)}function Fr(e){return/[\p{L}\p{N}\-_\/]/u.test(e)}function $r(e){return/[\p{L}\p{N}]/u.test(e)}function Ti(e,t){if(!e)return[];let n=(t??[]).filter((r)=>r.kind==="model"&&r.word&&r.label);if(n.length===0)return[{kind:"text",text:e}];let i=[],s=0;while(so)r=l,o=h,a=c;break}p=l+1}}if(a===null)break;if(r>s)i.push({kind:"text",text:e.slice(s,r)});i.push({kind:"model",word:a.word,label:a.label}),s=o}if(s3600000)return"";let t=Math.max(1,Math.round(e/1000));if(t<60)return`${t}s`;let n=Math.floor(t/60),i=t%60;return i>0?`${n}m ${i}s`:`${n}m`}function Vr(e,t){let n=document.createDocumentFragment(),i=Ti(e,t),s=u("native.thread.model","Model").toLowerCase();for(let r of i){if(r.kind==="text"){n.appendChild(document.createTextNode(r.text));continue}let o=document.createElement("span");o.className="bp-ref-chip bp-ref-model",o.title=r.word,o.setAttribute("data-ref-word",r.word);let a=document.createElement("span");a.className="bp-ref-sigil",a.textContent="&";let c=document.createElement("span");c.className="bp-ref-label",c.textContent=r.label;let p=document.createElement("span");p.className="bp-ref-kind",p.textContent=s,o.append(a,c,p),n.appendChild(o)}return n}function Ur(e){e.addEventListener("copy",(t)=>{let n=typeof window<"u"?window.getSelection():null;if(!n||n.rangeCount===0||n.isCollapsed)return;let i=n.getRangeAt(0);if(!e.contains(i.commonAncestorContainer))return;let s=i.commonAncestorContainer,a=(s.nodeType===Node.ELEMENT_NODE?s:s.parentElement)?.closest(".bp-ref-chip[data-ref-word]")?.getAttribute("data-ref-word"),c;if(a)c=a;else{let p=i.cloneContents(),l=p.querySelectorAll(".bp-ref-chip[data-ref-word]");if(l.length===0)return;for(let d of l){let m=d.getAttribute("data-ref-word")||d.textContent||"";d.replaceWith(document.createTextNode(m))}let h=p.querySelectorAll(".bp-entry");for(let d=1;d{if(!this.loadingOlder&&this.hasMore)this.loadingOlder=!0,this.cb.onLoadOlder()}),this.scrollEl.addEventListener("scroll",()=>{if(this.pinnedToBottom=this.isNearBottom(),this.hasMore&&!this.loadingOlder&&this.scrollEl.scrollTop<48)this.loadingOlder=!0,this.cb.onLoadOlder()}),typeof ResizeObserver<"u"){let n=0;new ResizeObserver(()=>{let s=this.scrollEl.clientHeight;if(n>0&&s!==n&&this.pinnedToBottom)this.scrollToBottom();n=s}).observe(this.scrollEl)}this.listEl=document.createElement("div"),this.listEl.className="bp-timeline-list",Ur(this.scrollEl),this.scrollEl.append(this.olderBtn,this.listEl),e.append(this.bannerEl,this.scrollEl)}setLoading(e){this.thread=e,this.entries=[],this.hasMore=!1,this.loadingOlder=!1,this.review=null,this.unanswered=null,this.btwNote=null,this.liveNodes.clear(),this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear(),this.renderBanners(),this.olderBtn.classList.add("bp-hidden");let t=document.createElement("div");t.className="bp-empty-state",t.textContent=u("web.chat.loading","Loading messages…"),this.listEl.replaceChildren(t)}setError(e,t,n){this.thread=e,this.entries=[],this.hasMore=!1,this.loadingOlder=!1,this.review=null,this.unanswered=null,this.btwNote=null,this.liveNodes.clear(),this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear(),this.renderBanners(),this.olderBtn.classList.add("bp-hidden");let i=document.createElement("div");i.className="bp-empty-state";let s=document.createElement("div");s.className="bp-bad",s.textContent=t;let r=document.createElement("button");r.type="button",r.textContent=u("tools.retry","Retry"),r.addEventListener("click",n),i.append(s,r),this.listEl.replaceChildren(i)}getEntries(){return this.entries.slice()}refreshLocale(){let e=this.scrollEl.scrollTop;if(this.olderBtn.textContent=u("android.load.earlier","Load earlier"),this.renderBanners(),this.thread&&this.entries.length>0)this.renderEntries(!1);this.scrollEl.scrollTop=e}setThread(e,t,n,i,s){if((this.thread?.id??"")!==(e?.id??""))this.planExpanded.clear(),this.planRevisingId="",this.planReviseDrafts.clear();this.thread=e,this.entries=t.filter((r)=>!Sn(r)),this.hasMore=n,this.loadingOlder=!1,this.review=i,this.unanswered=s,this.btwNote=null,this.renderBanners(),this.renderEntries(!0)}updateThreadMeta(e){if(!this.thread||this.thread.id!==e.id)return;this.thread=e}setReview(e){this.review=e,this.renderBanners()}setUnanswered(e){this.unanswered=e,this.renderBanners()}setNoProvider(e){this.noProvider=e,this.renderBanners()}showBtw(e,t){this.btwNote={q:e,a:t},this.renderBanners()}prependEntries(e,t){this.loadingOlder=!1;let n=this.scrollEl.scrollHeight,i=new Set(this.entries.map((r)=>r.id)),s=e.filter((r)=>!Sn(r)&&!i.has(r.id));this.entries=[...s,...this.entries],this.hasMore=t,this.renderEntries(!1),this.scrollEl.scrollTop+=this.scrollEl.scrollHeight-n}clearLoadingOlder(){this.loadingOlder=!1}upsertEntry(e){if(Sn(e))return;let t=this.isNearBottom()||e.kind==="user"&&Boolean(e.clientId),n=this.entries.findIndex((i)=>i.id===e.id);if(n<0&&e.clientId)n=this.entries.findIndex((i)=>i.clientId&&i.clientId===e.clientId);if(n>=0)this.entries[n]=e;else this.entries.push(e);this.renderEntries(t)}goTo(e){let t=this.scrollEl.querySelector(`[data-entry-id="${CSS.escape(e)}"]`);if(!t)return!1;return t.scrollIntoView({block:"center",behavior:"smooth"}),t.classList.remove("bp-entry-flash"),t.offsetWidth,t.classList.add("bp-entry-flash"),window.setTimeout(()=>t.classList.remove("bp-entry-flash"),1200),!0}removeEntry(e){let t=this.entries.filter((n)=>n.id!==e);if(t.length!==this.entries.length)this.entries=t,this.renderEntries(!1)}appendLiveText(e,t,n){let i=this.isNearBottom(),s=this.entries.find((o)=>o.id===e);if(!s){s={id:e,kind:"assistant",text:t,at:n,live:!0},this.entries.push(s),this.renderEntries(i);return}s.text+=t,s.live=!0;let r=this.liveNodes.get(e);if(r){if(r.replaceChildren(Ot(s.text)),i)this.scrollToBottom()}else this.renderEntries(i)}isNearBottom(){let e=this.scrollEl;return e.scrollHeight-e.scrollTop-e.clientHeight<80}scrollToBottom(){this.pinnedToBottom=!0,this.scrollEl.scrollTop=this.scrollEl.scrollHeight}renderBanners(){let e=document.createDocumentFragment();if(this.noProvider&&!this.thread?.id.includes("~")){let t=document.createElement("div");t.className="bp-banner bp-no-provider",t.setAttribute("data-testid","no-provider-banner");let n=document.createElement("div");n.className="bp-no-provider-body";let i=document.createElement("strong");if(i.textContent=he(this.noProvider.head),n.appendChild(i),this.noProvider.text){let o=document.createElement("span");o.className="bp-dim",o.textContent=he(this.noProvider.text),n.appendChild(o)}let s=document.createElement("div");s.className="bp-banner-actions";let r=document.createElement("button");r.type="button",r.className="primary",r.setAttribute("data-testid","no-provider-accounts-btn"),r.textContent=he(this.noProvider.button),r.addEventListener("click",()=>this.cb.onOpenAccounts?.()),s.appendChild(r),t.append(n,s),e.appendChild(t)}if(this.review&&(this.review.text||this.review.button)){let t=document.createElement("div");t.className="bp-banner bp-review-bar",t.setAttribute("data-testid","review-bar");let n=document.createElement("span");if(n.textContent=this.review.text||u("web.chat.review.mode","Review mode"),t.appendChild(n),this.review.button){let i=document.createElement("button");i.type="button",i.textContent=this.review.button,i.addEventListener("click",()=>this.cb.onToggleReview(!(this.review?.on??!0))),t.appendChild(i)}e.appendChild(t)}if(this.unanswered&&(this.unanswered.head||this.unanswered.text)){let t=document.createElement("div");t.className="bp-banner bp-unanswered",t.setAttribute("data-testid","unanswered-notice");let n=document.createElement("div");if(n.className="bp-unanswered-body",this.unanswered.head){let i=document.createElement("strong");i.textContent=this.unanswered.head,n.appendChild(i)}if(this.unanswered.text){let i=document.createElement("span");i.textContent=this.unanswered.text,n.appendChild(i)}if(t.appendChild(n),this.unanswered.buttons?.length){let i=document.createElement("div");i.className="bp-banner-actions";for(let s of this.unanswered.buttons){let r=document.createElement("button");if(r.type="button",s.primary)r.className="primary";r.textContent=s.label,r.addEventListener("click",()=>this.cb.onUnansweredAction(s.action,s.value)),i.appendChild(r)}t.appendChild(i)}e.appendChild(t)}if(this.btwNote){let t=document.createElement("div");t.className="bp-banner bp-btw-banner";let n=document.createElement("div"),i=document.createElement("div");i.className="bp-dim",i.textContent=`/btw ${this.btwNote.q}`;let s=document.createElement("div");s.appendChild(Ot(this.btwNote.a)),n.append(i,s);let r=document.createElement("button");r.type="button",r.className="icon",r.textContent="×",r.addEventListener("click",()=>{this.btwNote=null,this.renderBanners()}),t.append(n,r),e.appendChild(t)}this.bannerEl.replaceChildren(e)}makeEntryActions(e,t,n){let i=document.createElement("div");i.className="bp-entry-foot"+(t?" user":"");let s=document.createElement("button");s.type="button",s.className="bp-entry-act";let r=u("common.copy","Copy"),o=document.createElement("span");o.textContent=r,s.append(Gt(["M9 9h11v11H9z","M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"]),o),s.addEventListener("click",()=>{navigator.clipboard?.writeText(e.text||"").then(()=>{o.textContent="✓",window.setTimeout(()=>{o.textContent=r},1000)}).catch(()=>{})});let a=document.createElement("button");a.type="button",a.className="bp-entry-act";let c=document.createElement("span");c.textContent=u("reply.action","Reply"),a.append(Gt(["M9 17l-5-5 5-5","M20 18v-2a4 4 0 0 0-4-4H4"]),c),a.addEventListener("click",()=>this.cb.onReplyEntry(e));let p=!e.live&&!e.id.startsWith("local-")&&!e.id.startsWith("live:"),l=document.createElement("span");l.className="bp-entry-time";let h=Or(e.at);if(t)l.textContent=h,i.append(s,...p?[a]:[],l);else{let d=n&&e.at?Gr(Ln(e.at)-Ln(n)):"",m=h?d?u("web.chat.finished.dur","Finished {time} · {dur}",{time:h,dur:d}):u("web.chat.finished","Finished {time}",{time:h}):"";l.textContent=e.live?u("web.chat.streaming","Streaming…"):m,i.append(l,s,...p?[a]:[])}return i}closePlanRevise(){let e=this.planRevisingId;if(!e)return!1;this.planRevisingId="";let t=this.scrollEl.scrollTop;return this.renderEntries(!1),this.scrollEl.scrollTop=t,this.listEl.querySelector(`[data-testid="ask-${CSS.escape(e)}"] [data-testid="plan-revise"]`)?.focus(),!0}renderEntries(e){let t=null,n=typeof document<"u"?document.activeElement:null;if(n instanceof HTMLTextAreaElement&&n.classList.contains("bp-plan-revise-input")&&this.listEl.contains(n)&&this.planRevisingId)this.planReviseDrafts.set(this.planRevisingId,n.value),t={askId:this.planRevisingId,start:n.selectionStart,end:n.selectionEnd,dir:n.selectionDirection};this.olderBtn.classList.toggle("bp-hidden",!this.hasMore),this.liveNodes.clear();let i=document.createDocumentFragment();if(!this.thread){let r=document.createElement("div");r.className="bp-empty-state",r.textContent=u("web.chat.choose","Choose a project thread on the left to begin."),i.appendChild(r),this.listEl.replaceChildren(i);return}if(this.entries.length===0){let r=document.createElement("div");r.className="bp-empty-state",r.textContent=u("web.chat.empty","No messages yet. Type below to start a turn."),i.appendChild(r),this.listEl.replaceChildren(i);return}let s=0;for(let r of this.entries){if(r.kind==="user"&&r.at)s=r.at;let o=document.createElement("article");if(o.className=`bp-entry bp-entry-${r.kind}`+(r.live?" is-live":""),o.setAttribute("data-entry-id",r.id),r.kind==="tool"&&r.tool){let l=document.createElement("div");l.className=`bp-tool-pill bp-tool-${r.tool.state||"done"}`;let h=document.createElement("span");if(h.className="bp-tool-name",h.textContent=r.tool.name,l.appendChild(h),r.tool.summary){let d=document.createElement("span");d.className="bp-tool-summary",d.textContent=r.tool.summary,l.appendChild(d)}o.appendChild(l),i.appendChild(o);continue}if(r.kind==="ask"&&r.ask){let l=r.ask;if(l.kind==="plan"){o.appendChild(this.renderPlanAsk(l)),i.appendChild(o);continue}let h=document.createElement("div");h.className="bp-ask-card",h.setAttribute("data-testid",`ask-${l.id}`);let d=document.createElement("div");if(d.className="bp-ask-q",d.textContent=l.question,h.appendChild(d),l.state==="open"){let m=document.createElement("div");if(m.className="bp-ask-opts",l.options&&l.options.length>0)for(let f of l.options){let b=document.createElement("button");b.type="button",b.textContent=f.label,b.addEventListener("click",()=>this.cb.onAnswerAsk(l.id,f.id)),m.appendChild(b)}else{let f=document.createElement("input");f.type="text",f.className="bp-input",f.placeholder=u("web.chat.answer.placeholder","Type answer…");let b=document.createElement("button");b.type="button",b.className="primary",b.textContent=u("web.chat.answer.btn","Answer"),b.addEventListener("click",()=>{if(f.value.trim())this.cb.onAnswerAsk(l.id,f.value.trim())}),m.append(f,b)}h.appendChild(m)}else{let m=document.createElement("div");m.className="bp-ask-answered",m.textContent=u("web.chat.answered","Answered: {answer}",{answer:l.answered??""}),h.appendChild(m)}o.appendChild(h),i.appendChild(o);continue}let a=Boolean(r.text&&r.text.trim().length>0),c=Boolean(r.images&&r.images.length>0),p=Boolean(r.attachments&&r.attachments.length>0);if(!a&&!c&&!p&&!r.live)continue;if(r.replyTo?.quote){let l=document.createElement("div");l.className="bp-reply-quote",l.textContent=u("gpui.b.in.reply.to","↩ In reply to: {quote}",{quote:r.replyTo.quote});let h=r.replyTo.id;l.setAttribute("role","button"),l.tabIndex=0,l.setAttribute("data-testid","entry-reply-quote");let d=()=>{if(this.cb.onGoToEntry)this.cb.onGoToEntry(h);else this.goTo(h)};l.addEventListener("click",d),l.addEventListener("keydown",(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),d()}),o.appendChild(l)}if(a||r.live){let l=document.createElement("div");if(l.className="bp-entry-body",r.kind==="user")l.appendChild(Vr(r.text||"",r.refs));else l.appendChild(Ot(r.text||""));if(r.live)this.liveNodes.set(r.id,l);o.appendChild(l)}if(p&&r.attachments){let l=document.createElement("div");l.className="bp-entry-images";for(let h of r.attachments)if(h.previewUrl){let d=document.createElement("img");d.className="bp-reply-img",d.src=h.previewUrl,d.alt=h.name||"attachment",l.appendChild(d)}else if(h.path||h.name){let d=document.createElement("span");d.className="bp-tool-pill",d.textContent=h.name||h.path||"image",l.appendChild(d)}if(l.childElementCount>0)o.appendChild(l)}if(r.images&&r.images.length>0){let l=document.createElement("div");l.className="bp-entry-images";for(let h of r.images){let d=document.createElement("img");d.className="bp-reply-img",d.alt=h;let m=`${r.id}|${h}`,f=this.imageCache.get(m);if(f)d.src=f;else this.cb.onLoadImage(r.id,h).then((b)=>{if(!b)return;let v=b.url??(b.mime&&b.data?`data:${b.mime};base64,${b.data}`:"");if(!v)return;this.imageCache.set(m,v),d.src=v});l.appendChild(d)}o.appendChild(l)}o.appendChild(this.makeEntryActions(r,r.kind==="user",r.kind==="assistant"?s:void 0)),i.appendChild(o)}if(this.listEl.replaceChildren(i),t&&this.planRevisingId===t.askId){let r=this.listEl.querySelector(`[data-testid="ask-${CSS.escape(t.askId)}"] .bp-plan-revise-input`);if(r){if(r.focus({preventScroll:!0}),t.start!==null&&t.end!==null)r.setSelectionRange(t.start,t.end,t.dir??void 0)}}if(e&&!t)this.scrollToBottom()}renderPlanAsk(e){let t=this.planExpanded.has(e.id),n=e.state==="open"&&this.planRevisingId===e.id,i=document.createElement("div");i.className="bp-ask-card bp-ask-plan",i.setAttribute("data-testid",`ask-${e.id}`);let s=document.createElement("div");s.className="bp-plan-head";let r=Gt(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"]);r.classList.add("bp-plan-head-ic");let o=document.createElement("span");if(o.className="bp-plan-title",o.textContent=!e.head||e.head==="Proposed plan"?u("ask.plan","Proposed plan"):he(e.head),s.append(r,o),e.state==="open"){let l=document.createElement("span");l.className="bp-plan-badge",l.textContent=u("gpui.ask.plan.ready","Ready for review"),s.appendChild(l)}let a=document.createElement("span");if(a.className="bp-mgmt-flex1",s.appendChild(a),e.question){let l=document.createElement("button");l.type="button",l.className="bp-plan-head-btn";let h=u("common.copy","Copy"),d=document.createElement("span");d.textContent=h,l.append(Gt(["M9 9h11v11H9z","M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"]),d),l.addEventListener("click",()=>{navigator.clipboard?.writeText(e.question).then(()=>{l.classList.add("copied"),d.textContent=u("web.clone.copied","Copied"),window.setTimeout(()=>{l.classList.remove("copied"),d.textContent=h},1200)}).catch(()=>{})}),s.appendChild(l)}let c=document.createElement("button");c.type="button",c.className="bp-plan-head-btn",c.setAttribute("data-testid","plan-expand"),c.textContent=t?u("gpui.c.term.collapse","Collapse"):u("gpui.c.term.expand","Expand"),c.addEventListener("click",()=>{if(this.planExpanded.has(e.id))this.planExpanded.delete(e.id);else this.planExpanded.add(e.id);let l=this.scrollEl.scrollTop;this.renderEntries(!1),this.scrollEl.scrollTop=l}),s.appendChild(c),i.appendChild(s);let p=document.createElement("div");if(p.className="bp-plan-body"+(t?" is-expanded":""),p.setAttribute("data-testid","plan-body"),p.appendChild(Ot(e.question||"")),i.appendChild(p),e.state==="open"){let l=document.createElement("div");l.className="bp-plan-actions";let h=e.options?.find((b)=>b.id==="implement"||b.id.endsWith("|implement")),d=document.createElement("button");if(d.type="button",d.className="primary",d.setAttribute("data-testid","plan-implement"),d.textContent=h?.label&&h.label!=="Implement"?he(h.label):u("approval.implement","Implement"),d.addEventListener("click",()=>{this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,h?.id??"implement")}),l.appendChild(d),e.revise!==!1){let b=document.createElement("button");b.type="button",b.className="bp-plan-revise-btn"+(n?" active":""),b.setAttribute("data-testid","plan-revise"),b.append(Gt(["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"]),document.createTextNode(u("gpui.ask.plan.revise","Revise"))),b.addEventListener("click",()=>{let v=this.planRevisingId!==e.id;this.planRevisingId=v?e.id:"";let w=this.scrollEl.scrollTop;if(this.renderEntries(!1),this.scrollEl.scrollTop=w,v)this.listEl.querySelector(`[data-testid="ask-${CSS.escape(e.id)}"] .bp-plan-revise-input`)?.focus()}),l.appendChild(b)}let m=e.options?.find((b)=>b.id==="dismiss"||b.id.endsWith("|dismiss")),f=document.createElement("button");if(f.type="button",f.className="bp-plan-dismiss-btn",f.setAttribute("data-testid","plan-dismiss"),f.textContent=m?.label&&m.label!=="Dismiss"?he(m.label):u("approval.dismiss","Dismiss"),f.addEventListener("click",()=>{this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,m?.id??"dismiss")}),l.appendChild(f),i.appendChild(l),n){let b=document.createElement("div");b.className="bp-plan-revise",b.setAttribute("data-testid","plan-revise-drawer");let v=document.createElement("textarea");v.rows=2,v.className="bp-input bp-plan-revise-input",v.placeholder=u("gpui.ask.plan.reviseph","What should change in the plan?"),v.value=this.planReviseDrafts.get(e.id)??"";let w=document.createElement("button");w.type="button",w.className="bp-plan-revise-send",w.setAttribute("data-testid","plan-revise-send"),w.textContent=u("gpui.ask.plan.sendrev","Send revision"),w.disabled=v.value.trim().length===0;let E=()=>{let M=v.value.trim();if(!M)return;this.planRevisingId="",this.planReviseDrafts.delete(e.id),this.cb.onAnswerAsk(e.id,`revise:${M}`)},k=()=>{this.closePlanRevise()};b.addEventListener("keydown",(M)=>{if(M.key==="Escape")M.preventDefault(),M.stopPropagation(),k()}),v.addEventListener("input",()=>{this.planReviseDrafts.set(e.id,v.value),w.disabled=v.value.trim().length===0}),v.addEventListener("keydown",(M)=>{if(M.key==="Enter"&&!M.shiftKey)M.preventDefault(),E()}),w.addEventListener("click",E);let L=document.createElement("button");L.type="button",L.className="bp-btn-ghost",L.textContent=u("common.cancel","Cancel"),L.addEventListener("click",k),b.append(v,w,L),i.appendChild(b)}}else{let l=document.createElement("div");l.className="bp-ask-answered",l.textContent=u("web.chat.answered","Answered: {answer}",{answer:e.answered??""}),i.appendChild(l)}return i}}var Wr={claude:"Claude Code",codex:"Codex CLI",grok:"Grok CLI",muse:"Muse Code",antigravity:"Google Antigravity",opencode:"OpenCode",pi:"Pi",omp:"Oh My Pi"};var Ii=/[\x00-\x1f\x7f]/,_r=/\s/;function Pt(e){return e.trim().replace(/^@+/,"").toLowerCase()}function ft(e,t){if(Ii.test(e)||Ii.test(t))return"";let n=Pt(e),i=t.trim();if(!n||!i||n.includes("/")||_r.test(n))return"";if(n.length+1+i.length>200)return"";return`${n}/${i}`}function Ri(e){let t=e.indexOf("/");if(t<=0)return null;let n=e.slice(0,t),i=e.slice(t+1);if(!ft(n,i))return null;return{provider:Pt(n),model:i.trim()}}function dt(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let i of e){if(typeof i!=="string")continue;let s=Ri(i);if(!s)continue;let r=`${s.provider}/${s.model}`;if(!n.has(r)){if(n.add(r),t.push(r),t.length>=64)break}}return t}function Nn(e,t,n,i){let s=ft(t,n),r=dt(e);if(!s)return{keys:r,starred:!1};let o=r.indexOf(s),a=i!==void 0?i:o<0;if(a&&o<0){if(r.length>=64)return{keys:r,starred:!1};r.push(s)}else if(!a&&o>=0)r.splice(o,1);return{keys:r,starred:a}}function nt(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:null}function xt(e){return Array.isArray(e)?e:[]}function Se(e){return typeof e==="string"?e:""}function zr(e){return Wr[e]??e}function ji(e,t,n,i){let s=new Map;for(let o of e)s.set(o.provider,o);let r=[];for(let o of dt(t)){let a=Ri(o);if(!a)continue;let c=s.get(a.provider),p=Boolean(c&&c.models.some((m)=>m.value!=="")),l=c?.models.find((m)=>m.value===a.model),h=l?l.ok&&(c?.ok??!0):c?.ok??!0,d=l?.why||c?.why||"";if(h&&p&&!l)h=!1,d="not available on this machine";r.push({key:o,provider:a.provider,model:a.model,label:l?.label||a.model,note:l?.note||"",on:a.provider===n&&a.model===i,ok:h,why:d})}return r}function Hi(e,t=[]){let n=nt(e),i=nt(n?.picker)??n??{},s=xt(i.sections).map(nt).filter((P)=>Boolean(P)),r=(P)=>s.find((Y)=>Se(Y.action)===P),o=r("provider"),a=r("model"),c=r("effort"),p=xt(o?.choices).map(nt).filter((P)=>Boolean(P)),l=xt(a?.choices).map(nt).filter((P)=>Boolean(P)),h=xt(c?.choices).map(nt).filter((P)=>Boolean(P)),d=Se(i.chip),m=Se(p.find((P)=>P.on===!0)?.value)||d.split("/")[0]?.trim()||"claude",f=Pt(m)||"claude",b=Se(l.find((P)=>P.on===!0)?.value),v=Se(h.find((P)=>P.on===!0)?.value),w=h.map((P)=>({value:Se(P.value),label:Se(P.label)||"auto",on:P.on===!0})),E=nt(i.agents),k=[],L=new Set,M=(P)=>{let Y=Pt(P);if(Y&&!L.has(Y))L.add(Y),k.push(Y)};for(let P of p)M(Se(P.value)||Se(P.label));if(E)for(let P of Object.keys(E))M(P);M(f);let A=k.map((P)=>{let Y=p.find((te)=>Pt(Se(te.value)||Se(te.label))===P),re=nt(E?.[P]),ie=re?re.ok!==!1:Y?Y.ok!==!1:!0,ue=Se(re?.why)||Se(Y?.why),Pe=xt(re?.models).map(nt).filter((te)=>Boolean(te)),Ce;if(Pe.length>0)Ce=Pe.map((te)=>{let oe=Se(te.value),R=Se(te.label)||(oe===""?"default":oe),me=Se(te.note);return{value:oe,label:R,note:me,on:P===f&&oe===b,ok:te.ok!==!1&&ie,why:Se(te.why)||ue}});else if(P===f&&l.length>0)Ce=l.map((te)=>{let oe=Se(te.value),R=Se(te.label);return{value:oe,label:oe===""?"default":oe,note:R&&R!==oe?R:"",on:te.on===!0,ok:te.ok!==!1&&ie,why:Se(te.why)||ue}});else if(ie)Ce=[{value:"",label:"default",note:"",on:P===f&&b==="",ok:!0,why:""}];else Ce=[];if(P===f&&b&&!Ce.some((te)=>te.value===b)){let te=l.find((R)=>Se(R.value)===b),oe=Se(te?.label);Ce.push({value:b,label:b,note:oe&&oe!==b?oe:"",on:!0,ok:!0,why:""})}return{provider:P,label:zr(P),ok:ie,why:ue,models:Ce}}),B=Array.isArray(i.favoriteKeys),T=xt(i.favorites).map(nt).filter((P)=>Boolean(P)),H=B?dt(i.favoriteKeys):T.length>0?dt(T.map((P)=>Se(P.key)||ft(Se(P.provider),Se(P.model)))):dt(t),O=T.length>0?T.map((P)=>{let Y=Pt(Se(P.provider)),re=Se(P.model).trim(),ie=ft(Y,re);if(!ie)return null;return{key:ie,provider:Y,model:re,label:Se(P.label)||re,note:Se(P.note),on:P.on===!0||Y===f&&re===b,ok:P.ok!==!1,why:Se(P.why)}}).filter((P)=>Boolean(P)):ji(A,H,f,b);return{chip:d,provider:f,model:b,effort:v,efforts:w,providers:A,favoriteKeys:H,favorites:O}}function Vt(e,t){let n=dt(t);return{...e,favoriteKeys:n,favorites:ji(e.providers,n,e.provider,e.model)}}function Di(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean),i=(a)=>{if(n.length===0)return!0;let c=a.toLowerCase();return n.every((p)=>c.includes(p))},s=new Set(e.favoriteKeys),r=e.favorites.filter((a)=>i(`${a.provider} ${a.model} ${a.label} ${a.note}`)),o=[];for(let a of e.providers){let c=a.models.filter((p)=>i(`${a.provider} ${a.label} ${p.value} ${p.label} ${p.note}`)).map((p)=>{let l=p.value?ft(a.provider,p.value):"";return{...p,provider:a.provider,starrable:p.value!=="",starred:Boolean(l&&s.has(l))}});if(c.length>0||n.length===0&&!a.ok&&a.why)o.push({provider:a.provider,label:a.label,ok:a.ok,why:a.why,models:c})}return{favorites:r,groups:o,efforts:e.efforts}}var Fi={claude:{viewBox:"0 0 24 24",d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},codex:{viewBox:"0 0 256 260",d:"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695l-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218l-.052-32.434Z"},grok:{viewBox:"0 0 24 24",d:"M9.497 15.122 L16.811 9.491 C17.169 9.215 17.682 9.323 17.852 9.751 C18.752 12.013 18.35 14.73 16.561 16.596 C14.772 18.462 12.283 18.871 10.007 17.939 L7.522 19.139 C11.087 21.68 15.416 21.052 18.121 18.229 C20.267 15.991 20.931 12.941 20.31 10.19 L20.315 10.196 C19.414 6.155 20.537 4.54 22.837 1.237 C22.891 1.159 22.946 1.08 23 1 L19.974 4.156 L19.974 4.146 L9.495 15.124 M7.987 16.49 C5.429 13.941 5.87 9.996 8.053 7.721 C9.667 6.037 12.313 5.35 14.622 6.361 L17.102 5.166 C16.655 4.829 16.082 4.467 15.425 4.213 C12.455 2.938 8.9 3.573 6.485 6.088 C4.163 8.51 3.433 12.234 4.687 15.411 C5.624 17.786 4.088 19.466 2.541 21.162 C1.993 21.763 1.443 22.364 1 23 L7.985 16.492"},muse:{viewBox:"0 0 24 24",d:"M10.73.032c-1.333 0-2.032 1.016-2.032 2.285 0 2.223 2.127 4.953 4.318 4.953 1.301 0 2-.953 2-2.254 0-2.254-2.095-4.984-4.286-4.984m8.413 2.984c-1.968 0-3.397 2.73-3.397 4.825 0 1.556.794 3.016 2.254 3.016 2 0 3.365-2.762 3.365-4.794 0-1.523-.762-3.047-2.222-3.047M4.857 4.159c-1.968 0-3.778 1.016-3.778 2.54 0 1.65 2.16 2.793 4.254 2.793 1.873 0 3.778-.92 3.778-2.508 0-1.682-2.159-2.825-4.254-2.825m-.222 6.476C2.413 10.635 0 13.175 0 15.397c0 1.301.825 2.159 2.095 2.159 2.19 0 4.603-2.508 4.603-4.794 0-1.27-.761-2.127-2.063-2.127m16.667.698c-2.223 0-5.016 1.62-5.016 3.651 0 1.238 1.047 2.19 2.698 2.19 2.159 0 5.016-1.587 5.016-3.682 0-1.302-1.08-2.159-2.698-2.159M7.619 16c-1.524 0-2.38 1.746-2.38 3.429 0 2.063 1.269 4.54 3.047 4.54 1.524 0 2.38-1.81 2.38-3.461C10.667 18.57 9.46 16 7.62 16m6.571 1.016c-1.333 0-2.476.667-2.476 2.032 0 2.095 2.667 4.063 4.92 4.063 1.366 0 2.54-.73 2.54-2.063 0-2.032-2.698-4.032-4.984-4.032"},antigravity:{viewBox:"0 0 24 24",d:"M20.197 20.618 C21.318 21.459 23 20.898 21.459 19.357 C16.834 14.873 17.815 2.541 12.07 2.541 C6.325 2.541 7.306 14.873 2.682 19.357 C1 21.038 2.822 21.459 3.943 20.618 C8.287 17.675 8.006 12.49 12.07 12.49 C16.134 12.49 15.853 17.675 20.197 20.618 Z"},opencode:{viewBox:"0 0 24 24",d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"},pi:{viewBox:"0 0 24 24",d:"M0 0v24h6v-6h6v-6H6V6h6v6h6V0Zm18 12v12h6V12Z"},omp:{viewBox:"0 0 24 24",d:"M1.44 3.86 L22.56 3.86 C23 3.86 23 3.86 23 4.3 L23 6.06 C23 6.5 23 6.5 22.56 6.5 L1.44 6.5 C1 6.5 1 6.5 1 6.06 L1 4.3 C1 3.86 1 3.86 1.44 3.86 Z M4.74 6.5 L6.5 6.5 C6.94 6.5 6.94 6.5 6.94 6.94 L6.94 19.7 C6.94 20.14 6.94 20.14 6.5 20.14 L4.74 20.14 C4.3 20.14 4.3 20.14 4.3 19.7 L4.3 6.94 C4.3 6.5 4.3 6.5 4.74 6.5 Z M15.74 6.5 L17.5 6.5 C17.94 6.5 17.94 6.5 17.94 6.94 L17.94 13.32 C17.94 13.76 17.94 13.76 17.5 13.76 L15.74 13.76 C15.3 13.76 15.3 13.76 15.3 13.32 L15.3 6.94 C15.3 6.5 15.3 6.5 15.74 6.5 Z M15.08 14.64 L18.16 14.64 C18.82 14.64 18.82 14.64 18.82 15.3 L18.82 17.5 C18.82 18.16 18.82 18.16 18.16 18.16 L15.08 18.16 C14.42 18.16 14.42 18.16 14.42 17.5 L14.42 15.3 C14.42 14.64 14.42 14.64 15.08 14.64 Z"}};var St="http://www.w3.org/2000/svg",$i=4,Oi=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function on(e){let t=document.createElementNS(St,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","15"),t.setAttribute("height","15"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("aria-hidden","true");for(let n of e){let i=document.createElementNS(St,"path");i.setAttribute("d",n),t.appendChild(i)}return t}function Mn(){return on(["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"])}function Gi(){return on(["M6 4l14 8-14 8z"])}function Vi(e){let t=document.createElementNS(St,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill",e?"currentColor":"none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");let n=document.createElementNS(St,"path");return n.setAttribute("d","M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5-4.8-4.6 6.6-.9z"),t.appendChild(n),t}function Ui(e){let t=(e||"").toLowerCase();if(t.includes("claude")||t.includes("anthropic"))return{mark:"claude",glyph:"A",color:"#d97757",title:"Claude"};if(t.includes("codex")||t.includes("openai"))return{mark:"codex",glyph:"O",color:"#10a37f",title:"Codex"};if(t.includes("gemini")||t.includes("antigravity")||t==="agy")return{mark:"antigravity",glyph:"G",color:"#4285f4",title:"Antigravity"};if(t.includes("grok"))return{mark:"grok",glyph:"X",color:"#6b7280",title:"Grok"};if(t.includes("muse"))return{mark:"muse",glyph:"M",color:"#8b5cf6",title:"Muse"};if(t.includes("opencode"))return{mark:"opencode",glyph:"C",color:"#2563eb",title:"OpenCode"};if(t.includes("omp")||t.includes("oh-my-pi"))return{mark:"omp",glyph:"Ω",color:"#c026d3",title:"Oh My Pi"};if(t==="pi"||t.startsWith("pi/")||t.startsWith("@pi"))return{mark:"pi",glyph:"π",color:"#db2777",title:"Pi"};return{glyph:"●",color:"var(--accent)",title:e||"Model"}}function Wi(e){let t=Fi[e];if(!t||!t.d)return null;let n=document.createElementNS(St,"svg");n.setAttribute("viewBox",t.viewBox||"0 0 24 24"),n.setAttribute("width","14"),n.setAttribute("height","14"),n.setAttribute("fill","currentColor"),n.setAttribute("aria-hidden","true");let i=document.createElementNS(St,"path");return i.setAttribute("d",t.d),n.appendChild(i),n}class Tn{popupEl;attachStripEl;planBarEl;fileInput;textarea;memoryEl;memoryFill;memoryText;modelBtn;providerMarkEl;modelTextEl;ctxEl;modelPickerEl;modelSearchInput;modelPickerBodyEl;modelPickerEffortsEl;modelPickerOpen=!1;modelPickerLoading=!1;modelPickerSnap=null;modelPickerQuery="";modelPickerFocusIdx=-1;onDocMouseDown;planChipBtn;planChipIconHost;planChipLbl;attachBtn;voiceBtn;sendBtn;stopBtn;errorEl;replyEl;cb;commands=[];popupMode="none";filteredSlash=[];mentionItems=[];popupIdx=0;enabled=!1;attachments=[];planMode=null;constructor(e,t){this.cb=t;let n=document.createElement("div");n.className="bp-composer",n.setAttribute("data-testid","composer");let i=document.createElement("div");i.className="bp-composer-inner",this.popupEl=document.createElement("div"),this.popupEl.className="bp-composer-popup bp-hidden",this.popupEl.setAttribute("data-testid","slash-menu"),this.errorEl=document.createElement("div"),this.errorEl.className="bp-composer-err bp-hidden",this.replyEl=document.createElement("div"),this.replyEl.className="bp-reply-strip bp-hidden",this.replyEl.setAttribute("data-testid","composer-reply"),this.attachStripEl=document.createElement("div"),this.attachStripEl.className="bp-attach-strip bp-hidden",this.attachStripEl.setAttribute("data-testid","composer-attachments"),this.planBarEl=document.createElement("div"),this.planBarEl.className="bp-plan-bar bp-hidden",this.planBarEl.setAttribute("data-testid","composer-plan-bar"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.accept="image/png,image/jpeg,image/webp,image/gif",this.fileInput.multiple=!0,this.fileInput.className="bp-hidden",this.fileInput.setAttribute("data-testid","composer-file-input"),this.fileInput.addEventListener("change",()=>{if(this.fileInput.files)this.addFiles(Array.from(this.fileInput.files));this.fileInput.value=""}),this.textarea=document.createElement("textarea"),this.textarea.className="bp-composer-input",this.textarea.rows=2,this.textarea.placeholder=u("composer.placeholder","Ask anything: @bot, >thread, %project, #room, $skill, /btw"),this.textarea.setAttribute("data-testid","composer-input");let s=document.createElement("div");s.className="bp-composer-bar";let r=document.createElement("button");r.type="button",r.className="bp-composer-model",r.setAttribute("data-testid","composer-model-chip"),r.setAttribute("aria-haspopup","dialog"),r.setAttribute("aria-expanded","false"),r.title=u("composer.model.tip","Choose the model and effort"),this.modelBtn=r,this.providerMarkEl=document.createElement("span"),this.providerMarkEl.className="bp-provider-mark",this.providerMarkEl.textContent="●",this.modelTextEl=document.createElement("span"),this.modelTextEl.className="bp-model-text",this.modelTextEl.textContent="default",this.ctxEl=document.createElement("span"),this.ctxEl.className="bp-ctx-pct bp-hidden",this.ctxEl.setAttribute("data-testid","composer-ctx");let o=document.createElement("span");o.className="bp-model-caret",o.textContent="▾",r.append(this.providerMarkEl,this.modelTextEl,this.ctxEl,o),r.addEventListener("click",()=>{this.toggleModelPicker()}),this.modelPickerEl=document.createElement("div"),this.modelPickerEl.className="bp-model-picker bp-hidden",this.modelPickerEl.setAttribute("data-testid","model-picker"),this.modelPickerEl.setAttribute("role","dialog");let a=document.createElement("div");a.className="bp-mp-search-wrap",this.modelSearchInput=document.createElement("input"),this.modelSearchInput.type="search",this.modelSearchInput.className="bp-mp-search",this.modelSearchInput.placeholder=u("gpui.search.models","Search models"),this.modelSearchInput.setAttribute("data-testid","model-picker-search"),this.modelSearchInput.addEventListener("input",()=>{this.modelPickerQuery=this.modelSearchInput.value,this.modelPickerFocusIdx=-1,this.renderModelPicker()}),this.modelSearchInput.addEventListener("keydown",(l)=>{if(l.key==="Escape"){l.preventDefault(),l.stopPropagation(),this.closeModelPicker(),this.textarea.focus();return}if(l.key==="ArrowDown"||l.key==="ArrowUp"){let h=this.modelPickerFocusableButtons();if(h.length===0)return;l.preventDefault();let d=l.key==="ArrowDown"?1:-1;this.modelPickerFocusIdx=this.modelPickerFocusIdx<0?d>0?0:h.length-1:(this.modelPickerFocusIdx+d+h.length)%h.length,this.updateModelPickerKbdFocus(h);return}if(l.key==="Enter"){let h=this.modelPickerFocusableButtons(),d=this.modelPickerFocusIdx>=0&&this.modelPickerFocusIdxthis.cb.onCyclePlanMode?.()),this.memoryEl=document.createElement("div"),this.memoryEl.className="bp-composer-memory bp-hidden",this.memoryEl.setAttribute("data-testid","composer-memory");let c=document.createElement("div");c.className="bp-memory-meter",this.memoryFill=document.createElement("div"),this.memoryFill.className="bp-memory-fill",c.appendChild(this.memoryFill),this.memoryText=document.createElement("span"),this.memoryEl.append(c,this.memoryText);let p=document.createElement("div");p.className="bp-composer-btns",this.attachBtn=document.createElement("button"),this.attachBtn.type="button",this.attachBtn.className="icon bp-composer-tool",this.attachBtn.title=u("web.composer.attach","Attach image"),this.attachBtn.setAttribute("aria-label",u("web.composer.attach","Attach image")),this.attachBtn.setAttribute("data-testid","composer-attach"),this.attachBtn.appendChild(on(["M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"])),this.attachBtn.addEventListener("click",()=>this.fileInput.click()),this.voiceBtn=document.createElement("button"),this.voiceBtn.type="button",this.voiceBtn.className="icon bp-composer-tool",this.voiceBtn.title=u("web.composer.voice","Voice dictation"),this.voiceBtn.setAttribute("aria-label",u("web.composer.voice","Voice dictation")),this.voiceBtn.setAttribute("data-testid","composer-voice"),this.voiceBtn.appendChild(on(["M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z","M19 10v2a7 7 0 0 1-14 0v-2","M12 19v4","M8 23h8"])),this.voiceBtn.addEventListener("click",()=>this.cb.onToggleVoice?.()),this.stopBtn=document.createElement("button"),this.stopBtn.type="button",this.stopBtn.className="primary stop bp-hidden",this.stopBtn.textContent=u("composer.stop","Stop"),this.stopBtn.setAttribute("data-testid","composer-stop"),this.stopBtn.addEventListener("click",()=>this.cb.onInterrupt()),this.sendBtn=document.createElement("button"),this.sendBtn.type="button",this.sendBtn.className="primary bp-send-btn",this.sendBtn.textContent=u("composer.send","Send"),this.sendBtn.setAttribute("data-testid","composer-send"),this.sendBtn.addEventListener("click",()=>this.submit()),p.append(this.attachBtn,this.voiceBtn,this.stopBtn,this.sendBtn),s.append(r,this.planChipBtn,this.memoryEl,p),i.append(this.modelPickerEl,this.popupEl,this.errorEl,this.replyEl,this.attachStripEl,this.planBarEl,this.fileInput,this.textarea,s),n.appendChild(i),e.appendChild(n),this.onDocMouseDown=(l)=>{if(!this.modelPickerEl.isConnected){document.removeEventListener("mousedown",this.onDocMouseDown);return}if(!this.modelPickerOpen)return;let h=l.target;if(h&&(this.modelPickerEl.contains(h)||this.modelBtn.contains(h)))return;this.closeModelPicker()},document.addEventListener("mousedown",this.onDocMouseDown),this.textarea.addEventListener("paste",(l)=>{let h=l.clipboardData?.items;if(!h)return;let d=[];for(let m=0;m0)l.preventDefault(),this.addFiles(d)}),this.textarea.addEventListener("input",()=>{this.autoGrow(),this.clearError(),this.updatePopups()}),this.textarea.addEventListener("keydown",(l)=>{if(this.popupMode!=="none"){let h=this.popupMode==="slash"?this.filteredSlash.length:this.mentionItems.length;if(l.key==="ArrowDown"){l.preventDefault(),this.popupIdx=(this.popupIdx+1)%Math.max(1,h),this.renderPopup();return}if(l.key==="ArrowUp"){l.preventDefault(),this.popupIdx=(this.popupIdx-1+Math.max(1,h))%Math.max(1,h),this.renderPopup();return}if(l.key==="Tab"||l.key==="Enter"&&!l.shiftKey&&this.shouldCompleteOnEnter()){l.preventDefault(),this.applyPopupChoice(this.popupIdx);return}if(l.key==="Escape"){l.preventDefault(),this.closePopup();return}}if(l.key==="Tab"&&l.shiftKey&&this.planMode!==null){l.preventDefault(),this.cb.onCyclePlanMode?.();return}if(l.key==="Enter"&&!l.shiftKey)l.preventDefault(),this.submit()})}setCommands(e){this.commands=e.map((t)=>({...t,word:t.word.replace(/^\//,"")}))}setModelChip(e,t,n){let i=Ui(t),s=i.mark?Wi(i.mark):null;if(s)this.providerMarkEl.replaceChildren(s);else this.providerMarkEl.textContent=i.glyph;if(this.providerMarkEl.style.color=i.color,this.providerMarkEl.title=i.title,this.modelTextEl.textContent=e||"default",typeof n==="number"&&Number.isFinite(n)&&n>=0)this.ctxEl.textContent=`ctx ${Math.round(n)}%`,this.ctxEl.classList.remove("bp-hidden");else this.ctxEl.textContent="",this.ctxEl.classList.add("bp-hidden")}setFeatures(e,t){this.attachBtn.classList.toggle("bp-hidden",!e),this.voiceBtn.classList.toggle("bp-hidden",!t)}setVoiceRecording(e){this.voiceBtn.classList.toggle("recording",e),this.voiceBtn.setAttribute("aria-pressed",e?"true":"false")}setVoiceLevel(e){this.voiceBtn.setAttribute("data-level",String(e))}getDraft(){return this.textarea.value}getCaret(){return this.textarea.selectionStart??this.textarea.value.length}setMemory(e){if(this.memoryEl.classList.toggle("bp-hidden",!e),!e)return;let t=e.total??0,n=t>0?Math.min(1,(e.done??0)/t):1;this.memoryFill.style.width=`${Math.round(n*100)}%`,this.memoryFill.dataset.state=e.state??"",this.memoryText.textContent=e.line??"",this.memoryEl.title=[e.status,e.lines,e.viewLine].filter(Boolean).join(` +`)}setPlanMode(e){if(this.planMode=e,this.textarea.classList.remove("is-plan","is-plan-exec"),this.sendBtn.classList.remove("is-plan","is-plan-exec"),this.planChipBtn.classList.remove("is-plan","is-exec"),this.planBarEl.classList.remove("is-exec"),!e){this.planChipBtn.classList.add("bp-hidden"),this.planChipBtn.setAttribute("aria-pressed","false"),this.planBarEl.classList.add("bp-hidden"),this.planBarEl.replaceChildren(),this.sendBtn.textContent=u("composer.send","Send");return}let t=e.phase,n=t!=="off",i=t==="armed"||t==="planning"||t==="pending",s=t==="executing";this.planChipBtn.classList.remove("bp-hidden"),this.planChipBtn.classList.toggle("is-plan",i),this.planChipBtn.classList.toggle("is-exec",s),this.planChipBtn.setAttribute("aria-pressed",n?"true":"false");let r=`${u("gpui.planmode.tip","Plan before acting (1 turn, always, or off)")} · Shift+Tab`;if(this.planChipBtn.title=r,this.planChipBtn.setAttribute("aria-label",r),this.planChipIconHost.replaceChildren(s?Gi():Mn()),this.planChipLbl.textContent=s?u("gpui.planmode.chip.building","Building"):t==="pending"?u("gpui.mgmt.fab.reviewbtn","Review"):i&&e.once?u("gpui.planmode.chip.once","Plan · 1t"):u("gpui.mgmt.plan.tab","Plan"),this.textarea.classList.toggle("is-plan",i),this.textarea.classList.toggle("is-plan-exec",s),this.sendBtn.classList.toggle("is-plan",i),this.sendBtn.classList.toggle("is-plan-exec",s),this.sendBtn.textContent=i?u("gpui.mgmt.plan.tab","Plan"):u("composer.send","Send"),!n){this.planBarEl.classList.add("bp-hidden"),this.planBarEl.replaceChildren();return}this.planBarEl.classList.remove("bp-hidden"),this.planBarEl.classList.toggle("is-exec",s);let o=document.createElement("span");o.className="bp-plan-bar-ic",o.appendChild(s?Gi():Mn());let a=document.createElement("span");a.className="bp-plan-bar-text",a.textContent=t==="armed"&&e.once?u("gpui.planmode.bar.once","Plan mode (1 turn) — explores and proposes a plan before editing"):t==="armed"?u("gpui.planmode.bar.always","Plan mode — explores and proposes a plan before editing"):t==="planning"?u("gpui.planmode.bar.planning","Planning — drafting a plan before edits"):t==="pending"?u("gpui.planmode.bar.pending","Proposed plan awaits review below"):u("gpui.planmode.bar.executing","Building the approved plan");let c=[o,a];if(t==="armed"||t==="planning"){let p=document.createElement("div");p.className="bp-plan-scopes";let l=(h,d,m,f)=>{let b=document.createElement("button");return b.type="button",b.className="bp-plan-scope-btn"+(d?" active":""),b.textContent=h,b.disabled=!this.enabled,b.setAttribute("data-testid",f),b.addEventListener("click",()=>this.cb.onSetPlanMode?.(m)),b};p.append(l(u("gpui.planmode.scope.once","1 turn"),e.once,"once","plan-scope-once"),l(u("gpui.planmode.scope.always","Always"),!e.once,"always","plan-scope-always"),l(u("gpui.bots.recall.off","Off"),!1,"off","plan-scope-off")),c.push(p)}this.planBarEl.replaceChildren(...c)}setState(e,t){if(this.enabled=e,this.textarea.disabled=!e,this.sendBtn.disabled=!e,this.attachBtn.disabled=!e,this.voiceBtn.disabled=!e,this.modelBtn.disabled=!e,!e)this.closeModelPicker();this.planChipBtn.disabled=!e,this.planBarEl.querySelectorAll(".bp-plan-scope-btn").forEach((n)=>{n.disabled=!e}),this.stopBtn.classList.toggle("bp-hidden",!t)}destroy(){document.removeEventListener("mousedown",this.onDocMouseDown)}isModelPickerOpen(){return this.modelPickerOpen}closeModelPicker(){if(!this.modelPickerOpen)return;this.modelPickerOpen=!1,this.modelPickerFocusIdx=-1,this.modelPickerEl.classList.add("bp-hidden"),this.modelBtn.classList.remove("is-open"),this.modelBtn.setAttribute("aria-expanded","false")}modelPickerFocusableButtons(){return Array.from(this.modelPickerBodyEl.querySelectorAll(".bp-mp-row-main:not(:disabled)"))}updateModelPickerKbdFocus(e){e.forEach((t,n)=>{let i=n===this.modelPickerFocusIdx;if(t.classList.toggle("is-kbd",i),i)t.scrollIntoView({block:"nearest"})})}updateFavoriteModels(e){if(!this.modelPickerSnap)return;if(this.modelPickerSnap=Vt(this.modelPickerSnap,e),this.modelPickerOpen)this.renderModelPicker()}async toggleModelPicker(){if(!this.enabled)return;if(this.modelPickerOpen){this.closeModelPicker();return}this.closePopup(),this.modelPickerOpen=!0,this.modelPickerQuery="",this.modelPickerFocusIdx=-1,this.modelSearchInput.value="",this.modelPickerEl.classList.remove("bp-hidden"),this.modelBtn.classList.add("is-open"),this.modelBtn.setAttribute("aria-expanded","true"),this.modelPickerLoading=!0,this.renderModelPicker(),this.modelSearchInput.focus(),await this.reloadModelPicker()}async reloadModelPicker(){if(!this.cb.onLoadModelPicker){this.modelPickerLoading=!1,this.renderModelPicker();return}try{let e=await this.cb.onLoadModelPicker();if(!this.modelPickerOpen)return;this.modelPickerSnap=Hi(e,this.cb.getFavoriteModels?.()??[])}catch{}finally{if(this.modelPickerLoading=!1,this.modelPickerOpen)this.renderModelPicker()}}async toggleFavoriteInPicker(e,t){if(!this.modelPickerSnap)return;let n=this.modelPickerSnap,i=ft(e,t);if(!i)return;let s=n.favoriteKeys.includes(i),r=Nn(n.favoriteKeys,e,t);if(r.keys.length===n.favoriteKeys.length&&r.starred===s)return;if(this.modelPickerSnap=Vt(n,r.keys),this.renderModelPicker(),!this.cb.onToggleFavorite)return;try{let o=await this.cb.onToggleFavorite(e,t,r.starred);if(Array.isArray(o)&&this.modelPickerSnap){if(this.modelPickerSnap=Vt(this.modelPickerSnap,dt(o)),this.modelPickerOpen)this.renderModelPicker()}}catch(o){if(this.modelPickerSnap){let a=this.cb.getFavoriteModels?.(),c=Array.isArray(a)?dt(a):Nn(this.modelPickerSnap.favoriteKeys,e,t,!r.starred).keys;if(this.modelPickerSnap=Vt(this.modelPickerSnap,c),this.modelPickerOpen)this.renderModelPicker()}this.showError(o instanceof Error&&o.message?o.message:"Could not update favorite model")}}renderProviderGlyph(e){let t=Ui(e),n=document.createElement("span");n.className="bp-mp-mark",n.style.color=t.color,n.title=t.title;let i=t.mark?Wi(t.mark):null;if(i)n.appendChild(i);else n.textContent=t.glyph;return n}makeStarButton(e,t,n,i="model-star"){let s=document.createElement("button");s.type="button",s.className="bp-mp-star"+(n?" is-starred":"");let r=n?u("gpui.picker.favorite.remove","Remove from favorites"):u("gpui.picker.favorite.add","Add to favorites");return s.title=r,s.setAttribute("aria-label",r),s.setAttribute("aria-pressed",n?"true":"false"),s.setAttribute("data-testid",`${i}-${e}-${t}`),s.appendChild(Vi(n)),s.addEventListener("click",(o)=>{o.preventDefault(),o.stopPropagation(),this.toggleFavoriteInPicker(e,t)}),s}renderModelPicker(){if(!this.modelPickerOpen)return;if(this.modelPickerFocusIdx=-1,!this.modelPickerSnap){let i=document.createElement("div");i.className="bp-mp-empty",i.textContent=this.modelPickerLoading?"…":u("gpui.no.models","No models"),this.modelPickerBodyEl.replaceChildren(i),this.modelPickerEffortsEl.classList.add("bp-hidden"),this.modelPickerEffortsEl.replaceChildren();return}let e=Di(this.modelPickerSnap,this.modelPickerQuery),t=document.createDocumentFragment();if(e.favorites.length>0){let i=document.createElement("div");i.className="bp-mp-section bp-mp-favorites",i.setAttribute("data-testid","model-picker-favorites");let s=document.createElement("div");s.className="bp-mp-head";let r=document.createElement("span");r.className="bp-mp-head-star",r.appendChild(Vi(!0));let o=document.createElement("span");o.textContent=u("gpui.picker.favorites","Favorites"),s.append(r,o),i.appendChild(s);for(let a of e.favorites){let c=document.createElement("div");c.className="bp-mp-row"+(a.on?" is-active":"")+(!a.ok?" is-disabled":""),c.setAttribute("data-testid",`model-fav-row-${a.provider}-${a.model}`);let p=document.createElement("button");if(p.type="button",p.className="bp-mp-row-main",p.disabled=!a.ok,!a.ok&&a.why)p.title=a.why;let l=document.createElement("span");l.className="bp-mp-check",l.textContent=a.on?"✓":"";let h=document.createElement("span");h.className="bp-mp-name",h.textContent=a.label;let d=document.createElement("span");d.className="bp-mp-note",d.textContent=!a.ok&&a.why?he(a.why):a.note&&a.note!==a.label?he(a.note):a.provider,p.append(l,this.renderProviderGlyph(a.provider),h,d),p.addEventListener("click",()=>{if(!a.ok)return;this.closeModelPicker(),this.textarea.focus(),this.cb.onSelectModel?.(a.provider,a.model)}),c.append(p,this.makeStarButton(a.provider,a.model,!0,"model-fav-star")),i.appendChild(c)}t.appendChild(i)}let n=document.createElement("div");if(n.className="bp-mp-groups",n.setAttribute("data-testid","model-picker-groups"),e.groups.length===0){let i=document.createElement("div");i.className="bp-mp-empty",i.textContent=this.modelPickerQuery.trim()?u("gpui.nothing.matches","Nothing matches"):u("gpui.no.models","No models"),n.appendChild(i)}else for(let i of e.groups){let s=document.createElement("div");s.className="bp-mp-group";let r=document.createElement("div");r.className="bp-mp-group-head";let o=document.createElement("span");if(o.className="bp-mp-group-title",o.textContent=i.label,r.append(this.renderProviderGlyph(i.provider),o),!i.ok&&i.why){let a=document.createElement("span");a.className="bp-mp-group-why",a.textContent=he(i.why),r.appendChild(a)}s.appendChild(r);for(let a of i.models){let c=document.createElement("div");c.className="bp-mp-row"+(a.on?" is-active":"")+(!a.ok?" is-disabled":""),c.setAttribute("data-testid",`model-row-${i.provider}-${a.value||"default"}`);let p=document.createElement("button");if(p.type="button",p.className="bp-mp-row-main",p.disabled=!a.ok,!a.ok&&a.why)p.title=a.why;let l=document.createElement("span");l.className="bp-mp-check",l.textContent=a.on?"✓":"";let h=document.createElement("span");h.className="bp-mp-name",h.textContent=a.label;let d=document.createElement("span");if(d.className="bp-mp-note",d.textContent=a.note&&a.note!==a.label?he(a.note):"",p.append(l,h,d),p.addEventListener("click",()=>{if(!a.ok)return;this.closeModelPicker(),this.textarea.focus(),this.cb.onSelectModel?.(i.provider,a.value)}),c.appendChild(p),a.starrable)c.appendChild(this.makeStarButton(i.provider,a.value,a.starred));s.appendChild(c)}n.appendChild(s)}if(t.appendChild(n),this.modelPickerBodyEl.replaceChildren(t),e.efforts.length>0){let i=document.createDocumentFragment(),s=document.createElement("span");s.className="bp-mp-efforts-lbl",s.textContent=u("model.col.effort","Effort"),i.appendChild(s);for(let r of e.efforts){let o=document.createElement("button");o.type="button",o.className="bp-mp-effort"+(r.on?" active":""),o.textContent=r.label,o.addEventListener("click",()=>{Promise.resolve(this.cb.onSelectEffort?.(r.value)).then(()=>{if(this.modelPickerOpen)this.reloadModelPicker()})}),i.appendChild(o)}this.modelPickerEffortsEl.replaceChildren(i),this.modelPickerEffortsEl.classList.remove("bp-hidden")}else this.modelPickerEffortsEl.classList.add("bp-hidden"),this.modelPickerEffortsEl.replaceChildren()}setDraft(e){this.textarea.value=e,this.autoGrow(),this.textarea.focus()}setReply(e,t,n){if(!e){this.replyEl.replaceChildren(),this.replyEl.classList.add("bp-hidden");return}let i=document.createElement("button");i.type="button",i.className="bp-reply-strip-body",i.setAttribute("data-testid","composer-reply-go");let s=document.createElement("span");s.className="bp-reply-strip-who",s.textContent=e.who;let r=document.createElement("span");if(r.className="bp-reply-strip-line",r.textContent=u("gpui.b.replying.to","↩ Replying to: {line}",{line:e.line}),i.append(s,r),t)i.addEventListener("click",t);let o=document.createElement("button");o.type="button",o.className="icon bp-reply-strip-drop",o.textContent="×";let a=u("reply.cancel","Cancel reply");if(o.title=a,o.setAttribute("aria-label",a),o.setAttribute("data-testid","composer-reply-drop"),n)o.addEventListener("click",n);this.replyEl.replaceChildren(i,o),this.replyEl.classList.remove("bp-hidden"),this.textarea.focus()}prependDraft(e){let t=this.textarea.value;this.textarea.value=t?`${e} +${t}`:e,this.autoGrow(),this.textarea.focus()}showError(e,t){let n=document.createElement("span");if(n.textContent=he(e),t){let i=document.createElement("button");i.type="button",i.className="bp-composer-err-act",i.setAttribute("data-testid","composer-err-accounts"),i.textContent=t.label,i.addEventListener("click",t.onClick),this.errorEl.replaceChildren(n,i)}else this.errorEl.replaceChildren(n);this.errorEl.classList.remove("bp-hidden")}clearError(){this.errorEl.replaceChildren(),this.errorEl.classList.add("bp-hidden")}focus(){this.textarea.focus()}refreshLocale(){if(this.textarea.placeholder=u("composer.placeholder","Ask anything: @bot, >thread, %project, #room, $skill, /btw"),this.attachBtn.title=u("web.composer.attach","Attach image"),this.attachBtn.setAttribute("aria-label",u("web.composer.attach","Attach image")),this.voiceBtn.title=u("web.composer.voice","Voice dictation"),this.voiceBtn.setAttribute("aria-label",u("web.composer.voice","Voice dictation")),this.modelBtn.title=u("composer.model.tip","Choose the model and effort"),this.modelSearchInput.placeholder=u("gpui.search.models","Search models"),this.sendBtn.textContent=u("composer.send","Send"),this.stopBtn.textContent=u("composer.stop","Stop"),this.setPlanMode(this.planMode),this.modelPickerOpen)this.renderModelPicker()}autoGrow(){this.textarea.style.height="auto",this.textarea.style.height=`${Math.min(180,Math.max(54,this.textarea.scrollHeight))}px`}shouldCompleteOnEnter(){if(this.popupMode==="mention")return!0;if(this.popupMode==="slash"){let e=this.textarea.value;return e.startsWith("/")&&!e.includes(" ")}return!1}updatePopups(){let e=this.textarea.value;if(e.startsWith("/")&&!e.includes(" ")&&!e.includes(` +`)){let n=e.slice(1).toLowerCase();if(this.filteredSlash=this.commands.filter((i)=>i.word.toLowerCase().startsWith(n)),this.filteredSlash.length>0){this.popupMode="slash",this.popupIdx=Math.min(this.popupIdx,this.filteredSlash.length-1),this.renderPopup();return}}let t=/(?:^|\s)([@>%#])([a-zA-Z0-9._-]{1,32})$/.exec(e.slice(0,this.textarea.selectionStart));if(t){let n=t[1],i=t[2];this.cb.onQueryMentions(i,n).then((s)=>{if(s.length>0)this.mentionItems=s,this.popupMode="mention",this.popupIdx=0,this.renderPopup();else if(this.popupMode==="mention")this.closePopup()});return}this.closePopup()}closePopup(){this.popupMode="none",this.popupEl.classList.add("bp-hidden"),this.popupEl.replaceChildren()}renderPopup(){let e=document.createDocumentFragment();if(this.popupMode==="slash")this.filteredSlash.forEach((t,n)=>{let i=document.createElement("button");i.type="button",i.className="bp-popup-row"+(n===this.popupIdx?" active":""),i.setAttribute("data-testid",`slash-item-${t.word}`);let s=document.createElement("span");s.className="bp-popup-name",s.textContent=`/${t.word}`;let r=document.createElement("span");r.className="bp-popup-desc",r.textContent=t.desc||t.label,i.append(s,r),i.addEventListener("mousedown",(o)=>{o.preventDefault(),this.applyPopupChoice(n)}),e.appendChild(i)});else if(this.popupMode==="mention")this.mentionItems.forEach((t,n)=>{let i=document.createElement("button");i.type="button",i.className="bp-popup-row"+(n===this.popupIdx?" active":"");let s=document.createElement("span");s.className="bp-popup-name",s.textContent=t.word||`${t.sigil}${t.label}`;let r=document.createElement("span");r.className="bp-popup-desc",r.textContent=t.detail||t.label,i.append(s,r),i.addEventListener("mousedown",(o)=>{o.preventDefault(),this.applyPopupChoice(n)}),e.appendChild(i)});this.popupEl.replaceChildren(e),this.popupEl.classList.remove("bp-hidden")}applyPopupChoice(e){if(this.popupMode==="slash"){let t=this.filteredSlash[e];if(t)this.textarea.value=`/${t.word} `,this.autoGrow(),this.textarea.focus();this.closePopup()}else if(this.popupMode==="mention"){let t=this.mentionItems[e];if(t){let n=this.textarea.selectionStart,i=this.textarea.value.slice(0,n),s=this.textarea.value.slice(n),r=i.replace(/([@>%#][a-zA-Z0-9._-]{1,32})$/,`${t.word} `);this.textarea.value=r+s,this.textarea.selectionStart=this.textarea.selectionEnd=r.length,this.textarea.focus()}this.closePopup()}}async addFiles(e){this.clearError();for(let t of e){if(!Oi.has(t.type)){this.showError(u("web.composer.unsupported","Unsupported image type: {type}",{type:t.type||t.name}));continue}if(this.attachments.length>=$i){this.showError(u("web.composer.maximages","At most {max} images per message.",{max:$i}));break}let n=await new Promise((s,r)=>{let o=new FileReader;o.onload=()=>s(String(o.result||"")),o.onerror=()=>r(Error("read failed")),o.readAsDataURL(t)}).catch(()=>""),i=n.indexOf(",");if(i<0)continue;this.attachments.push({name:t.name||`image-${this.attachments.length+1}.png`,mime:t.type,data:n.slice(i+1),previewUrl:n})}this.renderAttachments()}renderAttachments(){if(this.attachments.length===0){this.attachStripEl.classList.add("bp-hidden"),this.attachStripEl.replaceChildren();return}let e=document.createDocumentFragment();this.attachments.forEach((t,n)=>{let i=document.createElement("div");i.className="bp-attach-chip";let s=document.createElement("img");s.src=t.previewUrl,s.alt=t.name,s.className="bp-attach-thumb";let r=document.createElement("button");r.type="button",r.className="icon bp-attach-rm",r.textContent="×",r.title=u("common.remove","Remove"),r.addEventListener("click",()=>{this.attachments.splice(n,1),this.renderAttachments()}),i.append(s,r),e.appendChild(i)}),this.attachStripEl.replaceChildren(e),this.attachStripEl.classList.remove("bp-hidden")}submit(){if(!this.enabled)return;let e=this.textarea.value.trim();if(!e&&this.attachments.length===0)return;if(this.closePopup(),this.clearError(),e.startsWith("/")&&this.attachments.length===0){let n=e.slice(1).split(/\s+/)[0]?.toLowerCase()??"";if(this.commands.some((i)=>i.word.toLowerCase()===n)){this.textarea.value="",this.autoGrow(),this.cb.onRunCommand(e);return}}let t=this.attachments.map(({name:n,mime:i,data:s})=>({name:n,mime:i,data:s}));this.attachments=[],this.renderAttachments(),this.textarea.value="",this.autoGrow(),this.cb.onSend(e,t)}}async function _i(e,t=fetch){let n=await t("/auth/web/logout",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:"{}"});if(n.status!==200||(await n.json()).state!=="revoked")throw Error("Logout was not confirmed");e()}var qr=new Set(["bom","checks","life","plan","fab"]);function an(e){if(!e||!Array.isArray(e.panels))return[];return e.panels.filter((t)=>t&&typeof t.id==="string"&&qr.has(t.id))}function Xi(e){let t=e?.badge?.n??0;if(!Number.isFinite(t)||t<=0)return null;return{text:t>99?"99+":String(Math.floor(t)),tone:e?.badge?.tone==="bad"?"bad":"warn"}}function ln(e,t=22){let n=e.join(", ");if(n.length<=t)return n;let i="";for(let s=0;s0?` +${a}`.length:0)>t)return i?`${i} +${e.length-s}`:`${e[0]} +${e.length-1}`;i=o}return i}function Lt(e){if(!Number.isFinite(e)||e<0)return"?";if(e<1000)return String(Math.round(e));if(e<1e6){let n=e/1000;return n<10?`${n.toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(n)}k`}let t=e/1e6;return t<10?`${t.toFixed(1).replace(/\.0$/,"")}M`:`${Math.round(t)}M`}function At(e){if(!Number.isFinite(e))return"";if(e>=1)return`$${e.toFixed(2)}`;let t=e.toFixed(4).replace(/0+$/,"");return(t.split(".")[1]??"").length<2?`$${e.toFixed(2)}`:`$${t}`}var Kr=new Set(["0201","0402","0603","0805","1206","1210","1812","2010","2512"]),Jr=new Set(["QFN","DFN","SOT","SOIC","SOP","SSOP","TSSOP","MSOP","QFP","LQFP","TQFP","BGA","WLCSP","SOD","TO","SON","LGA"]);function Qi(e){if(!e)return"";let t=e.indexOf(":"),i=(t>=0?e.slice(t+1):e).split("_");for(let o of i)if(Kr.has(o))return o;let s=i[0]??"",r=s.replace(/[^a-zA-Z].*$/,"").toUpperCase();if(Jr.has(r)){let o=s.split("-");if(o.length>=2&&/^\d+$/.test(o[1]))return`${o[0]}-${o[1]}`;return o[0]}return i.slice(0,2).join("_")}function Zi(e){let t=e?.status??"";if(!t)return null;let n=typeof e?.stock==="number"?e.stock:-1;if(t==="checking")return{text:"…",tone:"faint"};if(t==="unknown")return{text:"?",tone:"faint"};if(t==="out")return{text:`out ${Lt(Math.max(n,0))}`,tone:"bad"};if(t==="low")return{text:`low ${Lt(n)}`,tone:"warn"};return{text:Lt(n),tone:"ok"}}function es(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;return e.filter((i)=>{let s=[(i.refs??[]).join(" "),i.value??"",i.footprint??"",i.mpn??"",i.fab??""].join(" ").toLowerCase();return n.every((r)=>r==="dnp"&&Boolean(i.dnp)||s.includes(r))})}function ts(e,t){if(!t)return e;return e.filter((n)=>n.source===t)}function In(e){if(e==="active")return{label:"Active",tone:"ok"};if(e==="nrnd")return{label:"NRND",tone:"warn"};if(e==="eol")return{label:"EOL",tone:"bad"};return{label:"Unknown",tone:"faint"}}function cn(e){if(!Number.isFinite(e)||e<=0)return"";let t=new Date(e*1000),n=t.getUTCFullYear(),i=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0");return`${n}-${i}-${s}`}function ns(e){return e.state==="routed"||e.state==="verified"}function is(e){switch(e.state){case"approved":return"✓";case"edited":return"✎";case"verified":return"✓✓";case"routed":return"100%";case"rejected":case"failed":return"✗";case"routing":return typeof e.routed==="number"&&typeof e.total==="number"&&e.total>0?`${e.routed}/${e.total}`:"…";case"blocked":return`⚠ ${Math.max(1,e.problems??1)}`;default:return""}}function ss(e){switch(e.status){case"blocked":return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};case"routing":return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};case"awaiting":return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};case"verified":return{key:"gpui.mgmt.plan.st.verified",label:"Verified",tone:"ok"};case"routed":return{key:"gpui.mgmt.plan.st.routed",label:"Routed",tone:"ok"};case"ready":return{key:"gpui.mgmt.plan.st.approved",label:"Approved",tone:"accent"};case"partial":return{key:"gpui.mgmt.plan.st.partial",label:"Partial",tone:"warn"};case"rejected":return{key:"gpui.mgmt.plan.st.rejected",label:"Rejected",tone:"bad"};default:if((e.blocked??0)>0)return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};if(e.routing)return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};if((e.awaiting??0)>0)return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};return{key:"gpui.mgmt.plan.st.empty",label:"Empty",tone:"faint"}}}function rs(e){let t=e.done??0,n=e.approved??0,i=e.awaiting??0,s=e.blocked??0,r=0;if(typeof e.total!=="number"){for(let o of e.layers??[])for(let a of o.items??[])if(a.state==="routed"||a.state==="verified")t+=1;else if(a.state==="routing")r+=1;else if(a.state==="approved")n+=1}else if(e.routing)r=Math.max(0,e.total-(t+n+i+s));return[{count:t,tone:"ok"},{count:r,tone:"accent"},{count:n,tone:"input"},{count:i,tone:"warn"},{count:s,tone:"bad"}]}function os(e){switch(e){case"current":return{text:"The fab's limits are in the DRC rules",button:null};case"stale":return{text:"The DRC rules have older fab limits",button:"Update"};case"none":return{text:"The fab's limits are not in the DRC rules",button:"Write"};default:return{text:"No KiCad project for DRC rules",button:null}}}function as(e){return e==="extra"?"costs-more limits":"base-price limits"}function Rn(e,t){return e.watchGen===t.watchGen&&e.editGen===t.editGen&&e.project!==""&&e.project===t.project&&e.editId!==""&&e.editId===t.editId}function ls(e){return{project:e.project,refs:e.refs.slice(),field:e.field,value:e.was}}function jn(e,t){return e.watchGen===t.watchGen&&e.project!==""&&e.project===t.project&&e.threadId!==""&&e.threadId===t.threadId&&e.threadGen===t.threadGen}var zi=["#f59e0b","#38bdf8","#c084fc","#2dd4bf","#ef4444","#a3e635","#f97316","#ec4899"],qi=["#14b8a6","#f59e0b","#c084fc","#22c55e","#38bdf8","#ef4444","#e879f9","#84cc16"];function cs(e){let t=2166136261;for(let n=0;n>>0;return t}function Ut(e,t=""){let n=t.trim().toLowerCase();if(n&&n!=="#5a7a9a"&&n!=="#8a8a8a")return t;let i=e.toUpperCase();if(i.includes("3V3A")||i.includes("AVDD")||i.includes("VDDA"))return"#38bdf8";if(i.includes("1V8")||i.includes("1.8V"))return"#c084fc";if(i.includes("2V5")||i.includes("2.5V"))return"#a3e635";if(i.includes("3V3")||i.includes("3.3V")||i.includes("VCC"))return"#f59e0b";if(i.includes("5V")||i.startsWith("+5"))return"#ef4444";if(i.includes("12V")||i.includes("24V"))return"#f97316";if(i.includes("VBAT")||i.includes("VIN"))return"#ec4899";if(i.includes("GND"))return"#2dd4bf";return zi[cs(i)%zi.length]}function Nt(e,t=""){let n=t.trim().toLowerCase();if(n&&n!=="#8a8a8a")return t;return qi[cs(e)%qi.length]}function ds(e,t,n,i=14){let s=Math.max(1,Math.abs(e[2]-e[0])),r=Math.max(1,Math.abs(e[3]-e[1])),o=Math.max(20,t-i*2),a=Math.max(20,n-i*2),c=Math.max(0.05,Math.min(200,Math.min(o/s,a/r)));return{cx:(e[0]+e[2])*0.5,cy:(e[1]+e[3])*0.5,scale:c,fitted:c,touched:!1}}function Ke(e,t,n,i,s){return[i*0.5+(t-e.cx)*e.scale,s*0.5+(n-e.cy)*e.scale]}function dn(e,t,n,i,s){let r=Math.max(0.0001,e.scale);return[e.cx+(t-i*0.5)/r,e.cy+(n-s*0.5)/r]}function ps(e,t,n){let i=Math.max(0.0001,e.scale);return{...e,cx:e.cx-t/i,cy:e.cy-n/i,touched:!0}}function hs(e,t,n,i,s,r){let o=Math.max(0.02,e.fitted*0.35),a=Math.max(40,e.fitted*24),c=Math.max(o,Math.min(a,e.scale*t)),[p,l]=dn(e,n,i,s,r);return{...e,cx:p-(n-s*0.5)/c,cy:l-(i-r*0.5)/c,scale:c,touched:!0}}function us(e,t,n,i){let s=e.map((o)=>[o[0],o[1]]);if(s.length===0)return[n];let r=i&&t+1>=s.length?s.length:Math.min(t+1,s.length);return s.splice(r,0,[n[0],n[1]]),s}function Hn(e,t,n){let i=n?3:2;if(e.length<=i||t<0||t>=e.length)return null;let s=e.map((r)=>[r[0],r[1]]);return s.splice(t,1),s}function Yr(e,t,n,i,s,r){let o=s-n,a=r-i,c=o*o+a*a;if(c<0.000001)return(e-n)*(e-n)+(t-i)*(t-i);let p=Math.max(0,Math.min(1,((e-n)*o+(t-i)*a)/c)),l=n+p*o,h=i+p*a;return(e-l)*(e-l)+(t-h)*(t-h)}function Ki(e,t,n){if(n.length<3)return!1;let i=!1;for(let s=0,r=n.length-1;st!==p>t&&e<(c-o)*(t-a)/(p-a+0.000000000001)+o)i=!i}return i}function Dn(e,t){return Math.max(5,Math.min(32,e*t))}function pn(e,t,n,i,s,r,o,a,c){if(i){for(let d of e){if(d.layer!==n||d.id!==i||d.locked)continue;let m=d.path??[];for(let f=0;f=3)for(let f=0;f=0;d--){let m=t[d];if(m.layer!==n)continue;let f=m.outline??[];if(!Ki(l,h,f))continue;if(!(m.holes??[]).some((v)=>Ki(l,h,v)))return{kind:"region",id:m.id}}return null}function Mt(e){let t=null,n=null,i=[];for(let r of e){if(!r.layer)continue;i.push(r.layer);let o=r.items??[],a=o.filter((p)=>p.kind==="corridor").length,c=o.filter((p)=>p.kind==="plane").length;if((a>0||r.role==="signal")&&(!t||a>t.count))t={count:a,layer:r.layer};if((c>0||r.role==="power"||r.role==="plane")&&(!n||c>n.count))n={count:c,layer:r.layer}}let s=[];if(t)s.push(t.layer);if(n&&!s.includes(n.layer))s.push(n.layer);for(let r of i){if(s.length>=2)break;if(!s.includes(r))s.push(r)}return s}function Ji(e,t){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=Math.max(0,Math.min(1,t)),i=0;for(let o=1;o=s&&a>0.000000001){let c=(s-r)/a;return[e[o-1][0]+(e[o][0]-e[o-1][0])*c,e[o-1][1]+(e[o][1]-e[o-1][1])*c]}r+=a}return e[e.length-1]}function vt(e,t,n){for(let i of t??[])if(i.layer===e&&i.title)return i.title;for(let i of n??[])if(i.layer===e&&i.title)return i.title;return e}function ms(e,t,n){if(e==="split"&&n.length>0)return t.filter((i)=>n.includes(i.layer));return t}function Bn(e,t){return!(e[2]<=t[0]||e[0]>=t[2]||e[3]<=t[1]||e[1]>=t[3])}function Yi(e,t,n){if(n.length<3)return!1;let i=!1;for(let s=0,r=n.length-1;st!==p>t&&e<(c-o)*(t-a)/(p-a+0.000000000001)+o)i=!i}return i}function bs(e,t){if(e.length<3)return null;let n=1/0,i=1/0,s=-1/0,r=-1/0,o=0,a=0;for(let p of e)n=Math.min(n,p[0]),i=Math.min(i,p[1]),s=Math.max(s,p[0]),r=Math.max(r,p[1]),o+=p[0],a+=p[1];let c=[[(n+s)*0.5,(i+r)*0.5],[o/e.length,a/e.length]];for(let p of[0.5,0.25,0.75,0.125,0.875])for(let l of[0.5,0.25,0.75,0.125,0.875])c.push([n+(s-n)*l,i+(r-i)*p]);for(let p of c)if(Yi(p[0],p[1],e)&&!t.some((l)=>Yi(p[0],p[1],l)))return p;return null}function gs(e,t,n,i,s,r){let o=[];for(let l of e){let h=l.nets??0,d=l.path??[];if(h<=0||d.length<2)continue;let m=0;for(let f=1;f{let d=l.sel||l.hov?1:0,m=h.sel||h.hov?1:0;if(m!==d)return m-d;if(h.nets!==l.nets)return h.nets-l.nets;return l.b.id.localeCompare(h.b.id)});let a=[],c=[],p=(l,h,d,m,f)=>[l-d*0.5-f,h-m*0.5-f,l+d*0.5+f,h+m*0.5+f];for(let l of o){let h=l.b.name||"",d=String(l.nets),m=h?`${h} · ${l.nets}`:d,f=(l.sel||l.hov||l.pxLen>=95)&&h?[m,d]:[d],b=null,v=(E,k)=>Math.max(k*0.5+3,Math.min(Math.max(k*0.5+3,n-k*0.5-3),E)),w=(E,k)=>Math.max(k*0.5+3,Math.min(Math.max(k*0.5+3,i-k*0.5-3),E));e:for(let E of f){let k=Math.max(16,E.length*5.9+10),L=15;for(let M of[0.5,0.35,0.65,0.22,0.78]){let A=Ji(l.pts,M);if(!A)continue;let[B,T]=Ke(t,A[0],A[1],n,i),H=v(B,k),O=w(T,15),P=p(H,O,k,15,2);if(!a.some((Y)=>Bn(P,Y))){b={id:l.b.id,text:E,cx:H,cy:O,pw:k,ph:15,col:l.col,sel:l.sel};break e}}}if(!b){let E=Ji(l.pts,0.5);if(E){let[k,L]=Ke(t,E[0],E[1],n,i),M=Math.max(16,d.length*6.5+8),A=15,B=v(k,M);for(let T of[-18,18]){let H=w(L+T,15);if(!a.some((O)=>Bn(p(B,H,M,15,2),O))){b={id:l.b.id,text:d,cx:B,cy:H,pw:M,ph:15,col:l.col,sel:l.sel};break}}}}if(b)a.push(p(b.cx,b.cy,b.pw,b.ph,2)),c.push(b)}return c}function fs(e,t,n,i,s,r=[]){let o=new Set(s),a=[];for(let l of e){if(!l.r||!l.b||l.b.length!==4)continue;let[h,d]=Ke(t,l.b[0],l.b[1],n,i),[m,f]=Ke(t,l.b[2],l.b[3],n,i),b=Math.abs(m-h),v=Math.abs(f-d);if(b<13||v<9)continue;let w=(h+m)*0.5,E=(d+f)*0.5;if(w<8||w>n-8||E<8||E>i-8)continue;a.push({text:l.r,cx:w,cy:E,bw:l.r.length*5.8+4,bh:11,score:b*v+(o.has(l.r)?1e4:0)})}a.sort((l,h)=>h.score-l.score);let c=[...r],p=[];for(let l of a){let h=[l.cx-l.bw*0.5,l.cy-l.bh*0.5,l.cx+l.bw*0.5,l.cy+l.bh*0.5];if(!c.some((m)=>Bn(h,m)))c.push(h),p.push({text:l.text,cx:l.cx,cy:l.cy})}return p}function vs(e){if(!e||typeof e!=="object")return null;let t=e;if(t.panel&&typeof t.panel==="object")return t.panel;if(t.result&&typeof t.result==="object"){let n=t.result.panel;if(n&&typeof n==="object")return n}return null}function hn(e,t){if(!t||t.length===0)return e;let n=new Map;for(let r of e)if(r.layer)n.set(r.layer,r);let i=[],s=new Set;for(let r of t){if(!r.layer)continue;s.add(r.layer);let o=n.get(r.layer);if(o)i.push(o);else i.push({layer:r.layer,index:r.index,title:r.title||`L${r.index} · ${r.layer}`,subtitle:r.subtitle||"",role:r.role,status:"proposed",done:0,approved:0,total:0,items:[]})}for(let r of e)if(r.layer&&!s.has(r.layer))i.push(r);return i}function ws(e,t,n,i,s,r,o,a){return e===t&&n===i&&s===r&&(a===void 0||o>=a)}var ys="#111917",Xr="#16201d",Qr="rgba(212, 224, 219, 0.92)",Zr="rgba(61, 80, 73, 0.72)",eo="rgba(82, 107, 97, 0.85)";var Es="#f59e0b",to="#eef5f2",Cs="#ef4444";function wt(e,t){let n=e.trim().replace(/^#/,"");if(n.length===6){let i=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),r=parseInt(n.slice(4,6),16);if(!Number.isNaN(i)&&!Number.isNaN(s)&&!Number.isNaN(r))return`rgba(${i}, ${s}, ${r}, ${t})`}return`rgba(20, 184, 166, ${t})`}function no(e,t,n){let i=0.14,s=0.45,r=0.85,o=!1;switch(e){case"approved":case"routing":i=0.16,s=0.51,r=0.91;break;case"edited":i=0.2,s=0.56,r=0.95;break;case"routed":case"verified":i=0.08,s=0.26,r=0.59;break;case"rejected":case"failed":i=0.05,s=0.13,r=0.27;break;case"blocked":i=0.18,s=0.48,r=0.88,o=!0;break}if(t)i=Math.min(0.35,i+0.1),s=Math.min(0.71,s+0.12),r=1;else if(n)i=Math.min(0.28,i+0.06),s=Math.min(0.63,s+0.07);return{glow:i,body:s,core:r,bad:o}}function io(e,t,n){let i=0.27,s=0.83,r=!1;switch(e){case"approved":case"routing":i=0.36,s=0.91;break;case"edited":i=0.38,s=0.95;break;case"routed":case"verified":i=0.16,s=0.54;break;case"rejected":case"failed":i=0.08,s=0.27;break;case"blocked":i=0.31,s=0.94,r=!0;break}if(t)i=Math.min(0.53,i+0.12),s=1;else if(n)i=Math.min(0.45,i+0.06),s=Math.min(1,s+0.1);return{fill:i,edge:s,bad:r}}function so(e){let t=e.items??[];if(t.some((n)=>n.state==="blocked"||n.state==="failed"))return{key:"gpui.mgmt.plan.st.blocked",label:"Blocked",tone:"bad"};if(t.some((n)=>n.state==="routing"))return{key:"gpui.mgmt.plan.st.routing",label:"Routing",tone:"accent"};if(t.some((n)=>n.state==="proposed"||n.state==="edited"))return{key:"gpui.mgmt.plan.st.awaiting",label:"Awaiting review",tone:"warn"};if(t.length>0&&t.every((n)=>n.state==="routed"||n.state==="verified"))return{key:"gpui.mgmt.plan.st.routed",label:"Routed",tone:"ok"};if(t.length>0&&t.every((n)=>n.state==="approved"||n.state==="routed"||n.state==="verified"))return{key:"gpui.mgmt.plan.st.approved",label:"Approved",tone:"accent"};return{key:"gpui.mgmt.plan.st.empty",label:"Empty",tone:"faint"}}class Fn{root;cb;state=null;cards=new Map;renderedLayerKey="";sharedCam=null;layerCams=new Map;hover=null;selectedVertex=null;drag=null;downPos=null;rafPending=0;constructor(e){this.cb=e,this.root=document.createElement("div"),this.root.className="bp-plan-canvas-grid",this.root.tabIndex=0,this.root.setAttribute("data-testid","mgmt-plan-canvas-grid"),this.root.addEventListener("keydown",(t)=>this.onKeyDown(t))}isDragging(){return this.drag!==null}fitAll(){this.sharedCam=null,this.layerCams.clear(),this.scheduleDraw()}destroy(){if(this.rafPending)cancelAnimationFrame(this.rafPending),this.rafPending=0;for(let e of this.cards.values())e.ro.disconnect();this.cards.clear(),this.root.replaceChildren()}visibleLayers(e){let t=hn(e.layers,e.copperLayers);if(t.length===0)return[];if(e.gridMode==="all")return t;if(e.gridMode==="single"){let s=e.shownLayers.find((o)=>t.some((a)=>a.layer===o))??Mt(t)[0]??t[0]?.layer,r=t.find((o)=>o.layer===s);return r?[r]:[]}let n=e.shownLayers.length>0&&e.shownLayers.every((s)=>t.some((r)=>r.layer===s))?e.shownLayers.slice(0,2):Mt(t),i=[];for(let s of n){let r=t.find((o)=>o.layer===s);if(r)i.push(r)}return i.length>0?i:t.slice(0,2)}update(e,t){this.state=e;let n=this.visibleLayers(e);this.root.classList.toggle("two-cols",t&&n.length>1);let i=n.map((s)=>s.layer).join("|");if(i!==this.renderedLayerKey){this.renderedLayerKey=i;for(let s of this.cards.values())s.ro.disconnect();this.cards.clear(),this.root.replaceChildren();for(let s of n){let r=this.buildCard(s);this.cards.set(s.layer,r),this.root.appendChild(r.el)}}else for(let s of n){let r=this.cards.get(s.layer);if(r)this.syncCardHeaderAndLegend(r,s)}this.scheduleDraw()}effectiveBbox(e){let t=e.bbox;if(!t||t.length!==4||Math.abs(t[2]-t[0])<0.5||Math.abs(t[3]-t[1])<0.5)return[0,0,100,70];return t}getCam(e,t,n){let i=this.state,s=i?.syncZoom?this.sharedCam:this.layerCams.get(e)??null;if(s&&s.touched)return s;return ds(i?this.effectiveBbox(i.board):[0,0,100,70],t,n,14)}setCam(e,t){if(this.state?.syncZoom)this.sharedCam=t;else this.layerCams.set(e,t)}buildCard(e){let t=document.createElement("section");t.className="bp-plan-card",t.setAttribute("data-testid",`mgmt-plan-card-${e.layer}`);let n=document.createElement("div");n.className="bp-plan-card-head";let i=document.createElement("div");i.className="bp-plan-card-head-top";let s=document.createElement("span"),r=e.role==="power"||(e.items?.length??0)>0&&(e.items??[]).every((E)=>E.kind==="plane");s.className="bp-plan-card-bar "+(r?"pwr":"sig");let o=document.createElement("span");o.className="bp-plan-card-title";let a=document.createElement("span");a.className="bp-plan-status-badge";let c=document.createElement("button");c.type="button",c.className="bp-mgmt-btn bp-plan-mini-btn",c.textContent="✓",c.title=u("gpui.mgmt.plan.layer","Approve layer"),c.addEventListener("click",(E)=>{E.stopPropagation(),this.cb.onApproveLayer(e.layer,!0)});let p=document.createElement("button");p.type="button",p.className="bp-mgmt-btn bp-plan-mini-btn",p.textContent="✗",p.title=u("gpui.mgmt.plan.rejectlayer","Reject layer"),p.addEventListener("click",(E)=>{E.stopPropagation(),this.cb.onApproveLayer(e.layer,!1)}),i.append(s,o,a,c,p);let l=document.createElement("div");l.className="bp-plan-card-sub",n.append(i,l);let h=document.createElement("div");h.className="bp-plan-card-canvas-wrap";let d=document.createElement("canvas");d.className="bp-plan-card-canvas",d.setAttribute("data-testid",`mgmt-plan-canvas-${e.layer}`);let m=document.createElement("div");m.className="bp-plan-hover-hud bp-hidden",h.append(d,m);let f=document.createElement("div");f.className="bp-plan-legend bp-hidden",t.append(n,h,f);let b=d.getContext("2d"),v=new ResizeObserver(()=>this.scheduleDraw());v.observe(h),this.attachPointerListeners(d,e.layer);let w={layer:e.layer,el:t,canvas:d,ctx:b,legendEl:f,okBtn:c,noBtn:p,statusEl:a,titleEl:o,subtitleEl:l,hoverHudEl:m,ro:v};return this.syncCardHeaderAndLegend(w,e),w}syncCardHeaderAndLegend(e,t){e.titleEl.textContent=vt(t.layer,this.state?.copperLayers,this.state?.layers)||t.title||t.layer;let n=t.subtitle||t.stackup||"";e.subtitleEl.textContent=n,e.subtitleEl.classList.toggle("bp-hidden",!n);let i=t.items??[],s=so(t);e.statusEl.className=`bp-plan-card-status tone-${s.tone==="warn"?"dim":s.tone}`,e.statusEl.textContent=i.length>0?u(s.key,s.label):"",e.statusEl.classList.toggle("bp-hidden",i.length===0);let r=i.some((a)=>a.state==="proposed"||a.state==="edited");if(e.okBtn)e.okBtn.classList.toggle("bp-hidden",!r);if(e.noBtn)e.noBtn.classList.toggle("bp-hidden",!r);let o=(this.state?.regions??[]).filter((a)=>a.layer===t.layer);if(o.length===0)e.legendEl.classList.add("bp-hidden"),e.legendEl.replaceChildren();else{e.legendEl.classList.remove("bp-hidden");let a=document.createDocumentFragment();for(let c of o){let p=document.createElement("button");p.type="button";let l=this.state?.selectedId===c.id;p.className="bp-plan-legend-chip"+(l?" active":"");let h=document.createElement("span");h.className="bp-plan-legend-sw",h.style.background=Ut(c.net||c.id,c.color||"");let d=document.createElement("span");d.textContent=c.net||c.id,p.append(h,d),p.addEventListener("click",()=>{this.cb.onSelect(c.id),this.cb.onFocusItem(c.id)}),a.appendChild(p)}e.legendEl.replaceChildren(a)}}attachPointerListeners(e,t){e.addEventListener("contextmenu",(i)=>i.preventDefault()),e.addEventListener("dblclick",()=>this.fitAll()),e.addEventListener("pointerdown",(i)=>{let s=this.state;if(!s)return;this.root.focus({preventScroll:!0});let r=e.getBoundingClientRect(),o=i.clientX-r.left,a=i.clientY-r.top,c=Math.max(1,r.width),p=Math.max(1,r.height),l=this.getCam(t,c,p),h=pn(s.bands,s.regions,t,s.selectedId,l,c,p,o,a);if(i.button===2){if(h?.kind==="vertex"){let d=this.getItemPts(h.id,h.isPlane),m=Hn(d,h.idx,h.isPlane);if(m)this.selectedVertex=null,this.cb.onCommitFields(h.id,{[h.isPlane?"outline":"path"]:m})}return}if(i.button!==0)return;if(e.setPointerCapture(i.pointerId),this.downPos={x:i.clientX,y:i.clientY},h?.kind==="vertex"){let d=this.getItemPts(h.id,h.isPlane),m=d.map((f)=>[f[0],f[1]]);this.selectedVertex={id:h.id,idx:h.idx},this.drag={layer:t,kind:"vertex",id:h.id,isPlane:h.isPlane,idx:h.idx,pts:d.map((f)=>[f[0],f[1]]),origPts:m,moved:!1},this.scheduleDraw()}else if(h?.kind==="midpoint"){let d=this.getItemPts(h.id,h.isPlane),m=d.map((v)=>[v[0],v[1]]),f=us(d,h.segIdx,h.pos,h.isPlane),b=h.isPlane&&h.segIdx+1>=d.length?f.length-1:Math.min(h.segIdx+1,f.length-1);this.selectedVertex={id:h.id,idx:b},this.patchLocalItem(h.id,h.isPlane,f),this.drag={layer:t,kind:"vertex",id:h.id,isPlane:h.isPlane,idx:b,pts:f,origPts:m,moved:!0},this.scheduleDraw()}else this.selectedVertex=null,this.drag={layer:t,kind:"pan",lastX:o,lastY:a}}),e.addEventListener("pointermove",(i)=>{let s=this.state;if(!s)return;let r=e.getBoundingClientRect(),o=i.clientX-r.left,a=i.clientY-r.top,c=Math.max(1,r.width),p=Math.max(1,r.height);if(this.drag&&this.drag.layer===t){if(this.drag.kind==="pan"){let L=this.getCam(t,c,p);this.setCam(t,ps(L,o-this.drag.lastX,a-this.drag.lastY)),this.drag.lastX=o,this.drag.lastY=a,this.scheduleDraw();return}if(this.downPos&&Math.hypot(i.clientX-this.downPos.x,i.clientY-this.downPos.y)<1.5&&!this.drag.moved)return;let b=this.getCam(t,c,p),[v,w]=dn(b,o,a,c,p),E=[Math.round(v*1000)/1000,Math.round(w*1000)/1000];this.drag.moved=!0,this.drag.pts[this.drag.idx]=E;let k=this.drag.pts.map((L)=>[L[0],L[1]]);this.patchLocalItem(this.drag.id,this.drag.isPlane,k),this.scheduleDraw();return}let l=this.getCam(t,c,p),h=pn(s.bands,s.regions,t,s.selectedId,l,c,p,o,a),d=this.hover?.hit?"id"in this.hover.hit?this.hover.hit.id:"":"",m=this.hover?.hit.kind??"",f=h?h.id:"";if(this.hover=h?{layer:t,hit:h}:null,e.style.cursor=h?"pointer":"crosshair",d!==f||(h?.kind??"")!==m)this.syncHoverHud(t),this.scheduleDraw()}),e.addEventListener("pointerleave",()=>{if(this.hover?.layer===t)this.hover=null,this.syncHoverHud(t),this.scheduleDraw()});let n=()=>{let i=this.drag;if(!i||i.layer!==t)return;if(this.drag=null,this.downPos=null,i.kind==="vertex"&&i.moved){let s=i.origPts.map((r)=>[r[0],r[1]]);this.patchLocalItem(i.id,i.isPlane,s)}this.cb.onDragEnd?.(),this.scheduleDraw()};e.addEventListener("pointercancel",n),e.addEventListener("lostpointercapture",n),e.addEventListener("pointerup",(i)=>{let s=this.state,r=this.drag,o=this.downPos;if(this.drag=null,this.downPos=null,e.hasPointerCapture(i.pointerId))e.releasePointerCapture(i.pointerId);if(r&&r.kind==="vertex"&&r.layer===t){if(r.moved)this.cb.onCommitFields(r.id,{[r.isPlane?"outline":"path"]:r.pts});else this.cb.onDragEnd?.(),this.scheduleDraw();return}if(s&&o&&Math.hypot(i.clientX-o.x,i.clientY-o.y)<4.5){let a=e.getBoundingClientRect(),c=i.clientX-a.left,p=i.clientY-a.top,l=Math.max(1,a.width),h=Math.max(1,a.height),d=this.getCam(t,l,h),m=pn(s.bands,s.regions,t,s.selectedId,d,l,h,c,p);if(m&&(m.kind==="band"||m.kind==="region")){this.cb.onSelect(m.id),this.cb.onFocusItem(m.id);return}if(!m&&s.selectedId){this.cb.onSelect("");return}}this.cb.onDragEnd?.()}),e.addEventListener("wheel",(i)=>{i.preventDefault();let s=e.getBoundingClientRect(),r=i.clientX-s.left,o=i.clientY-s.top,a=Math.max(1,s.width),c=Math.max(1,s.height),p=this.getCam(t,a,c),l=Math.max(0.65,Math.min(1.55,1-i.deltaY*0.002));this.setCam(t,hs(p,l,r,o,a,c)),this.scheduleDraw()},{passive:!1})}patchLocalItem(e,t,n){let i=this.state;if(!i)return;if(t){let s=i.regions.find((r)=>r.id===e);if(s){if(s.outline=n,s.edited=!0,s.state==="proposed")s.state="edited"}}else{let s=i.bands.find((r)=>r.id===e);if(s){if(s.path=n,s.edited=!0,s.state==="proposed")s.state="edited"}}}getItemPts(e,t){let n=this.state;if(!n)return[];if(t)return(n.regions.find((i)=>i.id===e)?.outline??[]).map((i)=>[i[0],i[1]]);return(n.bands.find((i)=>i.id===e)?.path??[]).map((i)=>[i[0],i[1]])}syncHoverHud(e){let t=this.cards.get(e),n=this.state;if(!t||!n)return;if(!this.hover||this.hover.layer!==e){t.hoverHudEl.classList.add("bp-hidden"),t.hoverHudEl.textContent="";return}let i=this.hover.hit.id,s=n.bands.find((a)=>a.id===i),r=n.regions.find((a)=>a.id===i),o="";if(s)o=`${s.name||i} · ${s.nets??0}n · ${(s.width??1.5).toFixed(2)}mm`;else if(r)o=r.reference?`${r.net||i} · ${r.reference}`:r.net||i;if(!o)t.hoverHudEl.classList.add("bp-hidden");else t.hoverHudEl.classList.remove("bp-hidden"),t.hoverHudEl.textContent=o}onKeyDown(e){let t=this.state;if(!t)return;if(e.key==="0"||e.key==="Home"){e.preventDefault(),this.fitAll();return}if(e.key==="Escape"){this.selectedVertex=null,this.cb.onSelect("");return}if(!t.selectedId)return;let n=t.bands.find((o)=>o.id===t.selectedId),i=t.regions.find((o)=>o.id===t.selectedId),s=Boolean(n?.locked??i?.locked),r=e.key.toLowerCase();if(r==="a")e.preventDefault(),this.cb.onQuickApprove([t.selectedId],!0);else if(r==="r")e.preventDefault(),this.cb.onQuickApprove([t.selectedId],!1);else if(r==="l")e.preventDefault(),this.cb.onCommitFields(t.selectedId,{locked:!s});else if(r==="w"&&n&&!s){e.preventDefault();let o=e.shiftKey?-0.25:0.25,a=Math.round(Math.max(0.15,Math.min(25,(n.width??1.5)+o))*100)/100;this.cb.onCommitFields(t.selectedId,{width:a})}else if((e.key==="Delete"||e.key==="Backspace")&&!s&&this.selectedVertex?.id===t.selectedId){e.preventDefault();let o=Boolean(i),a=this.getItemPts(t.selectedId,o),c=Hn(a,this.selectedVertex.idx,o);if(c)this.selectedVertex=null,this.cb.onCommitFields(t.selectedId,{[o?"outline":"path"]:c})}}scheduleDraw(){if(this.rafPending)return;this.rafPending=requestAnimationFrame(()=>{this.rafPending=0,this.drawAll()})}drawAll(){let e=this.state;if(!e)return;let t=Math.max(0.45,Math.min(1.25,Math.abs(this.effectiveBbox(e.board)[3]-this.effectiveBbox(e.board)[1])/Math.max(1,Math.abs(this.effectiveBbox(e.board)[2]-this.effectiveBbox(e.board)[0]))));for(let n of this.cards.values()){let i=n.canvas.parentElement;if(!i)continue;let s=Math.max(120,Math.round(i.clientWidth)),r=Math.max(165,Math.min(250,Math.round(s*t)));n.canvas.style.height=`${r}px`;let o=Math.max(1,window.devicePixelRatio||1),a=Math.round(s*o),c=Math.round(r*o);if(n.canvas.width!==a||n.canvas.height!==c)n.canvas.width=a,n.canvas.height=c;n.ctx.setTransform(o,0,0,o,0,0),this.drawLayer(n.ctx,n.layer,s,r,e)}}drawLayer(e,t,n,i,s){let r=this.getCam(t,n,i),o=(b,v)=>Ke(r,b,v,n,i);e.fillStyle=ys,e.fillRect(0,0,n,i);let a=(s.board.outline??[]).filter((b)=>b.length>=3);if(e.fillStyle=Xr,a.length>0){e.beginPath();for(let b of a){for(let v=0;vb.layer===t),p=this.hover?.layer===t?this.hover.hit:null;for(let b of c){let v=b.outline??[];if(v.length<3)continue;let w=s.selectedId===b.id,E=p?.id===b.id,k=io(b.state||"proposed",w,E),L=Ut(b.net||b.id,b.color||"");e.beginPath();for(let A=0;AT)T=P;if(Y>H)H=Y}if(Math.abs(T-A)>=38&&Math.abs(H-B)>=18){let O=bs(v,b.holes??[]);if(O){let[P,Y]=o(O[0],O[1]);e.fillStyle=wt(L,w?0.91:0.67),e.font="bold 10px ui-monospace, 'SFMono-Regular', Menlo, monospace",e.textAlign="center",e.textBaseline="middle",e.fillText(M,P,Y)}}}}if(e.strokeStyle=Qr,e.lineWidth=1.25,e.lineCap="round",e.lineJoin="round",a.length>0){e.beginPath();for(let b of a){for(let v=0;vb.layer===t),d=gs(h,r,n,i,s.selectedId,p?.id??""),m=d.map((b)=>[b.cx-b.pw*0.5-1,b.cy-b.ph*0.5-1,b.cx+b.pw*0.5+1,b.cy+b.ph*0.5+1]),f=[];for(let b of h){for(let v of b.from??[])f.push(v);for(let v of b.to??[])f.push(v)}e.fillStyle="rgba(143, 163, 155, 0.72)",e.font="9.5px ui-monospace, 'SFMono-Regular', Menlo, monospace",e.textAlign="center",e.textBaseline="middle";for(let b of fs(l,r,n,i,f,m))e.fillText(b.text,b.cx,b.cy);for(let b of h){let v=b.guides??[];if(v.length===0)continue;let w=s.selectedId===b.id||p?.id===b.id,E=Nt(b.name||b.id,b.color||"");e.strokeStyle=wt(E,w?0.38:0.17),e.lineWidth=w?1:0.7,e.beginPath();for(let k of v){let[L,M]=o(k[0],k[1]),[A,B]=o(k[2],k[3]);e.moveTo(L,M),e.lineTo(A,B)}e.stroke()}for(let b of h){let v=b.path??[];if(v.length<2)continue;let w=s.selectedId===b.id,E=p?.id===b.id,k=no(b.state||"proposed",w,E),L=Nt(b.name||b.id,b.color||""),M=Dn(b.width??1.5,r.scale),A=()=>{e.beginPath();for(let B=0;B{let E=w?v.length:Math.max(0,v.length-1);for(let k=0;kn.id===e))return;if(this.openPanel!==e)this.togglePanel(e)}getTabs(){return an(this.getStateInfo())}isOpen(){return this.openPanel!==""}closePanel(){if(!this.openPanel)return;if(this.openPanel="",this.project)this.cb.hub.rpc("mgmt.panel",{project:this.project,open:""}).catch(()=>{});this.render()}clear(){this.watchGen++,this.bomEditGen++,this.askedProject="",this.digest="",this.project="",this.openPanel="",this.errorMsg="",this.bomEditingId="",this.bomLastUndo=null,this.bomEditStatus="",this.checksStatus="",this.planStatus="",this.planSelectedId="",this.planStackupOpen=!1,this.planShownLayers=[],this.planOptimistic.clear(),this.planOptimisticRev=void 0,this.planHydratedKey="",this.planHydrateAskedKey="",this.planHydrateGen++,this.planHydratedRev=void 0,this.planRenderDeferred=!1,this.planHydratedBoard=null,this.planHydratedDraw=null,this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.planCanvas?.destroy(),this.planCanvas=null,this.planCommitFields=null,this.fabStatus="",this.render()}async watchProject(e){if(!e||!this.cb.hub.hasFeature("mgmt")){this.clear();return}if(e===this.askedProject&&this.digest){this.render();return}let t=++this.watchGen;if(this.askedProject=e,this.project!==e)this.bomEditGen++,this.digest="",this.project="",this.openPanel="",this.errorMsg="",this.bomSelectedId="",this.bomEditingId="",this.bomEditStatus="",this.bomLastUndo=null,this.checksSelectedId="",this.checksStatus="",this.planStatus="",this.planSelectedId="",this.planStackupOpen=!1,this.planShownLayers=[],this.planOptimistic.clear(),this.planOptimisticRev=void 0,this.planHydratedKey="",this.planHydrateAskedKey="",this.planHydrateGen++,this.planHydratedRev=void 0,this.planRenderDeferred=!1,this.planHydratedBoard=null,this.planHydratedDraw=null,this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.planCanvas?.destroy(),this.planCanvas=null,this.planCommitFields=null,this.fabStatus="",this.lifeSelectedKey="",this.lifePartSamples=null,this.render();try{let n=await this.cb.hub.rpc("mgmt.watch",{project:e});if(t!==this.watchGen)return;let i=typeof n.digest==="string"?n.digest:"";if(!i){this.render();return}if(this.digest=i,this.project=typeof n.project==="string"&&n.project?n.project:e,n.state&&typeof n.state==="object")this.infos.set(`mgmt.state.${i}`,n.state);if(n.data&&typeof n.data==="object"){for(let[s,r]of Object.entries(n.data))if(r&&typeof r==="object")this.infos.set(`mgmt.${s}.${i}`,r)}this.errorMsg="",this.render()}catch{if(t===this.watchGen)this.render()}}handleInfo(e){let t=!1;for(let[n,i]of Object.entries(e)){if(!n.startsWith("mgmt.")&&!n.startsWith("kicad.checks."))continue;if(i===""||i===null||i===void 0){if(this.infos.delete(n))t=!0;continue}if(typeof i==="string")try{let s=JSON.parse(i);if(s&&typeof s==="object")this.infos.set(n,s),t=!0}catch{}else if(typeof i==="object")this.infos.set(n,i),t=!0}if(t)this.render()}getStateInfo(){if(!this.digest)return null;return this.infos.get(`mgmt.state.${this.digest}`)??null}getPanelData(e){if(!this.digest)return null;return this.infos.get(`mgmt.${e}.${this.digest}`)??null}togglePanel(e){let t=this.openPanel===e?"":e;if(this.openPanel=t,this.errorMsg="",this.render(),this.project)this.cb.hub.rpc("mgmt.panel",{project:this.project,open:t}).catch((n)=>{this.errorMsg=n instanceof Error?n.message:"Could not update panel",this.render()})}render(){if(this.openPanel==="plan"&&this.planCanvas?.isDragging()){this.planRenderDeferred=!0;return}this.planRenderDeferred=!1;let e=this.getStateInfo(),t=an(e);if(!this.digest||t.length===0){this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded"),this.stripEl.classList.add("bp-hidden"),this.panelEl.classList.add("bp-hidden"),this.panelEl.removeAttribute("data-testid"),this.panelEl.replaceChildren(),this.stripEl.replaceChildren(),this.cb.onOpenChange?.(!1);return}this.stripEl.classList.remove("bp-hidden");let n=document.createDocumentFragment(),i=document.createElement("div");i.className="bp-mgmt-tabs";for(let o of t){let a=document.createElement("button");a.type="button";let c=this.openPanel===o.id;a.className="bp-mgmt-tab"+(c?" active":""),a.setAttribute("data-testid",`mgmt-tab-${o.id}`),a.setAttribute("aria-pressed",c?"true":"false");let p=document.createElement("span");p.textContent=he(o.label),a.appendChild(p);let l=this.getPanelData(o.id),h=Xi(l);if(h){let d=document.createElement("span");d.className=`bp-mgmt-badge bp-tone-${h.tone}`,d.textContent=h.text,a.appendChild(d)}a.addEventListener("click",()=>this.togglePanel(o.id)),i.appendChild(a)}if(n.appendChild(i),this.openPanel){let o=document.createElement("button");o.type="button",o.className="icon bp-mgmt-close",o.textContent="×",o.title=u("gpui.mgmt.close","Close the panel"),o.setAttribute("aria-label",u("gpui.mgmt.close","Close the panel")),o.setAttribute("data-testid","mgmt-close"),o.addEventListener("click",()=>this.closePanel()),n.appendChild(o)}if(this.stripEl.replaceChildren(n),!this.openPanel){this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded"),this.panelEl.classList.add("bp-hidden"),this.panelEl.removeAttribute("data-testid"),this.panelEl.replaceChildren(),this.cb.onOpenChange?.(!1);return}if(this.openPanel!=="plan")this.planCanvas?.destroy(),this.planCanvas=null,this.panelEl.classList.remove("bp-plan-expanded");else this.panelEl.classList.toggle("bp-plan-expanded",this.planExpanded);this.panelEl.classList.remove("bp-hidden"),this.panelEl.setAttribute("data-testid",`mgmt-panel-${this.openPanel}`),this.cb.onOpenChange?.(!0);let s=this.openPanel==="plan"&&this.planCanvas!==null&&document.activeElement instanceof HTMLElement&&this.panelEl.contains(document.activeElement)&&(document.activeElement===this.planCanvas.root||this.planCanvas.root.contains(document.activeElement)),r=document.createDocumentFragment();if(this.errorMsg){let o=document.createElement("div");o.className="bp-mgmt-note bp-tone-bad",o.textContent=this.errorMsg,r.appendChild(o)}switch(this.openPanel){case"bom":r.appendChild(this.renderBom());break;case"checks":r.appendChild(this.renderChecks());break;case"life":r.appendChild(this.renderLife());break;case"plan":r.appendChild(this.renderPlan());break;case"fab":r.appendChild(this.renderFab());break}if(this.panelEl.replaceChildren(r),s)this.planCanvas?.root.focus({preventScroll:!0})}renderBom(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("bom");if(!t)return e.appendChild(this.makeEmpty("Reading the schematic…")),e;let n=Array.isArray(t.lines)?t.lines:[],i=document.createElement("div");i.className="bp-mgmt-head";let s=document.createElement("span");s.className="bp-dim",s.textContent=`${t.parts??0} parts · ${n.length} lines`;let r=document.createElement("span"),o=t.source==="kicad";if(r.className="bp-mgmt-pill"+(o?" accent":""),r.textContent=o?"live":"saved",i.append(s,r),(t.priced??0)>0&&(t.checking??0)===0&&typeof t.cost==="number"){let p=document.createElement("span");p.className="bp-dim",p.textContent=(t.priced??0)<(t.lookups??0)?`≥ ${At(t.cost)}/board`:`${At(t.cost)}/board`,i.appendChild(p)}if(t.paused){let p=document.createElement("span");p.className="bp-mgmt-faint",p.textContent="Stock check paused",i.appendChild(p)}if(e.appendChild(i),t.stock_note){let p=document.createElement("div");p.className="bp-mgmt-note bp-mgmt-faint",p.textContent=he(t.stock_note),e.appendChild(p)}let a=this.bomEditingId?n.find((p)=>p.id===this.bomEditingId)??null:null;if(a)e.appendChild(this.renderBomEditor(a));else{let p=document.createElement("div");p.className="bp-mgmt-filter-row";let l=document.createElement("input");l.type="text",l.className="bp-mgmt-filter",l.placeholder="Filter BOM (ref, value, footprint, MPN, dnp)…",l.value=this.bomFilter,l.setAttribute("data-testid","mgmt-bom-filter"),l.addEventListener("input",()=>{this.bomFilter=l.value,this.renderBomRows(c,n)}),p.appendChild(l),e.appendChild(p)}let c=document.createElement("div");return c.className="bp-mgmt-rows",c.setAttribute("data-testid","mgmt-bom-rows"),this.renderBomRows(c,n),e.appendChild(c),e}renderBomRows(e,t){let n=es(t,this.bomFilter);if(n.length===0){e.replaceChildren(this.makeEmpty(t.length===0?"No parts found.":"No matching lines."));return}let i=t.some((r)=>Boolean(r.mpn)||Boolean(r.fab)),s=document.createDocumentFragment();for(let r of n){let o=Array.isArray(r.refs)?r.refs:[],a=document.createElement("div");a.className="bp-mgmt-row"+(this.bomSelectedId===r.id?" active":"")+(r.dnp?" faint":""),a.setAttribute("data-testid",`mgmt-bom-row-${r.id}`);let c=document.createElement("div");c.className="bp-mgmt-row-line";let p=document.createElement("span");if(p.className="bp-mgmt-strong bp-mgmt-flex1",p.textContent=ln(o,24),c.appendChild(p),r.dnp){let b=document.createElement("span");b.className="bp-mgmt-pill",b.textContent=u("gpui.mgmt.bom.dnp","DNP"),c.appendChild(b)}else{let b=Zi(r.stock);if(b){let v=document.createElement("span");v.className=`bp-tone-${b.tone}`,v.textContent=b.text,c.appendChild(v)}}let l=document.createElement("button");l.type="button",l.className="bp-mgmt-btn",l.textContent="Edit",l.addEventListener("click",(b)=>{b.stopPropagation(),this.bomEditGen++,this.bomEditingId=r.id,this.bomEditDraft=r.mpn??"",this.bomEditStatus="",this.bomLastUndo=null,this.render()}),c.appendChild(l);let h=document.createElement("div");h.className="bp-mgmt-row-sub";let d=[`${r.qty??o.length}×`,r.value??"",Qi(r.footprint??"")].filter(Boolean).join(" · "),m=document.createElement("span");m.className="bp-dim",m.textContent=d;let f=document.createElement("span");if(f.className="bp-mgmt-flex1",r.mpn)f.textContent=r.mpn;else if(i&&!r.dnp)f.className+=" bp-tone-warn",f.textContent=u("gpui.mgmt.bom.nompn","no MPN");if(h.append(m,f),!r.dnp&&typeof r.stock?.price==="number"){let b=document.createElement("span");b.className="bp-dim",b.textContent=At(r.stock.price),h.appendChild(b)}if(!r.dnp&&r.stock?.class){let b=document.createElement("span");b.className="bp-mgmt-faint",b.textContent=he(r.stock.class),h.appendChild(b)}a.append(c,h),a.addEventListener("click",()=>{this.bomSelectedId=r.id,this.renderBomRows(e,t)}),s.appendChild(a)}e.replaceChildren(s)}renderBomEditor(e){let t=document.createElement("div");t.className="bp-mgmt-editor",t.setAttribute("data-testid","mgmt-bom-edit");let n=Array.isArray(e.refs)?e.refs:[],i=document.createElement("div");i.className="bp-mgmt-row-line";let s=document.createElement("span");s.className="bp-mgmt-strong",s.textContent=ln(n,30);let r=document.createElement("button");r.type="button",r.className="icon",r.textContent="×",r.addEventListener("click",()=>{this.bomEditGen++,this.bomEditingId="",this.bomLastUndo=null,this.bomEditStatus="",this.render()}),i.append(s,r);let o=document.createElement("input");o.type="text",o.className="bp-mgmt-filter",o.placeholder="MPN",o.value=this.bomEditDraft,o.addEventListener("input",()=>{this.bomEditDraft=o.value});let a=()=>({watchGen:this.watchGen,editGen:this.bomEditGen,project:this.project,editId:this.bomEditingId}),c=async(d,m=!1)=>{let f=a();this.bomEditStatus="Writing…",this.render();try{let b=await this.cb.hub.rpc("mgmt.bom.edit",d);if(!Rn(f,a()))return;this.bomLastUndo=!m&&(b.changed??0)>0?{project:d.project,editId:f.editId,refs:d.refs.slice(),field:d.field,was:typeof b.was==="string"?b.was:d.field==="mpn"?e.mpn??"":e.dnp?"yes":"no"}:null,this.bomEditStatus=m?"Restored":(b.changed??0)===0?"No change":b.via==="kicad"?"Updated in KiCad":"Saved to schematic"}catch(b){if(!Rn(f,a()))return;this.bomEditStatus=b instanceof Error?b.message:"Could not save edit"}this.render()},p=document.createElement("div");p.className="bp-mgmt-btn-row";let l=document.createElement("button");l.type="button",l.className="primary bp-mgmt-btn",l.textContent="Save MPN",l.addEventListener("click",()=>{c({project:this.project,refs:n.slice(),field:"mpn",value:this.bomEditDraft.trim()})});let h=document.createElement("button");if(h.type="button",h.className="bp-mgmt-btn",h.textContent=e.dnp?"Clear DNP":"Mark DNP",h.addEventListener("click",()=>{c({project:this.project,refs:n.slice(),field:"dnp",value:e.dnp?"no":"yes"})}),p.append(l,h),this.bomLastUndo&&this.bomLastUndo.project===this.project&&this.bomLastUndo.editId===this.bomEditingId){let d=this.bomLastUndo,m=document.createElement("button");m.type="button",m.className="bp-mgmt-btn",m.textContent="Undo",m.addEventListener("click",()=>{c(ls(d),!0)}),p.appendChild(m)}if(t.append(i,o,p),this.bomEditStatus){let d=document.createElement("div");d.className="bp-mgmt-faint",d.textContent=this.bomEditStatus,t.appendChild(d)}return t}renderChecks(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("checks");if(!t)return e.appendChild(this.makeEmpty("Reading checks…")),e;let n=Array.isArray(t.groups)?t.groups:[],i=Array.from(new Set(n.map((d)=>d.source).filter(Boolean))),s=(d)=>t.sources?.[d]?.label||d.toUpperCase(),r=(d)=>t.sources?.[d]?.judged===!0,o=document.createElement("div");o.className="bp-mgmt-head bp-mgmt-scroll-x";let a=document.createElement("button");a.type="button",a.className="bp-mgmt-btn"+(this.checksSource===""?" active":""),a.textContent=u("gpui.mgmt.checks.all","All"),a.addEventListener("click",()=>{this.checksSource="",this.render()}),o.appendChild(a);for(let d of i){let m=document.createElement("button");m.type="button",m.className="bp-mgmt-btn"+(this.checksSource===d?" active":""),m.textContent=s(d)+(r(d)?" · judged":""),m.addEventListener("click",()=>{this.checksSource=this.checksSource===d?"":d,this.render()}),o.appendChild(m)}let c=document.createElement("span");c.className="bp-mgmt-flex1";let p=document.createElement("button");if(p.type="button",p.className="bp-mgmt-btn",p.textContent=u("gpui.mgmt.checks.run","Run"),p.addEventListener("click",()=>{let d=this.watchGen,m=this.project;this.checksStatus="Running checks…",this.render(),this.cb.hub.rpc("kicad.checks.run",{project:m}).then(()=>{if(d!==this.watchGen||m!==this.project)return;this.checksStatus="",this.render()}).catch((f)=>{if(d!==this.watchGen||m!==this.project)return;this.checksStatus=f instanceof Error?f.message:"Could not run checks",this.render()})}),o.append(c,p),e.appendChild(o),this.checksStatus){let d=document.createElement("div");d.className="bp-mgmt-note bp-dim",d.textContent=this.checksStatus,e.appendChild(d)}let l=document.createElement("div");l.className="bp-mgmt-rows",l.setAttribute("data-testid","mgmt-checks-rows");let h=ts(n,this.checksSource);if(h.length===0)l.appendChild(this.makeEmpty("No check findings."));else for(let d of h){let m=d.severity==="error"?"bad":d.severity==="warning"?"warn":"faint",f=document.createElement("div");f.className="bp-mgmt-group-head";let b=document.createElement("span");b.className=`bp-mgmt-dot bp-tone-bg-${m}`;let v=document.createElement("span");v.className="bp-mgmt-flex1",v.textContent=`${s(d.source)} · ${d.rule}`;let w=document.createElement("span");w.className=`bp-tone-${m}`,w.textContent=String(d.n),f.append(b,v,w),l.appendChild(f);for(let E of d.rows??[]){let k=document.createElement("div");k.className="bp-mgmt-row"+(this.checksSelectedId===E.id?" active":"");let L=document.createElement("div");if(L.textContent=he(E.title??""),k.appendChild(L),E.names||this.checksSelectedId===E.id){let M=document.createElement("div");M.className="bp-mgmt-row-sub";let A=document.createElement("span");if(A.className="bp-dim bp-mgmt-flex1",A.textContent=E.names??"",M.appendChild(A),this.checksSelectedId===E.id){let B=document.createElement("button");B.type="button",B.className="bp-mgmt-btn accent",B.textContent=u("gpui.mgmt.checks.fix","Fix with agent"),B.addEventListener("click",(T)=>{T.stopPropagation();let H={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};this.cb.hub.rpc("kicad.checks.fix",{project:H.project,id:E.id}).then((O)=>{let P={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};if(!jn(H,P))return;if(O.text)this.cb.onSendText(O.text),this.checksStatus="Sent to agent",this.render()}).catch((O)=>{let P={watchGen:this.watchGen,project:this.project,threadId:this.cb.getThreadId(),threadGen:this.cb.getThreadGen()};if(!jn(H,P))return;this.checksStatus=O instanceof Error?O.message:"Could not send finding",this.render()})}),M.appendChild(B)}k.appendChild(M)}k.addEventListener("click",()=>{this.checksSelectedId=E.id,this.cb.hub.rpc("kicad.checks.focus",{project:this.project,id:E.id}).catch(()=>{}),this.render()}),l.appendChild(k)}}return e.appendChild(l),e}renderLife(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("life");if(!t)return e.appendChild(this.makeEmpty("Reading lifecycle…")),e;let n=document.createElement("div");n.className="bp-mgmt-head";let i=t.counts??{};for(let c of["active","nrnd","eol"]){let p=i[c]??0,l=In(c),h=document.createElement("span");h.className=p>0?`bp-tone-${l.tone}`:"bp-mgmt-faint",h.textContent=`${l.label} ${p}`,n.appendChild(h)}if((i.unknown??0)>0){let c=document.createElement("span");c.className="bp-mgmt-faint",c.textContent=`${i.unknown} unknown`,n.appendChild(c)}if(t.since){let c=document.createElement("span");c.className="bp-mgmt-flex1";let p=document.createElement("span");p.className="bp-mgmt-faint",p.textContent=`since ${cn(t.since)} (${t.samples??0})`,n.append(c,p)}e.appendChild(n);let s=document.createElement("div");s.className="bp-mgmt-rows",s.setAttribute("data-testid","mgmt-life-rows");let r=t.bom?.cost??[],o=t.bom?.instock??[],a=t.bom?.lines??0;if(r.length===0)s.appendChild(this.makeEmpty(a===0?"No line has an MPN or fab part number to follow yet.":"No reading of the fab's stock yet: the BOM panel's lookups start it."));else{let c=r[r.length-1],p=o[o.length-1],l=document.createElement("div");l.className="bp-mgmt-note bp-dim",l.textContent=`Parts/board: ${At(c[1])} · ${Math.round(p?.[1]??0)}/${a} lines in stock (${cn(c[0])})`,s.appendChild(l)}for(let c of t.parts??[]){let p=this.lifeSelectedKey===c.key,l=In(c.lifecycle??"unknown"),h=document.createElement("div");h.className="bp-mgmt-row"+(p?" active":"");let d=document.createElement("div");d.className="bp-mgmt-row-line";let m=document.createElement("span");m.className="bp-mgmt-strong",m.textContent=ln(c.refs??[],14);let f=document.createElement("span");f.className="bp-mgmt-flex1 bp-dim",f.textContent=c.mpn||c.key;let b=document.createElement("span");if(b.className=`bp-tone-${l.tone}`,b.textContent=l.label,d.append(m,f,b),typeof c.stock==="number"){let v=document.createElement("span");v.className="bp-dim",v.textContent=Lt(c.stock),d.appendChild(v)}if(h.appendChild(d),p){let v=document.createElement("div");if(v.className="bp-mgmt-row-sub bp-mgmt-faint",this.lifePartLoading)v.textContent=u("gpui.mgmt.life.reading","Reading its history…");else if(this.lifePartSamples&&this.lifePartSamples.length>0){let w=this.lifePartSamples[this.lifePartSamples.length-1];v.textContent=`${this.lifePartSamples.length} samples · latest ${w.at?cn(w.at):""}`+(typeof w.stock==="number"?` · stock ${Lt(w.stock)}`:"")+(typeof w.price==="number"?` · ${At(w.price)}`:"")}else v.textContent=u("gpui.mgmt.life.nopart","No reading of this part yet.");h.appendChild(v)}h.addEventListener("click",()=>{if(this.lifeSelectedKey===c.key){this.lifeSelectedKey="",this.lifePartSamples=null,this.render();return}this.lifeSelectedKey=c.key,this.lifePartSamples=null,this.lifePartLoading=!0,this.render(),this.cb.hub.rpc("mgmt.life.part",{project:this.project,key:c.key}).then((v)=>{if(this.lifeSelectedKey!==c.key)return;this.lifePartLoading=!1,this.lifePartSamples=Array.isArray(v.samples)?v.samples:[],this.render()}).catch(()=>{if(this.lifeSelectedKey!==c.key)return;this.lifePartLoading=!1,this.lifePartSamples=[],this.render()})}),s.appendChild(h)}return e.appendChild(s),e}renderPlan(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("plan");if(!t)return e.appendChild(this.makeEmpty(u("gpui.mgmt.plan.reading","Reading the routing plan…"))),e;let n=(C,x)=>{let F=this.watchGen,I=this.project;this.planStatus="",this.cb.hub.rpc(C,{pro:I,...x}).catch((J)=>{if(F!==this.watchGen||I!==this.project)return;this.planOptimistic.clear(),this.planStatus=J instanceof Error?J.message:u("gpui.mgmt.plan.refused","KiCad refused"),this.render()})};if(t.revision!==this.planOptimisticRev)this.planOptimisticRev=t.revision,this.planOptimistic.clear();let i=`${this.project}:${t.revision??0}`;if(t.board_trimmed&&this.planHydrateAskedKey!==i&&this.project){this.planHydrateAskedKey=i;let C=this.watchGen,x=++this.planHydrateGen,F=this.project,I=t.revision??0;this.cb.hub.rpc("plan.get",{pro:F,board:!0}).then((J)=>{let se=vs(J);if(!se)return;let ye=typeof se.revision==="number"?se.revision:I;if(!ws(C,this.watchGen,x,this.planHydrateGen,F,this.project,ye,this.planHydratedRev))return;this.planHydratedRev=ye,this.planHydratedKey=`${F}:${ye}`,this.planHydratedBoard=se.board??null,this.planHydratedDraw=se.draw??null,this.render()}).catch(()=>{})}let s=t.on===!0,r=document.createElement("div");r.className="bp-plan-header";let o=document.createElement("div");o.className="bp-plan-toggle";let a=document.createElement("span");a.className="bp-mgmt-strong",a.textContent=u("gpui.mgmt.plan.before","Plan before routing"),a.title=s?u("gpui.mgmt.plan.onwords","Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve."):u("gpui.mgmt.plan.offwords","Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here."),o.appendChild(a);let c=t.awaiting??0,p=t.blocked??0,l=t.done??0,h=t.total??0,d=t.revision??0,m=t.empty?[]:rs(t),f=m.reduce((C,x)=>C+x.count,0);if(!t.empty){let C=ss(t),x=document.createElement("span");if(x.className=`bp-plan-status-badge tone-${C.tone}`,x.textContent=u(C.key,C.label),o.appendChild(x),d>0){let I=document.createElement("span");I.className="bp-dim",I.textContent=`v${d}`,o.appendChild(I)}let F=document.createElement("span");if(F.className="bp-plan-header-counts bp-mgmt-flex1 "+(c>0?"bp-tone-warn":p>0?"bp-tone-bad":"bp-dim"),F.textContent=h>0?`${l}/${h} ${u("gpui.mgmt.plan.done","done")}`:c>0?u("web.plan.awaiting","{n} awaiting approval",{n:c}):u("gpui.mgmt.plan.nothing","Nothing awaits your approval"),o.appendChild(F),!t.live){let I=document.createElement("span");I.className="bp-mgmt-pill",I.textContent=u("gpui.mgmt.plan.saved","saved plan"),o.appendChild(I)}}else{let C=document.createElement("span");C.className="bp-mgmt-flex1",o.appendChild(C)}let b=document.createElement("button");b.type="button",b.className="bp-mgmt-btn bp-plan-chip-btn"+(s?" active":""),b.setAttribute("data-testid","mgmt-plan-on"),b.setAttribute("aria-pressed",s?"true":"false"),b.textContent=u("gpui.bots.recall.on","On"),b.addEventListener("click",()=>n("plan.enable",{on:!0}));let v=document.createElement("button");if(v.type="button",v.className="bp-mgmt-btn bp-plan-chip-btn"+(!s?" active":""),v.setAttribute("data-testid","mgmt-plan-off"),v.setAttribute("aria-pressed",!s?"true":"false"),v.textContent=u("gpui.bots.recall.off","Off"),v.addEventListener("click",()=>n("plan.enable",{on:!1})),o.append(b,v),r.appendChild(o),f>0){let C=document.createElement("div");C.className="bp-plan-segbar";for(let x of m){if(x.count<=0)continue;let F=document.createElement("div");F.className=`bp-plan-seg bp-tone-bg-${x.tone}`,F.style.flexGrow=String(x.count),C.appendChild(F)}r.appendChild(C)}e.appendChild(r);for(let C of t.elsewhere??[]){let x=document.createElement("div");x.className="bp-plan-elsewhere";let F=document.createElement("span");F.className="bp-tone-warn bp-mgmt-flex1",F.textContent=u("gpui.mgmt.plan.elsewhere","A routing plan for {board} awaits your approval",{board:C.name||C.rel||""}),x.appendChild(F),e.appendChild(x)}if(t.empty){let C=document.createElement("div");C.className="bp-mgmt-note";let x=document.createElement("div");x.className="bp-dim",x.textContent=u("gpui.mgmt.plan.noboard","No routing plan for this board.");let F=document.createElement("div");return F.className="bp-mgmt-faint",F.textContent=u("gpui.mgmt.plan.emptysub","Layers, corridors, and planes appear here once a plan is proposed."),C.append(x,F),e.appendChild(C),e}let w=t.stackup_summary??"",E=Array.isArray(t.impedances)?t.impedances:[],k=Boolean(w)||E.length>0,L=document.createElement("div");if(L.className="bp-mgmt-head",c>0){let C=document.createElement("button");C.type="button",C.className="primary bp-mgmt-btn",C.setAttribute("data-testid","mgmt-plan-approve-all"),C.textContent=u("gpui.mgmt.plan.all","Approve all"),C.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[],approve:!0})),L.appendChild(C)}if(t.routing){let C=document.createElement("button");C.type="button",C.className="bp-mgmt-btn",C.setAttribute("data-testid","mgmt-plan-stop"),C.textContent=u("gpui.mgmt.plan.stop","Stop routing"),C.addEventListener("click",()=>n("plan.stop",{})),L.appendChild(C)}if(t.live&&l>0){let C=document.createElement("button");C.type="button",C.className="bp-mgmt-btn",C.setAttribute("data-testid","mgmt-plan-verify"),C.textContent=u("gpui.mgmt.plan.verify","Verify"),C.addEventListener("click",()=>n("plan.verify",{})),L.appendChild(C)}let M=document.createElement("span");if(M.className="bp-mgmt-flex1",L.appendChild(M),k){let C=document.createElement("button");C.type="button",C.className="bp-mgmt-btn bp-plan-chip-btn"+(this.planStackupOpen?" active":""),C.setAttribute("data-testid","mgmt-plan-stackup-toggle"),C.setAttribute("aria-expanded",this.planStackupOpen?"true":"false"),C.textContent=`${u("gpui.mgmt.plan.stackup.short","Stackup")} ${this.planStackupOpen?"▾":"▸"}`,C.addEventListener("click",()=>{this.planStackupOpen=!this.planStackupOpen,this.render()}),L.appendChild(C)}let A=document.createElement("button");A.type="button",A.className="bp-mgmt-btn",A.setAttribute("data-testid","mgmt-plan-hide"),A.textContent=this.planHideDone?u("gpui.mgmt.plan.show","Show done"):u("gpui.mgmt.plan.hide","Hide done"),A.addEventListener("click",()=>{this.planHideDone=!this.planHideDone,this.render()}),L.appendChild(A),e.appendChild(L);let B=Array.isArray(t.asks)?t.asks:[];if(B.length>0){let C=B.map((se)=>se.what||"").filter(Boolean).join(", "),x=B[0]?.note||"",F=document.createElement("div");F.className="bp-plan-elsewhere";let I=document.createElement("div");I.className="bp-plan-ask-col";let J=document.createElement("div");if(J.className="bp-tone-warn",J.textContent=C?u("gpui.mgmt.plan.requested","Approval requested: {what}",{what:C}):u("gpui.mgmt.plan.reqplain","Approval requested"),I.appendChild(J),x){let se=document.createElement("div");se.className="bp-dim",se.textContent=x,I.appendChild(se)}F.appendChild(I),e.appendChild(F)}if(this.planStatus){let C=document.createElement("div");C.className="bp-mgmt-note bp-plan-err bp-tone-bad";let x=document.createElement("span");x.className="bp-mgmt-flex1",x.textContent=this.planStatus==="KiCad refused"?u("gpui.mgmt.plan.refused","KiCad refused"):he(this.planStatus);let F=document.createElement("button");F.type="button",F.className="icon",F.textContent="×",F.title=u("common.close","Close"),F.addEventListener("click",()=>{this.planStatus="",this.render()}),C.append(x,F),e.appendChild(C)}if(t.keys_note){let C=document.createElement("div");C.className="bp-mgmt-note bp-dim";let x="On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.";C.textContent=t.keys_note===x?u("gpui.mgmt.plan.keysnote",x):he(t.keys_note),e.appendChild(C)}if(k&&this.planStackupOpen){let C=document.createElement("div");if(C.className="bp-plan-stackup-body",C.setAttribute("data-testid","mgmt-plan-stackup-body"),w){let x=document.createElement("div");x.className="bp-dim",x.textContent=w,C.appendChild(x)}for(let x of E){let F=document.createElement("div");F.className="bp-mgmt-faint",F.textContent=`· ${x}`,C.appendChild(F)}e.appendChild(C)}let T=(C,x,F,I)=>{let J=document.createElement("button");return J.type="button",J.className="bp-mgmt-btn bp-plan-chip-btn"+(x?" active":""),J.setAttribute("data-testid",F),J.setAttribute("aria-pressed",x?"true":"false"),J.textContent=C,J.addEventListener("click",I),J},H=document.createElement("div");if(H.className="bp-plan-viewbar",H.append(T(u("gpui.mgmt.plan.view.canvas","Canvas"),this.planViewMode==="canvas","mgmt-plan-view-canvas",()=>{this.planViewMode="canvas",this.render()}),T(u("gpui.mgmt.plan.view.split","Split"),this.planViewMode==="split","mgmt-plan-view-split",()=>{this.planViewMode="split",this.render()}),T(u("gpui.mgmt.plan.view.list","List"),this.planViewMode==="list","mgmt-plan-view-list",()=>{this.planViewMode="list",this.render()})),this.planViewMode!=="list"){let C=document.createElement("span");C.className="bp-plan-sep";let x=document.createElement("span");x.className="bp-plan-sep";let F=document.createElement("button");F.type="button",F.className="bp-mgmt-btn bp-plan-mini-btn",F.setAttribute("data-testid","mgmt-plan-fit"),F.textContent=u("gpui.mgmt.plan.fit","Fit"),F.addEventListener("click",()=>this.planCanvas?.fitAll()),H.append(C,T(u("gpui.mgmt.plan.grid.pair","Side by side"),this.planGridMode==="pair","mgmt-plan-grid-pair",()=>{this.planGridMode="pair",this.render()}),T(u("gpui.mgmt.plan.grid.all","All layers"),this.planGridMode==="all","mgmt-plan-grid-all",()=>{this.planGridMode="all",this.render()}),T(u("gpui.mgmt.plan.grid.single","Single"),this.planGridMode==="single","mgmt-plan-grid-single",()=>{this.planGridMode="single",this.render()}),x,T(u("gpui.mgmt.plan.sync","Link zoom"),this.planSyncZoom,"mgmt-plan-sync",()=>{this.planSyncZoom=!this.planSyncZoom,this.render()}),F)}let O=document.createElement("span");O.className="bp-mgmt-flex1";let P=document.createElement("button");P.type="button",P.className="bp-mgmt-btn bp-plan-mini-btn",P.setAttribute("data-testid","mgmt-plan-expand"),P.textContent=this.planExpanded?u("gpui.mgmt.plan.compact","Compact"):u("gpui.mgmt.plan.expand","Expand"),P.addEventListener("click",()=>{this.planExpanded=!this.planExpanded,this.render()}),H.append(O,P),e.appendChild(H);let Y=Boolean(this.planHydratedBoard)&&this.planHydratedKey.startsWith(`${this.project}:`)&&(this.planHydratedKey===i||this.planHydratedRev!==void 0&&this.planHydratedRev>=(t.revision??0)),re=Y&&this.planHydratedBoard?this.planHydratedBoard:t.board??{bbox:[0,0,100,70],outline:[],parts:[]},ie=Y&&this.planHydratedDraw?this.planHydratedDraw:t.draw??{bands:[],regions:[]},ue=(ie.bands??[]).map((C)=>{let x=this.planOptimistic.get(C.id);if(!x)return{...C};return{...C,...x,edited:!0,state:C.state==="proposed"?"edited":C.state}}),Pe=(ie.regions??[]).map((C)=>{let x=this.planOptimistic.get(C.id);if(!x)return{...C};return{...C,...x,edited:!0,state:C.state==="proposed"?"edited":C.state}}),Ce=[],te=(t.layers??[]).map((C)=>{let x=[];for(let F of C.items??[]){let I=this.planOptimistic.get(F.id);if(!I){x.push(F);continue}let J={...F,width:typeof I.width==="number"?I.width:F.width,locked:typeof I.locked==="boolean"?I.locked:F.locked,edited:!0,state:F.state==="proposed"?"edited":F.state};if(typeof I.layer==="string"&&I.layer!==C.layer)Ce.push({target:I.layer,item:J});else x.push(J)}return{...C,items:x}});for(let C of Ce){let x=te.find((F)=>F.layer===C.target);if(x)x.items=[...x.items??[],C.item]}let oe=hn(te,t.copper_layers),R=this.planGridMode==="all"?oe.map((C)=>C.layer):this.planGridMode==="single"?[this.planShownLayers.find((C)=>oe.some((x)=>x.layer===C))??Mt(oe)[0]??oe[0]?.layer??""].filter(Boolean):this.planShownLayers.length>0&&this.planShownLayers.every((C)=>oe.some((x)=>x.layer===C))?this.planShownLayers.slice(0,2):Mt(oe);if(this.planViewMode!=="list"&&this.planGridMode!=="all"&&oe.length>1){let C=document.createElement("div");C.className="bp-plan-layerbar";for(let x of oe){let F=R.includes(x.layer),I=(x.items??[]).length,J=vt(x.layer,t.copper_layers,oe)||x.title||x.layer,se=I>0?`${J} · ${I}`:J,ye=T(se,F,`mgmt-plan-layerpill-${x.layer}`,()=>{if(this.planGridMode==="single")this.planShownLayers=[x.layer];else if(this.planGridMode==="pair"){if(!R.includes(x.layer))this.planShownLayers=R.length>=2?[R[0],x.layer]:[...R,x.layer]}else this.planGridMode="single",this.planShownLayers=[x.layer];this.render()});if(I===0&&!F)ye.classList.add("empty-layer");C.appendChild(ye)}e.appendChild(C)}let me=(C,x)=>{let F=this.planOptimistic.get(C)??{};if(this.planOptimistic.set(C,{...F,...x}),typeof x.layer==="string"){if(this.planGridMode==="single")this.planShownLayers=[x.layer];else if(this.planGridMode==="pair"&&!R.includes(x.layer))this.planShownLayers=R.length>=2?[R[0],x.layer]:[...R,x.layer]}let I=typeof t.revision==="number"?t.revision:void 0;this.render(),n("plan.update",{ops:[{op:"set",id:C,fields:x}],...I!==void 0?{base:I}:{}})};if(this.planCommitFields=me,this.planSelectedId){let C="",x=null;for(let F of te){let I=(F.items??[]).find((J)=>J.id===this.planSelectedId);if(I){C=F.layer,x=I;break}}if(x){let F=vt(C,t.copper_layers,oe),I=document.createElement("div");I.className="bp-plan-inspector",I.setAttribute("data-testid","mgmt-plan-inspector");let J=document.createElement("div");J.className="bp-plan-ins-row";let se=document.createElement("span");se.className="bp-plan-ins-sw",se.style.background=x.kind==="corridor"?Nt(x.name||x.id,x.color||""):Ut(x.name||x.id,x.color||"");let ye=document.createElement("span");ye.className="bp-mgmt-strong",ye.textContent=x.name||x.id;let D=document.createElement("span");if(D.className="bp-dim",D.textContent=F,J.append(se,ye,D),x.edited||x.state==="edited"){let q=document.createElement("span");q.className="bp-plan-ins-pill warn",q.textContent=u("gpui.mgmt.plan.edited","Edited"),J.appendChild(q)}if(x.locked){let q=document.createElement("span");q.className="bp-plan-ins-pill",q.textContent=u("gpui.mgmt.plan.locked","Locked"),J.appendChild(q)}let ne=document.createElement("span");ne.className="bp-mgmt-flex1",J.appendChild(ne);let Te=document.createElement("button");if(Te.type="button",Te.className="bp-mgmt-btn bp-plan-mini-btn",Te.setAttribute("data-testid","mgmt-plan-lock"),Te.textContent=x.locked?u("gpui.mgmt.plan.unlock","Unlock"):u("gpui.mgmt.plan.lock","Lock"),Te.addEventListener("click",()=>me(x.id,{locked:!x.locked})),J.appendChild(Te),x.state==="proposed"||x.state==="edited"){let q=document.createElement("button");q.type="button",q.className="primary bp-mgmt-btn bp-plan-mini-btn",q.textContent=u("android.hub.machines.approve","Approve"),q.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[x.id],approve:!0}));let fe=document.createElement("button");fe.type="button",fe.className="bp-mgmt-btn bp-plan-mini-btn",fe.textContent=u("gpui.mgmt.plan.reject","Reject"),fe.addEventListener("click",()=>n("plan.approve",{layer:"",ids:[x.id],approve:!1})),J.append(q,fe)}let Le=document.createElement("button");Le.type="button",Le.className="bp-mgmt-btn bp-plan-mini-btn",Le.setAttribute("data-testid","mgmt-plan-note-toggle"),Le.textContent=u("gpui.mgmt.plan.addnote","Add note"),Le.addEventListener("click",()=>{this.planNoteOpen=!this.planNoteOpen,this.render()});let Be=document.createElement("button");if(Be.type="button",Be.className="icon",Be.textContent="×",Be.addEventListener("click",()=>{this.planSelectedId="",this.planNoteOpen=!1,this.planMoveLayerOpen=!1,this.render()}),J.append(Le,Be),I.appendChild(J),!x.locked){let q=document.createElement("div");if(q.className="bp-plan-ins-row",x.kind==="corridor"){let le=typeof x.width==="number"?x.width:1.5,He=document.createElement("span");He.className="bp-dim",He.textContent=u("gpui.mgmt.plan.width","Width");let $e=document.createElement("button");$e.type="button",$e.className="bp-mgmt-btn bp-plan-mini-btn",$e.setAttribute("data-testid","mgmt-plan-w-down"),$e.textContent="-",$e.addEventListener("click",()=>{let ze=Math.round(Math.max(0.15,le-0.25)*100)/100;me(x.id,{width:ze})});let Oe=document.createElement("span");Oe.className="bp-plan-ins-val",Oe.textContent=`${le.toFixed(2)}mm`;let Ne=document.createElement("button");Ne.type="button",Ne.className="bp-mgmt-btn bp-plan-mini-btn",Ne.setAttribute("data-testid","mgmt-plan-w-up"),Ne.textContent="+",Ne.addEventListener("click",()=>{let ze=Math.round(Math.min(25,le+0.25)*100)/100;me(x.id,{width:ze})});let We=document.createElement("span");We.className="bp-plan-sep",q.append(He,$e,Oe,Ne,We)}let fe=(t.copper_layers??[]).length>0?(t.copper_layers??[]).map((le)=>le.layer):te.map((le)=>le.layer);if(fe.length>0){let le=document.createElement("span");le.className="bp-dim",le.textContent=u("gpui.mgmt.plan.layer.short","Layer"),q.appendChild(le),q.appendChild(T(`${F} ${this.planMoveLayerOpen?"▴":"▾"}`,this.planMoveLayerOpen,"mgmt-plan-move-toggle",()=>{this.planMoveLayerOpen=!this.planMoveLayerOpen,this.render()}))}if(I.appendChild(q),this.planMoveLayerOpen&&fe.length>0){let le=document.createElement("div");le.className="bp-plan-ins-row";for(let He of fe){let $e=vt(He,t.copper_layers,oe);le.appendChild(T($e,He===C,`mgmt-plan-move-${He}`,()=>{if(this.planMoveLayerOpen=!1,He!==C)me(x.id,{layer:He});else this.render()}))}I.appendChild(le)}}if(this.planNoteOpen){let q=document.createElement("form");q.className="bp-plan-note-form";let fe=document.createElement("input");fe.type="text",fe.className="bp-plan-note-input",fe.setAttribute("data-testid","mgmt-plan-note-input"),fe.placeholder=u("gpui.mgmt.plan.note.placeholder","Steering note for router…");let le=document.createElement("button");le.type="submit",le.className="primary bp-mgmt-btn bp-plan-mini-btn",le.setAttribute("data-testid","mgmt-plan-note-submit"),le.textContent=u("gpui.mgmt.plan.addnote","Add note"),q.append(fe,le),q.addEventListener("submit",(He)=>{He.preventDefault();let $e=fe.value.trim();if(!$e)return;fe.value="",this.planNoteOpen=!1;let Oe=typeof t.revision==="number"?t.revision:void 0;this.render(),n("plan.update",{ops:[{op:"note",target:x.id,text:$e}],...Oe!==void 0?{base:Oe}:{}})}),I.appendChild(q)}if(this.planViewMode!=="list"&&!x.locked){let q=document.createElement("div");q.className="bp-plan-hint",q.textContent=u("gpui.mgmt.plan.hint","Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove"),I.appendChild(q)}e.appendChild(I)}}let de=document.createElement("div");de.className="bp-mgmt-rows"+(this.planViewMode==="split"?" bp-plan-split-list":""),de.setAttribute("data-testid","mgmt-plan-rows");let ee=u("gpui.mgmt.plan.done","done"),ge=ms(this.planViewMode,te,R);if(this.planViewMode==="split"&&ge.length===0){let C=document.createElement("div");C.className="bp-dim",C.style.padding="6px 8px",C.style.fontSize="11px",C.textContent=u("gpui.mgmt.plan.noitems","No corridors or planes on this layer"),de.appendChild(C)}for(let C of ge){let x=C.items??[],F=vt(C.layer,t.copper_layers,oe)||C.layer;if(this.planViewMode==="split"){if(ge.length>1){let I=document.createElement("div");I.className="bp-plan-split-divider";let J=C.role==="power"||C.role==="plane",se=document.createElement("span");se.className="bp-plan-card-bar "+(J?"pwr":"sig");let ye=document.createElement("span");ye.className="bp-mgmt-strong",ye.textContent=F;let D=document.createElement("span");D.className="bp-dim",D.textContent=`${C.done??0}/${x.length} ${ee}`,I.append(se,ye,D),de.appendChild(I)}}else{let I=document.createElement("div");I.className="bp-mgmt-group-head bp-plan-layer-head";let J=document.createElement("div");J.className="bp-mgmt-row-line";let se=document.createElement("span");se.className="bp-mgmt-strong",se.textContent=F;let ye=document.createElement("span");if(ye.className="bp-dim bp-mgmt-flex1",ye.textContent=`${C.role?`${C.role} · `:""}${C.done??0}/${x.length} ${ee}`,J.append(se,ye),C.status!=="approved"&&x.length>0){let D=document.createElement("button");D.type="button",D.className="bp-mgmt-btn",D.textContent=u("gpui.mgmt.plan.layer","Approve layer"),D.addEventListener("click",()=>n("plan.approve",{layer:C.layer,ids:[],approve:!0}));let ne=document.createElement("button");ne.type="button",ne.className="bp-mgmt-btn",ne.textContent=u("gpui.mgmt.plan.reject","Reject"),ne.addEventListener("click",()=>n("plan.approve",{layer:C.layer,ids:[],approve:!1})),J.append(D,ne)}if(I.appendChild(J),C.stackup){let D=document.createElement("div");D.className="bp-plan-layer-stackup",D.textContent=C.stackup,I.appendChild(D)}de.appendChild(I)}for(let I of x){if(this.planHideDone&&ns(I))continue;let J=this.planSelectedId===I.id,se=document.createElement("div");se.className="bp-mgmt-row bp-plan-row"+(J?" active":""),se.setAttribute("data-testid",`mgmt-plan-row-${I.id}`);let ye=document.createElement("div");ye.className="bp-mgmt-row-line";let D=document.createElement("span");D.className=`bp-plan-swatch bp-plan-st-${I.state||"proposed"}`,D.style.setProperty("--swatch-color",I.color||"#8a8a8a");let ne=document.createElement("span");ne.className="bp-mgmt-flex1"+(I.state==="blocked"||I.state==="failed"?" bp-tone-bad":I.state==="edited"?" bp-tone-warn":I.state==="rejected"||I.state==="routed"||I.state==="verified"?" bp-dim":""),ne.textContent=`${I.name||I.id}${I.locked?" \uD83D\uDD12":""}`;let Te=[];if(I.kind==="plane"){if(I.reference)Te.push(u("gpui.mgmt.plan.reference","over {layer}",{layer:I.reference}))}else{let q=I.nets??0;Te.push(q===1?u("web.plan.net.one","1 net"):u("web.plan.nets","{n} nets",{n:q}))}if(typeof I.width==="number"&&Number.isFinite(I.width))Te.push(`${I.width.toFixed(2)}mm`);if(I.impedance)Te.push(I.impedance);let Le=Te.join(" · "),Be=document.createElement("span");if(Be.className="bp-plan-mark "+(I.state==="blocked"||I.state==="failed"?"bp-tone-bad":I.state==="verified"||I.state==="routed"?"bp-tone-ok":I.state==="approved"?"bp-tone-accent":"bp-dim"),Be.textContent=is(I),ye.append(D,ne,Be),I.state==="proposed"||I.state==="edited"){let q=document.createElement("button");q.type="button",q.className="bp-mgmt-btn",q.textContent="✓",q.title=u("gpui.mgmt.plan.layer","Approve layer"),q.addEventListener("click",(le)=>{le.stopPropagation(),n("plan.approve",{layer:"",ids:[I.id],approve:!0})});let fe=document.createElement("button");fe.type="button",fe.className="bp-mgmt-btn",fe.textContent="✗",fe.title=u("gpui.mgmt.plan.reject","Reject"),fe.addEventListener("click",(le)=>{le.stopPropagation(),n("plan.approve",{layer:"",ids:[I.id],approve:!1})}),ye.append(q,fe)}if(se.appendChild(ye),Le){let q=document.createElement("div");q.className="bp-mgmt-row-sub bp-plan-detail bp-dim",q.textContent=Le,se.appendChild(q)}if(I.state==="routing"&&typeof I.total==="number"&&I.total>0){let q=document.createElement("div");q.className="bp-plan-microbar";let fe=document.createElement("div");fe.className="bp-plan-microbar-fill";let le=Math.max(0,Math.min(100,Math.round((I.routed??0)/I.total*100)));fe.style.width=`${le}%`,q.appendChild(fe),se.appendChild(q)}if(I.problem_text){let q=document.createElement("div");q.className="bp-plan-problem",q.textContent=I.problem_text,se.appendChild(q)}se.addEventListener("click",()=>{this.planSelectedId=I.id,n("plan.focus",{id:I.id}),this.render()}),de.appendChild(se)}}if(this.planViewMode!=="list"){if(!this.planCanvas)this.planCanvas=new Fn({onSelect:(I)=>{if(this.planSelectedId=I,!I)this.planNoteOpen=!1;this.render()},onFocusItem:(I)=>{n("plan.focus",{id:I})},onDragEnd:()=>{if(this.planRenderDeferred)this.planRenderDeferred=!1,this.render()},onCommitFields:(I,J)=>{(this.planCommitFields??me)(I,J)},onApproveLayer:(I,J)=>{n("plan.approve",{layer:I,ids:[],approve:J})},onQuickApprove:(I,J)=>{n("plan.approve",{layer:"",ids:I,approve:J})}});let C=this.panelEl.parentElement?.classList.contains("bp-has-viewer")===!1,x=this.planExpanded||this.panelEl.clientWidth>=540||C;this.planCanvas.update({gridMode:this.planGridMode,syncZoom:this.planSyncZoom,shownLayers:R,selectedId:this.planSelectedId,board:re,bands:ue,regions:Pe,layers:oe,copperLayers:t.copper_layers},x);let F=document.createElement("div");F.className="bp-plan-canvas-scroll",F.appendChild(this.planCanvas.root),e.appendChild(F)}if(this.planViewMode!=="canvas")e.appendChild(de);if((t.draw?.bands?.length??0)>0||(t.draw?.regions?.length??0)>0){let C=document.createElement("div");C.className="bp-plan-footer",C.textContent=u("gpui.mgmt.plan.drawn","The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them."),e.appendChild(C)}return e}renderFab(){let e=document.createElement("div");e.className="bp-mgmt-body";let t=this.getPanelData("fab");if(!t)return e.appendChild(this.makeEmpty("Reading the fab's profile…")),e;if(t.error){let E=document.createElement("div");return E.className="bp-mgmt-note bp-tone-warn",E.textContent=t.error,e.appendChild(E),e}let n=(E,k={})=>{let L=this.watchGen,M=this.project;this.fabStatus="",this.cb.hub.rpc("fab.profile",{pro:M,action:E,...k}).catch((A)=>{if(L!==this.watchGen||M!==this.project)return;this.fabStatus=A instanceof Error?A.message:"Fab action failed",this.render()})},i=document.createElement("div");i.className="bp-mgmt-head";let s=document.createElement("span");s.className="bp-mgmt-strong",s.textContent=u("gpui.mgmt.fab.thefab","The fab");let r=document.createElement("span");r.className="bp-dim bp-mgmt-flex1",r.textContent=`rev ${t.rev??0}${t.updated?` · ${t.updated}`:""}${t.board?` · ${t.board}`:""} · ${as(t.tier??"")}`;let o=document.createElement("button");if(o.type="button",o.className="bp-mgmt-btn",o.textContent=u("gpui.mgmt.fab.refresh","Refresh"),o.addEventListener("click",()=>n("refresh")),i.append(s,r,o),e.appendChild(i),this.fabStatus){let E=document.createElement("div");E.className="bp-mgmt-note bp-tone-bad",E.textContent=this.fabStatus,e.appendChild(E)}let a=document.createElement("div");a.className="bp-mgmt-rows",a.setAttribute("data-testid","mgmt-fab-rows");let c=t.review,p=document.createElement("div");p.className="bp-mgmt-row";let l=document.createElement("div");l.className="bp-mgmt-row-line";let h=document.createElement("span"),d=(c?.counts?.error??0)>0;if(h.className="bp-mgmt-flex1 "+(d?"bp-tone-bad":"bp-dim"),h.textContent=c?.running?"Reviewing the design…":c?.at==null?"No design review yet":`${c.counts?.error??0} must-fix · ${c.counts?.warning??0} should-fix · ${c.counts?.info??0} notes${c.scope?` (${c.scope})`:""}`,l.appendChild(h),c?.at!=null){let E=document.createElement("button");E.type="button",E.className="bp-mgmt-btn",E.textContent=u("gpui.mgmt.fab.findings","Findings"),E.addEventListener("click",()=>this.togglePanel("checks")),l.appendChild(E)}if(!c?.running){let E=document.createElement("button");E.type="button",E.className="bp-mgmt-btn",E.textContent=u("gpui.mgmt.fab.reviewbtn","Review"),E.addEventListener("click",()=>n("review")),l.appendChild(E)}if(c?.judge){let E=document.createElement("button");E.type="button",E.className="bp-mgmt-btn",E.textContent=u("gpui.mgmt.fab.judge","Datasheets"),E.addEventListener("click",()=>{if(c.judge)this.cb.onSendText(c.judge)}),l.appendChild(E)}p.appendChild(l),a.appendChild(p);let m=os(t.drc?.state??""),f=document.createElement("div");f.className="bp-mgmt-row";let b=document.createElement("div");b.className="bp-mgmt-row-line";let v=document.createElement("span");if(v.className="bp-mgmt-flex1 "+(m.button?"bp-tone-warn":"bp-dim"),v.textContent=m.text,b.appendChild(v),m.button){let E=document.createElement("button");E.type="button",E.className="bp-mgmt-btn",E.textContent=m.button,E.addEventListener("click",()=>n("drc")),b.appendChild(E)}f.appendChild(b),a.appendChild(f);for(let E of t.conflicts??[]){let k=document.createElement("div");k.className="bp-mgmt-row bp-tone-bad",k.textContent=E,a.appendChild(k)}for(let E of t.suggestions??[]){let k=document.createElement("div");k.className="bp-mgmt-row";let L=document.createElement("div");L.className="bp-mgmt-row-line";let M=document.createElement("span");M.className="bp-mgmt-flex1 bp-tone-warn",M.textContent=`${E.label||E.key}: board ${E.project??"?"} mm, fab ${E.fab??"?"} mm`;let A=document.createElement("button");A.type="button",A.className="bp-mgmt-btn",A.textContent=u("gpui.mgmt.fab.apply","Apply"),A.addEventListener("click",()=>n("apply",{key:E.key})),L.append(M,A),k.appendChild(L),a.appendChild(k)}if(t.stackup?.chosen){let E=document.createElement("div");E.className="bp-mgmt-row";let k=document.createElement("div");k.className="bp-mgmt-row-line";let L=t.stackup.by==="proposed",M=document.createElement("span");if(M.className="bp-mgmt-flex1 "+(L?"bp-tone-warn":"bp-dim"),M.textContent=`${L?"Proposed: ":""}${t.stackup.chosen}${t.stackup.outer_50_mm?` (50Ω ${t.stackup.outer_50_mm} mm)`:""}`,k.appendChild(M),L){let A=t.stackup.chosen,B=document.createElement("button");B.type="button",B.className="bp-mgmt-btn",B.textContent=u("gpui.mgmt.fab.use","Use"),B.addEventListener("click",()=>n("stackup",{id:A})),k.appendChild(B)}E.appendChild(k),a.appendChild(E)}if(Array.isArray(t.changed)&&t.changed.length>0){let E=document.createElement("div");E.className="bp-mgmt-row";let k=document.createElement("div");k.className="bp-mgmt-row-line";let L=document.createElement("span");L.className="bp-mgmt-flex1 bp-tone-warn",L.textContent=u("gpui.mgmt.fab.changed","Changed since you last looked");let M=document.createElement("button");M.type="button",M.className="bp-mgmt-btn",M.textContent=u("gpui.mgmt.fab.seen","Seen"),M.addEventListener("click",()=>n("seen")),k.append(L,M),E.appendChild(k);for(let A of t.changed.slice(0,12)){let B=document.createElement("div");B.className="bp-mgmt-faint",B.textContent=A,E.appendChild(B)}a.appendChild(E)}let w=Array.isArray(t.limits)?t.limits:[];if(w.length>0){let E=document.createElement("div");E.className="bp-mgmt-group-head";let k=document.createElement("span");k.className="bp-mgmt-flex1",k.textContent=u("gpui.mgmt.fab.limit","Limit");let L=document.createElement("span");L.className="bp-mgmt-col",L.textContent=u("gpui.mgmt.fab.free","Base price");let M=document.createElement("span");M.className="bp-mgmt-col",M.textContent=u("gpui.mgmt.fab.extra","Costs more");let A=document.createElement("span");A.className="bp-mgmt-col bp-mgmt-col-read",A.textContent=u("gpui.mgmt.fab.readcol","Read"),E.append(k,L,M,A),a.appendChild(E);for(let T of w){let H=document.createElement("div");H.className="bp-mgmt-row";let O=document.createElement("div");O.className="bp-mgmt-row-line";let P=document.createElement("span");P.className="bp-mgmt-flex1"+(T.changed?" bp-tone-warn":T.inherited?" bp-dim":""),P.textContent=`${T.changed?"• ":""}${T.label??""}`;let Y=document.createElement("span");Y.className="bp-mgmt-col",Y.textContent=T.free?.text||"—";let re=document.createElement("span");re.className="bp-mgmt-col bp-dim",re.textContent=T.extra?.text||"—";let ie=T.free&&typeof T.free==="object"?T.free:T.extra,ue=ie?.fetched??"",Pe=Boolean(ue)&&ie?.confidence!=="published",Ce=ue?Pe?`${ue}*`:ue:"—",te=ie?.source??"",oe;if(te.startsWith("https://")&&ue){let R=document.createElement("a");R.className="bp-mgmt-col bp-mgmt-col-read bp-mgmt-read-link",R.href=te,R.target="_blank",R.rel="noopener noreferrer",R.textContent=Ce,oe=R}else{let R=document.createElement("span");R.className="bp-mgmt-col bp-mgmt-col-read bp-mgmt-faint",R.textContent=Ce,oe=R}O.append(P,Y,re,oe),H.appendChild(O),a.appendChild(H)}let B=document.createElement("div");B.className="bp-mgmt-note bp-mgmt-faint",B.textContent=u("gpui.mgmt.fab.derived","* worked out from the fab's page. Dimmed: the rigid board's value. A date opens the source page."),a.appendChild(B)}return e.appendChild(a),e}makeEmpty(e){let t=document.createElement("div");return t.className="bp-mgmt-note bp-mgmt-faint",t.textContent=e,t}}var ro={trs:(e)=>e,t:(e,t)=>t},oo=new Set(["/settle"]);function ks(e,t){let n=t.trim().toLowerCase();if(!n)return 1;let i=e.toLowerCase();if(i.startsWith(n))return 3;if(i.split(/[^a-z0-9]+/i).some((o)=>o.startsWith(n)))return 2;let r=0;for(let o=0;o0||e.status==="waiting")return{urgency:3,want:"waiting"};if(e.status==="asking")return{urgency:2,want:"question"};if(e.status==="failed"||e.state==="failed")return{urgency:1,want:"failed"};return{urgency:0,want:""}}function Ps(e){let t=e.status||e.state;if(t==="active"||t==="working")return"bp-dot-work";if(t==="finished")return"bp-dot-done";if(t==="waiting"||t==="asking"||t==="blocked"||t==="failed"||(e.waiting??0)>0)return"bp-dot-need";return"bp-dot-idle"}function Ss(e,t){let n=t.trim().split(/\s+/)[0]?.toLowerCase()??"";if(!n)return null;let i=e.toLowerCase();if(i.length!==e.length)return null;let s=i.indexOf(n);if(s<0)return null;return[s,s+n.length]}function Ls(e,t=ro){let{t:n,trs:i}=t,s=[],r=new Map;for(let a of e.projects)r.set(a.id,a.title||a.id);let o=e.threads.find((a)=>a.id===e.selectedThreadId)??null;for(let a of e.railItems){if(a.state==="disabled"||a.id==="commands")continue;if(!o&&a.id!=="terminal")continue;s.push({label:i(a.label),place:a.id==="terminal"?"":"viewer",kind:"action",shortcut:a.key?a.key.toUpperCase():void 0,action:{type:"rail",id:a.id}})}if(o){if(s.push({label:o.pinned?n("menu.unpin","Unpin"):n("menu.pin","Pin"),place:"",kind:"action",action:{type:"thread-act",action:o.pinned?"unpin":"pin"}}),s.push({label:o.settled?n("phone.unsettle","Unsettle"):n("menu.settle","Settle"),place:"",kind:"action",action:{type:"thread-act",action:o.settled?"unsettle":"settle"}}),s.push({label:o.archived?n("palette.unarchive","Unarchive"):n("palette.archive","Archive"),place:"",kind:"action",action:{type:"thread-act",action:o.archived?"unarchive":"archive"}}),o.project==="chats")s.push({label:n("chats.move","Move to project…"),place:"",kind:"action",action:{type:"move-project"}});s.push({label:n("sheet.rename","Rename thread"),place:"",kind:"action",action:{type:"rename"}}),s.push({label:n("gpui.previous.thread","Previous thread"),place:"",kind:"action",action:{type:"prev-thread"}}),s.push({label:n("gpui.next.thread","Next thread"),place:"",kind:"action",action:{type:"next-thread"}})}if(o)for(let a of e.commands){if(!a.word)continue;let c=oo.has(a.word.toLowerCase());s.push({label:a.label?`${a.word} — ${a.label}`:a.word,place:a.desc||"command",kind:"command",action:{type:"command",word:a.word,runDirectly:c}})}s.push({label:n("gpui.improvements","Improvements"),place:"",kind:"action",action:{type:"improvements"}}),s.push({label:n("palette.settings","Settings"),place:"",kind:"action",action:{type:"settings"}}),s.push({label:n("gpui.fold.or.unfold.the.sidebar","Fold or unfold the sidebar"),place:"",kind:"action",action:{type:"sidebar"}}),s.push({label:n("chats.new.noproject","New chat (no project)"),place:"",kind:"action",action:{type:"new-chat"}});for(let a of e.projects)s.push({label:`New thread in ${a.title||a.id}`,place:"",kind:"action",action:{type:"new-thread",projectId:a.id}});for(let a of e.threads){let{urgency:c,want:p}=xs(a);s.push({label:a.title||"Untitled thread",place:a.project==="chats"?n("chats.title","Chats"):a.project?r.get(a.project)??"":"",kind:"thread",urgency:c,want:p,dotClass:Ps(a),action:{type:"thread",id:a.id}})}for(let a of e.bots){if(!a.name||!a.thread)continue;s.push({label:a.name,place:"",kind:"bot",action:{type:"thread",id:a.thread}})}return s}function As(e,t,n,i=[],s=10,r=14){let o=t.trim(),a=o.length===0,c=e.slice();if(n?.threads&&n.threads.length>0){let d=new Map;for(let f of i)d.set(f.id,f.title||f.id);let m=new Set;for(let f of c)if(f.action.type==="thread")m.add(f.action.id);for(let f of n.threads){if(!f.id||m.has(f.id))continue;m.add(f.id);let{urgency:b,want:v}=xs(f);c.push({label:f.title||"Untitled thread",place:f.project?d.get(f.project)??"":"",kind:"thread",urgency:b,want:v,dotClass:Ps(f),action:{type:"thread",id:f.id}})}}let p=[];for(let d=0;d0)p.push({score:v,index:d,item:m})}p.sort((d,m)=>{if(a){let v=(m.item.urgency??0)-(d.item.urgency??0);if(v!==0)return v}if(m.score!==d.score)return m.score-d.score;let f=d.item.kind==="thread"?0:1,b=m.item.kind==="thread"?0:1;if(f!==b)return f-b;return d.index-m.index});let l=new Set,h=[];for(let d of p){let m=`${d.item.label}\x00${d.item.place}\x00${d.item.kind}`;if(l.has(m))continue;if(l.add(m),h.push(d.item),h.length>=s)break}if(n?.messages&&n.messages.length>0&&h.length{if(o.target===t)this.close()}),s.addEventListener("input",()=>{this.query=s.value,this.activeIdx=0,this.renderList(),this.scheduleSearch()}),s.addEventListener("keydown",(o)=>{if(o.key==="Escape")o.preventDefault(),o.stopPropagation(),this.close();else if(o.key==="ArrowDown"){if(o.preventDefault(),this.listed.length>0)this.activeIdx=(this.activeIdx+1)%this.listed.length,this.renderList(!0)}else if(o.key==="ArrowUp"){if(o.preventDefault(),this.listed.length>0)this.activeIdx=(this.activeIdx-1+this.listed.length)%this.listed.length,this.renderList(!0)}else if(o.key==="Enter")o.preventDefault(),this.runAt(this.activeIdx)}),this.backdrop=t,this.inputEl=s,this.listEl=r,this.root.appendChild(t),this.renderList(),this.query.trim().length>=2)this.scheduleSearch();s.focus()}close(){if(this.searchTimer!==null)window.clearTimeout(this.searchTimer),this.searchTimer=null;if(this.searchGen++,this.backdrop)this.backdrop.remove(),this.backdrop=null,this.inputEl=null,this.listEl=null;this.prevFocus?.focus(),this.prevFocus=null}scheduleSearch(){if(this.searchTimer!==null)window.clearTimeout(this.searchTimer),this.searchTimer=null;let e=this.query.trim();if(e.length<2){this.searchHits=null,this.searchHitsQuery="";return}if(e===this.searchHitsQuery)return;let t=++this.searchGen;this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.cb.onSearch(e).then((n)=>{if(t!==this.searchGen||!this.backdrop)return;if(this.query.trim()!==e)return;this.searchHits=n,this.searchHitsQuery=e,this.renderList()}).catch(()=>{})},180)}runAt(e){let t=this.listed[e];if(!t)return;this.close(),this.cb.onExecute(t.action)}renderList(e=!1){if(!this.listEl)return;let t=this.cb.getState(),n=Ls(t,{t:u,trs:he}),i=this.query.trim()===this.searchHitsQuery?this.searchHits:null;if(this.listed=As(n,this.query,i,t.projects),this.activeIdx>=this.listed.length)this.activeIdx=Math.max(0,this.listed.length-1);if(this.listed.length===0){let o=document.createElement("div");o.className="bp-palette-empty",o.textContent=u("gpui.nothing.matches","Nothing matches"),this.listEl.replaceChildren(o);return}let s=document.createDocumentFragment(),r=null;for(let o=0;o0)p.appendChild(document.createTextNode(a.label.slice(0,d)));let f=document.createElement("strong");if(f.className="bp-palette-mark",f.textContent=a.label.slice(d,m),p.appendChild(f),m{if(this.activeIdx!==o)this.activeIdx=o,this.updateActiveClass()}),c.addEventListener("click",()=>this.runAt(o)),o===this.activeIdx)r=c;s.appendChild(c)}if(this.listEl.replaceChildren(s),e&&r)r.scrollIntoView({block:"nearest"})}updateActiveClass(){if(!this.listEl)return;let e=this.listEl.children;for(let t=0;t0?Math.floor(t.leadDays):0,i=[];for(let s of un(t.warnings)){let r=it(s).trim();if(r&&!i.includes(r))i.push(r)}return{project:it(t.project),root:it(t.root),intent:it(t.intent),parts:un(t.parts).map((s)=>Gn(s)).map((s)=>({name:it(s.name),kind:it(s.kind),path:it(s.path)})).filter((s)=>s.name||s.path),boards:un(t.boards).map(it).filter(Boolean),mech:un(t.mech).map((s)=>Gn(s)).map((s)=>({path:it(s.path),name:it(s.name),size:typeof s.size==="number"&&s.size>0?s.size:0})).filter((s)=>s.name||s.path),leadDays:n,warnings:i}}function Vn(e){let t=[];for(let n of e.split(` +`)){let i=n.trimEnd();if(!i.trim())continue;if(t.length>=60)break;let s=i.trimStart();if(s.startsWith("#"))t.push({kind:"h",text:s.replace(/^#+/,"").trim()});else if(s.startsWith("- ")||s.startsWith("* "))t.push({kind:"li",text:s.slice(2).trim()});else t.push({kind:"p",text:s})}return t}function Ms(e){return!Vn(e).some((t)=>t.kind!=="h"&&t.text.length>0)}function Ts(e){if(!Number.isFinite(e)||e<=0)return"";if(e<1024)return`${Math.floor(e)} B`;if(e<1048576)return`${(e/1024).toFixed(e<10240?1:0)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Un(e){let t=e.lastIndexOf("|");return t>=0?e.slice(t+1):e}function be(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n!==void 0)i.textContent=n;return i}class Wn{root;titleEl;rootEl;newBtn;newLbl;threadsEl;bodyEl;cb;projectId="";data=null;threads=null;error="";constructor(e,t){this.cb=t,this.root=be("section","bp-project-home bp-hidden"),this.root.setAttribute("data-testid","project-home");let n=be("div","bp-home-inner"),i=be("header","bp-home-head");this.titleEl=be("h1","bp-home-title"),this.titleEl.setAttribute("data-testid","project-home-title"),this.rootEl=be("div","bp-home-root"),i.append(this.titleEl,this.rootEl);let s=be("div","bp-home-bar");this.newBtn=be("button","primary bp-home-new"),this.newBtn.type="button",this.newBtn.setAttribute("data-testid","project-home-new-thread");let r=be("span","bp-home-new-plus","+");r.setAttribute("aria-hidden","true"),this.newLbl=be("span","",u("thread.new","New thread")),this.newBtn.append(r,this.newLbl),this.newBtn.addEventListener("click",()=>{if(this.projectId)this.cb.onNewThread(this.projectId)}),s.appendChild(this.newBtn),this.threadsEl=be("div","bp-home-threads"),this.bodyEl=be("div","bp-home-body"),n.append(i,s,this.threadsEl,this.bodyEl),this.root.appendChild(n),e.appendChild(this.root)}isOpen(){return this.projectId!==""}show(e){if(this.projectId!==e.id)this.data=null,this.threads=null,this.root.scrollTop=0;this.error="",this.projectId=e.id,this.titleEl.textContent=e.title||e.id,this.root.classList.remove("bp-hidden"),this.render()}hide(){this.projectId="",this.root.classList.add("bp-hidden")}setTitle(e){if(e)this.titleEl.textContent=e}setData(e){this.data=e,this.error="",this.render()}setThreads(e){this.threads=e,this.render()}setError(e){this.error=e,this.render()}refreshLocale(){if(this.newLbl.textContent=u("thread.new","New thread"),this.isOpen())this.render()}section(e){return be("h2","bp-home-section",e)}render(){this.rootEl.textContent=this.data?.root??"",this.rootEl.classList.toggle("bp-hidden",!this.data?.root),this.renderThreads(),this.renderBody()}renderThreads(){let e=document.createDocumentFragment(),t=this.threads;if(t){if(e.appendChild(this.section(u("gpui.projects.threads","THREADS ({n})",{n:t.length}))),t.length===0)e.appendChild(be("div","bp-home-empty",u("gpui.no.threads.yet","No threads yet.")));for(let n of t){let i=be("button","bp-home-row bp-home-thread"+(n.settled?" bp-dim":""));i.type="button",i.setAttribute("data-testid",`project-home-thread-${n.id}`);let s=be("span",`bp-dot ${n.dot}`);if(n.status)s.title=n.status;let r=be("span","bp-home-row-main",n.title||"Untitled thread"),o=be("span","bp-home-row-faint",n.age);i.append(s,r,o),i.addEventListener("click",()=>this.cb.onOpenThread(n.id)),e.appendChild(i)}}this.threadsEl.replaceChildren(e)}renderBody(){let e=document.createDocumentFragment(),t=this.data;if(this.error){let s=be("div","bp-home-error");s.setAttribute("data-testid","project-home-error"),s.appendChild(be("span","",this.error));let r=be("button","bp-btn-ghost",u("tools.retry","Retry"));r.type="button";let o=this.projectId;r.addEventListener("click",()=>this.cb.onRetry(o)),s.appendChild(r),e.appendChild(s)}if(!t){if(!this.error)e.appendChild(be("div","bp-home-empty",u("web.home.loading","Loading project…")));this.bodyEl.replaceChildren(e);return}e.appendChild(this.section(u("gpui.goal.notes","GOAL & NOTES")));let n=be("div","bp-home-intent");if(n.setAttribute("data-testid","project-home-intent"),Ms(t.intent))e.appendChild(be("div","bp-home-empty",u("gpui.no.goal.yet.ask.an","No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.")));else{for(let s of Vn(t.intent))if(s.kind==="h")n.appendChild(be("div","bp-home-intent-h",s.text));else if(s.kind==="li"){let r=be("div","bp-home-intent-li"),o=be("span","bp-home-bullet","•");o.setAttribute("aria-hidden","true"),r.append(o,be("span","",s.text)),n.appendChild(r)}else n.appendChild(be("div","",s.text));e.appendChild(n)}let i=this.threads?.[0]?.id??"";if(t.mech.length>0)e.appendChild(this.section(u("gpui.projects.mech","MECHANICAL ({n})",{n:t.mech.length}))),t.mech.forEach((s,r)=>{let o=r===0&&t.mech.length>1,a=this.fileRow(i,"mech",`project-home-mech-${r}`);if(a.title=s.path,a.appendChild(be("span","bp-home-row-main",s.name||s.path)),o)a.appendChild(be("span","bp-home-row-accent",u("gpui.assembly","Assembly")));a.appendChild(be("span","bp-home-row-faint",Ts(s.size))),e.appendChild(a)});if(t.parts.length>0){e.appendChild(this.section(u("gpui.projects.to.order","TO ORDER ({n})",{n:t.parts.length})));let s=be("div","bp-home-order");if(s.setAttribute("data-testid","project-home-order"),t.parts.forEach((r,o)=>{let a=be("div","bp-home-row");a.setAttribute("data-testid",`project-home-part-${o}`),a.append(be("span","bp-home-row-main",r.name||r.path),be("span","bp-home-row-dim",r.kind),be("span","bp-home-row-faint",r.path)),s.appendChild(a)}),t.leadDays>0){let r=be("div","bp-home-order-note",t.leadDays===1?u("web.home.lead.one","Lead time: 1 day"):u("web.home.lead","Lead time: {n} days",{n:t.leadDays}));r.setAttribute("data-testid","project-home-lead"),s.appendChild(r)}for(let r of t.warnings){let o=be("div","bp-home-order-note warn",r);o.setAttribute("data-testid","project-home-warning"),s.appendChild(o)}e.appendChild(s)}if(t.boards.length>0)e.appendChild(this.section(u("gpui.projects.boards","BOARDS ({n})",{n:t.boards.length}))),t.boards.forEach((s,r)=>{let o=this.fileRow(i,"board",`project-home-board-${r}`);o.appendChild(be("span","bp-home-row-main",s)),e.appendChild(o)});this.bodyEl.replaceChildren(e)}fileRow(e,t,n){if(!e){let s=be("div","bp-home-row");return s.setAttribute("data-testid",n),s}let i=be("button","bp-home-row bp-home-open");return i.type="button",i.setAttribute("data-testid",n),i.addEventListener("click",()=>this.cb.onOpenViewer(e,t)),i}}function _n(e){let t=null;if(typeof e==="string"){let i=e.trim();if(!i)return null;try{let s=JSON.parse(i);if(s&&typeof s==="object"&&!Array.isArray(s))t=s}catch{return null}}else if(e&&typeof e==="object"&&!Array.isArray(e))t=e;if(!t)return null;let n=typeof t.head==="string"?t.head.trim():"";if(!n)return null;return{reason:typeof t.reason==="string"?t.reason:"",head:n,text:typeof t.text==="string"?t.text:"",button:typeof t.button==="string"&&t.button.trim()?t.button:"Open Settings → Accounts",url:typeof t.url==="string"&&t.url.trim()?t.url:"backplane://settings/accounts"}}function ao(e){return e.startsWith("No AI provider connected yet.")}function Bs(e,t){if(t==="no_provider")return!0;if(t)return!1;return ao(e)}function st(e){return typeof e==="string"?e:""}function zn(e){return typeof e==="number"&&Number.isFinite(e)?e:0}function Is(e){let t=e&&typeof e==="object"?e:{},n=[];for(let i of Array.isArray(t.notes)?t.notes:[]){if(!i||typeof i!=="object")continue;let s=i,r=st(s.id);if(!r)continue;n.push({id:r,said:zn(s.said),gesture:st(s.gesture),words:st(s.words),model:st(s.model),conf:typeof s.conf==="number"&&Number.isFinite(s.conf)?s.conf:null,unsure:st(s.unsure),state:st(s.state),error:st(s.error),thread:st(s.thread),play:st(s.play),heard:zn(s.heard)})}return{total:Math.max(zn(t.total),n.length),notes:n,busy:st(t.busy)}}function Rs(e){let t=/\/ring\/audio\/(n[0-9a-f]{16})(?:\.m4a)?\?k=([0-9a-fA-F]+)$/.exec(e);return t?`/ring/audio/${t[1]}?k=${t[2]}`:""}function js(e){if(!e.model)return{key:"web.ring.not.heard",fallback:"Not heard"};if(e.model==="ring")return{key:"web.ring.app.words",fallback:"The Pebble app's words"};if(e.conf!==null)return{key:"web.ring.heard.by.sure",fallback:"Heard by {model}, {conf}% sure",vars:{model:e.model,conf:Math.round(e.conf)}};return{key:"web.ring.heard.by",fallback:"Heard by {model}",vars:{model:e.model}}}function Hs(e,t){if(t)return{key:"web.ring.state.busy",fallback:"being heard now"};switch(e){case"sent":return{key:"web.ring.state.sent",fallback:"given to Pebble"};case"new":return{key:"web.ring.state.new",fallback:"waiting to be heard"};case"heard":return{key:"web.ring.state.heard",fallback:"waiting to go to Pebble"};case"failed":return{key:"web.ring.state.failed",fallback:"not given to Pebble"};default:return{key:"",fallback:e}}}function Ds(e,t,n){if(e<=0)return{key:"ring.no.recordings.yet",fallback:"No recordings yet."};if(n.trim())return{key:"web.ring.found",fallback:"{found} of {total} have “{q}”.",vars:{found:t,total:e,q:n.trim()}};return e===1?{key:"web.ring.count.one",fallback:"1 recording"}:{key:"web.ring.count",fallback:"{n} recordings",vars:{n:e}}}var Fs="http://www.w3.org/2000/svg",$s={terminal:["M4 17l6-6-6-6","M12 19h8"],search:["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.3-4.3"],"circuit-board":["M3 3h18v18H3z","M9 3v6h6","M9 21v-6","M15 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","M9 15a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],cpu:["M6 6h12v12H6z","M9 2v4","M15 2v4","M9 18v4","M15 18v4","M2 9h4","M2 15h4","M18 9h4","M18 15h4"],box:["M21 16V8l-9-5-9 5v8l9 5 9-5z","M3.3 7L12 12l8.7-5","M12 22V12"],gauge:["M12 14l4-4","M3.3 19a10 10 0 1 1 17.4 0"],"file-stack":["M16 2H6v12h10V2z","M20 6v12H10","M4 18h10v4H4z"],"layout-panel-left":["M3 3h18v18H3z","M10 3v18"],layers:["M12 2L2 7l10 5 10-5-10-5z","M2 12l10 5 10-5","M2 17l10 5 10-5"],wrench:["M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"],folder:["M3 6h6l2 2h10v11H3z"],diff:["M12 5v10","M7 10h10","M7 19h10"],"circle-check":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M9 12l2 2 4-4"],globe:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M2 12h20","M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20z"]};function lo(e){let t=document.createElementNS(Fs,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.75"),t.setAttribute("stroke-linecap","square"),t.setAttribute("stroke-linejoin","miter"),t.setAttribute("aria-hidden","true");let n=$s[e]??$s.folder;for(let i of n){let s=document.createElementNS(Fs,"path");s.setAttribute("d",i),t.appendChild(s)}return t}class qn{el;items=[];activeId="";onPress;pagesRo=null;constructor(e,t){this.el=e,this.onPress=t,this.render()}setItems(e){this.items=e.slice(),this.render()}setActive(e){this.activeId=e,this.render()}renderButton(e){let t=e.state==="disabled",n=!t&&(e.state==="on"||this.activeId!==""&&e.id===this.activeId),i=he(e.label),s=e.why?he(e.why):"",r=document.createElement("button");if(r.type="button",r.className="bp-rail-btn"+(n?" active":"")+(t?" disabled":""),r.disabled=t,r.setAttribute("aria-pressed",n?"true":"false"),t){if(r.title=s||i,s)r.setAttribute("data-why",s)}else r.title=e.key?`${i} (${e.key.toUpperCase()})`:i;r.setAttribute("data-rail-id",e.id),r.setAttribute("data-testid",`rail-${e.id}`),r.appendChild(lo(e.icon));let o=document.createElement("span");if(o.className="bp-rail-lbl",o.textContent=i,r.appendChild(o),!t)r.addEventListener("click",()=>this.onPress(e.id));return r}render(){let e=this.items.filter((o)=>o.group!=="tools"),t=this.items.filter((o)=>o.group==="tools"),n=document.createElement("div");n.className="bp-rail-pages";let i;for(let o of e){if(i!==void 0&&o.group!==i){let a=document.createElement("div");a.className="bp-rail-rule",n.appendChild(a)}i=o.group,n.appendChild(this.renderButton(o))}let s=()=>{let o=n.scrollLeft>2,a=n.scrollLeft+n.clientWidth0){let o=document.createElement("div");o.className="bp-rail-tools";for(let a of t)o.appendChild(this.renderButton(a));r.appendChild(o)}this.el.replaceChildren(r)}}var co=new Set(["resume","raise","retry","move","signin"]);function Kn(e){if(!e||typeof e!=="object")return null;let t=e,n=(r)=>typeof r==="string"?r:"",i=(Array.isArray(t.actions)?t.actions:[]).filter((r)=>Boolean(r)&&typeof r==="object").map((r)=>({label:n(r.label),act:n(r.act),room:n(r.room),thread:n(r.thread)})),s={line:n(t.line),why:n(t.why),actions:i};return s.line||i.length?s:null}function mn(e,t){if(e.act==="board")return t&&e.room?{kind:"board",room:e.room}:null;if(e.act==="open")return e.thread?{kind:"thread",id:e.thread}:null;if(co.has(e.act)){let n={room:e.room,action:e.act};if(e.thread)n.thread=e.thread;return{kind:"call",method:"swarm.act",params:n}}return null}function Os(e){let t=e&&typeof e==="object"?e.open:void 0;if(typeof t!=="string")return null;let n=t.indexOf(":"),i=n<0?"":t.slice(n+1);if(!i)return null;if(t.startsWith("account:"))return{kind:"account",id:i};if(t.startsWith("thread:"))return{kind:"thread",id:i};return null}var Yn=[{id:"general",label:"General"},{id:"ai",label:"Agents and tools"},{id:"connect",label:"Connect"}],Tt=[{id:"appearance",group:"general",title:"Appearance",subtitle:"Kept in this browser only. Never sent to the hub.",icon:"sun",keywords:["theme","dark","light","auto","color","language","locale","english","espanol","japanese"]},{id:"providers",group:"ai",title:"AI providers",subtitle:"Account sign-ins live in the desktop or mobile app.",icon:"cpu",keywords:["accounts","claude","codex","antigravity","grok","openai","anthropic","signin","login","model"]},{id:"ring",group:"ai",title:"Ring",subtitle:"Voice notes from your Pebble ring. Its webhook is set up in the desktop or mobile app.",icon:"mic",keywords:["pebble","index","voice","note","notes","recording","recordings","play","hear","transcribe","search"]},{id:"devices",group:"connect",title:"Devices & browser",subtitle:"This browser session and paired devices on this hub.",icon:"link",keywords:["sign out","logout","session","cookie","revoke","paired","phone","browser","pair"]},{id:"home",group:"connect",title:"Home machine",subtitle:"Which machine hosts your always-on hub and bots.",icon:"globe",keywords:["host","boat","move","online","away","queued","linked"]}];function Gs(e){if(e==="dark"||e==="light"||e==="auto")return e;return"auto"}function Vs(e){if(e==="en"||e==="es"||e==="ja"||e==="auto")return e;return"auto"}function Wt(e,t){if(e==="dark"||e==="light")return e;return t==="light"?"light":"dark"}function Us(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function Jn(e,t){if(t.length===0)return!0;let n=e.toLowerCase();return t.every((i)=>n.includes(i))}function Ws(e,t){let n=Us(t);if(n.length===0)return[];return e.filter((i)=>{let s=[i.groupLabel,i.pageTitle,i.rowTitle,i.rowDetail,...i.keywords??[]].join(" ");return Jn(s,n)})}function Xn(e,t,n){let i=Us(n);if(i.length===0)return e.map((o)=>({page:o,hits:[]}));let s=new Map(Yn.map((o)=>[o.id,o.label])),r=[];for(let o of e){let c=t.filter((l)=>l.pageId===o.id).filter((l)=>Jn([l.rowTitle,l.rowDetail,l.pageTitle,l.groupLabel,...l.keywords??[]].join(" "),i));if(Jn([s.get(o.group)??"",o.title,o.subtitle,...o.keywords].join(" "),i)||c.length>0){let l=[];for(let h of c){if(!l.includes(h.rowTitle))l.push(h.rowTitle);if(l.length>=2)break}r.push({page:o,hits:l})}}return r}function Qn(e){return e.key?u(e.key,e.fallback,e.vars):e.fallback}function po(e){let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("width","15"),n.setAttribute("height","15"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.75"),n.setAttribute("stroke-linecap","square"),n.setAttribute("stroke-linejoin","miter"),n.setAttribute("aria-hidden","true");let i=(s,r)=>{let o=document.createElementNS("http://www.w3.org/2000/svg",s);for(let[a,c]of Object.entries(r))o.setAttribute(a,c);n.appendChild(o)};switch(e){case"sun":i("circle",{cx:"12",cy:"12",r:"4"}),i("path",{d:"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"});break;case"cpu":i("rect",{x:"5",y:"5",width:"14",height:"14"}),i("rect",{x:"9",y:"9",width:"6",height:"6"}),i("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3M2 9h3m-3 6h3M19 9h3m-3 6h3"});break;case"link":i("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),i("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"});break;case"mic":i("rect",{x:"9",y:"2",width:"6",height:"12"}),i("path",{d:"M5 11a7 7 0 0 0 14 0M12 18v4M8 22h8"});break;case"globe":i("circle",{cx:"12",cy:"12",r:"10"}),i("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"});break}return n}function ho(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.75"),t.setAttribute("aria-hidden","true");let n=document.createElementNS("http://www.w3.org/2000/svg","circle");n.setAttribute("cx","11"),n.setAttribute("cy","11"),n.setAttribute("r","7");let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","m20 20-3.5-3.5"),t.append(n,i),t}function bn(e,t){switch(e){case"general":return u("gpui.settings.group.general",t);case"ai":return u("gpui.settings.group.agents",t);case"connect":return u("native.pair.connect",t)}}function gt(e,t){switch(e){case"appearance":return u("settings.appearance",t);case"providers":return u("web.settings.providers",t);case"ring":return u("ring.ring",t);case"devices":return t;case"home":return u("home.machine",t)}}class Zn{backdrop;titleEl;badgeEl;closeBtn;navListEl;searchInput;searchClearBtn;paneEl;cb;openState=!1;activePage="appearance";forceProviders=!1;query="";searchBrowseAll=!1;devicesLoaded=!1;devicesLoading=!1;devicesRows=[];devicesError="";loadGen=0;ringLoaded=!1;ringLoading=!1;ringList={total:0,notes:[],busy:""};ringCountEl=null;ringErrorEl=null;ringRows=new Map;ringShownQuery="";ringError="";ringQuery="";ringDraft="";ringGen=0;ringBusy=new Set;ringPolls=0;ringTimers=[];constructor(e,t){this.cb=t,this.backdrop=document.createElement("div"),this.backdrop.className="bp-modal-backdrop bp-hidden",this.backdrop.setAttribute("data-testid","settings-modal");let n=document.createElement("div");n.className="bp-modal bp-settings-modal",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby","bp-settings-title");let i=document.createElement("div");i.className="bp-modal-head";let s=document.createElement("div");s.className="bp-settings-head-title",this.titleEl=document.createElement("h2"),this.titleEl.id="bp-settings-title",this.titleEl.textContent=u("palette.settings","Settings"),this.badgeEl=document.createElement("span"),this.badgeEl.className="bp-settings-badge",this.badgeEl.textContent="Browser",s.append(this.titleEl,this.badgeEl),this.closeBtn=document.createElement("button"),this.closeBtn.type="button",this.closeBtn.className="icon",this.closeBtn.textContent="×",this.closeBtn.setAttribute("aria-label",u("common.close","Close")),this.closeBtn.addEventListener("click",()=>this.close()),i.append(s,this.closeBtn);let r=document.createElement("div");r.className="bp-settings-body";let o=document.createElement("aside");o.className="bp-settings-nav";let a=document.createElement("div");a.className="bp-settings-search";let c=document.createElement("span");c.className="bp-settings-search-icon",c.appendChild(ho()),this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="bp-settings-search-input",this.searchInput.placeholder="Search settings…",this.searchInput.setAttribute("aria-label","Search settings"),this.searchInput.setAttribute("data-testid","settings-search"),this.searchClearBtn=document.createElement("button"),this.searchClearBtn.type="button",this.searchClearBtn.className="bp-settings-search-clear bp-hidden",this.searchClearBtn.textContent="×",this.searchClearBtn.title="Clear search",this.searchClearBtn.setAttribute("aria-label","Clear search"),a.append(c,this.searchInput,this.searchClearBtn),this.navListEl=document.createElement("nav"),this.navListEl.className="bp-settings-nav-list",this.navListEl.setAttribute("aria-label","Settings sections"),o.append(a,this.navListEl),this.paneEl=document.createElement("div"),this.paneEl.className="bp-settings-pane",r.append(o,this.paneEl),n.append(i,r),this.backdrop.appendChild(n),this.backdrop.addEventListener("click",(p)=>{if(p.target===this.backdrop)this.close()}),this.searchInput.addEventListener("input",()=>{this.query=this.searchInput.value,this.searchBrowseAll=this.query.trim().length>0,this.syncSearchClear(),this.render()}),this.searchInput.addEventListener("keydown",(p)=>{if(p.key==="Enter"){let l=Xn(Tt,this.buildSearchItems(),this.query);if(l.length>0)p.preventDefault(),this.activePage=l[0].page.id,this.searchBrowseAll=!1,this.render()}else if(p.key==="Escape"&&this.query.trim().length>0)p.preventDefault(),p.stopPropagation(),this.clearSearch()}),this.searchClearBtn.addEventListener("click",()=>{this.clearSearch(),this.searchInput.focus()}),e.appendChild(this.backdrop)}isOpen(){return this.openState}handleEscape(){if(!this.openState)return;if(this.query.trim().length>0)this.clearSearch(),this.searchInput.focus();else this.close()}async open(e){if(this.openState=!0,e)this.activePage=e;if(this.backdrop.classList.remove("bp-hidden"),this.render(),this.loadDevices(),this.activePage==="ring")this.loadRing();window.setTimeout(()=>{if(this.openState)this.searchInput.focus()},0)}async openToAccounts(){this.forceProviders=!0,this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),await this.open("providers")}close(){this.openState=!1,this.forceProviders=!1,this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),this.backdrop.classList.add("bp-hidden");for(let e of this.ringTimers)window.clearTimeout(e);if(this.ringTimers=[],this.ringBusy.clear(),this.ringPolls=0,this.activePage==="ring")this.paneEl.replaceChildren()}refreshLocale(){if(this.titleEl.textContent=u("palette.settings","Settings"),this.closeBtn.setAttribute("aria-label",u("common.close","Close")),this.openState)this.render()}async refresh(){if(!this.openState)return;this.render(),await this.loadDevices()}clearSearch(){this.query="",this.searchInput.value="",this.searchBrowseAll=!1,this.syncSearchClear(),this.render()}syncSearchClear(){this.searchClearBtn.classList.toggle("bp-hidden",this.query.length===0)}async loadDevices(){let e=++this.loadGen;if(this.devicesLoading=!this.devicesLoaded,this.devicesLoading&&this.openState)this.renderPane();try{let t=await this.cb.onLoadDevices();if(e!==this.loadGen)return;this.devicesRows=t,this.devicesError="",this.devicesLoaded=!0}catch(t){if(e!==this.loadGen)return;let n=t instanceof Error&&t.message?t.message:"Not available from a browser";this.devicesError=`${n} — manage paired devices in Backplane › Settings › Devices on desktop or a paired phone.`,this.devicesRows=[],this.devicesLoaded=!0}finally{if(e===this.loadGen){if(this.devicesLoading=!1,this.openState)this.render()}}}async loadRing(){if(!this.cb.onRingList||!(this.cb.hasRing?.()??!1))return;let e=++this.ringGen;if(this.ringLoading=!this.ringLoaded,this.ringLoading)this.showRing();try{let t=await this.cb.onRingList(this.ringQuery);if(e!==this.ringGen)return;if(this.ringList=t,this.ringError="",!t.busy)this.ringBusy.clear();if(t.busy&&this.openState&&this.ringPolls<40)this.ringPolls++,this.ringLater(3000);else if(!t.busy)this.ringPolls=0}catch(t){if(e!==this.ringGen)return;this.ringError=t instanceof Error&&t.message?t.message:u("web.ring.error","Could not load recordings.")}finally{if(e===this.ringGen)this.ringLoaded=!0,this.ringLoading=!1,this.showRing()}}ringLater(e){let t=window.setTimeout(()=>{if(this.ringTimers=this.ringTimers.filter((n)=>n!==t),this.openState)this.loadRing()},e);this.ringTimers.push(t)}ringIsBusy(e){return this.ringBusy.has(e)||this.ringList.busy===e}showRing(){if(!this.openState||this.activePage!=="ring"||this.query.trim()&&this.searchBrowseAll)return;let e=this.ringList.notes.map((i)=>i.id),t=Array.from(this.ringRows.keys());if(!(this.ringCountEl?.isConnected===!0&&this.ringShownQuery===this.ringQuery&&e.length===t.length&&e.every((i,s)=>i===t[s]))){this.renderPane();return}if(this.ringCountEl)this.ringCountEl.textContent=this.ringCountLine();if(this.ringErrorEl)this.ringErrorEl.textContent=this.ringError,this.ringErrorEl.classList.toggle("bp-hidden",!this.ringError);for(let i of this.ringList.notes)this.fillRingNote(i)}ringCountLine(){return this.ringLoading?u("web.ring.loading","Loading recordings…"):Qn(Ds(this.ringList.total,this.ringList.notes.length,this.ringQuery))}fillRingNote(e){let t=this.ringRows.get(e.id);if(!t)return;let n=this.ringIsBusy(e.id);t.state.className="bp-status-pill "+(n?"accent":e.state==="sent"?"ok":e.state==="failed"?"bad":"warn"),t.state.textContent=Qn(Hs(e.state,n)),t.words.className="bp-ring-words"+(e.words?"":" bp-dim"),t.words.textContent=e.words||u("web.ring.no.words","(no words)"),t.meta.textContent=[Qn(js(e)),e.unsure,e.error].filter(Boolean).join(" · ");for(let i of t.hear)i.disabled=n}async hearRing(e,t){if(!this.cb.onRingHear||this.ringIsBusy(e))return;this.ringBusy.add(e),this.ringError="",this.showRing();try{await this.cb.onRingHear(e,t),this.ringPolls=0,this.ringLater(1500)}catch(n){this.ringBusy.delete(e),this.ringError=n instanceof Error&&n.message?n.message:u("web.ring.error","Could not load recordings."),this.showRing()}}buildSearchItems(){let e=this.cb.onGetHome?.()??null,t=this.cb.onGetNoProvider?.()??null,n=bn("general","General"),i=bn("ai","Agents and tools"),s=bn("connect","Connect"),r=gt("appearance","Appearance"),o=gt("providers","AI providers"),a=gt("devices","Devices & browser"),c=gt("home","Home machine"),p=[{pageId:"appearance",pageTitle:r,groupLabel:n,rowTitle:u("settings.theme","Theme"),rowDetail:"Auto (follow hub), Dark, or Light in this browser.",keywords:["theme","dark","light","auto","appearance","colors"]},{pageId:"appearance",pageTitle:r,groupLabel:n,rowTitle:u("settings.lang","Language"),rowDetail:"Interface language for this browser.",keywords:["locale","english","espanol","japanese","language"]},{pageId:"providers",pageTitle:o,groupLabel:i,rowTitle:t?he(t.head):"Provider connections",rowDetail:"Connect Claude, Codex, Antigravity, or other AI providers in Settings → Accounts.",keywords:["accounts","claude","codex","antigravity","grok","openai","signin"]},{pageId:"ring",pageTitle:gt("ring","Ring"),groupLabel:i,rowTitle:u("ring.recordings","Recordings"),rowDetail:"Read, search, play and hear again the voice notes from your Pebble ring.",keywords:["pebble","voice","note","recording","play","hear","transcribe"]},{pageId:"devices",pageTitle:a,groupLabel:s,rowTitle:"This browser",rowDetail:"Sign out and revoke this browser's session cookie.",keywords:["logout","sign out","session","cookie"]},{pageId:"devices",pageTitle:a,groupLabel:s,rowTitle:"Paired devices",rowDetail:this.devicesRows.map((l)=>`${l.title||l.head||""} ${l.detail||l.text||""}`).join(" ")||"Paired phones and browsers on this hub.",keywords:["phone","pair","revoke","browser"]},{pageId:"home",pageTitle:c,groupLabel:s,rowTitle:e?.name?`${e.name}`:c,rowDetail:"Which machine hosts your always-on hub and bots.",keywords:["boat","move","online","away","queued","machine"]}];for(let l of this.devicesRows){let h=l.title||l.head||"";if(h)p.push({pageId:"devices",pageTitle:a,groupLabel:s,rowTitle:h,rowDetail:l.detail||l.text||"",keywords:["paired","device"]})}return p}render(){this.renderNav(),this.renderPane()}renderNav(){let e=document.createDocumentFragment(),t=Xn(Tt,this.buildSearchItems(),this.query),n=this.cb.onGetNoProvider?.()??null,i=this.cb.onGetHome?.()??null;if(t.length===0){let r=document.createElement("div");r.className="bp-settings-nav-empty",r.setAttribute("data-testid","settings-nav-empty"),r.textContent="No matching settings",e.appendChild(r),this.navListEl.replaceChildren(e);return}let s="";for(let r of t){let o=r.page;if(o.group!==s){s=o.group;let d=Yn.find((m)=>m.id===o.group);if(d){let m=document.createElement("div");m.className="bp-settings-group",m.textContent=bn(d.id,d.label),e.appendChild(m)}}let a=document.createElement("button");a.type="button";let c=!this.searchBrowseAll&&o.id===this.activePage;a.className="bp-settings-nav-item"+(c?" active":""),a.setAttribute("data-testid",`settings-nav-${o.id}`);let p=document.createElement("div");p.className="bp-settings-nav-row";let l=document.createElement("span");l.className="bp-settings-nav-icon",l.appendChild(po(o.icon));let h=document.createElement("span");if(h.className="bp-settings-nav-label",h.textContent=gt(o.id,o.title),p.append(l,h),o.id==="providers"&&(n||this.forceProviders)){let d=document.createElement("span");d.className="bp-settings-nav-dot warn",d.title="Action needed",p.appendChild(d)}else if(o.id==="home"&&i){let d=document.createElement("span");d.className="bp-settings-nav-dot "+(i.moving?.state==="failed"?"bad":i.online?"ok":"warn"),p.appendChild(d)}if(a.appendChild(p),r.hits.length>0)for(let d of r.hits){let m=document.createElement("div");m.className="bp-settings-hit",m.textContent=d,a.appendChild(m)}a.addEventListener("click",()=>{if(this.activePage=o.id,this.searchBrowseAll=!1,this.render(),o.id==="ring")this.loadRing()}),e.appendChild(a)}this.navListEl.replaceChildren(e)}renderPane(){let e=document.createDocumentFragment(),t=this.query.trim();if(t&&this.searchBrowseAll){this.renderSearchResults(e,t),this.paneEl.replaceChildren(e);return}let n=Tt.find((o)=>o.id===this.activePage)??Tt[0],i=document.createElement("div");i.className="bp-settings-pane-head";let s=document.createElement("h3");s.textContent=gt(n.id,n.title);let r=document.createElement("div");switch(r.className="bp-settings-pane-sub",r.textContent=n.subtitle,i.append(s,r),e.appendChild(i),n.id){case"appearance":this.renderAppearancePage(e);break;case"providers":this.renderProvidersPage(e);break;case"ring":this.renderRingPage(e);break;case"devices":this.renderDevicesPage(e);break;case"home":this.renderHomePage(e);break}this.paneEl.replaceChildren(e)}renderSearchResults(e,t){let n=Ws(this.buildSearchItems(),t),i=document.createElement("div");i.className="bp-settings-pane-head";let s=document.createElement("h3");s.textContent="Search results";let r=document.createElement("div");if(r.className="bp-settings-pane-sub",r.textContent=n.length===0?`No settings match "${t}".`:`${n.length} matching ${n.length===1?"setting":"settings"} for "${t}"`,i.append(s,r),e.appendChild(i),n.length===0){let a=document.createElement("div");a.className="bp-settings-empty",a.textContent="Try searching for theme, language, providers, sign out, devices, or home.",e.appendChild(a);return}let o=Array.from(new Set(n.map((a)=>a.pageId)));for(let a of o){let c=Tt.find((m)=>m.id===a);if(!c)continue;let p=document.createElement("div");p.className="bp-settings-search-sec";let l=document.createElement("div");l.className="bp-settings-subhead",l.textContent=gt(c.id,c.title);let h=document.createElement("button");h.type="button",h.className="bp-settings-search-open",h.textContent="Open page ›",h.addEventListener("click",()=>{if(this.activePage=a,this.searchBrowseAll=!1,this.render(),a==="ring")this.loadRing()}),p.append(l,h),e.appendChild(p);let d=new Set(n.filter((m)=>m.pageId===a).map((m)=>m.rowTitle));if(a==="appearance")this.renderAppearancePage(e,d);else if(a==="providers")this.renderProvidersPage(e);else if(a==="ring"){let m=document.createElement("div");m.className="bp-settings-empty",m.textContent="Read, search, play and hear again the voice notes from your Pebble ring.",e.appendChild(m)}else if(a==="devices")this.renderDevicesPage(e,d);else if(a==="home")this.renderHomePage(e)}}renderAppearancePage(e,t){let n=this.cb.onGetThemePref?.()??"auto",i=this.cb.onGetHubTheme?.()??"dark",s=Wt(n,i),r=this.cb.onGetLocalePref?.()??"auto",o=u("settings.theme","Theme"),a=u("settings.lang","Language");if(!t||t.has(o)){let c=u("settings.theme.dark","Dark"),p=u("settings.theme.light","Light"),l=n==="auto"?`Following hub theme (${i==="light"?p:c}). Stored in this browser only.`:`Using ${s==="light"?p:c} in this browser. Select Auto to follow the hub.`;e.appendChild(this.makeSegmentedRow(o,l,[{value:"auto",label:"Auto"},{value:"dark",label:c},{value:"light",label:p}],n,"settings-theme",(h)=>{this.cb.onSetThemePref?.(h),this.render()}))}if(!t||t.has(a))e.appendChild(this.makeSegmentedRow(a,"Interface language for this browser. Automatic follows the hub or browser language.",[{value:"auto",label:u("settings.lang.auto","Automatic")},{value:"en",label:u("settings.lang.en","English")},{value:"es",label:u("settings.lang.es","Español")},{value:"ja",label:u("settings.lang.ja","日本語")}],r,"settings-locale",(c)=>{this.cb.onSetLocalePref?.(c),this.render()}))}makeSegmentedRow(e,t,n,i,s,r){let o=document.createElement("div");o.className="bp-settings-row";let a=document.createElement("div");a.className="bp-settings-row-info";let c=document.createElement("div");c.className="bp-settings-row-title",c.textContent=e;let p=document.createElement("div");p.className="bp-settings-row-detail",p.textContent=t,a.append(c,p);let l=document.createElement("div");l.className="bp-chip-group",l.setAttribute("role","group"),l.setAttribute("aria-label",e);for(let h of n){let d=document.createElement("button");d.type="button";let m=h.value===i;d.className="bp-chip"+(m?" active":""),d.textContent=h.label,d.setAttribute("aria-pressed",m?"true":"false"),d.setAttribute("data-testid",`${s}-${h.value}`),d.addEventListener("click",()=>r(h.value)),l.appendChild(d)}return o.append(a,l),o}renderProvidersPage(e){let t=this.cb.onGetNoProvider?.()??null,n=document.createElement("section");if(n.className="bp-settings-section",n.setAttribute("data-testid","settings-providers"),t||this.forceProviders){let i=document.createElement("div");i.className="bp-settings-notice warn";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title",r.textContent=t?he(t.head):u("provider.notice.head","No AI provider connected");let o=document.createElement("div");o.className="bp-settings-row-detail",o.textContent=u("web.settings.providers.browser","Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."),s.append(r,o);let a=document.createElement("div");a.className="bp-set-btns";let c=document.createElement("a");c.className="bp-link-btn primary",c.href=t?.url||"backplane://settings/accounts",c.setAttribute("data-testid","settings-open-accounts"),c.textContent=t?he(t.button):u("provider.notice.button","Open Settings → Accounts"),a.appendChild(c),i.append(s,a),n.appendChild(i)}else{let i=document.createElement("div");i.className="bp-settings-row";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title-wrap";let o=document.createElement("span");o.className="bp-settings-row-title",o.textContent="Provider connections";let a=document.createElement("span");a.className="bp-status-pill ok",a.textContent=u("gpui.acct.connected","Connected"),r.append(o,a);let c=document.createElement("div");c.className="bp-settings-row-detail",c.textContent="Provider sign-ins, fallback order, API keys, and usage limits are managed in the Backplane desktop or mobile app.",s.append(r,c);let p=document.createElement("div");p.className="bp-set-btns";let l=document.createElement("a");l.className="bp-link-btn",l.href="backplane://settings/accounts",l.setAttribute("data-testid","settings-open-accounts"),l.textContent=u("provider.notice.button","Open Settings → Accounts"),p.appendChild(l),i.append(s,p),n.appendChild(i)}e.appendChild(n)}renderDevicesPage(e,t){let n=!t||t.has("This browser"),i=!t||t.has("Paired devices")||this.devicesRows.some((o)=>t.has(o.title||o.head||""));if(n){let o=document.createElement("div");o.className="bp-settings-subhead",o.textContent="This browser",e.appendChild(o);let a=document.createElement("div");a.className="bp-settings-row";let c=document.createElement("div");c.className="bp-settings-row-info";let p=document.createElement("div");p.className="bp-settings-row-title",p.textContent="Browser session";let l=document.createElement("div");l.className="bp-settings-row-detail",l.textContent="Sign out and revoke this browser's session cookie.",c.append(p,l);let h=document.createElement("button");h.type="button",h.className="primary stop",h.textContent=u("agy.signout","Sign out"),h.setAttribute("data-testid","logout-btn"),h.addEventListener("click",()=>{h.disabled=!0,this.cb.onLogout().catch(()=>{l.setAttribute("role","alert"),l.className="bp-settings-row-detail bp-bad",l.textContent=u("web.logout.failed","Could not confirm sign-out. Try again."),h.disabled=!1})}),a.append(c,h),e.appendChild(a)}if(!i)return;let s=document.createElement("div");if(s.className="bp-settings-subhead",s.textContent="Paired devices",e.appendChild(s),this.devicesLoading){let o=document.createElement("div");o.className="bp-settings-empty",o.textContent="Loading paired devices…",e.appendChild(o);return}if(this.devicesError){let o=document.createElement("div");o.className="bp-settings-notice bad";let a=document.createElement("div");a.className="bp-settings-row-detail",a.textContent=this.devicesError,o.appendChild(a),e.appendChild(o);return}let r=!t||t.has("Paired devices")?this.devicesRows:this.devicesRows.filter((o)=>t.has(o.title||o.head||""));if(r.length===0){let o=document.createElement("div");o.className="bp-settings-empty",o.textContent="No paired devices listed.",e.appendChild(o)}else for(let o of r){let a=document.createElement("div");a.className="bp-settings-row";let c=document.createElement("div");c.className="bp-settings-row-info";let p=document.createElement("div");p.className="bp-settings-row-title-wrap";let l=document.createElement("span");l.className="bp-settings-row-title",l.textContent=o.title||o.head||"",p.appendChild(l);let h=o.detail||o.text||"";if(h){let d=document.createElement("span"),m=h.toLowerCase();d.className="bp-status-pill "+(m.includes("this browser")?"accent":"neutral"),d.textContent=h,p.appendChild(d)}if(c.appendChild(p),a.appendChild(c),o.buttons?.length){let d=document.createElement("div");d.className="bp-set-btns";for(let m of o.buttons){let f=document.createElement("button");if(f.type="button",m.primary)f.className="primary";if(m.danger)f.className="primary stop";f.textContent=m.label||u("common.remove","Remove"),f.addEventListener("click",()=>{f.disabled=!0,this.cb.onDevicesAct(m.action,m.value).finally(()=>{this.refresh()})}),d.appendChild(f)}a.appendChild(d)}e.appendChild(a)}if(!t){let o=document.createElement("div");o.className="bp-settings-footnote",o.textContent="Pair new browsers or phones, configure Tailscale HTTPS forwarding, or revoke access in desktop or mobile Settings → Devices.",e.appendChild(o)}}renderRingPage(e){let t=document.createElement("section");if(t.className="bp-settings-section",t.setAttribute("data-testid","settings-ring"),!this.cb.onRingList||!(this.cb.hasRing?.()??!1)){let a=document.createElement("div");a.className="bp-settings-empty",a.textContent=u("web.ring.unavailable","This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app."),t.appendChild(a),e.appendChild(t);return}let n=document.createElement("form");n.className="bp-ring-search";let i=document.createElement("input");i.type="search",i.className="bp-ring-search-input",i.placeholder=u("ring.search.what.you.said","Search what you said"),i.setAttribute("aria-label",u("ring.search.what.you.said","Search what you said")),i.setAttribute("data-testid","ring-search"),i.value=this.ringDraft,i.addEventListener("input",()=>{this.ringDraft=i.value});let s=document.createElement("button");if(s.type="submit",s.className="primary",s.textContent=u("common.search","Search"),n.append(i,s),this.ringQuery){let a=document.createElement("button");a.type="button",a.className="bp-btn-ghost",a.textContent=u("ring.show.all","Show all"),a.addEventListener("click",()=>{this.ringDraft="",this.ringQuery="",this.loadRing()}),n.appendChild(a)}n.addEventListener("submit",(a)=>{a.preventDefault(),this.ringQuery=this.ringDraft.trim(),this.loadRing()}),t.appendChild(n);let r=document.createElement("div");r.className="bp-settings-notice bad"+(this.ringError?"":" bp-hidden"),r.setAttribute("data-testid","ring-error"),r.textContent=this.ringError,t.appendChild(r),this.ringErrorEl=r;let o=document.createElement("div");o.className="bp-ring-count",o.setAttribute("data-testid","ring-count"),o.textContent=this.ringCountLine(),t.appendChild(o),this.ringCountEl=o,this.ringRows.clear(),this.ringShownQuery=this.ringQuery;for(let a of this.ringList.notes)t.appendChild(this.renderRingNote(a));e.appendChild(t)}renderRingNote(e){let t=document.createElement("div");t.className="bp-ring-note"+(e.state==="failed"?" bad":""),t.setAttribute("data-testid",`ring-note-${e.id}`);let n=document.createElement("div");n.className="bp-ring-note-head";let i=document.createElement("span");i.className="bp-settings-row-title";let s=e.said>0?new Date(e.said*1000).toLocaleString(Mi(),{dateStyle:"medium",timeStyle:"short"}):"";i.textContent=[s,e.gesture].filter(Boolean).join(" · ");let r=document.createElement("span");n.append(i,r);let o=document.createElement("div"),a=document.createElement("div");a.className="bp-settings-row-detail";let c=[],p=document.createElement("div");p.className="bp-ring-acts";let l=Rs(e.play);if(l){let h=document.createElement("audio");h.className="bp-ring-audio",h.controls=!0,h.preload="none",h.src=l,h.setAttribute("data-testid",`ring-audio-${e.id}`),p.appendChild(h);for(let[d,m]of[["local",u("ring.hear.again.local","Hear again (local)")],["openai",u("ring.hear.again.openai","Hear again (OpenAI)")]]){let f=document.createElement("button");f.type="button",f.className="bp-btn-ghost",f.textContent=m,f.setAttribute("data-testid",`ring-hear-${d}-${e.id}`),c.push(f),f.addEventListener("click",()=>{this.hearRing(e.id,d)}),p.appendChild(f)}}if(e.thread&&this.cb.onOpenThread){let h=document.createElement("button");h.type="button",h.className="bp-btn-ghost",h.textContent=u("ring.what.happened","What happened"),h.addEventListener("click",()=>{this.close(),this.cb.onOpenThread?.(e.thread)}),p.appendChild(h)}if(t.append(n,o,a),p.childElementCount>0)t.appendChild(p);return this.ringRows.set(e.id,{state:r,words:o,meta:a,hear:c}),this.fillRingNote(e),t}renderHomePage(e){let t=this.cb.onGetHome?.()??null,n=document.createElement("section");if(n.className="bp-settings-section",n.setAttribute("data-testid","settings-home"),!t){let d=document.createElement("div");d.className="bp-settings-empty",d.textContent="Single-hub mode — this hub is running locally without linked home machines.",n.appendChild(d),e.appendChild(n);return}let i=document.createElement("div");i.className="bp-settings-row";let s=document.createElement("div");s.className="bp-settings-row-info";let r=document.createElement("div");r.className="bp-settings-row-title-wrap";let o=document.createElement("span");o.className="bp-settings-row-title",o.textContent=t.name||(t.kind==="boat"?"Boat":"This machine"),r.appendChild(o);let a=document.createElement("span");a.className="bp-status-pill neutral",a.textContent=t.kind==="local"?"This machine":t.kind==="boat"?"Boat":"Linked machine",r.appendChild(a);let c=document.createElement("span"),p="Online",l="ok";if(t.moving?.state==="moving")p="Moving",l="accent";else if(t.moving?.state==="failed")p="Move failed",l="bad";else if(!t.online)p="Away",l="warn";c.className=`bp-status-pill ${l}`,c.textContent=p,r.appendChild(c);let h=document.createElement("div");if(h.className="bp-settings-row-detail",t.moving?.state==="moving")h.textContent=t.moving.step?u("home.moving.step","Moving home to {to}: {step}").replace("{to}",t.moving.to).replace("{step}",t.moving.step):u("home.moving","Moving home to {to}…").replace("{to}",t.moving.to);else if(t.moving?.state==="failed")h.textContent=t.moving.note?u("home.move.failed.note","Home move failed: {note}").replace("{note}",t.moving.note):u("home.move.failed","Home move failed");else if(!t.online)h.textContent=t.queuedCount>0?u("home.away.queued","Home ({name}) is away · {n} queued").replace("{name}",t.name||"home").replace("{n}",String(t.queuedCount)):u("home.away","Home ({name}) is away").replace("{name}",t.name||"home");else h.textContent="Your active home hub is online and serving threads and bots.";if(s.append(r,h),i.appendChild(s),t.canMoveHere&&this.cb.onMoveHomeHere){let d=document.createElement("button");d.type="button",d.className="primary",d.textContent=u("home.move.here","Make this machine the home"),d.setAttribute("data-testid","home-move-here-btn"),d.addEventListener("click",()=>{d.disabled=!0,this.cb.onMoveHomeHere?.().finally(()=>{this.refresh()})}),i.appendChild(d)}n.appendChild(i),e.appendChild(n)}}function xe(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n)i.textContent=n;return i}function _t(e,t,n=!1){let i=xe("button",n?"primary":"bp-btn-ghost",e);return i.type="button",i.addEventListener("click",t),i}function ei(e){return xe("pre","bp-context-code",e)}function uo(e){return xe("span",`bp-context-badge ${e==="Native"||e==="Enabled"?"active":e==="Untrusted"||e==="Invalid"?"warn":""}`,he(e))}function gn(e,t){let n=xe("div","bp-context-row");return n.append(xe("strong",void 0,e),uo(t)),n}class ti{fetchContext;dialog=xe("dialog","bp-context");title=xe("h2");cwd=xe("div","bp-context-path");tabs=xe("div","bp-context-tabs");body=xe("div","bp-context-body");notice=xe("p","bp-context-notice");current;thread="";requestId=0;tab=0;busy=!1;constructor(e,t){this.fetchContext=t;let n=xe("div","bp-context-head"),i=xe("div");i.append(this.title,this.cwd),this.title.id="bp-context-title",this.dialog.setAttribute("aria-labelledby",this.title.id),this.notice.setAttribute("role","status"),n.append(i,_t(u("common.refresh","Refresh"),()=>{this.load()}),_t(u("common.close","Close"),()=>this.dialog.close())),this.dialog.append(n,this.tabs,this.notice,this.body),this.dialog.addEventListener("close",()=>{this.requestId++}),e.append(this.dialog)}open(e){if(this.thread=e,this.tab=0,this.current=void 0,this.busy=!1,this.title.textContent=u("thread.context.title","Context & Prompt"),this.cwd.textContent="",!this.dialog.open)this.dialog.showModal();this.render(),this.load()}async load(e){if(this.busy)return;let t=++this.requestId;this.busy=!0,this.notice.textContent=u("thread.context.reading","Reading thread context…"),this.render();try{let n=await this.fetchContext(this.thread,e);if(t!==this.requestId)return;this.current=n,this.cwd.textContent=n.cwd,this.notice.textContent=""}catch(n){if(t===this.requestId)this.notice.textContent=String(n)}finally{if(t===this.requestId)this.busy=!1,this.render()}}render(){let e=[u("thread.context.instructions","Instructions"),u("thread.context.system","System Prompt"),u("thread.context.skills","Skills"),u("thread.context.mcp","Project MCPs")];this.tabs.replaceChildren(...e.map((n,i)=>{let s=_t(n,()=>{this.tab=i,this.render(),this.body.scrollTop=0,this.tabs.children[i].focus()});return s.setAttribute("aria-pressed",String(i===this.tab)),s})),this.body.replaceChildren();let t=this.current;if(!t)return;switch(this.tab){case 0:this.instructions(t.instructions);break;case 1:this.prompt(t);break;case 2:this.skills(t.skills);break;case 3:this.mcps(t.mcp);break}}instructions(e){if(!e.length)this.body.append(xe("p","bp-dim",u("thread.context.none.instructions","No project instructions found.")));for(let t of e){let n=xe("details","bp-context-card"),i=xe("summary");if(i.append(gn(t.path,t.status),xe("small","bp-dim",u("thread.context.size","{bytes} B · ≈{tokens} tokens",{bytes:t.bytes,tokens:t.estimated_tokens}))),n.append(i,ei(t.preview)),t.note)n.append(xe("small","bp-dim",t.note));this.body.append(n)}}prompt(e){let t=xe("div","bp-context-row"),n=_t(u("thread.context.copy","Copy prompt"),()=>{navigator.clipboard.writeText(e.prompt).then(()=>{this.notice.textContent=u("thread.context.copied","Prompt copied.")}).catch((i)=>{this.notice.textContent=String(i)})});t.append(xe("p","bp-dim",u("thread.context.native.note","Backplane’s launch prompt. Native files are loaded by the provider.")),n),this.body.append(t);for(let[i,s]of[[u("thread.context.base","Backplane"),e.sections.base],[u("thread.context.injected.label","Injected project instructions"),e.sections.instructions],[u("thread.context.index","Available skills index"),e.sections.skills]])if(s)this.body.append(xe("h3",void 0,i),ei(s))}skills(e){for(let t of["Project","User","Bundled"]){let n=e.filter((i)=>i.scope===t);if(!n.length)continue;this.body.append(xe("h3",void 0,he(t)));for(let i of n){let s=xe("article","bp-context-card");s.append(gn(i.name,i.status),xe("p",void 0,i.description),xe("small","bp-context-path",[i.source,i.provider,i.model].filter(Boolean).join(" · ")),xe("small","bp-context-path",i.path)),this.body.append(s)}}}mcps(e){if(!e.length)this.body.append(xe("p","bp-dim",u("thread.context.none.mcp","No project MCP configurations found.")));for(let t of e){let n=xe("article","bp-context-card");n.append(gn(t.path,t.state));for(let s of t.servers){let r=s.url||[s.command,...s.args].map((o)=>JSON.stringify(o)).join(" ");if(n.append(gn(s.name,s.status),ei(r)),s.cwd)n.append(xe("small","bp-context-path",s.cwd))}if(t.error)n.append(xe("p","bp-warn",t.error));let i=t.state==="Untrusted"?"trust":t.state==="Enabled"?"disable":t.state==="Disabled"?"enable":"";if(i){let s=i==="trust"?u("thread.context.trust","Trust and enable"):i==="disable"?u("thread.context.disable","Disable"):u("thread.context.enable","Enable"),r=_t(s,()=>{this.load({action:i,path:t.path,sha256:t.sha256})},i==="trust");r.disabled=this.busy;let o=xe("div","bp-context-actions");o.append(r),n.append(o)}this.body.append(n)}}}var yt="chats";function Js(e){return e.filter((t)=>t.id&&t.id!==yt&&t.id!=="scratch"&&!t.id.includes("~")).slice().sort((t,n)=>(t.title||t.id).toLowerCase().localeCompare((n.title||n.id).toLowerCase()))}function mo(e,t){if(e.settled)return!1;if(e.state==="done"||e.state==="stopped")return!1;if(!t)return!0;let n=e.working??0,i=Boolean(e.monitoring),s=Boolean(Kn(e.need))||e.word==="needs";return(n>0||i)&&e.state!=="paused"||s}function bo(e){if(e.wake)return{icon:"◷",label:"Snoozed",tone:"dim"};let t=(e.label??"").trim(),n=(e.tone??"").trim();if(t){let s=t.toLowerCase();return{icon:s==="approve"||s==="sign in"?"!":s==="input"?"?":s==="failed"||s==="stopped"?"×":s==="working"||s==="running"?"▸":s==="waiting"?"◌":s==="done"?"✓":"•",label:t,tone:n==="bad"?s==="failed"||s==="stopped"?"bad-out":"bad":n==="run"?"run":n==="wait"?"wait":n==="ok"?"ok":"dim"}}let i=e.word||"";if(i==="needs"){if(e.want==="approval")return{icon:"!",label:"Approve",tone:"bad"};if(e.want==="sign-in")return{icon:"!",label:"Sign in",tone:"bad"};return{icon:"?",label:"Input",tone:"bad"}}if(i==="failed"||e.status==="failed"||e.state==="fail")return{icon:"×",label:"Failed",tone:"bad-out"};if(i==="cut"||i==="interrupted")return{icon:"×",label:"Stopped",tone:"bad-out"};if(i==="running"||e.status==="active"||e.status==="working"||e.state==="run")return{icon:"▸",label:"Working",tone:"run"};if(i==="monitoring"||i==="limit"||e.status==="waiting")return{icon:"◌",label:"Waiting",tone:"wait"};if(i==="done"||e.status==="finished")return{icon:"✓",label:"Done",tone:"ok"};return null}var _s="http://www.w3.org/2000/svg";function pt(e,t=14,n=""){let i=document.createElementNS(_s,"svg");if(i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("width",String(t)),i.setAttribute("height",String(t)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.75"),i.setAttribute("stroke-linecap","square"),i.setAttribute("stroke-linejoin","miter"),i.setAttribute("aria-hidden","true"),n)i.classList.add(...n.split(" "));for(let s of e){let r=document.createElementNS(_s,"path");r.setAttribute("d",s),i.appendChild(r)}return i}function zs(){return pt(["M3 6h6l2 2h10v11H3z"],14,"bp-folder-icon")}function qs(e=14,t="bp-folder-icon bp-hw-icon"){return pt(["M3 3h18v18H3z","M9 3v6h6","M9 21v-6","M15 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","M9 15a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"],e,t)}function go(e=13){return pt(["M6 6h12v12H6z","M9 2v4","M15 2v4","M9 18v4","M15 18v4","M2 9h4","M2 15h4","M18 9h4","M18 15h4"],e)}function fo(e=15){return pt(["M4 10V4l4 3h8l4-3v6l-2 9H6z","M9 13h1","M14 13h1","M11 16h2"],e,"bp-cat-glyph")}function vo(e=11){return pt(["M4 12l5 5 11-11"],e)}function wo(e=13){return pt(["M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4z"],e)}function yo(e=11){return pt(["M2 9V5a2 2 0 0 1 2-2h4l2 3h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2","M2 13h10","M9 16l3-3-3-3"],e)}function Eo(){return typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||"")?"⌥⇧N":"Alt+Shift+N"}function Co(e=11){return pt(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 6v6l4 2"],e)}function ko(e=11){return pt(["M12 17v5","M8 4h8l-1 5 3 3v2H6v-2l3-3z"],e,"bp-pin-icon")}function Ks(e){if(!e)return"";let t=e<10000000000?e*1000:e,n=Math.max(0,Math.floor((Date.now()-t)/1000));if(n<60)return"now";if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400)return`${Math.floor(n/3600)}h`;return`${Math.floor(n/86400)}d`}function xo(e){let t=e.replace(/^@/,"").trim();if(!t)return"?";let n=t.split(/[\s_-]+/).filter(Boolean);if(n.length>=2)return(n[0][0]+n[1][0]).toUpperCase();return t.slice(0,2).toUpperCase()}function ni(e){if(e==="wait"||e==="error")return"bp-mood-wait";if(e==="work"||e==="talk")return"bp-mood-work";return"bp-mood-idle"}function Qe(e){let t=e.lastIndexOf("|");return t>=0?e.slice(t+1):e}class ii{el;hostLabel;homeBanner;crewEl;filterInput;listEl;connEl;filterText="";allFilter="all";snoozeMenuRowId="";collapsedProjects=new Set;addShown=!1;sections=null;projects=[];selectedProjectId="";threads=[];bots=[];rooms=[];selectedThreadId="";cb;needErr=new Map;needBusy=new Set;constructor(e,t){this.el=e,this.cb=t;let n=document.createElement("div");n.className="bp-side-host";let i=document.createElement("div");i.className="bp-side-host-left",this.hostLabel=document.createElement("span"),this.hostLabel.textContent="This computer";let s=document.createElement("span");s.className="bp-dim",s.textContent="›",i.append(this.hostLabel,s);let r=document.createElement("button");r.type="button",r.className="icon bp-side-collapse",r.textContent="‹",r.title="Collapse sidebar",r.setAttribute("aria-label","Collapse sidebar"),r.setAttribute("data-testid","sidebar-collapse"),r.addEventListener("click",()=>this.cb.onCollapseSidebar?.()),n.append(i,r);let o=document.createElement("div");o.className="bp-side-head",this.filterInput=document.createElement("input"),this.filterInput.type="search",this.filterInput.className="bp-input bp-side-search";let a=u("sidebar.search.projects","Search projects, threads…");this.filterInput.placeholder=a,this.filterInput.setAttribute("aria-label",a),this.filterInput.setAttribute("data-testid","sidebar-filter"),this.filterInput.addEventListener("input",()=>{this.filterText=this.filterInput.value.trim().toLowerCase(),this.render()});let c=document.createElement("button");c.type="button",c.className="icon bp-side-add",c.textContent="+",c.title=u("thread.new","New thread"),c.setAttribute("aria-label",u("thread.new","New thread")),c.setAttribute("data-testid","sidebar-new-thread"),c.addEventListener("click",()=>{let d=this.firstProjectId();if(d)this.cb.onNewThread(d)});let p=document.createElement("button");p.type="button",p.className="icon bp-side-add bp-side-new-chat",p.appendChild(wo(13));let l=`${u("chats.new.noproject","New chat (no project)")} (${Eo()})`;p.title=l,p.setAttribute("aria-label",u("chats.new.noproject","New chat (no project)")),p.setAttribute("data-testid","sidebar-new-chat"),p.addEventListener("click",()=>this.cb.onNewChat?.()),o.append(this.filterInput,p,c),this.homeBanner=document.createElement("div"),this.homeBanner.className="bp-side-home bp-hidden",this.homeBanner.setAttribute("data-testid","home-away-banner"),this.homeBanner.style.padding="6px 10px",this.homeBanner.style.fontSize="11px",this.homeBanner.style.borderBottom="1px solid var(--line, #2a2a2a)",this.crewEl=document.createElement("div"),this.crewEl.className="bp-crew-band bp-hidden",this.crewEl.setAttribute("data-testid","sidebar-crew"),this.listEl=document.createElement("div"),this.listEl.className="bp-side-list",this.listEl.setAttribute("data-testid","sidebar-list");let h=document.createElement("div");h.className="bp-side-footer",this.connEl=document.createElement("span"),this.connEl.className="bp-conn-status",this.connEl.textContent="Connecting…",this.connEl.setAttribute("data-testid","conn-status"),h.appendChild(this.connEl),this.el.append(n,o,this.homeBanner,this.crewEl,this.listEl,h)}setHome(e){if(!e){this.homeBanner.classList.add("bp-hidden"),this.homeBanner.textContent="";return}let t="",n=!1;if(e.moving?.state==="moving")t=e.moving.step?u("home.moving.step","Moving home to {to}: {step}").replace("{to}",e.moving.to).replace("{step}",e.moving.step):u("home.moving","Moving home to {to}…").replace("{to}",e.moving.to);else if(e.moving?.state==="failed")t=e.moving.note?u("home.move.failed.note","Home move failed: {note}").replace("{note}",e.moving.note):u("home.move.failed","Home move failed"),n=!0;else if(!e.online){let i=e.name||"home",s="";if(e.awaySince&&e.awaySince>0){let r=new Date(e.awaySince);s=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`}if(s&&e.queuedCount>0)t=u("home.away.since.queued","Home ({name}) is away since {time} · {n} queued").replace("{name}",i).replace("{time}",s).replace("{n}",String(e.queuedCount));else if(s)t=u("home.away.since","Home ({name}) is away since {time}").replace("{name}",i).replace("{time}",s);else if(e.queuedCount>0)t=u("home.away.queued","Home ({name}) is away · {n} queued").replace("{name}",i).replace("{n}",String(e.queuedCount));else t=u("home.away","Home ({name}) is away").replace("{name}",i)}if(!t)this.homeBanner.classList.add("bp-hidden"),this.homeBanner.textContent="";else this.homeBanner.textContent=t,this.homeBanner.className=n?"bp-side-home bp-bad":"bp-side-home bp-dim",this.homeBanner.classList.remove("bp-hidden")}setHostName(e){this.hostLabel.textContent=e||"This computer"}setConnStatus(e,t){this.connEl.textContent=e,this.connEl.className=`bp-conn-status ${t}`.trim()}setData(e,t,n,i){this.projects=e,this.threads=t,this.bots=n,this.rooms=i,this.render()}setSections(e,t,n){this.sections=e,this.bots=t,this.rooms=n,this.render()}setSelected(e){this.selectedThreadId=e,this.render()}setSelectedProject(e){if(this.selectedProjectId===e)return;this.selectedProjectId=e,this.render()}makeFoldChevron(e,t){let n=document.createElement("button");n.type="button",n.className="bp-proj-chev"+(e?" folded":""),n.textContent=e?"▸":"▾";let i=e?u("web.home.unfold","Show threads"):u("web.home.fold","Hide threads");return n.title=i,n.setAttribute("aria-label",i),n.setAttribute("aria-expanded",e?"false":"true"),n.setAttribute("data-testid",`project-fold-${t}`),n}focusFilter(){this.filterInput.focus()}firstProjectId(){if(this.sections){for(let e of this.sections)if(e.kind==="projects"&&e.rows.length>0){let t=e.rows[0];if(t.id&&!t.off)return t.id}}return this.projects[0]?.id??""}refreshLocale(){let e=u("sidebar.search.projects","Search projects, threads…");this.filterInput.placeholder=e,this.filterInput.setAttribute("aria-label",e),this.render()}renderCrewBand(e){let t=this.bots.find((c)=>c.uber),n=this.bots.filter((c)=>!c.uber&&(!e||c.name.toLowerCase().includes(e))),i=this.rooms.filter((c)=>!e||c.name.toLowerCase().includes(e)),s=Boolean(t&&(!e||t.name.toLowerCase().includes(e))),r=n.length>0||Boolean(this.cb.onNewBot)&&!e,o=i.length>0||Boolean(this.cb.onNewRoom)&&!e;if(!s&&!r&&!o){this.crewEl.classList.add("bp-hidden"),this.crewEl.replaceChildren();return}let a=document.createDocumentFragment();if(s&&t){let c=document.createElement("button");c.type="button",c.className="bp-crew-uber"+(t.thread===this.selectedThreadId?" active":""),c.setAttribute("data-testid",`crew-uber-${t.id}`);let p=document.createElement("span");if(p.className=`bp-crew-uber-avatar ${ni(t.mood)}`,t.color)p.style.color=t.color;p.appendChild(fo(14));let l=document.createElement("span");l.className="bp-crew-uber-meta";let h=document.createElement("span");if(h.className="bp-crew-uber-name",h.textContent=t.name,l.appendChild(h),t.note){let d=document.createElement("span");d.className=`bp-crew-uber-note ${ni(t.mood)}`,d.textContent=t.note,l.appendChild(d)}if(c.append(p,l),t.mood==="wait"||t.mood==="error"){let d=document.createElement("span");d.className="bp-status-pill bp-pill-bad",d.textContent="? Input",c.appendChild(d)}c.addEventListener("click",()=>this.cb.onSelectBot(t)),a.appendChild(c)}if(r){let c=document.createElement("div");c.className="bp-crew-bots",c.setAttribute("data-testid","crew-bots");let p=document.createElement("span");p.className="bp-crew-lbl",p.textContent=u("tour.title.bots","Bots").toUpperCase(),c.appendChild(p);let l=document.createElement("div");l.className="bp-crew-bot-tiles";for(let h of n){let d=document.createElement("button");if(d.type="button",d.className=`bp-crew-bot-tile ${ni(h.mood)}`+(h.thread===this.selectedThreadId?" active":""),d.title=h.note?`@${h.name} — ${h.note}`:`@${h.name}`,d.setAttribute("aria-label",`@${h.name}`),d.setAttribute("data-testid",`crew-bot-${h.id}`),h.color)d.style.setProperty("--bot-c",h.color);let m=document.createElement("span");if(m.className="bp-crew-bot-init",m.textContent=xo(h.name),d.appendChild(m),h.mood==="wait"||h.mood==="error"){let f=document.createElement("span");f.className="bp-crew-bot-wait",d.appendChild(f)}d.addEventListener("click",()=>this.cb.onSelectBot(h)),l.appendChild(d)}if(this.cb.onNewBot&&!e){let h=document.createElement("button");h.type="button",h.className="bp-crew-bot-tile bp-crew-add",h.textContent="+",h.title=u("bots.new","New bot"),h.setAttribute("aria-label",u("bots.new","New bot")),h.setAttribute("data-testid","crew-new-bot"),h.addEventListener("click",()=>this.cb.onNewBot?.()),l.appendChild(h)}c.appendChild(l),a.appendChild(c)}if(o){let c=document.createElement("div");c.className="bp-crew-rooms",c.setAttribute("data-testid","crew-rooms");for(let p of i){let l=document.createElement("button");l.type="button",l.className="bp-crew-room-chip",l.setAttribute("data-testid",`crew-room-${p.id}`);let h=document.createElement("span");h.className="bp-dim",h.textContent="#";let d=document.createElement("span");if(d.textContent=p.name,l.append(h,d),p.members!==void 0&&p.members>0){let m=document.createElement("span");m.className="bp-crew-room-cnt",m.textContent=String(p.members),l.appendChild(m)}l.title=p.members?`#${p.name} (${p.members})`:`#${p.name}`,l.addEventListener("click",()=>this.cb.onSelectRoom?.(p)),c.appendChild(l)}if(this.cb.onNewRoom&&!e){let p=document.createElement("button");p.type="button",p.className="bp-crew-room-chip bp-crew-add",p.textContent="+",p.title=u("rooms.new","New room"),p.setAttribute("aria-label",u("rooms.new","New room")),p.setAttribute("data-testid","crew-new-room"),p.addEventListener("click",()=>this.cb.onNewRoom?.()),c.appendChild(p)}a.appendChild(c)}this.crewEl.classList.remove("bp-hidden"),this.crewEl.replaceChildren(a)}projectsHead(e){let t=document.createElement("div");if(t.className="bp-side-section-head",!this.cb.onAddProject||this.addShown)return t.textContent=e,t;this.addShown=!0,t.classList.add("bp-side-section-row");let n=document.createElement("span");n.textContent=e;let i=document.createElement("button");i.type="button",i.className="bp-side-sec-plus bp-side-sec-btn",i.textContent="+";let s=u("sidebar.add.project","Add project");return i.title=s,i.setAttribute("aria-label",s),i.setAttribute("data-testid","sidebar-add-project"),i.addEventListener("click",(r)=>{r.stopPropagation(),this.cb.onAddProject?.()}),t.append(n,i),t}renderStatusPill(e,t){let n=document.createElement("span");if(n.className=`bp-status-pill bp-pill-${e.tone}`,n.textContent=`${e.icon} ${e.label}`,t)n.title=t;return n}renderRowActions(e){if(e.off)return null;let t=Array.isArray(e.snooze)&&e.snooze.length>0&&Boolean(this.cb.onSnoozeRow),n=Boolean(e.wake)&&Boolean(this.cb.onSnoozeRow),i=e.kind==="swarm",s=Boolean(e.settle)&&(!i||Boolean(this.cb.onSettleSwarm)),r=Boolean(e.chat)&&Boolean(this.cb.onMoveToProject);if(!t&&!n&&!s&&!r)return null;let o=document.createElement("span");if(o.className="bp-row-acts",n&&e.wake){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-wake-btn",a.textContent=u("menu.wake","Wake"),a.title=u("menu.wake","Wake snoozed thread"),a.setAttribute("data-testid",`wake-row-${e.id}`),a.addEventListener("click",(c)=>{c.stopPropagation(),this.cb.onSnoozeRow?.(e.wake)}),o.appendChild(a)}if(t&&e.snooze){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-snooze-btn",a.title=u("menu.snooze","Snooze thread"),a.setAttribute("aria-label",u("menu.snooze","Snooze thread")),a.setAttribute("data-testid",`snooze-row-${e.id}`),a.appendChild(Co(11)),a.addEventListener("click",(c)=>{c.stopPropagation(),this.snoozeMenuRowId=this.snoozeMenuRowId===e.id?"":e.id,this.render()}),o.appendChild(a)}if(r){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-move-btn",a.title=u("chats.move","Move to project…"),a.setAttribute("aria-label",u("chats.move","Move to project…")),a.setAttribute("data-testid",`move-row-${e.id}`),a.appendChild(yo(11)),a.addEventListener("click",(c)=>{c.stopPropagation(),this.cb.onMoveToProject?.(Qe(e.id))}),o.appendChild(a)}if(s&&e.settle){let a=document.createElement("button");a.type="button",a.className="bp-row-act-btn bp-settle-btn",a.title=u("menu.settle","Settle"),a.setAttribute("aria-label",u("menu.settle","Settle")),a.setAttribute("data-testid",`settle-row-${e.id}`),a.appendChild(vo(11)),a.addEventListener("click",(c)=>{if(c.stopPropagation(),i)this.cb.onSettleSwarm?.(Qe(e.settle));else this.cb.onThreadAct(Qe(e.settle),"settle")}),o.appendChild(a)}return o}renderSectionThreadRow(e,t,n=!1){let i=document.createElement("div");i.className="bp-thread-row"+(n?" bp-inbox-row":"")+(!this.selectedProjectId&&(e.id===this.selectedThreadId||Qe(e.id)===this.selectedThreadId)?" active":"")+(e.off?" bp-dim":""),i.setAttribute("data-thread-id",e.id),i.setAttribute("data-testid",`thread-row-${e.id}`);let s=bo(e),r=this.renderRowActions(e);if(n){let l=document.createElement("div");l.className="bp-inbox-main";let h=document.createElement("div");h.className="bp-inbox-top";let d=document.createElement("div");if(d.className="bp-thread-title",d.textContent=e.title||"Untitled thread",h.appendChild(d),r)h.appendChild(r);let m=document.createElement("div");if(m.className="bp-inbox-meta",s)m.appendChild(this.renderStatusPill(s,e.say));if(e.project&&!e.chat){let f=document.createElement("span");f.className="bp-inbox-proj",f.textContent=e.project,m.appendChild(f)}if(e.ago){let f=document.createElement("span");if(f.className="bp-thread-age",f.textContent=e.ago,e.pinned)f.title=u("tools.pinned","Pinned");m.appendChild(f)}l.append(h,m),i.appendChild(l)}else{if(t){let h=document.createElement("span");h.className="bp-tree-branch",h.setAttribute("aria-hidden","true"),i.appendChild(h)}if(s)i.appendChild(this.renderStatusPill(s,e.say));let l=document.createElement("div");if(l.className="bp-thread-title",l.textContent=e.title||"Untitled thread",i.appendChild(l),r)i.appendChild(r);if(e.ago){let h=document.createElement("span");if(h.className="bp-thread-age",h.textContent=e.ago,e.pinned)h.title=u("tools.pinned","Pinned");i.appendChild(h)}}let o=e.nav||e.id;if(!e.off&&o&&!o.startsWith("@room:"))i.addEventListener("click",()=>this.cb.onSelectThread(Qe(o)));let a=this.snoozeMenuRowId===e.id&&Array.isArray(e.snooze)&&e.snooze.length>0,c=e.kind==="swarm"?Kn(e.need):null;if(!c&&!a)return i;let p=document.createElement("div");if(p.className="bp-need-wrap",p.appendChild(i),a&&e.snooze){let l=document.createElement("div");l.className="bp-snooze-bar"+(t?" nested":""),l.setAttribute("data-testid",`snooze-bar-${e.id}`);let h=document.createElement("span");h.className="bp-dim",h.textContent="Snooze:",l.appendChild(h);for(let d of e.snooze){let m=document.createElement("button");m.type="button",m.className="bp-snooze-opt",m.textContent=d.label,m.addEventListener("click",(f)=>{f.stopPropagation(),this.snoozeMenuRowId="",this.cb.onSnoozeRow?.(d.value),this.render()}),l.appendChild(m)}p.appendChild(l)}if(c){let l=document.createElement("div");l.className="bp-need"+(t?" nested":"")+(e.off?" bp-dim":""),l.setAttribute("data-testid",`need-${e.id}`);let h=document.createElement("span");h.className="bp-need-line",h.textContent=c.line,h.title=c.line,l.appendChild(h);for(let m of c.actions){if(!mn(m,Boolean(this.cb.hasRoomView)))continue;let f=document.createElement("button");f.type="button",f.className="bp-need-btn",f.textContent=m.label,f.setAttribute("data-testid",`need-${m.act}-${e.id}`),f.disabled=Boolean(e.off)||this.needBusy.has(e.id)||!this.cb.onNeedAct,f.addEventListener("click",(b)=>{b.stopPropagation();let v=this.cb.onNeedAct;if(!v)return;this.needErr.delete(e.id),this.needBusy.add(e.id),this.render(),v(m).catch((w)=>{this.needErr.set(e.id,w instanceof Error?w.message:String(w))}).finally(()=>{this.needBusy.delete(e.id),this.render()})}),l.appendChild(f)}p.appendChild(l);let d=this.needErr.get(e.id);if(d){let m=document.createElement("div");m.className="bp-need-err"+(t?" nested":""),m.textContent=d,p.appendChild(m)}}return p}renderHubSections(e,t){let n=this.sections??[],i=new Set;for(let o of n)if(o.kind==="threads")for(let a of o.rows)i.add(a.id),i.add(Qe(a.id));else if(o.kind==="projects")for(let a of o.rows)for(let c of a.threads??[])i.add(c.id),i.add(Qe(c.id));let s=this.selectedThreadId?this.threads.find((o)=>o.id===this.selectedThreadId)??null:null,r=!1;for(let o of n)if(o.kind==="projects"&&(o.rows.length>0||(o.count??0)>0))r=!0;for(let o of n){if(o.kind==="bub")continue;if(o.kind==="threads"){let a=Boolean(o.fold&&o.toggle),c=o.rows.filter((l)=>{if(!t)return!0;return`${l.title} ${l.project??""}`.toLowerCase().includes(t)});if(!a&&c.length===0)continue;if(a&&t&&c.length===0)continue;if(a&&!t&&(o.count??c.length)===0)continue;let p=document.createElement("section");if(p.className=`bp-side-section bp-side-inbox bp-sec-${o.id}`,p.setAttribute("data-section-id",o.id),a){let l=document.createElement("button");l.type="button",l.className="bp-side-section-head bp-side-section-toggle";let h=t?c.length:o.count??c.length,d=o.open||Boolean(t)?"▾":"▸";if(l.textContent=`${d} ${o.title.toUpperCase()} (${h})`,o.hint)l.title=o.hint;l.setAttribute("data-testid",`section-toggle-${o.id}`),l.addEventListener("click",()=>{if(o.toggle)this.cb.onToggleSection?.(o.toggle)}),p.appendChild(l)}else{let l=document.createElement("div");if(l.className="bp-side-section-head"+(o.id==="needs"?" bp-head-needs":o.id==="running"?" bp-head-running":""),o.id===yt&&this.cb.onNewChat){l.classList.add("bp-side-section-row");let h=document.createElement("span");h.textContent=`${u("chats.title",o.title).toUpperCase()} ${c.length}`;let d=document.createElement("button");d.type="button",d.className="bp-side-sec-plus bp-side-sec-btn",d.textContent="+",d.title=u("chats.new.noproject","New chat (no project)"),d.setAttribute("aria-label",d.title),d.setAttribute("data-testid","section-new-chat"),d.addEventListener("click",(m)=>{m.stopPropagation(),this.cb.onNewChat?.()}),l.append(h,d)}else l.textContent=`${o.title.toUpperCase()} ${c.length}`;p.appendChild(l)}if(!a||Boolean(o.open)||Boolean(t))for(let l of c)p.appendChild(this.renderSectionThreadRow(l,!1,!0));e.appendChild(p);continue}if(o.kind==="projects"){let a=o.rows,c=a.filter((d)=>{if(!t)return!0;if((d.title||d.id).toLowerCase().includes(t))return!0;if((d.threads??[]).some((m)=>m.title.toLowerCase().includes(t)))return!0;if((d.swarms??[]).some((m)=>m.title.toLowerCase().includes(t)))return!0;return!1}),p=Boolean(o.fold&&o.toggle);if(t&&c.length===0)continue;if(!p&&o.id!=="active"&&c.length===0)continue;let l=document.createElement("section");if(l.className=`bp-side-section bp-sec-${o.id}`,l.setAttribute("data-section-id",o.id),p){let d=document.createElement("button");d.type="button",d.className="bp-side-section-head bp-side-section-toggle";let m=t?c.length:o.count??c.length,f=o.open||Boolean(t)?"▾":"▸";if(d.textContent=`${f} ${o.title.toUpperCase()} (${m})`,o.hint)d.title=o.hint;d.setAttribute("data-testid",`section-toggle-${o.id}`),d.addEventListener("click",()=>{if(o.toggle)this.cb.onToggleSection?.(o.toggle)}),l.appendChild(d)}else l.appendChild(this.projectsHead(o.title.toUpperCase()));if(!p||Boolean(o.open)||Boolean(t)){if(o.id==="all"&&!t){let d=a.some((f)=>f.hasBoard||f.hasSchematic),m=a.some((f)=>!f.hasBoard&&!f.hasSchematic);if(d&&m){let f=document.createElement("div");f.className="bp-proj-filter",f.setAttribute("data-testid","all-projects-filter");let b=[{id:"all",label:"All"},{id:"hw",label:"Boards"},{id:"sw",label:"Code"}];for(let v of b){let w=document.createElement("button");w.type="button",w.className="bp-proj-filter-btn"+(this.allFilter===v.id?" active":""),w.textContent=v.label,w.addEventListener("click",()=>{this.allFilter=v.id,this.render()}),f.appendChild(w)}if(l.appendChild(f),this.allFilter==="hw")c=c.filter((v)=>v.hasBoard||v.hasSchematic);else if(this.allFilter==="sw")c=c.filter((v)=>!v.hasBoard&&!v.hasSchematic)}}if(o.id==="active"&&!r&&!t){let d=document.createElement("div");d.className="bp-side-empty",d.textContent="No projects yet.",l.appendChild(d)}for(let d of c){let m=document.createElement("div");if(m.className="bp-proj-group"+(d.off||o.id==="quiet"?" bp-dim":""),m.setAttribute("data-project-id",d.id),d.nav||d.key)m.setAttribute("data-project-key",d.nav||d.key||"");let f=document.createElement("div");f.className="bp-proj-head";let b=document.createElement("button");b.type="button",b.className="bp-proj-toggle";let w=Boolean(d.hasBoard||d.hasSchematic)?qs(14):zs();if(d.css)w.style.color=d.css;let E=document.createElement("span");E.className="bp-proj-name",E.textContent=d.title||d.id,b.append(w,E);let k=d.fold==="project-fold"&&Boolean(d.nav),L=()=>{if(k)this.cb.onToggleProjectFold?.(d.nav)};if(!d.off&&this.cb.canOpenProject?.())b.title=u("web.home.open","Open project home");if(b.setAttribute("data-testid",`project-open-${d.id}`),this.selectedProjectId&&Qe(d.id)===this.selectedProjectId)f.classList.add("active");b.addEventListener("click",()=>{if(d.off||!this.cb.onOpenProject?.(d.id))L()});let M=this.makeFoldChevron(Boolean(d.folded),d.id);if(k)M.addEventListener("click",(P)=>{P.stopPropagation(),L()});else M.disabled=!0;f.appendChild(M);let A=document.createElement("div");if(A.className="bp-proj-meta",(d.needsCount??0)>0){let P=document.createElement("span");P.className="bp-proj-badge-need",P.textContent=String(d.needsCount),P.title=`${d.needsCount} needing you`,A.appendChild(P)}if((d.running??0)>0){let P=document.createElement("span");P.className="bp-proj-badge-run",P.textContent=String(d.running),P.title=`${d.running} running`,A.appendChild(P)}if(d.pinned&&o.id!=="pinned")A.appendChild(ko(11));let B=document.createElement("div");if(B.className="bp-proj-acts",!d.off&&this.cb.onQuickOpenViewer){if(d.hasBoard){let P=document.createElement("button");P.type="button",P.className="bp-proj-quick",P.title=u("viewer.board","Open Board"),P.setAttribute("aria-label",`Open Board (${d.title})`),P.setAttribute("data-testid",`quick-board-${d.id}`),P.appendChild(qs(13,"")),P.addEventListener("click",(Y)=>{Y.stopPropagation(),this.cb.onQuickOpenViewer?.(Qe(d.id),"board")}),B.appendChild(P)}if(d.hasSchematic){let P=document.createElement("button");P.type="button",P.className="bp-proj-quick",P.title=u("viewer.schematic","Open Schematic"),P.setAttribute("aria-label",`Open Schematic (${d.title})`),P.setAttribute("data-testid",`quick-sch-${d.id}`),P.appendChild(go(13)),P.addEventListener("click",(Y)=>{Y.stopPropagation(),this.cb.onQuickOpenViewer?.(Qe(d.id),"schematic")}),B.appendChild(P)}}let T=document.createElement("button");if(T.type="button",T.className="icon bp-proj-add",T.title=u("thread.new","New thread"),T.textContent="+",T.setAttribute("data-testid",`new-thread-${d.id}`),d.off)T.disabled=!0;T.addEventListener("click",(P)=>{P.stopPropagation(),this.cb.onNewThread(Qe(d.id))}),B.appendChild(T),f.append(b,A,B),m.appendChild(f);let H=Boolean(t)&&(d.title||d.id).toLowerCase().includes(t),O=Boolean(d.folded&&!t);for(let P of d.swarms??[]){if(!mo(P,O))continue;if(t&&!H&&!P.title.toLowerCase().includes(t))continue;m.appendChild(this.renderSectionThreadRow(P,!0))}if(!O){for(let P of d.threads??[]){if(t&&!H&&!P.title.toLowerCase().includes(t))continue;m.appendChild(this.renderSectionThreadRow(P,!0))}if(s&&s.project===Qe(d.id)&&!i.has(s.id)&&(!t||H||s.title.toLowerCase().includes(t)))m.appendChild(this.renderSectionThreadRow({id:s.id,title:s.title,status:s.status,state:s.state,ago:Ks(s.updatedAt),pinned:s.pinned,nav:s.id},!0))}l.appendChild(m)}}e.appendChild(l)}}}render(){this.addShown=!1;let e=this.filterText;this.renderCrewBand(e);let t=document.createDocumentFragment();if(this.sections!==null)this.renderHubSections(t,e);else{let n=new Map;for(let i of this.threads){if(i.archived||i.swarm)continue;if(e){if(!`${i.title} ${i.preview??""}`.toLowerCase().includes(e))continue}let s=n.get(i.project)??[];s.push(i),n.set(i.project,s)}if(t.appendChild(this.projectsHead("RECENT")),this.projects.length===0&&this.threads.length===0){let i=document.createElement("div");i.className="bp-side-empty",i.textContent="No projects yet.",t.appendChild(i)}for(let i of this.projects){let s=n.get(i.id)??[];if(e&&s.length===0&&!i.title.toLowerCase().includes(e))continue;let r=document.createElement("section");r.className="bp-proj-group",r.setAttribute("data-project-id",i.id);let o=document.createElement("div");o.className="bp-proj-head";let a=document.createElement("button");a.type="button",a.className="bp-proj-toggle";let c=this.collapsedProjects.has(i.id)&&!e,p=zs();if(i.css)p.style.color=i.css;let l=document.createElement("span");l.className="bp-proj-name",l.textContent=i.title||i.id,a.append(p,l);let h=()=>{if(this.collapsedProjects.has(i.id))this.collapsedProjects.delete(i.id);else this.collapsedProjects.add(i.id);this.render()};if(this.cb.canOpenProject?.())a.title=u("web.home.open","Open project home");if(a.setAttribute("data-testid",`project-open-${i.id}`),this.selectedProjectId&&i.id===this.selectedProjectId)o.classList.add("active");a.addEventListener("click",()=>{if(!this.cb.onOpenProject?.(i.id))h()});let d=this.makeFoldChevron(c,i.id);d.addEventListener("click",(f)=>{f.stopPropagation(),h()}),o.appendChild(d);let m=document.createElement("button");if(m.type="button",m.className="icon bp-proj-add",m.title=u("thread.new","New thread"),m.textContent="+",m.setAttribute("data-testid",`new-thread-${i.id}`),m.addEventListener("click",(f)=>{f.stopPropagation(),this.cb.onNewThread(i.id)}),o.append(a,m),r.appendChild(o),!c)for(let f of s)r.appendChild(this.renderSectionThreadRow({id:f.id,title:f.title,status:f.status,state:f.state,ago:Ks(f.updatedAt),pinned:f.pinned,nav:f.id},!0));t.appendChild(r)}}this.listEl.replaceChildren(t)}}function Po(e){try{return new URL(e,window.location.origin).searchParams.get("s")||""}catch{return""}}function zt(e){if(!e)return;for(let t of e.getTracks())try{t.stop()}catch{}}function So(e,t){if(t===16000){let r=new Int16Array(e.length);for(let o=0;o0?c/p:0));s[r]=l<0?l*32768:l*32767}return s}class si{hub;cb;active=!1;starting=!1;sessionGen=0;activeGen=0;abortedGen=0;threadId="";sessionKey="";stream=null;audioCtx=null;processor=null;pendingPcm=[];postChain=Promise.resolve();stopDrain=Promise.resolve();mark=0;constructor(e,t){this.hub=e,this.cb=t}isRecording(){return this.active||this.starting}async toggle(){if(this.active||this.starting)await this.stop();else await this.start()}async start(){if(this.active||this.starting)return;let e=this.cb.getThreadId();if(!e)return;if(!navigator.mediaDevices?.getUserMedia){this.cb.showError("Microphone access is not available in this browser.");return}let t=++this.sessionGen;this.starting=!0,this.threadId=e,this.sessionKey="",this.pendingPcm=[],this.mark=this.cb.getCaret(),this.cb.setRecording(!0);let n;try{n=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{if(t===this.sessionGen)this.starting=!1,this.cb.setRecording(!1),this.cb.showError("Microphone permission denied.");return}if(t!==this.sessionGen||this.cb.getThreadId()!==e){zt(n);return}if(this.stream=n,await this.stopDrain,t!==this.sessionGen||this.cb.getThreadId()!==e){if(zt(n),this.stream===n)this.stream=null;return}try{let i=await this.hub.rpc("voice.start",{thread:e,draft:this.cb.getDraft(),caret:this.mark});if(t!==this.sessionGen||this.cb.getThreadId()!==e){if(zt(n),this.stream===n)this.stream=null;if(!this.active&&!this.starting)this.hub.rpc("voice.stop",{thread:e}).catch(()=>{});return}let s=i.session||(i.path?Po(i.path):"");if(!s)throw Error("Hub did not return a voice session.");this.sessionKey=s,this.activeGen=t,this.starting=!1,this.active=!0,this.startCapture(n,t)}catch(i){if(t===this.sessionGen)this.cleanupAudio(),this.starting=!1,this.active=!1,this.cb.setRecording(!1),this.cb.showError(i instanceof Error?i.message:"Could not start voice dictation.");else if(zt(n),this.stream===n)this.stream=null}}async stop(){if(!this.active&&!this.starting)return;let e=this.activeGen,t=this.active,n=this.threadId,i=this.sessionKey;this.sessionGen++,this.starting=!1,this.active=!1,this.sessionKey="",this.cb.setRecording(!1),this.cb.setLevel(0),this.cleanupAudio();let r=this.stopDrain.then(async()=>{if(t&&i){let o=new Int16Array(this.pendingPcm);this.pendingPcm=[],this.enqueuePost(i,new Uint8Array(o.buffer),!0,e),await this.postChain}else this.pendingPcm=[];if(t&&n)await this.hub.rpc("voice.stop",{thread:n}).catch(()=>{})});this.stopDrain=r,await r}cancel(){if(!this.active&&!this.starting)return;let e=this.active,t=this.threadId;if(this.abortedGen=Math.max(this.abortedGen,this.sessionGen),this.sessionGen++,this.starting=!1,this.active=!1,this.sessionKey="",this.pendingPcm=[],this.cb.setRecording(!1),this.cb.setLevel(0),this.cleanupAudio(),e&&t&&this.hub.getState()==="connected")this.hub.rpc("voice.stop",{thread:t}).catch(()=>{})}handleFrame(e){let t=String(e.ev??""),n=String(e.thread??"");if(n&&this.cb.getThreadId()&&n!==this.cb.getThreadId())return;if(t==="draft"&&typeof e.text==="string")this.cb.setDraft(e.text),this.mark=e.text.length;else if(t==="edit"){let i=this.cb.getDraft(),s=Number(e.del??0),r=String(e.ins??""),o=Math.max(0,Math.min(i.length,this.mark)),a=Math.max(0,o-s),c=i.slice(0,a)+r+i.slice(o);this.mark=a+r.length,this.cb.setDraft(c)}else if(t==="level")this.cb.setLevel(Math.max(0,Math.min(100,Number(e.v??0))));else if(t==="view"){let i=e.view;if(i&&i.on===!1&&(this.active||this.starting))this.stop()}}startCapture(e,t){let i=new(window.AudioContext||window.webkitAudioContext),s=i.createMediaStreamSource(e),r=i.createScriptProcessor(4096,1,1);r.onaudioprocess=(o)=>{if(!this.active||t!==this.sessionGen||!this.sessionKey)return;let a=So(o.inputBuffer.getChannelData(0),i.sampleRate);for(let c=0;c=3200){let c=new Int16Array(this.pendingPcm.splice(0,3200));this.enqueuePost(this.sessionKey,new Uint8Array(c.buffer),!1,t)}},s.connect(r),r.connect(i.destination),this.audioCtx=i,this.processor=r}enqueuePost(e,t,n,i){this.postChain=this.postChain.then(async()=>{if(i<=this.abortedGen)return;try{let s={"Content-Type":"application/octet-stream","X-Voice-Session":e};if(n)s["X-Voice-End"]="1";let r=await fetch("/voice/in",{method:"POST",credentials:"same-origin",headers:s,body:t});if(!r.ok&&!n&&i===this.sessionGen&&this.active)this.failUpload(`Voice upload failed (${r.status}).`)}catch{if(!n&&i===this.sessionGen&&this.active)this.failUpload("Voice upload failed.")}})}failUpload(e){this.abortedGen=Math.max(this.abortedGen,this.sessionGen),this.sessionGen++,this.active=!1,this.starting=!1,this.sessionKey="",this.pendingPcm=[],this.cleanupAudio(),this.cb.setRecording(!1),this.cb.setLevel(0),this.cb.showError(e)}cleanupAudio(){if(this.processor)this.processor.disconnect(),this.processor.onaudioprocess=null,this.processor=null;if(this.audioCtx)this.audioCtx.close().catch(()=>{}),this.audioCtx=null;zt(this.stream),this.stream=null}}var Ys=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Xs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Qs=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Zs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Lo=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function qt(e,t){let n=new Int32Array(16),i=0;for(let a=0;a0){if(n[c]++,c>i)i=c}}let s=new Int32Array(16),r=0;for(let a=1;a<=15;a++)s[a]=r,r+=n[a];let o=new Int32Array(r);for(let a=0;a0)o[s[c]++]=a}return{counts:n,symbols:o,maxBits:i}}var Ao=(()=>{let e=new Uint8Array(288);return e.fill(8,0,144),e.fill(9,144,256),e.fill(7,256,280),e.fill(8,280,288),qt(e,288)})(),No=(()=>{let e=new Uint8Array(32);return e.fill(5),qt(e,32)})();class ri{win=new Uint8Array(32768);winPos=0;feed(e,t=16777216){let n=0,i=0,s=0,r=(h)=>{while(s=e.length)throw Error("truncated deflate frame");i|=e[n++]<>>=h,s-=h,d},o=(h)=>{let d=0,m=0,f=0;for(let b=1;b<=h.maxBits;b++){d|=r(1);let v=h.counts[b];if(d-v{let d=c+h;if(d>t)throw Error("inflated frame exceeds limit");if(d<=a.length)return;let m=a.length;while(m{p(1),a[c++]=h,this.win[this.winPos]=h,this.winPos=this.winPos+1&32767};while(n0){if(n>=e.length&&s<3)break;let h=r(1),d=r(2);if(d===0){if(i=0,s=0,n+4>e.length)throw Error("truncated stored block");let m=e[n]|e[n+1]<<8,f=e[n+2]|e[n+3]<<8;if(n+=4,(m^65535)!==f)throw Error("invalid stored block length");if(n+m>e.length)throw Error("truncated stored payload");p(m);for(let b=0;b=e.length)break}else if(d===1||d===2){let m=Ao,f=No;if(d===2){let b=r(5)+257,v=r(5)+1,w=r(4)+4,E=new Uint8Array(19);for(let B=0;BL)throw Error("code length overflow");for(let O=0;OL)throw Error("code length overflow");A+=T}else if(B===18){let T=r(7)+11;if(A+T>L)throw Error("code length overflow");A+=T}else throw Error("invalid code length symbol")}m=qt(M,b),f=qt(M.subarray(b),v)}while(!0){let b=o(m);if(b<256)l(b);else if(b===256)break;else{let v=b-257;if(v>=Ys.length)throw Error("invalid length symbol");let w=Ys[v]+(Xs[v]?r(Xs[v]):0),E=o(f);if(E>=Qs.length)throw Error("invalid distance symbol");let k=Qs[E]+(Zs[E]?r(Zs[E]):0);p(w);let L=this.winPos-k&32767;for(let M=0;M{this.stateListeners.delete(e)}}onFrame(e){return this.frameListeners.add(e),()=>{this.frameListeners.delete(e)}}onBinary(e){return this.binaryListeners.add(e),()=>{this.binaryListeners.delete(e)}}rpc(e,t={},n=20000){return new Promise((i,s)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s(Error("Not connected to hub"));return}let r=this.nextId++,o=window.setTimeout(()=>{this.pending.delete(r),s(Error(`RPC timeout: ${e}`))},n);this.pending.set(r,{resolve:i,reject:s,timer:o}),this.ws.send(JSON.stringify({id:r,m:e,p:t}))})}setState(e){this.state=e;for(let t of this.stateListeners)t(e,this.hello)}rejectAllPending(e){for(let[,t]of this.pending)window.clearTimeout(t.timer),t.reject(Error(e));this.pending.clear()}openSocket(){if(this.closed)return;this.inflater=null;let t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?data=1&enc=json&z=deflate`,n=new WebSocket(t);n.binaryType="arraybuffer",this.ws=n;let i=(s)=>{let r;try{r=JSON.parse(s)}catch{return}if(r.t==="hub.restarting")this.restarting={reason:String(r.reason??""),build:String(r.build??""),text:String(r.text??""),at:Date.now()};if(r.t==="hello")this.restarting=null,this.hello=r,this.features=new Set(this.hello.features??[]),this.inflater=this.hello.z==="deflate"?new ri:null,this.reconnectDelay=500,this.setState("connected");else if(r.t==="reply"&&typeof r.id==="number"){let o=this.pending.get(r.id);if(o)if(this.pending.delete(r.id),window.clearTimeout(o.timer),r.ok)o.resolve(r.result??{});else{let a=r.error,c=typeof a==="string"?a:a&&typeof a==="object"&&("message"in a)?String(a.message):"Request failed",p=typeof r.errorCode==="string"?r.errorCode:void 0,l=typeof r.machine==="string"?r.machine:void 0,h=typeof r.thread==="string"?r.thread:void 0;o.reject(new Kt(c,{code:p,machine:l,thread:h}))}return}for(let o of this.frameListeners)o(r)};n.addEventListener("message",(s)=>{if(s.data instanceof ArrayBuffer){if(this.inflater){let r;try{r=this.inflater.feed(new Uint8Array(s.data))}catch{n.close();return}if(r.length>0&&r[0]===123)i(this.textDecoder.decode(r));else{let o=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);for(let a of this.binaryListeners)a(o)}return}for(let r of this.binaryListeners)r(s.data);return}if(typeof s.data!=="string")return;i(s.data)}),n.addEventListener("close",(s)=>{if(this.ws===n)this.ws=null;if(this.rejectAllPending("Connection closed"),this.closed)return;if(s.code===4001||s.code===4401||s.code===1008){this.handleRevoked();return}this.probeSessionOrReconnect()}),n.addEventListener("error",()=>{})}async probeSessionOrReconnect(){try{let t=await fetch("/",{method:"GET",credentials:"same-origin",cache:"no-store"});if(t.status===401||t.status===403){this.handleRevoked();return}if(t.ok){if((await t.text()).includes('id="pair-root"')){this.handleRevoked();return}}}catch{}this.setState("reconnecting");let e=this.reconnectDelay;this.reconnectDelay=Math.min(8000,Math.round(this.reconnectDelay*1.6)),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.openSocket()},e)}handleRevoked(){this.closed=!0,this.setState("revoked"),window.location.replace("/")}}var Mo=new TextDecoder;function er(e){return e.length>7&&e[0]>=160&&e[0]<=183&&e[1]===1&&e[2]===100&&e[3]===112&&e[4]===108&&e[5]===111&&e[6]===116}function tr(e){let t=0,n=0;function i(o){if(o<=23)return o;if(o===24){if(t>=e.length)return null;return e[t++]}if(o===25){if(t+2>e.length)return null;let a=e[t]<<8|e[t+1];return t+=2,a}if(o===26){if(t+4>e.length)return null;let a=(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0;return t+=4,a}return null}function s(o){if(n++,o>32||n>400000||t>=e.length)return null;let a=e[t++],c=a>>5,p=i(a&31);if(p===null)return null;switch(c){case 0:return p;case 1:return-1-p;case 2:{if(t+p>e.length)return null;let l=e.subarray(t,t+p);return t+=p,l}case 3:{if(t+p>e.length)return null;let l=Mo.decode(e.subarray(t,t+p));return t+=p,l}case 4:{if(p>e.length)return null;let l=Array(p);for(let h=0;h=this.b.length)return this.ok=!1,0;let n=this.b[this.i++],i=7*t;if(i>=28&&(n&240)!==0)return this.ok=!1,0;if(e=(e|(n&127)<>>0,n<128)return e}return this.ok=!1,0}nextI32(){let e=this.nextU32();return e>>>1^-(e&1)}}function ir(e){let t=0xcbf29ce484222325n,n=0x100000001b3n,i=0xffffffffffffffffn;for(let s=0;stypeof e[b]==="number"?e[b]:v,n=t("l",0),i=t("c",0),s=t("a",255)/255,r=t("m",1),o=t("w",0),a=o/2,c=r===0&&o!==0,p=e.d instanceof Uint8Array?e.d:new Uint8Array(0),l=new nr(p),h=[],d=[],m=0,f=0;while(l.more()){let b=l.nextU32(),v=h.length,w=1/0,E=1/0,k=-1/0,L=-1/0;if(r===2)m=m+l.nextI32()|0,f=f+l.nextI32()|0,h.push(m,f),w=k=m,E=L=f;else{let A=Math.min(l.nextU32(),1048576);for(let B=0;Bk)k=m;if(fL)L=f}}let M=(h.length-v)/2;if(M>0){let A=r===2||M===1?2:r===0?0:1,B=r===0?0:a;d.push({info:b,x0:w-B,y0:E-B,x1:k+B,y1:L+B,at:v,n:M,kind:A})}}return{layer:n,color:i,alpha:s,mode:r,r:a,own:c,pts:new Float32Array(h),pieces:d}}function sr(e,t,n){let i=(o)=>Array.isArray(o)&&o.length>=4?[Number(o[0])||0,Number(o[1])||0,Number(o[2])||0,Number(o[3])||0]:[0,0,0,0],s=Array.isArray(e.cs)?e.cs:[],r=[];for(let o=0;o=0&&a0){n.delete(a.h),n.set(a.h,c);while(n.size>1024){let p=n.keys().next().value;if(p!==void 0)n.delete(p);else break}}}}return{key:typeof e.key==="string"?e.key:"",fam:typeof e.fam==="string"?e.fam:"",base:typeof e.base==="string"?e.base:"",box:i(e.box),edge:i(e.edge),thick:typeof e.thick==="number"?e.thick:1600,note:typeof e.note==="string"?e.note:"",warn:typeof e.warn==="number"?e.warn!==0:!1,chunks:r}}function rr(e,t,n,i=!0){if(n.width<=0||n.height<=0||n.naturalWidth<=0||n.naturalHeight<=0)return null;let s=Math.min(n.width/n.naturalWidth,n.height/n.naturalHeight),r=n.naturalWidth*s,o=n.naturalHeight*s,a=n.left+(n.width-r)/2,c=i?n.top:n.top+(n.height-o)/2,p=(e-a)/r,l=(t-c)/o;if(p<0||p>1||l<0||l>1)return null;return{x:Math.max(0,Math.min(1000,Math.round(p*1000))),y:Math.max(0,Math.min(1000,Math.round(l*1000)))}}var or=[["Enter","Enter"],["Tab","Tab"],["Bksp","Backspace"],["Esc","Escape"],["↑","ArrowUp"],["↓","ArrowDown"],["←","ArrowLeft"],["→","ArrowRight"]];function ar(e){let t=e.trim();if(!t)return"";if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))return t;return`https://${t}`}class ai{tail=Promise.resolve();enqueue(e){let t=this.tail.then(e,e);return this.tail=t.catch(()=>{}),t}}function lr(e,t,n){let i=!0,s=!1,r=!1,o="",a=!1,c=!1,p=-1,l=null,h=new ai,d=document.createElement("div");d.className="bp-pane bp-browser-pane",d.setAttribute("data-testid","pane-browser");let m=document.createElement("div");m.className="bp-pane-bar bp-browser-nav";function f(ee,ge,C){let x=document.createElement("button");if(x.type="button",x.className="bp-v-btn",x.textContent=ee,x.setAttribute("data-testid",ge),C)x.title=C;return x}let b=f("←","browser-back","Back"),v=f("→","browser-forward","Forward"),w=f("↻","browser-reload","Reload"),E=document.createElement("form");E.className="bp-browser-url-form";let k=document.createElement("input");k.type="text",k.className="bp-browser-input",k.placeholder="https://…",k.autocomplete="off",k.spellcheck=!1,k.setAttribute("data-testid","browser-url");let L=f("Go","browser-go","Navigate");L.type="submit",E.append(k,L);let M=f("Take over","browser-takeover");M.classList.add("is-primary"),m.append(b,v,w,E,M);let A=document.createElement("div");A.className="bp-browser-drive-bar",A.hidden=!0;let B=document.createElement("div");B.className="bp-browser-keys-row";let T=document.createElement("input");T.type="text",T.className="bp-browser-input",T.placeholder="Type text or press Enter/Tab/Arrows…",T.autocomplete="off",T.spellcheck=!1,T.setAttribute("data-testid","browser-keys");let H=f("Send","browser-type-send");B.append(T,H);let O=document.createElement("div");O.className="bp-browser-quick-keys";for(let[ee,ge]of or){let C=f(ee,`browser-key-${ge}`);C.addEventListener("click",()=>te("press",{key:ge})),O.append(C)}A.append(B,O);let P=document.createElement("div");P.className="bp-browser-err",P.setAttribute("data-testid","browser-error"),P.hidden=!0;let Y=document.createElement("div");Y.className="bp-browser-stage",Y.setAttribute("data-testid","browser-stage");let re=document.createElement("img");re.className="bp-browser-img",re.alt="Hub browser screen",re.draggable=!1,re.hidden=!0,re.setAttribute("data-testid","browser-frame");let ie=document.createElement("div");ie.className="bp-pane-empty",ie.setAttribute("data-testid","browser-empty"),ie.textContent="Loading browser screen…",Y.append(re,ie);let ue=document.createElement("div");ue.className="bp-browser-hint",ue.textContent="You have the page: click to tap, scroll to wheel, type in the key box. Hand it back when done.",ue.hidden=!0,d.append(m,A,P,Y,ue),e.replaceChildren(d);function Pe(ee){P.textContent=ee,P.hidden=!ee}function Ce(){A.hidden=!s,ue.hidden=!s,M.textContent=s?"Hand back":"Take over",M.setAttribute("data-testid",s?"browser-handback":"browser-takeover"),M.classList.toggle("is-on",s),re.classList.toggle("is-driving",s)}function te(ee,ge={},C){h.enqueue(async()=>{if(!i)return;Pe("");try{if(await t.hub.rpc("browser",{thread:n,op:ee,...ge}),!i)return;C?.(),me()}catch(x){if(!i)return;Pe(x instanceof Error?x.message:String(x))}})}function oe(ee){te("toolbar",{command:ee},()=>{s=!0,Ce()})}b.addEventListener("click",()=>oe("back")),v.addEventListener("click",()=>oe("forward")),w.addEventListener("click",()=>oe("reload")),E.addEventListener("submit",(ee)=>{ee.preventDefault();let ge=ar(k.value);if(!ge)return;if(k.value=ge,!s)te("takeover",{},()=>{s=!0,Ce()});te("navigate",{url:ge},()=>{s=!0,Ce()})}),M.addEventListener("click",()=>{if(s)te("handback",{},()=>{s=!1,Ce()});else te("takeover",{},()=>{s=!0,Ce(),T.focus()})});function R(){let ee=T.value;if(!ee)return;T.value="",te("type",{text:ee})}H.addEventListener("click",R),T.addEventListener("keydown",(ee)=>{if(!s)return;if(ee.key==="Enter"){if(ee.preventDefault(),T.value)R();te("press",{key:"Enter"});return}if(ee.key==="Tab"||ee.key==="Escape"||ee.key==="ArrowUp"||ee.key==="ArrowDown"||ee.key==="ArrowLeft"||ee.key==="ArrowRight"||ee.key==="Backspace"&&T.value==="")ee.preventDefault(),te("press",{key:ee.key})}),re.addEventListener("click",(ee)=>{if(!s||!r)return;let ge=re.getBoundingClientRect(),C=rr(ee.clientX,ee.clientY,{left:ge.left,top:ge.top,width:ge.width,height:ge.height,naturalWidth:re.naturalWidth,naturalHeight:re.naturalHeight});if(!C)return;te("click",C)}),re.addEventListener("wheel",(ee)=>{if(!s||!r)return;ee.preventDefault();let ge=Math.round(ee.deltaX),C=Math.round(ee.deltaY);if(ge===0&&C===0)return;te("scroll",{dx:ge,dy:C})},{passive:!1});async function me(){if(!i)return;if(a){c=!0;return}a=!0;try{do{c=!1,l=new AbortController;let ee=await fetch(`/bots/${encodeURIComponent(n)}/screen.jpg`,{credentials:"same-origin",cache:"no-store",signal:l.signal});if(!i)return;if(ee.ok){let ge=await ee.blob();if(!i)return;let C=URL.createObjectURL(ge),x=o;if(o=C,re.src=C,re.hidden=!1,ie.hidden=!0,r=!0,x)URL.revokeObjectURL(x)}else if(!r)re.hidden=!0,ie.hidden=!1,ie.textContent="No browser page yet. An agent opens one when it needs the web."}while(i&&c)}catch{if(!i)return;if(!r)re.hidden=!0,ie.hidden=!1,ie.textContent="No browser page yet. An agent opens one when it needs the web."}finally{l=null,a=!1}}let de=t.hub.onFrame((ee)=>{if(!i)return;if(ee.t==="shot"&&ee.bot===n){if(typeof ee.n==="number"){if(ee.n===p)return;p=ee.n}me()}});return me(),{destroy(){if(i=!1,de(),l?.abort(),o)URL.revokeObjectURL(o),o=""}}}function U(e,t,n){let i=document.createElement(e);if(t)i.className=t;if(n!==void 0)i.textContent=n;return i}function fn(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function dr(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Bo(e){return["png","jpg","jpeg","gif","webp","svg","bmp","ico"].includes(e)}function cr(e){return["txt","md","markdown","json","toml","yaml","yml","xml","csv","tsv","rs","ts","tsx","js","mjs","cjs","jsx","css","html","htm","sh","bash","py","c","h","cc","cpp","hpp","go","java","kt","swift","rb","lua","sql","ini","cfg","conf","env","gitignore","lock","log","gbr","gtl","gbl","gts","gbs","gto","gbo","gm1","drl","pos","net","kicad_pro","kicad_prl","kicad_dru","kicad_sym","kicad_mod","kicad_wks"].includes(e)}function Io(e){let t=dr(e);if(t==="kicad_pcb")return"board";if(t==="kicad_sch")return"schematic";if(t==="step"||t==="stp"||t==="glb")return"mech";return null}function pr(e,t,n,i){let s=!0,r="",o="",a=U("div","bp-pane bp-files-pane");a.setAttribute("data-testid","pane-files");let c=U("div","bp-pane-bar"),p=U("div","bp-files-crumbs"),l=U("button","bp-v-btn","Refresh");l.type="button",l.addEventListener("click",()=>void v(r)),c.append(p,l);let h=U("div","bp-files-split"),d=U("div","bp-files-list");d.setAttribute("data-testid","files-list");let m=U("div","bp-files-preview");m.setAttribute("data-testid","files-preview"),m.append(U("div","bp-pane-empty","Select a file to preview")),h.append(d,m),a.append(c,h),e.replaceChildren(a);function f(){p.replaceChildren();let w=U("button","bp-crumb-btn","project");if(w.type="button",w.addEventListener("click",()=>void v("")),p.append(w),!r)return;let E=r.split("/").filter(Boolean),k="";for(let L of E){k=k?`${k}/${L}`:L;let M=k;p.append(U("span","bp-vh-sep","/"));let A=U("button","bp-crumb-btn",L);A.type="button",A.addEventListener("click",()=>void v(M)),p.append(A)}}async function b(w,E,k){o=w,m.replaceChildren();let L=U("div","bp-files-prev-head");L.append(U("span","bp-files-prev-name",w));let M=U("div","bp-files-prev-acts"),A=Io(E);if(A){let O=U("button","bp-v-btn is-primary",`Open in ${A}`);O.type="button",O.setAttribute("data-testid","files-open-viewer"),O.addEventListener("click",()=>i(A,w)),M.append(O)}let B=`/files/get?thread=${encodeURIComponent(n)}&path=${encodeURIComponent(w)}`,T=U("a","bp-v-btn","Download");T.href=B,T.download=E,M.append(T),L.append(M),m.append(L);let H=dr(E);if(Bo(H)){let O=U("div","bp-files-img-wrap"),P=document.createElement("img");P.className="bp-files-img",P.alt=E,P.src=B,O.append(P),m.append(O);return}if(k>524288&&!cr(H)){m.append(U("div","bp-pane-empty",`Binary file (${fn(k)}). Use Download to save.`));return}if(cr(H)||k<=65536){let O=U("div","bp-pane-empty","Loading…");m.append(O);try{let P=await fetch(B,{credentials:"same-origin"});if(!s||o!==w)return;if(!P.ok){O.textContent=`Could not load file (${P.status})`;return}if((P.headers.get("content-type")||"").startsWith("image/")){O.remove();let de=document.createElement("img");de.className="bp-files-img",de.alt=E,de.src=B,m.append(de);return}let re=262144,ie=[],ue=0,Pe=!1;if(P.body){let de=P.body.getReader();try{while(!0){let{done:ee,value:ge}=await de.read();if(ee||!ge)break;if(ue+ge.byteLength>re){let C=re-ue;if(C>0)ie.push(ge.subarray(0,C)),ue+=C;Pe=!0,await de.cancel();break}ie.push(ge),ue+=ge.byteLength}}finally{de.releaseLock()}}if(!s||o!==w)return;let Ce=new Uint8Array(ue),te=0;for(let de of ie)Ce.set(de,te),te+=de.byteLength;let oe=!1;for(let de=0;deL.dir===M.dir?L.name.localeCompare(M.name):L.dir?-1:1),d.replaceChildren(),w){let L=U("button","bp-file-row is-dir");L.type="button",L.append(U("span","bp-file-icon","↰"),U("span","bp-file-name",".."));let M=w.includes("/")?w.slice(0,w.lastIndexOf("/")):"";L.addEventListener("click",()=>void v(M)),d.append(L)}if(k.length===0){d.append(U("div","bp-pane-empty","Empty folder"));return}for(let L of k){let M=w?`${w}/${L.name}`:L.name,A=U("button","bp-file-row"+(L.dir?" is-dir":"")+(M===o?" is-sel":""));A.type="button",A.setAttribute("data-testid",`file-row-${L.name}`),A.append(U("span","bp-file-icon",L.dir?"▸":"·"),U("span","bp-file-name",L.name),U("span","bp-file-size",L.dir?"":fn(L.size))),A.addEventListener("click",()=>{if(L.dir)v(M);else d.querySelectorAll(".bp-file-row.is-sel").forEach((B)=>B.classList.remove("is-sel")),A.classList.add("is-sel"),b(M,L.name,L.size)}),d.append(A)}}catch(E){if(!s)return;d.replaceChildren(U("div","bp-pane-empty",E instanceof Error?E.message:String(E)))}}return v(""),{destroy(){s=!1}}}function hr(e,t,n){let i=!0,s=U("div","bp-pane bp-diff-pane");s.setAttribute("data-testid","pane-diff");let r=U("div","bp-pane-bar"),o=U("span","bp-diff-summary","Loading diff…"),a=U("button","bp-v-btn","Refresh");a.type="button",a.addEventListener("click",()=>void p()),r.append(o,a);let c=U("div","bp-diff-body");c.setAttribute("data-testid","diff-body"),s.append(r,c),e.replaceChildren(s);async function p(){o.textContent="Loading diff…",c.replaceChildren();try{let l=await t.hub.rpc("viewer.diff",{thread:n});if(!i)return;if(l?.nogit){o.textContent="Not a git repository",c.append(U("div","bp-pane-empty","This project is not a git repository."));return}let h=typeof l?.diff==="string"?l.diff:"";if(!h.trim()){o.textContent="Clean working tree",c.append(U("div","bp-pane-empty","No uncommitted changes."));return}let d=h.split(` +`),m=0,f=0,b=0,v=document.createDocumentFragment(),w=U("div","bp-diff-file");for(let E of d){if(E.startsWith("diff --git ")){if(w.childNodes.length>0)v.append(w);w=U("div","bp-diff-file"),m++;let k=E.match(/ b\/(.+)$/);w.append(U("div","bp-diff-file-head",k?k[1]:E));continue}if(E.startsWith("index ")||E.startsWith("--- ")||E.startsWith("+++ "))w.append(U("div","bp-diff-line is-meta",E));else if(E.startsWith("@@"))w.append(U("div","bp-diff-line is-hunk",E));else if(E.startsWith("+"))f++,w.append(U("div","bp-diff-line is-add",E));else if(E.startsWith("-"))b++,w.append(U("div","bp-diff-line is-del",E));else w.append(U("div","bp-diff-line",E))}if(w.childNodes.length>0)v.append(w);o.textContent=`${m||1} file${m===1?"":"s"} · +${f} -${b}`,c.append(v)}catch(l){if(!i)return;o.textContent="Diff unavailable",c.append(U("div","bp-pane-empty",l instanceof Error?l.message:String(l)))}}return p(),{destroy(){i=!1}}}function Ro(e,t){let n=t.rel||"",i=t.manifest||{},s=(p)=>`/files/get?thread=${encodeURIComponent(e)}&path=${encodeURIComponent(`${n}/${p}`)}`,r=(p)=>typeof p==="string"&&p!==""&&!p.startsWith("/")&&!p.split(/[\\/]/).includes(".."),o=(Array.isArray(i.drawings)?i.drawings:[]).filter((p)=>r(p?.file)),a=new Set(o.map((p)=>p.file)),c=o.map((p)=>({title:p.title||p.kind||p.file,file:p.file,url:s(p.file),drawing:!0}));for(let p of Array.isArray(i.files)?i.files:[])if(r(p)&&!a.has(p))c.push({title:p,file:p,url:s(p),drawing:!1});return c}function ur(e,t,n){let i=!0,s="checks",r=U("div","bp-pane bp-review-pane");r.setAttribute("data-testid","pane-review");let o=U("div","bp-pane-bar"),a=U("div","bp-review-tabs"),c=U("button","bp-v-btn is-on","Checks"),p=U("button","bp-v-btn","BOM"),l=U("button","bp-v-btn","Comments"),h=U("button","bp-v-btn","Release");h.setAttribute("data-testid","review-tab-release"),c.type=p.type=l.type=h.type="button",a.append(c,p,l,h);let d=U("button","bp-v-btn","Refresh");d.type="button",d.addEventListener("click",()=>void w()),o.append(a,d);let m=U("div","bp-review-body");m.setAttribute("data-testid","review-body"),r.append(o,m),e.replaceChildren(r);function f(E){s=E,c.classList.toggle("is-on",s==="checks"),p.classList.toggle("is-on",s==="bom"),l.classList.toggle("is-on",s==="comments"),h.classList.toggle("is-on",s==="release"),w()}c.addEventListener("click",()=>f("checks")),p.addEventListener("click",()=>f("bom")),l.addEventListener("click",()=>f("comments")),h.addEventListener("click",()=>f("release"));function b(E){let k=U("div","bp-review-md bp-review-release");k.setAttribute("data-testid","review-release");let L=E.manifest||{};k.append(U("h2","bp-review-h",E.tag||"Release")),k.append(U("p","bp-review-p",[L.commit?`Commit ${L.commit.slice(0,12)}`:"",L.date||""].filter(Boolean).join(" · ")));let M=Ro(n,E),A=(T,H)=>{if(H.length===0)return;k.append(U("h3","bp-review-h",T));let O=U("table","bp-review-table");for(let P of H){let Y=document.createElement("tr"),re=U("td",void 0,P.title);re.title=P.file;let ie=document.createElement("td"),ue=U("a","bp-v-btn","Download");ue.href=P.url,ue.download=P.file.split("/").pop()||P.file,ie.append(ue),Y.append(re,ie),O.append(Y)}k.append(O)};A("Drawings",M.filter((T)=>T.drawing));let B=Array.isArray(L.openFabNotes)?L.openFabNotes:[];if(B.length>0)k.append(U("div","bp-review-gate",`Open fabrication notes, not in the board (agree them with the fabricator): ${B.join(", ")}.`));if(A("Files",M.filter((T)=>!T.drawing)),E.rel){let T=U("a","bp-v-btn","Download all (.zip)");T.href=`/files/zip?thread=${encodeURIComponent(n)}&path=${encodeURIComponent(E.rel)}`,k.append(T)}return k}function v(E){let k=U("div","bp-review-md"),L=E.split(` +`),M=0;while(M{H.preventDefault();let O=B.value.trim();if(!O)return;T.disabled=!0,t.hub.rpc("review.comment",{thread:n,text:O}).then(()=>{B.value="",T.disabled=!1,w()},()=>{T.disabled=!1})}),m.append(A),M.length===0){m.append(U("div","bp-pane-empty","No review comments yet."));return}for(let H of M){let O=U("div","bp-review-comment"+(H.resolved?" is-resolved":"")),P=[H.by||"review",H.file,H.layer,H.item].filter(Boolean).join(" · ");O.append(U("div","bp-review-comment-meta",P),U("div","bp-review-comment-text",H.text)),m.append(O)}return}let E=await t.hub.rpc("review.page",{thread:n,page:s});if(!i)return;let k=E?.report||{};if(m.replaceChildren(),k.line||k.gate){let L=U("div","bp-review-gate",[k.gate,k.line].filter(Boolean).join(" · "));m.append(L)}if(k.err)m.append(U("div","bp-review-err",k.err));if(Array.isArray(k.tasks)&&k.tasks.length>0){let L=U("div","bp-review-tasks");k.tasks.forEach((M,A)=>{let B=U("label","bp-review-task"),T=document.createElement("input");T.type="checkbox",T.checked=!!(M.done??M.checked);let H=typeof M.index==="number"?M.index:A;T.addEventListener("change",()=>{t.hub.rpc("review.tick",{thread:n,index:H}).then(()=>void w(),()=>{})}),B.append(T,U("span",void 0,M.text||M.label||`Item ${A+1}`)),L.append(B)}),m.append(L)}if(s==="release"&&k.release&&k.release.manifest)m.append(b(k.release));else if(k.md&&k.md.trim())m.append(v(k.md));else if(!k.err&&(!k.tasks||k.tasks.length===0))m.append(U("div","bp-pane-empty",s==="release"?"No release yet. A release tags this design and makes its fabrication outputs and drawings in .backplane/releases.":`No ${s==="bom"?"BOM":"design checks"} report available.`))}catch(E){if(!i)return;m.replaceChildren(U("div","bp-pane-empty",E instanceof Error?E.message:String(E)))}}return w(),{destroy(){i=!1}}}function mr(e,t){let n=e>>>16&255,i=e>>>8&255,s=e&255;return t>=0.999?`rgb(${n},${i},${s})`:`rgba(${n},${i},${s},${t.toFixed(3)})`}class li{canvas;ctx;frame=null;masks={off:0,dim:0,lift:255};highlights=new Set;lightTheme=!1;cx=0;cy=0;scale=0.0001;fittedKey="";fitW=0;fitH=0;userMoved=!1;dirty=!1;rafId=0;pointers=new Map;dragStart=null;pinchStart=null;resizeObs;cbs;constructor(e,t={}){this.cbs=t,this.canvas=document.createElement("canvas"),this.canvas.className="bp-viewer-canvas",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.touchAction="none",e.appendChild(this.canvas);let n=this.canvas.getContext("2d");if(!n)throw Error("Canvas2D unavailable");this.ctx=n,this.resizeObs=new ResizeObserver(()=>this.scheduleDraw()),this.resizeObs.observe(this.canvas),this.canvas.addEventListener("pointerdown",this.onPointerDown),this.canvas.addEventListener("pointermove",this.onPointerMove),this.canvas.addEventListener("pointerup",this.onPointerUp),this.canvas.addEventListener("pointercancel",this.onPointerUp),this.canvas.addEventListener("wheel",this.onWheel,{passive:!1}),this.canvas.addEventListener("dblclick",this.onDblClick)}setTheme(e){if(this.lightTheme!==e)this.lightTheme=e,this.scheduleDraw()}setFrame(e){if(this.frame=e,e&&e.key!==this.fittedKey)this.fittedKey=e.key,this.fit();else this.scheduleDraw()}setLayers(e){this.masks=e,this.scheduleDraw()}setHighlights(e){this.highlights.clear();for(let[t,n]of e)this.highlights.add(`${t}:${n}`);this.scheduleDraw()}presentMask(){if(!this.frame)return 0;let e=0;for(let t of this.frame.chunks)if(t.layer<32)e=(e|1<>>0;return e>>>0}presentColors(){let e=new Map;if(!this.frame)return e;for(let t of this.frame.chunks)if(!e.has(t.layer))e.set(t.layer,t.color);return e}applyFit(e,t){if(!this.frame||e<10||t<10)return;let n=this.frame.box,i=Math.max(n[2]-n[0],1000),s=Math.max(n[3]-n[1],1000);this.cx=(n[0]+n[2])*0.5,this.cy=(n[1]+n[3])*0.5,this.scale=Math.min(e/i,t/s)*0.92,this.fitW=e,this.fitH=t,this.userMoved=!1}fit(){if(!this.frame)return;this.userMoved=!1,this.fitW=0,this.fitH=0;let e=this.canvas.getBoundingClientRect();if(e.width>=10&&e.height>=10)this.applyFit(e.width,e.height);this.scheduleDraw()}zoomToBoxMm(e){let t=e[0]*1000,n=e[1]*1000,i=e[2]*1000,s=e[3]*1000,r=Math.max(i-t,1000),o=Math.max(s-n,1000),a=this.canvas.getBoundingClientRect(),c=Math.max(a.width,200),p=Math.max(a.height,200);this.cx=(t+i)*0.5,this.cy=(n+s)*0.5,this.scale=Math.min(c/r,p/o)*0.85,this.userMoved=!0,this.scheduleDraw()}scheduleDraw(){if(this.dirty)return;this.dirty=!0,this.rafId=requestAnimationFrame(()=>{this.dirty=!1,this.rafId=0,this.draw()})}draw(){let e=this.canvas.getBoundingClientRect(),t=Math.max(1,Math.round(e.width)),n=Math.max(1,Math.round(e.height)),i=Math.min(window.devicePixelRatio||1,2),s=Math.round(t*i),r=Math.round(n*i);if(this.canvas.width!==s||this.canvas.height!==r)this.canvas.width=s,this.canvas.height=r;let o=this.ctx;o.setTransform(i,0,0,i,0,0),o.fillStyle=this.lightTheme?"#f5f4ef":"#08090b",o.fillRect(0,0,t,n);let a=this.frame;if(!a)return;if(!this.userMoved&&t>=10&&n>=10&&(Math.abs(this.fitW-t)>2||Math.abs(this.fitH-n)>2))this.applyFit(t,n);let c=t*0.5,p=n*0.5,l=this.scale,h=this.cx,d=this.cy,m=h-c/l,f=h+c/l,b=d-p/l,v=d+p/l,{off:w,dim:E,lift:k}=this.masks,L=[],M=[];for(let B=0;B>>T&1)===1)continue;if(T===k)M.push(B);else L.push(B)}let A=L.concat(M);o.lineCap="round",o.lineJoin="round";for(let B=0;B>>H.layer&1)===1,P=H.alpha*(O?0.25:1);if(P<=0.01)continue;this.drawChunk(o,H,P,m,b,f,v,h,d,l,c,p)}if(this.highlights.size>0){o.fillStyle=this.lightTheme?"rgba(245,244,239,0.72)":"rgba(8,9,11,0.72)",o.fillRect(0,0,t,n);let B=this.lightTheme?"rgba(27,29,33,0.77)":"rgba(217,221,228,0.77)";for(let T=0;Tr||v.y1o)continue;if(v.n<3)continue;let w=(d[v.at]-a)*p+l,E=(d[v.at+1]-c)*p+h;e.moveTo(w,E);for(let k=1;k0)e.fill()}else if(t.mode===2){let f=Math.max(0.75,t.r*p);e.fillStyle=m,e.beginPath();let b=0;for(let v=0;vr||w.y1o)continue;let E=(d[w.at]-a)*p+l,k=(d[w.at+1]-c)*p+h;e.moveTo(E+f,k),e.arc(E,k,f,0,Math.PI*2),b++}if(b>0)e.fill()}else{e.strokeStyle=m,e.lineWidth=Math.max(1,t.r*2*p),e.beginPath();let f=0;for(let b=0;br||v.y1o)continue;let w=(d[v.at]-a)*p+l,E=(d[v.at+1]-c)*p+h;if(v.n===1)e.moveTo(w,E),e.lineTo(w+0.01,E);else{e.moveTo(w,E);for(let k=1;k0)e.stroke()}}drawLitPieces(e,t,n,i,s,r,o,a,c,p,l,h,d){let m=t.pts,f=mr(t.color,t.alpha);for(let b=0;bo||v.y1a)continue;let w=(m[v.at]-c)*l+h,E=(m[v.at+1]-p)*l+d;if(v.kind===2){let k=Math.max(1.5,t.r*l);e.fillStyle=f,e.beginPath(),e.arc(w,E,k,0,Math.PI*2),e.fill(),e.strokeStyle=i,e.lineWidth=1.5,e.stroke()}else if(v.kind===0&&v.n>=3){e.fillStyle=f,e.beginPath(),e.moveTo(w,E);for(let k=1;k=0;l--){let h=n.chunks[l];if(h.layer<32&&(p>>>h.layer&1)===1)continue;for(let d=0;dm.x1+o||rm.y1+o)continue;let f=(m.x1-m.x0+1)*(m.y1-m.y0+1);if(f{if(this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.pointers.size===1)this.dragStart={x:e.clientX,y:e.clientY,cx:this.cx,cy:this.cy,moved:!1},this.pinchStart=null;else if(this.pointers.size===2){let[t,n]=Array.from(this.pointers.values());this.pinchStart={dist:Math.hypot(n.x-t.x,n.y-t.y)||1,midX:(t.x+n.x)*0.5,midY:(t.y+n.y)*0.5,scale:this.scale,cx:this.cx,cy:this.cy},this.dragStart=null}};onPointerMove=(e)=>{if(!this.pointers.has(e.pointerId))return;if(this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.pointers.size===2&&this.pinchStart){let[t,n]=Array.from(this.pointers.values()),i=Math.hypot(n.x-t.x,n.y-t.y)||1,s=(t.x+n.x)*0.5,r=(t.y+n.y)*0.5,o=i/this.pinchStart.dist,a=Math.max(0.0000001,Math.min(2,this.pinchStart.scale*o)),c=this.canvas.getBoundingClientRect(),p=this.pinchStart.midX-c.left-c.width*0.5,l=this.pinchStart.midY-c.top-c.height*0.5,h=s-c.left-c.width*0.5,d=r-c.top-c.height*0.5;this.scale=a,this.cx=this.pinchStart.cx+p/this.pinchStart.scale-h/a,this.cy=this.pinchStart.cy+l/this.pinchStart.scale-d/a,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw();return}if(this.dragStart&&this.pointers.size===1){let t=e.clientX-this.dragStart.x,n=e.clientY-this.dragStart.y;if(Math.hypot(t,n)>3)this.dragStart.moved=!0;if(this.dragStart.moved)this.cx=this.dragStart.cx-t/this.scale,this.cy=this.dragStart.cy-n/this.scale,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw()}};onPointerUp=(e)=>{let t=this.dragStart&&!this.dragStart.moved&&this.pointers.size===1;if(this.pointers.delete(e.pointerId),this.pointers.size<2)this.pinchStart=null;if(this.pointers.size===0)this.dragStart=null;if(t&&this.cbs.onPick){let n=this.canvas.getBoundingClientRect(),i=this.hitTest(e.clientX-n.left,e.clientY-n.top);this.cbs.onPick(i)}};onWheel=(e)=>{e.preventDefault();let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-t.width*0.5,i=e.clientY-t.top-t.height*0.5,s=e.deltaY<0?1.16:0.8620689655172414,r=Math.max(0.0000001,Math.min(2,this.scale*s));this.cx+=n/this.scale-n/r,this.cy+=i/this.scale-i/r,this.scale=r,this.userMoved=!0,this.cbs.onUserMove?.(),this.scheduleDraw()};onDblClick=()=>{this.fit()};destroy(){if(this.rafId)cancelAnimationFrame(this.rafId);this.resizeObs.disconnect(),this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("dblclick",this.onDblClick),this.canvas.remove()}}var br=[{id:"fit",label:"Fit"},{id:"iso",label:"Iso"},{id:"top",label:"Top"},{id:"bottom",label:"Bottom"},{id:"front",label:"Front"},{id:"right",label:"Right"},{id:"back",label:"Back"},{id:"left",label:"Left"}];function gr(e){switch(e){case"top":return{yaw:0,pitch:Math.PI*0.499};case"bottom":return{yaw:0,pitch:-Math.PI*0.499};case"front":return{yaw:0,pitch:0};case"right":return{yaw:Math.PI*0.5,pitch:0};case"back":return{yaw:Math.PI,pitch:0};case"left":return{yaw:-Math.PI*0.5,pitch:0};case"iso":case"fit":default:return{yaw:0.6,pitch:0.7}}}function ci(e,t,n,i){if(!e||!t||!n||!i)return!1;if(!e.startsWith(t))return!1;let s=e.slice(t.length).split(` +`),r=(s[0]||"").split("\t");if(r[0]!=="git"||r[2]!==n)return!1;let o=s[1]||r.slice(4).join("\t");if(!o)return!1;let a=o.replace(/\\/g,"/"),c=i.replace(/\\/g,"/");if(c.startsWith("/")||/^[A-Za-z]:\//.test(c))return a===c;return a===c||a.endsWith(`/${c}`)}class di{refs=[];index=-1;lastCommit="";highlightEdits=!1;playing=!1;setRefs(e){if(this.refs=e,this.index>=e.length)this.index=-1,this.highlightEdits=!1}isLive(){return this.index<0||this.index>=this.refs.length}activeRef(){return this.isLive()?null:this.refs[this.index]}step(e){if(this.refs.length===0)return!1;let t=this.index;if(e>0)this.index=Math.min(this.refs.length-1,this.index+1);else this.index=Math.max(-1,this.index-1);if(this.index===-1)this.playing=!1,this.highlightEdits=!1;else this.lastCommit=this.refs[this.index].commit,this.highlightEdits=!0;return this.index!==t}selectCommit(e){if(!e)return this.goLive();let t=this.refs.findIndex((i)=>i.commit===e);if(t<0)return!1;let n=this.index!==t||!this.highlightEdits;return this.index=t,this.lastCommit=e,this.highlightEdits=!0,n}goLive(){let e=this.index!==-1||this.playing||this.highlightEdits;return this.index=-1,this.playing=!1,this.highlightEdits=!1,e}toggleHighlight(){if(this.highlightEdits)return this.goLive(),!1;if(this.refs.length===0)return!1;let e=this.lastCommit?this.refs.findIndex((t)=>t.commit===this.lastCommit):0;return this.index=e>=0?e:0,this.lastCommit=this.refs[this.index].commit,this.highlightEdits=!0,!0}compareRequest(){let e=this.activeRef();if(!e||!this.highlightEdits)return null;return{commit:e.commit,bits:0}}}var jo=`#version 300 es precision highp float; out vec2 vUv; void main() { @@ -20,7 +20,7 @@ void main() { vUv = vec2(x * 0.5 + 0.5, 1.0 - (y * 0.5 + 0.5)); gl_Position = vec4(x, y, 0.0, 1.0); } -`,Na=`#version 300 es +`,Ho=`#version 300 es precision highp float; in vec2 vUv; uniform vec3 uBgTop; @@ -37,7 +37,7 @@ void main() { vec3 lin = mix(uBgTop, uBgBot, clamp(vUv.y, 0.0, 1.0)); outColor = vec4(linearToSrgb(clamp(lin, 0.0, 1.0)), 1.0); } -`,Ma=`#version 300 es +`,Do=`#version 300 es precision highp float; layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNrm; @@ -55,7 +55,7 @@ void main() { vCol = aCol; gl_Position = uMvp * vec4(aPos, 1.0); } -`,Ta=`#version 300 es +`,Fo=`#version 300 es precision highp float; in vec3 vPos; in vec3 vNrm; @@ -151,8 +151,8 @@ void main() { rgb = rgb / (vec3(1.0) + max(rgb - vec3(0.8), vec3(0.0)) * 0.28); outColor = vec4(linearToSrgb(clamp(rgb, 0.0, 1.0)), alpha * uFade); } -`;function Ke(e){let t=e/255;return t<=0.04045?t/12.92:Math.pow((t+0.055)/1.055,2.4)}var Ba=[Ke(77),Ke(83),Ke(94)],Ia=[Ke(53),Ke(58),Ke(67)],Ra=[Ke(245),Ke(246),Ke(248)],ja=[Ke(225),Ke(228),Ke(233)];function mr(e,t,n){let i=e.createShader(t);if(!i)throw Error("createShader failed");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){let s=e.getShaderInfoLog(i)||"shader compile error";throw e.deleteShader(i),Error(s)}return i}function br(e,t,n){let i=mr(e,e.VERTEX_SHADER,t),s=mr(e,e.FRAGMENT_SHADER,n),r=e.createProgram();if(!r)throw Error("createProgram failed");if(e.attachShader(r,i),e.attachShader(r,s),e.linkProgram(r),e.deleteShader(i),e.deleteShader(s),!e.getProgramParameter(r,e.LINK_STATUS)){let a=e.getProgramInfoLog(r)||"program link error";throw e.deleteProgram(r),Error(a)}return r}function Ha(e,t){let n=new Float32Array(16);for(let i=0;i<4;i++)for(let s=0;s<4;s++)n[i*4+s]=e[0+s]*t[i*4+0]+e[4+s]*t[i*4+1]+e[8+s]*t[i*4+2]+e[12+s]*t[i*4+3];return n}function Da(e,t,n,i){let s=1/Math.tan(e*0.5),r=1/(n-i),a=new Float32Array(16);return a[0]=s/t,a[5]=s,a[10]=(i+n)*r,a[11]=-1,a[14]=2*i*n*r,a}function gr(e){let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]}function fr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function li(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}class ci{canvas;gl=null;bgProg=null;bgVao=null;uBgTop=null;uBgBot=null;prog=null;uMvp=null;uEye=null;uRight=null;uUp=null;uFwd=null;uFade=null;worker=null;boardBatch=null;partBatches=[];activeKey="";lastMeshId="";nextJobId=1;partsTotal=0;partsDone=0;center=[0,0,0];target=[0,0,0];radius=50;dist=120;yaw=0.6;pitch=0.7;lightTheme=!1;dirty=!1;rafId=0;pointers=new Map;pinchDist=0;resizeObs;cbs;constructor(e,t={}){this.cbs=t,this.canvas=document.createElement("canvas"),this.canvas.className="bp-viewer-canvas",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.touchAction="none",e.appendChild(this.canvas);let n=this.canvas.getContext("webgl2",{antialias:!0,alpha:!1,preserveDrawingBuffer:!0});if(n)this.gl=n,this.bgProg=br(n,Aa,Na),this.bgVao=n.createVertexArray(),this.uBgTop=n.getUniformLocation(this.bgProg,"uBgTop"),this.uBgBot=n.getUniformLocation(this.bgProg,"uBgBot"),this.prog=br(n,Ma,Ta),this.uMvp=n.getUniformLocation(this.prog,"uMvp"),this.uEye=n.getUniformLocation(this.prog,"uEye"),this.uRight=n.getUniformLocation(this.prog,"uRight"),this.uUp=n.getUniformLocation(this.prog,"uUp"),this.uFwd=n.getUniformLocation(this.prog,"uFwd"),this.uFade=n.getUniformLocation(this.prog,"uFade"),n.enable(n.DEPTH_TEST),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);else this.cbs.onStatus?.("WebGL2 is unavailable in this browser");try{this.worker=new Worker("/assets/mesh-worker.js",{type:"module"}),this.worker.onmessage=(i)=>this.onWorkerMessage(i.data)}catch{this.cbs.onStatus?.("3D worker unavailable")}this.resizeObs=new ResizeObserver(()=>this.scheduleDraw()),this.resizeObs.observe(this.canvas),this.canvas.addEventListener("pointerdown",this.onPointerDown),this.canvas.addEventListener("pointermove",this.onPointerMove),this.canvas.addEventListener("pointerup",this.onPointerUp),this.canvas.addEventListener("pointercancel",this.onPointerUp),this.canvas.addEventListener("wheel",this.onWheel,{passive:!1}),this.canvas.addEventListener("dblclick",this.onDblClick),this.canvas.addEventListener("contextmenu",this.onContextMenu)}keptToken(){return this.activeKey&&this.lastMeshId?`${this.activeKey} ${this.lastMeshId}`:""}setTheme(e){if(this.lightTheme!==e)this.lightTheme=e,this.scheduleDraw()}handleFrame(e){let t=typeof e.key==="string"?e.key:"";if(!t)return;if(e.mesh instanceof Uint8Array&&typeof e.n==="number"&&!e.part){this.activeKey=t,this.lastMeshId=er(e.mesh),this.clearParts(),this.cbs.onStatus?.("Building 3D model…");let n=new Uint8Array(e.mesh),i=e.faces instanceof Uint8Array?new Uint8Array(e.faces):void 0,s=[n.buffer];if(i)s.push(i.buffer);this.worker?.postMessage({id:this.nextJobId++,kind:"solid",key:t,n:e.n,mesh:n,faces:i},s);return}if(e.parts&&typeof e.parts==="object"&&!Array.isArray(e.parts)&&!(e.parts instanceof Uint8Array)){if(this.activeKey&&t!==this.activeKey)return;if(this.activeKey=t,this.clearParts(),this.partsTotal=typeof e.parts.of==="number"?e.parts.of:0,this.partsDone=0,this.partsTotal>0)this.cbs.onStatus?.(`Loading parts 0/${this.partsTotal}…`);this.scheduleDraw();return}if(typeof e.part==="string"&&e.mesh instanceof Uint8Array&&e.at instanceof Uint8Array&&typeof e.n==="number"){if(this.activeKey&&t!==this.activeKey)return;let n=new Uint8Array(e.mesh),i=new Uint8Array(e.at),s=e.faces instanceof Uint8Array?new Uint8Array(e.faces):void 0,r=[n.buffer,i.buffer];if(s)r.push(s.buffer);this.worker?.postMessage({id:this.nextJobId++,kind:"part",key:t,partId:e.part,n:e.n,mesh:n,at:i,faces:s,refs:Array.isArray(e.refs)?e.refs:[],done:typeof e.done==="number"?e.done:0},r)}}onWorkerMessage(e){if(e.error){this.cbs.onStatus?.(e.error);return}if(e.key!==this.activeKey||!this.gl)return;if(e.kind==="solid")this.deleteBatch(this.boardBatch),this.boardBatch=this.uploadBatch(e.positions,e.normals,e.colors,0),this.center=[e.center[0],e.center[1],e.center[2]],this.target=[e.center[0],e.center[1],e.center[2]],this.radius=e.radius,this.fit(),this.cbs.onStatus?.(""),this.scheduleDraw();else if(e.kind==="part"){let t=this.uploadBatch(e.positions,e.normals,e.colors,performance.now());if(t)this.partBatches.push(t);if(this.partsDone=e.done||this.partsDone+1,this.partsTotal>0&&this.partsDone>>24===0)r++;else a++;let o=r>0?new Float32Array(r*9):null,c=r>0?new Float32Array(r*9):null,p=r>0?new Float32Array(r*12):null,l=a>0?new Float32Array(a*9):null,h=a>0?new Float32Array(a*9):null,d=a>0?new Float32Array(a*12):null,u=0,f=0;for(let y=0;y>>24&255,L=1-C/255,N=(w>>>16&255)/255,A=(w>>>8&255)/255,B=(w&255)/255,M=y*9;if(C===0&&o&&c&&p){let j=u*9;for(let x=0;x<9;x++)o[j+x]=e[M+x],c[j+x]=t[M+x];let O=u*12;for(let x=0;x<3;x++)p[O+x*4]=N,p[O+x*4+1]=A,p[O+x*4+2]=B,p[O+x*4+3]=1;u++}else if(l&&h&&d){let j=f*9;for(let x=0;x<9;x++)l[j+x]=e[M+x],h[j+x]=t[M+x];let O=f*12;for(let x=0;x<3;x++)d[O+x*4]=N,d[O+x*4+1]=A,d[O+x*4+2]=B,d[O+x*4+3]=L;f++}}let b=o&&c&&p?this.createSubBatch(o,c,p,r*3):null,v=l&&h&&d?this.createSubBatch(l,h,d,a*3):null;if(!b&&!v)return null;return{opaque:b,translucent:v,fadeStartMs:i}}deleteSubBatch(e){let t=this.gl;if(!t||!e)return;t.deleteVertexArray(e.vao),t.deleteBuffer(e.posBuf),t.deleteBuffer(e.nrmBuf),t.deleteBuffer(e.colBuf)}deleteBatch(e){if(!e)return;this.deleteSubBatch(e.opaque),this.deleteSubBatch(e.translucent)}clearParts(){for(let e of this.partBatches)this.deleteBatch(e);this.partBatches=[]}fit(){this.setView("fit")}setView(e){let t=35*Math.PI/180;this.dist=this.radius/Math.sin(t*0.5)*1.15,this.target=[this.center[0],this.center[1],this.center[2]];let{yaw:n,pitch:i}=ur(e);this.yaw=n,this.pitch=i,this.scheduleDraw()}snapPng(){return this.draw(performance.now()),new Promise((e)=>{this.canvas.toBlob((t)=>e(t),"image/png")})}scheduleDraw(){if(this.dirty)return;this.dirty=!0,this.rafId=requestAnimationFrame((e)=>{if(this.dirty=!1,this.rafId=0,this.draw(e))this.scheduleDraw()})}drawSubBatch(e){if(!e||!this.gl)return;this.gl.bindVertexArray(e.vao),this.gl.drawArrays(this.gl.TRIANGLES,0,e.vertCount)}draw(e){let t=this.gl;if(!t||!this.prog)return!1;let n=this.canvas.getBoundingClientRect(),i=Math.max(1,Math.round(n.width)),s=Math.max(1,Math.round(n.height)),r=Math.min(window.devicePixelRatio||1,2),a=Math.round(i*r),o=Math.round(s*r);if(this.canvas.width!==a||this.canvas.height!==o)this.canvas.width=a,this.canvas.height=o;if(t.viewport(0,0,a,o),!this.boardBatch&&this.partBatches.length===0)return!1;if(t.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT),this.bgProg&&this.bgVao){t.disable(t.DEPTH_TEST),t.disable(t.BLEND),t.depthMask(!1),t.useProgram(this.bgProg);let j=this.lightTheme?Ra:Ba,O=this.lightTheme?ja:Ia;t.uniform3f(this.uBgTop,j[0],j[1],j[2]),t.uniform3f(this.uBgBot,O[0],O[1],O[2]),t.bindVertexArray(this.bgVao),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindVertexArray(null)}let c=Math.cos(this.pitch),p=Math.sin(this.pitch),l=Math.cos(this.yaw),h=Math.sin(this.yaw),d=[this.target[0]+this.dist*c*h,this.target[1]-this.dist*c*l,this.target[2]+this.dist*p],u=gr([this.target[0]-d[0],this.target[1]-d[1],this.target[2]-d[2]]),f=Math.abs(u[2])>0.99?[0,1,0]:[0,0,1],b=gr(fr(u,f)),v=fr(b,u),y=new Float32Array([b[0],v[0],-u[0],0,b[1],v[1],-u[1],0,b[2],v[2],-u[2],0,-li(b,d),-li(v,d),li(u,d),1]),w=Math.max(0.05,this.dist*0.01),C=Math.max(this.dist*10,this.radius*20),L=Da(35*Math.PI/180,a/o,w,C),N=Ha(L,y);t.useProgram(this.prog),t.uniformMatrix4fv(this.uMvp,!1,N),t.uniform3f(this.uEye,d[0],d[1],d[2]),t.uniform3f(this.uRight,b[0],b[1],b[2]),t.uniform3f(this.uUp,v[0],v[1],v[2]),t.uniform3f(this.uFwd,u[0],u[1],u[2]);let A=!1,B=[],M=[];for(let j of this.partBatches){let O=e-j.fadeStartMs,x=j.fadeStartMs===0?1:Math.min(1,Math.max(0,O/300));if(x<1){if(A=!0,x>0)M.push({batch:j,fade:x})}else B.push(j)}if(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.disable(t.BLEND),t.uniform1f(this.uFade,1),this.boardBatch)this.drawSubBatch(this.boardBatch.opaque);for(let j of B)this.drawSubBatch(j.opaque);if(t.depthMask(!1),t.enable(t.BLEND),t.uniform1f(this.uFade,1),this.boardBatch)this.drawSubBatch(this.boardBatch.translucent);for(let j of B)this.drawSubBatch(j.translucent);for(let{batch:j,fade:O}of M)t.uniform1f(this.uFade,O),this.drawSubBatch(j.opaque),this.drawSubBatch(j.translucent);return t.depthMask(!0),t.bindVertexArray(null),A}onPointerDown=(e)=>{if(this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY,button:e.button,shift:e.shiftKey}),this.pointers.size===2){let[t,n]=Array.from(this.pointers.values());this.pinchDist=Math.hypot(n.x-t.x,n.y-t.y)||1}};onPointerMove=(e)=>{let t=this.pointers.get(e.pointerId);if(!t)return;let n=e.clientX-t.x,i=e.clientY-t.y;if(t.x=e.clientX,t.y=e.clientY,this.pointers.size===2){let[s,r]=Array.from(this.pointers.values()),a=Math.hypot(r.x-s.x,r.y-s.y)||1;if(this.pinchDist>0)this.dist=Math.max(this.radius*0.05,Math.min(this.radius*20,this.dist*(this.pinchDist/a)));this.pinchDist=a,this.cbs.onUserMove?.(),this.scheduleDraw();return}if(t.button===2||t.button===1||t.shift){let s=this.dist*0.0014,r=Math.cos(this.yaw),a=Math.sin(this.yaw);this.target[0]-=n*r*s,this.target[1]-=n*a*s,this.target[2]+=i*s}else this.yaw+=n*0.008,this.pitch=Math.max(-Math.PI*0.49,Math.min(Math.PI*0.49,this.pitch+i*0.008));this.cbs.onUserMove?.(),this.scheduleDraw()};onPointerUp=(e)=>{if(this.pointers.delete(e.pointerId),this.pointers.size<2)this.pinchDist=0};onWheel=(e)=>{e.preventDefault();let t=e.deltaY<0?0.8620689655172414:1.16;this.dist=Math.max(this.radius*0.05,Math.min(this.radius*20,this.dist*t)),this.cbs.onUserMove?.(),this.scheduleDraw()};onDblClick=()=>{this.fit()};onContextMenu=(e)=>{e.preventDefault()};destroy(){if(this.rafId)cancelAnimationFrame(this.rafId);if(this.resizeObs.disconnect(),this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("dblclick",this.onDblClick),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.deleteBatch(this.boardBatch),this.clearParts(),this.gl){if(this.bgVao)this.gl.deleteVertexArray(this.bgVao);if(this.bgProg)this.gl.deleteProgram(this.bgProg);if(this.prog)this.gl.deleteProgram(this.prog)}this.worker?.terminate(),this.canvas.remove()}}var vr=64,Fa=16777216;function $a(e,t){switch(e){case"board":case"3d":return t.board!==!1;case"schematic":return t.schematic!==!1;case"mech":return t.mech!==!1;case"gerbers":return t.gerbers!==!1;default:return!0}}function zt(e){if(!e)return"";let t=e.replace(/\\/g,"/").replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function yr(e){switch(e){case"board":return m("viewer.board","Board");case"schematic":return m("viewer.schematic","Schematic");case"3d":return m("viewer.solid","3D");case"gerbers":return m("gpui.gerbers","Gerbers");case"mech":return m("viewer.mech","Mech");case"files":return m("viewer.files","Files");case"diff":return m("viewer.diff","Diff");case"review":return m("viewer.review","Review");case"browser":return m("bots.tab.browser","Browser");case"terminal":return m("viewer.terminal","Terminal");default:return e?e.charAt(0).toUpperCase()+e.slice(1):""}}function di(e){return e==="board"||e==="schematic"||e==="gerbers"}function Oa(e){return e==="files"||e==="diff"||e==="review"||e==="browser"||e==="terminal"}function pi(e,t){let n=document.createElement("div");n.className="bp-vh";let i=document.createElement("div");i.className="bp-vh-title";let s=document.createElement("span");s.className="bp-vh-page";let r=document.createElement("span");r.className="bp-vh-sep",r.textContent="·",r.hidden=!0;let a=document.createElement("span");a.className="bp-vh-file",a.hidden=!0,i.append(s,r,a);let o=document.createElement("div");o.className="bp-vh-actions",n.append(i,o);let c=document.createElement("div");c.className="bp-solid-bar",c.setAttribute("data-testid","solid-presets-bar"),c.hidden=!0;let p=document.createElement("div");p.className="bp-v-banner",p.hidden=!0;let l=document.createElement("div");l.className="bp-v-stage-wrap";let h=document.createElement("div");h.className="bp-v-stage";let d=document.createElement("div");d.className="bp-v-overlay",d.hidden=!0;let u=document.createElement("div");u.className="bp-v-layers",u.hidden=!0;let f=document.createElement("div");f.className="bp-v-info",f.hidden=!0,l.append(h,d,u,f);let b=document.createElement("div");b.className="bp-history-bar",b.setAttribute("data-testid","viewer-history-bar"),b.hidden=!0,e.replaceChildren(n,c,p,l,b);let v="",y="",w=0,C=!1,L=new Set,N=[],A=0,B=new Map,M=new Map,j={},O=[],x="",Y="",se=!1,ne=!1,he=0,Se=!1,ke=0,ee="",re=0,R=null,ue=null,le=null,Q=null,ge=null,k=new oi,P=0,F=!1,I="",J="",ie="",Ee="";document.addEventListener("click",(V)=>{if(!F)return;if(V.target instanceof Node&&b.contains(V.target))return;F=!1,Ae()}),document.addEventListener("keydown",(V)=>{if(F&&V.key==="Escape")F=!1,Ae()});function D(){if(P)window.clearInterval(P),P=0;k.playing=!1}function te(){let V=y==="3d"||y==="mech";if(c.hidden=!V,!V)return;if(c.childElementCount>0)return;for(let _ of hr){let G=document.createElement("button");G.type="button",G.className="bp-v-btn",G.textContent=_.label,G.setAttribute("data-testid",`solid-view-${_.id}`),G.addEventListener("click",()=>{le?.setView(_.id)}),c.append(G)}let W=document.createElement("button");W.type="button",W.className="bp-v-btn",W.textContent="Snap view",W.setAttribute("data-testid","solid-snap"),W.addEventListener("click",()=>{if(!le)return;le.snapPng().then((_)=>{if(!_)return;let G=URL.createObjectURL(_),z=document.createElement("a");z.href=G;let ae=(De()||y||"view").replace(/[^a-zA-Z0-9._-]/g,"_");z.download=`${ae}-snap.png`,z.click(),setTimeout(()=>URL.revokeObjectURL(G),1000)})}),c.append(W)}async function Me(){if(!v||y!=="board"&&y!=="schematic")return;Ae();let V=k.compareRequest();if(!V){I="",J="",ie="",Ee="",await ct(!1);return}let W=`${y}|${V.commit}|${V.bits}|${Y}`;if(W===Ee&&L.size>0){He(k.highlightEdits?`Comparing against ${k.activeRef()?.label||V.commit.slice(0,7)} (edits highlighted)`:`Comparing against ${k.activeRef()?.label||V.commit.slice(0,7)}`,!1);return}let _=++w;L.clear(),B.clear(),ye(),C=!0,I="",J=V.commit,ie="",Ee=W;try{let G=Y||(y==="schematic"?j.sch:j.pcb)||"";if(!G){let xe=await t.hub.rpc("viewer.files",{thread:v});if(_!==w)return;j=xe||{},Fe(),G=(y==="schematic"?j.sch:j.pcb)||""}if(!G)throw Error(`Unable to resolve ${y} file path for compare`);let z=await t.hub.rpc("viewer.compare",{thread:v,kind:y,commit:V.commit,bits:V.bits,...Y?{path:Y}:{}});if(_!==w)return;let ae=typeof z?.root==="string"?z.root:"",K=y==="schematic"?"1":"0";I=ae?`${K}|${ae}|diff -`:`${K}|`,J=V.commit,ie=G.startsWith("/")||/^[A-Za-z]:[\\/]/.test(G)||!ae?G:`${ae.replace(/\/+$/,"")}/${G.replace(/^\/+/,"")}`,C=!1;let we=N;ye();for(let xe of we)if(xe.kind==="bin")Ze(xe.buf);else Je(xe.key,xe.none,xe.retryable,xe.big);He(k.highlightEdits?`Comparing against ${k.activeRef()?.label||V.commit.slice(0,7)} (edits highlighted)`:`Viewing snapshot: ${k.activeRef()?.label||V.commit.slice(0,7)}`,!1)}catch(G){if(_!==w)return;C=!1,I="",J="",ie="",Ee="",ye(),He(G instanceof Error?G.message:String(G),!0)}}function Ae(){let V=y==="board"||y==="schematic";if(b.hidden=!V,!V)return;let W=document.createElement("div");W.className="bp-history-group";let _=document.createElement("button");_.type="button",_.className="bp-v-btn",_.textContent="<",_.title="Older snapshot",_.disabled=k.refs.length===0||k.index>=k.refs.length-1,_.setAttribute("data-testid","history-prev"),_.addEventListener("click",()=>{if(D(),k.step(1))Me()});let G=document.createElement("button");G.type="button",G.className="bp-v-btn"+(k.playing?" is-on":""),G.textContent=k.playing?"⏸":"▶",G.title=k.playing?"Pause history":"Play history",G.disabled=k.refs.length===0,G.setAttribute("data-testid","history-play"),G.addEventListener("click",()=>{if(k.playing){D(),Ae();return}if(k.refs.length===0)return;if(k.playing=!0,k.isLive())k.index=k.refs.length-1,Me();else Ae();P=window.setInterval(()=>{if(!k.playing||y!=="board"&&y!=="schematic"){D(),Ae();return}if(k.step(-1))Me();else D(),Ae()},1400)});let z=document.createElement("button");z.type="button",z.className="bp-v-btn",z.textContent=">",z.title="Newer snapshot",z.disabled=k.isLive(),z.setAttribute("data-testid","history-next"),z.addEventListener("click",()=>{if(D(),k.step(-1))Me()});let ae=document.createElement("button");ae.type="button",ae.className="bp-v-btn"+(k.isLive()?" is-on":""),ae.textContent="Live",ae.setAttribute("data-testid","history-live"),ae.addEventListener("click",()=>{if(D(),k.goLive())He("",!1),Me()});let K=document.createElement("span");K.className="bp-history-label",K.setAttribute("data-testid","history-label");let we=k.activeRef();K.textContent=we?we.label||we.commit.slice(0,7):k.refs.length>0?`Live (${k.refs.length} saved)`:"Live",W.append(_,G,z,ae,K);let xe=document.createElement("div");xe.className="bp-history-group";let Ne=document.createElement("button");Ne.type="button",Ne.className="bp-v-btn"+(k.highlightEdits?" is-on":""),Ne.textContent="Highlight edits",Ne.disabled=k.refs.length===0,Ne.setAttribute("data-testid","history-highlight"),Ne.addEventListener("click",()=>{D(),k.toggleHighlight(),Me()});let $e=document.createElement("div");$e.className="bp-history-menu-wrap";let Re=document.createElement("button");if(Re.type="button",Re.className="bp-v-btn"+(F||!k.isLive()?" is-on":""),Re.disabled=k.refs.length===0,Re.setAttribute("data-testid","history-compare"),Re.setAttribute("aria-haspopup","menu"),Re.setAttribute("aria-expanded",String(F)),Re.textContent=we?`Compare: ${we.label||we.commit.slice(0,7)} ▾`:"Compare ▾",Re.addEventListener("click",(ve)=>{ve.stopPropagation(),F=!F,Ae()}),$e.append(Re),F&&k.refs.length>0){let ve=document.createElement("div");ve.className="bp-history-menu",ve.setAttribute("role","menu"),ve.setAttribute("data-testid","history-compare-menu");let Ue=(Oe,Mt,bn)=>{let et=document.createElement("button");et.type="button",et.className="bp-history-menu-item"+(bn?" is-active":""),et.setAttribute("role","menuitem"),et.setAttribute("data-commit",Mt),et.textContent=Oe,et.addEventListener("click",()=>{if(F=!1,D(),k.selectCommit(Mt)){if(k.isLive())He("",!1);Me()}else Ae()}),ve.append(et)};Ue("Live (working tree)","",k.isLive());for(let Oe of k.refs)Ue(Oe.label||Oe.commit.slice(0,7),Oe.commit,we?.commit===Oe.commit);$e.append(ve)}xe.append(Ne,$e),b.replaceChildren(W,xe)}async function Te(V){if(!V)return;try{let W=await t.hub.rpc("viewer.refs",{thread:V});if(V!==v)return;k.setRefs(Array.isArray(W?.refs)?W.refs:[]),Ae()}catch{if(V!==v)return;k.setRefs([]),Ae()}}function q(){return document.documentElement.classList.contains("light")}let fe=new MutationObserver(()=>{let V=q();ue?.setTheme(V),le?.setTheme(V),ge?.setTheme(V)});fe.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});function oe(V,W="",_=!1,G=""){if(V==="none"){d.hidden=!0,d.replaceChildren();return}d.hidden=!1,d.className=`bp-v-overlay is-${V}`;let z=document.createElement("div");z.className="bp-v-state-card";let ae=document.createElement("div");if(ae.className="bp-v-state-msg",ae.textContent=W,z.append(ae),_){let K=document.createElement("button");K.type="button",K.className="bp-v-btn is-primary",K.textContent=m("tools.retry","Retry"),K.addEventListener("click",()=>void ct(!0)),z.append(K)}if(G){let K=document.createElement("div");K.className="bp-v-state-msg",K.textContent=m("gpui.c.solid.big.next","Loading it may take a while and a lot of memory.");let we=document.createElement("button");we.type="button",we.className="bp-v-btn is-primary",we.textContent=m("gpui.c.solid.load.big","Load it anyway"),we.addEventListener("click",()=>{oe("loading",m("gpui.c.solid.loading.big","Loading it anyway…")),t.hub.rpc("kicad.big",{key:G}).catch(()=>oe("error",W,!1,G))}),z.append(K,we)}d.replaceChildren(z)}function He(V,W){p.textContent=V,p.hidden=!V,p.classList.toggle("is-warn",W)}function De(){if(Y)return zt(Y);if(y==="board"||y==="3d")return zt(j.pcb);if(y==="schematic")return zt(j.sch);if(y==="mech")return zt(x);return""}function Fe(){s.textContent=yr(y);let V=De();if(r.hidden=!V,a.hidden=!V,a.textContent=V,o.replaceChildren(),y==="mech"&&O.length>1){let _=document.createElement("select");_.className="bp-v-select",_.setAttribute("aria-label",m("viewer.mech","Mech"));for(let G of O){let z=document.createElement("option");z.value=G,z.textContent=zt(G),z.selected=G===x,_.append(z)}_.addEventListener("change",()=>{x=_.value,Fe(),ct(!1)}),o.append(_)}if(di(y)){let _=document.createElement("button");_.type="button",_.className="bp-v-btn"+(Se?" is-on":""),_.textContent=R?.layerHead||"Layers",_.setAttribute("data-testid","viewer-layers-btn"),_.addEventListener("click",()=>{if(Se=!Se,u.hidden=!Se,_.classList.toggle("is-on",Se),Se)Ge("","")}),o.append(_)}if(y==="board"||y==="schematic"||y==="3d"||y==="mech"||y==="gerbers"){let _=document.createElement("button");_.type="button",_.className="bp-v-btn",_.textContent="Fit",_.setAttribute("data-testid","viewer-fit-btn"),_.addEventListener("click",()=>{ue?.fit(),le?.fit()}),o.append(_)}if((y==="board"||y==="schematic")&&t.hub.hasFeature("follow")){let _=document.createElement("button");_.type="button",_.className="bp-v-btn"+(se&&!ne?" is-on":""),_.textContent=se?ne?m("gpui.follow.paused","Follow (paused)"):"Follow agent":"Follow agent",_.setAttribute("data-testid","viewer-follow-btn"),_.addEventListener("click",()=>void Jt()),o.append(_)}let W=document.createElement("button");W.type="button",W.className="bp-v-btn bp-v-close",W.textContent="✕",W.title=m("common.close","Close"),W.setAttribute("aria-label",m("common.close","Close")),W.setAttribute("data-testid","viewer-close-btn"),W.addEventListener("click",()=>t.closeViewer()),o.append(W)}function Be(){if(!R){u.replaceChildren();return}let V=document.createDocumentFragment(),W=document.createElement("div");W.className="bp-v-layers-head";let _=document.createElement("span");if(_.textContent=R.layerHead||"Layers",W.append(_),R.layerReset){let K=document.createElement("button");K.type="button",K.className="bp-v-btn",K.textContent="Reset",K.addEventListener("click",()=>void Ge("reset","")),W.append(K)}if(V.append(W),R.layerModes){let K=document.createElement("div");K.className="bp-v-layers-modes",["All","Dim","Only"].forEach((we,xe)=>{let Ne=document.createElement("button");Ne.type="button",Ne.className="bp-v-btn"+(R?.layerMode===xe?" is-on":""),Ne.textContent=we,Ne.addEventListener("click",()=>void Ge("mode",String(xe))),K.append(Ne)}),V.append(K)}let G=ue?.presentColors()??new Map,z=(R.layerList||[]).concat(R.layerMarks||[]),ae=document.createElement("div");ae.className="bp-v-layers-list";for(let K of z){let we=G.get(K.layer);if(we===void 0)continue;let xe=document.createElement("div");xe.className="bp-v-layer-row"+(K.active?" is-focus":"");let Ne=document.createElement("input");Ne.type="checkbox",Ne.checked=K.on!==!1,Ne.addEventListener("change",()=>void Ge("toggle",String(K.layer)));let $e=document.createElement("span");$e.className="bp-v-layer-swatch";let Re=we>>>16&255,ve=we>>>8&255,Ue=we&255;$e.style.background=K.on!==!1?`rgb(${Re},${ve},${Ue})`:`rgba(${Re},${ve},${Ue},0.2)`;let Oe=document.createElement("button");Oe.type="button",Oe.className="bp-v-layer-name",Oe.textContent=K.name,Oe.addEventListener("click",()=>void Ge("pick",String(K.layer))),xe.append(Ne,$e,Oe),ae.append(xe)}V.append(ae),u.replaceChildren(V)}async function Ge(V,W){if(!di(y))return;let _=w;try{let G=await t.hub.rpc("viewer.layers",{kind:y,present:re,off:ke,focus:ee,...V?{action:V,value:W}:{}});if(_!==w||!G)return;ke=Number(G.own)||0,ee=typeof G.focus==="string"?G.focus:"",R=G;let z={off:Number(G.off)||0,dim:Number(G.dim)||0,lift:typeof G.lift==="number"?G.lift:255};if(ue?.setLayers(z),Fe(),Se)Be()}catch{}}async function _e(){if(!se||ne||!v||!t.hub.hasFeature("follow"))return;ne=!0,Fe();try{await t.hub.rpc("viewer.follow",{thread:v,action:"pause"})}catch{}}async function Jt(){if(!v||!t.hub.hasFeature("follow"))return;let V=!se?"on":ne?"resume":"off";try{let W=await t.hub.rpc("viewer.follow",{thread:v,action:V});if(se=!!W.on,ne=!!W.paused,Fe(),W.on&&!W.paused&&W.focus&&Array.isArray(W.focus.box)&&W.focus.box.length===4&&(W.seq||0)>he)he=W.seq||he,ue?.zoomToBoxMm([W.focus.box[0],W.focus.box[1],W.focus.box[2],W.focus.box[3]])}catch{}}function st(){f.hidden=!0,f.replaceChildren(),ue?.setHighlights([])}function Yt(V){let W=V.split(";").filter(Boolean),_=W.shift()||V,G=[],z="",ae="";for(let $e of W){if($e.startsWith("g="))continue;let Re=$e.indexOf("=");if(Re>0){let ve=$e.slice(0,Re),Ue=$e.slice(Re+1);if((ve==="ref"||ve==="symbol")&&!z)z=Ue;if(ve==="net"&&!ae)ae=Ue;G.push([ve,Ue])}else G.push([$e,""])}let K=document.createElement("div");K.className="bp-v-info-head";let we=document.createElement("span");we.className="bp-v-info-title",we.textContent=_;let xe=document.createElement("button");xe.type="button",xe.className="bp-v-info-x",xe.textContent="×",xe.setAttribute("aria-label","Clear selection"),xe.addEventListener("click",st),K.append(we,xe);let Ne=document.createElement("div");Ne.className="bp-v-info-rows";for(let[$e,Re]of G){let ve=document.createElement("span");ve.className="bp-v-info-chip",ve.textContent=Re?`${$e}: ${Re}`:$e,Ne.append(ve)}return f.replaceChildren(K,...G.length>0?[Ne]:[]),f.hidden=!1,{ref:z||void 0,net:ae||void 0}}async function At(V){if(!V){st();return}let W=Array.from(L)[0]||"";if(!W)return;let _=w;try{let G=await t.hub.rpc("viewer.info",{key:W,at:V.at,idx:V.idx});if(_!==w)return;let z=typeof G.info==="string"?G.info:"";if(!z){st();return}let{ref:ae,net:K}=Yt(z),we=[];if(ae)we.push(["ref",ae]);if(K)we.push(["net",K]);let xe=[[V.at,V.idx]];for(let[Ne,$e]of we){let Re=await t.hub.rpc("viewer.probe",{key:W,name:Ne,value:$e});if(_!==w)return;if(Array.isArray(Re.matches))for(let ve of Re.matches)xe.push(ve)}ue?.setHighlights(xe)}catch{st()}}function Ce(){Q?.destroy(),Q=null,ge?.destroy(),ge=null,ue?.destroy(),ue=null,le?.destroy(),le=null,h.replaceChildren(),Se=!1,u.hidden=!0,f.hidden=!0,f.replaceChildren(),He("",!1),oe("none")}function ye(){N=[],A=0}async function ct(V){if(!v||!y)return;let W=++w;if(L.clear(),C=!1,ye(),Ce(),Fe(),te(),Ae(),(y==="board"||y==="schematic")&&v)Te(v);if(Oa(y)){if(t.hub.rpc("viewer.watch",{thread:v,kind:""}).catch(()=>{}),y==="files")Q=lr(h,t,v,(z,ae)=>{if(y=z,Y=ae,z==="mech")x=ae;ct(!1)});else if(y==="diff")Q=cr(h,t,v);else if(y==="review")Q=dr(h,t,v);else if(y==="browser")Q=rr(h,t,v);else if(y==="terminal")oe("loading","Loading terminal…"),import("/assets/terminal.js").then((ae)=>{if(W!==w)return;if(oe("none"),ae?.mountTerminalPane)ge=ae.mountTerminalPane(h,t,v,q());else oe("error","Terminal chunk missing",!0)},(ae)=>{if(W!==w)return;oe("error",ae instanceof Error?ae.message:String(ae),!0)});return}if(oe("loading","Loading…"),!j.root)try{let z=await t.hub.rpc("viewer.files",{thread:v});if(W!==w)return;j=z||{},Fe()}catch{}if(y==="gerbers"&&j.hasGerbers===!1){oe("empty","No Gerbers in this project",!1);return}let _=q();if(y==="3d"||y==="mech")le=new ci(h,{onStatus:(z,ae)=>{if(ae)oe("none"),He(z,!1);else if(z)oe("loading",z);else oe("none"),He("",!1)},onUserMove:()=>void _e()}),le.setTheme(_);else if(y==="board"||y==="schematic"||y==="gerbers")ue=new ri(h,{onPick:(z)=>void At(z),onUserMove:()=>void _e()}),ue.setTheme(_);else{oe("empty",`${yr(y)} is not available in this viewer`,!1);return}let G={thread:v};if(V)G.force=!0;if(y==="mech"){if(O.length===0)try{let z=await t.hub.rpc("mech.list",{thread:v});if(W!==w)return;if(O=Array.isArray(z.parts)?z.parts:[],!x)x=z.primary||O[0]||"";Fe()}catch(z){if(W!==w)return;oe("error",z instanceof Error?z.message:String(z),!0);return}if(!x){oe("empty",m("gpui.rail.no.mech","No mechanical parts in this project"),!1);return}G.kind="3d",G.path=x}else{if(G.kind=y,Y&&(y==="board"||y==="schematic"))G.path=Y;if(y==="3d"&&!V&&le){let z=le.keptToken();if(z)G.kept=z}if((y==="board"||y==="schematic"||y==="gerbers")&&!V&&t.hub.hasFeature("keptChunks"))G.keptChunks=Array.from(M.keys())}C=!0,I="",J="",ie="",Ee="";try{let z=await t.hub.rpc("viewer.watch",G);if(W!==w)return;L=new Set(Array.isArray(z.keys)?z.keys:[]),C=!1;let ae=N;ye();for(let K of ae)if(K.kind==="bin")Ze(K.buf);else Je(K.key,K.none,K.retryable,K.big)}catch(z){if(W!==w)return;C=!1,L.clear(),ye();let ae=z instanceof Error?z.message:String(z),K=/no gerbers|not in this project|another machine/i.test(ae);oe(K?"empty":"error",ae,!K)}}function Je(V,W,_,G=!1){if(C){if(N.length{if(V.t==="plot"&&typeof V.none==="string"&&typeof V.key==="string")Je(V.key,V.none,V.retryable===!0)}),rt=en(()=>{if(y)Fe()}),Xt=(V)=>{if(V.key==="Escape"&&y&&!f.hidden)st()};return window.addEventListener("keydown",Xt),{open(V,W){if(W!==v){if(v=W,j={},O=[],x="",B.clear(),se=!1,ne=!1,he=0,ke=0,ee="",re=0,R=null,t.hub.hasFeature("follow"))t.hub.rpc("viewer.follow",{thread:W}).then((_)=>{if(W!==v)return;if(se=!!_.on,ne=!!_.paused,he=Number(_.seq)||0,y)Fe()}).catch(()=>{})}if(V!==y)D(),k.goLive(),ke=0,ee="",re=0,R=null;y=V,Y="",ct(!1)},reconcileHas(V){if(y&&!$a(y,V))t.closeViewer()},close(){if(w++,C=!1,D(),F=!1,I="",J="",ie="",Ee="",k.goLive(),c.hidden=!0,b.hidden=!0,ye(),v)t.hub.rpc("viewer.watch",{thread:v,kind:""}).catch(()=>{});y="",L.clear(),Ce()}}}var wr="http://www.w3.org/2000/svg";function qt(e){let t=document.createElementNS(wr,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("aria-hidden","true");for(let n of e){let i=document.createElementNS(wr,"path");i.setAttribute("d",n),t.appendChild(i)}return t}function Er(e){if(!e)return"bp-dot-idle";let t=e.status||e.state;if(t==="active"||t==="working")return"bp-dot-work";if(t==="finished")return"bp-dot-done";if(t==="waiting"||t==="asking"||t==="blocked"||t==="failed"||(e.waiting??0)>0)return"bp-dot-need";return"bp-dot-idle"}function Ga(e){if(!e)return"";let t=e<10000000000?e*1000:e,n=Math.max(0,Math.floor((Date.now()-t)/1000));if(n<60)return"now";if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400)return`${Math.floor(n/3600)}h`;return`${Math.floor(n/86400)}d`}function kr(e,t){if(!e)return!0;if(t==="board"||t==="3d")return e.board!==!1;if(t==="schematic")return e.schematic!==!1;if(t==="mech")return e.mech!==!1;if(t==="gerbers")return e.gerbers!==!1;return!0}var Kt="dark",mn=(()=>{try{return $s(localStorage.getItem("bp.theme.pref"))}catch{return"auto"}})(),hi=null,Lt=(()=>{try{return Os(localStorage.getItem("bp.locale"))}catch{return"auto"}})();function Sr(){let e=Gt(mn,Kt);document.documentElement.classList.toggle("light",e==="light");try{localStorage.setItem("bp.theme",e)}catch{}}function Cr(e){if(!e)return;Kt=e==="light"?"light":"dark",Sr()}function xr(){if(Lt!=="auto")vt(Lt);else if(hi)vt(hi);else if(typeof navigator<"u"&&navigator.language){if(!vt(navigator.language))vt("en")}}function Va(){return`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Pr(){let e=document.getElementById("root");if(!e)return;try{if(localStorage.getItem("bp.theme")==="light")Kt="light";if(Gt(mn,Kt)==="light")document.documentElement.classList.add("light");if(Lt!=="auto")vt(Lt)}catch{}let t=document.createElement("header");t.className="bp-topbar",t.setAttribute("data-testid","topbar");let n=document.createElement("button");n.type="button",n.className="icon bp-side-toggle",n.textContent="☰",n.title="Toggle sidebar",n.setAttribute("aria-label","Toggle sidebar");let i=document.createElement("div");i.className="bp-brand";let s=document.createElement("img");s.src="/assets/favicon.svg",s.alt="Backplane",s.className="bp-logo";let r=document.createElement("span");r.className="bp-brand-name bp-hide-phone",r.textContent="Backplane";let a=document.createElement("span");a.className="bp-crumb-sep bp-hide-phone",a.textContent="/";let o=document.createElement("span");o.className="bp-crumb-proj bp-hide-phone";let c=document.createElement("span");c.className="bp-crumb-sep bp-hide-phone",c.textContent="/";let p=document.createElement("span");p.className="bp-crumb-thread",p.setAttribute("data-testid","thread-title");let l=document.createElement("span");l.className="bp-plan-top-badge bp-hidden",l.setAttribute("data-testid","plan-top-badge"),i.append(s,r,a,o,c,p,l);let h=document.createElement("div");h.className="bp-top-state bp-hide-phone bp-hidden";let d=document.createElement("span");d.className="bp-top-state-lbl",d.textContent="STATE";let u=document.createElement("span");u.className="bp-dot bp-dot-idle";let f=document.createElement("span");f.className="bp-top-state-word",h.append(d,u,f);let b=document.createElement("div");b.className="bp-top-acts bp-hide-phone bp-hidden";let v=document.createElement("button");v.type="button",v.className="bp-btn-ghost bp-top-act";let y=document.createElement("span");y.textContent=m("menu.pin","Pin"),v.append(qt(["M12 17v5","M9 3h6l1 7 3 3H5l3-3 1-7z"]),y);let w=document.createElement("button");w.type="button",w.className="bp-btn-ghost bp-top-act";let C=document.createElement("span");C.textContent=m("menu.settle","Settle"),w.append(qt(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M9 12l2 2 4-4"]),C);let L=document.createElement("div");L.className="bp-menu-wrap";let N=document.createElement("button");N.type="button",N.className="bp-btn-ghost bp-top-act",N.textContent="▾",N.title="Thread menu",N.setAttribute("aria-label","Thread menu"),N.setAttribute("data-testid","thread-menu-btn");let A=document.createElement("div");A.className="bp-popover bp-hidden",A.setAttribute("data-testid","thread-menu"),L.append(N,A),b.append(v,w,L);let B=document.createElement("div");B.className="bp-top-right";let M=document.createElement("button");M.type="button",M.className="bp-btn-ghost bp-top-act bp-hide-tablet",M.setAttribute("data-testid","improvements-btn");let j=document.createElement("span");j.textContent=m("gpui.improvements","Improvements"),M.append(qt(["M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 16.8l-6.2 4.5 2.4-7.4L2 9.4h7.6z"]),j);let O=document.createElement("button");O.type="button",O.className="bp-cmd-box bp-hide-tablet",O.textContent="> Jump or run a command";let x=document.createElement("button");x.type="button",x.className="icon bp-top-icon",x.title="Search",x.setAttribute("aria-label","Search"),x.appendChild(qt(["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.3-4.3"]));let Y=document.createElement("button");Y.type="button",Y.className="icon bp-top-icon",Y.title=m("palette.settings","Settings"),Y.setAttribute("aria-label",m("palette.settings","Settings")),Y.setAttribute("data-testid","settings-btn"),Y.appendChild(qt(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c.26.6.85 1 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"])),B.append(M,O,x,Y),t.append(n,i,h,b,B);let se=document.createElement("div");se.className="bp-body";let ne=document.createElement("aside");ne.className="bp-sidebar",ne.setAttribute("data-testid","sidebar");let he=document.createElement("main");he.className="bp-center";let Se=document.createElement("div");Se.className="bp-right-area bp-hidden",Se.setAttribute("data-testid","right-area");let ke=document.createElement("div");ke.className="bp-right-top";let ee=document.createElement("section");ee.className="bp-viewer-pane bp-hidden",ee.setAttribute("data-testid","viewer-pane"),ke.appendChild(ee),Se.appendChild(ke);let re=document.createElement("nav");re.className="bp-rail",re.setAttribute("aria-label","Viewer rail"),re.setAttribute("data-testid","viewer-rail"),se.append(ne,he,Se,re),e.append(t,se);let R=new ii,ue=null,le=new Set,Q=0,ge=null,k=[],P=[],F=[],I=[],J=[],ie=[],Ee=[],D="",te=0,Me=0,Ae=null,Te=null,q="",fe=null,oe=20,He={},De=new Map;function Fe(g,E){De.delete(g),De.set(g,E);while(De.size>oe){let S=De.keys().next().value;if(S!==void 0)De.delete(S);else break}}let Be="",Ge=0,_e=new Gn(he,{onNewThread:(g)=>{Tt(g)},onOpenThread:(g)=>{ze(g)},onOpenViewer:(g,E)=>{ze(g).then(()=>{if(D===g)Oe(E)})},onRetry:(g)=>{At(g)}});function Jt(){if(!Be)return;Be="",Ge++,he.classList.remove("bp-home-open"),_e.hide(),Ce.setSelectedProject(""),ve()}function st(g){return k.find((E)=>E.id===g)??k.find((E)=>On(E.id)===g)}async function Yt(g,E){try{let S=await R.rpc("threads.list",{project:g,limit:50,archived:!1});if(E!==Ge||Be!==g)return;let T=(S.threads??[]).filter((H)=>!H.swarm).map((H)=>({id:H.id,title:H.title,dot:Er(H),status:H.status||H.state||"",age:Ga(H.updatedAt),settled:H.settled}));_e.setThreads(T)}catch{if(E===Ge&&Be===g)_e.setThreads([])}}function At(g){if(!g||!R.hasFeature("projecthome"))return!1;Ze.cancel(),de.closeModelPicker(),Be=g;let E=++Ge,S=st(g);return he.classList.add("bp-home-open"),ne.classList.remove("bp-sidebar-open"),_e.show({id:g,title:S?.title??g}),Ce.setSelectedProject(g),ve(),Yt(g,E),R.rpc("project.home",{project:g}).then((T)=>{if(E===Ge&&Be===g)_e.setData(Ls(T))}).catch((T)=>{if(E!==Ge||Be!==g)return;_e.setError(T instanceof Error&&T.message?T.message:m("web.home.error","Could not load this project."))}),!0}let Ce=new ei(ne,{onSelectThread:(g)=>{if(g===D&&Ae!==null){Jt(),ne.classList.remove("bp-sidebar-open");return}ze(g)},onNewThread:(g)=>{Tt(g)},onOpenProject:(g)=>At(On(g)),canOpenProject:()=>R.hasFeature("projecthome"),onSelectBot:(g)=>{ze(g.thread)},onQuickOpenViewer:(g,E)=>{let S=P.find((H)=>H.project===g&&!H.archived&&!H.swarm);(async()=>{if(S)await ze(S.id);else await Tt(g);if(D)q=E,G.setActive(E),fe?.open(E,D)})()},onThreadAct:(g,E)=>{dt(g,E)},onSnoozeRow:(g)=>{R.rpc("sidebar.act",{action:"row-snooze",value:g}).then(()=>Ye()).catch(()=>{})},onToggleSection:(g)=>{if(le.has(g))le.delete(g);else le.add(g);Ye()},onToggleProjectFold:(g)=>{R.rpc("sidebar.act",{action:"project-fold",value:g}).then(()=>Ye()).catch(()=>{})},onCollapseSidebar:()=>{ne.classList.remove("bp-sidebar-open"),ne.classList.add("bp-sidebar-collapsed")},onNeedAct:async(g)=>{let E=dn(g,!1);if(!E)return;if(E.kind==="thread"){ze(E.id);return}if(E.kind!=="call")return;let S=Fs(await R.rpc(E.method,E.params));if(S?.kind==="thread")ze(S.id);Ye()},hasRoomView:!1,onAddProject:()=>_.open({mode:"folder"}),onSettleSwarm:(g)=>{R.rpc("sidebar.act",{action:"swarm-settle",value:g}).then(()=>Ye()).catch(()=>{})}}),ye=new Pn(he,{onLoadOlder:()=>{bi()},onGoToEntry:(g)=>{mi(g)},onOpenAccounts:()=>{xe()},onAnswerAsk:(g,E)=>{R.rpc("ask.answer",{ask:g,answer:E}).catch((S)=>{de.showError(S instanceof Error?S.message:"Could not send answer")})},onToggleReview:(g)=>{if(!D)return;let E=te;R.rpc("thread.review",{thread:D,on:g}).then((S)=>{if(E===te)ye.setReview(S.review??null)}).catch(()=>{})},onUnansweredAction:(g,E)=>{if(!D)return;if(g==="again"||g==="thread-again")R.rpc("thread.again",{thread:D,value:E}).catch(()=>{});else R.rpc("thread.act",{thread:D,action:g,value:E}).catch(()=>{})},onReplyEntry:(g)=>{if(!R.hasFeature("reply")){let E=(g.text||"").split(` -`)[0]?.slice(0,100)??"";if(E)de.prependDraft(`> ${E} -`);return}if(!g.text||!g.text.trim()||g.live||g.id.startsWith("local-"))return;Bt({id:g.id,text:g.text,role:g.kind==="user"?"user":"assistant"})},onLoadImage:async(g,E)=>{try{let S={entry:g,path:E};if(R.hasFeature("blobs"))S.metaOnly=!0;let T=await R.rpc("message.image",S);if(T.blob&&T.blob.startsWith("/blob/"))return{url:T.blob};if(T.mime&&T.data)return{mime:T.mime,data:T.data}}catch{}return null}});function ct(g){if(!g)return null;if(g.planMode)return g.planMode;if(g.provider==="claude")return{phase:"off",interaction:"default",once:!1};return null}function Je(g,E){if(!D)return;let S=te,T=D;R.rpc(g,E).then((H)=>{if(S!==te||D!==T)return;if(H.thread){let Z=P.findIndex((me)=>me.id===H.thread.id);if(Z>=0)P[Z]=H.thread;else P.unshift(H.thread);Ce.setData(k,P,F,I),ye.updateThreadMeta(H.thread),ve(),de.setState(!0,H.thread.state==="working")}}).catch((H)=>{if(S===te&&D===T)de.showError(H instanceof Error?H.message:"Could not change Plan mode")})}let Ze,de=new An(he,{onSend:(g,E)=>{fi(g,E)},onRunCommand:(g)=>{vi(g)},onInterrupt:()=>{if(D)R.rpc("turn.interrupt",{thread:D}).catch(()=>{})},onQueryMentions:async(g,E)=>{try{return(await R.rpc("mentions.list",{q:g,kind:E,limit:10})).items??[]}catch{return[]}},onToggleVoice:()=>{Ze.toggle()},onCyclePlanMode:()=>{let g=P.find((S)=>S.id===D)??null,E=ct(g);if(!E||!D)return;if(E.interaction!=="plan")Je("thread.planonce",{thread:D,on:!0});else if(E.once)Je("thread.pick",{thread:D,action:"interaction",value:"plan"});else Je("thread.pick",{thread:D,action:"interaction",value:"default"})},onSetPlanMode:(g)=>{if(!D)return;if(g==="once")Je("thread.planonce",{thread:D,on:!0});else if(g==="always")Je("thread.pick",{thread:D,action:"interaction",value:"plan"});else Je("thread.pick",{thread:D,action:"interaction",value:"default"})},getFavoriteModels:()=>J,onLoadModelPicker:async()=>{if(!D)return null;return R.rpc("thread.picker",{thread:D})},onSelectModel:async(g,E)=>{if(!D)return;let S=te,T=D;try{let H=await R.rpc("thread.model",{thread:T,provider:g,model:E});if(S!==te||D!==T)return;if(H.thread){let Z=P.findIndex((me)=>me.id===H.thread.id);if(Z>=0)P[Z]=H.thread;else P.unshift(H.thread);Ce.setData(k,P,F,I),ye.updateThreadMeta(H.thread),ve(),de.setState(!0,H.thread.state==="working")}}catch(H){if(S===te&&D===T)de.showError(H instanceof Error?H.message:"Could not switch model")}},onSelectEffort:async(g)=>{if(!D)return;let E=te,S=D;try{let T=await R.rpc("thread.pick",{thread:S,action:"effort",value:g});if(E!==te||D!==S)return;if(T.thread){let H=P.findIndex((Z)=>Z.id===T.thread.id);if(H>=0)P[H]=T.thread;else P.unshift(T.thread);Ce.setData(k,P,F,I),ye.updateThreadMeta(T.thread),ve()}}catch(T){if(E===te&&D===S)de.showError(T instanceof Error?T.message:"Could not set effort")}},onToggleFavorite:async(g,E,S)=>{let T=await R.rpc("models.favorite",{provider:g,model:E,on:S});if(Array.isArray(T.favorites))return J=T.favorites,J;return null}});Ze=new ti(R,{getThreadId:()=>D,getDraft:()=>de.getDraft(),getCaret:()=>de.getCaret(),setDraft:(g)=>de.setDraft(g),setRecording:(g)=>de.setVoiceRecording(g),setLevel:(g)=>de.setVoiceLevel(g),showError:(g)=>de.showError(g)});function Nt(){let g=q!=="",E=rt.isOpen();Se.classList.toggle("bp-hidden",!g&&!E),Se.classList.toggle("bp-has-viewer",g),Se.classList.toggle("bp-has-mgmt",E)}let rt=new Hn(ke,Se,{hub:R,getThreadId:()=>D,getThreadGen:()=>te,onSendText:(g)=>{fi(g)},onOpenChange:()=>Nt()});function Xt(g){let E=window.prompt("Rename thread",g.title||"");if(!E||!E.trim())return;R.rpc("thread.act",{thread:g.id,action:"rename",title:E.trim()}).then((S)=>{if(S.thread)P=P.map((T)=>T.id===S.thread.id?S.thread:T),ve(),Ye()}).catch((S)=>{de.showError(S instanceof Error?S.message:"Could not rename thread")})}function V(g){switch(g.type){case"thread":ze(g.id);break;case"rail":if(!D&&g.id!=="terminal")break;if(q===g.id)Ue();else Oe(g.id);break;case"thread-act":if(D)dt(D,g.action);break;case"new-thread":Tt(g.projectId);break;case"rename":{let E=P.find((S)=>S.id===D);if(E)Xt(E);break}case"prev-thread":case"next-thread":{let E=P.filter((Z)=>!Z.archived&&!Z.swarm);if(E.length<2)break;let S=E.findIndex((Z)=>Z.id===D),T=g.type==="next-thread"?1:-1,H=E[(S<0?0:S+T+E.length)%E.length];if(H)ze(H.id);break}case"command":if(g.runDirectly)vi(g.word);else de.setDraft(`${g.word} `),de.focus();break;case"improvements":Re();break;case"settings":K.open();break;case"sidebar":ne.classList.toggle("bp-sidebar-open"),ne.classList.toggle("bp-sidebar-collapsed");break}}let W=new Dn(e,{getState:()=>({selectedThreadId:D,threads:P,projects:k,bots:F,railItems:ie,commands:Ee}),onSearch:async(g)=>{if(!R.hasFeature("search"))return{threads:[],projects:[],messages:[]};return R.rpc("search",{q:g,limit:20})},onExecute:V}),_=new kn(e,{hub:R,onProjectAdded:(g)=>{if(Ye(),g.id)Tt(g.id)},onCloneDone:(g)=>{if(Ye(),g.thread)ze(g.thread)}}),G=new Wn(re,(g)=>{if(g==="commands"){W.open();return}if(!D)return;if(q===g)Ue();else Oe(g)}),z=null,ae=null,K=new Yn(e,{onLoadDevices:async()=>(await R.rpc("devices.page",{})).rows??[],onDevicesAct:async(g,E)=>{await R.rpc("devices.page.act",{action:g,value:E})},onGetHome:()=>z,onMoveHomeHere:async()=>{await R.rpc("home.move",{to:"back"})},onGetNoProvider:()=>ae,onGetThemePref:()=>mn,onSetThemePref:(g)=>{mn=g;try{if(g==="auto")localStorage.removeItem("bp.theme.pref");else localStorage.setItem("bp.theme.pref",g)}catch{}Sr()},onGetHubTheme:()=>Kt,onGetLocalePref:()=>Lt,onSetLocalePref:(g)=>{Lt=g;try{if(g==="auto")localStorage.removeItem("bp.locale");else localStorage.setItem("bp.locale",g)}catch{}xr()},hasRing:()=>R.hasFeature("ringnotes"),onRingList:async(g)=>Ts(await R.rpc("ring.list",{q:g})),onRingHear:async(g,E)=>{await R.rpc("ring.hear",{note:g,engine:E})},onOpenThread:(g)=>{ze(g)},onLogout:()=>Ui(()=>{R.disconnect(),window.location.replace("/")})});function we(g){if(ae=g,ye.setNoProvider(g),K.isOpen())K.refresh()}function xe(){K.openToAccounts()}function Ne(g,E){let S=g instanceof Error?g.message:E,T=g instanceof _t?g:null,H=T?.code,Z=T?.machine,me=H==="no_provider_remote"&&Z?m("provider.notice.senderr.remote","No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.").replaceAll("{machine}",Z):S;de.showError(me,Ms(S,H)?{label:m("provider.notice.button","Open Settings → Accounts"),onClick:xe}:void 0)}v.addEventListener("click",()=>{let g=P.find((E)=>E.id===D);if(g)dt(g.id,g.pinned?"unpin":"pin")}),w.addEventListener("click",()=>{let g=P.find((E)=>E.id===D);if(g)dt(g.id,g.settled?"unsettle":"settle")});let $e=new Qn(e,(g,E)=>E?R.rpc("thread.context.mcp",{thread:g,...E}):R.rpc("thread.context",{thread:g}));N.addEventListener("click",(g)=>{g.stopPropagation();let E=P.find((H)=>H.id===D);if(!E)return;if(!A.classList.contains("bp-hidden")){A.classList.add("bp-hidden");return}let S=[{label:"Rename…",run:()=>Xt(E)},{label:E.pinned?m("menu.unpin","Unpin"):m("menu.pin","Pin"),run:()=>{dt(E.id,E.pinned?"unpin":"pin")}},{label:E.settled?m("phone.unsettle","Unsettle"):m("menu.settle","Settle"),run:()=>{dt(E.id,E.settled?"unsettle":"settle")}},{label:E.archived?"Unarchive":"Archive",run:()=>{dt(E.id,E.archived?"unarchive":"archive")}},{label:"Delete",danger:!0,run:()=>{if(window.confirm("Delete this thread?"))dt(E.id,"delete")}}];if(R.hasFeature("threadContext"))S.unshift({label:m("thread.context.title","Context & Prompt"),run:()=>$e.open(E.id)});let T=document.createDocumentFragment();for(let H of S){let Z=document.createElement("button");Z.type="button",Z.className="bp-popover-item"+(H.danger?" danger":""),Z.textContent=H.label,Z.addEventListener("click",()=>{A.classList.add("bp-hidden"),H.run()}),T.appendChild(Z)}A.replaceChildren(T),A.classList.remove("bp-hidden")}),document.addEventListener("click",()=>A.classList.add("bp-hidden"));async function Re(){let g=document.createElement("div");g.className="bp-modal-backdrop",g.setAttribute("data-testid","improvements-modal");let E=document.createElement("div");E.className="bp-modal";let S=document.createElement("div");S.className="bp-modal-head";let T=document.createElement("h2");T.textContent=m("gpui.improvements","Improvements");let H=document.createElement("button");H.type="button",H.className="icon",H.textContent="×",H.addEventListener("click",()=>g.remove()),S.append(T,H);let Z=document.createElement("div");Z.className="bp-modal-body",Z.textContent="Loading…",E.append(S,Z),g.appendChild(E),g.addEventListener("click",(me)=>{if(me.target===g)g.remove()}),e.appendChild(g);try{let me=await R.rpc("improvements.projects",{}),Ve=me.projects??[];if(Ve.length===0){Z.textContent="No projects available for Improvements.";return}let at=document.createDocumentFragment();for(let ot of Ve){let je=document.createElement("div");je.className="bp-set-row";let ce=document.createElement("div");ce.className="bp-set-info",ce.textContent=ot.title||ot.name||ot.id;let Xe=document.createElement("button");Xe.type="button",Xe.className=ot.id===me.project?"primary":"",Xe.textContent=ot.id===me.project?"Active":"Select",Xe.addEventListener("click",()=>{R.rpc("improvements.project",{project:ot.id}).then(()=>g.remove()).catch(()=>{})}),je.append(ce,Xe),at.appendChild(je)}Z.replaceChildren(at)}catch(me){Z.textContent=me instanceof Error?me.message:"Could not load Improvements."}}M.addEventListener("click",()=>{Re()}),O.addEventListener("click",()=>W.open()),x.addEventListener("click",()=>W.open()),Y.addEventListener("click",()=>{K.open()}),n.addEventListener("click",()=>{ne.classList.toggle("bp-sidebar-open"),ne.classList.toggle("bp-sidebar-collapsed")});function ve(){let g=Be?null:P.find((T)=>T.id===D)??null,E=Be?st(Be)??{id:Be,title:Be}:g?st(g.project):void 0;if(Be&&E)_e.setTitle(E.title);o.textContent=E?.title??"",a.classList.toggle("bp-hidden",!E),c.classList.toggle("bp-hidden",!g),p.textContent=g?g.title||"Untitled thread":"";let S=ct(g);if(de.setPlanMode(S),!S||S.phase==="off")l.classList.add("bp-hidden"),l.classList.remove("is-exec"),l.textContent="";else l.classList.remove("bp-hidden"),l.classList.toggle("is-exec",S.phase==="executing"),l.title=m("gpui.planmode.tip","Plan before acting (1 turn, always, or off)"),l.textContent=S.phase==="armed"&&S.once?m("gpui.planmode.top.once","Plan (1 turn)"):S.phase==="armed"?m("gpui.mgmt.plan.tab","Plan"):S.phase==="planning"?m("gpui.planmode.top.planning","Planning"):S.phase==="pending"?m("gpui.planmode.top.pending","Review plan"):m("gpui.planmode.top.executing","Building plan");if(h.classList.toggle("bp-hidden",!g),b.classList.toggle("bp-hidden",!g),g){u.className=`bp-dot ${Er(g)}`,f.textContent=g.status||g.state||"idle",y.textContent=g.pinned?m("menu.unpin","Unpin"):m("menu.pin","Pin"),C.textContent=g.settled?m("phone.unsettle","Unsettle"):m("menu.settle","Settle");let T=g;de.setModelChip(g.chip||g.model||"default",g.provider,T.ctxPct??T.contextPct),de.setMemory(g.memory)}else de.setModelChip("default"),de.setMemory(null)}function Ue(g=!0){if(Me++,q="",G.setActive(""),ee.classList.add("bp-hidden"),fe?.close(),Nt(),g&&D&&R.getState()==="connected")R.rpc("viewer.watch",{thread:D,kind:""}).catch(()=>{})}function Oe(g){if(Me++,q=g,G.setActive(g),ee.classList.remove("bp-hidden"),Nt(),!fe&&typeof pi==="function")fe=pi(ee,{hub:R,getThreadId:()=>D,closeViewer:()=>Ue(!0)});if(fe)fe.open(g,D);else{let E=document.createElement("div");E.className="bp-viewer-placeholder";let S=document.createElement("div");S.className="bp-viewer-bar";let T=document.createElement("span");T.textContent=g.toUpperCase();let H=document.createElement("button");H.type="button",H.className="icon",H.textContent="×",H.addEventListener("click",()=>Ue(!0)),S.append(T,H);let Z=document.createElement("div");Z.className="bp-dim bp-viewer-msg",Z.textContent=`Viewer pane (${g}).`,E.append(S,Z),ee.replaceChildren(E)}}async function Mt(g,E){if(!g||!R.hasFeature("rail")){if(E===te)ie=[],G.setItems([]);return}let S=++Me;try{let T=await R.rpc("viewer.rail",{thread:g,page:q});if(E!==te||S!==Me)return;let H=Array.isArray(T.rail)?T.rail:Array.isArray(T.items)?T.items:[];if(ie=H,G.setItems(H),T.has){if(fe?.reconcileHas?.(T.has),q&&!kr(T.has,q))Ue(!0)}}catch{if(E===te&&S===Me)ie=[],G.setItems([])}}function bn(g){for(let E of g)if(E.kind==="threads"){for(let S of E.rows)if(!S.off&&(S.nav||S.id)&&!(S.nav||"").startsWith("@room:"))return S.nav||S.id}else if(E.kind==="projects"){for(let S of E.rows)for(let T of S.threads??[])if(!T.off&&(T.nav||T.id)&&!(T.nav||"").startsWith("@room:"))return T.nav||T.id}return""}function et(g,E){for(let S of g)if(S.kind==="threads"){if(S.rows.some((T)=>(T.nav||T.id)===E))return!0}else if(S.kind==="projects"){for(let T of S.rows)if((T.threads??[]).some((H)=>(H.nav||H.id)===E))return!0}return!1}function gn(g){let E=[];for(let S of g){if(S.kind!=="projects")continue;for(let T of S.rows)E.push({id:T.id,title:T.title,css:T.css,color:T.color})}if(E.length>0)k=E}async function Ye(){if(!R.hasFeature("sections"))return!1;let g=++Q;try{let E=await R.rpc("sidebar.sections",{open:Array.from(le)});if(g!==Q)return!0;let S=Array.isArray(E.sections)?E.sections:[];if(ue=S,gn(S),Ce.setData(k,P,F,I),Ce.setSections(S,F,I),ve(),Be)Yt(Be,Ge);return!0}catch{return!1}}function Qt(){if(!R.hasFeature("sections"))return;if(ge!==null)window.clearTimeout(ge);ge=window.setTimeout(()=>{ge=null,Ye()},150)}async function Lr(){if(Ae=null,R.hasFeature("bots"))try{let E=await R.rpc("bots.list",{});F=E.bots??[],I=E.rooms??[]}catch{}if(R.hasFeature("shell")){let E=await R.rpc("shell.sync",{have:He,settled:25}),S=new Set(E.removed??[]),T=new Set((E.projects??[]).map((H)=>H.id));if(S.size>0||T.size>0)k=[...k.filter((H)=>!S.has(H.id)&&!T.has(H.id)),...E.projects??[]],P=[...P.filter((H)=>!S.has(H.project)&&!T.has(H.project)),...E.threads??[]];else if(Array.isArray(E.threads)&&E.threads.length>0){let H=new Map(P.map((Z)=>[Z.id,Z]));for(let Z of E.threads)H.set(Z.id,Z);P=Array.from(H.values())}if(E.sections!==void 0){let H=Array.isArray(E.sections)?E.sections:Array.isArray(E.sections?.sections)?E.sections.sections:null;if(H)ue=H,gn(H)}if(E.h)He=E.h;Ce.setData(k,P,F,I),Ce.setSections(ue,F,I)}else if(R.hasFeature("sections")){let[E,S]=await Promise.all([R.rpc("sidebar.sections",{open:Array.from(le)}).catch(()=>null),R.rpc("threads.list",{limit:200,archived:!1}).catch(()=>({threads:[]}))]);if(P=S.threads??[],E&&Array.isArray(E.sections)){let T=E.sections;if(!T.some((Z)=>Z.kind==="projects"&&Z.rows.length>0)){let Z=T.find((me)=>me.kind==="projects"&&me.fold&&me.toggle&&(me.count??0)>0);if(Z?.toggle&&!le.has(Z.toggle)){le.add(Z.toggle);let me=await R.rpc("sidebar.sections",{open:Array.from(le)}).catch(()=>null);if(me&&Array.isArray(me.sections))T=me.sections}}ue=T,gn(T),Ce.setData(k,P,F,I),Ce.setSections(T,F,I)}else ue=null,k=(await R.rpc("projects.list",{limit:100})).projects??[],Ce.setSections(null,F,I),Ce.setData(k,P,F,I);await R.rpc("subscribe",{topic:"lists"}).catch(()=>{})}else{ue=null;let[E,S]=await Promise.all([R.rpc("projects.list",{limit:100}),R.rpc("threads.list",{limit:200,archived:!1})]);k=E.projects??[],P=S.threads??[],Ce.setSections(null,F,I),Ce.setData(k,P,F,I),await R.rpc("subscribe",{topic:"lists"}).catch(()=>{})}let g=D;if(!g){let E="";try{E=localStorage.getItem("bp.lastThread")||""}catch{}if(E&&(ue&&et(ue,E)||P.some((S)=>S.id===E)))g=E;else if(ue)g=bn(ue);if(!g)g=(P.find((T)=>!T.archived&&!T.swarm&&!T.settled)??P.find((T)=>!T.archived&&!T.swarm))?.id??""}if(g&&(ue&&et(ue,g)||P.some((E)=>E.id===g)))await ze(g,Be!=="");else D="",ie=[],G.setItems([]),de.setState(!1,!1),ve();if(Be)At(Be)}async function ze(g,E=!1){if(!E)Jt();if(D&&D!==g){Ze.cancel();let je=ye.getEntries();if(je.length>0){let ce=De.get(D);Fe(D,{entries:je,ids:ce?.ids??je.map((Xe)=>Xe.id),olderCursor:Te,review:ce?.review??null,unanswered:ce?.unanswered??null,rail:ce?.rail??ie,hashes:ce?.hashes??{}})}}let S=++te;Me++,Bt(null);let T=Ae;if(Ae=null,T!==null)R.rpc("unsubscribe",{sub:T}).catch(()=>{});D=g,de.closeModelPicker();let H=De.get(g);Te=H?.olderCursor??null;try{localStorage.setItem("bp.lastThread",g)}catch{}Ce.setSelected(g),ne.classList.remove("bp-sidebar-open"),ve();let Z=P.find((je)=>je.id===g)??null;if(H)ye.setThread(Z,H.entries,Boolean(H.olderCursor),H.review,H.unanswered),ie=H.rail,G.setItems(H.rail);else ye.setLoading(Z),ie=[],G.setItems([]);if(de.setState(!0,Z?.state==="working"),R.hasFeature("open")){let je={};if(H){for(let[Ie,Rt]of Object.entries(H.hashes))je[Ie]=Rt;for(let Ie of H.entries)if(Ie.h)je[Ie.id]=Ie.h}let ce;try{ce=await R.rpc("thread.open",{thread:g,limit:40,have:je})}catch(Ie){if(S===te){let Rt=Ie instanceof Error&&Ie.message?Ie.message:"Could not load messages.";ye.setError(Z,Rt,()=>{ze(g)})}return}if(S!==te){if(ce.sub!==void 0&&ce.sub!==null)R.rpc("unsubscribe",{sub:ce.sub}).catch(()=>{});return}if(Ae=ce.sub??null,ce.thread){Z=ce.thread;let Ie=P.findIndex((Rt)=>Rt.id===ce.thread.id);if(Ie>=0)P[Ie]=ce.thread;else P.unshift(ce.thread);ve(),de.setState(!0,Z.state==="working")}if("next"in ce)Te=ce.next??null;let Xe=new Map;if(H)for(let Ie of H.entries)Xe.set(Ie.id,Ie);for(let Ie of ce.entries??[])Xe.set(Ie.id,Ie);let wi=ce.ids??H?.ids??(ce.entries??[]).map((Ie)=>Ie.id),Ei=wi.map((Ie)=>Xe.get(Ie)).filter((Ie)=>Boolean(Ie)),It=H?.rail??[];if(ce.rail!==void 0){if(Array.isArray(ce.rail))It=ce.rail;else if(It=Array.isArray(ce.rail?.rail)?ce.rail.rail:Array.isArray(ce.rail?.items)?ce.rail.items:[],ce.rail?.has){if(fe?.reconcileHas?.(ce.rail.has),q&&!kr(ce.rail.has,q))Ue(!0)}}ie=It,G.setItems(It);let fn=H?.review??null;if(R.hasFeature("reviewmode"))try{let Ie=await R.rpc("thread.review",{thread:g});if(S!==te)return;fn=Ie.review??null}catch{}if(S!==te)return;let ki="unanswered"in ce?ce.unanswered??null:H?.unanswered??null,Ar=ce.h??H?.hashes??{};if(Fe(g,{entries:Ei,ids:wi,olderCursor:Te,review:fn,unanswered:ki,rail:It,hashes:Ar}),ye.setThread(Z,Ei,Boolean(Te),fn,ki),ui(g,S),q)Oe(q);return}let me;try{me=await R.rpc("thread.entries",{thread:g,limit:40})}catch(je){if(S===te){let ce=je instanceof Error&&je.message?je.message:"Could not load messages.";ye.setError(Z,ce,()=>{ze(g)})}return}if(S!==te)return;if(me.thread){let je=P.findIndex((ce)=>ce.id===me.thread.id);if(je>=0)P[je]=me.thread;else P.unshift(me.thread);ve()}Te=me.next??null;let Ve=null;if(R.hasFeature("reviewmode"))try{let je=await R.rpc("thread.review",{thread:g});if(S!==te)return;Ve=je.review??null}catch{}if(S!==te)return;let at=me.entries??[],ot=me.unanswered??null;Fe(g,{entries:at,ids:at.map((je)=>je.id),olderCursor:Te,review:Ve,unanswered:ot,rail:H?.rail??[],hashes:H?.hashes??{}}),ye.setThread(Z,at,Boolean(Te),Ve,ot);try{let ce=(await R.rpc("subscribe",{topic:"thread",thread:g})).sub??null;if(ce!==null){if(S!==te){R.rpc("unsubscribe",{sub:ce}).catch(()=>{});return}Ae=ce}}catch{}if(S!==te)return;if(Mt(g,S),ui(g,S),q)Oe(q)}async function ui(g,E){if(!g||!R.hasFeature("mgmt")){if(E===te)rt.clear();return}let S=P.find((H)=>H.id===g),T=S?.project?k.find((H)=>H.id===S.project)?.root??"":"";if(!T&&R.hasFeature("viewers"))try{let H=await R.rpc("viewer.files",{thread:g});if(E!==te)return;T=H.pcb||H.sch||H.root||""}catch{}if(E!==te)return;if(T)await rt.watchProject(T);else rt.clear()}async function mi(g){let E=te;for(let S=0;S<25&&E===te;S++){if(ye.goTo(g))return;if(!Te)return;let T=Te;if(await bi(),Te===T)return}}async function bi(){if(!D||!Te){ye.clearLoadingOlder();return}let g=te,E=D,S=Te;try{let T=await R.rpc("thread.entries",{thread:E,limit:40,before:S});if(g!==te||D!==E)return;Te=T.next??null,ye.prependEntries(T.entries??[],Boolean(Te))}catch{if(g===te)ye.clearLoadingOlder()}}async function Tt(g){try{let E=await R.rpc("thread.create",{project:g});if(E.thread)P=[E.thread,...P.filter((S)=>S.id!==E.thread.id)],Ce.setData(k,P,F,I),Ye(),await ze(E.thread.id),de.focus()}catch(E){Ne(E,"Could not create thread")}}let gt=null;function gi(g){return(g.split(` -`).map((E)=>E.trim()).find((E)=>E.length>0)??"").slice(0,200)}function Bt(g){gt=g,de.setReply(g?{who:g.role==="user"?m("secret.you","You"):m("model.col.agent","Agent"),line:gi(g.text)}:null,()=>{if(gt)mi(gt.id)},()=>Bt(null))}async function fi(g,E=[]){if(!D)return;let S=te,T=D,H=Va(),Z=`local-${H}`,me=gt&&g.trim()&&R.hasFeature("reply")?gt:null;if(me)Bt(null);ye.upsertEntry({id:Z,kind:"user",text:g,at:Date.now(),clientId:H,...me?{replyTo:{id:me.id,quote:gi(me.text)}}:{},attachments:E.map((Ve)=>({name:Ve.name,mime:Ve.mime,previewUrl:`data:${Ve.mime};base64,${Ve.data}`}))});try{let Ve={thread:T,text:g,clientId:H};if(E.length>0)Ve.attachments=E;if(me)Ve.replyTo={id:me.id,text:me.text};let at=await R.rpc("message.send",Ve);if(S!==te||D!==T)return;if(at.entry)ye.upsertEntry(at.entry)}catch(Ve){if(S===te&&D===T){if(ye.removeEntry(Z),de.setDraft(g),me&&!gt)Bt(me);Ne(Ve,"Failed to send message")}}}async function vi(g){if(!D)return;let E=te,S=D;try{let T=await R.rpc("composer.run",{thread:S,text:g});if(E!==te||D!==S)return;if(T.error)de.setDraft(g),Ne(new _t(T.error,{code:T.errorCode,machine:T.machine}),T.error);else if(T.kind==="btw"&&typeof T.a==="string")ye.showBtw(T.q??"",T.a);else if(T.kind==="edit"&&typeof T.text==="string")de.setDraft(T.text);else if(T.kind==="project")_.open({mode:"folder"});else if(T.kind==="clone")_.open({mode:"clone",repo:T.repo??"",text:T.text??""})}catch(T){if(E===te&&D===S)de.setDraft(g),Ne(T,"Command refused")}}async function dt(g,E){try{let S=await R.rpc("thread.act",{thread:g,action:E});if(S.thread){if(P=P.map((T)=>T.id===S.thread.id?S.thread:T),Ce.setData(k,P,F,I),S.thread.id===D)ye.updateThreadMeta(S.thread),ve()}Ye()}catch(S){de.showError(S instanceof Error?S.message:`Action "${E}" not allowed`)}}function yi(g,E){if(!g||!g.text||E-g.at>=300000)return"";let S=g.build.split("-").pop()??"";if(g.reason==="build"&&S)return m("hub.restarting.build",g.text,{build:S});if(g.reason==="stop")return m("hub.stopped",g.text);return m("hub.restarting",g.text)}function Zt(g){if(g==="connected")Ce.setConnStatus(m("gpui.acct.connected","Connected"),"bp-ok");else if(g==="reconnecting"&&yi(R.restarting,Date.now()))Ce.setConnStatus(yi(R.restarting,Date.now()),"");else if(g==="reconnecting")Ce.setConnStatus("Reconnecting…","bp-warn");else if(g==="revoked")Ce.setConnStatus(m("gpui.acct.sign.in.expired","Sign-in expired"),"bp-bad");else Ce.setConnStatus("Connecting…","")}en(()=>{Zt(R.getState()),j.textContent=m("gpui.improvements","Improvements"),Y.title=m("palette.settings","Settings"),Y.setAttribute("aria-label",m("palette.settings","Settings")),ve(),Ce.refreshLocale(),ye.refreshLocale(),de.refreshLocale(),G.render(),K.refreshLocale(),_e.refreshLocale(),_.refreshLocale()}),R.onState((g,E)=>{if(g==="connected"&&E){if(E.locale)hi=E.locale,xr();if(E.theme)Cr(E.theme);if(E.name)Ce.setHostName(E.name);if(Array.isArray(E.favoriteModels))J=E.favoriteModels,de.updateFavoriteModels(J);if(z=E.home??null,Ce.setHome(z),we(Vn(E.noProvider)),K.isOpen())K.refresh();Zt(g);let S=typeof E.hubBack==="string"?String(E.hubBack):"";if(S)try{let T=JSON.parse(S);if(T.reason==="crash")Ce.setConnStatus(m("hub.back.crash",T.text??""),"bp-warn"),window.setTimeout(()=>Zt(R.getState()),6000)}catch{}if(de.setFeatures(R.hasFeature("images"),R.hasFeature("voice")),Array.isArray(E.commands))Ee=E.commands,de.setCommands(Ee);else Ee=[];Lr(),_.reconcile()}else Ze.cancel(),Zt(g)}),R.onFrame((g)=>{if(g.t==="voice"){Ze.handleFrame(g);return}if(g.t==="info"&&g.info&&typeof g.info==="object"){let S=g.info;if(Object.prototype.hasOwnProperty.call(S,"provider.notice"))we(Vn(S["provider.notice"]));rt.handleInfo(S);return}if(g.t!=="d")return;let E=g;if(E.k==="clone"||E.k==="clone.repos"||E.k==="clone.signin"){_.handleFrame(E);return}switch(E.k){case"project":{let S=E.project;if(!S)break;let T=k.findIndex((H)=>H.id===S.id);if(T>=0)k[T]=S;else k.unshift(S);Ce.setData(k,P,F,I),ve(),Qt();break}case"thread":{let S=E.thread;if(!S)break;let T=P.findIndex((H)=>H.id===S.id);if(T>=0)P[T]=S;else P.unshift(S);if(Ce.setData(k,P,F,I),S.id===D)ye.updateThreadMeta(S),ve(),de.setState(!0,S.state==="working");Qt();break}case"thread.removed":{let S=String(E.id??"");P=P.filter((T)=>T.id!==S),Ce.setData(k,P,F,I),Qt();break}case"entry":{if(E.thread===D&&E.entry)ye.upsertEntry(E.entry);break}case"text":{if(E.thread===D)ye.appendLiveText(String(E.entry??""),String(E.append??""),Number(E.at??Date.now()));break}case"turn":{if(E.thread===D){let S=String(E.state??"idle");de.setState(!0,S==="working"),Mt(D,te)}Qt();break}case"btw":{if(E.thread===D)ye.showBtw(String(E.q??""),String(E.a??""));break}case"unanswered":{if(E.thread===D)ye.setUnanswered(E.unanswered??null);break}case"theme":{if(typeof E.theme==="string")Cr(E.theme);break}case"home":{if(z=E.home??null,Ce.setHome(z),K.isOpen())K.refresh();break}case"favorites":{if(Array.isArray(E.favorites))J=E.favorites.filter((S)=>typeof S==="string"),de.updateFavoriteModels(J);break}default:break}}),window.addEventListener("keydown",(g)=>{let E=g.key.toLowerCase();if((g.ctrlKey||g.metaKey)&&(E==="k"||g.shiftKey&&E==="p"))if(g.preventDefault(),W.isOpen())W.close();else W.open();else if(g.key==="Escape"){if(W.isOpen())W.close();else if(de.isModelPickerOpen())de.closeModelPicker();else if(_.isOpen())_.escape();else if(K.isOpen())K.handleEscape();else if(ye.closePlanRevise());else if(rt.isOpen())rt.closePanel()}}),R.connect()}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",Pr);else Pr(); +`;function Ze(e){let t=e/255;return t<=0.04045?t/12.92:Math.pow((t+0.055)/1.055,2.4)}var $o=[Ze(77),Ze(83),Ze(94)],Oo=[Ze(53),Ze(58),Ze(67)],Go=[Ze(245),Ze(246),Ze(248)],Vo=[Ze(225),Ze(228),Ze(233)];function fr(e,t,n){let i=e.createShader(t);if(!i)throw Error("createShader failed");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){let s=e.getShaderInfoLog(i)||"shader compile error";throw e.deleteShader(i),Error(s)}return i}function vr(e,t,n){let i=fr(e,e.VERTEX_SHADER,t),s=fr(e,e.FRAGMENT_SHADER,n),r=e.createProgram();if(!r)throw Error("createProgram failed");if(e.attachShader(r,i),e.attachShader(r,s),e.linkProgram(r),e.deleteShader(i),e.deleteShader(s),!e.getProgramParameter(r,e.LINK_STATUS)){let o=e.getProgramInfoLog(r)||"program link error";throw e.deleteProgram(r),Error(o)}return r}function Uo(e,t){let n=new Float32Array(16);for(let i=0;i<4;i++)for(let s=0;s<4;s++)n[i*4+s]=e[0+s]*t[i*4+0]+e[4+s]*t[i*4+1]+e[8+s]*t[i*4+2]+e[12+s]*t[i*4+3];return n}function Wo(e,t,n,i){let s=1/Math.tan(e*0.5),r=1/(n-i),o=new Float32Array(16);return o[0]=s/t,o[5]=s,o[10]=(i+n)*r,o[11]=-1,o[14]=2*i*n*r,o}function wr(e){let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]}function yr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function pi(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}class hi{canvas;gl=null;bgProg=null;bgVao=null;uBgTop=null;uBgBot=null;prog=null;uMvp=null;uEye=null;uRight=null;uUp=null;uFwd=null;uFade=null;worker=null;boardBatch=null;partBatches=[];activeKey="";lastMeshId="";nextJobId=1;partsTotal=0;partsDone=0;center=[0,0,0];target=[0,0,0];radius=50;dist=120;yaw=0.6;pitch=0.7;lightTheme=!1;dirty=!1;rafId=0;pointers=new Map;pinchDist=0;resizeObs;cbs;constructor(e,t={}){this.cbs=t,this.canvas=document.createElement("canvas"),this.canvas.className="bp-viewer-canvas",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.touchAction="none",e.appendChild(this.canvas);let n=this.canvas.getContext("webgl2",{antialias:!0,alpha:!1,preserveDrawingBuffer:!0});if(n)this.gl=n,this.bgProg=vr(n,jo,Ho),this.bgVao=n.createVertexArray(),this.uBgTop=n.getUniformLocation(this.bgProg,"uBgTop"),this.uBgBot=n.getUniformLocation(this.bgProg,"uBgBot"),this.prog=vr(n,Do,Fo),this.uMvp=n.getUniformLocation(this.prog,"uMvp"),this.uEye=n.getUniformLocation(this.prog,"uEye"),this.uRight=n.getUniformLocation(this.prog,"uRight"),this.uUp=n.getUniformLocation(this.prog,"uUp"),this.uFwd=n.getUniformLocation(this.prog,"uFwd"),this.uFade=n.getUniformLocation(this.prog,"uFade"),n.enable(n.DEPTH_TEST),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);else this.cbs.onStatus?.("WebGL2 is unavailable in this browser");try{this.worker=new Worker("/assets/mesh-worker.js",{type:"module"}),this.worker.onmessage=(i)=>this.onWorkerMessage(i.data)}catch{this.cbs.onStatus?.("3D worker unavailable")}this.resizeObs=new ResizeObserver(()=>this.scheduleDraw()),this.resizeObs.observe(this.canvas),this.canvas.addEventListener("pointerdown",this.onPointerDown),this.canvas.addEventListener("pointermove",this.onPointerMove),this.canvas.addEventListener("pointerup",this.onPointerUp),this.canvas.addEventListener("pointercancel",this.onPointerUp),this.canvas.addEventListener("wheel",this.onWheel,{passive:!1}),this.canvas.addEventListener("dblclick",this.onDblClick),this.canvas.addEventListener("contextmenu",this.onContextMenu)}keptToken(){return this.activeKey&&this.lastMeshId?`${this.activeKey} ${this.lastMeshId}`:""}setTheme(e){if(this.lightTheme!==e)this.lightTheme=e,this.scheduleDraw()}handleFrame(e){let t=typeof e.key==="string"?e.key:"";if(!t)return;if(e.mesh instanceof Uint8Array&&typeof e.n==="number"&&!e.part){this.activeKey=t,this.lastMeshId=ir(e.mesh),this.clearParts(),this.cbs.onStatus?.("Building 3D model…");let n=new Uint8Array(e.mesh),i=e.faces instanceof Uint8Array?new Uint8Array(e.faces):void 0,s=[n.buffer];if(i)s.push(i.buffer);this.worker?.postMessage({id:this.nextJobId++,kind:"solid",key:t,n:e.n,mesh:n,faces:i},s);return}if(e.parts&&typeof e.parts==="object"&&!Array.isArray(e.parts)&&!(e.parts instanceof Uint8Array)){if(this.activeKey&&t!==this.activeKey)return;if(this.activeKey=t,this.clearParts(),this.partsTotal=typeof e.parts.of==="number"?e.parts.of:0,this.partsDone=0,this.partsTotal>0)this.cbs.onStatus?.(`Loading parts 0/${this.partsTotal}…`);this.scheduleDraw();return}if(typeof e.part==="string"&&e.mesh instanceof Uint8Array&&e.at instanceof Uint8Array&&typeof e.n==="number"){if(this.activeKey&&t!==this.activeKey)return;let n=new Uint8Array(e.mesh),i=new Uint8Array(e.at),s=e.faces instanceof Uint8Array?new Uint8Array(e.faces):void 0,r=[n.buffer,i.buffer];if(s)r.push(s.buffer);this.worker?.postMessage({id:this.nextJobId++,kind:"part",key:t,partId:e.part,n:e.n,mesh:n,at:i,faces:s,refs:Array.isArray(e.refs)?e.refs:[],done:typeof e.done==="number"?e.done:0},r)}}onWorkerMessage(e){if(e.error){this.cbs.onStatus?.(e.error);return}if(e.key!==this.activeKey||!this.gl)return;if(e.kind==="solid")this.deleteBatch(this.boardBatch),this.boardBatch=this.uploadBatch(e.positions,e.normals,e.colors,0),this.center=[e.center[0],e.center[1],e.center[2]],this.target=[e.center[0],e.center[1],e.center[2]],this.radius=e.radius,this.fit(),this.cbs.onStatus?.(""),this.scheduleDraw();else if(e.kind==="part"){let t=this.uploadBatch(e.positions,e.normals,e.colors,performance.now());if(t)this.partBatches.push(t);if(this.partsDone=e.done||this.partsDone+1,this.partsTotal>0&&this.partsDone>>24===0)r++;else o++;let a=r>0?new Float32Array(r*9):null,c=r>0?new Float32Array(r*9):null,p=r>0?new Float32Array(r*12):null,l=o>0?new Float32Array(o*9):null,h=o>0?new Float32Array(o*9):null,d=o>0?new Float32Array(o*12):null,m=0,f=0;for(let w=0;w>>24&255,L=1-k/255,M=(E>>>16&255)/255,A=(E>>>8&255)/255,B=(E&255)/255,T=w*9;if(k===0&&a&&c&&p){let H=m*9;for(let P=0;P<9;P++)a[H+P]=e[T+P],c[H+P]=t[T+P];let O=m*12;for(let P=0;P<3;P++)p[O+P*4]=M,p[O+P*4+1]=A,p[O+P*4+2]=B,p[O+P*4+3]=1;m++}else if(l&&h&&d){let H=f*9;for(let P=0;P<9;P++)l[H+P]=e[T+P],h[H+P]=t[T+P];let O=f*12;for(let P=0;P<3;P++)d[O+P*4]=M,d[O+P*4+1]=A,d[O+P*4+2]=B,d[O+P*4+3]=L;f++}}let b=a&&c&&p?this.createSubBatch(a,c,p,r*3):null,v=l&&h&&d?this.createSubBatch(l,h,d,o*3):null;if(!b&&!v)return null;return{opaque:b,translucent:v,fadeStartMs:i}}deleteSubBatch(e){let t=this.gl;if(!t||!e)return;t.deleteVertexArray(e.vao),t.deleteBuffer(e.posBuf),t.deleteBuffer(e.nrmBuf),t.deleteBuffer(e.colBuf)}deleteBatch(e){if(!e)return;this.deleteSubBatch(e.opaque),this.deleteSubBatch(e.translucent)}clearParts(){for(let e of this.partBatches)this.deleteBatch(e);this.partBatches=[]}fit(){this.setView("fit")}setView(e){let t=35*Math.PI/180;this.dist=this.radius/Math.sin(t*0.5)*1.15,this.target=[this.center[0],this.center[1],this.center[2]];let{yaw:n,pitch:i}=gr(e);this.yaw=n,this.pitch=i,this.scheduleDraw()}snapPng(){return this.draw(performance.now()),new Promise((e)=>{this.canvas.toBlob((t)=>e(t),"image/png")})}scheduleDraw(){if(this.dirty)return;this.dirty=!0,this.rafId=requestAnimationFrame((e)=>{if(this.dirty=!1,this.rafId=0,this.draw(e))this.scheduleDraw()})}drawSubBatch(e){if(!e||!this.gl)return;this.gl.bindVertexArray(e.vao),this.gl.drawArrays(this.gl.TRIANGLES,0,e.vertCount)}draw(e){let t=this.gl;if(!t||!this.prog)return!1;let n=this.canvas.getBoundingClientRect(),i=Math.max(1,Math.round(n.width)),s=Math.max(1,Math.round(n.height)),r=Math.min(window.devicePixelRatio||1,2),o=Math.round(i*r),a=Math.round(s*r);if(this.canvas.width!==o||this.canvas.height!==a)this.canvas.width=o,this.canvas.height=a;if(t.viewport(0,0,o,a),!this.boardBatch&&this.partBatches.length===0)return!1;if(t.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT),this.bgProg&&this.bgVao){t.disable(t.DEPTH_TEST),t.disable(t.BLEND),t.depthMask(!1),t.useProgram(this.bgProg);let H=this.lightTheme?Go:$o,O=this.lightTheme?Vo:Oo;t.uniform3f(this.uBgTop,H[0],H[1],H[2]),t.uniform3f(this.uBgBot,O[0],O[1],O[2]),t.bindVertexArray(this.bgVao),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindVertexArray(null)}let c=Math.cos(this.pitch),p=Math.sin(this.pitch),l=Math.cos(this.yaw),h=Math.sin(this.yaw),d=[this.target[0]+this.dist*c*h,this.target[1]-this.dist*c*l,this.target[2]+this.dist*p],m=wr([this.target[0]-d[0],this.target[1]-d[1],this.target[2]-d[2]]),f=Math.abs(m[2])>0.99?[0,1,0]:[0,0,1],b=wr(yr(m,f)),v=yr(b,m),w=new Float32Array([b[0],v[0],-m[0],0,b[1],v[1],-m[1],0,b[2],v[2],-m[2],0,-pi(b,d),-pi(v,d),pi(m,d),1]),E=Math.max(0.05,this.dist*0.01),k=Math.max(this.dist*10,this.radius*20),L=Wo(35*Math.PI/180,o/a,E,k),M=Uo(L,w);t.useProgram(this.prog),t.uniformMatrix4fv(this.uMvp,!1,M),t.uniform3f(this.uEye,d[0],d[1],d[2]),t.uniform3f(this.uRight,b[0],b[1],b[2]),t.uniform3f(this.uUp,v[0],v[1],v[2]),t.uniform3f(this.uFwd,m[0],m[1],m[2]);let A=!1,B=[],T=[];for(let H of this.partBatches){let O=e-H.fadeStartMs,P=H.fadeStartMs===0?1:Math.min(1,Math.max(0,O/300));if(P<1){if(A=!0,P>0)T.push({batch:H,fade:P})}else B.push(H)}if(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.disable(t.BLEND),t.uniform1f(this.uFade,1),this.boardBatch)this.drawSubBatch(this.boardBatch.opaque);for(let H of B)this.drawSubBatch(H.opaque);if(t.depthMask(!1),t.enable(t.BLEND),t.uniform1f(this.uFade,1),this.boardBatch)this.drawSubBatch(this.boardBatch.translucent);for(let H of B)this.drawSubBatch(H.translucent);for(let{batch:H,fade:O}of T)t.uniform1f(this.uFade,O),this.drawSubBatch(H.opaque),this.drawSubBatch(H.translucent);return t.depthMask(!0),t.bindVertexArray(null),A}onPointerDown=(e)=>{if(this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY,button:e.button,shift:e.shiftKey}),this.pointers.size===2){let[t,n]=Array.from(this.pointers.values());this.pinchDist=Math.hypot(n.x-t.x,n.y-t.y)||1}};onPointerMove=(e)=>{let t=this.pointers.get(e.pointerId);if(!t)return;let n=e.clientX-t.x,i=e.clientY-t.y;if(t.x=e.clientX,t.y=e.clientY,this.pointers.size===2){let[s,r]=Array.from(this.pointers.values()),o=Math.hypot(r.x-s.x,r.y-s.y)||1;if(this.pinchDist>0)this.dist=Math.max(this.radius*0.05,Math.min(this.radius*20,this.dist*(this.pinchDist/o)));this.pinchDist=o,this.cbs.onUserMove?.(),this.scheduleDraw();return}if(t.button===2||t.button===1||t.shift){let s=this.dist*0.0014,r=Math.cos(this.yaw),o=Math.sin(this.yaw);this.target[0]-=n*r*s,this.target[1]-=n*o*s,this.target[2]+=i*s}else this.yaw+=n*0.008,this.pitch=Math.max(-Math.PI*0.49,Math.min(Math.PI*0.49,this.pitch+i*0.008));this.cbs.onUserMove?.(),this.scheduleDraw()};onPointerUp=(e)=>{if(this.pointers.delete(e.pointerId),this.pointers.size<2)this.pinchDist=0};onWheel=(e)=>{e.preventDefault();let t=e.deltaY<0?0.8620689655172414:1.16;this.dist=Math.max(this.radius*0.05,Math.min(this.radius*20,this.dist*t)),this.cbs.onUserMove?.(),this.scheduleDraw()};onDblClick=()=>{this.fit()};onContextMenu=(e)=>{e.preventDefault()};destroy(){if(this.rafId)cancelAnimationFrame(this.rafId);if(this.resizeObs.disconnect(),this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("dblclick",this.onDblClick),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.deleteBatch(this.boardBatch),this.clearParts(),this.gl){if(this.bgVao)this.gl.deleteVertexArray(this.bgVao);if(this.bgProg)this.gl.deleteProgram(this.bgProg);if(this.prog)this.gl.deleteProgram(this.prog)}this.worker?.terminate(),this.canvas.remove()}}var Er=64,_o=16777216;function zo(e,t){switch(e){case"board":case"3d":return t.board!==!1;case"schematic":return t.schematic!==!1;case"mech":return t.mech!==!1;case"gerbers":return t.gerbers!==!1;default:return!0}}function Jt(e){if(!e)return"";let t=e.replace(/\\/g,"/").replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function Cr(e){switch(e){case"board":return u("viewer.board","Board");case"schematic":return u("viewer.schematic","Schematic");case"3d":return u("viewer.solid","3D");case"gerbers":return u("gpui.gerbers","Gerbers");case"mech":return u("viewer.mech","Mech");case"files":return u("viewer.files","Files");case"diff":return u("viewer.diff","Diff");case"review":return u("viewer.review","Review");case"browser":return u("bots.tab.browser","Browser");case"terminal":return u("viewer.terminal","Terminal");default:return e?e.charAt(0).toUpperCase()+e.slice(1):""}}function ui(e){return e==="board"||e==="schematic"||e==="gerbers"}function qo(e){return e==="files"||e==="diff"||e==="review"||e==="browser"||e==="terminal"}function mi(e,t){let n=document.createElement("div");n.className="bp-vh";let i=document.createElement("div");i.className="bp-vh-title";let s=document.createElement("span");s.className="bp-vh-page";let r=document.createElement("span");r.className="bp-vh-sep",r.textContent="·",r.hidden=!0;let o=document.createElement("span");o.className="bp-vh-file",o.hidden=!0,i.append(s,r,o);let a=document.createElement("div");a.className="bp-vh-actions",n.append(i,a);let c=document.createElement("div");c.className="bp-solid-bar",c.setAttribute("data-testid","solid-presets-bar"),c.hidden=!0;let p=document.createElement("div");p.className="bp-v-banner",p.hidden=!0;let l=document.createElement("div");l.className="bp-v-stage-wrap";let h=document.createElement("div");h.className="bp-v-stage";let d=document.createElement("div");d.className="bp-v-overlay",d.hidden=!0;let m=document.createElement("div");m.className="bp-v-layers",m.hidden=!0;let f=document.createElement("div");f.className="bp-v-info",f.hidden=!0,l.append(h,d,m,f);let b=document.createElement("div");b.className="bp-history-bar",b.setAttribute("data-testid","viewer-history-bar"),b.hidden=!0,e.replaceChildren(n,c,p,l,b);let v="",w="",E=0,k=!1,L=new Set,M=[],A=0,B=new Map,T=new Map,H={},O=[],P="",Y="",re=!1,ie=!1,ue=0,Pe=!1,Ce=0,te="",oe=0,R=null,me=null,de=null,ee=null,ge=null,C=new di,x=0,F=!1,I="",J="",se="",ye="";document.addEventListener("click",(V)=>{if(!F)return;if(V.target instanceof Node&&b.contains(V.target))return;F=!1,Le()}),document.addEventListener("keydown",(V)=>{if(F&&V.key==="Escape")F=!1,Le()});function D(){if(x)window.clearInterval(x),x=0;C.playing=!1}function ne(){let V=w==="3d"||w==="mech";if(c.hidden=!V,!V)return;if(c.childElementCount>0)return;for(let _ of br){let G=document.createElement("button");G.type="button",G.className="bp-v-btn",G.textContent=_.label,G.setAttribute("data-testid",`solid-view-${_.id}`),G.addEventListener("click",()=>{de?.setView(_.id)}),c.append(G)}let W=document.createElement("button");W.type="button",W.className="bp-v-btn",W.textContent="Snap view",W.setAttribute("data-testid","solid-snap"),W.addEventListener("click",()=>{if(!de)return;de.snapPng().then((_)=>{if(!_)return;let G=URL.createObjectURL(_),z=document.createElement("a");z.href=G;let ae=($e()||w||"view").replace(/[^a-zA-Z0-9._-]/g,"_");z.download=`${ae}-snap.png`,z.click(),setTimeout(()=>URL.revokeObjectURL(G),1000)})}),c.append(W)}async function Te(){if(!v||w!=="board"&&w!=="schematic")return;Le();let V=C.compareRequest();if(!V){I="",J="",se="",ye="",await ht(!1);return}let W=`${w}|${V.commit}|${V.bits}|${Y}`;if(W===ye&&L.size>0){He(C.highlightEdits?`Comparing against ${C.activeRef()?.label||V.commit.slice(0,7)} (edits highlighted)`:`Comparing against ${C.activeRef()?.label||V.commit.slice(0,7)}`,!1);return}let _=++E;L.clear(),B.clear(),ve(),k=!0,I="",J=V.commit,se="",ye=W;try{let G=Y||(w==="schematic"?H.sch:H.pcb)||"";if(!G){let ke=await t.hub.rpc("viewer.files",{thread:v});if(_!==E)return;H=ke||{},Oe(),G=(w==="schematic"?H.sch:H.pcb)||""}if(!G)throw Error(`Unable to resolve ${w} file path for compare`);let z=await t.hub.rpc("viewer.compare",{thread:v,kind:w,commit:V.commit,bits:V.bits,...Y?{path:Y}:{}});if(_!==E)return;let ae=typeof z?.root==="string"?z.root:"",K=w==="schematic"?"1":"0";I=ae?`${K}|${ae}|diff +`:`${K}|`,J=V.commit,se=G.startsWith("/")||/^[A-Za-z]:[\\/]/.test(G)||!ae?G:`${ae.replace(/\/+$/,"")}/${G.replace(/^\/+/,"")}`,k=!1;let we=M;ve();for(let ke of we)if(ke.kind==="bin")tt(ke.buf);else et(ke.key,ke.none,ke.retryable,ke.big);He(C.highlightEdits?`Comparing against ${C.activeRef()?.label||V.commit.slice(0,7)} (edits highlighted)`:`Viewing snapshot: ${C.activeRef()?.label||V.commit.slice(0,7)}`,!1)}catch(G){if(_!==E)return;k=!1,I="",J="",se="",ye="",ve(),He(G instanceof Error?G.message:String(G),!0)}}function Le(){let V=w==="board"||w==="schematic";if(b.hidden=!V,!V)return;let W=document.createElement("div");W.className="bp-history-group";let _=document.createElement("button");_.type="button",_.className="bp-v-btn",_.textContent="<",_.title="Older snapshot",_.disabled=C.refs.length===0||C.index>=C.refs.length-1,_.setAttribute("data-testid","history-prev"),_.addEventListener("click",()=>{if(D(),C.step(1))Te()});let G=document.createElement("button");G.type="button",G.className="bp-v-btn"+(C.playing?" is-on":""),G.textContent=C.playing?"⏸":"▶",G.title=C.playing?"Pause history":"Play history",G.disabled=C.refs.length===0,G.setAttribute("data-testid","history-play"),G.addEventListener("click",()=>{if(C.playing){D(),Le();return}if(C.refs.length===0)return;if(C.playing=!0,C.isLive())C.index=C.refs.length-1,Te();else Le();x=window.setInterval(()=>{if(!C.playing||w!=="board"&&w!=="schematic"){D(),Le();return}if(C.step(-1))Te();else D(),Le()},1400)});let z=document.createElement("button");z.type="button",z.className="bp-v-btn",z.textContent=">",z.title="Newer snapshot",z.disabled=C.isLive(),z.setAttribute("data-testid","history-next"),z.addEventListener("click",()=>{if(D(),C.step(-1))Te()});let ae=document.createElement("button");ae.type="button",ae.className="bp-v-btn"+(C.isLive()?" is-on":""),ae.textContent="Live",ae.setAttribute("data-testid","history-live"),ae.addEventListener("click",()=>{if(D(),C.goLive())He("",!1),Te()});let K=document.createElement("span");K.className="bp-history-label",K.setAttribute("data-testid","history-label");let we=C.activeRef();K.textContent=we?we.label||we.commit.slice(0,7):C.refs.length>0?`Live (${C.refs.length} saved)`:"Live",W.append(_,G,z,ae,K);let ke=document.createElement("div");ke.className="bp-history-group";let Ae=document.createElement("button");Ae.type="button",Ae.className="bp-v-btn"+(C.highlightEdits?" is-on":""),Ae.textContent="Highlight edits",Ae.disabled=C.refs.length===0,Ae.setAttribute("data-testid","history-highlight"),Ae.addEventListener("click",()=>{D(),C.toggleHighlight(),Te()});let Ge=document.createElement("div");Ge.className="bp-history-menu-wrap";let je=document.createElement("button");if(je.type="button",je.className="bp-v-btn"+(F||!C.isLive()?" is-on":""),je.disabled=C.refs.length===0,je.setAttribute("data-testid","history-compare"),je.setAttribute("aria-haspopup","menu"),je.setAttribute("aria-expanded",String(F)),je.textContent=we?`Compare: ${we.label||we.commit.slice(0,7)} ▾`:"Compare ▾",je.addEventListener("click",(De)=>{De.stopPropagation(),F=!F,Le()}),Ge.append(je),F&&C.refs.length>0){let De=document.createElement("div");De.className="bp-history-menu",De.setAttribute("role","menu"),De.setAttribute("data-testid","history-compare-menu");let Ie=(Ve,ut,tn)=>{let at=document.createElement("button");at.type="button",at.className="bp-history-menu-item"+(tn?" is-active":""),at.setAttribute("role","menuitem"),at.setAttribute("data-commit",ut),at.textContent=Ve,at.addEventListener("click",()=>{if(F=!1,D(),C.selectCommit(ut)){if(C.isLive())He("",!1);Te()}else Le()}),De.append(at)};Ie("Live (working tree)","",C.isLive());for(let Ve of C.refs)Ie(Ve.label||Ve.commit.slice(0,7),Ve.commit,we?.commit===Ve.commit);Ge.append(De)}ke.append(Ae,Ge),b.replaceChildren(W,ke)}async function Be(V){if(!V)return;try{let W=await t.hub.rpc("viewer.refs",{thread:V});if(V!==v)return;C.setRefs(Array.isArray(W?.refs)?W.refs:[]),Le()}catch{if(V!==v)return;C.setRefs([]),Le()}}function q(){return document.documentElement.classList.contains("light")}let fe=new MutationObserver(()=>{let V=q();me?.setTheme(V),de?.setTheme(V),ge?.setTheme(V)});fe.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});function le(V,W="",_=!1,G=""){if(V==="none"){d.hidden=!0,d.replaceChildren();return}d.hidden=!1,d.className=`bp-v-overlay is-${V}`;let z=document.createElement("div");z.className="bp-v-state-card";let ae=document.createElement("div");if(ae.className="bp-v-state-msg",ae.textContent=W,z.append(ae),_){let K=document.createElement("button");K.type="button",K.className="bp-v-btn is-primary",K.textContent=u("tools.retry","Retry"),K.addEventListener("click",()=>void ht(!0)),z.append(K)}if(G){let K=document.createElement("div");K.className="bp-v-state-msg",K.textContent=u("gpui.c.solid.big.next","Loading it may take a while and a lot of memory.");let we=document.createElement("button");we.type="button",we.className="bp-v-btn is-primary",we.textContent=u("gpui.c.solid.load.big","Load it anyway"),we.addEventListener("click",()=>{le("loading",u("gpui.c.solid.loading.big","Loading it anyway…")),t.hub.rpc("kicad.big",{key:G}).catch(()=>le("error",W,!1,G))}),z.append(K,we)}d.replaceChildren(z)}function He(V,W){p.textContent=V,p.hidden=!V,p.classList.toggle("is-warn",W)}function $e(){if(Y)return Jt(Y);if(w==="board"||w==="3d")return Jt(H.pcb);if(w==="schematic")return Jt(H.sch);if(w==="mech")return Jt(P);return""}function Oe(){s.textContent=Cr(w);let V=$e();if(r.hidden=!V,o.hidden=!V,o.textContent=V,a.replaceChildren(),w==="mech"&&O.length>1){let _=document.createElement("select");_.className="bp-v-select",_.setAttribute("aria-label",u("viewer.mech","Mech"));for(let G of O){let z=document.createElement("option");z.value=G,z.textContent=Jt(G),z.selected=G===P,_.append(z)}_.addEventListener("change",()=>{P=_.value,Oe(),ht(!1)}),a.append(_)}if(ui(w)){let _=document.createElement("button");_.type="button",_.className="bp-v-btn"+(Pe?" is-on":""),_.textContent=R?.layerHead||"Layers",_.setAttribute("data-testid","viewer-layers-btn"),_.addEventListener("click",()=>{if(Pe=!Pe,m.hidden=!Pe,_.classList.toggle("is-on",Pe),Pe)We("","")}),a.append(_)}if(w==="board"||w==="schematic"||w==="3d"||w==="mech"||w==="gerbers"){let _=document.createElement("button");_.type="button",_.className="bp-v-btn",_.textContent="Fit",_.setAttribute("data-testid","viewer-fit-btn"),_.addEventListener("click",()=>{me?.fit(),de?.fit()}),a.append(_)}if((w==="board"||w==="schematic")&&t.hub.hasFeature("follow")){let _=document.createElement("button");_.type="button",_.className="bp-v-btn"+(re&&!ie?" is-on":""),_.textContent=re?ie?u("gpui.follow.paused","Follow (paused)"):"Follow agent":"Follow agent",_.setAttribute("data-testid","viewer-follow-btn"),_.addEventListener("click",()=>void Qt()),a.append(_)}let W=document.createElement("button");W.type="button",W.className="bp-v-btn bp-v-close",W.textContent="✕",W.title=u("common.close","Close"),W.setAttribute("aria-label",u("common.close","Close")),W.setAttribute("data-testid","viewer-close-btn"),W.addEventListener("click",()=>t.closeViewer()),a.append(W)}function Ne(){if(!R){m.replaceChildren();return}let V=document.createDocumentFragment(),W=document.createElement("div");W.className="bp-v-layers-head";let _=document.createElement("span");if(_.textContent=R.layerHead||"Layers",W.append(_),R.layerReset){let K=document.createElement("button");K.type="button",K.className="bp-v-btn",K.textContent="Reset",K.addEventListener("click",()=>void We("reset","")),W.append(K)}if(V.append(W),R.layerModes){let K=document.createElement("div");K.className="bp-v-layers-modes",["All","Dim","Only"].forEach((we,ke)=>{let Ae=document.createElement("button");Ae.type="button",Ae.className="bp-v-btn"+(R?.layerMode===ke?" is-on":""),Ae.textContent=we,Ae.addEventListener("click",()=>void We("mode",String(ke))),K.append(Ae)}),V.append(K)}let G=me?.presentColors()??new Map,z=(R.layerList||[]).concat(R.layerMarks||[]),ae=document.createElement("div");ae.className="bp-v-layers-list";for(let K of z){let we=G.get(K.layer);if(we===void 0)continue;let ke=document.createElement("div");ke.className="bp-v-layer-row"+(K.active?" is-focus":"");let Ae=document.createElement("input");Ae.type="checkbox",Ae.checked=K.on!==!1,Ae.addEventListener("change",()=>void We("toggle",String(K.layer)));let Ge=document.createElement("span");Ge.className="bp-v-layer-swatch";let je=we>>>16&255,De=we>>>8&255,Ie=we&255;Ge.style.background=K.on!==!1?`rgb(${je},${De},${Ie})`:`rgba(${je},${De},${Ie},0.2)`;let Ve=document.createElement("button");Ve.type="button",Ve.className="bp-v-layer-name",Ve.textContent=K.name,Ve.addEventListener("click",()=>void We("pick",String(K.layer))),ke.append(Ae,Ge,Ve),ae.append(ke)}V.append(ae),m.replaceChildren(V)}async function We(V,W){if(!ui(w))return;let _=E;try{let G=await t.hub.rpc("viewer.layers",{kind:w,present:oe,off:Ce,focus:te,...V?{action:V,value:W}:{}});if(_!==E||!G)return;Ce=Number(G.own)||0,te=typeof G.focus==="string"?G.focus:"",R=G;let z={off:Number(G.off)||0,dim:Number(G.dim)||0,lift:typeof G.lift==="number"?G.lift:255};if(me?.setLayers(z),Oe(),Pe)Ne()}catch{}}async function ze(){if(!re||ie||!v||!t.hub.hasFeature("follow"))return;ie=!0,Oe();try{await t.hub.rpc("viewer.follow",{thread:v,action:"pause"})}catch{}}async function Qt(){if(!v||!t.hub.hasFeature("follow"))return;let V=!re?"on":ie?"resume":"off";try{let W=await t.hub.rpc("viewer.follow",{thread:v,action:V});if(re=!!W.on,ie=!!W.paused,Oe(),W.on&&!W.paused&&W.focus&&Array.isArray(W.focus.box)&&W.focus.box.length===4&&(W.seq||0)>ue)ue=W.seq||ue,me?.zoomToBoxMm([W.focus.box[0],W.focus.box[1],W.focus.box[2],W.focus.box[3]])}catch{}}function rt(){f.hidden=!0,f.replaceChildren(),me?.setHighlights([])}function Zt(V){let W=V.split(";").filter(Boolean),_=W.shift()||V,G=[],z="",ae="";for(let Ge of W){if(Ge.startsWith("g="))continue;let je=Ge.indexOf("=");if(je>0){let De=Ge.slice(0,je),Ie=Ge.slice(je+1);if((De==="ref"||De==="symbol")&&!z)z=Ie;if(De==="net"&&!ae)ae=Ie;G.push([De,Ie])}else G.push([Ge,""])}let K=document.createElement("div");K.className="bp-v-info-head";let we=document.createElement("span");we.className="bp-v-info-title",we.textContent=_;let ke=document.createElement("button");ke.type="button",ke.className="bp-v-info-x",ke.textContent="×",ke.setAttribute("aria-label","Clear selection"),ke.addEventListener("click",rt),K.append(we,ke);let Ae=document.createElement("div");Ae.className="bp-v-info-rows";for(let[Ge,je]of G){let De=document.createElement("span");De.className="bp-v-info-chip",De.textContent=je?`${Ge}: ${je}`:Ge,Ae.append(De)}return f.replaceChildren(K,...G.length>0?[Ae]:[]),f.hidden=!1,{ref:z||void 0,net:ae||void 0}}async function It(V){if(!V){rt();return}let W=Array.from(L)[0]||"";if(!W)return;let _=E;try{let G=await t.hub.rpc("viewer.info",{key:W,at:V.at,idx:V.idx});if(_!==E)return;let z=typeof G.info==="string"?G.info:"";if(!z){rt();return}let{ref:ae,net:K}=Zt(z),we=[];if(ae)we.push(["ref",ae]);if(K)we.push(["net",K]);let ke=[[V.at,V.idx]];for(let[Ae,Ge]of we){let je=await t.hub.rpc("viewer.probe",{key:W,name:Ae,value:Ge});if(_!==E)return;if(Array.isArray(je.matches))for(let De of je.matches)ke.push(De)}me?.setHighlights(ke)}catch{rt()}}function Ee(){ee?.destroy(),ee=null,ge?.destroy(),ge=null,me?.destroy(),me=null,de?.destroy(),de=null,h.replaceChildren(),Pe=!1,m.hidden=!0,f.hidden=!0,f.replaceChildren(),He("",!1),le("none")}function ve(){M=[],A=0}async function ht(V){if(!v||!w)return;let W=++E;if(L.clear(),k=!1,ve(),Ee(),Oe(),ne(),Le(),(w==="board"||w==="schematic")&&v)Be(v);if(qo(w)){if(t.hub.rpc("viewer.watch",{thread:v,kind:""}).catch(()=>{}),w==="files")ee=pr(h,t,v,(z,ae)=>{if(w=z,Y=ae,z==="mech")P=ae;ht(!1)});else if(w==="diff")ee=hr(h,t,v);else if(w==="review")ee=ur(h,t,v);else if(w==="browser")ee=lr(h,t,v);else if(w==="terminal")le("loading","Loading terminal…"),import("/assets/terminal.js").then((ae)=>{if(W!==E)return;if(le("none"),ae?.mountTerminalPane)ge=ae.mountTerminalPane(h,t,v,q());else le("error","Terminal chunk missing",!0)},(ae)=>{if(W!==E)return;le("error",ae instanceof Error?ae.message:String(ae),!0)});return}if(le("loading","Loading…"),!H.root)try{let z=await t.hub.rpc("viewer.files",{thread:v});if(W!==E)return;H=z||{},Oe()}catch{}if(w==="gerbers"&&H.hasGerbers===!1){le("empty","No Gerbers in this project",!1);return}let _=q();if(w==="3d"||w==="mech")de=new hi(h,{onStatus:(z,ae)=>{if(ae)le("none"),He(z,!1);else if(z)le("loading",z);else le("none"),He("",!1)},onUserMove:()=>void ze()}),de.setTheme(_);else if(w==="board"||w==="schematic"||w==="gerbers")me=new li(h,{onPick:(z)=>void It(z),onUserMove:()=>void ze()}),me.setTheme(_);else{le("empty",`${Cr(w)} is not available in this viewer`,!1);return}let G={thread:v};if(V)G.force=!0;if(w==="mech"){if(O.length===0)try{let z=await t.hub.rpc("mech.list",{thread:v});if(W!==E)return;if(O=Array.isArray(z.parts)?z.parts:[],!P)P=z.primary||O[0]||"";Oe()}catch(z){if(W!==E)return;le("error",z instanceof Error?z.message:String(z),!0);return}if(!P){le("empty",u("gpui.rail.no.mech","No mechanical parts in this project"),!1);return}G.kind="3d",G.path=P}else{if(G.kind=w,Y&&(w==="board"||w==="schematic"))G.path=Y;if(w==="3d"&&!V&&de){let z=de.keptToken();if(z)G.kept=z}if((w==="board"||w==="schematic"||w==="gerbers")&&!V&&t.hub.hasFeature("keptChunks"))G.keptChunks=Array.from(T.keys())}k=!0,I="",J="",se="",ye="";try{let z=await t.hub.rpc("viewer.watch",G);if(W!==E)return;L=new Set(Array.isArray(z.keys)?z.keys:[]),k=!1;let ae=M;ve();for(let K of ae)if(K.kind==="bin")tt(K.buf);else et(K.key,K.none,K.retryable,K.big)}catch(z){if(W!==E)return;k=!1,L.clear(),ve();let ae=z instanceof Error?z.message:String(z),K=/no gerbers|not in this project|another machine/i.test(ae);le(K?"empty":"error",ae,!K)}}function et(V,W,_,G=!1){if(k){if(M.length{if(V.t==="plot"&&typeof V.none==="string"&&typeof V.key==="string")et(V.key,V.none,V.retryable===!0)}),ot=rn(()=>{if(w)Oe()}),en=(V)=>{if(V.key==="Escape"&&w&&!f.hidden)rt()};return window.addEventListener("keydown",en),{open(V,W){if(W!==v){if(v=W,H={},O=[],P="",B.clear(),re=!1,ie=!1,ue=0,Ce=0,te="",oe=0,R=null,t.hub.hasFeature("follow"))t.hub.rpc("viewer.follow",{thread:W}).then((_)=>{if(W!==v)return;if(re=!!_.on,ie=!!_.paused,ue=Number(_.seq)||0,w)Oe()}).catch(()=>{})}if(V!==w)D(),C.goLive(),Ce=0,te="",oe=0,R=null;w=V,Y="",ht(!1)},reconcileHas(V){if(w&&!zo(w,V))t.closeViewer()},close(){if(E++,k=!1,D(),F=!1,I="",J="",se="",ye="",C.goLive(),c.hidden=!0,b.hidden=!0,ve(),v)t.hub.rpc("viewer.watch",{thread:v,kind:""}).catch(()=>{});w="",L.clear(),Ee()}}}var kr="http://www.w3.org/2000/svg";function Yt(e){let t=document.createElementNS(kr,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","13"),t.setAttribute("height","13"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","1.8"),t.setAttribute("aria-hidden","true");for(let n of e){let i=document.createElementNS(kr,"path");i.setAttribute("d",n),t.appendChild(i)}return t}function xr(e){if(!e)return"bp-dot-idle";let t=e.status||e.state;if(t==="active"||t==="working")return"bp-dot-work";if(t==="finished")return"bp-dot-done";if(t==="waiting"||t==="asking"||t==="blocked"||t==="failed"||(e.waiting??0)>0)return"bp-dot-need";return"bp-dot-idle"}function Ko(e){if(!e)return"";let t=e<10000000000?e*1000:e,n=Math.max(0,Math.floor((Date.now()-t)/1000));if(n<60)return"now";if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400)return`${Math.floor(n/3600)}h`;return`${Math.floor(n/86400)}d`}function Pr(e,t){if(!e)return!0;if(t==="board"||t==="3d")return e.board!==!1;if(t==="schematic")return e.schematic!==!1;if(t==="mech")return e.mech!==!1;if(t==="gerbers")return e.gerbers!==!1;return!0}var Xt="dark",vn=(()=>{try{return Gs(localStorage.getItem("bp.theme.pref"))}catch{return"auto"}})(),bi=null,Bt=(()=>{try{return Vs(localStorage.getItem("bp.locale"))}catch{return"auto"}})();function Nr(){let e=Wt(vn,Xt);document.documentElement.classList.toggle("light",e==="light");try{localStorage.setItem("bp.theme",e)}catch{}}function Sr(e){if(!e)return;Xt=e==="light"?"light":"dark",Nr()}function Lr(){if(Bt!=="auto")kt(Bt);else if(bi)kt(bi);else if(typeof navigator<"u"&&navigator.language){if(!kt(navigator.language))kt("en")}}function Jo(){return`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Ar(){let e=document.getElementById("root");if(!e)return;try{if(localStorage.getItem("bp.theme")==="light")Xt="light";if(Wt(vn,Xt)==="light")document.documentElement.classList.add("light");if(Bt!=="auto")kt(Bt)}catch{}let t=document.createElement("header");t.className="bp-topbar",t.setAttribute("data-testid","topbar");let n=document.createElement("button");n.type="button",n.className="icon bp-side-toggle",n.textContent="☰",n.title="Toggle sidebar",n.setAttribute("aria-label","Toggle sidebar");let i=document.createElement("div");i.className="bp-brand";let s=document.createElement("img");s.src="/assets/favicon.svg",s.alt="Backplane",s.className="bp-logo";let r=document.createElement("span");r.className="bp-brand-name bp-hide-phone",r.textContent="Backplane";let o=document.createElement("span");o.className="bp-crumb-sep bp-hide-phone",o.textContent="/";let a=document.createElement("span");a.className="bp-crumb-proj bp-hide-phone";let c=document.createElement("span");c.className="bp-crumb-sep bp-hide-phone",c.textContent="/";let p=document.createElement("span");p.className="bp-crumb-thread",p.setAttribute("data-testid","thread-title");let l=document.createElement("span");l.className="bp-plan-top-badge bp-hidden",l.setAttribute("data-testid","plan-top-badge"),i.append(s,r,o,a,c,p,l);let h=document.createElement("div");h.className="bp-top-state bp-hide-phone bp-hidden";let d=document.createElement("span");d.className="bp-top-state-lbl",d.textContent="STATE";let m=document.createElement("span");m.className="bp-dot bp-dot-idle";let f=document.createElement("span");f.className="bp-top-state-word",h.append(d,m,f);let b=document.createElement("div");b.className="bp-top-acts bp-hide-phone bp-hidden";let v=document.createElement("button");v.type="button",v.className="bp-btn-ghost bp-top-act";let w=document.createElement("span");w.textContent=u("menu.pin","Pin"),v.append(Yt(["M12 17v5","M9 3h6l1 7 3 3H5l3-3 1-7z"]),w);let E=document.createElement("button");E.type="button",E.className="bp-btn-ghost bp-top-act";let k=document.createElement("span");k.textContent=u("menu.settle","Settle"),E.append(Yt(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M9 12l2 2 4-4"]),k);let L=document.createElement("div");L.className="bp-menu-wrap";let M=document.createElement("button");M.type="button",M.className="bp-btn-ghost bp-top-act",M.textContent="▾",M.title="Thread menu",M.setAttribute("aria-label","Thread menu"),M.setAttribute("data-testid","thread-menu-btn");let A=document.createElement("div");A.className="bp-popover bp-hidden",A.setAttribute("data-testid","thread-menu"),L.append(M,A),b.append(v,E,L);let B=document.createElement("div");B.className="bp-top-right";let T=document.createElement("button");T.type="button",T.className="bp-btn-ghost bp-top-act bp-hide-tablet",T.setAttribute("data-testid","improvements-btn");let H=document.createElement("span");H.textContent=u("gpui.improvements","Improvements"),T.append(Yt(["M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 16.8l-6.2 4.5 2.4-7.4L2 9.4h7.6z"]),H);let O=document.createElement("button");O.type="button",O.className="bp-cmd-box bp-hide-tablet",O.textContent="> Jump or run a command";let P=document.createElement("button");P.type="button",P.className="icon bp-top-icon",P.title="Search",P.setAttribute("aria-label","Search"),P.appendChild(Yt(["M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M21 21l-4.3-4.3"]));let Y=document.createElement("button");Y.type="button",Y.className="icon bp-top-icon",Y.title=u("palette.settings","Settings"),Y.setAttribute("aria-label",u("palette.settings","Settings")),Y.setAttribute("data-testid","settings-btn"),Y.appendChild(Yt(["M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c.26.6.85 1 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"])),B.append(T,O,P,Y),t.append(n,i,h,b,B);let re=document.createElement("div");re.className="bp-body";let ie=document.createElement("aside");ie.className="bp-sidebar",ie.setAttribute("data-testid","sidebar");let ue=document.createElement("main");ue.className="bp-center";let Pe=document.createElement("div");Pe.className="bp-right-area bp-hidden",Pe.setAttribute("data-testid","right-area");let Ce=document.createElement("div");Ce.className="bp-right-top";let te=document.createElement("section");te.className="bp-viewer-pane bp-hidden",te.setAttribute("data-testid","viewer-pane"),Ce.appendChild(te),Pe.appendChild(Ce);let oe=document.createElement("nav");oe.className="bp-rail",oe.setAttribute("aria-label","Viewer rail"),oe.setAttribute("data-testid","viewer-rail"),re.append(ie,ue,Pe,oe),e.append(t,re);let R=new oi,me=null,de=new Set,ee=0,ge=null,C=[],x=[],F=[],I=[],J=[],se=[],ye=[],D="",ne=0,Te=0,Le=null,Be=null,q="",fe=null,le=20,He={},$e=new Map;function Oe(g,y){$e.delete(g),$e.set(g,y);while($e.size>le){let S=$e.keys().next().value;if(S!==void 0)$e.delete(S);else break}}let Ne="",We=0,ze=new Wn(ue,{onNewThread:(g)=>{mt(g)},onOpenThread:(g)=>{qe(g)},onOpenViewer:(g,y)=>{qe(g).then(()=>{if(D===g)ut(y)})},onRetry:(g)=>{It(g)}});function Qt(){if(!Ne)return;Ne="",We++,ue.classList.remove("bp-home-open"),ze.hide(),Ee.setSelectedProject(""),Ie()}function rt(g){return C.find((y)=>y.id===g)??C.find((y)=>Un(y.id)===g)}async function Zt(g,y){try{let S=await R.rpc("threads.list",{project:g,limit:50,archived:!1});if(y!==We||Ne!==g)return;let N=(S.threads??[]).filter((j)=>!j.swarm).map((j)=>({id:j.id,title:j.title,dot:xr(j),status:j.status||j.state||"",age:Ko(j.updatedAt),settled:j.settled}));ze.setThreads(N)}catch{if(y===We&&Ne===g)ze.setThreads([])}}function It(g){if(!g||!R.hasFeature("projecthome"))return!1;tt.cancel(),pe.closeModelPicker(),Ne=g;let y=++We,S=rt(g);return ue.classList.add("bp-home-open"),ie.classList.remove("bp-sidebar-open"),ze.show({id:g,title:S?.title??g}),Ee.setSelectedProject(g),Ie(),Zt(g,y),R.rpc("project.home",{project:g}).then((N)=>{if(y===We&&Ne===g)ze.setData(Ns(N))}).catch((N)=>{if(y!==We||Ne!==g)return;ze.setError(N instanceof Error&&N.message?N.message:u("web.home.error","Could not load this project."))}),!0}let Ee=new ii(ie,{onSelectThread:(g)=>{if(g===D&&Le!==null){Qt(),ie.classList.remove("bp-sidebar-open");return}qe(g)},onNewThread:(g)=>{mt(g)},onOpenProject:(g)=>It(Un(g)),canOpenProject:()=>R.hasFeature("projecthome"),onSelectBot:(g)=>{qe(g.thread)},onQuickOpenViewer:(g,y)=>{let S=x.find((j)=>j.project===g&&!j.archived&&!j.swarm);(async()=>{if(S)await qe(S.id);else await mt(g);if(D)q=y,G.setActive(y),fe?.open(y,D)})()},onThreadAct:(g,y)=>{bt(g,y)},onSnoozeRow:(g)=>{R.rpc("sidebar.act",{action:"row-snooze",value:g}).then(()=>Xe()).catch(()=>{})},onToggleSection:(g)=>{if(de.has(g))de.delete(g);else de.add(g);Xe()},onToggleProjectFold:(g)=>{R.rpc("sidebar.act",{action:"project-fold",value:g}).then(()=>Xe()).catch(()=>{})},onCollapseSidebar:()=>{ie.classList.remove("bp-sidebar-open"),ie.classList.add("bp-sidebar-collapsed")},onNeedAct:async(g)=>{let y=mn(g,!1);if(!y)return;if(y.kind==="thread"){qe(y.id);return}if(y.kind!=="call")return;let S=Os(await R.rpc(y.method,y.params));if(S?.kind==="thread")qe(S.id);Xe()},hasRoomView:!1,onAddProject:()=>_.open({mode:"folder"}),onSettleSwarm:(g)=>{R.rpc("sidebar.act",{action:"swarm-settle",value:g}).then(()=>Xe()).catch(()=>{})},onNewChat:()=>{mt(yt)},onMoveToProject:(g)=>De(g)}),ve=new An(ue,{onLoadOlder:()=>{wi()},onGoToEntry:(g)=>{vi(g)},onOpenAccounts:()=>{ke()},onAnswerAsk:(g,y)=>{R.rpc("ask.answer",{ask:g,answer:y}).catch((S)=>{pe.showError(S instanceof Error?S.message:"Could not send answer")})},onToggleReview:(g)=>{if(!D)return;let y=ne;R.rpc("thread.review",{thread:D,on:g}).then((S)=>{if(y===ne)ve.setReview(S.review??null)}).catch(()=>{})},onUnansweredAction:(g,y)=>{if(!D)return;if(g==="again"||g==="thread-again")R.rpc("thread.again",{thread:D,value:y}).catch(()=>{});else R.rpc("thread.act",{thread:D,action:g,value:y}).catch(()=>{})},onReplyEntry:(g)=>{if(!R.hasFeature("reply")){let y=(g.text||"").split(` +`)[0]?.slice(0,100)??"";if(y)pe.prependDraft(`> ${y} +`);return}if(!g.text||!g.text.trim()||g.live||g.id.startsWith("local-"))return;jt({id:g.id,text:g.text,role:g.kind==="user"?"user":"assistant"})},onLoadImage:async(g,y)=>{try{let S={entry:g,path:y};if(R.hasFeature("blobs"))S.metaOnly=!0;let N=await R.rpc("message.image",S);if(N.blob&&N.blob.startsWith("/blob/"))return{url:N.blob};if(N.mime&&N.data)return{mime:N.mime,data:N.data}}catch{}return null}});function ht(g){if(!g)return null;if(g.planMode)return g.planMode;if(g.provider==="claude")return{phase:"off",interaction:"default",once:!1};return null}function et(g,y){if(!D)return;let S=ne,N=D;R.rpc(g,y).then((j)=>{if(S!==ne||D!==N)return;if(j.thread){let Q=x.findIndex((ce)=>ce.id===j.thread.id);if(Q>=0)x[Q]=j.thread;else x.unshift(j.thread);Ee.setData(C,x,F,I),ve.updateThreadMeta(j.thread),Ie(),pe.setState(!0,j.thread.state==="working")}}).catch((j)=>{if(S===ne&&D===N)pe.showError(j instanceof Error?j.message:"Could not change Plan mode")})}let tt,pe=new Tn(ue,{onSend:(g,y)=>{Ei(g,y)},onRunCommand:(g)=>{Ci(g)},onInterrupt:()=>{if(D)R.rpc("turn.interrupt",{thread:D}).catch(()=>{})},onQueryMentions:async(g,y)=>{try{return(await R.rpc("mentions.list",{q:g,kind:y,limit:10})).items??[]}catch{return[]}},onToggleVoice:()=>{tt.toggle()},onCyclePlanMode:()=>{let g=x.find((S)=>S.id===D)??null,y=ht(g);if(!y||!D)return;if(y.interaction!=="plan")et("thread.planonce",{thread:D,on:!0});else if(y.once)et("thread.pick",{thread:D,action:"interaction",value:"plan"});else et("thread.pick",{thread:D,action:"interaction",value:"default"})},onSetPlanMode:(g)=>{if(!D)return;if(g==="once")et("thread.planonce",{thread:D,on:!0});else if(g==="always")et("thread.pick",{thread:D,action:"interaction",value:"plan"});else et("thread.pick",{thread:D,action:"interaction",value:"default"})},getFavoriteModels:()=>J,onLoadModelPicker:async()=>{if(!D)return null;return R.rpc("thread.picker",{thread:D})},onSelectModel:async(g,y)=>{if(!D)return;let S=ne,N=D;try{let j=await R.rpc("thread.model",{thread:N,provider:g,model:y});if(S!==ne||D!==N)return;if(j.thread){let Q=x.findIndex((ce)=>ce.id===j.thread.id);if(Q>=0)x[Q]=j.thread;else x.unshift(j.thread);Ee.setData(C,x,F,I),ve.updateThreadMeta(j.thread),Ie(),pe.setState(!0,j.thread.state==="working")}}catch(j){if(S===ne&&D===N)pe.showError(j instanceof Error?j.message:"Could not switch model")}},onSelectEffort:async(g)=>{if(!D)return;let y=ne,S=D;try{let N=await R.rpc("thread.pick",{thread:S,action:"effort",value:g});if(y!==ne||D!==S)return;if(N.thread){let j=x.findIndex((Q)=>Q.id===N.thread.id);if(j>=0)x[j]=N.thread;else x.unshift(N.thread);Ee.setData(C,x,F,I),ve.updateThreadMeta(N.thread),Ie()}}catch(N){if(y===ne&&D===S)pe.showError(N instanceof Error?N.message:"Could not set effort")}},onToggleFavorite:async(g,y,S)=>{let N=await R.rpc("models.favorite",{provider:g,model:y,on:S});if(Array.isArray(N.favorites))return J=N.favorites,J;return null}});tt=new si(R,{getThreadId:()=>D,getDraft:()=>pe.getDraft(),getCaret:()=>pe.getCaret(),setDraft:(g)=>pe.setDraft(g),setRecording:(g)=>pe.setVoiceRecording(g),setLevel:(g)=>pe.setVoiceLevel(g),showError:(g)=>pe.showError(g)});function Rt(){let g=q!=="",y=ot.isOpen();Pe.classList.toggle("bp-hidden",!g&&!y),Pe.classList.toggle("bp-has-viewer",g),Pe.classList.toggle("bp-has-mgmt",y)}let ot=new $n(Ce,Pe,{hub:R,getThreadId:()=>D,getThreadGen:()=>ne,onSendText:(g)=>{Ei(g)},onOpenChange:()=>Rt()});function en(g){let y=window.prompt("Rename thread",g.title||"");if(!y||!y.trim())return;R.rpc("thread.act",{thread:g.id,action:"rename",title:y.trim()}).then((S)=>{if(S.thread)x=x.map((N)=>N.id===S.thread.id?S.thread:N),Ie(),Xe()}).catch((S)=>{pe.showError(S instanceof Error?S.message:"Could not rename thread")})}function V(g){switch(g.type){case"thread":qe(g.id);break;case"rail":if(!D&&g.id!=="terminal")break;if(q===g.id)Ve();else ut(g.id);break;case"thread-act":if(D)bt(D,g.action);break;case"new-thread":mt(g.projectId);break;case"new-chat":mt(yt);break;case"move-project":if(D)De(D);break;case"rename":{let y=x.find((S)=>S.id===D);if(y)en(y);break}case"prev-thread":case"next-thread":{let y=x.filter((Q)=>!Q.archived&&!Q.swarm);if(y.length<2)break;let S=y.findIndex((Q)=>Q.id===D),N=g.type==="next-thread"?1:-1,j=y[(S<0?0:S+N+y.length)%y.length];if(j)qe(j.id);break}case"command":if(g.runDirectly)Ci(g.word);else pe.setDraft(`${g.word} `),pe.focus();break;case"improvements":je();break;case"settings":K.open();break;case"sidebar":ie.classList.toggle("bp-sidebar-open"),ie.classList.toggle("bp-sidebar-collapsed");break}}let W=new On(e,{getState:()=>({selectedThreadId:D,threads:x,projects:C,bots:F,railItems:se,commands:ye}),onSearch:async(g)=>{if(!R.hasFeature("search"))return{threads:[],projects:[],messages:[]};return R.rpc("search",{q:g,limit:20})},onExecute:V}),_=new Pn(e,{hub:R,onProjectAdded:(g)=>{if(Xe(),g.id)mt(g.id)},onCloneDone:(g)=>{if(Xe(),g.thread)qe(g.thread)}}),G=new qn(oe,(g)=>{if(g==="commands"){W.open();return}if(!D)return;if(q===g)Ve();else ut(g)}),z=null,ae=null,K=new Zn(e,{onLoadDevices:async()=>(await R.rpc("devices.page",{})).rows??[],onDevicesAct:async(g,y)=>{await R.rpc("devices.page.act",{action:g,value:y})},onGetHome:()=>z,onMoveHomeHere:async()=>{await R.rpc("home.move",{to:"back"})},onGetNoProvider:()=>ae,onGetThemePref:()=>vn,onSetThemePref:(g)=>{vn=g;try{if(g==="auto")localStorage.removeItem("bp.theme.pref");else localStorage.setItem("bp.theme.pref",g)}catch{}Nr()},onGetHubTheme:()=>Xt,onGetLocalePref:()=>Bt,onSetLocalePref:(g)=>{Bt=g;try{if(g==="auto")localStorage.removeItem("bp.locale");else localStorage.setItem("bp.locale",g)}catch{}Lr()},hasRing:()=>R.hasFeature("ringnotes"),onRingList:async(g)=>Is(await R.rpc("ring.list",{q:g})),onRingHear:async(g,y)=>{await R.rpc("ring.hear",{note:g,engine:y})},onOpenThread:(g)=>{qe(g)},onLogout:()=>_i(()=>{R.disconnect(),window.location.replace("/")})});function we(g){if(ae=g,ve.setNoProvider(g),K.isOpen())K.refresh()}function ke(){K.openToAccounts()}function Ae(g,y){let S=g instanceof Error?g.message:y,N=g instanceof Kt?g:null,j=N?.code,Q=N?.machine,ce=j==="no_provider_remote"&&Q?u("provider.notice.senderr.remote","No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.").replaceAll("{machine}",Q):S;pe.showError(ce,Bs(S,j)?{label:u("provider.notice.button","Open Settings → Accounts"),onClick:ke}:void 0)}v.addEventListener("click",()=>{let g=x.find((y)=>y.id===D);if(g)bt(g.id,g.pinned?"unpin":"pin")}),E.addEventListener("click",()=>{let g=x.find((y)=>y.id===D);if(g)bt(g.id,g.settled?"unsettle":"settle")});let Ge=new ti(e,(g,y)=>y?R.rpc("thread.context.mcp",{thread:g,...y}):R.rpc("thread.context",{thread:g}));M.addEventListener("click",(g)=>{g.stopPropagation();let y=x.find((j)=>j.id===D);if(!y)return;if(!A.classList.contains("bp-hidden")){A.classList.add("bp-hidden");return}let S=[{label:"Rename…",run:()=>en(y)},{label:y.pinned?u("menu.unpin","Unpin"):u("menu.pin","Pin"),run:()=>{bt(y.id,y.pinned?"unpin":"pin")}},{label:y.settled?u("phone.unsettle","Unsettle"):u("menu.settle","Settle"),run:()=>{bt(y.id,y.settled?"unsettle":"settle")}},{label:y.archived?"Unarchive":"Archive",run:()=>{bt(y.id,y.archived?"unarchive":"archive")}},{label:"Delete",danger:!0,run:()=>{if(window.confirm("Delete this thread?"))bt(y.id,"delete")}}];if(R.hasFeature("threadContext"))S.unshift({label:u("thread.context.title","Context & Prompt"),run:()=>Ge.open(y.id)});let N=document.createDocumentFragment();for(let j of S){let Q=document.createElement("button");Q.type="button",Q.className="bp-popover-item"+(j.danger?" danger":""),Q.textContent=j.label,Q.addEventListener("click",()=>{A.classList.add("bp-hidden"),j.run()}),N.appendChild(Q)}A.replaceChildren(N),A.classList.remove("bp-hidden")}),document.addEventListener("click",()=>A.classList.add("bp-hidden"));async function je(){let g=document.createElement("div");g.className="bp-modal-backdrop",g.setAttribute("data-testid","improvements-modal");let y=document.createElement("div");y.className="bp-modal";let S=document.createElement("div");S.className="bp-modal-head";let N=document.createElement("h2");N.textContent=u("gpui.improvements","Improvements");let j=document.createElement("button");j.type="button",j.className="icon",j.textContent="×",j.addEventListener("click",()=>g.remove()),S.append(N,j);let Q=document.createElement("div");Q.className="bp-modal-body",Q.textContent="Loading…",y.append(S,Q),g.appendChild(y),g.addEventListener("click",(ce)=>{if(ce.target===g)g.remove()}),e.appendChild(g);try{let ce=await R.rpc("improvements.projects",{}),Fe=ce.projects??[];if(Fe.length===0){Q.textContent="No projects available for Improvements.";return}let Je=document.createDocumentFragment();for(let Ye of Fe){let Me=document.createElement("div");Me.className="bp-set-row";let Z=document.createElement("div");Z.className="bp-set-info",Z.textContent=Ye.title||Ye.name||Ye.id;let Ue=document.createElement("button");Ue.type="button",Ue.className=Ye.id===ce.project?"primary":"",Ue.textContent=Ye.id===ce.project?"Active":"Select",Ue.addEventListener("click",()=>{R.rpc("improvements.project",{project:Ye.id}).then(()=>g.remove()).catch(()=>{})}),Me.append(Z,Ue),Je.appendChild(Me)}Q.replaceChildren(Je)}catch(ce){Q.textContent=ce instanceof Error?ce.message:"Could not load Improvements."}}function De(g){let y=x.find((Z)=>Z.id===g),S=document.createElement("div");S.className="bp-modal-backdrop",S.setAttribute("data-testid","move-project-modal");let N=document.createElement("div");N.className="bp-modal";let j=document.createElement("div");j.className="bp-modal-head";let Q=document.createElement("h2");Q.textContent=u("chats.move","Move to project…");let ce=document.createElement("button");ce.type="button",ce.className="icon",ce.textContent="×",ce.addEventListener("click",()=>S.remove()),j.append(Q,ce);let Fe=document.createElement("div");Fe.className="bp-modal-body";let Je=document.createElement("div");Je.className="bp-move-note",Je.textContent=y?.title||"";let Ye=document.createElement("div");Ye.className="bp-move-err",Fe.append(Je);let Me=Js(C);if(Me.length===0){let Z=document.createElement("div");Z.textContent=u("chats.move.none","No project to move it to. Add a project first."),Fe.appendChild(Z)}for(let Z of Me){let Ue=document.createElement("button");Ue.type="button",Ue.className="bp-move-row",Ue.textContent=Z.title||Z.id,Ue.setAttribute("data-testid",`move-project-${Z.id}`),Ue.addEventListener("click",()=>{R.rpc("thread.move_project",{thread:g,project:Z.id}).then((lt)=>{if(lt.thread)x=x.map((ct)=>ct.id===lt.thread.id?lt.thread:ct);else x=x.map((ct)=>ct.id===g?{...ct,project:Z.id}:ct);Ee.setData(C,x,F,I),Ie(),Xe(),S.remove()}).catch((lt)=>{Ye.textContent=lt instanceof Error?lt.message:"Could not move the chat"})}),Fe.appendChild(Ue)}Fe.appendChild(Ye),N.append(j,Fe),S.appendChild(N),S.addEventListener("click",(Z)=>{if(Z.target===S)S.remove()}),e.appendChild(S)}T.addEventListener("click",()=>{je()}),O.addEventListener("click",()=>W.open()),P.addEventListener("click",()=>W.open()),Y.addEventListener("click",()=>{K.open()}),n.addEventListener("click",()=>{ie.classList.toggle("bp-sidebar-open"),ie.classList.toggle("bp-sidebar-collapsed")});function Ie(){let g=Ne?null:x.find((j)=>j.id===D)??null,y=Ne?rt(Ne)??{id:Ne,title:Ne}:g?rt(g.project):void 0;if(Ne&&y)ze.setTitle(y.title);let S=!Ne&&g?.project===yt;a.textContent=S?u("chats.title","Chats"):y?.title??"",o.classList.toggle("bp-hidden",!y&&!S),c.classList.toggle("bp-hidden",!g),p.textContent=g?g.title||"Untitled thread":"";let N=ht(g);if(pe.setPlanMode(N),!N||N.phase==="off")l.classList.add("bp-hidden"),l.classList.remove("is-exec"),l.textContent="";else l.classList.remove("bp-hidden"),l.classList.toggle("is-exec",N.phase==="executing"),l.title=u("gpui.planmode.tip","Plan before acting (1 turn, always, or off)"),l.textContent=N.phase==="armed"&&N.once?u("gpui.planmode.top.once","Plan (1 turn)"):N.phase==="armed"?u("gpui.mgmt.plan.tab","Plan"):N.phase==="planning"?u("gpui.planmode.top.planning","Planning"):N.phase==="pending"?u("gpui.planmode.top.pending","Review plan"):u("gpui.planmode.top.executing","Building plan");if(h.classList.toggle("bp-hidden",!g),b.classList.toggle("bp-hidden",!g),g){m.className=`bp-dot ${xr(g)}`,f.textContent=g.status||g.state||"idle",w.textContent=g.pinned?u("menu.unpin","Unpin"):u("menu.pin","Pin"),k.textContent=g.settled?u("phone.unsettle","Unsettle"):u("menu.settle","Settle");let j=g;pe.setModelChip(g.chip||g.model||"default",g.provider,j.ctxPct??j.contextPct),pe.setMemory(g.memory)}else pe.setModelChip("default"),pe.setMemory(null)}function Ve(g=!0){if(Te++,q="",G.setActive(""),te.classList.add("bp-hidden"),fe?.close(),Rt(),g&&D&&R.getState()==="connected")R.rpc("viewer.watch",{thread:D,kind:""}).catch(()=>{})}function ut(g){if(Te++,q=g,G.setActive(g),te.classList.remove("bp-hidden"),Rt(),!fe&&typeof mi==="function")fe=mi(te,{hub:R,getThreadId:()=>D,closeViewer:()=>Ve(!0)});if(fe)fe.open(g,D);else{let y=document.createElement("div");y.className="bp-viewer-placeholder";let S=document.createElement("div");S.className="bp-viewer-bar";let N=document.createElement("span");N.textContent=g.toUpperCase();let j=document.createElement("button");j.type="button",j.className="icon",j.textContent="×",j.addEventListener("click",()=>Ve(!0)),S.append(N,j);let Q=document.createElement("div");Q.className="bp-dim bp-viewer-msg",Q.textContent=`Viewer pane (${g}).`,y.append(S,Q),te.replaceChildren(y)}}async function tn(g,y){if(!g||!R.hasFeature("rail")){if(y===ne)se=[],G.setItems([]);return}let S=++Te;try{let N=await R.rpc("viewer.rail",{thread:g,page:q});if(y!==ne||S!==Te)return;let j=Array.isArray(N.rail)?N.rail:Array.isArray(N.items)?N.items:[];if(se=j,G.setItems(j),N.has){if(fe?.reconcileHas?.(N.has),q&&!Pr(N.has,q))Ve(!0)}}catch{if(y===ne&&S===Te)se=[],G.setItems([])}}function at(g){for(let y of g)if(y.kind==="threads"){for(let S of y.rows)if(!S.off&&(S.nav||S.id)&&!(S.nav||"").startsWith("@room:"))return S.nav||S.id}else if(y.kind==="projects"){for(let S of y.rows)for(let N of S.threads??[])if(!N.off&&(N.nav||N.id)&&!(N.nav||"").startsWith("@room:"))return N.nav||N.id}return""}function gi(g,y){for(let S of g)if(S.kind==="threads"){if(S.rows.some((N)=>(N.nav||N.id)===y))return!0}else if(S.kind==="projects"){for(let N of S.rows)if((N.threads??[]).some((j)=>(j.nav||j.id)===y))return!0}return!1}function wn(g){let y=[];for(let S of g){if(S.kind!=="projects")continue;for(let N of S.rows)y.push({id:N.id,title:N.title,css:N.css,color:N.color})}if(y.length>0)C=y}async function Xe(){if(!R.hasFeature("sections"))return!1;let g=++ee;try{let y=await R.rpc("sidebar.sections",{open:Array.from(de)});if(g!==ee)return!0;let S=Array.isArray(y.sections)?y.sections:[];if(me=S,wn(S),Ee.setData(C,x,F,I),Ee.setSections(S,F,I),Ie(),Ne)Zt(Ne,We);return!0}catch{return!1}}function nn(){if(!R.hasFeature("sections"))return;if(ge!==null)window.clearTimeout(ge);ge=window.setTimeout(()=>{ge=null,Xe()},150)}async function Mr(){if(Le=null,R.hasFeature("bots"))try{let y=await R.rpc("bots.list",{});F=y.bots??[],I=y.rooms??[]}catch{}if(R.hasFeature("shell")){let y=await R.rpc("shell.sync",{have:He,settled:25}),S=new Set(y.removed??[]),N=new Set((y.projects??[]).map((j)=>j.id));if(S.size>0||N.size>0)C=[...C.filter((j)=>!S.has(j.id)&&!N.has(j.id)),...y.projects??[]],x=[...x.filter((j)=>!S.has(j.project)&&!N.has(j.project)),...y.threads??[]];else if(Array.isArray(y.threads)&&y.threads.length>0){let j=new Map(x.map((Q)=>[Q.id,Q]));for(let Q of y.threads)j.set(Q.id,Q);x=Array.from(j.values())}if(y.sections!==void 0){let j=Array.isArray(y.sections)?y.sections:Array.isArray(y.sections?.sections)?y.sections.sections:null;if(j)me=j,wn(j)}if(y.h)He=y.h;Ee.setData(C,x,F,I),Ee.setSections(me,F,I)}else if(R.hasFeature("sections")){let[y,S]=await Promise.all([R.rpc("sidebar.sections",{open:Array.from(de)}).catch(()=>null),R.rpc("threads.list",{limit:200,archived:!1}).catch(()=>({threads:[]}))]);if(x=S.threads??[],y&&Array.isArray(y.sections)){let N=y.sections;if(!N.some((Q)=>Q.kind==="projects"&&Q.rows.length>0)){let Q=N.find((ce)=>ce.kind==="projects"&&ce.fold&&ce.toggle&&(ce.count??0)>0);if(Q?.toggle&&!de.has(Q.toggle)){de.add(Q.toggle);let ce=await R.rpc("sidebar.sections",{open:Array.from(de)}).catch(()=>null);if(ce&&Array.isArray(ce.sections))N=ce.sections}}me=N,wn(N),Ee.setData(C,x,F,I),Ee.setSections(N,F,I)}else me=null,C=(await R.rpc("projects.list",{limit:100})).projects??[],Ee.setSections(null,F,I),Ee.setData(C,x,F,I);await R.rpc("subscribe",{topic:"lists"}).catch(()=>{})}else{me=null;let[y,S]=await Promise.all([R.rpc("projects.list",{limit:100}),R.rpc("threads.list",{limit:200,archived:!1})]);C=y.projects??[],x=S.threads??[],Ee.setSections(null,F,I),Ee.setData(C,x,F,I),await R.rpc("subscribe",{topic:"lists"}).catch(()=>{})}let g=D;if(!g){let y="";try{y=localStorage.getItem("bp.lastThread")||""}catch{}if(y&&(me&&gi(me,y)||x.some((S)=>S.id===y)))g=y;else if(me)g=at(me);if(!g)g=(x.find((N)=>!N.archived&&!N.swarm&&!N.settled)??x.find((N)=>!N.archived&&!N.swarm))?.id??""}if(g&&(me&&gi(me,g)||x.some((y)=>y.id===g)))await qe(g,Ne!=="");else D="",se=[],G.setItems([]),pe.setState(!1,!1),Ie();if(Ne)It(Ne)}async function qe(g,y=!1){if(!y)Qt();if(D&&D!==g){tt.cancel();let Me=ve.getEntries();if(Me.length>0){let Z=$e.get(D);Oe(D,{entries:Me,ids:Z?.ids??Me.map((Ue)=>Ue.id),olderCursor:Be,review:Z?.review??null,unanswered:Z?.unanswered??null,rail:Z?.rail??se,hashes:Z?.hashes??{}})}}let S=++ne;Te++,jt(null);let N=Le;if(Le=null,N!==null)R.rpc("unsubscribe",{sub:N}).catch(()=>{});D=g,pe.closeModelPicker();let j=$e.get(g);Be=j?.olderCursor??null;try{localStorage.setItem("bp.lastThread",g)}catch{}Ee.setSelected(g),ie.classList.remove("bp-sidebar-open"),Ie();let Q=x.find((Me)=>Me.id===g)??null;if(j)ve.setThread(Q,j.entries,Boolean(j.olderCursor),j.review,j.unanswered),se=j.rail,G.setItems(j.rail);else ve.setLoading(Q),se=[],G.setItems([]);if(pe.setState(!0,Q?.state==="working"),R.hasFeature("open")){let Me={};if(j){for(let[Re,Dt]of Object.entries(j.hashes))Me[Re]=Dt;for(let Re of j.entries)if(Re.h)Me[Re.id]=Re.h}let Z;try{Z=await R.rpc("thread.open",{thread:g,limit:40,have:Me})}catch(Re){if(S===ne){let Dt=Re instanceof Error&&Re.message?Re.message:"Could not load messages.";ve.setError(Q,Dt,()=>{qe(g)})}return}if(S!==ne){if(Z.sub!==void 0&&Z.sub!==null)R.rpc("unsubscribe",{sub:Z.sub}).catch(()=>{});return}if(Le=Z.sub??null,Z.thread){Q=Z.thread;let Re=x.findIndex((Dt)=>Dt.id===Z.thread.id);if(Re>=0)x[Re]=Z.thread;else x.unshift(Z.thread);Ie(),pe.setState(!0,Q.state==="working")}if("next"in Z)Be=Z.next??null;let Ue=new Map;if(j)for(let Re of j.entries)Ue.set(Re.id,Re);for(let Re of Z.entries??[])Ue.set(Re.id,Re);let lt=Z.ids??j?.ids??(Z.entries??[]).map((Re)=>Re.id),ct=lt.map((Re)=>Ue.get(Re)).filter((Re)=>Boolean(Re)),Ht=j?.rail??[];if(Z.rail!==void 0){if(Array.isArray(Z.rail))Ht=Z.rail;else if(Ht=Array.isArray(Z.rail?.rail)?Z.rail.rail:Array.isArray(Z.rail?.items)?Z.rail.items:[],Z.rail?.has){if(fe?.reconcileHas?.(Z.rail.has),q&&!Pr(Z.rail.has,q))Ve(!0)}}se=Ht,G.setItems(Ht);let yn=j?.review??null;if(R.hasFeature("reviewmode"))try{let Re=await R.rpc("thread.review",{thread:g});if(S!==ne)return;yn=Re.review??null}catch{}if(S!==ne)return;let xi="unanswered"in Z?Z.unanswered??null:j?.unanswered??null,Tr=Z.h??j?.hashes??{};if(Oe(g,{entries:ct,ids:lt,olderCursor:Be,review:yn,unanswered:xi,rail:Ht,hashes:Tr}),ve.setThread(Q,ct,Boolean(Be),yn,xi),fi(g,S),q)ut(q);return}let ce;try{ce=await R.rpc("thread.entries",{thread:g,limit:40})}catch(Me){if(S===ne){let Z=Me instanceof Error&&Me.message?Me.message:"Could not load messages.";ve.setError(Q,Z,()=>{qe(g)})}return}if(S!==ne)return;if(ce.thread){let Me=x.findIndex((Z)=>Z.id===ce.thread.id);if(Me>=0)x[Me]=ce.thread;else x.unshift(ce.thread);Ie()}Be=ce.next??null;let Fe=null;if(R.hasFeature("reviewmode"))try{let Me=await R.rpc("thread.review",{thread:g});if(S!==ne)return;Fe=Me.review??null}catch{}if(S!==ne)return;let Je=ce.entries??[],Ye=ce.unanswered??null;Oe(g,{entries:Je,ids:Je.map((Me)=>Me.id),olderCursor:Be,review:Fe,unanswered:Ye,rail:j?.rail??[],hashes:j?.hashes??{}}),ve.setThread(Q,Je,Boolean(Be),Fe,Ye);try{let Z=(await R.rpc("subscribe",{topic:"thread",thread:g})).sub??null;if(Z!==null){if(S!==ne){R.rpc("unsubscribe",{sub:Z}).catch(()=>{});return}Le=Z}}catch{}if(S!==ne)return;if(tn(g,S),fi(g,S),q)ut(q)}async function fi(g,y){if(!g||!R.hasFeature("mgmt")){if(y===ne)ot.clear();return}let S=x.find((j)=>j.id===g),N=S?.project?C.find((j)=>j.id===S.project)?.root??"":"";if(!N&&R.hasFeature("viewers"))try{let j=await R.rpc("viewer.files",{thread:g});if(y!==ne)return;N=j.pcb||j.sch||j.root||""}catch{}if(y!==ne)return;if(N)await ot.watchProject(N);else ot.clear()}async function vi(g){let y=ne;for(let S=0;S<25&&y===ne;S++){if(ve.goTo(g))return;if(!Be)return;let N=Be;if(await wi(),Be===N)return}}async function wi(){if(!D||!Be){ve.clearLoadingOlder();return}let g=ne,y=D,S=Be;try{let N=await R.rpc("thread.entries",{thread:y,limit:40,before:S});if(g!==ne||D!==y)return;Be=N.next??null,ve.prependEntries(N.entries??[],Boolean(Be))}catch{if(g===ne)ve.clearLoadingOlder()}}async function mt(g){try{let y=await R.rpc("thread.create",{project:g});if(y.thread)x=[y.thread,...x.filter((S)=>S.id!==y.thread.id)],Ee.setData(C,x,F,I),Xe(),await qe(y.thread.id),pe.focus()}catch(y){Ae(y,"Could not create thread")}}let Et=null;function yi(g){return(g.split(` +`).map((y)=>y.trim()).find((y)=>y.length>0)??"").slice(0,200)}function jt(g){Et=g,pe.setReply(g?{who:g.role==="user"?u("secret.you","You"):u("model.col.agent","Agent"),line:yi(g.text)}:null,()=>{if(Et)vi(Et.id)},()=>jt(null))}async function Ei(g,y=[]){if(!D)return;let S=ne,N=D,j=Jo(),Q=`local-${j}`,ce=Et&&g.trim()&&R.hasFeature("reply")?Et:null;if(ce)jt(null);ve.upsertEntry({id:Q,kind:"user",text:g,at:Date.now(),clientId:j,...ce?{replyTo:{id:ce.id,quote:yi(ce.text)}}:{},attachments:y.map((Fe)=>({name:Fe.name,mime:Fe.mime,previewUrl:`data:${Fe.mime};base64,${Fe.data}`}))});try{let Fe={thread:N,text:g,clientId:j};if(y.length>0)Fe.attachments=y;if(ce)Fe.replyTo={id:ce.id,text:ce.text};let Je=await R.rpc("message.send",Fe);if(S!==ne||D!==N)return;if(Je.entry)ve.upsertEntry(Je.entry)}catch(Fe){if(S===ne&&D===N){if(ve.removeEntry(Q),pe.setDraft(g),ce&&!Et)jt(ce);Ae(Fe,"Failed to send message")}}}async function Ci(g){if(!D)return;let y=ne,S=D;try{let N=await R.rpc("composer.run",{thread:S,text:g});if(y!==ne||D!==S)return;if(N.error)pe.setDraft(g),Ae(new Kt(N.error,{code:N.errorCode,machine:N.machine}),N.error);else if(N.kind==="btw"&&typeof N.a==="string")ve.showBtw(N.q??"",N.a);else if(N.kind==="edit"&&typeof N.text==="string")pe.setDraft(N.text);else if(N.kind==="project")_.open({mode:"folder"});else if(N.kind==="clone")_.open({mode:"clone",repo:N.repo??"",text:N.text??""})}catch(N){if(y===ne&&D===S)pe.setDraft(g),Ae(N,"Command refused")}}async function bt(g,y){try{let S=await R.rpc("thread.act",{thread:g,action:y});if(S.thread){if(x=x.map((N)=>N.id===S.thread.id?S.thread:N),Ee.setData(C,x,F,I),S.thread.id===D)ve.updateThreadMeta(S.thread),Ie()}Xe()}catch(S){pe.showError(S instanceof Error?S.message:`Action "${y}" not allowed`)}}function ki(g,y){if(!g||!g.text||y-g.at>=300000)return"";let S=g.build.split("-").pop()??"";if(g.reason==="build"&&S)return u("hub.restarting.build",g.text,{build:S});if(g.reason==="stop")return u("hub.stopped",g.text);return u("hub.restarting",g.text)}function sn(g){if(g==="connected")Ee.setConnStatus(u("gpui.acct.connected","Connected"),"bp-ok");else if(g==="reconnecting"&&ki(R.restarting,Date.now()))Ee.setConnStatus(ki(R.restarting,Date.now()),"");else if(g==="reconnecting")Ee.setConnStatus("Reconnecting…","bp-warn");else if(g==="revoked")Ee.setConnStatus(u("gpui.acct.sign.in.expired","Sign-in expired"),"bp-bad");else Ee.setConnStatus("Connecting…","")}rn(()=>{sn(R.getState()),H.textContent=u("gpui.improvements","Improvements"),Y.title=u("palette.settings","Settings"),Y.setAttribute("aria-label",u("palette.settings","Settings")),Ie(),Ee.refreshLocale(),ve.refreshLocale(),pe.refreshLocale(),G.render(),K.refreshLocale(),ze.refreshLocale(),_.refreshLocale()}),R.onState((g,y)=>{if(g==="connected"&&y){if(y.locale)bi=y.locale,Lr();if(y.theme)Sr(y.theme);if(y.name)Ee.setHostName(y.name);if(Array.isArray(y.favoriteModels))J=y.favoriteModels,pe.updateFavoriteModels(J);if(z=y.home??null,Ee.setHome(z),we(_n(y.noProvider)),K.isOpen())K.refresh();sn(g);let S=typeof y.hubBack==="string"?String(y.hubBack):"";if(S)try{let N=JSON.parse(S);if(N.reason==="crash")Ee.setConnStatus(u("hub.back.crash",N.text??""),"bp-warn"),window.setTimeout(()=>sn(R.getState()),6000)}catch{}if(pe.setFeatures(R.hasFeature("images"),R.hasFeature("voice")),Array.isArray(y.commands))ye=y.commands,pe.setCommands(ye);else ye=[];Mr(),_.reconcile()}else tt.cancel(),sn(g)}),R.onFrame((g)=>{if(g.t==="voice"){tt.handleFrame(g);return}if(g.t==="info"&&g.info&&typeof g.info==="object"){let S=g.info;if(Object.prototype.hasOwnProperty.call(S,"provider.notice"))we(_n(S["provider.notice"]));ot.handleInfo(S);return}if(g.t!=="d")return;let y=g;if(y.k==="clone"||y.k==="clone.repos"||y.k==="clone.signin"){_.handleFrame(y);return}switch(y.k){case"project":{let S=y.project;if(!S)break;let N=C.findIndex((j)=>j.id===S.id);if(N>=0)C[N]=S;else C.unshift(S);Ee.setData(C,x,F,I),Ie(),nn();break}case"thread":{let S=y.thread;if(!S)break;let N=x.findIndex((j)=>j.id===S.id);if(N>=0)x[N]=S;else x.unshift(S);if(Ee.setData(C,x,F,I),S.id===D)ve.updateThreadMeta(S),Ie(),pe.setState(!0,S.state==="working");nn();break}case"thread.removed":{let S=String(y.id??"");x=x.filter((N)=>N.id!==S),Ee.setData(C,x,F,I),nn();break}case"entry":{if(y.thread===D&&y.entry)ve.upsertEntry(y.entry);break}case"text":{if(y.thread===D)ve.appendLiveText(String(y.entry??""),String(y.append??""),Number(y.at??Date.now()));break}case"turn":{if(y.thread===D){let S=String(y.state??"idle");pe.setState(!0,S==="working"),tn(D,ne)}nn();break}case"btw":{if(y.thread===D)ve.showBtw(String(y.q??""),String(y.a??""));break}case"unanswered":{if(y.thread===D)ve.setUnanswered(y.unanswered??null);break}case"theme":{if(typeof y.theme==="string")Sr(y.theme);break}case"home":{if(z=y.home??null,Ee.setHome(z),K.isOpen())K.refresh();break}case"favorites":{if(Array.isArray(y.favorites))J=y.favorites.filter((S)=>typeof S==="string"),pe.updateFavoriteModels(J);break}default:break}}),window.addEventListener("keydown",(g)=>{let y=g.key.toLowerCase();if((g.ctrlKey||g.metaKey)&&(y==="k"||g.shiftKey&&y==="p"))if(g.preventDefault(),W.isOpen())W.close();else W.open();else if(g.shiftKey&&g.code==="KeyN"&&(g.altKey||g.ctrlKey||g.metaKey))g.preventDefault(),mt(yt);else if(g.key==="Escape"){let S=document.querySelector('[data-testid="move-project-modal"]');if(S){S.remove();return}if(W.isOpen())W.close();else if(pe.isModelPickerOpen())pe.closeModelPicker();else if(_.isOpen())_.escape();else if(K.isOpen())K.handleEscape();else if(ve.closePlanRevise());else if(ot.isOpen())ot.closePanel()}}),R.connect()}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",Ar);else Ar(); diff --git a/web/dist/assets/pair.js b/web/dist/assets/pair.js index a8a46d3714..27c16532c4 100644 --- a/web/dist/assets/pair.js +++ b/web/dist/assets/pair.js @@ -1 +1 @@ -var U={en:{"agy.signout":"Sign out","android.hub.machines.approve":"Approve","android.load.earlier":"load earlier","approval.dismiss":"Dismiss","approval.implement":"Implement","ask.plan":"Proposed plan","bots.new":"New bot","bots.rooms":"Rooms","bots.tab.browser":"Browser","common.cancel":"Cancel","common.close":"Close","common.copy":"Copy","common.delete":"Delete","common.refresh":"Refresh","common.remove":"Remove","common.save":"Save","common.search":"Search","composer.model.tip":"Choose the model and effort","composer.placeholder":"Ask anything: @bot, >thread, %project, #room, $skill, /btw","composer.send":"Send","composer.stop":"Stop","gpui.acct.connected":"Connected","gpui.acct.not.connected":"Not connected","gpui.acct.sign.in.expired":"Sign-in expired","gpui.ask.plan.ready":"Ready for review","gpui.ask.plan.revise":"Revise","gpui.ask.plan.reviseph":"What should change in the plan?","gpui.ask.plan.sendrev":"Send revision","gpui.assembly":"Assembly","gpui.b.in.reply.to":"↩ In reply to: {quote}","gpui.b.replying.to":"↩ Replying to: {line}","gpui.bots.recall.off":"Off","gpui.bots.recall.on":"On","gpui.c.solid.big.next":"Loading it may take a while and a lot of memory.","gpui.c.solid.load.big":"Load it anyway","gpui.c.solid.loading.big":"Loading it anyway…","gpui.c.term.collapse":"Collapse","gpui.c.term.expand":"Expand","gpui.commands":"Commands","gpui.e.open.folder":"Open folder","gpui.filter.projects.and.threads":"Filter projects and threads","gpui.fold.or.unfold.the.sidebar":"Fold or unfold the sidebar","gpui.follow.paused":"Following paused","gpui.follow.wait":"Following: waiting for the agent's next edit","gpui.gerbers":"Gerbers","gpui.goal.notes":"GOAL & NOTES","gpui.improvements":"Improvements","gpui.jump.to.a.thread.run":"Jump to a thread, run a command or find what was said","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"no MPN","gpui.mgmt.checks.all":"All","gpui.mgmt.checks.fix":"Fix with agent","gpui.mgmt.checks.run":"Run","gpui.mgmt.close":"Close the panel","gpui.mgmt.fab.apply":"Apply","gpui.mgmt.fab.changed":"Changed since you last looked","gpui.mgmt.fab.derived":"* worked out from the fab's page (a mil in mm, a ring from a diameter). Dimmed: the rigid board's value, where this board's page says nothing else. A date opens the page it was read from.","gpui.mgmt.fab.extra":"Costs more","gpui.mgmt.fab.findings":"Findings","gpui.mgmt.fab.free":"Base price","gpui.mgmt.fab.judge":"Datasheets","gpui.mgmt.fab.limit":"Limit","gpui.mgmt.fab.readcol":"Read","gpui.mgmt.fab.refresh":"Refresh","gpui.mgmt.fab.reviewbtn":"Review","gpui.mgmt.fab.seen":"Seen","gpui.mgmt.fab.thefab":"The fab","gpui.mgmt.fab.use":"Use","gpui.mgmt.life.nopart":"No reading of this part yet.","gpui.mgmt.life.reading":"Reading its history…","gpui.mgmt.plan.addnote":"Add note","gpui.mgmt.plan.all":"Approve all","gpui.mgmt.plan.before":"Plan before routing","gpui.mgmt.plan.compact":"Compact","gpui.mgmt.plan.done":"done","gpui.mgmt.plan.drawn":"The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them.","gpui.mgmt.plan.edited":"Edited","gpui.mgmt.plan.elsewhere":"A routing plan for {board} awaits your approval","gpui.mgmt.plan.emptysub":"Layers, corridors, and planes appear here once a plan is proposed.","gpui.mgmt.plan.expand":"Expand","gpui.mgmt.plan.fit":"Fit","gpui.mgmt.plan.grid.all":"All layers","gpui.mgmt.plan.grid.pair":"Side by side","gpui.mgmt.plan.grid.single":"Single","gpui.mgmt.plan.hide":"Hide done","gpui.mgmt.plan.hint":"Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove","gpui.mgmt.plan.keysnote":"On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.","gpui.mgmt.plan.layer":"Approve layer","gpui.mgmt.plan.layer.short":"Layer","gpui.mgmt.plan.lock":"Lock","gpui.mgmt.plan.locked":"Locked","gpui.mgmt.plan.noboard":"No routing plan for this board.","gpui.mgmt.plan.noitems":"No corridors or planes on this layer","gpui.mgmt.plan.note.placeholder":"Steering note for router…","gpui.mgmt.plan.nothing":"Nothing awaits your approval","gpui.mgmt.plan.offwords":"Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here.","gpui.mgmt.plan.onwords":"Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve.","gpui.mgmt.plan.reading":"Reading the routing plan…","gpui.mgmt.plan.reference":"over {layer}","gpui.mgmt.plan.refused":"KiCad refused","gpui.mgmt.plan.reject":"Reject","gpui.mgmt.plan.rejectlayer":"Reject layer","gpui.mgmt.plan.reqplain":"Approval requested","gpui.mgmt.plan.requested":"Approval requested: {what}","gpui.mgmt.plan.saved":"saved plan","gpui.mgmt.plan.show":"Show done","gpui.mgmt.plan.st.approved":"Approved","gpui.mgmt.plan.st.awaiting":"Awaiting review","gpui.mgmt.plan.st.blocked":"Blocked","gpui.mgmt.plan.st.empty":"Empty","gpui.mgmt.plan.st.partial":"Partial","gpui.mgmt.plan.st.rejected":"Rejected","gpui.mgmt.plan.st.routed":"Routed","gpui.mgmt.plan.st.routing":"Routing","gpui.mgmt.plan.st.verified":"Verified","gpui.mgmt.plan.stackup.short":"Stackup","gpui.mgmt.plan.stop":"Stop routing","gpui.mgmt.plan.sync":"Link zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Unlock","gpui.mgmt.plan.verify":"Verify","gpui.mgmt.plan.view.canvas":"Canvas","gpui.mgmt.plan.view.list":"List","gpui.mgmt.plan.view.split":"Split","gpui.mgmt.plan.width":"Width","gpui.next.thread":"Next thread","gpui.no.goal.yet.ask.an":"No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.","gpui.no.models":"No models","gpui.no.threads.yet":"No threads yet.","gpui.nothing.matches":"Nothing matches","gpui.picker.favorite.add":"Add to favorites","gpui.picker.favorite.remove":"Remove from favorites","gpui.picker.favorites":"Favorites","gpui.planmode.bar.always":"Plan mode — explores and proposes a plan before editing","gpui.planmode.bar.executing":"Building the approved plan","gpui.planmode.bar.once":"Plan mode (1 turn) — explores and proposes a plan before editing","gpui.planmode.bar.pending":"Proposed plan awaits review below","gpui.planmode.bar.planning":"Planning — drafting a plan before edits","gpui.planmode.chip.building":"Building","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Always","gpui.planmode.scope.once":"1 turn","gpui.planmode.tip":"Plan before acting (1 turn, always, or off)","gpui.planmode.top.executing":"Building plan","gpui.planmode.top.once":"Plan (1 turn)","gpui.planmode.top.pending":"Review plan","gpui.planmode.top.planning":"Planning","gpui.previous.thread":"Previous thread","gpui.projects.boards":"BOARDS ({n})","gpui.projects.mech":"MECHANICAL ({n})","gpui.projects.threads":"THREADS ({n})","gpui.projects.to.order":"TO ORDER ({n})","gpui.rail.no.board":"No board in this project","gpui.rail.no.mech":"No mechanical parts in this project","gpui.rail.no.schematic":"No schematic in this project","gpui.rail.split.needs.both":"Split needs a board and a schematic","gpui.search.models":"Search models","gpui.settings.group.agents":"Agents and tools","gpui.settings.group.general":"General","home.away":"Home ({name}) is away","home.away.queued":"Home ({name}) is away · {n} queued","home.away.since":"Home ({name}) is away since {time}","home.away.since.queued":"Home ({name}) is away since {time} · {n} queued","home.machine":"Home machine","home.move.failed":"Home move failed","home.move.failed.note":"Home move failed: {note}","home.move.here":"Make this machine the home","home.moving":"Moving home to {to}…","home.moving.step":"Moving home to {to}: {step}","hub.back.crash":"Backplane is back after it stopped unexpectedly","hub.restarting":"Restarting Backplane…","hub.restarting.build":"Restarting Backplane… (new build {build})","hub.stopped":"Backplane stopped","ios.hub.address.field":"Hub address","menu.pin":"Pin","menu.settle":"Settle","menu.unpin":"Unpin","menu.wake":"Wake","model.col.agent":"Agent","model.col.effort":"Effort","native.pair.connect":"Connect","native.thread.model":"Model","notify.settled":"Settled","palette.archive":"Archive thread","palette.command.placeholder":"Type a command or a thread","palette.diff":"Diff: what this thread changed","palette.newthread":"New thread","palette.settings":"Settings","palette.terminal":"Terminal","palette.unarchive":"Unarchive thread","phone.unsettle":"Unsettle","provider.notice.button":"Open Settings → Accounts","provider.notice.head":"No AI provider connected","provider.notice.senderr":"No AI provider connected yet. Open Settings → Accounts to connect Claude, Codex, Antigravity, or another provider.","provider.notice.senderr.remote":"No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.","provider.notice.text.none":"Connect Claude, Codex, Antigravity, or another provider to start chatting.","provider.notice.text.signedout":"Sign in to Claude, Codex, or another provider in Settings → Accounts to start chatting.","reply.action":"Reply","reply.cancel":"Cancel reply","reply.to":"In reply to:","ring.hear.again.local":"Hear again (local)","ring.hear.again.openai":"Hear again (OpenAI)","ring.no.recordings.yet":"No recordings yet.","ring.recordings":"Recordings","ring.ring":"Ring","ring.search.what.you.said":"Search what you said","ring.show.all":"Show all","ring.what.happened":"What happened","rooms.new":"New room","secret.you":"You","settings.appearance":"Appearance","settings.lang":"Language","settings.lang.auto":"Automatic","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Theme","settings.theme.dark":"Dark","settings.theme.light":"Light","sheet.rename":"Rename thread","sidebar.add.project":"Add project","sidebar.search.projects":"Search projects","thread.context.base":"Backplane","thread.context.copied":"Prompt copied.","thread.context.copy":"Copy prompt","thread.context.disable":"Disable","thread.context.enable":"Enable","thread.context.index":"Available skills index","thread.context.injected.label":"Injected project instructions","thread.context.instructions":"Instructions","thread.context.mcp":"Project MCPs","thread.context.native.note":"Backplane’s launch prompt. Native files are loaded by the provider.","thread.context.none.instructions":"No project instructions found.","thread.context.none.mcp":"No project MCP configurations found.","thread.context.reading":"Reading thread context…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Skills","thread.context.system":"System Prompt","thread.context.title":"Context & Prompt","thread.context.trust":"Trust and enable","thread.new":"New thread","tools.pinned":"Pinned","tools.retry":"Retry","tour.title.bots":"Bots","viewer.board":"Board","viewer.diff":"Diff","viewer.files":"Files","viewer.mech":"Mech","viewer.review":"Review","viewer.schematic":"Schematic","viewer.solid":"3D","web.chat.answer.btn":"Answer","web.chat.answer.placeholder":"Type answer…","web.chat.answered":"Answered: {answer}","web.chat.choose":"Choose a project thread on the left to begin.","web.chat.empty":"No messages yet. Type below to start a turn.","web.chat.finished":"Finished {time}","web.chat.finished.dur":"Finished {time} · {dur}","web.chat.loading":"Loading messages…","web.chat.review.mode":"Review mode","web.chat.streaming":"Streaming…","web.clone.add.dir":"Add {dir}","web.clone.back":"Back","web.clone.change.folder":"Change folder","web.clone.cloned":"Cloned {repo} into {dest}","web.clone.cloning":"Cloning {repo} into {dest}","web.clone.copied":"Copied","web.clone.first":"First message: {text}","web.clone.folder.name":"Folder name","web.clone.go":"Clone","web.clone.loading":"Loading…","web.clone.no.folders":"No folders here","web.clone.open.project":"Open the project","web.clone.open.thread":"Open the thread","web.clone.private":"private","web.clone.repo.placeholder":"https or ssh URL, or owner/repo","web.clone.retry":"Try again","web.clone.same":"Already cloned there: it is added as it is.","web.clone.signin":"Sign in to GitHub","web.clone.signin.done":"Signed in to GitHub","web.clone.signin.enter":"Enter this code on GitHub:","web.clone.signin.wait":"Starting GitHub sign-in…","web.clone.start.thread":"Start a thread","web.clone.stopped":"Stopped cloning {repo}","web.clone.tab":"Clone from git","web.clone.up":"Up","web.clone.use.dir":"Use {dir}","web.composer.attach":"Attach image","web.composer.maximages":"At most {max} images per message.","web.composer.unsupported":"Unsupported image type: {type}","web.composer.voice":"Voice dictation","web.home.error":"Could not load this project.","web.home.fold":"Hide threads","web.home.lead":"Lead time: {n} days","web.home.lead.one":"Lead time: 1 day","web.home.loading":"Loading project…","web.home.open":"Open project home","web.home.unfold":"Show threads","web.logout.failed":"Could not confirm sign-out. Try again.","web.pair.approve.in":"Approve on desktop or paired phone · expires in {time}","web.pair.approved":"Approved. Opening Backplane…","web.pair.cancelled":"Cancelled.","web.pair.code":"Comparison code","web.pair.denied":"Pairing request was denied.","web.pair.expired":"Pairing code expired. Request a new code to try again.","web.pair.failed":"Pairing request failed ({status})","web.pair.name":"Browser name","web.pair.nocode":"Hub did not return a comparison code.","web.pair.ratelimited":"Too many pairing attempts. Wait a moment and try again.","web.pair.request":"Request pairing","web.pair.requesting":"Requesting pairing code…","web.pair.subtitle":"Pair this browser with your hub. Approve the 6-digit code in Backplane › Settings › Devices.","web.pair.unreachable":"Could not reach the hub. Check your tailnet connection.","web.plan.awaiting":"{n} awaiting approval","web.plan.net.one":"1 net","web.plan.nets":"{n} nets","web.ring.app.words":"The Pebble app's words","web.ring.count":"{n} recordings","web.ring.count.one":"1 recording","web.ring.error":"Could not load recordings.","web.ring.found":"{found} of {total} have “{q}”.","web.ring.heard.by":"Heard by {model}","web.ring.heard.by.sure":"Heard by {model}, {conf}% sure","web.ring.loading":"Loading recordings…","web.ring.no.words":"(no words)","web.ring.not.heard":"Not heard","web.ring.state.busy":"being heard now","web.ring.state.failed":"not given to Pebble","web.ring.state.heard":"waiting to go to Pebble","web.ring.state.new":"waiting to be heard","web.ring.state.sent":"given to Pebble","web.ring.unavailable":"This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app.","web.settings.providers":"AI providers","web.settings.providers.browser":"Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."},es:{"agy.signout":"Cerrar sesión","android.hub.machines.approve":"Aprobar","android.load.earlier":"cargar anteriores","approval.dismiss":"Descartar","approval.implement":"Implementar","ask.plan":"Plan propuesto","bots.new":"Nuevo bot","bots.rooms":"Salas","bots.tab.browser":"Navegador","common.cancel":"Cancelar","common.close":"Cerrar","common.copy":"Copiar","common.delete":"Eliminar","common.refresh":"Actualizar","common.remove":"Quitar","common.save":"Guardar","common.search":"Buscar","composer.model.tip":"Elegir el modelo y el esfuerzo","composer.placeholder":"Pregunta lo que sea: @bot, >hilo, %proyecto, #sala, $skill, /btw","composer.send":"Enviar","composer.stop":"Detener","gpui.acct.connected":"Conectado","gpui.acct.not.connected":"No conectado","gpui.acct.sign.in.expired":"Sesión caducada","gpui.ask.plan.ready":"Listo para revisar","gpui.ask.plan.revise":"Revisar","gpui.ask.plan.reviseph":"¿Qué debería cambiar en el plan?","gpui.ask.plan.sendrev":"Enviar revisión","gpui.assembly":"Ensamblaje","gpui.b.in.reply.to":"↩ En respuesta a: {quote}","gpui.b.replying.to":"↩ Respondiendo a: {line}","gpui.bots.recall.off":"Desactivado","gpui.bots.recall.on":"Activado","gpui.c.solid.big.next":"Cargarlo puede tardar y usar mucha memoria.","gpui.c.solid.load.big":"Cargarlo de todos modos","gpui.c.solid.loading.big":"Cargándolo de todos modos…","gpui.c.term.collapse":"Contraer","gpui.c.term.expand":"Expandir","gpui.commands":"Comandos","gpui.e.open.folder":"Abrir carpeta","gpui.filter.projects.and.threads":"Filtrar proyectos e hilos","gpui.fold.or.unfold.the.sidebar":"Plegar o desplegar la barra lateral","gpui.follow.paused":"Seguimiento en pausa","gpui.follow.wait":"Siguiendo: esperando la próxima edición del agente","gpui.gerbers":"Gerbers","gpui.goal.notes":"OBJETIVO Y NOTAS","gpui.improvements":"Mejoras","gpui.jump.to.a.thread.run":"Saltar a un hilo, ejecutar un comando o buscar lo dicho","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"sin MPN","gpui.mgmt.checks.all":"Todas","gpui.mgmt.checks.fix":"Corregir con agente","gpui.mgmt.checks.run":"Ejecutar","gpui.mgmt.close":"Cerrar el panel","gpui.mgmt.fab.apply":"Aplicar","gpui.mgmt.fab.changed":"Cambió desde la última vez que miraste","gpui.mgmt.fab.derived":"* calculado desde la página del fabricante (un mil en mm, un anillo desde un diámetro). Atenuado: el valor de la placa rígida, cuando la página de esta placa no dice otra cosa. Una fecha abre la página de la que se leyó.","gpui.mgmt.fab.extra":"Cuesta más","gpui.mgmt.fab.findings":"Hallazgos","gpui.mgmt.fab.free":"Precio base","gpui.mgmt.fab.judge":"Hojas de datos","gpui.mgmt.fab.limit":"Límite","gpui.mgmt.fab.readcol":"Leído","gpui.mgmt.fab.refresh":"Actualizar","gpui.mgmt.fab.reviewbtn":"Revisar","gpui.mgmt.fab.seen":"Visto","gpui.mgmt.fab.thefab":"El fabricante","gpui.mgmt.fab.use":"Usar","gpui.mgmt.life.nopart":"Sin lectura de esta pieza aún.","gpui.mgmt.life.reading":"Leyendo su historial…","gpui.mgmt.plan.addnote":"Añadir nota","gpui.mgmt.plan.all":"Aprobar todo","gpui.mgmt.plan.before":"Planificar antes de rutear","gpui.mgmt.plan.compact":"Compacto","gpui.mgmt.plan.done":"hecho","gpui.mgmt.plan.drawn":"Los corredores y planos del plan se dibujan en la placa mientras este panel está abierto. Ciérralo para ocultarlos.","gpui.mgmt.plan.edited":"Editado","gpui.mgmt.plan.elsewhere":"Un plan de ruteo para {board} espera tu aprobación","gpui.mgmt.plan.emptysub":"Las capas, corredores y planos aparecerán aquí cuando se proponga un plan.","gpui.mgmt.plan.expand":"Expandir","gpui.mgmt.plan.fit":"Ajustar","gpui.mgmt.plan.grid.all":"Todas las capas","gpui.mgmt.plan.grid.pair":"Lado a lado","gpui.mgmt.plan.grid.single":"Única","gpui.mgmt.plan.hide":"Ocultar hechos","gpui.mgmt.plan.hint":"Arrastra vértices para guiar · Clic en + del borde para insertar · Clic derecho en vértice para quitar","gpui.mgmt.plan.keysnote":"En esta versión de KiCad, aprueba desde este panel: en la vista de plan las teclas A, R y W de KiCad aún no son del plan (A abre Añadir Huella). Actualiza KiCad.","gpui.mgmt.plan.layer":"Aprobar capa","gpui.mgmt.plan.layer.short":"Capa","gpui.mgmt.plan.lock":"Bloquear","gpui.mgmt.plan.locked":"Bloqueado","gpui.mgmt.plan.noboard":"No hay plan de ruteo para esta placa.","gpui.mgmt.plan.noitems":"Sin corredores ni planos en esta capa","gpui.mgmt.plan.note.placeholder":"Nota de guiado para el router…","gpui.mgmt.plan.nothing":"Nada espera tu aprobación","gpui.mgmt.plan.offwords":"Los agentes rutean como les pidas. Actívalo para que primero propongan un plan de ruteo y ruteen solo lo que apruebes aquí.","gpui.mgmt.plan.onwords":"Antes de rutear una placa con 4 o más capas de cobre o más de 60 redes, el agente propone aquí corredores y regiones de plano. Solo rutea lo que apruebes.","gpui.mgmt.plan.reading":"Leyendo el plan de ruteo…","gpui.mgmt.plan.reference":"sobre {layer}","gpui.mgmt.plan.refused":"KiCad lo rechazó","gpui.mgmt.plan.reject":"Rechazar","gpui.mgmt.plan.rejectlayer":"Rechazar capa","gpui.mgmt.plan.reqplain":"Aprobación solicitada","gpui.mgmt.plan.requested":"Aprobación solicitada: {what}","gpui.mgmt.plan.saved":"plan guardado","gpui.mgmt.plan.show":"Mostrar hechos","gpui.mgmt.plan.st.approved":"Aprobado","gpui.mgmt.plan.st.awaiting":"Esperando revisión","gpui.mgmt.plan.st.blocked":"Bloqueado","gpui.mgmt.plan.st.empty":"Vacío","gpui.mgmt.plan.st.partial":"Parcial","gpui.mgmt.plan.st.rejected":"Rechazado","gpui.mgmt.plan.st.routed":"Ruteado","gpui.mgmt.plan.st.routing":"Ruteando","gpui.mgmt.plan.st.verified":"Verificado","gpui.mgmt.plan.stackup.short":"Apilamiento","gpui.mgmt.plan.stop":"Detener ruteo","gpui.mgmt.plan.sync":"Vincular zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Desbloquear","gpui.mgmt.plan.verify":"Verificar","gpui.mgmt.plan.view.canvas":"Lienzo","gpui.mgmt.plan.view.list":"Lista","gpui.mgmt.plan.view.split":"Dividido","gpui.mgmt.plan.width":"Ancho","gpui.next.thread":"Hilo siguiente","gpui.no.goal.yet.ask.an":"Sin objetivo aún. Pide a un agente que escriba para qué es este proyecto, o edita .backplane/intent.md.","gpui.no.models":"Sin modelos","gpui.no.threads.yet":"Sin hilos aún.","gpui.nothing.matches":"Nada coincide","gpui.picker.favorite.add":"Añadir a favoritos","gpui.picker.favorite.remove":"Quitar de favoritos","gpui.picker.favorites":"Favoritos","gpui.planmode.bar.always":"Modo plan — explora y propone un plan antes de editar","gpui.planmode.bar.executing":"Ejecutando el plan aprobado","gpui.planmode.bar.once":"Modo plan (1 turno) — explora y propone un plan antes de editar","gpui.planmode.bar.pending":"El plan propuesto espera revisión abajo","gpui.planmode.bar.planning":"Planificando — redactando un plan antes de editar","gpui.planmode.chip.building":"Ejecutando","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Siempre","gpui.planmode.scope.once":"1 turno","gpui.planmode.tip":"Planificar antes de actuar (1 turno, siempre u off)","gpui.planmode.top.executing":"Ejecutando plan","gpui.planmode.top.once":"Plan (1 turno)","gpui.planmode.top.pending":"Revisar plan","gpui.planmode.top.planning":"Planificando","gpui.previous.thread":"Hilo anterior","gpui.projects.boards":"PLACAS ({n})","gpui.projects.mech":"MECÁNICO ({n})","gpui.projects.threads":"HILOS ({n})","gpui.projects.to.order":"POR PEDIR ({n})","gpui.rail.no.board":"Este proyecto no tiene placa","gpui.rail.no.mech":"Este proyecto no tiene piezas mecánicas","gpui.rail.no.schematic":"Este proyecto no tiene esquema","gpui.rail.split.needs.both":"La vista dividida requiere una placa y un esquema","gpui.search.models":"Buscar modelos","gpui.settings.group.agents":"Agentes y herramientas","gpui.settings.group.general":"General","home.away":"El inicio ({name}) no está disponible","home.away.queued":"El inicio ({name}) no está disponible · {n} en cola","home.away.since":"El inicio ({name}) no está disponible desde las {time}","home.away.since.queued":"El inicio ({name}) no está disponible desde las {time} · {n} en cola","home.machine":"Máquina de inicio","home.move.failed":"No se pudo mover el inicio","home.move.failed.note":"No se pudo mover el inicio: {note}","home.move.here":"Hacer de esta máquina el inicio","home.moving":"Moviendo el inicio a {to}…","home.moving.step":"Moviendo el inicio a {to}: {step}","hub.back.crash":"Backplane volvió tras detenerse de forma inesperada","hub.restarting":"Reiniciando Backplane…","hub.restarting.build":"Reiniciando Backplane… (nueva compilación {build})","hub.stopped":"Backplane se detuvo","ios.hub.address.field":"Dirección del hub","menu.pin":"Fijar","menu.settle":"Cerrar","menu.unpin":"Desfijar","menu.wake":"Despertar","model.col.agent":"Agente","model.col.effort":"Esfuerzo","native.pair.connect":"Conectar","native.thread.model":"Modelo","notify.settled":"Cerrado","palette.archive":"Archivar hilo","palette.command.placeholder":"Escribe un comando o un hilo","palette.diff":"Diff: qué cambió este hilo","palette.newthread":"Nuevo hilo","palette.settings":"Ajustes","palette.terminal":"Terminal","palette.unarchive":"Desarchivar hilo","phone.unsettle":"Reabrir","provider.notice.button":"Abrir Configuración → Cuentas","provider.notice.head":"No hay ningún proveedor de IA conectado","provider.notice.senderr":"Aún no hay ningún proveedor de IA conectado. Abre Configuración → Cuentas para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.senderr.remote":"No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.text.none":"Conecta Claude, Codex, Antigravity u otro proveedor para empezar a chatear.","provider.notice.text.signedout":"Inicia sesión en Claude, Codex u otro proveedor en Configuración → Cuentas para empezar a chatear.","reply.action":"Responder","reply.cancel":"Cancelar respuesta","reply.to":"En respuesta a:","ring.hear.again.local":"Escuchar de nuevo (local)","ring.hear.again.openai":"Escuchar de nuevo (OpenAI)","ring.no.recordings.yet":"Sin grabaciones aún.","ring.recordings":"Grabaciones","ring.ring":"Anillo","ring.search.what.you.said":"Buscar lo que dijiste","ring.show.all":"Mostrar todo","ring.what.happened":"Qué ocurrió","rooms.new":"Nueva sala","secret.you":"Tú","settings.appearance":"Apariencia","settings.lang":"Idioma","settings.lang.auto":"Automático","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Tema","settings.theme.dark":"Oscuro","settings.theme.light":"Claro","sheet.rename":"Renombrar hilo","sidebar.add.project":"Añadir proyecto","sidebar.search.projects":"Buscar proyectos","thread.context.base":"Backplane","thread.context.copied":"Se copiaron las instrucciones.","thread.context.copy":"Copiar instrucciones","thread.context.disable":"Desactivar","thread.context.enable":"Activar","thread.context.index":"Índice de habilidades disponibles","thread.context.injected.label":"Instrucciones del proyecto añadidas","thread.context.instructions":"Instrucciones","thread.context.mcp":"MCP del proyecto","thread.context.native.note":"Instrucciones de inicio de Backplane. El proveedor carga los archivos nativos.","thread.context.none.instructions":"No se encontraron instrucciones del proyecto.","thread.context.none.mcp":"No se encontraron configuraciones MCP del proyecto.","thread.context.reading":"Leyendo el contexto del hilo…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Habilidades","thread.context.system":"Instrucciones del sistema","thread.context.title":"Contexto e instrucciones","thread.context.trust":"Confiar y activar","thread.new":"Nuevo hilo","tools.pinned":"Fijado","tools.retry":"Reintentar","tour.title.bots":"Bots","viewer.board":"Placa","viewer.diff":"Diff","viewer.files":"Archivos","viewer.mech":"Mech","viewer.review":"Revisión","viewer.schematic":"Esquemático","viewer.solid":"3D","web.chat.answer.btn":"Responder","web.chat.answer.placeholder":"Escribe una respuesta…","web.chat.answered":"Respondido: {answer}","web.chat.choose":"Elige un hilo de proyecto a la izquierda para empezar.","web.chat.empty":"Aún no hay mensajes. Escribe abajo para iniciar un turno.","web.chat.finished":"Terminado {time}","web.chat.finished.dur":"Terminado {time} · {dur}","web.chat.loading":"Cargando mensajes…","web.chat.review.mode":"Modo de revisión","web.chat.streaming":"Transmitiendo…","web.clone.add.dir":"Añadir {dir}","web.clone.back":"Atrás","web.clone.change.folder":"Cambiar carpeta","web.clone.cloned":"{repo} clonado en {dest}","web.clone.cloning":"Clonando {repo} en {dest}","web.clone.copied":"Copiado","web.clone.first":"Primer mensaje: {text}","web.clone.folder.name":"Nombre de la carpeta","web.clone.go":"Clonar","web.clone.loading":"Cargando…","web.clone.no.folders":"No hay carpetas aquí","web.clone.open.project":"Abrir el proyecto","web.clone.open.thread":"Abrir el hilo","web.clone.private":"privado","web.clone.repo.placeholder":"URL https o ssh, o propietario/repositorio","web.clone.retry":"Reintentar","web.clone.same":"Ya está clonado ahí: se añade tal cual.","web.clone.signin":"Iniciar sesión en GitHub","web.clone.signin.done":"Sesión iniciada en GitHub","web.clone.signin.enter":"Introduce este código en GitHub:","web.clone.signin.wait":"Iniciando sesión en GitHub…","web.clone.start.thread":"Empezar un hilo","web.clone.stopped":"Se detuvo la clonación de {repo}","web.clone.tab":"Clonar desde git","web.clone.up":"Subir","web.clone.use.dir":"Usar {dir}","web.composer.attach":"Adjuntar imagen","web.composer.maximages":"Como máximo {max} imágenes por mensaje.","web.composer.unsupported":"Tipo de imagen no compatible: {type}","web.composer.voice":"Dictado por voz","web.home.error":"No se pudo cargar este proyecto.","web.home.fold":"Ocultar hilos","web.home.lead":"Plazo de entrega: {n} días","web.home.lead.one":"Plazo de entrega: 1 día","web.home.loading":"Cargando el proyecto…","web.home.open":"Abrir la página del proyecto","web.home.unfold":"Mostrar hilos","web.logout.failed":"No se pudo confirmar el cierre de sesión. Inténtalo de nuevo.","web.pair.approve.in":"Aprueba en el escritorio o en un teléfono vinculado · caduca en {time}","web.pair.approved":"Aprobado. Abriendo Backplane…","web.pair.cancelled":"Cancelado.","web.pair.code":"Código de comparación","web.pair.denied":"Se rechazó la solicitud de vinculación.","web.pair.expired":"El código de vinculación caducó. Solicita uno nuevo para intentarlo otra vez.","web.pair.failed":"Falló la solicitud de vinculación ({status})","web.pair.name":"Nombre del navegador","web.pair.nocode":"El hub no devolvió un código de comparación.","web.pair.ratelimited":"Demasiados intentos de vinculación. Espera un momento e inténtalo de nuevo.","web.pair.request":"Solicitar vinculación","web.pair.requesting":"Solicitando código de vinculación…","web.pair.subtitle":"Vincula este navegador con tu hub. Aprueba el código de 6 dígitos en Backplane › Ajustes › Dispositivos.","web.pair.unreachable":"No se pudo conectar con el hub. Comprueba tu conexión de tailnet.","web.plan.awaiting":"{n} esperando aprobación","web.plan.net.one":"1 red","web.plan.nets":"{n} redes","web.ring.app.words":"Las palabras de la aplicación Pebble","web.ring.count":"{n} grabaciones","web.ring.count.one":"1 grabación","web.ring.error":"No se pudieron cargar las grabaciones.","web.ring.found":"{found} de {total} contienen “{q}”.","web.ring.heard.by":"Transcrito por {model}","web.ring.heard.by.sure":"Transcrito por {model}, {conf}% de certeza","web.ring.loading":"Cargando grabaciones…","web.ring.no.words":"(sin palabras)","web.ring.not.heard":"Sin transcribir","web.ring.state.busy":"transcribiéndose ahora","web.ring.state.failed":"no entregada a Pebble","web.ring.state.heard":"en espera de entrega a Pebble","web.ring.state.new":"en espera de transcripción","web.ring.state.sent":"entregada a Pebble","web.ring.unavailable":"Este hub aún no muestra las notas del anillo en un navegador. Actualízalo o abre Configuración › Anillo en la aplicación de escritorio.","web.settings.providers":"Proveedores de IA","web.settings.providers.browser":"Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas."},ja:{"agy.signout":"サインアウト","android.hub.machines.approve":"承認","android.load.earlier":"以前のメッセージを読み込む","approval.dismiss":"閉じる","approval.implement":"実装","ask.plan":"提案されたプラン","bots.new":"新しいボット","bots.rooms":"ルーム","bots.tab.browser":"ブラウザ","common.cancel":"キャンセル","common.close":"閉じる","common.copy":"コピー","common.delete":"削除","common.refresh":"更新","common.remove":"削除","common.save":"保存","common.search":"検索","composer.model.tip":"モデルと推論の強さを選択","composer.placeholder":"何でも質問:@bot、>thread、%project、#room、$skill、/btw","composer.send":"送信","composer.stop":"停止","gpui.acct.connected":"接続済み","gpui.acct.not.connected":"未接続","gpui.acct.sign.in.expired":"サインインの期限切れ","gpui.ask.plan.ready":"確認待ち","gpui.ask.plan.revise":"修正","gpui.ask.plan.reviseph":"計画のどこを変更しますか?","gpui.ask.plan.sendrev":"修正を送る","gpui.assembly":"アセンブリ","gpui.b.in.reply.to":"↩ 返信先:{quote}","gpui.b.replying.to":"↩ 返信中:{line}","gpui.bots.recall.off":"オフ","gpui.bots.recall.on":"オン","gpui.c.solid.big.next":"読み込みには時間と多くのメモリがかかることがあります。","gpui.c.solid.load.big":"それでも読み込む","gpui.c.solid.loading.big":"それでも読み込み中…","gpui.c.term.collapse":"折りたたむ","gpui.c.term.expand":"展開","gpui.commands":"コマンド","gpui.e.open.folder":"フォルダを開く","gpui.filter.projects.and.threads":"プロジェクトとスレッドを絞り込む","gpui.fold.or.unfold.the.sidebar":"サイドバーを折りたたむ/開く","gpui.follow.paused":"追従を一時停止中","gpui.follow.wait":"追従中: エージェントの次の編集を待っています","gpui.gerbers":"ガーバー","gpui.goal.notes":"目標とメモ","gpui.improvements":"改善","gpui.jump.to.a.thread.run":"スレッドへ移動、コマンドを実行、または発言を検索","gpui.mgmt.bom.dnp":"実装しない","gpui.mgmt.bom.nompn":"MPNなし","gpui.mgmt.checks.all":"すべて","gpui.mgmt.checks.fix":"エージェントに直してもらう","gpui.mgmt.checks.run":"実行","gpui.mgmt.close":"パネルを閉じる","gpui.mgmt.fab.apply":"適用","gpui.mgmt.fab.changed":"前回見てから変わったところ","gpui.mgmt.fab.derived":"* 製造元のページから計算した値です(milをmmに、径からランドを)。薄い色の項目はリジッド基板の値です(この基板のページに記載がないもの)。日付を押すと読んだページが開きます。","gpui.mgmt.fab.extra":"追加料金","gpui.mgmt.fab.findings":"指摘","gpui.mgmt.fab.free":"基本料金","gpui.mgmt.fab.judge":"データシート","gpui.mgmt.fab.limit":"項目","gpui.mgmt.fab.readcol":"読んだ日","gpui.mgmt.fab.refresh":"再読み込み","gpui.mgmt.fab.reviewbtn":"レビュー","gpui.mgmt.fab.seen":"確認済み","gpui.mgmt.fab.thefab":"製造元","gpui.mgmt.fab.use":"使う","gpui.mgmt.life.nopart":"この部品の記録はまだありません。","gpui.mgmt.life.reading":"履歴を読んでいます…","gpui.mgmt.plan.addnote":"メモを追加","gpui.mgmt.plan.all":"すべて承認","gpui.mgmt.plan.before":"配線前に計画する","gpui.mgmt.plan.compact":"標準","gpui.mgmt.plan.done":"完了","gpui.mgmt.plan.drawn":"計画の配線経路とプレーンは、このパネルを開いている間だけ基板上に表示されます。閉じると消えます。","gpui.mgmt.plan.edited":"編集済み","gpui.mgmt.plan.elsewhere":"{board}の配線計画が承認を待っています","gpui.mgmt.plan.emptysub":"計画が提案されると、レイヤー・コリドー・ベタ領域がここに表示されます。","gpui.mgmt.plan.expand":"拡大","gpui.mgmt.plan.fit":"全体表示","gpui.mgmt.plan.grid.all":"全レイヤー","gpui.mgmt.plan.grid.pair":"並べて表示","gpui.mgmt.plan.grid.single":"単一","gpui.mgmt.plan.hide":"完了を隠す","gpui.mgmt.plan.hint":"頂点をドラッグして誘導 · 辺の + をクリックで追加 · 頂点を右クリックで削除","gpui.mgmt.plan.keysnote":"このバージョンのKiCadでは、このパネルから承認してください。プランビューでのKiCadのA・R・Wキーはまだ計画のものではありません(Aはフットプリントの追加を開きます)。KiCadを更新してください。","gpui.mgmt.plan.layer":"層を承認","gpui.mgmt.plan.layer.short":"レイヤー","gpui.mgmt.plan.lock":"ロック","gpui.mgmt.plan.locked":"ロック中","gpui.mgmt.plan.noboard":"この基板の配線計画はありません。","gpui.mgmt.plan.noitems":"このレイヤーにコリドーまたはプレーンがありません","gpui.mgmt.plan.note.placeholder":"ルーターへの指示メモ…","gpui.mgmt.plan.nothing":"承認待ちはありません","gpui.mgmt.plan.offwords":"エージェントは指示どおりに配線します。オンにすると、まず配線計画を提案し、ここで承認したものだけを配線します。","gpui.mgmt.plan.onwords":"銅箔層が4層以上、またはネットが60本を超える基板では、配線の前にエージェントがここで配線経路とプレーン領域を提案します。承認したものだけを配線します。","gpui.mgmt.plan.reading":"配線計画を読んでいます…","gpui.mgmt.plan.reference":"基準 {layer}","gpui.mgmt.plan.refused":"KiCad が拒否しました","gpui.mgmt.plan.reject":"却下","gpui.mgmt.plan.rejectlayer":"レイヤーを却下","gpui.mgmt.plan.reqplain":"承認が求められています","gpui.mgmt.plan.requested":"承認が求められています: {what}","gpui.mgmt.plan.saved":"保存された計画","gpui.mgmt.plan.show":"完了を表示","gpui.mgmt.plan.st.approved":"承認済み","gpui.mgmt.plan.st.awaiting":"承認待ち","gpui.mgmt.plan.st.blocked":"ブロック","gpui.mgmt.plan.st.empty":"空","gpui.mgmt.plan.st.partial":"一部完了","gpui.mgmt.plan.st.rejected":"却下","gpui.mgmt.plan.st.routed":"配線済み","gpui.mgmt.plan.st.routing":"配線中","gpui.mgmt.plan.st.verified":"検証済み","gpui.mgmt.plan.stackup.short":"スタックアップ","gpui.mgmt.plan.stop":"配線を止める","gpui.mgmt.plan.sync":"ズーム連動","gpui.mgmt.plan.tab":"計画","gpui.mgmt.plan.unlock":"ロック解除","gpui.mgmt.plan.verify":"検証","gpui.mgmt.plan.view.canvas":"キャンバス","gpui.mgmt.plan.view.list":"リスト","gpui.mgmt.plan.view.split":"分割","gpui.mgmt.plan.width":"幅","gpui.next.thread":"次のスレッド","gpui.no.goal.yet.ask.an":"目標はまだありません。このプロジェクトの目的をエージェントに書いてもらうか、.backplane/intent.md を編集してください。","gpui.no.models":"モデルがありません","gpui.no.threads.yet":"スレッドはまだありません。","gpui.nothing.matches":"一致するものはありません","gpui.picker.favorite.add":"お気に入りに追加","gpui.picker.favorite.remove":"お気に入りから外す","gpui.picker.favorites":"お気に入り","gpui.planmode.bar.always":"計画モード — 編集前に調査して計画を提案します","gpui.planmode.bar.executing":"承認された計画を実行しています","gpui.planmode.bar.once":"計画モード (1回) — 編集前に調査して計画を提案します","gpui.planmode.bar.pending":"提案された計画が下のレビューを待っています","gpui.planmode.bar.planning":"計画中 — 編集前の計画を作成しています","gpui.planmode.chip.building":"実行中","gpui.planmode.chip.once":"計画 · 1回","gpui.planmode.scope.always":"常時","gpui.planmode.scope.once":"1回","gpui.planmode.tip":"実行前に計画を作成 (1回・常時・オフ)","gpui.planmode.top.executing":"計画を実行中","gpui.planmode.top.once":"計画 (1回)","gpui.planmode.top.pending":"計画を確認","gpui.planmode.top.planning":"計画中","gpui.previous.thread":"前のスレッド","gpui.projects.boards":"基板({n})","gpui.projects.mech":"機構部品({n})","gpui.projects.threads":"スレッド({n})","gpui.projects.to.order":"注文するもの({n})","gpui.rail.no.board":"このプロジェクトには基板がありません","gpui.rail.no.mech":"このプロジェクトには機械部品がありません","gpui.rail.no.schematic":"このプロジェクトには回路図がありません","gpui.rail.split.needs.both":"分割表示には基板と回路図が必要です","gpui.search.models":"モデルを検索","gpui.settings.group.agents":"エージェントとツール","gpui.settings.group.general":"一般","home.away":"ホーム({name})はオフラインです","home.away.queued":"ホーム({name})はオフラインです · {n} 件待機中","home.away.since":"ホーム({name})は {time} からオフラインです","home.away.since.queued":"ホーム({name})は {time} からオフラインです · {n} 件待機中","home.machine":"ホームマシン","home.move.failed":"ホームの移動に失敗しました","home.move.failed.note":"ホームの移動に失敗しました: {note}","home.move.here":"このマシンをホームにする","home.moving":"ホームを {to} へ移動中…","home.moving.step":"ホームを {to} へ移動中: {step}","hub.back.crash":"予期せず停止したBackplaneが戻りました","hub.restarting":"Backplaneを再起動しています…","hub.restarting.build":"Backplaneを再起動しています…(新しいビルド {build})","hub.stopped":"Backplaneは停止しました","ios.hub.address.field":"ハブのアドレス","menu.pin":"ピン留め","menu.settle":"完了","menu.unpin":"ピン留めを解除","menu.wake":"再開","model.col.agent":"エージェント","model.col.effort":"推論の強さ","native.pair.connect":"接続","native.thread.model":"モデル","notify.settled":"完了","palette.archive":"スレッドをアーカイブ","palette.command.placeholder":"コマンドまたはスレッドを入力","palette.diff":"差分:このスレッドの変更","palette.newthread":"新しいスレッド","palette.settings":"設定","palette.terminal":"ターミナル","palette.unarchive":"スレッドのアーカイブを解除","phone.unsettle":"未完了に戻す","provider.notice.button":"設定 → アカウントを開く","provider.notice.head":"AI プロバイダーが接続されていません","provider.notice.senderr":"AI プロバイダーがまだ接続されていません。設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.senderr.remote":"{machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.none":"チャットを始めるには、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.signedout":"チャットを始めるには、設定 → アカウントで Claude、Codex などのプロバイダーにサインインしてください。","reply.action":"返信","reply.cancel":"返信をやめる","reply.to":"返信先:","ring.hear.again.local":"もう一度聞き取る (ローカル)","ring.hear.again.openai":"もう一度聞き取る (OpenAI)","ring.no.recordings.yet":"録音はまだありません。","ring.recordings":"録音","ring.ring":"リング","ring.search.what.you.said":"話した内容を検索","ring.show.all":"すべて表示","ring.what.happened":"どうなったか","rooms.new":"新しいルーム","secret.you":"あなた","settings.appearance":"外観","settings.lang":"言語","settings.lang.auto":"自動","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"テーマ","settings.theme.dark":"ダーク","settings.theme.light":"ライト","sheet.rename":"スレッド名を変更","sidebar.add.project":"プロジェクトを追加","sidebar.search.projects":"プロジェクトを検索","thread.context.base":"Backplane","thread.context.copied":"プロンプトをコピーしました。","thread.context.copy":"プロンプトをコピー","thread.context.disable":"無効にする","thread.context.enable":"有効にする","thread.context.index":"利用可能なスキルの一覧","thread.context.injected.label":"追加されたプロジェクトの指示","thread.context.instructions":"指示","thread.context.mcp":"プロジェクトの MCP","thread.context.native.note":"Backplane が起動時に渡すプロンプトです。ネイティブファイルはプロバイダーが読み込みます。","thread.context.none.instructions":"プロジェクトの指示が見つかりません。","thread.context.none.mcp":"プロジェクトの MCP 設定が見つかりません。","thread.context.reading":"スレッドのコンテキストを読み込み中…","thread.context.size":"{bytes} B・約{tokens}トークン","thread.context.skills":"スキル","thread.context.system":"システムプロンプト","thread.context.title":"コンテキストとプロンプト","thread.context.trust":"承認して有効にする","thread.new":"新しいスレッド","tools.pinned":"固定中","tools.retry":"再試行","tour.title.bots":"ボット","viewer.board":"基板","viewer.diff":"差分","viewer.files":"ファイル","viewer.mech":"Mech","viewer.review":"レビュー","viewer.schematic":"回路図","viewer.solid":"3D","web.chat.answer.btn":"回答","web.chat.answer.placeholder":"回答を入力…","web.chat.answered":"回答済み: {answer}","web.chat.choose":"左側からプロジェクトのスレッドを選んで開始してください。","web.chat.empty":"まだメッセージはありません。下に入力して開始してください。","web.chat.finished":"完了 {time}","web.chat.finished.dur":"完了 {time} · {dur}","web.chat.loading":"メッセージを読み込んでいます…","web.chat.review.mode":"レビューモード","web.chat.streaming":"受信中…","web.clone.add.dir":"{dir} を追加","web.clone.back":"戻る","web.clone.change.folder":"フォルダを変更","web.clone.cloned":"{repo} を {dest} にクローンしました","web.clone.cloning":"{repo} を {dest} にクローン中","web.clone.copied":"コピーしました","web.clone.first":"最初のメッセージ: {text}","web.clone.folder.name":"フォルダ名","web.clone.go":"クローン","web.clone.loading":"読み込み中…","web.clone.no.folders":"フォルダがありません","web.clone.open.project":"プロジェクトを開く","web.clone.open.thread":"スレッドを開く","web.clone.private":"非公開","web.clone.repo.placeholder":"https / ssh の URL、または owner/repo","web.clone.retry":"もう一度","web.clone.same":"すでにそこにクローンされています: そのまま追加します。","web.clone.signin":"GitHub にサインイン","web.clone.signin.done":"GitHub にサインインしました","web.clone.signin.enter":"このコードを GitHub に入力してください:","web.clone.signin.wait":"GitHub のサインインを開始しています…","web.clone.start.thread":"スレッドを開始","web.clone.stopped":"{repo} のクローンを中止しました","web.clone.tab":"git からクローン","web.clone.up":"上へ","web.clone.use.dir":"{dir} を使う","web.composer.attach":"画像を添付","web.composer.maximages":"1 件のメッセージに添付できる画像は最大 {max} 枚です。","web.composer.unsupported":"未対応の画像形式です: {type}","web.composer.voice":"音声入力","web.home.error":"このプロジェクトを読み込めませんでした。","web.home.fold":"スレッドを隠す","web.home.lead":"リードタイム: {n} 日","web.home.lead.one":"リードタイム: 1 日","web.home.loading":"プロジェクトを読み込み中…","web.home.open":"プロジェクトホームを開く","web.home.unfold":"スレッドを表示","web.logout.failed":"サインアウトを確認できませんでした。もう一度お試しください。","web.pair.approve.in":"デスクトップまたはペアリング済みの端末で承認してください · 有効期限 {time}","web.pair.approved":"承認されました。Backplane を開いています…","web.pair.cancelled":"キャンセルしました。","web.pair.code":"確認コード","web.pair.denied":"ペアリングのリクエストが拒否されました。","web.pair.expired":"ペアリングコードの有効期限が切れました。新しいコードをリクエストしてください。","web.pair.failed":"ペアリングのリクエストに失敗しました ({status})","web.pair.name":"ブラウザー名","web.pair.nocode":"ハブから確認コードが返されませんでした。","web.pair.ratelimited":"ペアリングの試行回数が多すぎます。しばらく待ってからやり直してください。","web.pair.request":"ペアリングをリクエスト","web.pair.requesting":"ペアリングコードをリクエストしています…","web.pair.subtitle":"このブラウザーをハブとペアリングします。Backplane › 設定 › デバイス で 6 桁のコードを承認してください。","web.pair.unreachable":"ハブに接続できませんでした。tailnet の接続を確認してください。","web.plan.awaiting":"{n} 件が承認待ち","web.plan.net.one":"1 ネット","web.plan.nets":"{n} ネット","web.ring.app.words":"Pebble アプリの文字起こし","web.ring.count":"録音 {n} 件","web.ring.count.one":"録音 1 件","web.ring.error":"録音を読み込めませんでした。","web.ring.found":"{total} 件中 {found} 件に「{q}」があります。","web.ring.heard.by":"{model} が認識","web.ring.heard.by.sure":"{model} が認識、確度 {conf}%","web.ring.loading":"録音を読み込み中…","web.ring.no.words":"(言葉なし)","web.ring.not.heard":"未認識","web.ring.state.busy":"認識中","web.ring.state.failed":"Pebble に渡せませんでした","web.ring.state.heard":"Pebble への受け渡し待ち","web.ring.state.new":"認識待ち","web.ring.state.sent":"Pebble に渡しました","web.ring.unavailable":"このハブはまだブラウザーにリングのメモを表示しません。ハブを更新するか、デスクトップアプリの設定 › リングを開いてください。","web.settings.providers":"AI プロバイダー","web.settings.providers.browser":"Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。"}};function Q(a,t){if(!t)return a;return a.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(s,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):s)}var H=te(),W=new Set,V=new Map;for(let[a,t]of Object.entries(U.en||{}))if(typeof t==="string"&&!V.has(t))V.set(t,a);function te(){let a=typeof navigator<"u"&&navigator.language?navigator.language.toLowerCase():"en";if(a.startsWith("ja"))return"ja";if(a.startsWith("es"))return"es";return"en"}function Y(){if(typeof document<"u"&&document.documentElement)document.documentElement.lang=H}Y();function ge(a){return W.add(a),()=>{W.delete(a)}}function me(a){if(!a)return!1;let t=a.toLowerCase(),s=t.startsWith("ja")?"ja":t.startsWith("es")?"es":t.startsWith("en")?"en":"";if(!s)return!1;let r=s!==H;if(H=s,Y(),r)for(let d of W)d(H);return r}function ue(){return H}function c(a,t,s){let d=(U[H]||U.en||{})[a]??U.en?.[a]??t??a;return Q(d,s)}function be(a){if(!a)return"";let t=V.get(a);if(!t)return a;return c(t,a)}var ae=[[1,26,7,1,[]],[2,44,10,1,[6,18]],[3,70,15,1,[6,22]],[4,100,20,1,[6,26]],[5,134,26,1,[6,30]],[6,172,18,2,[6,34]]],G=new Uint8Array(512),_=new Uint8Array(256);{let a=1;for(let t=0;t<255;t++)if(G[t]=a,_[a]=t,a<<=1,a&256)a^=285;for(let t=255;t<512;t++)G[t]=G[t-255]}function J(a,t){return a===0||t===0?0:G[_[a]+_[t]]}function ne(a){let t=new Uint8Array([1]);for(let s=0;s{let g=e-o*n;return Math.ceil((12+t.length*8)/8)<=g});if(!s)return null;let[r,d,m,f,S]=s,w=d-m*f,u=[],E=(e,o)=>{for(let n=o-1;n>=0;n--)u.push(e>>>n&1)};E(4,4),E(t.length,8);for(let e of t)E(e,8);for(let e=0;e<4&&u.length{if(e<0||o<0||e>=p||o>=p)return;z[e*p+o]=n?1:0,C[e*p+o]=1},N=(e,o)=>{for(let n=-1;n<=7;n++)for(let g=-1;g<=7;g++){let k=e+n,l=o+g,i=n>=0&&n<=6&&g>=0&&g<=6&&(n===0||n===6||g===0||g===6||n>=2&&n<=4&&g>=2&&g<=4);b(k,l,i)}};N(0,0),N(0,p-7),N(p-7,0);for(let e=8;e=1;e-=2){if(e===6)e=5;let o=(e+1&2)===0;for(let n=0;n>>3]>>>7-(j&7)&1,j++;let i=(g+l&1)===0?h^1:h;z[g*p+l]=i}}}let P=30660;for(let e=0;e<=5;e++)b(8,e,(P>>>14-e&1)===1);b(8,7,(P>>>8&1)===1),b(8,8,(P>>>7&1)===1),b(7,8,(P>>>6&1)===1);for(let e=0;e<=5;e++)b(5-e,8,(P>>>5-e&1)===1);for(let e=0;e<8;e++)b(8,p-1-e,(P>>>e&1)===1);for(let e=0;e<7;e++)b(p-7+e,8,(P>>>14-e&1)===1);return{size:p,modules:z}}function X(a){let t=ie(a);if(!t)return null;let s=2,r=t.size+s*2,d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("viewBox",`0 0 ${r} ${r}`),d.setAttribute("role","img"),d.setAttribute("aria-label",`QR code for ${a}`),d.setAttribute("shape-rendering","crispEdges"),d.classList.add("bp-qr-svg");let m=document.createElementNS("http://www.w3.org/2000/svg","rect");m.setAttribute("width",String(r)),m.setAttribute("height",String(r)),m.setAttribute("fill","#ffffff"),d.appendChild(m);let f="";for(let w=0;w{let h=l.trim();if(!h)return;let i=h.startsWith("https://")?h:`https://${h}`;if(!i.startsWith("https://")||i.length<=8)return;let x=document.createElement("div");x.className="bp-pair-addr-meta";let v=document.createElement("div");v.className="bp-pair-code-label",v.textContent=c("ios.hub.address.field","Hub address");let y=document.createElement("code");y.className="bp-pair-addr-url",y.textContent=i,y.setAttribute("data-testid","pair-address");let R=document.createElement("button");R.type="button",R.className="bp-pair-copy";let O=c("common.copy","Copy");R.textContent=O,R.addEventListener("click",()=>{navigator.clipboard?.writeText(i).then(()=>{R.textContent=c("web.clone.copied","Copied"),window.setTimeout(()=>{R.textContent=O},1200)}).catch(()=>{})}),x.append(v,y,R);let D=document.createDocumentFragment();D.appendChild(x);let K=X(i);if(K){let F=document.createElement("div");F.className="bp-pair-qr",F.setAttribute("data-testid","pair-qr"),F.appendChild(K),D.appendChild(F)}p.replaceChildren(D),p.classList.remove("bp-hidden")};fetch("/auth/web/info",{credentials:"same-origin"}).then(async(l)=>{if(!l.ok)return;let h=await l.json();if(typeof h.address==="string")z(h.address)}).catch(()=>{}),t.append(s,m,f,E,A,p),a.appendChild(t);let C=null,b=null,N=null,j=0,I=0,P=150,e=1000;function o(){if(j++,N)N.abort(),N=null;if(C!==null)window.clearTimeout(C),C=null;if(b!==null)window.clearInterval(b),b=null}function n(l="",h=!1){o(),f.classList.remove("bp-hidden"),E.classList.add("bp-hidden"),u.disabled=!1,A.textContent=l,A.className=h?"bp-pair-status bp-bad":"bp-pair-status"}function g(){let l=I-Date.now();if(l<=0){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}B.textContent=c("web.pair.approve.in","Approve on desktop or paired phone · expires in {time}",{time:pe(l)})}async function k(l){if(l!==j)return;if(I>0&&Date.now()>=I){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}let h=new AbortController;N=h;try{let i=await fetch("/auth/web/poll",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}",signal:h.signal});if(l!==j)return;if(e=1000,i.status===202){C=window.setTimeout(()=>{k(l)},150);return}if(i.status===200||i.status===204){let v={};if(i.status===200)try{v=await i.json()}catch{}if(l!==j)return;let y=(v.state||v.status||"").toLowerCase();if(i.status===204||v.approved===!0||y==="approved"||y==="ok"){o(),A.textContent=c("web.pair.approved","Approved. Opening Backplane…"),A.className="bp-pair-status bp-ok",window.location.replace("/");return}if(y==="denied"||y==="rejected"){n(c("web.pair.denied","Pairing request was denied."),!0);return}if(y==="expired"){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}C=window.setTimeout(()=>{k(l)},150);return}if(i.status===429){let v=Number(i.headers.get("Retry-After")||"5"),y=Math.max(2000,(Number.isFinite(v)?v:5)*1000);C=window.setTimeout(()=>{k(l)},y);return}if(i.status===401||i.status===403||i.status===404||i.status===410){let v="";try{let y=await i.json();v=(y.state||y.status||y.error||"").toLowerCase()}catch{}if(l!==j)return;if(v==="denied"||v==="rejected"||i.status===403)n(c("web.pair.denied","Pairing request was denied."),!0);else n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}let x=e;e=Math.min(1e4,Math.round(e*1.8)),C=window.setTimeout(()=>{k(l)},x)}catch{if(l!==j)return;let i=e;e=Math.min(1e4,Math.round(e*1.8)),C=window.setTimeout(()=>{k(l)},i)}finally{if(N===h)N=null}}L.addEventListener("click",()=>{n(c("web.pair.cancelled","Cancelled."))}),f.addEventListener("submit",async(l)=>{l.preventDefault();let h=w.value.trim()||Z();u.disabled=!0,A.textContent=c("web.pair.requesting","Requesting pairing code…"),A.className="bp-pair-status";try{let i=await fetch("/auth/web/request",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h})});if(!i.ok){let O=c("web.pair.failed","Pairing request failed ({status})",{status:i.status});try{let D=await i.json();if(D.error)O=D.error}catch{}if(i.status===429)O=c("web.pair.ratelimited","Too many pairing attempts. Wait a moment and try again.");n(O,!0);return}let x=await i.json(),v=x.code||x.checkCode||"";if(!v){n(c("web.pair.nocode","Hub did not return a comparison code."),!0);return}let y=Date.now();I=x.expiresAt?x.expiresAt<10000000000?x.expiresAt*1000:x.expiresAt:y+(x.expiresIn?x.expiresIn*1000:120000),o();let R=j;e=1000,P=x.pollMs&&x.pollMs>=100?x.pollMs:150,M.textContent=re(v),f.classList.add("bp-hidden"),E.classList.remove("bp-hidden"),A.textContent="",g(),b=window.setInterval(g,1000),C=window.setTimeout(()=>{k(R)},P)}catch{n(c("web.pair.unreachable","Could not reach the hub. Check your tailnet connection."),!0)}})}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",ee);else ee(); +var U={en:{"agy.signout":"Sign out","android.hub.machines.approve":"Approve","android.load.earlier":"load earlier","approval.dismiss":"Dismiss","approval.implement":"Implement","ask.plan":"Proposed plan","bots.new":"New bot","bots.rooms":"Rooms","bots.tab.browser":"Browser","chats.move":"Move to project…","chats.move.none":"No project to move it to. Add a project first.","chats.new.noproject":"New chat (no project)","chats.title":"Chats","common.cancel":"Cancel","common.close":"Close","common.copy":"Copy","common.delete":"Delete","common.refresh":"Refresh","common.remove":"Remove","common.save":"Save","common.search":"Search","composer.model.tip":"Choose the model and effort","composer.placeholder":"Ask anything: @bot, >thread, %project, #room, $skill, /btw","composer.send":"Send","composer.stop":"Stop","gpui.acct.connected":"Connected","gpui.acct.not.connected":"Not connected","gpui.acct.sign.in.expired":"Sign-in expired","gpui.ask.plan.ready":"Ready for review","gpui.ask.plan.revise":"Revise","gpui.ask.plan.reviseph":"What should change in the plan?","gpui.ask.plan.sendrev":"Send revision","gpui.assembly":"Assembly","gpui.b.in.reply.to":"↩ In reply to: {quote}","gpui.b.replying.to":"↩ Replying to: {line}","gpui.bots.recall.off":"Off","gpui.bots.recall.on":"On","gpui.c.solid.big.next":"Loading it may take a while and a lot of memory.","gpui.c.solid.load.big":"Load it anyway","gpui.c.solid.loading.big":"Loading it anyway…","gpui.c.term.collapse":"Collapse","gpui.c.term.expand":"Expand","gpui.commands":"Commands","gpui.e.open.folder":"Open folder","gpui.filter.projects.and.threads":"Filter projects and threads","gpui.fold.or.unfold.the.sidebar":"Fold or unfold the sidebar","gpui.follow.paused":"Following paused","gpui.follow.wait":"Following: waiting for the agent's next edit","gpui.gerbers":"Gerbers","gpui.goal.notes":"GOAL & NOTES","gpui.improvements":"Improvements","gpui.jump.to.a.thread.run":"Jump to a thread, run a command or find what was said","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"no MPN","gpui.mgmt.checks.all":"All","gpui.mgmt.checks.fix":"Fix with agent","gpui.mgmt.checks.run":"Run","gpui.mgmt.close":"Close the panel","gpui.mgmt.fab.apply":"Apply","gpui.mgmt.fab.changed":"Changed since you last looked","gpui.mgmt.fab.derived":"* worked out from the fab's page (a mil in mm, a ring from a diameter). Dimmed: the rigid board's value, where this board's page says nothing else. A date opens the page it was read from.","gpui.mgmt.fab.extra":"Costs more","gpui.mgmt.fab.findings":"Findings","gpui.mgmt.fab.free":"Base price","gpui.mgmt.fab.judge":"Datasheets","gpui.mgmt.fab.limit":"Limit","gpui.mgmt.fab.readcol":"Read","gpui.mgmt.fab.refresh":"Refresh","gpui.mgmt.fab.reviewbtn":"Review","gpui.mgmt.fab.seen":"Seen","gpui.mgmt.fab.thefab":"The fab","gpui.mgmt.fab.use":"Use","gpui.mgmt.life.nopart":"No reading of this part yet.","gpui.mgmt.life.reading":"Reading its history…","gpui.mgmt.plan.addnote":"Add note","gpui.mgmt.plan.all":"Approve all","gpui.mgmt.plan.before":"Plan before routing","gpui.mgmt.plan.compact":"Compact","gpui.mgmt.plan.done":"done","gpui.mgmt.plan.drawn":"The plan's corridors and planes are drawn on the board while this panel is open. Close it to hide them.","gpui.mgmt.plan.edited":"Edited","gpui.mgmt.plan.elsewhere":"A routing plan for {board} awaits your approval","gpui.mgmt.plan.emptysub":"Layers, corridors, and planes appear here once a plan is proposed.","gpui.mgmt.plan.expand":"Expand","gpui.mgmt.plan.fit":"Fit","gpui.mgmt.plan.grid.all":"All layers","gpui.mgmt.plan.grid.pair":"Side by side","gpui.mgmt.plan.grid.single":"Single","gpui.mgmt.plan.hide":"Hide done","gpui.mgmt.plan.hint":"Drag waypoints to steer · Click + on edge to insert · Right-click vertex to remove","gpui.mgmt.plan.keysnote":"On this KiCad version, approve from this panel: in plan view KiCad's A, R and W keys aren't the plan's yet (A opens Add Footprint). Update KiCad.","gpui.mgmt.plan.layer":"Approve layer","gpui.mgmt.plan.layer.short":"Layer","gpui.mgmt.plan.lock":"Lock","gpui.mgmt.plan.locked":"Locked","gpui.mgmt.plan.noboard":"No routing plan for this board.","gpui.mgmt.plan.noitems":"No corridors or planes on this layer","gpui.mgmt.plan.note.placeholder":"Steering note for router…","gpui.mgmt.plan.nothing":"Nothing awaits your approval","gpui.mgmt.plan.offwords":"Agents route as you ask. Turn it on to have them propose a routing plan first and route only what you approve here.","gpui.mgmt.plan.onwords":"Before routing a board with 4 or more copper layers or more than 60 nets, the agent proposes corridors and plane regions here. It routes only what you approve.","gpui.mgmt.plan.reading":"Reading the routing plan…","gpui.mgmt.plan.reference":"over {layer}","gpui.mgmt.plan.refused":"KiCad refused","gpui.mgmt.plan.reject":"Reject","gpui.mgmt.plan.rejectlayer":"Reject layer","gpui.mgmt.plan.reqplain":"Approval requested","gpui.mgmt.plan.requested":"Approval requested: {what}","gpui.mgmt.plan.saved":"saved plan","gpui.mgmt.plan.show":"Show done","gpui.mgmt.plan.st.approved":"Approved","gpui.mgmt.plan.st.awaiting":"Awaiting review","gpui.mgmt.plan.st.blocked":"Blocked","gpui.mgmt.plan.st.empty":"Empty","gpui.mgmt.plan.st.partial":"Partial","gpui.mgmt.plan.st.rejected":"Rejected","gpui.mgmt.plan.st.routed":"Routed","gpui.mgmt.plan.st.routing":"Routing","gpui.mgmt.plan.st.verified":"Verified","gpui.mgmt.plan.stackup.short":"Stackup","gpui.mgmt.plan.stop":"Stop routing","gpui.mgmt.plan.sync":"Link zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Unlock","gpui.mgmt.plan.verify":"Verify","gpui.mgmt.plan.view.canvas":"Canvas","gpui.mgmt.plan.view.list":"List","gpui.mgmt.plan.view.split":"Split","gpui.mgmt.plan.width":"Width","gpui.next.thread":"Next thread","gpui.no.goal.yet.ask.an":"No goal yet. Ask an agent to write what this project is for, or edit .backplane/intent.md.","gpui.no.models":"No models","gpui.no.threads.yet":"No threads yet.","gpui.nothing.matches":"Nothing matches","gpui.picker.favorite.add":"Add to favorites","gpui.picker.favorite.remove":"Remove from favorites","gpui.picker.favorites":"Favorites","gpui.planmode.bar.always":"Plan mode — explores and proposes a plan before editing","gpui.planmode.bar.executing":"Building the approved plan","gpui.planmode.bar.once":"Plan mode (1 turn) — explores and proposes a plan before editing","gpui.planmode.bar.pending":"Proposed plan awaits review below","gpui.planmode.bar.planning":"Planning — drafting a plan before edits","gpui.planmode.chip.building":"Building","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Always","gpui.planmode.scope.once":"1 turn","gpui.planmode.tip":"Plan before acting (1 turn, always, or off)","gpui.planmode.top.executing":"Building plan","gpui.planmode.top.once":"Plan (1 turn)","gpui.planmode.top.pending":"Review plan","gpui.planmode.top.planning":"Planning","gpui.previous.thread":"Previous thread","gpui.projects.boards":"BOARDS ({n})","gpui.projects.mech":"MECHANICAL ({n})","gpui.projects.threads":"THREADS ({n})","gpui.projects.to.order":"TO ORDER ({n})","gpui.rail.no.board":"No board in this project","gpui.rail.no.mech":"No mechanical parts in this project","gpui.rail.no.schematic":"No schematic in this project","gpui.rail.split.needs.both":"Split needs a board and a schematic","gpui.search.models":"Search models","gpui.settings.group.agents":"Agents and tools","gpui.settings.group.general":"General","home.away":"Home ({name}) is away","home.away.queued":"Home ({name}) is away · {n} queued","home.away.since":"Home ({name}) is away since {time}","home.away.since.queued":"Home ({name}) is away since {time} · {n} queued","home.machine":"Home machine","home.move.failed":"Home move failed","home.move.failed.note":"Home move failed: {note}","home.move.here":"Make this machine the home","home.moving":"Moving home to {to}…","home.moving.step":"Moving home to {to}: {step}","hub.back.crash":"Backplane is back after it stopped unexpectedly","hub.restarting":"Restarting Backplane…","hub.restarting.build":"Restarting Backplane… (new build {build})","hub.stopped":"Backplane stopped","ios.hub.address.field":"Hub address","menu.pin":"Pin","menu.settle":"Settle","menu.unpin":"Unpin","menu.wake":"Wake","model.col.agent":"Agent","model.col.effort":"Effort","native.pair.connect":"Connect","native.thread.model":"Model","notify.settled":"Settled","palette.archive":"Archive thread","palette.command.placeholder":"Type a command or a thread","palette.diff":"Diff: what this thread changed","palette.newthread":"New thread","palette.settings":"Settings","palette.terminal":"Terminal","palette.unarchive":"Unarchive thread","phone.unsettle":"Unsettle","provider.notice.button":"Open Settings → Accounts","provider.notice.head":"No AI provider connected","provider.notice.senderr":"No AI provider connected yet. Open Settings → Accounts to connect Claude, Codex, Antigravity, or another provider.","provider.notice.senderr.remote":"No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.","provider.notice.text.none":"Connect Claude, Codex, Antigravity, or another provider to start chatting.","provider.notice.text.signedout":"Sign in to Claude, Codex, or another provider in Settings → Accounts to start chatting.","reply.action":"Reply","reply.cancel":"Cancel reply","reply.to":"In reply to:","ring.hear.again.local":"Hear again (local)","ring.hear.again.openai":"Hear again (OpenAI)","ring.no.recordings.yet":"No recordings yet.","ring.recordings":"Recordings","ring.ring":"Ring","ring.search.what.you.said":"Search what you said","ring.show.all":"Show all","ring.what.happened":"What happened","rooms.new":"New room","secret.you":"You","settings.appearance":"Appearance","settings.lang":"Language","settings.lang.auto":"Automatic","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Theme","settings.theme.dark":"Dark","settings.theme.light":"Light","sheet.rename":"Rename thread","sidebar.add.project":"Add project","sidebar.search.projects":"Search projects","thread.context.base":"Backplane","thread.context.copied":"Prompt copied.","thread.context.copy":"Copy prompt","thread.context.disable":"Disable","thread.context.enable":"Enable","thread.context.index":"Available skills index","thread.context.injected.label":"Injected project instructions","thread.context.instructions":"Instructions","thread.context.mcp":"Project MCPs","thread.context.native.note":"Backplane’s launch prompt. Native files are loaded by the provider.","thread.context.none.instructions":"No project instructions found.","thread.context.none.mcp":"No project MCP configurations found.","thread.context.reading":"Reading thread context…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Skills","thread.context.system":"System Prompt","thread.context.title":"Context & Prompt","thread.context.trust":"Trust and enable","thread.new":"New thread","tools.pinned":"Pinned","tools.retry":"Retry","tour.title.bots":"Bots","viewer.board":"Board","viewer.diff":"Diff","viewer.files":"Files","viewer.mech":"Mech","viewer.review":"Review","viewer.schematic":"Schematic","viewer.solid":"3D","web.chat.answer.btn":"Answer","web.chat.answer.placeholder":"Type answer…","web.chat.answered":"Answered: {answer}","web.chat.choose":"Choose a project thread on the left to begin.","web.chat.empty":"No messages yet. Type below to start a turn.","web.chat.finished":"Finished {time}","web.chat.finished.dur":"Finished {time} · {dur}","web.chat.loading":"Loading messages…","web.chat.review.mode":"Review mode","web.chat.streaming":"Streaming…","web.clone.add.dir":"Add {dir}","web.clone.back":"Back","web.clone.change.folder":"Change folder","web.clone.cloned":"Cloned {repo} into {dest}","web.clone.cloning":"Cloning {repo} into {dest}","web.clone.copied":"Copied","web.clone.first":"First message: {text}","web.clone.folder.name":"Folder name","web.clone.go":"Clone","web.clone.loading":"Loading…","web.clone.no.folders":"No folders here","web.clone.open.project":"Open the project","web.clone.open.thread":"Open the thread","web.clone.private":"private","web.clone.repo.placeholder":"https or ssh URL, or owner/repo","web.clone.retry":"Try again","web.clone.same":"Already cloned there: it is added as it is.","web.clone.signin":"Sign in to GitHub","web.clone.signin.done":"Signed in to GitHub","web.clone.signin.enter":"Enter this code on GitHub:","web.clone.signin.wait":"Starting GitHub sign-in…","web.clone.start.thread":"Start a thread","web.clone.stopped":"Stopped cloning {repo}","web.clone.tab":"Clone from git","web.clone.up":"Up","web.clone.use.dir":"Use {dir}","web.composer.attach":"Attach image","web.composer.maximages":"At most {max} images per message.","web.composer.unsupported":"Unsupported image type: {type}","web.composer.voice":"Voice dictation","web.home.error":"Could not load this project.","web.home.fold":"Hide threads","web.home.lead":"Lead time: {n} days","web.home.lead.one":"Lead time: 1 day","web.home.loading":"Loading project…","web.home.open":"Open project home","web.home.unfold":"Show threads","web.logout.failed":"Could not confirm sign-out. Try again.","web.pair.approve.in":"Approve on desktop or paired phone · expires in {time}","web.pair.approved":"Approved. Opening Backplane…","web.pair.cancelled":"Cancelled.","web.pair.code":"Comparison code","web.pair.denied":"Pairing request was denied.","web.pair.expired":"Pairing code expired. Request a new code to try again.","web.pair.failed":"Pairing request failed ({status})","web.pair.name":"Browser name","web.pair.nocode":"Hub did not return a comparison code.","web.pair.ratelimited":"Too many pairing attempts. Wait a moment and try again.","web.pair.request":"Request pairing","web.pair.requesting":"Requesting pairing code…","web.pair.subtitle":"Pair this browser with your hub. Approve the 6-digit code in Backplane › Settings › Devices.","web.pair.unreachable":"Could not reach the hub. Check your tailnet connection.","web.plan.awaiting":"{n} awaiting approval","web.plan.net.one":"1 net","web.plan.nets":"{n} nets","web.ring.app.words":"The Pebble app's words","web.ring.count":"{n} recordings","web.ring.count.one":"1 recording","web.ring.error":"Could not load recordings.","web.ring.found":"{found} of {total} have “{q}”.","web.ring.heard.by":"Heard by {model}","web.ring.heard.by.sure":"Heard by {model}, {conf}% sure","web.ring.loading":"Loading recordings…","web.ring.no.words":"(no words)","web.ring.not.heard":"Not heard","web.ring.state.busy":"being heard now","web.ring.state.failed":"not given to Pebble","web.ring.state.heard":"waiting to go to Pebble","web.ring.state.new":"waiting to be heard","web.ring.state.sent":"given to Pebble","web.ring.unavailable":"This hub does not show ring notes to a browser yet. Update it, or open Settings › Ring in the desktop app.","web.settings.providers":"AI providers","web.settings.providers.browser":"Connect a provider in the Backplane desktop or mobile app under Settings → Accounts."},es:{"agy.signout":"Cerrar sesión","android.hub.machines.approve":"Aprobar","android.load.earlier":"cargar anteriores","approval.dismiss":"Descartar","approval.implement":"Implementar","ask.plan":"Plan propuesto","bots.new":"Nuevo bot","bots.rooms":"Salas","bots.tab.browser":"Navegador","chats.move":"Mover a un proyecto…","chats.move.none":"No hay ningún proyecto al que moverlo. Añade uno primero.","chats.new.noproject":"Chat nuevo (sin proyecto)","chats.title":"Chats","common.cancel":"Cancelar","common.close":"Cerrar","common.copy":"Copiar","common.delete":"Eliminar","common.refresh":"Actualizar","common.remove":"Quitar","common.save":"Guardar","common.search":"Buscar","composer.model.tip":"Elegir el modelo y el esfuerzo","composer.placeholder":"Pregunta lo que sea: @bot, >hilo, %proyecto, #sala, $skill, /btw","composer.send":"Enviar","composer.stop":"Detener","gpui.acct.connected":"Conectado","gpui.acct.not.connected":"No conectado","gpui.acct.sign.in.expired":"Sesión caducada","gpui.ask.plan.ready":"Listo para revisar","gpui.ask.plan.revise":"Revisar","gpui.ask.plan.reviseph":"¿Qué debería cambiar en el plan?","gpui.ask.plan.sendrev":"Enviar revisión","gpui.assembly":"Ensamblaje","gpui.b.in.reply.to":"↩ En respuesta a: {quote}","gpui.b.replying.to":"↩ Respondiendo a: {line}","gpui.bots.recall.off":"Desactivado","gpui.bots.recall.on":"Activado","gpui.c.solid.big.next":"Cargarlo puede tardar y usar mucha memoria.","gpui.c.solid.load.big":"Cargarlo de todos modos","gpui.c.solid.loading.big":"Cargándolo de todos modos…","gpui.c.term.collapse":"Contraer","gpui.c.term.expand":"Expandir","gpui.commands":"Comandos","gpui.e.open.folder":"Abrir carpeta","gpui.filter.projects.and.threads":"Filtrar proyectos e hilos","gpui.fold.or.unfold.the.sidebar":"Plegar o desplegar la barra lateral","gpui.follow.paused":"Seguimiento en pausa","gpui.follow.wait":"Siguiendo: esperando la próxima edición del agente","gpui.gerbers":"Gerbers","gpui.goal.notes":"OBJETIVO Y NOTAS","gpui.improvements":"Mejoras","gpui.jump.to.a.thread.run":"Saltar a un hilo, ejecutar un comando o buscar lo dicho","gpui.mgmt.bom.dnp":"DNP","gpui.mgmt.bom.nompn":"sin MPN","gpui.mgmt.checks.all":"Todas","gpui.mgmt.checks.fix":"Corregir con agente","gpui.mgmt.checks.run":"Ejecutar","gpui.mgmt.close":"Cerrar el panel","gpui.mgmt.fab.apply":"Aplicar","gpui.mgmt.fab.changed":"Cambió desde la última vez que miraste","gpui.mgmt.fab.derived":"* calculado desde la página del fabricante (un mil en mm, un anillo desde un diámetro). Atenuado: el valor de la placa rígida, cuando la página de esta placa no dice otra cosa. Una fecha abre la página de la que se leyó.","gpui.mgmt.fab.extra":"Cuesta más","gpui.mgmt.fab.findings":"Hallazgos","gpui.mgmt.fab.free":"Precio base","gpui.mgmt.fab.judge":"Hojas de datos","gpui.mgmt.fab.limit":"Límite","gpui.mgmt.fab.readcol":"Leído","gpui.mgmt.fab.refresh":"Actualizar","gpui.mgmt.fab.reviewbtn":"Revisar","gpui.mgmt.fab.seen":"Visto","gpui.mgmt.fab.thefab":"El fabricante","gpui.mgmt.fab.use":"Usar","gpui.mgmt.life.nopart":"Sin lectura de esta pieza aún.","gpui.mgmt.life.reading":"Leyendo su historial…","gpui.mgmt.plan.addnote":"Añadir nota","gpui.mgmt.plan.all":"Aprobar todo","gpui.mgmt.plan.before":"Planificar antes de rutear","gpui.mgmt.plan.compact":"Compacto","gpui.mgmt.plan.done":"hecho","gpui.mgmt.plan.drawn":"Los corredores y planos del plan se dibujan en la placa mientras este panel está abierto. Ciérralo para ocultarlos.","gpui.mgmt.plan.edited":"Editado","gpui.mgmt.plan.elsewhere":"Un plan de ruteo para {board} espera tu aprobación","gpui.mgmt.plan.emptysub":"Las capas, corredores y planos aparecerán aquí cuando se proponga un plan.","gpui.mgmt.plan.expand":"Expandir","gpui.mgmt.plan.fit":"Ajustar","gpui.mgmt.plan.grid.all":"Todas las capas","gpui.mgmt.plan.grid.pair":"Lado a lado","gpui.mgmt.plan.grid.single":"Única","gpui.mgmt.plan.hide":"Ocultar hechos","gpui.mgmt.plan.hint":"Arrastra vértices para guiar · Clic en + del borde para insertar · Clic derecho en vértice para quitar","gpui.mgmt.plan.keysnote":"En esta versión de KiCad, aprueba desde este panel: en la vista de plan las teclas A, R y W de KiCad aún no son del plan (A abre Añadir Huella). Actualiza KiCad.","gpui.mgmt.plan.layer":"Aprobar capa","gpui.mgmt.plan.layer.short":"Capa","gpui.mgmt.plan.lock":"Bloquear","gpui.mgmt.plan.locked":"Bloqueado","gpui.mgmt.plan.noboard":"No hay plan de ruteo para esta placa.","gpui.mgmt.plan.noitems":"Sin corredores ni planos en esta capa","gpui.mgmt.plan.note.placeholder":"Nota de guiado para el router…","gpui.mgmt.plan.nothing":"Nada espera tu aprobación","gpui.mgmt.plan.offwords":"Los agentes rutean como les pidas. Actívalo para que primero propongan un plan de ruteo y ruteen solo lo que apruebes aquí.","gpui.mgmt.plan.onwords":"Antes de rutear una placa con 4 o más capas de cobre o más de 60 redes, el agente propone aquí corredores y regiones de plano. Solo rutea lo que apruebes.","gpui.mgmt.plan.reading":"Leyendo el plan de ruteo…","gpui.mgmt.plan.reference":"sobre {layer}","gpui.mgmt.plan.refused":"KiCad lo rechazó","gpui.mgmt.plan.reject":"Rechazar","gpui.mgmt.plan.rejectlayer":"Rechazar capa","gpui.mgmt.plan.reqplain":"Aprobación solicitada","gpui.mgmt.plan.requested":"Aprobación solicitada: {what}","gpui.mgmt.plan.saved":"plan guardado","gpui.mgmt.plan.show":"Mostrar hechos","gpui.mgmt.plan.st.approved":"Aprobado","gpui.mgmt.plan.st.awaiting":"Esperando revisión","gpui.mgmt.plan.st.blocked":"Bloqueado","gpui.mgmt.plan.st.empty":"Vacío","gpui.mgmt.plan.st.partial":"Parcial","gpui.mgmt.plan.st.rejected":"Rechazado","gpui.mgmt.plan.st.routed":"Ruteado","gpui.mgmt.plan.st.routing":"Ruteando","gpui.mgmt.plan.st.verified":"Verificado","gpui.mgmt.plan.stackup.short":"Apilamiento","gpui.mgmt.plan.stop":"Detener ruteo","gpui.mgmt.plan.sync":"Vincular zoom","gpui.mgmt.plan.tab":"Plan","gpui.mgmt.plan.unlock":"Desbloquear","gpui.mgmt.plan.verify":"Verificar","gpui.mgmt.plan.view.canvas":"Lienzo","gpui.mgmt.plan.view.list":"Lista","gpui.mgmt.plan.view.split":"Dividido","gpui.mgmt.plan.width":"Ancho","gpui.next.thread":"Hilo siguiente","gpui.no.goal.yet.ask.an":"Sin objetivo aún. Pide a un agente que escriba para qué es este proyecto, o edita .backplane/intent.md.","gpui.no.models":"Sin modelos","gpui.no.threads.yet":"Sin hilos aún.","gpui.nothing.matches":"Nada coincide","gpui.picker.favorite.add":"Añadir a favoritos","gpui.picker.favorite.remove":"Quitar de favoritos","gpui.picker.favorites":"Favoritos","gpui.planmode.bar.always":"Modo plan — explora y propone un plan antes de editar","gpui.planmode.bar.executing":"Ejecutando el plan aprobado","gpui.planmode.bar.once":"Modo plan (1 turno) — explora y propone un plan antes de editar","gpui.planmode.bar.pending":"El plan propuesto espera revisión abajo","gpui.planmode.bar.planning":"Planificando — redactando un plan antes de editar","gpui.planmode.chip.building":"Ejecutando","gpui.planmode.chip.once":"Plan · 1t","gpui.planmode.scope.always":"Siempre","gpui.planmode.scope.once":"1 turno","gpui.planmode.tip":"Planificar antes de actuar (1 turno, siempre u off)","gpui.planmode.top.executing":"Ejecutando plan","gpui.planmode.top.once":"Plan (1 turno)","gpui.planmode.top.pending":"Revisar plan","gpui.planmode.top.planning":"Planificando","gpui.previous.thread":"Hilo anterior","gpui.projects.boards":"PLACAS ({n})","gpui.projects.mech":"MECÁNICO ({n})","gpui.projects.threads":"HILOS ({n})","gpui.projects.to.order":"POR PEDIR ({n})","gpui.rail.no.board":"Este proyecto no tiene placa","gpui.rail.no.mech":"Este proyecto no tiene piezas mecánicas","gpui.rail.no.schematic":"Este proyecto no tiene esquema","gpui.rail.split.needs.both":"La vista dividida requiere una placa y un esquema","gpui.search.models":"Buscar modelos","gpui.settings.group.agents":"Agentes y herramientas","gpui.settings.group.general":"General","home.away":"El inicio ({name}) no está disponible","home.away.queued":"El inicio ({name}) no está disponible · {n} en cola","home.away.since":"El inicio ({name}) no está disponible desde las {time}","home.away.since.queued":"El inicio ({name}) no está disponible desde las {time} · {n} en cola","home.machine":"Máquina de inicio","home.move.failed":"No se pudo mover el inicio","home.move.failed.note":"No se pudo mover el inicio: {note}","home.move.here":"Hacer de esta máquina el inicio","home.moving":"Moviendo el inicio a {to}…","home.moving.step":"Moviendo el inicio a {to}: {step}","hub.back.crash":"Backplane volvió tras detenerse de forma inesperada","hub.restarting":"Reiniciando Backplane…","hub.restarting.build":"Reiniciando Backplane… (nueva compilación {build})","hub.stopped":"Backplane se detuvo","ios.hub.address.field":"Dirección del hub","menu.pin":"Fijar","menu.settle":"Cerrar","menu.unpin":"Desfijar","menu.wake":"Despertar","model.col.agent":"Agente","model.col.effort":"Esfuerzo","native.pair.connect":"Conectar","native.thread.model":"Modelo","notify.settled":"Cerrado","palette.archive":"Archivar hilo","palette.command.placeholder":"Escribe un comando o un hilo","palette.diff":"Diff: qué cambió este hilo","palette.newthread":"Nuevo hilo","palette.settings":"Ajustes","palette.terminal":"Terminal","palette.unarchive":"Desarchivar hilo","phone.unsettle":"Reabrir","provider.notice.button":"Abrir Configuración → Cuentas","provider.notice.head":"No hay ningún proveedor de IA conectado","provider.notice.senderr":"Aún no hay ningún proveedor de IA conectado. Abre Configuración → Cuentas para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.senderr.remote":"No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.","provider.notice.text.none":"Conecta Claude, Codex, Antigravity u otro proveedor para empezar a chatear.","provider.notice.text.signedout":"Inicia sesión en Claude, Codex u otro proveedor en Configuración → Cuentas para empezar a chatear.","reply.action":"Responder","reply.cancel":"Cancelar respuesta","reply.to":"En respuesta a:","ring.hear.again.local":"Escuchar de nuevo (local)","ring.hear.again.openai":"Escuchar de nuevo (OpenAI)","ring.no.recordings.yet":"Sin grabaciones aún.","ring.recordings":"Grabaciones","ring.ring":"Anillo","ring.search.what.you.said":"Buscar lo que dijiste","ring.show.all":"Mostrar todo","ring.what.happened":"Qué ocurrió","rooms.new":"Nueva sala","secret.you":"Tú","settings.appearance":"Apariencia","settings.lang":"Idioma","settings.lang.auto":"Automático","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"Tema","settings.theme.dark":"Oscuro","settings.theme.light":"Claro","sheet.rename":"Renombrar hilo","sidebar.add.project":"Añadir proyecto","sidebar.search.projects":"Buscar proyectos","thread.context.base":"Backplane","thread.context.copied":"Se copiaron las instrucciones.","thread.context.copy":"Copiar instrucciones","thread.context.disable":"Desactivar","thread.context.enable":"Activar","thread.context.index":"Índice de habilidades disponibles","thread.context.injected.label":"Instrucciones del proyecto añadidas","thread.context.instructions":"Instrucciones","thread.context.mcp":"MCP del proyecto","thread.context.native.note":"Instrucciones de inicio de Backplane. El proveedor carga los archivos nativos.","thread.context.none.instructions":"No se encontraron instrucciones del proyecto.","thread.context.none.mcp":"No se encontraron configuraciones MCP del proyecto.","thread.context.reading":"Leyendo el contexto del hilo…","thread.context.size":"{bytes} B · ≈{tokens} tokens","thread.context.skills":"Habilidades","thread.context.system":"Instrucciones del sistema","thread.context.title":"Contexto e instrucciones","thread.context.trust":"Confiar y activar","thread.new":"Nuevo hilo","tools.pinned":"Fijado","tools.retry":"Reintentar","tour.title.bots":"Bots","viewer.board":"Placa","viewer.diff":"Diff","viewer.files":"Archivos","viewer.mech":"Mech","viewer.review":"Revisión","viewer.schematic":"Esquemático","viewer.solid":"3D","web.chat.answer.btn":"Responder","web.chat.answer.placeholder":"Escribe una respuesta…","web.chat.answered":"Respondido: {answer}","web.chat.choose":"Elige un hilo de proyecto a la izquierda para empezar.","web.chat.empty":"Aún no hay mensajes. Escribe abajo para iniciar un turno.","web.chat.finished":"Terminado {time}","web.chat.finished.dur":"Terminado {time} · {dur}","web.chat.loading":"Cargando mensajes…","web.chat.review.mode":"Modo de revisión","web.chat.streaming":"Transmitiendo…","web.clone.add.dir":"Añadir {dir}","web.clone.back":"Atrás","web.clone.change.folder":"Cambiar carpeta","web.clone.cloned":"{repo} clonado en {dest}","web.clone.cloning":"Clonando {repo} en {dest}","web.clone.copied":"Copiado","web.clone.first":"Primer mensaje: {text}","web.clone.folder.name":"Nombre de la carpeta","web.clone.go":"Clonar","web.clone.loading":"Cargando…","web.clone.no.folders":"No hay carpetas aquí","web.clone.open.project":"Abrir el proyecto","web.clone.open.thread":"Abrir el hilo","web.clone.private":"privado","web.clone.repo.placeholder":"URL https o ssh, o propietario/repositorio","web.clone.retry":"Reintentar","web.clone.same":"Ya está clonado ahí: se añade tal cual.","web.clone.signin":"Iniciar sesión en GitHub","web.clone.signin.done":"Sesión iniciada en GitHub","web.clone.signin.enter":"Introduce este código en GitHub:","web.clone.signin.wait":"Iniciando sesión en GitHub…","web.clone.start.thread":"Empezar un hilo","web.clone.stopped":"Se detuvo la clonación de {repo}","web.clone.tab":"Clonar desde git","web.clone.up":"Subir","web.clone.use.dir":"Usar {dir}","web.composer.attach":"Adjuntar imagen","web.composer.maximages":"Como máximo {max} imágenes por mensaje.","web.composer.unsupported":"Tipo de imagen no compatible: {type}","web.composer.voice":"Dictado por voz","web.home.error":"No se pudo cargar este proyecto.","web.home.fold":"Ocultar hilos","web.home.lead":"Plazo de entrega: {n} días","web.home.lead.one":"Plazo de entrega: 1 día","web.home.loading":"Cargando el proyecto…","web.home.open":"Abrir la página del proyecto","web.home.unfold":"Mostrar hilos","web.logout.failed":"No se pudo confirmar el cierre de sesión. Inténtalo de nuevo.","web.pair.approve.in":"Aprueba en el escritorio o en un teléfono vinculado · caduca en {time}","web.pair.approved":"Aprobado. Abriendo Backplane…","web.pair.cancelled":"Cancelado.","web.pair.code":"Código de comparación","web.pair.denied":"Se rechazó la solicitud de vinculación.","web.pair.expired":"El código de vinculación caducó. Solicita uno nuevo para intentarlo otra vez.","web.pair.failed":"Falló la solicitud de vinculación ({status})","web.pair.name":"Nombre del navegador","web.pair.nocode":"El hub no devolvió un código de comparación.","web.pair.ratelimited":"Demasiados intentos de vinculación. Espera un momento e inténtalo de nuevo.","web.pair.request":"Solicitar vinculación","web.pair.requesting":"Solicitando código de vinculación…","web.pair.subtitle":"Vincula este navegador con tu hub. Aprueba el código de 6 dígitos en Backplane › Ajustes › Dispositivos.","web.pair.unreachable":"No se pudo conectar con el hub. Comprueba tu conexión de tailnet.","web.plan.awaiting":"{n} esperando aprobación","web.plan.net.one":"1 red","web.plan.nets":"{n} redes","web.ring.app.words":"Las palabras de la aplicación Pebble","web.ring.count":"{n} grabaciones","web.ring.count.one":"1 grabación","web.ring.error":"No se pudieron cargar las grabaciones.","web.ring.found":"{found} de {total} contienen “{q}”.","web.ring.heard.by":"Transcrito por {model}","web.ring.heard.by.sure":"Transcrito por {model}, {conf}% de certeza","web.ring.loading":"Cargando grabaciones…","web.ring.no.words":"(sin palabras)","web.ring.not.heard":"Sin transcribir","web.ring.state.busy":"transcribiéndose ahora","web.ring.state.failed":"no entregada a Pebble","web.ring.state.heard":"en espera de entrega a Pebble","web.ring.state.new":"en espera de transcripción","web.ring.state.sent":"entregada a Pebble","web.ring.unavailable":"Este hub aún no muestra las notas del anillo en un navegador. Actualízalo o abre Configuración › Anillo en la aplicación de escritorio.","web.settings.providers":"Proveedores de IA","web.settings.providers.browser":"Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas."},ja:{"agy.signout":"サインアウト","android.hub.machines.approve":"承認","android.load.earlier":"以前のメッセージを読み込む","approval.dismiss":"閉じる","approval.implement":"実装","ask.plan":"提案されたプラン","bots.new":"新しいボット","bots.rooms":"ルーム","bots.tab.browser":"ブラウザ","chats.move":"プロジェクトに移動…","chats.move.none":"移動先のプロジェクトがありません。先にプロジェクトを追加してください。","chats.new.noproject":"新しいチャット(プロジェクトなし)","chats.title":"チャット","common.cancel":"キャンセル","common.close":"閉じる","common.copy":"コピー","common.delete":"削除","common.refresh":"更新","common.remove":"削除","common.save":"保存","common.search":"検索","composer.model.tip":"モデルと推論の強さを選択","composer.placeholder":"何でも質問:@bot、>thread、%project、#room、$skill、/btw","composer.send":"送信","composer.stop":"停止","gpui.acct.connected":"接続済み","gpui.acct.not.connected":"未接続","gpui.acct.sign.in.expired":"サインインの期限切れ","gpui.ask.plan.ready":"確認待ち","gpui.ask.plan.revise":"修正","gpui.ask.plan.reviseph":"計画のどこを変更しますか?","gpui.ask.plan.sendrev":"修正を送る","gpui.assembly":"アセンブリ","gpui.b.in.reply.to":"↩ 返信先:{quote}","gpui.b.replying.to":"↩ 返信中:{line}","gpui.bots.recall.off":"オフ","gpui.bots.recall.on":"オン","gpui.c.solid.big.next":"読み込みには時間と多くのメモリがかかることがあります。","gpui.c.solid.load.big":"それでも読み込む","gpui.c.solid.loading.big":"それでも読み込み中…","gpui.c.term.collapse":"折りたたむ","gpui.c.term.expand":"展開","gpui.commands":"コマンド","gpui.e.open.folder":"フォルダを開く","gpui.filter.projects.and.threads":"プロジェクトとスレッドを絞り込む","gpui.fold.or.unfold.the.sidebar":"サイドバーを折りたたむ/開く","gpui.follow.paused":"追従を一時停止中","gpui.follow.wait":"追従中: エージェントの次の編集を待っています","gpui.gerbers":"ガーバー","gpui.goal.notes":"目標とメモ","gpui.improvements":"改善","gpui.jump.to.a.thread.run":"スレッドへ移動、コマンドを実行、または発言を検索","gpui.mgmt.bom.dnp":"実装しない","gpui.mgmt.bom.nompn":"MPNなし","gpui.mgmt.checks.all":"すべて","gpui.mgmt.checks.fix":"エージェントに直してもらう","gpui.mgmt.checks.run":"実行","gpui.mgmt.close":"パネルを閉じる","gpui.mgmt.fab.apply":"適用","gpui.mgmt.fab.changed":"前回見てから変わったところ","gpui.mgmt.fab.derived":"* 製造元のページから計算した値です(milをmmに、径からランドを)。薄い色の項目はリジッド基板の値です(この基板のページに記載がないもの)。日付を押すと読んだページが開きます。","gpui.mgmt.fab.extra":"追加料金","gpui.mgmt.fab.findings":"指摘","gpui.mgmt.fab.free":"基本料金","gpui.mgmt.fab.judge":"データシート","gpui.mgmt.fab.limit":"項目","gpui.mgmt.fab.readcol":"読んだ日","gpui.mgmt.fab.refresh":"再読み込み","gpui.mgmt.fab.reviewbtn":"レビュー","gpui.mgmt.fab.seen":"確認済み","gpui.mgmt.fab.thefab":"製造元","gpui.mgmt.fab.use":"使う","gpui.mgmt.life.nopart":"この部品の記録はまだありません。","gpui.mgmt.life.reading":"履歴を読んでいます…","gpui.mgmt.plan.addnote":"メモを追加","gpui.mgmt.plan.all":"すべて承認","gpui.mgmt.plan.before":"配線前に計画する","gpui.mgmt.plan.compact":"標準","gpui.mgmt.plan.done":"完了","gpui.mgmt.plan.drawn":"計画の配線経路とプレーンは、このパネルを開いている間だけ基板上に表示されます。閉じると消えます。","gpui.mgmt.plan.edited":"編集済み","gpui.mgmt.plan.elsewhere":"{board}の配線計画が承認を待っています","gpui.mgmt.plan.emptysub":"計画が提案されると、レイヤー・コリドー・ベタ領域がここに表示されます。","gpui.mgmt.plan.expand":"拡大","gpui.mgmt.plan.fit":"全体表示","gpui.mgmt.plan.grid.all":"全レイヤー","gpui.mgmt.plan.grid.pair":"並べて表示","gpui.mgmt.plan.grid.single":"単一","gpui.mgmt.plan.hide":"完了を隠す","gpui.mgmt.plan.hint":"頂点をドラッグして誘導 · 辺の + をクリックで追加 · 頂点を右クリックで削除","gpui.mgmt.plan.keysnote":"このバージョンのKiCadでは、このパネルから承認してください。プランビューでのKiCadのA・R・Wキーはまだ計画のものではありません(Aはフットプリントの追加を開きます)。KiCadを更新してください。","gpui.mgmt.plan.layer":"層を承認","gpui.mgmt.plan.layer.short":"レイヤー","gpui.mgmt.plan.lock":"ロック","gpui.mgmt.plan.locked":"ロック中","gpui.mgmt.plan.noboard":"この基板の配線計画はありません。","gpui.mgmt.plan.noitems":"このレイヤーにコリドーまたはプレーンがありません","gpui.mgmt.plan.note.placeholder":"ルーターへの指示メモ…","gpui.mgmt.plan.nothing":"承認待ちはありません","gpui.mgmt.plan.offwords":"エージェントは指示どおりに配線します。オンにすると、まず配線計画を提案し、ここで承認したものだけを配線します。","gpui.mgmt.plan.onwords":"銅箔層が4層以上、またはネットが60本を超える基板では、配線の前にエージェントがここで配線経路とプレーン領域を提案します。承認したものだけを配線します。","gpui.mgmt.plan.reading":"配線計画を読んでいます…","gpui.mgmt.plan.reference":"基準 {layer}","gpui.mgmt.plan.refused":"KiCad が拒否しました","gpui.mgmt.plan.reject":"却下","gpui.mgmt.plan.rejectlayer":"レイヤーを却下","gpui.mgmt.plan.reqplain":"承認が求められています","gpui.mgmt.plan.requested":"承認が求められています: {what}","gpui.mgmt.plan.saved":"保存された計画","gpui.mgmt.plan.show":"完了を表示","gpui.mgmt.plan.st.approved":"承認済み","gpui.mgmt.plan.st.awaiting":"承認待ち","gpui.mgmt.plan.st.blocked":"ブロック","gpui.mgmt.plan.st.empty":"空","gpui.mgmt.plan.st.partial":"一部完了","gpui.mgmt.plan.st.rejected":"却下","gpui.mgmt.plan.st.routed":"配線済み","gpui.mgmt.plan.st.routing":"配線中","gpui.mgmt.plan.st.verified":"検証済み","gpui.mgmt.plan.stackup.short":"スタックアップ","gpui.mgmt.plan.stop":"配線を止める","gpui.mgmt.plan.sync":"ズーム連動","gpui.mgmt.plan.tab":"計画","gpui.mgmt.plan.unlock":"ロック解除","gpui.mgmt.plan.verify":"検証","gpui.mgmt.plan.view.canvas":"キャンバス","gpui.mgmt.plan.view.list":"リスト","gpui.mgmt.plan.view.split":"分割","gpui.mgmt.plan.width":"幅","gpui.next.thread":"次のスレッド","gpui.no.goal.yet.ask.an":"目標はまだありません。このプロジェクトの目的をエージェントに書いてもらうか、.backplane/intent.md を編集してください。","gpui.no.models":"モデルがありません","gpui.no.threads.yet":"スレッドはまだありません。","gpui.nothing.matches":"一致するものはありません","gpui.picker.favorite.add":"お気に入りに追加","gpui.picker.favorite.remove":"お気に入りから外す","gpui.picker.favorites":"お気に入り","gpui.planmode.bar.always":"計画モード — 編集前に調査して計画を提案します","gpui.planmode.bar.executing":"承認された計画を実行しています","gpui.planmode.bar.once":"計画モード (1回) — 編集前に調査して計画を提案します","gpui.planmode.bar.pending":"提案された計画が下のレビューを待っています","gpui.planmode.bar.planning":"計画中 — 編集前の計画を作成しています","gpui.planmode.chip.building":"実行中","gpui.planmode.chip.once":"計画 · 1回","gpui.planmode.scope.always":"常時","gpui.planmode.scope.once":"1回","gpui.planmode.tip":"実行前に計画を作成 (1回・常時・オフ)","gpui.planmode.top.executing":"計画を実行中","gpui.planmode.top.once":"計画 (1回)","gpui.planmode.top.pending":"計画を確認","gpui.planmode.top.planning":"計画中","gpui.previous.thread":"前のスレッド","gpui.projects.boards":"基板({n})","gpui.projects.mech":"機構部品({n})","gpui.projects.threads":"スレッド({n})","gpui.projects.to.order":"注文するもの({n})","gpui.rail.no.board":"このプロジェクトには基板がありません","gpui.rail.no.mech":"このプロジェクトには機械部品がありません","gpui.rail.no.schematic":"このプロジェクトには回路図がありません","gpui.rail.split.needs.both":"分割表示には基板と回路図が必要です","gpui.search.models":"モデルを検索","gpui.settings.group.agents":"エージェントとツール","gpui.settings.group.general":"一般","home.away":"ホーム({name})はオフラインです","home.away.queued":"ホーム({name})はオフラインです · {n} 件待機中","home.away.since":"ホーム({name})は {time} からオフラインです","home.away.since.queued":"ホーム({name})は {time} からオフラインです · {n} 件待機中","home.machine":"ホームマシン","home.move.failed":"ホームの移動に失敗しました","home.move.failed.note":"ホームの移動に失敗しました: {note}","home.move.here":"このマシンをホームにする","home.moving":"ホームを {to} へ移動中…","home.moving.step":"ホームを {to} へ移動中: {step}","hub.back.crash":"予期せず停止したBackplaneが戻りました","hub.restarting":"Backplaneを再起動しています…","hub.restarting.build":"Backplaneを再起動しています…(新しいビルド {build})","hub.stopped":"Backplaneは停止しました","ios.hub.address.field":"ハブのアドレス","menu.pin":"ピン留め","menu.settle":"完了","menu.unpin":"ピン留めを解除","menu.wake":"再開","model.col.agent":"エージェント","model.col.effort":"推論の強さ","native.pair.connect":"接続","native.thread.model":"モデル","notify.settled":"完了","palette.archive":"スレッドをアーカイブ","palette.command.placeholder":"コマンドまたはスレッドを入力","palette.diff":"差分:このスレッドの変更","palette.newthread":"新しいスレッド","palette.settings":"設定","palette.terminal":"ターミナル","palette.unarchive":"スレッドのアーカイブを解除","phone.unsettle":"未完了に戻す","provider.notice.button":"設定 → アカウントを開く","provider.notice.head":"AI プロバイダーが接続されていません","provider.notice.senderr":"AI プロバイダーがまだ接続されていません。設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.senderr.remote":"{machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.none":"チャットを始めるには、Claude、Codex、Antigravity などのプロバイダーを接続してください。","provider.notice.text.signedout":"チャットを始めるには、設定 → アカウントで Claude、Codex などのプロバイダーにサインインしてください。","reply.action":"返信","reply.cancel":"返信をやめる","reply.to":"返信先:","ring.hear.again.local":"もう一度聞き取る (ローカル)","ring.hear.again.openai":"もう一度聞き取る (OpenAI)","ring.no.recordings.yet":"録音はまだありません。","ring.recordings":"録音","ring.ring":"リング","ring.search.what.you.said":"話した内容を検索","ring.show.all":"すべて表示","ring.what.happened":"どうなったか","rooms.new":"新しいルーム","secret.you":"あなた","settings.appearance":"外観","settings.lang":"言語","settings.lang.auto":"自動","settings.lang.en":"English","settings.lang.es":"Español","settings.lang.ja":"日本語","settings.theme":"テーマ","settings.theme.dark":"ダーク","settings.theme.light":"ライト","sheet.rename":"スレッド名を変更","sidebar.add.project":"プロジェクトを追加","sidebar.search.projects":"プロジェクトを検索","thread.context.base":"Backplane","thread.context.copied":"プロンプトをコピーしました。","thread.context.copy":"プロンプトをコピー","thread.context.disable":"無効にする","thread.context.enable":"有効にする","thread.context.index":"利用可能なスキルの一覧","thread.context.injected.label":"追加されたプロジェクトの指示","thread.context.instructions":"指示","thread.context.mcp":"プロジェクトの MCP","thread.context.native.note":"Backplane が起動時に渡すプロンプトです。ネイティブファイルはプロバイダーが読み込みます。","thread.context.none.instructions":"プロジェクトの指示が見つかりません。","thread.context.none.mcp":"プロジェクトの MCP 設定が見つかりません。","thread.context.reading":"スレッドのコンテキストを読み込み中…","thread.context.size":"{bytes} B・約{tokens}トークン","thread.context.skills":"スキル","thread.context.system":"システムプロンプト","thread.context.title":"コンテキストとプロンプト","thread.context.trust":"承認して有効にする","thread.new":"新しいスレッド","tools.pinned":"固定中","tools.retry":"再試行","tour.title.bots":"ボット","viewer.board":"基板","viewer.diff":"差分","viewer.files":"ファイル","viewer.mech":"Mech","viewer.review":"レビュー","viewer.schematic":"回路図","viewer.solid":"3D","web.chat.answer.btn":"回答","web.chat.answer.placeholder":"回答を入力…","web.chat.answered":"回答済み: {answer}","web.chat.choose":"左側からプロジェクトのスレッドを選んで開始してください。","web.chat.empty":"まだメッセージはありません。下に入力して開始してください。","web.chat.finished":"完了 {time}","web.chat.finished.dur":"完了 {time} · {dur}","web.chat.loading":"メッセージを読み込んでいます…","web.chat.review.mode":"レビューモード","web.chat.streaming":"受信中…","web.clone.add.dir":"{dir} を追加","web.clone.back":"戻る","web.clone.change.folder":"フォルダを変更","web.clone.cloned":"{repo} を {dest} にクローンしました","web.clone.cloning":"{repo} を {dest} にクローン中","web.clone.copied":"コピーしました","web.clone.first":"最初のメッセージ: {text}","web.clone.folder.name":"フォルダ名","web.clone.go":"クローン","web.clone.loading":"読み込み中…","web.clone.no.folders":"フォルダがありません","web.clone.open.project":"プロジェクトを開く","web.clone.open.thread":"スレッドを開く","web.clone.private":"非公開","web.clone.repo.placeholder":"https / ssh の URL、または owner/repo","web.clone.retry":"もう一度","web.clone.same":"すでにそこにクローンされています: そのまま追加します。","web.clone.signin":"GitHub にサインイン","web.clone.signin.done":"GitHub にサインインしました","web.clone.signin.enter":"このコードを GitHub に入力してください:","web.clone.signin.wait":"GitHub のサインインを開始しています…","web.clone.start.thread":"スレッドを開始","web.clone.stopped":"{repo} のクローンを中止しました","web.clone.tab":"git からクローン","web.clone.up":"上へ","web.clone.use.dir":"{dir} を使う","web.composer.attach":"画像を添付","web.composer.maximages":"1 件のメッセージに添付できる画像は最大 {max} 枚です。","web.composer.unsupported":"未対応の画像形式です: {type}","web.composer.voice":"音声入力","web.home.error":"このプロジェクトを読み込めませんでした。","web.home.fold":"スレッドを隠す","web.home.lead":"リードタイム: {n} 日","web.home.lead.one":"リードタイム: 1 日","web.home.loading":"プロジェクトを読み込み中…","web.home.open":"プロジェクトホームを開く","web.home.unfold":"スレッドを表示","web.logout.failed":"サインアウトを確認できませんでした。もう一度お試しください。","web.pair.approve.in":"デスクトップまたはペアリング済みの端末で承認してください · 有効期限 {time}","web.pair.approved":"承認されました。Backplane を開いています…","web.pair.cancelled":"キャンセルしました。","web.pair.code":"確認コード","web.pair.denied":"ペアリングのリクエストが拒否されました。","web.pair.expired":"ペアリングコードの有効期限が切れました。新しいコードをリクエストしてください。","web.pair.failed":"ペアリングのリクエストに失敗しました ({status})","web.pair.name":"ブラウザー名","web.pair.nocode":"ハブから確認コードが返されませんでした。","web.pair.ratelimited":"ペアリングの試行回数が多すぎます。しばらく待ってからやり直してください。","web.pair.request":"ペアリングをリクエスト","web.pair.requesting":"ペアリングコードをリクエストしています…","web.pair.subtitle":"このブラウザーをハブとペアリングします。Backplane › 設定 › デバイス で 6 桁のコードを承認してください。","web.pair.unreachable":"ハブに接続できませんでした。tailnet の接続を確認してください。","web.plan.awaiting":"{n} 件が承認待ち","web.plan.net.one":"1 ネット","web.plan.nets":"{n} ネット","web.ring.app.words":"Pebble アプリの文字起こし","web.ring.count":"録音 {n} 件","web.ring.count.one":"録音 1 件","web.ring.error":"録音を読み込めませんでした。","web.ring.found":"{total} 件中 {found} 件に「{q}」があります。","web.ring.heard.by":"{model} が認識","web.ring.heard.by.sure":"{model} が認識、確度 {conf}%","web.ring.loading":"録音を読み込み中…","web.ring.no.words":"(言葉なし)","web.ring.not.heard":"未認識","web.ring.state.busy":"認識中","web.ring.state.failed":"Pebble に渡せませんでした","web.ring.state.heard":"Pebble への受け渡し待ち","web.ring.state.new":"認識待ち","web.ring.state.sent":"Pebble に渡しました","web.ring.unavailable":"このハブはまだブラウザーにリングのメモを表示しません。ハブを更新するか、デスクトップアプリの設定 › リングを開いてください。","web.settings.providers":"AI プロバイダー","web.settings.providers.browser":"Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。"}};function Q(a,t){if(!t)return a;return a.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(s,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):s)}var H=te(),W=new Set,V=new Map;for(let[a,t]of Object.entries(U.en||{}))if(typeof t==="string"&&!V.has(t))V.set(t,a);function te(){let a=typeof navigator<"u"&&navigator.language?navigator.language.toLowerCase():"en";if(a.startsWith("ja"))return"ja";if(a.startsWith("es"))return"es";return"en"}function Y(){if(typeof document<"u"&&document.documentElement)document.documentElement.lang=H}Y();function ge(a){return W.add(a),()=>{W.delete(a)}}function me(a){if(!a)return!1;let t=a.toLowerCase(),s=t.startsWith("ja")?"ja":t.startsWith("es")?"es":t.startsWith("en")?"en":"";if(!s)return!1;let r=s!==H;if(H=s,Y(),r)for(let d of W)d(H);return r}function ue(){return H}function c(a,t,s){let d=(U[H]||U.en||{})[a]??U.en?.[a]??t??a;return Q(d,s)}function be(a){if(!a)return"";let t=V.get(a);if(!t)return a;return c(t,a)}var ae=[[1,26,7,1,[]],[2,44,10,1,[6,18]],[3,70,15,1,[6,22]],[4,100,20,1,[6,26]],[5,134,26,1,[6,30]],[6,172,18,2,[6,34]]],G=new Uint8Array(512),_=new Uint8Array(256);{let a=1;for(let t=0;t<255;t++)if(G[t]=a,_[a]=t,a<<=1,a&256)a^=285;for(let t=255;t<512;t++)G[t]=G[t-255]}function J(a,t){return a===0||t===0?0:G[_[a]+_[t]]}function ne(a){let t=new Uint8Array([1]);for(let s=0;s{let g=e-o*n;return Math.ceil((12+t.length*8)/8)<=g});if(!s)return null;let[r,d,m,f,S]=s,w=d-m*f,u=[],E=(e,o)=>{for(let n=o-1;n>=0;n--)u.push(e>>>n&1)};E(4,4),E(t.length,8);for(let e of t)E(e,8);for(let e=0;e<4&&u.length{if(e<0||o<0||e>=p||o>=p)return;z[e*p+o]=n?1:0,A[e*p+o]=1},N=(e,o)=>{for(let n=-1;n<=7;n++)for(let g=-1;g<=7;g++){let k=e+n,l=o+g,i=n>=0&&n<=6&&g>=0&&g<=6&&(n===0||n===6||g===0||g===6||n>=2&&n<=4&&g>=2&&g<=4);b(k,l,i)}};N(0,0),N(0,p-7),N(p-7,0);for(let e=8;e=1;e-=2){if(e===6)e=5;let o=(e+1&2)===0;for(let n=0;n>>3]>>>7-(j&7)&1,j++;let i=(g+l&1)===0?h^1:h;z[g*p+l]=i}}}let P=30660;for(let e=0;e<=5;e++)b(8,e,(P>>>14-e&1)===1);b(8,7,(P>>>8&1)===1),b(8,8,(P>>>7&1)===1),b(7,8,(P>>>6&1)===1);for(let e=0;e<=5;e++)b(5-e,8,(P>>>5-e&1)===1);for(let e=0;e<8;e++)b(8,p-1-e,(P>>>e&1)===1);for(let e=0;e<7;e++)b(p-7+e,8,(P>>>14-e&1)===1);return{size:p,modules:z}}function X(a){let t=ie(a);if(!t)return null;let s=2,r=t.size+s*2,d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("viewBox",`0 0 ${r} ${r}`),d.setAttribute("role","img"),d.setAttribute("aria-label",`QR code for ${a}`),d.setAttribute("shape-rendering","crispEdges"),d.classList.add("bp-qr-svg");let m=document.createElementNS("http://www.w3.org/2000/svg","rect");m.setAttribute("width",String(r)),m.setAttribute("height",String(r)),m.setAttribute("fill","#ffffff"),d.appendChild(m);let f="";for(let w=0;w{let h=l.trim();if(!h)return;let i=h.startsWith("https://")?h:`https://${h}`;if(!i.startsWith("https://")||i.length<=8)return;let x=document.createElement("div");x.className="bp-pair-addr-meta";let v=document.createElement("div");v.className="bp-pair-code-label",v.textContent=c("ios.hub.address.field","Hub address");let y=document.createElement("code");y.className="bp-pair-addr-url",y.textContent=i,y.setAttribute("data-testid","pair-address");let R=document.createElement("button");R.type="button",R.className="bp-pair-copy";let O=c("common.copy","Copy");R.textContent=O,R.addEventListener("click",()=>{navigator.clipboard?.writeText(i).then(()=>{R.textContent=c("web.clone.copied","Copied"),window.setTimeout(()=>{R.textContent=O},1200)}).catch(()=>{})}),x.append(v,y,R);let D=document.createDocumentFragment();D.appendChild(x);let K=X(i);if(K){let F=document.createElement("div");F.className="bp-pair-qr",F.setAttribute("data-testid","pair-qr"),F.appendChild(K),D.appendChild(F)}p.replaceChildren(D),p.classList.remove("bp-hidden")};fetch("/auth/web/info",{credentials:"same-origin"}).then(async(l)=>{if(!l.ok)return;let h=await l.json();if(typeof h.address==="string")z(h.address)}).catch(()=>{}),t.append(s,m,f,E,C,p),a.appendChild(t);let A=null,b=null,N=null,j=0,I=0,P=150,e=1000;function o(){if(j++,N)N.abort(),N=null;if(A!==null)window.clearTimeout(A),A=null;if(b!==null)window.clearInterval(b),b=null}function n(l="",h=!1){o(),f.classList.remove("bp-hidden"),E.classList.add("bp-hidden"),u.disabled=!1,C.textContent=l,C.className=h?"bp-pair-status bp-bad":"bp-pair-status"}function g(){let l=I-Date.now();if(l<=0){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}B.textContent=c("web.pair.approve.in","Approve on desktop or paired phone · expires in {time}",{time:pe(l)})}async function k(l){if(l!==j)return;if(I>0&&Date.now()>=I){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}let h=new AbortController;N=h;try{let i=await fetch("/auth/web/poll",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}",signal:h.signal});if(l!==j)return;if(e=1000,i.status===202){A=window.setTimeout(()=>{k(l)},150);return}if(i.status===200||i.status===204){let v={};if(i.status===200)try{v=await i.json()}catch{}if(l!==j)return;let y=(v.state||v.status||"").toLowerCase();if(i.status===204||v.approved===!0||y==="approved"||y==="ok"){o(),C.textContent=c("web.pair.approved","Approved. Opening Backplane…"),C.className="bp-pair-status bp-ok",window.location.replace("/");return}if(y==="denied"||y==="rejected"){n(c("web.pair.denied","Pairing request was denied."),!0);return}if(y==="expired"){n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}A=window.setTimeout(()=>{k(l)},150);return}if(i.status===429){let v=Number(i.headers.get("Retry-After")||"5"),y=Math.max(2000,(Number.isFinite(v)?v:5)*1000);A=window.setTimeout(()=>{k(l)},y);return}if(i.status===401||i.status===403||i.status===404||i.status===410){let v="";try{let y=await i.json();v=(y.state||y.status||y.error||"").toLowerCase()}catch{}if(l!==j)return;if(v==="denied"||v==="rejected"||i.status===403)n(c("web.pair.denied","Pairing request was denied."),!0);else n(c("web.pair.expired","Pairing code expired. Request a new code to try again."),!0);return}let x=e;e=Math.min(1e4,Math.round(e*1.8)),A=window.setTimeout(()=>{k(l)},x)}catch{if(l!==j)return;let i=e;e=Math.min(1e4,Math.round(e*1.8)),A=window.setTimeout(()=>{k(l)},i)}finally{if(N===h)N=null}}L.addEventListener("click",()=>{n(c("web.pair.cancelled","Cancelled."))}),f.addEventListener("submit",async(l)=>{l.preventDefault();let h=w.value.trim()||Z();u.disabled=!0,C.textContent=c("web.pair.requesting","Requesting pairing code…"),C.className="bp-pair-status";try{let i=await fetch("/auth/web/request",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h})});if(!i.ok){let O=c("web.pair.failed","Pairing request failed ({status})",{status:i.status});try{let D=await i.json();if(D.error)O=D.error}catch{}if(i.status===429)O=c("web.pair.ratelimited","Too many pairing attempts. Wait a moment and try again.");n(O,!0);return}let x=await i.json(),v=x.code||x.checkCode||"";if(!v){n(c("web.pair.nocode","Hub did not return a comparison code."),!0);return}let y=Date.now();I=x.expiresAt?x.expiresAt<10000000000?x.expiresAt*1000:x.expiresAt:y+(x.expiresIn?x.expiresIn*1000:120000),o();let R=j;e=1000,P=x.pollMs&&x.pollMs>=100?x.pollMs:150,M.textContent=re(v),f.classList.add("bp-hidden"),E.classList.remove("bp-hidden"),C.textContent="",g(),b=window.setInterval(g,1000),A=window.setTimeout(()=>{k(R)},P)}catch{n(c("web.pair.unreachable","Could not reach the hub. Check your tailnet connection."),!0)}})}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",ee);else ee(); diff --git a/web/dist/assets/style.css b/web/dist/assets/style.css index a4aa47c4df..fe35f865d5 100644 --- a/web/dist/assets/style.css +++ b/web/dist/assets/style.css @@ -3162,6 +3162,14 @@ button.bp-home-row:focus-visible { outline: 1px solid var(--accent); outline-off .bp-ring-search { flex-wrap: wrap; } } +/* Quick chats: New chat beside the search, and Move to project's list */ +.bp-side-new-chat { display: inline-flex; align-items: center; padding: 4px 6px; } +.bp-move-note { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.bp-move-row { text-align: left; padding: 7px 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; } +.bp-move-row:hover { border-color: var(--faint); } +.bp-move-err { color: var(--bad); font-size: 12px; } +.bp-modal-body:has(.bp-move-row) { gap: 6px; } + /* Web viewer pane + 1440 / 820 / 390 px responsive styles. Auto-concatenated into web/dist/assets/style.css by web/build.ts. diff --git a/web/dist/manifest.json b/web/dist/manifest.json index 14141f4222..4eac383fc7 100644 --- a/web/dist/manifest.json +++ b/web/dist/manifest.json @@ -1,6 +1,6 @@ { "version": 1, - "totalAssetGzipBytes": 235837, + "totalAssetGzipBytes": 237355, "styleTokensSha256": "a4fed1b1c7bc676acc328907343eb5dcf87e426383d05617c632e48c0c3f2b80", "i18nKeys": [ "agy.signout", @@ -12,6 +12,10 @@ "bots.new", "bots.rooms", "bots.tab.browser", + "chats.move", + "chats.move.none", + "chats.new.noproject", + "chats.title", "common.cancel", "common.close", "common.copy", @@ -340,10 +344,10 @@ "web.settings.providers", "web.settings.providers.browser" ], - "i18nSubsetSha256": "6e36764b44f9e02d79f1962767de5a6ee5d04d2e6f01d8bbf6454d049483e23d", + "i18nSubsetSha256": "ad3083cc73511c7876092934bbfa1a26823b509f16985a9cf924cf2136eff864", "inputs": { "web/src/addproject.ts": "06a7ff3e13cd78d993ebca7f638d5d623da06c0099186ad534bae8f184dbe44f", - "web/src/app.ts": "8dd026527a0661b6034c6776a4d4dcf18a468d2a913e07cbc93a282c6ca858b7", + "web/src/app.ts": "266280ec582ff9db7a0800134c813cf5a62f7f6962a0d4083b1e636a639d4cad", "web/src/chat.ts": "639e3af0791aedcde788c1a76aee6ea07cf96f5749d6a3564898c2beb8bd7337", "web/src/clone-model.ts": "d265df49436e14f415bbeb2a271ffa3552f9163be62bdc0158cecc10c3cdae45", "web/src/composer.ts": "63a5e9d7acfd321007c0a18880ee0ba055506335fcf4808154febc2b380f91a8", @@ -358,7 +362,7 @@ "web/src/model-picker-model.ts": "8bebc12191d731c58f6805c5d273b8c018aa0dd64f36d4fc72adc8b39d58ec73", "web/src/pair.html": "cf7b94703316f910718356e9ff8e99e088b68211db39b5200213b623c9275f6e", "web/src/pair.ts": "af07d19224043f8176f8cd2298d00b6806248eee453fd2f287c183e71a08179b", - "web/src/palette-model.ts": "ae359cc71e98e84774428355a5048fd9ba0e1da2d45fa18290b4313c50c50ee4", + "web/src/palette-model.ts": "4854dad6a1e7044685689f146438c53670b99c50741cfb5af62355198dbf827c", "web/src/palette.ts": "bcd5c4585f57cc80a9cf29bf1b9da6ebbd33a3ab68f8f2a918c37c58060c8e48", "web/src/plan-canvas.ts": "49a0af6ef960301d4ea75f2fcd48628e01d983431d96329f37e6a3704bafd498", "web/src/project-home-model.ts": "866d403419cf28df64a914cf20aaceb177203666114d591e14feaa522494f048", @@ -369,8 +373,8 @@ "web/src/ring-model.ts": "66368ffe8996138d4e73f041e50ac4fa573cf20ee59571af5fd1f320e29a895d", "web/src/settings-model.ts": "2f8f64cc93ee54c1bf45d918d8568eec2457970db7b3c43e926b2b4c45dcd5f6", "web/src/settings.ts": "8d4c24f554ba9c7ba4c4a96098fe25eea68b91f41489aee4d2b01b616f41f507", - "web/src/shell.css": "8859e0833ec034ca137745c6863305a9e897c5f72a9c1b2dbec4434dffe11bce", - "web/src/sidebar.ts": "121045bb07d60d7b06393b4c67862d0088991b0737ff52b94add9dd5510ad2b1", + "web/src/shell.css": "0fc26ae8ba27a25dff78a10523e89880db122cd9b1ccbcd972b6457df1eafcd8", + "web/src/sidebar.ts": "ee2e10c0fdde6e1f2807e72199bce3a85379244fc550acedd4f35b76c1369fc4", "web/src/swarm-need.ts": "503bbf5ffe0389f068847571c792321b0ad5c8d26a18c73b8e41c0a8989e227f", "web/src/thread-context.ts": "b9fbd5b3ef0b1357b5a4444a1e9a0ac0606afe1c8a5377c4777752e918af0ac2", "web/src/user-refs.ts": "56bcf0dc116d5f14260606f07cf9af9becbbd7cbb102dc9e0687a4ea5f894011", @@ -407,9 +411,9 @@ }, "outputs": { "assets/app.js": { - "bytes": 434864, - "gzipBytes": 122455, - "sha256": "7650fc2de412daac4bc5d60cb382555c4d8f8470df5841f437915e7da1ec2621" + "bytes": 439731, + "gzipBytes": 123684, + "sha256": "7d68d5f26a82d1143218aa7c226e3ab5db7ba0221a0a134af296ee467509d547" }, "assets/favicon-light.svg": { "bytes": 1207, @@ -427,14 +431,14 @@ "sha256": "123b6a27f255d339b505c8fd83609674f0bddf9b46c0e907fce23befa96b1eec" }, "assets/pair.js": { - "bytes": 62486, - "gzipBytes": 18662, - "sha256": "2aca9be2863742059403024eca7b5cc265665b2cc99e54ce95cd6c3d6e681c21" + "bytes": 63122, + "gzipBytes": 18825, + "sha256": "1667d584f1306cc34069c62ca91e4aa78a1286d0875d1f12657817aa1a70a475" }, "assets/style.css": { - "bytes": 99938, - "gzipBytes": 16421, - "sha256": "65dfec07c0af6a83cf5da4c3c511cd08d842b07eec2dc677af2f26e21eb3ef8a" + "bytes": 100512, + "gzipBytes": 16547, + "sha256": "7d61c5023e532d5b8ac18015e107b26b6d2bcaa455a8e5f669c0c7fede529b80" }, "assets/terminal.js": { "bytes": 296616, diff --git a/web/src/app.ts b/web/src/app.ts index e02dca8b1b..a7d5425741 100644 --- a/web/src/app.ts +++ b/web/src/app.ts @@ -26,7 +26,9 @@ import { } from "./settings-model"; import { ThreadContextDialog } from "./thread-context"; import { + CHATS, SidebarView, + moveTargets, type BotItem, type PlanModeInfo, type ProjectItem, @@ -496,6 +498,8 @@ function mountApp(): void { .then(() => refreshSections()) .catch(() => {}); }, + onNewChat: () => { void createThread(CHATS); }, + onMoveToProject: (id) => openMoveToProject(id), }); const chat = new ChatView(centerEl, { @@ -729,6 +733,12 @@ function mountApp(): void { case "new-thread": void createThread(act.projectId); break; + case "new-chat": + void createThread(CHATS); + break; + case "move-project": + if (selectedThreadId) openMoveToProject(selectedThreadId); + break; case "rename": { const th = threads.find((x) => x.id === selectedThreadId); if (th) renameThread(th); @@ -983,6 +993,65 @@ function mountApp(): void { } } + /** Move to project…: a chat that belongs to no project goes to the project picked, with all it says (`thread.move_project`). */ + function openMoveToProject(threadId: string): void { + const th = threads.find((x) => x.id === threadId); + const backdrop = document.createElement("div"); + backdrop.className = "bp-modal-backdrop"; + backdrop.setAttribute("data-testid", "move-project-modal"); + const modal = document.createElement("div"); + modal.className = "bp-modal"; + const head = document.createElement("div"); + head.className = "bp-modal-head"; + const h2 = document.createElement("h2"); + h2.textContent = t("chats.move", "Move to project…"); + const closeBtn = document.createElement("button"); + closeBtn.type = "button"; + closeBtn.className = "icon"; + closeBtn.textContent = "×"; + closeBtn.addEventListener("click", () => backdrop.remove()); + head.append(h2, closeBtn); + const bodyEl = document.createElement("div"); + bodyEl.className = "bp-modal-body"; + const note = document.createElement("div"); + note.className = "bp-move-note"; + note.textContent = th?.title || ""; + const err = document.createElement("div"); + err.className = "bp-move-err"; + bodyEl.append(note); + const list = moveTargets(projects); + if (list.length === 0) { + const none = document.createElement("div"); + none.textContent = t("chats.move.none", "No project to move it to. Add a project first."); + bodyEl.appendChild(none); + } + for (const p of list) { + const row = document.createElement("button"); + row.type = "button"; + row.className = "bp-move-row"; + row.textContent = p.title || p.id; + row.setAttribute("data-testid", `move-project-${p.id}`); + row.addEventListener("click", () => { + void hub.rpc<{ thread?: ThreadItem }>("thread.move_project", { thread: threadId, project: p.id }) + .then((res) => { + if (res.thread) threads = threads.map((x) => (x.id === res.thread!.id ? res.thread! : x)); + else threads = threads.map((x) => (x.id === threadId ? { ...x, project: p.id } : x)); + sidebar.setData(projects, threads, bots, rooms); + updateHeader(); + void refreshSections(); + backdrop.remove(); + }) + .catch((e) => { err.textContent = e instanceof Error ? e.message : "Could not move the chat"; }); + }); + bodyEl.appendChild(row); + } + bodyEl.appendChild(err); + modal.append(head, bodyEl); + backdrop.appendChild(modal); + backdrop.addEventListener("click", (e) => { if (e.target === backdrop) backdrop.remove(); }); + root.appendChild(backdrop); + } + impBtn.addEventListener("click", () => { void openImprovementsModal(); }); cmdBox.addEventListener("click", () => palette.open()); searchBtn.addEventListener("click", () => palette.open()); @@ -999,8 +1068,10 @@ function mountApp(): void { ? projectOf(homeProjectId) ?? { id: homeProjectId, title: homeProjectId } : th ? projectOf(th.project) : undefined; if (homeProjectId && proj) projectHome.setTitle(proj.title); - projCrumb.textContent = proj?.title ?? ""; - sep1.classList.toggle("bp-hidden", !proj); + // a chat that belongs to no project says so where a project's name would be + const chat = !homeProjectId && th?.project === CHATS; + projCrumb.textContent = chat ? t("chats.title", "Chats") : (proj?.title ?? ""); + sep1.classList.toggle("bp-hidden", !proj && !chat); sep2.classList.toggle("bp-hidden", !th); threadCrumb.textContent = th ? (th.title || "Untitled thread") : ""; @@ -1892,7 +1963,13 @@ function mountApp(): void { e.preventDefault(); if (palette.isOpen()) palette.close(); else palette.open(); + } else if (e.shiftKey && e.code === "KeyN" && (e.altKey || e.ctrlKey || e.metaKey)) { + // New chat. A browser keeps Ctrl/Cmd+Shift+N for itself (it never arrives here); Alt+Shift+N always does + e.preventDefault(); + void createThread(CHATS); } else if (e.key === "Escape") { + const moving = document.querySelector('[data-testid="move-project-modal"]'); + if (moving) { moving.remove(); return; } if (palette.isOpen()) palette.close(); else if (composer.isModelPickerOpen()) composer.closeModelPicker(); else if (addProject.isOpen()) addProject.escape(); diff --git a/web/src/palette-model.ts b/web/src/palette-model.ts index ac44cf508f..61600e365a 100644 --- a/web/src/palette-model.ts +++ b/web/src/palette-model.ts @@ -13,6 +13,8 @@ export type PaletteAction = | { type: "next-thread" } | { type: "command"; word: string; runDirectly: boolean } | { type: "new-thread"; projectId: string } + | { type: "new-chat" } + | { type: "move-project" } | { type: "improvements" } | { type: "settings" } | { type: "sidebar" }; @@ -163,6 +165,15 @@ export function buildPaletteItems(state: PaletteState, labels: PaletteLabels = D kind: "action", action: { type: "thread-act", action: cur.archived ? "unarchive" : "archive" }, }); + // a chat that belongs to no project: it can go to one, with all it says + if (cur.project === "chats") { + out.push({ + label: t("chats.move", "Move to project…"), + place: "", + kind: "action", + action: { type: "move-project" }, + }); + } out.push({ label: t("sheet.rename", "Rename thread"), place: "", @@ -217,6 +228,14 @@ export function buildPaletteItems(state: PaletteState, labels: PaletteLabels = D action: { type: "sidebar" }, }); + // a chat in no project: always offered, whatever is open + out.push({ + label: t("chats.new.noproject", "New chat (no project)"), + place: "", + kind: "action", + action: { type: "new-chat" }, + }); + // 5. New thread in each project for (const p of state.projects) { out.push({ @@ -232,7 +251,7 @@ export function buildPaletteItems(state: PaletteState, labels: PaletteLabels = D const { urgency, want } = urgencyOf(th); out.push({ label: th.title || "Untitled thread", - place: th.project ? (projById.get(th.project) ?? "") : "", + place: th.project === "chats" ? t("chats.title", "Chats") : th.project ? (projById.get(th.project) ?? "") : "", kind: "thread", urgency, want, diff --git a/web/src/shell.css b/web/src/shell.css index bef4ed0105..eb41b1943f 100644 --- a/web/src/shell.css +++ b/web/src/shell.css @@ -3068,3 +3068,11 @@ button.bp-home-row:focus-visible { outline: 1px solid var(--accent); outline-off .bp-home-thread .bp-home-row-faint { display: inline; } .bp-ring-search { flex-wrap: wrap; } } + +/* Quick chats: New chat beside the search, and Move to project's list */ +.bp-side-new-chat { display: inline-flex; align-items: center; padding: 4px 6px; } +.bp-move-note { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.bp-move-row { text-align: left; padding: 7px 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; } +.bp-move-row:hover { border-color: var(--faint); } +.bp-move-err { color: var(--bad); font-size: 12px; } +.bp-modal-body:has(.bp-move-row) { gap: 6px; } diff --git a/web/src/sidebar.ts b/web/src/sidebar.ts index 08fc19688c..8cbe934f19 100644 --- a/web/src/sidebar.ts +++ b/web/src/sidebar.ts @@ -10,6 +10,17 @@ import { t } from "./i18n"; import { needPress, parseNeed, type NeedAction } from "./swarm-need"; import type { HomeInfo } from "./ws"; +/** The place of the chats that belong to no project (the hub's `sidebar::CHATS`): `thread.create {project: CHATS}` starts one. */ +export const CHATS = "chats"; + +/** The projects a chat may move to: this hub's own, by name (a linked machine's copy, `~`, is not offered). */ +export function moveTargets(projects: ProjectItem[]): ProjectItem[] { + return projects + .filter((p) => p.id && p.id !== CHATS && p.id !== "scratch" && !p.id.includes("~")) + .slice() + .sort((a, b) => (a.title || a.id).toLowerCase().localeCompare((b.title || b.id).toLowerCase())); +} + export interface ProjectItem { id: string; title: string; @@ -93,6 +104,8 @@ export interface SectionThreadRow { off?: boolean; nav?: string; kind?: string; + /** A chat that belongs to no project (hub `chat` field): it can move to a project. */ + chat?: boolean; /** Thread id for 1-click settle when eligible (hub `settle` field). */ settle?: string; /** Snooze duration choices when eligible (hub `snooze` field; send `row-snooze` with `value`). */ @@ -166,6 +179,10 @@ export interface SidebarCallbacks { onAddProject?: () => void; /** Settle/dismiss a swarm row (`sidebar.act` `swarm-settle`). */ onSettleSwarm?: (roomId: string) => void; + /** New chat: a thread in no project, started at once. */ + onNewChat?: () => void; + /** A chat row's Move to project…: the app asks which project. */ + onMoveToProject?: (threadId: string) => void; } /** Whether a swarm row under a project should be shown in the sidebar. */ @@ -296,6 +313,22 @@ function makeCheckIcon(size = 11): SVGSVGElement { return makeSvgIcon(["M4 12l5 5 11-11"], size); } +/** Lucide square-pen: the New chat glyph (as GPUI's). */ +function makeChatIcon(size = 13): SVGSVGElement { + return makeSvgIcon(["M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4z"], size); +} + +/** Lucide folder-input: Move to project. */ +function makeMoveIcon(size = 11): SVGSVGElement { + return makeSvgIcon(["M2 9V5a2 2 0 0 1 2-2h4l2 3h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2", "M2 13h10", "M9 16l3-3-3-3"], size); +} + +/** New chat's key as the person reads it. A browser keeps Ctrl+Shift+N for itself, so the web's is Alt+Shift+N. */ +export function newChatKeyHint(): string { + const mac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || ""); + return mac ? "⌥⇧N" : "Alt+Shift+N"; +} + function makeClockIcon(size = 11): SVGSVGElement { return makeSvgIcon(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z", "M12 6v6l4 2"], size); } @@ -412,7 +445,18 @@ export class SidebarView { if (firstProj) this.cb.onNewThread(firstProj); }); - head.append(this.filterInput, quickAdd); + // New chat: a thread in no project, in one press + const newChat = document.createElement("button"); + newChat.type = "button"; + newChat.className = "icon bp-side-add bp-side-new-chat"; + newChat.appendChild(makeChatIcon(13)); + const chatTip = `${t("chats.new.noproject", "New chat (no project)")} (${newChatKeyHint()})`; + newChat.title = chatTip; + newChat.setAttribute("aria-label", t("chats.new.noproject", "New chat (no project)")); + newChat.setAttribute("data-testid", "sidebar-new-chat"); + newChat.addEventListener("click", () => this.cb.onNewChat?.()); + + head.append(this.filterInput, newChat, quickAdd); this.homeBanner = document.createElement("div"); this.homeBanner.className = "bp-side-home bp-hidden"; @@ -745,7 +789,8 @@ export class SidebarView { const hasWake = Boolean(row.wake) && Boolean(this.cb.onSnoozeRow); const isSwarm = row.kind === "swarm"; const hasSettle = Boolean(row.settle) && (!isSwarm || Boolean(this.cb.onSettleSwarm)); - if (!hasSnooze && !hasWake && !hasSettle) return null; + const hasMove = Boolean(row.chat) && Boolean(this.cb.onMoveToProject); + if (!hasSnooze && !hasWake && !hasSettle && !hasMove) return null; const acts = document.createElement("span"); acts.className = "bp-row-acts"; @@ -780,6 +825,21 @@ export class SidebarView { acts.appendChild(snBtn); } + if (hasMove) { + const moveBtn = document.createElement("button"); + moveBtn.type = "button"; + moveBtn.className = "bp-row-act-btn bp-move-btn"; + moveBtn.title = t("chats.move", "Move to project…"); + moveBtn.setAttribute("aria-label", t("chats.move", "Move to project…")); + moveBtn.setAttribute("data-testid", `move-row-${row.id}`); + moveBtn.appendChild(makeMoveIcon(11)); + moveBtn.addEventListener("click", (e) => { + e.stopPropagation(); + this.cb.onMoveToProject?.(rawThreadId(row.id)); + }); + acts.appendChild(moveBtn); + } + if (hasSettle && row.settle) { const settleBtn = document.createElement("button"); settleBtn.type = "button"; @@ -829,7 +889,7 @@ export class SidebarView { const line2 = document.createElement("div"); line2.className = "bp-inbox-meta"; if (pill) line2.appendChild(this.renderStatusPill(pill, row.say)); - if (row.project) { + if (row.project && !row.chat) { const proj = document.createElement("span"); proj.className = "bp-inbox-proj"; proj.textContent = row.project; @@ -1012,7 +1072,23 @@ export class SidebarView { const head = document.createElement("div"); head.className = "bp-side-section-head" + (sec.id === "needs" ? " bp-head-needs" : sec.id === "running" ? " bp-head-running" : ""); - head.textContent = `${sec.title.toUpperCase()} ${rows.length}`; + if (sec.id === CHATS && this.cb.onNewChat) { + // Chats (the threads in no project): its + starts one + head.classList.add("bp-side-section-row"); + const lbl = document.createElement("span"); + lbl.textContent = `${t("chats.title", sec.title).toUpperCase()} ${rows.length}`; + const add = document.createElement("button"); + add.type = "button"; + add.className = "bp-side-sec-plus bp-side-sec-btn"; + add.textContent = "+"; + add.title = t("chats.new.noproject", "New chat (no project)"); + add.setAttribute("aria-label", add.title); + add.setAttribute("data-testid", "section-new-chat"); + add.addEventListener("click", (e) => { e.stopPropagation(); this.cb.onNewChat?.(); }); + head.append(lbl, add); + } else { + head.textContent = `${sec.title.toUpperCase()} ${rows.length}`; + } secWrap.appendChild(head); } diff --git a/web/test/palette.test.ts b/web/test/palette.test.ts index fec6834e3f..d8021e1cd0 100644 --- a/web/test/palette.test.ts +++ b/web/test/palette.test.ts @@ -65,6 +65,9 @@ describe("Command Palette pure logic", () => { // data/1 does not expose `thread.fork`; palette must not offer a misleading Fork action expect(items.some((i) => i.label.toLowerCase().includes("fork"))).toBe(false); expect(items.some((i) => i.action.type === "new-thread" && i.label === "New thread in Demo Board")).toBe(true); + // a chat in no project is always offered; Move to project… only for a chat + expect(items.some((i) => i.action.type === "new-chat" && i.label === "New chat (no project)")).toBe(true); + expect(items.some((i) => i.action.type === "move-project")).toBe(false); }); test("empty query surfaces waiting threads first", () => { diff --git a/web/test/sidebar.test.ts b/web/test/sidebar.test.ts index 729c37a101..3c385d2f45 100644 --- a/web/test/sidebar.test.ts +++ b/web/test/sidebar.test.ts @@ -3,7 +3,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; mock.module("virtual:i18n", () => ({ CATALOGS: {} })); -const { statusPillOf, isSwarmVisibleUnderProject } = await import("../src/sidebar"); +const { statusPillOf, isSwarmVisibleUnderProject, moveTargets, CHATS } = await import("../src/sidebar"); const root = join(import.meta.dir, ".."); const sidebarSrc = readFileSync(join(root, "src/sidebar.ts"), "utf8"); @@ -25,6 +25,17 @@ describe("SidebarView Crew / Inbox / Bench + Status Pills + Snooze", () => { expect(statusPillOf({ word: "idle" })).toBeNull(); }); + test("Quick chats: New chat in the header and the Chats head, Move to project on a chat row, own projects only", () => { + expect(CHATS).toBe("chats"); + expect(sidebarSrc).toContain('"sidebar-new-chat"'); + expect(sidebarSrc).toContain('"section-new-chat"'); + expect(sidebarSrc).toContain("`move-row-${row.id}`"); + const got = moveTargets([ + { id: "p2", title: "psu" }, { id: "chats", title: "Chats" }, { id: "scratch", title: "Scratch" }, { id: "L~p9", title: "far" }, { id: "p1", title: "Amp" }, + ]); + expect(got.map((p) => p.id)).toEqual(["p1", "p2"]); + }); + test("Crew band is mounted outside scrollable list and never appended after projects", () => { expect(sidebarSrc).toContain('this.crewEl.className = "bp-crew-band bp-hidden"'); expect(sidebarSrc).toContain("this.el.append(hostRow, head, this.homeBanner, this.crewEl, this.listEl, footer)"); From 42937709cceffaa9de557d25f9b6851d825ab626 Mon Sep 17 00:00:00 2001 From: i2cjak Date: Tue, 24 Nov 2026 01:56:22 -0500 Subject: [PATCH 2/4] chats: New chat and Move to project on the phones Android and iOS: a New chat button in the home bar (the new-thread screen with no project), the hub's Chats section in the Inbox tab (it does not end All clear), and Move to project in a chat row's menu, listing the hub's projects. Co-Authored-By: Claude Fable 5.2 --- .../java/dev/backplane/mobile/DataClient.kt | 2 ++ .../java/dev/backplane/mobile/DataSections.kt | 20 +++++++++++++--- .../java/dev/backplane/mobile/DataViews.kt | 6 +++-- .../backplane/mobile/MobileSectionsTest.kt | 23 +++++++++++++++++++ mobile/ios/Backplane/DataSections.swift | 6 ++++- mobile/ios/Backplane/DataViews.swift | 7 ++++-- mobile/ios/Backplane/HomeModel.swift | 6 ++++- mobile/ios/Backplane/SectionMenu.swift | 5 ++++ mobile/ios/Tests/HomeModelTests.swift | 3 +++ mobile/ios/Tests/SectionMenuTests.swift | 10 ++++++++ 10 files changed, 79 insertions(+), 9 deletions(-) diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt index af7b3188ea..81a8cf8b72 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataClient.kt @@ -883,6 +883,8 @@ object DataClient { projects = (projects.filter { it.id != p.id } + p).sortedByDescending { it.updatedAt } return p } + /** The place of the chats that belong to no project (the hub's `sidebar::CHATS`): `thread.create` with it starts one, in a folder of its own. */ + const val CHATS = "chats" suspend fun createThread(project: String, text: String, choice: DNewThreadChoice = DNewThreadChoice()): DThread { val p = choice.into(JSONObject().put("project", project).put("clientId", UUID.randomUUID().toString()).put("permission", "ask"), skipEmpty = true) if (text.isNotBlank()) p.put("text", text.trim()) diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt index ed4ea9d647..9d43830778 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataSections.kt @@ -177,7 +177,10 @@ data class MobilePartition( } } -private val INBOX_IDS = setOf("needs", "running", "snoozed") +/** The Inbox tab's sections, in the hub's order. Chats (the threads in no project) is listed here too: it is a list of threads, and the Bench is projects. */ +private val INBOX_IDS = setOf("needs", "running", "chats", "snoozed") +/** What stays under the Inbox's All clear card: nothing waits or runs, but the chats and the snoozed rows are still reachable. */ +fun quietInbox(inbox: List): List = inbox.filter { it.id == "chats" || it.id == "snoozed" } fun partitionSections(sections: List): MobilePartition { val inbox = sections.filter { it.id in INBOX_IDS } @@ -222,6 +225,11 @@ data class DMenuItem(val id: String, val label: String, val action: String, val companion object { fun list(a: JSONArray?): List = (0 until (a?.length() ?: 0)).map { i -> a!!.getJSONObject(i).let { o -> DMenuItem(o.optString("id"), o.optString("label"), o.optString("action"), o.optString("value"), o.optBoolean("confirm"), list(o.optJSONArray("sub"))) } } + /** A chat's Move to project… (`id` "move"): its `sub` is the projects, each sent as `sidebar.act` `row-move-project`. */ + const val MOVE_PROJECT = "row-move-project" + fun isMove(m: DMenuItem) = m.id == "move" && m.sub.isNotEmpty() + /** A thread row's menu: the hub's items that have words; Move to project… only while there is a project to move to. */ + fun thread(menu: List): List = menu.filter { it.label.isNotEmpty() && (it.id != "move" || it.sub.isNotEmpty()) } /** What a phone's long press lists: the hub's menu without Open folder (the folder is on the hub's machine) and New swarm when swarms are off. */ fun phone(menu: List, swarms: Boolean): List = menu.filter { it.id != "open" && (swarms || it.id != "swarm") && it.label.isNotEmpty() } } @@ -313,7 +321,8 @@ fun SectionHead(s: DSection, onLong: (() -> Unit)?) { fun SectionThread(r: DSecRow, indent: Int = 12, showProject: Boolean = false, openThread: (String) -> Unit = {}, open: (String) -> Unit) { var menu by remember { mutableStateOf(false) } var snoozeSheet by remember { mutableStateOf(false) } - val acts = if (r.key.isEmpty() && r.swarmRoom == null) r.menu.filter { it.label.isNotEmpty() } else emptyList() + var moveSheet by remember { mutableStateOf(null) } + val acts = if (r.key.isEmpty() && r.swarmRoom == null) DMenuItem.thread(r.menu) else emptyList() val need = r.need?.takeIf { r.kind == "swarm" } val pill = remember(r.label, r.tone, r.word, r.want, r.wake) { statusPillOf(r) } val canSwipeStart = r.wake.isNotEmpty() || r.settle.isNotEmpty() @@ -378,7 +387,8 @@ fun SectionThread(r: DSecRow, indent: Int = 12, showProject: Boolean = false, op DropdownMenuItem(text = { Text(Msg.tools_snooze, fontFamily = BpMono) }, onClick = { menu = false; snoozeSheet = true }, modifier = Modifier.testTag("home.section.snooze.${r.id}")) } if (r.hide.isNotEmpty()) DropdownMenuItem(text = { Text(Msg.common_hide, fontFamily = BpMono) }, onClick = { menu = false; DataClient.sidebarAct("thread-hide", r.hide) }, modifier = Modifier.testTag("home.section.hide.${r.id}")) - acts.forEach { m -> DropdownMenuItem(text = { Text(Tr.t(m.label), fontFamily = BpMono) }, onClick = { menu = false; DataClient.sectionThreadAct(r.id, m.id) }, modifier = Modifier.testTag("home.section.${m.id}.${r.id}")) } + // a chat in no project: Move to project… opens the hub's list of projects (`sub`); every other item is a thread.act + acts.forEach { m -> DropdownMenuItem(text = { Text(Tr.t(m.label), fontFamily = BpMono) }, onClick = { menu = false; if (DMenuItem.isMove(m)) moveSheet = m else DataClient.sectionThreadAct(r.id, m.id) }, modifier = Modifier.testTag("home.section.${m.id}.${r.id}")) } } } if (need != null) SwarmNeedLine(r, need, indent, { open(r.nav) }, openThread) @@ -446,6 +456,10 @@ fun SectionThread(r: DSecRow, indent: Int = 12, showProject: Boolean = false, op rowContent() } + moveSheet?.let { m -> + ActionSheet(Tr.t(m.label), m.sub.map { g -> g.label to { moveSheet = null; DataClient.sidebarAct(g.action.ifEmpty { DMenuItem.MOVE_PROJECT }, g.value) } }) { moveSheet = null } + } + if (snoozeSheet && r.snooze.isNotEmpty()) { ActionSheet( Msg.mobile_snooze_for, diff --git a/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt b/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt index cd7b552d2f..d90ef9b75d 100644 --- a/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt +++ b/mobile/android/app/src/main/java/dev/backplane/mobile/DataViews.kt @@ -378,6 +378,8 @@ private fun HomeScreen(open: (String) -> Unit, settings: () -> Unit, hub: () -> Icon(if (searchOpen) Icons.Default.Close else Icons.Default.Search, if (searchOpen) Msg.common_close else Msg.common_search, tint = if (searchOpen) dcs.primary else dcs.onSurfaceVariant) } } + // New chat: a thread in no project, from every tab (the hub keeps it under Chats until it is settled or moved to a project) + IconButton(onClick = { newThread(DataClient.CHATS) }, modifier = Modifier.testTag("home.chat.new")) { Icon(Icons.Default.Edit, Msg.chats_new, tint = dcs.onSurfaceVariant) } IconButton(onClick = settings, modifier = Modifier.testTag("home.settings")) { Icon(Icons.Default.Settings, Msg.palette_settings, tint = dcs.onSurfaceVariant) } } ConnBanner(hub, settings) @@ -412,7 +414,7 @@ private fun HomeScreen(open: (String) -> Unit, settings: () -> Unit, hub: () -> ) } // keep Snoozed reachable underneath All clear when items are snoozed - inboxItems(partition.inbox.filter { it.id == "snoozed" }, open, openSwarm) + inboxItems(quietInbox(partition.inbox), open, openSwarm) } else { inboxItems(partition.inbox, open, openSwarm) } @@ -1679,7 +1681,7 @@ private fun NewThreadScreen(project: String, back: () -> Unit, created: (String) LaunchedEffect(choice) { if (DataClient.has("picker")) runCatching { DataClient.picker(null, choice) }.onSuccess { chip = it.chip } } if (picking) PickerSheet(null, choice, { choice = it }) { picking = false } Column(Modifier.fillMaxSize()) { - DBar(Msg.android_thread_new_title(title), back) + DBar(if (project == DataClient.CHATS) Msg.chats_new else Msg.android_thread_new_title(title), back) Column(Modifier.padding(12.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { if (where.isNotEmpty()) DMono(Tr.t(where) + if ((owner?.newOn?.size ?: 0) > 1) " ▾" else "", dfaint, 11, Modifier.testTag("new.where").clickable(enabled = (owner?.newOn?.size ?: 0) > 1) { pickRun = true }) DField(text, { text = it }, Msg.android_thread_new_hint, Modifier.heightIn(min = 120.dp).focusRequester(focus).testTag("new.text"), 8, dcs.primary) diff --git a/mobile/android/app/src/test/java/dev/backplane/mobile/MobileSectionsTest.kt b/mobile/android/app/src/test/java/dev/backplane/mobile/MobileSectionsTest.kt index de699b62b2..c0c8476b70 100644 --- a/mobile/android/app/src/test/java/dev/backplane/mobile/MobileSectionsTest.kt +++ b/mobile/android/app/src/test/java/dev/backplane/mobile/MobileSectionsTest.kt @@ -68,6 +68,29 @@ class MobileSectionsTest { assertNull(statusPillOf(row("""{"id":"9","word":"idle"}"""))) } + @Test fun chatsWithNoProjectAreInTheInboxAndMoveToAProject() { + val sections = DSection.list(JSONArray( + """[ + {"id":"chats","kind":"threads","title":"Chats","count":1,"rows":[{"id":"c1","title":"quick question","chat":true,"project":"Chats","projectKey":"", + "menu":[{"id":"pin","label":"Pin","action":"row-pin","value":"c1"}, + {"id":"move","label":"Move to project…","action":"","value":"","sub":[{"id":"project","label":"amp","action":"row-move-project","value":"c1\u001fp1"}]}]}]}, + {"id":"snoozed","kind":"threads","title":"Snoozed","count":1,"fold":true,"open":false,"toggle":"sec:snoozed","rows":[]}, + {"id":"active","kind":"projects","title":"Recent","count":0,"rows":[]} + ]""" + )) + val p = partitionSections(sections) + assertEquals(listOf("chats", "snoozed"), p.inbox.map { it.id }) + assertTrue("chats alone do not end All clear", p.inboxEmpty) + assertEquals(listOf("chats", "snoozed"), quietInbox(p.inbox).map { it.id }) + val menu = DMenuItem.thread(p.inbox[0].rows[0].menu) + assertEquals(listOf("pin", "move"), menu.map { it.id }) + val move = menu[1] + assertTrue(DMenuItem.isMove(move)); assertFalse(DMenuItem.isMove(menu[0])) + assertEquals("row-move-project", move.sub[0].action); assertEquals("c1\u001fp1", move.sub[0].value) + // no project to move to: the item is left out + assertTrue(DMenuItem.thread(DMenuItem.list(JSONArray("""[{"id":"move","label":"Move to project…","sub":[]}]"""))).isEmpty()) + } + @Test fun partitionsInboxAndBenchAndComputesQuickJump() { val raw = JSONArray( """[ diff --git a/mobile/ios/Backplane/DataSections.swift b/mobile/ios/Backplane/DataSections.swift index b791c3df29..0b4823f484 100644 --- a/mobile/ios/Backplane/DataSections.swift +++ b/mobile/ios/Backplane/DataSections.swift @@ -213,7 +213,11 @@ extension View { func farHide(_ r: DSecRow, _ client: DataClient, after: @escaping () async -> Void = {}) -> some View { contextMenu { if !r.hide.isEmpty { Button(Tr.t("Hide"), systemImage: "eye.slash") { Task { await client.sidebarAct("thread-hide", r.hide) } } } - if !r.isProject && r.swarmRoom == nil { ForEach(r.menu) { m in Button(Tr.t(m.label)) { Task { await client.sectionThreadAct(r.id, m.id); await after() } }.accessibilityIdentifier("data.section." + m.id + "." + r.id) } } + if !r.isProject && r.swarmRoom == nil { ForEach(DMenuItem.thread(r.menu)) { m in + // a chat in no project: Move to project… lists the hub's projects (`sub`, each a `row-move-project`); every other item is a thread.act + if m.isMove { Menu { ForEach(m.sub.indices, id: \.self) { i in Button(m.sub[i].label) { Task { await client.sidebarAct(m.sub[i].action.isEmpty ? DMenuItem.moveProject : m.sub[i].action, m.sub[i].value); await after() } }.accessibilityIdentifier("data.section.move." + r.id + ".\(i)") } } label: { Label(Tr.t(m.label), systemImage: "folder") }.accessibilityIdentifier("data.section.move." + r.id) } + else { Button(Tr.t(m.label)) { Task { await client.sectionThreadAct(r.id, m.id); await after() } }.accessibilityIdentifier("data.section." + m.id + "." + r.id) } + } } // what a swipe does, for a finger that would rather press: the spans it can be snoozed for, or Wake if !r.snooze.isEmpty { Menu { ForEach(r.snooze) { o in Button(Tr.t(o.label)) { Task { await client.snoozeRow(o.value); await after() } } } } label: { Label(Tr.t("Snooze"), systemImage: "clock") } } if !r.wake.isEmpty { Button(Tr.t("Wake"), systemImage: "bell") { Task { await client.snoozeRow(r.wake); await after() } } } diff --git a/mobile/ios/Backplane/DataViews.swift b/mobile/ios/Backplane/DataViews.swift index ab7c0a92f9..4035abe6bc 100644 --- a/mobile/ios/Backplane/DataViews.swift +++ b/mobile/ios/Backplane/DataViews.swift @@ -231,6 +231,9 @@ struct DataThreadsView: View { Button { searching = true; searchFocus = true } label: { Image(systemName: "magnifyingglass").foregroundStyle(BackplaneDesign.dim) } .accessibilityLabel(Tr.t("Search")).accessibilityIdentifier("data.home.search") } + // New chat: a thread in no project, from every tab (the hub keeps it under Chats until it is settled or moved to a project) + Button { newThread = Home.chats } label: { Image(systemName: "square.and.pencil").foregroundStyle(BackplaneDesign.dim) } + .accessibilityLabel(Tr.t("New chat")).accessibilityIdentifier("data.home.chat.new") Button { path.append(DPage(name: "settings")) } label: { Image(systemName: "gearshape").foregroundStyle(BackplaneDesign.dim) } .accessibilityLabel(Tr.t("Settings")).accessibilityIdentifier("data.settings") }.dflat() @@ -361,7 +364,7 @@ struct DataThreadsView: View { private var inboxList: some View { List { awayRow - if !inboxSections.contains(where: { $0.id != "snoozed" }) { allClear } + if Home.allClear(inboxSections.map(\.id)) { allClear } ForEach(inboxSections) { s in DataSectionHead(s: s) { client.toggleSection(s.toggle) }.dataRow() ForEach(s.rows) { r in inboxRow(r) } @@ -787,7 +790,7 @@ struct DataNewThreadSheet: View { var body: some View { VStack(alignment: .leading, spacing: 10) { HStack { - Text(owner?.title ?? Tr.t("New thread")).dmono(14, bold: true).lineLimit(1); Spacer() + Text(project == Home.chats ? Tr.t("New chat") : owner?.title ?? Tr.t("New thread")).dmono(14, bold: true).lineLimit(1); Spacer() Button(Tr.t("Cancel")) { dismiss() }.dmono(13).foregroundStyle(BackplaneDesign.dim) } if !whereLine.isEmpty { diff --git a/mobile/ios/Backplane/HomeModel.swift b/mobile/ios/Backplane/HomeModel.swift index 017545ca13..e7697f3296 100644 --- a/mobile/ios/Backplane/HomeModel.swift +++ b/mobile/ios/Backplane/HomeModel.swift @@ -24,7 +24,11 @@ struct HomePill: Equatable { var label: String; var tone: String; var symbol: St enum Home { /// The sections of the Inbox tab, in the hub's order. - static let inbox: Set = ["needs", "running", "snoozed"] + static let inbox: Set = ["needs", "running", "chats", "snoozed"] + /// The place of the chats that belong to no project (the hub's `sidebar::CHATS`): `thread.create` with it starts one, in a folder of its own. + static let chats = "chats" + /// Whether the Inbox says All clear: nothing waits and nothing runs. The chats and the snoozed rows stay listed under it. + static func allClear(_ sections: [String]) -> Bool { !sections.contains { $0 != "snoozed" && $0 != chats } } static func tab(section id: String, kind: String) -> HomeTab? { if kind == "bub" { return .crew } if inbox.contains(id) { return .inbox } diff --git a/mobile/ios/Backplane/SectionMenu.swift b/mobile/ios/Backplane/SectionMenu.swift index a9d12712d0..2e0752c5fe 100644 --- a/mobile/ios/Backplane/SectionMenu.swift +++ b/mobile/ios/Backplane/SectionMenu.swift @@ -16,6 +16,11 @@ struct DMenuItem: Decodable, Equatable, Identifiable { id = s(.id); label = s(.label); action = s(.action); value = s(.value) confirm = (try? c.decode(Bool.self, forKey: .confirm)) ?? false; sub = (try? c.decode([DMenuItem].self, forKey: .sub)) ?? [] } + /// A chat's Move to project… (`id` "move"): its `sub` is the projects, each sent as `sidebar.act` `row-move-project`. + static let moveProject = "row-move-project" + var isMove: Bool { id == "move" && !sub.isEmpty } + /// A thread row's menu: the hub's items that have words; Move to project… only while there is a project to move to. + static func thread(_ menu: [DMenuItem]) -> [DMenuItem] { menu.filter { !$0.label.isEmpty && ($0.id != "move" || !$0.sub.isEmpty) } } /// What a phone's long press lists: the hub's menu without Open folder (the folder is on the hub's machine) and New swarm when swarms are off. static func phone(_ menu: [DMenuItem], swarms: Bool) -> [DMenuItem] { menu.filter { $0.id != "open" && (swarms || $0.id != "swarm") && !$0.label.isEmpty } } } diff --git a/mobile/ios/Tests/HomeModelTests.swift b/mobile/ios/Tests/HomeModelTests.swift index 032dc9c4c6..63a6cc3aad 100644 --- a/mobile/ios/Tests/HomeModelTests.swift +++ b/mobile/ios/Tests/HomeModelTests.swift @@ -11,6 +11,9 @@ for id in ["pinned", "active", "group:owner:github.com/acme", "all", "quiet"] { check(Home.tab(section: "bub", kind: "bub") == .crew, "Bub's row is the Crew's") check(Home.tab(section: "later", kind: "threads") == .inbox, "a list of threads a newer hub adds is in the Inbox, never lost") check(Home.tab(section: "x", kind: "chart") == nil, "an unknown kind is not drawn") +// Chats (the threads in no project) are a list of threads: the Inbox, and they do not end All clear +check(Home.tab(section: "chats", kind: "threads") == .inbox && Home.chats == "chats", "Chats are in the Inbox") +check(Home.allClear([]) && Home.allClear(["chats", "snoozed"]) && !Home.allClear(["needs", "chats"]) && !Home.allClear(["running"]), "All clear with only chats and snoozed rows") // the status pill: the hub's label and tone as they come check(Home.pill(label: "Approve", tone: "bad", word: "needs", want: "approval") == HomePill(label: "Approve", tone: "bad", symbol: "exclamationmark"), "the hub's label and tone") diff --git a/mobile/ios/Tests/SectionMenuTests.swift b/mobile/ios/Tests/SectionMenuTests.swift index bf8cfaf5b3..ac6578548c 100644 --- a/mobile/ios/Tests/SectionMenuTests.swift +++ b/mobile/ios/Tests/SectionMenuTests.swift @@ -21,5 +21,15 @@ check(sub.map(\.label) == ["Nordic", "New group…"], "Move to group: the other check(sub.first?.value == "k1\u{1f}folder:/w/n", "a group's value is the project key and the group", sub.first?.value ?? "") check(((try? JSONDecoder().decode([DMenuItem].self, from: Data("[{\"id\":\"pin\"}]".utf8))) ?? []).first?.label == "", "missing fields are empty") +// a chat in no project: its row's menu has Move to project…, a second list of the hub's projects (each a `row-move-project`) +let chatJson = """ +[{"id":"pin","label":"Pin","action":"row-pin","value":"c1"},{"id":"settle","label":"Settle","action":"row-settle","value":"c1"}, + {"id":"move","label":"Move to project…","action":"","value":"","sub":[{"id":"project","label":"amp","action":"row-move-project","value":"c1\\u001fp1"}]}] +""" +let chatMenu = DMenuItem.thread(try! JSONDecoder().decode([DMenuItem].self, from: Data(chatJson.utf8))) +check(chatMenu.map(\.id) == ["pin", "settle", "move"], "a chat's menu: pin, settle, move", chatMenu.map(\.id)) +check(chatMenu[2].isMove && !chatMenu[0].isMove && chatMenu[2].sub[0].action == DMenuItem.moveProject && chatMenu[2].sub[0].value == "c1\u{1f}p1", "Move to project lists the projects", chatMenu[2].sub) +check(DMenuItem.thread([DMenuItem(id: "move", label: "Move to project…")]).isEmpty, "no project to move to: no item") + print("section-menu: \(passed) passed, \(failed) failed") exit(failed == 0 ? 0 : 1) From 399f0a02f62b6972d1882e2e7ace458623653423 Mon Sep 17 00:00:00 2001 From: i2cjak Date: Tue, 24 Nov 2026 01:56:53 -0500 Subject: [PATCH 3/4] docs: PARITY row for chats that belong to no project Co-Authored-By: Claude Fable 5.2 --- docs/PARITY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/PARITY.md b/docs/PARITY.md index 5a8bc40b3f..d13347c795 100644 --- a/docs/PARITY.md +++ b/docs/PARITY.md @@ -93,6 +93,7 @@ Each lane updates its own rows in the commit that lands the work. | Japanese in the iOS app (Settings → Language: Automatic, English, 日本語) | done | i18n | `scripts/i18n-ios.py` generates `Tr.swift`/`TrCatalog.swift`; `scripts/check-ios-i18n.py` and TrTests (58 checks) run in `scripts/mobile/ios-unit-tests.sh` and CI. Driven 2026-11-09 on the Mac mini's private simulator with a temp-home hub: Automatic with the simulator in Japanese, and Settings › Language › 日本語 on an English simulator (`scripts/mobile/ios-i18n-journey.sh`): pairing, Home, search, a thread turn with composer and menu, Board, Schematic, 3D, Mech and Diff, bot, room, the Add-a-hub sheet. Not seen on screen: the Notifications section. Still English: content, product names, the system Paste button and keyboard tip (they follow the device language). | | Notification settings of 0.14 (`notify.*`: needs, settled, all, reminders, failed, idle) | done | notify | Settings → Notifications, one page the hub draws (`present/settings.rs` `notifications`; phones: data/1 `notify.page`, feature `notifysettings`): Needs me, Settled, Reminders, Everything, quiet hours (on/off, times), urgent asks, one row per iPhone (mute). Each changes what fires: hub tests `each_notify_switch_changes_whether_a_thread_alerts_the_phone`, `the_reminders_switch_…`, `the_pages_…`, `the_notify_switches_change_what_an_end_records`. Driven: GPUI on Xvfb with real clicks (`scripts/notify-e2e.sh`: Settled off → the next finished turn raises no desktop notification, on → it does); Android emulator (every press in `events.jsonl`, a bad time refused with the hub's words, Settled off → no alert on the phone, on → alert); iOS simulator (`test/e2e/push/notify-ios.sh`, 26 steps: quiet hours hold a push and releasing sends it as one, mute and urgent). `notify.failed` and `notify.idle` were only 0.14's message texts ("Failed", "All agents idle"), not switches. Everything (`notify.all`) did nothing in this hub before: it now alerts every completed or failed turn end; room exchanges stay quiet (open). | | Old Scratch chats: retired for new threads in 0.14 (38d3b10954) with their chats kept; 0.14's docs say they open "from Conversation history in the sidebar or search" | done | phone-cmds | The sidebar has a Conversation history group (`sidebar.rs` `legacy`, `present/screen.rs`): its row counts the chats and opens or shuts the list; a chat that wants attention, or is open, always has its row; nothing starts there. The sidebar search finds threads by title, these chats too, and opens the group; Enter opens the first found; the palette jumps to them (tests `scratch_chats_are_conversation_history_found_by_search_and_never_a_place_to_start`, `the_search_finds_threads_by_title_and_narrows_a_project_to_them`, `an_old_scratch_chat_is_found_by_its_title`). Phones: data/1 feature `history` (PHONE-DATA.md, Conversation history): `history.list {q?}` → `{live, threads, next, count}` from the sidebar's own rule (`sidebar::scratch_chats`); a `Thread` says `history`; Scratch is no project of `projects.list`, `search` or `mentions.list`, its chats are not in `threads.list`, and `thread.create` refuses it (test `scratch_chats_are_history_found_by_search_and_never_a_place_to_start` in `data/tests.rs`). Both phones draw the group under the projects (Android `DataViews.kt`, iOS `DataViews.swift`; `DHistoryTest`, `ThreadGroupsTests.swift`) and the search's finds under a Conversation history heading. Driven (hub-rest lane, Xvfb): the group opened and the chat opened from it (`hub-rest-history.png`, `hub-rest-scratch-chat.png`). Driven (phone-cmds lane): on the Android emulator and the iOS simulator (journey `data-history`) the group's row counts 3 with only the live chat shown, opens to all, no project or + for Scratch, the search finds the chat, it opens with its messages and takes a message the stand-in answers. | +| Chats that belong to no project (new in 2026-11: a thread in no project, `thread.project == "chats"`, its own folder `/chats/`; the old Scratch chats above stay as they are) | partial | quick-chats | One press everywhere: GPUI has New chat beside the sidebar search (`ui:New chat`), Ctrl/Cmd+Shift+N (`keys.rs` `new-chat`, rebindable), the palette's New chat (no project) and a + on the Chats section's head, all the action `new-thread` with `chats`; the web client the same button, Alt+Shift+N (a browser keeps Ctrl+Shift+N) and palette action over `thread.create {project:"chats"}`; both phones a New chat button in the home bar that opens the new-thread screen with no project. The hub lists the unsettled chats in the section `chats` (`present/sections.rs`, kind `threads`): GPUI and the web draw it as any section, the phones in the Inbox tab (it does not end All clear). Move to project…: the hub's `move` item on a chat row (`sub`: the projects, each `row-move-project`) is a second menu in GPUI (row and title menus) and on the phones; the web has a row button and a palette action over `thread.move_project`. Tested: GPUI `a_chat_in_no_project_moves_to_a_project_from_its_menu_and_has_no_subthread`, the palette and key tests; web `sidebar.test.ts`, `palette.test.ts`; Android `MobileSectionsTest.chatsWithNoProjectAreInTheInboxAndMoveToAProject`; iOS `HomeModelTests`, `SectionMenuTests`. Not driven on a phone or in a browser yet; the phone tests have not been run (no Android SDK or Mac on the lane's machine). | | `browser.seen` (0.14's client sent it from its browser-cast code, `client.bend:3811`, `3852`, naming a page) | unchecked | audit | Audit: unknown method on `main`; the GPUI client has no cast. What it acknowledged and whether anything replaced it is not shown. | | `view.search` (0.14's Find: "Type a word said in any thread", text of messages across threads) | done | search | Hub: `session/index.rs` indexes every message by its tokens, built once at start on its own thread (a real 150 MB log, 465k lines, 20k messages: 0.47 s; queries 1-3 ms) and then kept up from the lines appended since; a word is found anywhere inside what was said, any case. `thread.search` and data/1 `search` (`messages`) answer from it; `thread.find {thread, q}` and data/1 `find` (feature `find`) answer one thread's matches, oldest first, the newest 1000 at most (docs/HUB-API.md Search, docs/PHONE-DATA.md). `view.search`, `view.message` and `view.cancel` are retired: no client sends them, a newer query replaces an older one, and no message row is ever cut for `view.message` to continue (`partial` names activity rows only); they answer INVALID_REQUEST. GPUI (lane/search, Xvfb, real X keys and mouse, temp home, 162 seeded messages): Ctrl+Shift+F opened "Type a word said in any thread"; "pinecone" listed 4 hits (3 of the long thread, 1 of another) with the word bold; Down Down Enter opened the oldest hit ~150 rows back, paged until held, scrolled to and marked (`build/gpui/shots/search/g1-find-all.png`, `g3-opened-at-message.png`). Android (lane/search-android, Pixel 9 on a private hub, 2026-11-09): home search for "zephyr" lists a MESSAGES group (snippet with the word bold, "you said"/"agent said" · thread · project); a tap on a hit four pages back opens the thread there, marked. iOS: on a SEARCH=1 data hub (scripts/mobile/ios-search-test.sh, journey data-search in the Simulator) the home search lists what was said under Messages (word in bold, "you said"/"agent said", thread · project); a tap opens the thread at the message, older pages read, marked. | | Old checklist rows not in "Old checklist, audited": 56 to 84 (providers, MCP tools), 131 to 198 (settings pages, accounts and pairing, diagnostics, housekeeping, onboarding, hub core), and every phone result | unchecked | audit | Not driven yet. Settings pages are the E2E walk's (S01 to S14); providers, MCP tools and the hub-internal rows (173 to 198) need an agent or hub-level driver, not the GUI. The phones need an emulator or simulator and were not started. | From b4f4a0f1ac637f4cd38127ba8da7352b58c7585a Mon Sep 17 00:00:00 2001 From: i2cjak Date: Tue, 24 Nov 2026 02:21:26 -0500 Subject: [PATCH 4/4] chats: hub state, commands, presenter, data/1, and docs for quick chats --- docs/HUB-API.md | 4 + docs/PHONE-DATA.md | 10 +- native/host/src/agents/mod.rs | 4 +- native/host/src/agents/person.rs | 12 +- native/host/src/agents/snapguard.rs | 4 +- native/host/src/agents/world.rs | 17 ++- native/host/src/bots/plane.rs | 2 +- native/host/src/commands/actions.rs | 14 +++ native/host/src/commands/fold.rs | 6 +- native/host/src/commands/mod.rs | 12 +- native/host/src/commands/plan.rs | 128 ++++++++++++++-------- native/host/src/commands/tests.rs | 55 ++++++++++ native/host/src/data/ext.rs | 47 ++++++-- native/host/src/data/machines.rs | 4 +- native/host/src/data/mod.rs | 18 ++- native/host/src/data/tests.rs | 66 ++++++++++- native/host/src/data/webpolicy.rs | 2 + native/host/src/files/threadpath.rs | 6 +- native/host/src/import014/plan.rs | 2 +- native/host/src/model.rs | 1 + native/host/src/net/far.rs | 6 +- native/host/src/net/feed.rs | 4 +- native/host/src/net/registry.rs | 2 +- native/host/src/present/keys.rs | 35 ++++++ native/host/src/present/merged.rs | 6 +- native/host/src/present/rail.rs | 38 +++++-- native/host/src/present/screen.rs | 9 +- native/host/src/present/sections.rs | 93 +++++++++++++++- native/host/src/present/sections_tests.rs | 61 ++++++++++- native/host/src/present/thread.rs | 28 ++++- native/host/src/present/viewer.rs | 9 +- native/host/src/session/search.rs | 2 +- native/host/src/sidebar.rs | 9 +- native/host/src/state/mod.rs | 7 +- native/host/src/state/visible.rs | 2 +- 35 files changed, 596 insertions(+), 129 deletions(-) diff --git a/docs/HUB-API.md b/docs/HUB-API.md index 2551ff8033..cc92917349 100644 --- a/docs/HUB-API.md +++ b/docs/HUB-API.md @@ -39,6 +39,10 @@ One place to start modules, after `Hub::start`: `agents::Agents::start(hub.clone ## Rules process Not wired yet. Planned call: one persistent native process, a JSON line in, one out: `{"v":1,"fn":"Fm.safe","args":{...}}` -> `{"ok":..}`; 6.7 us round trip measured (docs/HUB-M1.md). Until then implement the rule in Rust with a corpus test and keep name in the test. +## Quick chats (`project == "chats"`) +- `thread.create {project: "chats", ...}` creates a project-free quick chat in `/chats/` with no git repo and default title `"New chat"`. +- `thread.move_project {thread, project}` emits append-only `ThreadProjectSet {id, project, at}` to move an idle quick chat (`thread.project == "chats"`) into a live local project, clearing `worktree`, `branch`, and `session`, keeping conversation history, and stopping any idle agent process. + ## Agent providers (agents lane, commit 51b4ac53d) Contract: `native/host/src/agents/providers/mod.rs` (read its docs); reference driver: `providers/codex.rs`. diff --git a/docs/PHONE-DATA.md b/docs/PHONE-DATA.md index 90cc1b6849..6b9f4c5c59 100644 --- a/docs/PHONE-DATA.md +++ b/docs/PHONE-DATA.md @@ -56,7 +56,7 @@ On reconnect the app resubscribes and re-reads lists and the open thread (no res ## Additions (2026-11-06, gpui-mobile; `native/host/src/data/ext.rs`) `hello.features` lists what a hub does beyond the base: `images` (above), `actions`, `search`, `models`, `mentions`, `bots`, `notify`. An app checks the feature before offering the control. -- `thread.act {thread, action: pin|unpin|settle|unsettle|archive|unarchive|delete|detach|reparent|rename|fork, title?, parent?}` → `{thread}` (fork requires feature `fork` and returns the new thread; delete: `{}`; reparent: `parent` is another live thread of its project, no cycle); each is the hub's own `thread.` request, so the desktop and the phone agree. `badge.list` → `{colors:[{name,css}], icons:[name]}` · `project.act {project, action: rename|color|icon|pick|remove, title?, value?}` → `{}` (color: a tint name, icon: an icon name; pick: Pick again, the hub's model picks the icon anew and the person's icon and colour are cleared; a project shows the person's icon and colour, else the hub's pick, else the folder and a colour from its id; `detach` on a thread makes it top level). +- `thread.act {thread, action: pin|unpin|settle|unsettle|archive|unarchive|delete|detach|reparent|rename|fork|move_project, title?, parent?, project?}` → `{thread}` (fork requires feature `fork` and returns the new thread; delete: `{}`; reparent: `parent` is another live thread of its project, no cycle; move_project: moves a quick chat into a live project); each is the hub's own `thread.` request, so the desktop and the phone agree. `badge.list` → `{colors:[{name,css}], icons:[name]}` · `project.act {project, action: rename|color|icon|pick|remove, title?, value?}` → `{}` (color: a tint name, icon: an icon name; pick: Pick again, the hub's model picks the icon anew and the person's icon and colour are cleared; a project shows the person's icon and colour, else the hub's pick, else the folder and a colour from its id; `detach` on a thread makes it top level). - `search {q, archived?=false, limit?=30, thread?, messages?=true}` → `{threads, projects, messages}` (title, project title, project folder; case-insensitive). `messages` are what was said with every word of `q` anywhere in it (the person's and the agents' messages, newest first, at most 3 a thread; with `thread`, only that thread's), from the hub's index of messages (docs/HUB-API.md, Search): each `{thread, title, project, msg, role, text, at}`, `text` a line around the first word. `messages: false` leaves them out. `at` is unix ms, as everywhere here. A tap on one opens its thread at the message (older pages read with `thread.entries {before}` until it is held), marked. - `find {thread, q}` (feature `find`) → `{q, matches: [{msg, role, at, text}], total, more}`: find in a thread, every message of it with every word of `q`, oldest first (the thread's order), at most 1000: past that the newest 1000, with `more`. The app's find bar shows "n of total", steps next and previous through `matches` and scrolls to each `msg` (reading older pages with `thread.entries {before}` until it is held), marking it. An unknown thread is an error. - `models.list` → `{models:{provider:[{value,label,ok,why}]}}` (the hub's `models.all`); `thread.model {thread, provider, model, effort?}` → `{thread}` (the same provider: `thread.modes`; another provider: `thread.provider`, between turns only). A thread's `model` is the one chosen (ModesSet) else the provider's. @@ -299,6 +299,14 @@ The old Scratch chats: 0.14 stopped new ones and kept these. They open read and - `history.list {q?, limit?=50, before?}` → `{live, threads, next, count}`: `live` are the chats that want attention (an open ask, a running turn, still on the Pinned or Active shelf); a phone always shows them under the group's row. `threads` are the rest, newest first, paged like `threads.list`, shown while the group is open. `q` keeps the chats whose title has every word of it, any case. `count` counts every chat, the search aside; the group's row ("Conversation history (N)") shows only when it is above 0, and opens or shuts the list. - `search` finds these chats by title: a phone shows them under a "Chats with no project" heading. A `lists` push of a `thread` with `history: true` means the group changed: ask `history.list` again. +## Quick chats (no project, feature `chats`; `native/host/src/data/ext.rs`, `sidebar.rs` `CHATS`) +Persistent threads started outside any project (`project: "chats"`), stored in `/chats/` with no git repository: +- `hello.features` includes `"chats"`. +- `thread.create {project:"chats", title?, text?, ...}` → `{thread}` with `project: "chats"`, `chat: true`. `"chats"` is excluded from `projects.list` and `mentions.list` (`%`), while `threads.list` includes live quick chats (and `chats.list` lists quick chats specifically). +- `chats.list {q?, settled?, limit?=50, before?}` → `{threads, next, count}` lists non-deleted, non-archived quick chats (`q` matches title words, `settled` optionally filters by settled flag). +- `thread.move_project {thread, project}` (and `thread.act {action:"move_project", project}` / `sidebar.act {action:"row-move-project", value:"\u001f"}`) → `{thread}` moves an idle quick chat into a live project (`ThreadProjectSet` event), clearing `worktree`/`branch`/`session`, preserving history, and stopping any idle agent process. +- In `sidebar.sections`, unsettled quick chats (plus the selected one) appear in the `chats` section (`kind: "threads"`, after `snoozed` and before `pinned`); `jump` includes settled quick chats too with `place: "Chats"` and `chat: true`. `viewer.rail` omits design/diff/review tools for quick chats. + ## Terminals (feature `terms`; `native/host/src/data/term.rs`, `term/stream.rs`) The hub's own terminals: the chat terminals a thread opens (an agent's `terminal_open`), the threads' floating shells, and shells a phone opens itself. The screen is the hub's emulator's; a phone runs the same VT rules on the bytes (or draws the snapshot). A data/1 socket holds the hub's token or a paired device's (full access), so it types into them as the desktop does. - Entry `{id, kind:"term", text:, at, term:{key, id, title, cols, rows, cmd}}`: a chat terminal in a thread's entries (paging and `entry` pushes alike). Draw it as a card a few rows tall; its screen comes from `term.read`/`term.watch` under `key`. A thread's card stays after the terminal ends: its last screen is on the hub's disk, so it reads back after a restart (a terminal that was running when the hub stopped reads back `stopped`). diff --git a/native/host/src/agents/mod.rs b/native/host/src/agents/mod.rs index b9983b6e27..6b5cf3cd81 100644 --- a/native/host/src/agents/mod.rs +++ b/native/host/src/agents/mod.rs @@ -886,8 +886,8 @@ impl Actor { let mut ev: Vec<Value> = vec![]; let takes_ride = !ride.is_empty() && (codex || sbs || !was_running); if takes_ride { ev.extend(codex::ride_done(&th, &ride, "with a new turn", now)) } // Ride.post: an idle thread starts with the mail still waiting - let first_title = if t.title == "New thread" && person && role == "user" && origin.is_none() { Some(rules::title_of(&text)).filter(|x| !x.is_empty()) } else { None }; // Title.out: the first line now, a model's title after - if t.title == "New thread" { ev.push(json!({"$":"ThreadRenamed","id":th,"title":rules::title_of(&text),"at":now})) } + let first_title = if matches!(t.title.as_str(), "New thread" | "New chat") && person && role == "user" && origin.is_none() { Some(rules::title_of(&text)).filter(|x| !x.is_empty()) } else { None }; // Title.out: the first line now, a model's title after + if matches!(t.title.as_str(), "New thread" | "New chat") { ev.push(json!({"$":"ThreadRenamed","id":th,"title":rules::title_of(&text),"at":now})) } // Steer.change: a message into a streaming reply posts what streamed, up to its last line break, ahead of it let head = rules::steer_head(&self.live); if !head.is_empty() { diff --git a/native/host/src/agents/person.rs b/native/host/src/agents/person.rs index b858b446f1..b9a319badc 100644 --- a/native/host/src/agents/person.rs +++ b/native/host/src/agents/person.rs @@ -26,9 +26,10 @@ pub fn check_folder(cwd: &str, roots: &[String], copy_home: &Path, live_home: Op if let Some(l) = live_home { let l = canon(l); if under(&real, &l) { return Err(format!("{cwd} is inside the live Backplane's home ({})", l.display())) } } let ch = canon(copy_home); let scratch = ch.join("scratch"); + let chats = ch.join("chats"); let in_root = roots.iter().filter(|r| !r.is_empty()).any(|r| under(&real, &canon(Path::new(r)))); - if real == ch || (under(&real, &ch) && !under(&real, &scratch)) { return Err(format!("{cwd} is the copy's own home or one of its control folders")) } - if !(in_root || under(&real, &scratch)) { return Err(format!("{cwd} is not under a project folder of this copy")) } + if real == ch || (under(&real, &ch) && !under(&real, &scratch) && !under(&real, &chats)) { return Err(format!("{cwd} is the copy's own home or one of its control folders")) } + if !(in_root || under(&real, &scratch) || under(&real, &chats)) { return Err(format!("{cwd} is not under a project folder of this copy")) } Ok(real) } @@ -41,11 +42,12 @@ impl LiveFold { let mut f = LiveFold::default(); for (t, folder, running) in base { if !folder.is_empty() { f.folder.insert(t.clone(), folder.clone()); } if *running { f.running.insert(t.clone()); } } for l in lines { let Some(ty) = crate::session::event_type(l) else { continue }; - if !["ProjectCreated", "ThreadCreated", "WorktreeSet", "TurnChanged"].contains(&ty) { continue } + if !["ProjectCreated", "ThreadCreated", "ThreadProjectSet", "WorktreeSet", "TurnChanged"].contains(&ty) { continue } let Ok(v) = serde_json::from_str::<Value>(l) else { continue }; let g = |k: &str| v.get(k).and_then(Value::as_str).unwrap_or("").to_string(); match ty { "ProjectCreated" => { f.roots.insert(g("id"), g("root")); } "ThreadCreated" => { f.project.insert(g("id"), g("project")); let wt = g("worktree"); let folder = if !wt.is_empty() { wt } else { f.roots.get(&g("project")).cloned().unwrap_or_default() }; if !folder.is_empty() { f.folder.insert(g("id"), folder); } } + "ThreadProjectSet" => { let (id, proj) = (g("id"), g("project")); f.project.insert(id.clone(), proj.clone()); if let Some(r) = f.roots.get(&proj).cloned().filter(|r| !r.is_empty()) { f.folder.insert(id, r); } else { f.folder.remove(&id); } } "WorktreeSet" => { f.folder.insert(g("id"), g("worktree")); } "TurnChanged" => { if g("state") == "running" { f.running.insert(g("thread")); } else { f.running.remove(&g("thread")); } } _ => {} @@ -105,10 +107,12 @@ mod tests { fn dir(n: &str) -> crate::plat::tmp::TempDir { crate::plat::tmp::canonical(&format!("person-{n}")) } #[test] fn the_folder_must_be_a_project_folder_of_the_copy_and_nothing_of_the_live_home_or_root() { let (proj, home, live, other) = (dir("proj"), dir("home"), dir("live"), dir("other")); std::fs::create_dir_all(proj.join("sub")).unwrap(); std::fs::create_dir_all(home.join("scratch/t1")).unwrap(); std::fs::create_dir_all(live.join("scratch/t9")).unwrap(); + std::fs::create_dir_all(home.join("chats/c1")).unwrap(); std::fs::create_dir_all(live.join("chats/c9")).unwrap(); let roots = vec![proj.to_string_lossy().into_owned()]; assert!(check_folder(proj.to_str().unwrap(), &roots, &home, Some(&live)).is_ok()); assert!(check_folder(proj.join("sub").to_str().unwrap(), &roots, &home, Some(&live)).is_ok()); assert!(check_folder(home.join("scratch/t1").to_str().unwrap(), &roots, &home, Some(&live)).is_ok(), "the copy's own scratch"); - for (bad, why) in [("/", "root"), (live.join("scratch/t9").to_str().unwrap(), "under the live home"), (other.to_str().unwrap(), "not a project folder"), (home.to_str().unwrap(), "the copy's home"), (home.join("attachments").to_str().unwrap(), "control folder"), ("/no/such/folder", "missing"), ("", "empty")] { + assert!(check_folder(home.join("chats/c1").to_str().unwrap(), &roots, &home, Some(&live)).is_ok(), "the copy's own chats"); + for (bad, why) in [("/", "root"), (live.join("scratch/t9").to_str().unwrap(), "under the live home"), (live.join("chats/c9").to_str().unwrap(), "chats under live home"), (other.to_str().unwrap(), "not a project folder"), (home.to_str().unwrap(), "the copy's home"), (home.join("attachments").to_str().unwrap(), "control folder"), ("/no/such/folder", "missing"), ("", "empty")] { assert!(check_folder(bad, &roots, &home, Some(&live)).is_err(), "{why}: {bad}"); } std::fs::create_dir_all(home.join("attachments")).unwrap(); assert!(check_folder(home.join("attachments").to_str().unwrap(), &roots, &home, Some(&live)).is_err()); diff --git a/native/host/src/agents/snapguard.rs b/native/host/src/agents/snapguard.rs index 6443f9a4c8..b981c5982f 100644 --- a/native/host/src/agents/snapguard.rs +++ b/native/host/src/agents/snapguard.rs @@ -124,8 +124,8 @@ impl Agents { /// `turn_guard_start`; `person`: the person's own message started this turn (they can answer a mass-deletion ask). pub async fn turn_guard_start_by(self: &Arc<Self>, th: &str, cwd: &str, text: Option<&str>, person: bool) -> Result<(), String> { if crate::copy::on() || cwd.is_empty() { return Ok(()) } - // a bot's own thread works in its own folder (bots/rpc.rs makes it a repository), not a project: never blocked for git, never snapshotted - if self.world().await.bot_of.contains_key(th) { return Ok(()) } + // a bot's own thread or a project-free Quick Chat works in its own folder, never blocked for git, never snapshotted + { let w = self.world().await; if w.bot_of.contains_key(th) || w.threads.get(th).is_some_and(|t| t.project == crate::sidebar::CHATS) { return Ok(()) } } if !git_runs().await { self.git_missing(th).await; return Err(GIT_MISSING.into()) } self.close_git_asks(th).await; // installed meanwhile (setup, or this ask's own press): the ask is done self.guard_begin(th, cwd, text, true).await; diff --git a/native/host/src/agents/world.rs b/native/host/src/agents/world.rs index c2554a2bfd..86083cff34 100644 --- a/native/host/src/agents/world.rs +++ b/native/host/src/agents/world.rs @@ -86,7 +86,7 @@ impl World { pub fn apply(&mut self, line: &str) { let Some(t) = crate::session::event_type(line) else { return }; - const READ: [&str; 41] = ["WorktreeSkipped", "ThreadSettled", "ThreadUnsettled", "ThreadWoke", "LockChanged", "BotSet", "BotDeleted", "RoomSet", "RoomDeleted", "TurnQueued", "QueueTaken", "QueueRemoved", "QueueTakenOne", "ThreadParentSet", "ProjectRemoved", "ThreadLaunched", "TaskDelegated", "TaskStateSet", "TaskDelivered", "WorkSet", "AskOpened", "AskClosed", "ThreadRenamed", "ProjectCreated", "ThreadCreated", "WorktreeSet", "ProviderSet", "ModesSet", "SessionSet", "TurnChanged", "MessagePosted", "ActivityLogged", "UsageSet", "SettingSet", "TurnUsage", "ThreadArchived", "ThreadDeleted", "ThreadForked", "QueueTaken", "TurnQueued", "ThreadWoke"]; + const READ: &[&str] = &["WorktreeSkipped", "ThreadSettled", "ThreadUnsettled", "ThreadWoke", "LockChanged", "BotSet", "BotDeleted", "RoomSet", "RoomDeleted", "TurnQueued", "QueueTaken", "QueueRemoved", "QueueTakenOne", "ThreadParentSet", "ProjectRemoved", "ThreadLaunched", "TaskDelegated", "TaskStateSet", "TaskDelivered", "WorkSet", "AskOpened", "AskClosed", "ThreadRenamed", "ThreadProjectSet", "ProjectCreated", "ThreadCreated", "WorktreeSet", "ProviderSet", "ModesSet", "SessionSet", "TurnChanged", "MessagePosted", "ActivityLogged", "UsageSet", "SettingSet", "TurnUsage", "ThreadArchived", "ThreadDeleted", "ThreadForked", "QueueTaken", "TurnQueued", "ThreadWoke"]; if !READ.contains(&t) { return } let Ok(v) = serde_json::from_str::<Value>(line) else { return }; let g = |k: &str| v.get(k).and_then(Value::as_str).unwrap_or("").to_string(); @@ -121,6 +121,7 @@ impl World { "ModesSet" => if let Some(x) = self.threads.get_mut(&g("id")) { x.runtime = g("runtime"); x.interaction = g("interaction"); x.model = g("model") }, "SessionSet" => if let Some(x) = self.threads.get_mut(&g("id")) { x.session = g("session") }, "ThreadRenamed" => if let Some(x) = self.threads.get_mut(&g("id")) { x.title = g("title") }, + "ThreadProjectSet" => if let Some(x) = self.threads.get_mut(&g("id")) { x.project = g("project"); x.env = "local".into(); x.branch.clear(); x.worktree.clear(); x.wt_skipped = false; x.session.clear(); }, "AskOpened" => { self.asks.insert(g("id"), Ask { thread: g("thread"), kind: g("kind"), tool: g("tool"), detail: g("detail"), options: g("options") }); } "AskClosed" => if let Some(a) = self.asks.remove(&g("id")) { if a.kind == "approval" && g("answer") == "session" { self.sessions.insert((a.thread, a.tool)); } }, // an archive is read as a manual settle (state/mod.rs says why); what the thread held goes as before, until it is brought back @@ -275,4 +276,18 @@ mod tests { w.apply(r#"{"$":"WorktreeSet","id":"t","branch":"","worktree":"/elsewhere/lanes/bub","at":3}"#); assert_eq!(w.cwd("t"), home.join("bots").join("bub").to_string_lossy()); assert!(home.join("bots/bub").is_dir()); } + #[test] fn thread_project_set_moves_chat_and_clears_worktree_and_session() { + let mut w = World::default(); + for l in [ + r#"{"$":"ProjectCreated","id":"p1","title":"P","root":"/r","at":1}"#, + r#"{"$":"ThreadCreated","id":"c1","project":"chats","title":"Quick","env":"local","branch":"","worktree":"/home/u/chats/c1","provider":"claude","model":"","at":2}"#, + r#"{"$":"SessionSet","id":"c1","session":"S1","at":3}"#, + ] { w.apply(l); } + assert_eq!(w.cwd("c1"), "/home/u/chats/c1"); + w.apply(r#"{"$":"ThreadProjectSet","id":"c1","project":"p1","at":4}"#); + assert_eq!(w.threads["c1"].project, "p1"); + assert_eq!(w.threads["c1"].worktree, ""); + assert_eq!(w.threads["c1"].session, ""); + assert_eq!(w.cwd("c1"), "/r"); + } } diff --git a/native/host/src/bots/plane.rs b/native/host/src/bots/plane.rs index 4f0ad8db8e..9f6a022544 100644 --- a/native/host/src/bots/plane.rs +++ b/native/host/src/bots/plane.rs @@ -210,7 +210,7 @@ pub fn read(st: &State, w: &World, rooms: &[RoomNews], now: u64, idle: bool) -> }; all.push(Row { kind: "swarm", id: s.id.clone(), title: s.title.clone(), sub, state, at: s.activity }); } - let mut projects: Vec<(&String, &Project)> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != "scratch").collect(); projects.sort_by(|a, b| b.1.created.cmp(&a.1.created).then(a.0.cmp(b.0))); + let mut projects: Vec<(&String, &Project)> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != "scratch" && id.as_str() != crate::sidebar::CHATS).collect(); projects.sort_by(|a, b| b.1.created.cmp(&a.1.created).then(a.0.cmp(b.0))); for (pid, p) in projects { for id in live_threads(st, pid, now, &hidden) { let (state, t) = (c.state(id), c.thread(id)); diff --git a/native/host/src/commands/actions.rs b/native/host/src/commands/actions.rs index 3e3301c966..2640dd2123 100644 --- a/native/host/src/commands/actions.rs +++ b/native/host/src/commands/actions.rs @@ -103,6 +103,13 @@ pub fn act(req: &Req) -> Option<ActOut> { if th.is_empty() || parent.is_empty() || th == parent { return None } a.rpc("thread.reparent", json!({"thread": th, "parent": parent})); a.set("@del", ""); a.set("@menu", ""); } + // promote a Quick Chat into an existing project (`<thread>\u{1f}<project>`, thread.move_project) + "row-move-project" => { + let Some((raw_th, project)) = v.split_once('\u{1f}') else { return None }; + let th = raw_th.rsplit_once('|').map_or(raw_th, |(_, r)| r); + if th.is_empty() || project.is_empty() { return None } + a.rpc("thread.move_project", json!({"thread": th, "project": project})); a.set("@del", ""); a.set("@menu", ""); + } // the project's menu: Rename opens the same rename box a thread's does, on the project (rename-save sends project.rename) "proj-rename" => { if v.is_empty() { return None } @@ -202,6 +209,13 @@ pub fn act(req: &Req) -> Option<ActOut> { "run-on" => { let (p, to) = v.split_once('|')?; if p.is_empty() { return None } a.set(&format!("@runon.{p}"), to); a.set("@menu", ""); } "new-thread" => { if v.is_empty() { return None } // no project named: the new-bot form, the helper's + if v == crate::sidebar::CHATS { + let rid = a.rid.to_string(); + let at = format!("{}|{}", r.session["info"]["local.machine"].as_str().unwrap_or(""), r.session["info"]["local.generation"].as_str().unwrap_or("")); + a.set("@del", ""); a.set("@menu", ""); a.set("@want.viewer", ""); a.set("@want.new", &rid); a.set("@want.new.at", &at); + a.rpc("thread.create", json!({"project": crate::sidebar::CHATS, "title": "New chat"})); + return Some(a.out()) + } // `<target>\u{1f}<picked>`: the window says which machine the person picked; a target on any other machine is refused, never made there let (v, picked) = v.split_once('\u{1f}').unwrap_or((v, "")); let chosen = draft(r.session, &format!("@runon.{v}")).to_string(); let v = if chosen.is_empty() { v } else { chosen.as_str() }; diff --git a/native/host/src/commands/fold.rs b/native/host/src/commands/fold.rs index 264b88cd3b..7776aa68cd 100644 --- a/native/host/src/commands/fold.rs +++ b/native/host/src/commands/fold.rs @@ -26,7 +26,10 @@ pub struct Fold { #[serde(skip)] pub alloc: Option<usize>, /// the agent a new thread gets when its request names none (settings/models.rs `default_agent`, set by the handler from /// what is installed here); None: the `agent.provider` setting as it is #[serde(skip)] pub default_agent: Option<String>, /// the first messages of home threads ("home-<msg>"), so a retry knows whether the message arrived + /// the first messages of home threads ("home-<msg>"), so a retry knows whether the message arrived pub home_msgs: std::collections::HashSet<String>, + /// `<home>/chats` directory resolved by the command handler for Quick Chats. + #[serde(skip)] pub chats_root: String, } const KEYS: &[&str] = &["thread.parent.", "bg.", "watch.", "carry.wait.", "thread.env", "agent.provider", "agent.model", "projects.missing", "merged.", "provider.resume.", "restart.retry.", "resume.", "wt.again.", "thread.config.hold.", "plan.once.", "seen.", "tz.machine", "account.thread.", "account.default.", "accounts.inventory", "account.session.", "account.seen.", "account.chosen.", "account.limit.", "fallback.intent."]; @@ -64,7 +67,7 @@ impl Fold { pub fn apply(&mut self, line: &str) { let Some(t) = crate::session::event_type(line) else { return }; - const READ: &[&str] = &["ProjectCreated", "ProjectRemoved", "ThreadCreated", "ThreadRenamed", "ThreadArchived", "ThreadDeleted", "ThreadForked", "ThreadSnoozed", "ThreadOrdered", "ProjectOrdered", + const READ: &[&str] = &["ProjectCreated", "ProjectRemoved", "ThreadCreated", "ThreadRenamed", "ThreadProjectSet", "ThreadArchived", "ThreadDeleted", "ThreadForked", "ThreadSnoozed", "ThreadOrdered", "ProjectOrdered", "TurnQueued", "QueueTaken", "QueueEdited", "QueueRemoved", "QueueMoved", "QueueTakenOne", "AskOpened", "AskClosed", "SettingSet", "ProviderSet", "TurnChanged", "WorktreeSet", "ModesSet", "WorkSet", "WorktreeSkipped", "ThreadParentSet", "ThreadPinned", "ThreadSettled", "ThreadUnsettled", "ThreadMerged", "WorktreeRemoved", "SessionSet", "MessagePosted", "ActivityLogged", "Reminded"]; if !READ.contains(&t) { return } let Ok(v) = serde_json::from_str::<Value>(line) else { return }; @@ -76,6 +79,7 @@ impl Fold { "ThreadCreated" => { self.threads.insert(g("id"), T { project: g("project"), title: g("title"), env: g("env"), branch: g("branch"), worktree: g("worktree"), provider: g("provider"), model: g("model"), turn: "idle".into(), runtime: "full-access".into(), interaction: "default".into(), ..Default::default() }); } "ThreadRenamed" => if let Some(x) = self.threads.get_mut(&g("id")) { x.title = g("title") }, + "ThreadProjectSet" => if let Some(x) = self.threads.get_mut(&g("id")) { x.project = g("project"); x.env = "local".into(); x.branch.clear(); x.worktree.clear(); }, // an archive is read as a manual settle (state/mod.rs says why) "ThreadArchived" => if let Some(x) = self.threads.get_mut(&g("id")) { if v.get("archived").and_then(Value::as_bool).unwrap_or(false) { x.forced = 1; x.settled_at = x.settled_at.max(at); x.pinned = false } }, "ThreadDeleted" => if let Some(x) = self.threads.get_mut(&g("id")) { x.deleted = true }, diff --git a/native/host/src/commands/mod.rs b/native/host/src/commands/mod.rs index f4fad8ed76..12f08ce850 100644 --- a/native/host/src/commands/mod.rs +++ b/native/host/src/commands/mod.rs @@ -95,7 +95,7 @@ impl Commands { impl RpcHandler for Commands { fn methods(&self) -> &'static [&'static str] { &["bots.give", "thread.pin", "thread.unpin", "thread.settle", "thread.unsettle", "thread.archive", "thread.unarchive", "thread.rename", "thread.delete", "thread.snooze", - "thread.reorder", "thread.detach", "thread.reparent", "thread.create", "thread.modes", "thread.planonce", "thread.effort", "thread.speed", "thread.provider", "accounts.select", "accounts.move_all", "accounts.choose", "fallback.switch", "thread.fork", "thread.back", "project.remove", "project.rename", + "thread.reorder", "thread.detach", "thread.reparent", "thread.create", "thread.move_project", "thread.modes", "thread.planonce", "thread.effort", "thread.speed", "thread.provider", "accounts.select", "accounts.move_all", "accounts.choose", "fallback.switch", "thread.fork", "thread.back", "project.remove", "project.rename", "project.reorder", "project.move", "project.add", "project.new", "project.create", "project.start", "project.home", "todos.edit", "queue.edit", "queue.remove", "queue.move", "queue.steer", "queue.resume", "order.buy", "fs.list", "fs.mkdir", "fs.find", "agents.fresh"] } fn call<'a>(&'a self, hub: &'a Arc<Hub>, who: &'a Caller, id: &'a Value, method: &'a str, p: &'a Value) -> Fut<'a, Vec<Value>> { Box::pin(async move { @@ -164,6 +164,7 @@ impl RpcHandler for Commands { } } if let Err(e) = f.sync(&hub.store) { return vec![json!({"t":"reply","id":id,"ok":false,"error":format!("{e:#}")})] } f.default_agent = crate::settings::models::live().then(|| crate::settings::models::default_now(f.setting("agent.provider"), f.setting("accounts.inventory"))); + f.chats_root = hub.cfg.home.join("chats").to_string_lossy().into_owned(); f.alloc = Some(hub.alloc_n(4) as usize); // p<at>-<n>, t<at>-<n+1>, g<at>-<n+3>: a number no other request shares if let Some(root) = create_in { let pl = plan::project_create(&f, now_s(), id, p, &root); @@ -213,6 +214,8 @@ impl RpcHandler for Commands { if method == "thread.delete" { if let Some(h) = hub.rpc_for("browser.close") { let (hub, th) = (hub.clone(), p["thread"].as_str().unwrap_or("").to_string()); tokio::spawn(async move { let _ = h.call(&hub, &Caller { gen: String::new(), client: 0 }, &json!(0), "browser.close", &json!({"thread": th})).await; }); } } // BotFx scratch (an out, so after the changes): the folder exists before the reply, and before anything runs in it if let Some(th) = pl.scratch.clone() { scratch_folder(hub, &th); } + // Quick Chats: `<home>/chats/<thread>` exists synchronously before the reply (no git init) + if let Some(th) = pl.chat.clone() { chat_folder(hub, &th); } if let Some((th, root, mode, src, pv, bd, op)) = wtc { worktree::spawn(hub.clone(), self.fold.clone(), th, root, mode, src, pv, bd, op) } // Home.start: the first message is a turn.start of the new thread (the agents module posts it, queued while the worktree is made); its failure is the reply's if let Some(("post", th, text)) = pl.act.clone() { @@ -290,6 +293,13 @@ fn scratch_folder(hub: &Arc<Hub>, th: &str) { }); } +/// Quick Chats: `<home>/chats/<thread>` made synchronously before the reply (no git init). +fn chat_folder(hub: &Arc<Hub>, th: &str) { + let plain = !th.is_empty() && !th.starts_with('.') && th.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.')); + if !plain { return } + let _ = std::fs::create_dir_all(hub.cfg.home.join("chats").join(th)); +} + /// The provider and account binding a worktree job starts with (Hub.job.ready compares them when it reports): the thread's, as this step's events set them. fn capture(f: &fold::Fold, th: &str, events: &[Value]) -> (String, String) { let provider = events.iter().find(|e| e["$"] == "ThreadCreated" && e["id"] == th).and_then(|e| e["provider"].as_str()).unwrap_or("").to_string(); diff --git a/native/host/src/commands/plan.rs b/native/host/src/commands/plan.rs index 7e7c931932..409daa7df9 100644 --- a/native/host/src/commands/plan.rs +++ b/native/host/src/commands/plan.rs @@ -5,7 +5,8 @@ use serde_json::{json, Value}; pub struct Plan { pub events: Vec<Value>, pub reply: Value, /// a running turn to stop before the events (Retire.archive) pub stop: Option<String>, /// a worktree to make after the events are durable: (thread, project folder, mode, fork source) pub wt: Option<(String, String, String, String, super::worktree::Opts)>, /// a scratch thread's own folder to make: (thread) - pub scratch: Option<String>, /// what the agents module does after the events: ("steer" | "resume", thread, text) + pub scratch: Option<String>, /// a project-free Quick Chat's own folder to make: (thread) + pub chat: Option<String>, /// what the agents module does after the events: ("steer" | "resume", thread, text) pub act: Option<(&'static str, String, String)> } /// One entry of a thread as the handoff text reads it: a message or an activity row. @@ -19,7 +20,7 @@ pub struct Ctx { pub entries: Vec<Line>, pub buy: Buy } pub struct Buy { pub on: bool, pub buying: bool, pub last: String } /// The requests that read the thread's whole conversation. -pub fn needs_entries(m: &str) -> bool { matches!(m, "thread.fork" | "thread.back" | "thread.provider" | "accounts.select" | "accounts.choose" | "fallback.switch") } +pub fn needs_entries(m: &str) -> bool { matches!(m, "thread.fork" | "thread.back" | "thread.provider" | "thread.move_project" | "accounts.select" | "accounts.choose" | "fallback.switch") } fn ok(id: &Value) -> Value { json!({"t":"reply","id":id,"ok":true}) } fn made(id: &Value, th: &str) -> Value { json!({"t":"reply","id":id,"ok":true,"thread":th}) } @@ -29,7 +30,7 @@ fn s(p: &Value, k: &str, d: &str) -> String { p.get(k).and_then(Value::as_str).u fn nat(p: &Value, k: &str) -> u64 { match p.get(k) { Some(Value::Number(n)) => n.as_u64().unwrap_or(0), Some(Value::String(t)) => t.parse().unwrap_or(0), _ => 0 } } /// pinned threads a project keeps (`thread.pin`) pub const PINS: usize = 2; -fn done(events: Vec<Value>, id: &Value) -> Option<Plan> { Some(Plan { events, reply: ok(id), stop: None, wt: None, scratch: None, act: None }) } +fn done(events: Vec<Value>, id: &Value) -> Option<Plan> { Some(Plan { events, reply: ok(id), stop: None, wt: None, scratch: None, chat: None, act: None }) } /// Merge.found: the events that settle a thread whose branch is merged, once (none when it is not due). pub fn merged(f: &Fold, th: &str, url: &str, at: u64) -> Vec<Value> { let t = f.threads.get(th).cloned().unwrap_or_default(); @@ -123,7 +124,7 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) "thread.settle" | "thread.archive" => { let mut ev = vec![json!({"$":"ThreadSettled","id":th,"manual":true,"at":at})]; if !f.setting(&format!("bg.{th}")).is_empty() { ev.push(json!({"$":"WorkSet","thread":th,"kind":"bg","rows":"","at":at})) } - Some(Plan { events: ev, reply: ok(id), stop: Some(th.clone()), wt: None, scratch: None, act: None }) + Some(Plan { events: ev, reply: ok(id), stop: Some(th.clone()), wt: None, scratch: None, chat: None, act: None }) } "thread.unsettle" => done(vec![json!({"$":"ThreadUnsettled","id":th,"at":at})], id), // a new pin goes to the bottom of the Pinned shelf: a place a drag gave it on an earlier pin is dropped @@ -143,20 +144,20 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) "thread.rename" => { let t = s(p, "title", ""); let t = t.trim(); done(if t.is_empty() || th.is_empty() { vec![] } else { vec![json!({"$":"ThreadRenamed","id":th,"title":t,"at":at}), json!({"$":"SettingSet","key":format!("title.person.{th}"),"value":"1","at":at})] }, id) } // the person's own title: no titler replaces it "thread.delete" => { let stop = Some(th.clone()); // Retire: AgentStop every time, a running turn is interrupted first (see mod.rs) - Some(Plan { events: retire(f, &th, at, json!({"$":"ThreadDeleted","id":th,"at":at}), false), reply: ok(id), stop, wt: None, scratch: None, act: None }) + Some(Plan { events: retire(f, &th, at, json!({"$":"ThreadDeleted","id":th,"at":at}), false), reply: ok(id), stop, wt: None, scratch: None, chat: None, act: None }) } "thread.snooze" => { // "tomorrow" is a server job (the machine's zone): a copy of a log tells the client no (Copy.git.reads), anywhere else it answers {thread} let tomorrow_job = s(p, "for", "") == "tomorrow"; - if tomorrow_job && crate::copy::on() { return Some(Plan { events: vec![], reply: err(id, crate::copy::GIT_TOLD), stop: None, wt: None, scratch: None, act: None }) } + if tomorrow_job && crate::copy::on() { return Some(Plan { events: vec![], reply: err(id, crate::copy::GIT_TOLD), stop: None, wt: None, scratch: None, chat: None, act: None }) } let until = match s(p, "for", "").as_str() { "1h" => at + 3600, "1w" => at + 604800, "off" => 0, "tomorrow" => tomorrow(at), _ => nat(p, "until") }; let reply = if tomorrow_job { json!({"t":"reply","id":id,"ok":true,"result":{"thread":th}}) } else { ok(id) }; - Some(Plan { events: vec![json!({"$":"ThreadSnoozed","id":th,"until":until,"at":at})], reply, stop: None, wt: None, scratch: None, act: None }) + Some(Plan { events: vec![json!({"$":"ThreadSnoozed","id":th,"until":until,"at":at})], reply, stop: None, wt: None, scratch: None, chat: None, act: None }) } // a shelf's new order after a drag: {section: "pinned" | "active", thread: the one moved, ids: the shelf's threads in their new order} "thread.reorder" => { let section = s(p, "section", ""); - if section != "pinned" && section != "active" { return Some(Plan { events: vec![], reply: err(id, "only pinned and active threads reorder"), stop: None, wt: None, scratch: None, act: None }) } + if section != "pinned" && section != "active" { return Some(Plan { events: vec![], reply: err(id, "only pinned and active threads reorder"), stop: None, wt: None, scratch: None, chat: None, act: None }) } let xs: Vec<(String, String)> = p.get("ids").and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str) .map(|i| { let n = f.nav(i); (i.to_string(), if section == "pinned" { n.pinned } else { n.active }) }).collect(); done(key::plan(&xs, &th).into_iter().map(|(i, k)| json!({"$":"ThreadOrdered","id":i,"section":section,"key":k,"at":at})).collect(), id) @@ -176,9 +177,9 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) // Roots.move: a project pointed at its folder's new place; its worktrees under the old root move with it "project.move" => { let pid = s(p, "project", ""); let raw = s(p, "path", ""); let t = raw.trim(); let path = if t.ends_with('/') && t.len() > 1 { &t[..t.len() - 1] } else { t }; - if !crate::plat::fs::is_abs(path) { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, act: None }) } - if pid.contains('~') || pid == "scratch" { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, act: None }) } - let Some(pr) = f.projects.get(&pid).filter(|x| !x.removed) else { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, act: None }) }; + if !crate::plat::fs::is_abs(path) { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, chat: None, act: None }) } + if pid.contains('~') || pid == "scratch" { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, chat: None, act: None }) } + let Some(pr) = f.projects.get(&pid).filter(|x| !x.removed) else { return Some(Plan { events: vec![], reply: err(id, "Type the folder's full path, starting with /"), stop: None, wt: None, scratch: None, chat: None, act: None }) }; let mut ev = vec![json!({"$":"ProjectCreated","id":pid,"title":pr.title,"root":path,"at":at})]; for (tid, t) in &f.threads { if t.project == pid && t.worktree.starts_with(&format!("{}/", pr.root)) { ev.push(json!({"$":"WorktreeSet","id":tid,"branch":t.branch,"worktree":format!("{path}{}", &t.worktree[pr.root.len()..]),"at":at})) } } @@ -189,15 +190,15 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) // Hub.thread_parent: empty parent detaches; the whole new ancestry is checked first "thread.detach" | "thread.reparent" => { let parent = if method == "thread.detach" { String::new() } else { s(p, "parent", "") }; - if !parent_valid(f, &th, &parent) { return Some(Plan { events: vec![], reply: err(id, "Parent must be a live conversation in the same project without a cycle (maximum depth 64)."), stop: None, wt: None, scratch: None, act: None }) } + if !parent_valid(f, &th, &parent) { return Some(Plan { events: vec![], reply: err(id, "Parent must be a live conversation in the same project without a cycle (maximum depth 64)."), stop: None, wt: None, scratch: None, chat: None, act: None }) } let mut ev = vec![json!({"$":"ThreadParentSet","id":th,"parent":parent,"at":at})]; if !parent.is_empty() { ev.push(json!({"$":"SettingSet","key":format!("thread.tree.{parent}"),"value":"1","at":at})) } done(ev, id) } // Todos.edit.rpc: the person's add, delete, move, set on the agent's list; the fold applies it (state/todo.rs `edit`). A new item has no id yet: it gets one the agent will not make. "todos.edit" => { - if th.is_empty() || !f.threads.contains_key(&th) { return Some(Plan { events: vec![], reply: err(id, "No such thread."), stop: None, wt: None, scratch: None, act: None }) } - let op = s(p, "op", ""); if !["add", "delete", "move", "set"].contains(&op.as_str()) { return Some(Plan { events: vec![], reply: err(id, "Unknown to-do edit."), stop: None, wt: None, scratch: None, act: None }) } + if th.is_empty() || !f.threads.contains_key(&th) { return Some(Plan { events: vec![], reply: err(id, "No such thread."), stop: None, wt: None, scratch: None, chat: None, act: None }) } + let op = s(p, "op", ""); if !["add", "delete", "move", "set"].contains(&op.as_str()) { return Some(Plan { events: vec![], reply: err(id, "Unknown to-do edit."), stop: None, wt: None, scratch: None, chat: None, act: None }) } let tid = if op == "add" && s(p, "id", "").is_empty() { format!("u{at}-{}", f.threads.len()) } else { s(p, "id", "") }; let data = json!({"op": op, "id": tid, "text": s(p, "text", ""), "status": s(p, "status", ""), "to": nat(p, "to")}).to_string(); done(vec![json!({"$":"TodosChanged","thread":th,"who":"person","data":data,"at":at})], id) @@ -206,6 +207,7 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) "queue.remove" => done(vec![json!({"$":"QueueRemoved","thread":th,"msg":s(p, "msg", ""),"at":at})], id), "queue.move" => done(vec![json!({"$":"QueueMoved","thread":th,"msg":s(p, "msg", ""),"to":nat(p, "to"),"at":at})], id), "thread.create" => create(f, at, id, p, None, None), + "thread.move_project" => move_project(f, at, id, p, cx), "thread.titled" => { // Title.changes: the writer's title replaces the placeholder only while the thread still has it, and only when there is an answer let (cur, ph) = (f.threads.get(&th).map(|t| t.title.clone()).unwrap_or_default(), s(p, "placeholder", "")); @@ -223,15 +225,15 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) // Queue.steer: a queued message sent now (into the running turn, or as a turn of its own); the agents module runs it "queue.steer" => { let m = s(p, "msg", ""); - let Some((_, text)) = f.queue(&th).iter().find(|(i, _)| *i == m).cloned() else { return Some(Plan { events: vec![], reply: err(id, "no such queued message"), stop: None, wt: None, scratch: None, act: None }) }; - Some(Plan { events: vec![json!({"$":"QueueTakenOne","thread":th,"msg":m,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, act: Some((if running(f, &th) { "steer" } else { "start_one" }, th.clone(), text)) }) + let Some((_, text)) = f.queue(&th).iter().find(|(i, _)| *i == m).cloned() else { return Some(Plan { events: vec![], reply: err(id, "no such queued message"), stop: None, wt: None, scratch: None, chat: None, act: None }) }; + Some(Plan { events: vec![json!({"$":"QueueTakenOne","thread":th,"msg":m,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, chat: None, act: Some((if running(f, &th) { "steer" } else { "start_one" }, th.clone(), text)) }) } // Hub.resume: the held queue of an idle thread (kept across a restart, or after a stop) starts now "queue.resume" => { let ev: Vec<Value> = if f.setting(&format!("thread.config.hold.{th}")) == "on" { vec![json!({"$":"SettingSet","key":format!("thread.config.hold.{th}"),"value":"","at":at})] } else { vec![] }; let go = !running(f, &th) && f.queue(&th).iter().any(|(m, _)| !m.starts_with("handoff:")); let text = f.queue_text(&th); // Queue.texts - Some(Plan { events: ev, reply: ok(id), stop: None, wt: None, scratch: None, act: go.then(|| ("resume", th.clone(), text)) }) + Some(Plan { events: ev, reply: ok(id), stop: None, wt: None, scratch: None, chat: None, act: go.then(|| ("resume", th.clone(), text)) }) } "thread.modes" => modes(f, at, id, p), // the picker's "Plan first, this turn only" (Claude's plan mode for one turn): plan mode now, and `plan.once.<thread>` so the turn's end puts the @@ -267,19 +269,20 @@ fn plan_inner(f: &Fold, at: u64, id: &Value, method: &str, p: &Value, cx: &Ctx) /// Hub.thread_create: a thread of a project, as the person asked; a retry with the same creationKey is the same thread. fn create(f: &Fold, at: u64, id: &Value, p: &Value, new_root: Option<(&str, usize)>, forced_id: Option<&str>) -> Option<Plan> { let project = s(p, "project", ""); let parent = s(p, "parent", ""); let key = s(p, "creationKey", ""); - let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, act: None }); + let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, chat: None, act: None }); let root = new_root.map(|r| r.0.to_string()).unwrap_or_else(|| f.projects.get(&project).map(|x| x.root.clone()).unwrap_or_default()); let scratch = project == "scratch"; + let chat = project == crate::sidebar::CHATS; let n = new_root.map_or(f.n(), |r| r.1); let mut th = forced_id.map(str::to_string).unwrap_or_else(|| hub_id("t", at, n)); if !key.is_empty() { let hex = key.len() == 32 && key.bytes().all(|c| c.is_ascii_digit() || (b'a'..=b'f').contains(&c)); - let live = f.projects.get(&project).map_or(false, |x| !x.removed && !x.root.is_empty()) && !scratch; + let live = f.projects.get(&project).map_or(false, |x| !x.removed && !x.root.is_empty()) && !scratch && !chat; if !(hex && parent.is_empty() && live) { return refuse("Choose an existing project and retry this request.") } th = format!("improvement-{key}"); if f.threads.contains_key(&th) { - return Some(if alive(f, &th) && tree_project(f, &th) == project { Plan { events: vec![], reply: made(id, &th), stop: None, wt: None, scratch: None, act: None } } - else { Plan { events: vec![], reply: err(id, "This request belongs to a different or removed conversation. Open that conversation before retrying."), stop: None, wt: None, scratch: None, act: None } }); + return Some(if alive(f, &th) && tree_project(f, &th) == project { Plan { events: vec![], reply: made(id, &th), stop: None, wt: None, scratch: None, chat: None, act: None } } + else { Plan { events: vec![], reply: err(id, "This request belongs to a different or removed conversation. Open that conversation before retrying."), stop: None, wt: None, scratch: None, chat: None, act: None } }); } } else if !parent.is_empty() && !(alive(f, &parent) && tree_project(f, &parent) == project && chain(f, 63, tree_raw(f, &parent), &parent)) { @@ -288,15 +291,21 @@ fn create(f: &Fold, at: u64, id: &Value, p: &Value, new_root: Option<(&str, usiz // J.Json.get_str: the default when the field is missing or not a string; M.Setting.get keeps a stored "" let gs = |k: &str, d: &str| p.get(k).and_then(Value::as_str).unwrap_or(d).to_string(); let env = gs("env", f.get("thread.env", "auto")); - let title = gs("title", "New thread"); + let title = if chat { + p.get("title").and_then(Value::as_str).map(str::trim).filter(|x| !x.is_empty()).unwrap_or("New chat").to_string() + } else { + gs("title", "New thread") + }; let default_prov = f.default_agent.as_deref().unwrap_or(f.get("agent.provider", "claude")); let explicit_prov = p.get("provider").and_then(Value::as_str); let provider = explicit_prov.unwrap_or(default_prov).to_string(); let default_model = if explicit_prov.is_some_and(|x| x != default_prov) { "" } else { f.get("agent.model", "") }; let raw_model = p.get("model").and_then(Value::as_str).unwrap_or(default_model); let model = crate::settings::models::sanitize_model_now(&provider, raw_model); - let mode = if scratch || env == "local" { "local" } else { "worktree" }; - let wt = if scratch { format!("{root}/{th}") } else { String::new() }; + let mode = if scratch || chat || env == "local" { "local" } else { "worktree" }; + let wt = if scratch { format!("{root}/{th}") } + else if chat { if f.chats_root.is_empty() { format!("chats/{th}") } else { format!("{}/{th}", f.chats_root) } } + else { String::new() }; let mut ev = vec![json!({"$":"ThreadCreated","id":th,"project":project,"title":title,"env":mode,"branch":"","worktree":wt,"provider":provider,"model":model,"at":at})]; ev.extend(account_created(f, &th, &provider, at)); // Accounts.created: the binding follows the thread if !key.is_empty() || parent.is_empty() {} else { @@ -307,8 +316,32 @@ fn create(f: &Fold, at: u64, id: &Value, p: &Value, new_root: Option<(&str, usiz // an Improvements send names its base (a local branch that exists: the handler checked) and its branch; only with a creation key let prefer = { let own = f.get(&format!("worktree.base.{project}"), ""); if own.is_empty() { f.get("worktree.base", "") } else { own } }.to_string(); // the project's default base (a local branch), when no base is asked for let opts = if !key.is_empty() { super::worktree::Opts { base: s(p, "base", ""), branch: super::worktree::sanitize(&s(p, "branch", "")), prefer: if s(p, "base", "").is_empty() { prefer.clone() } else { String::new() } } } else { super::worktree::Opts { prefer, ..Default::default() } }; - let wt = (mode == "worktree" && !scratch).then(|| (th.clone(), root.clone(), env.clone(), String::new(), opts)); - Some(Plan { events: ev, reply: made(id, &th), stop: None, wt, scratch: scratch.then(|| th.clone()), act: None }) + let wt = (mode == "worktree" && !scratch && !chat).then(|| (th.clone(), root.clone(), env.clone(), String::new(), opts)); + Some(Plan { events: ev, reply: made(id, &th), stop: None, wt, scratch: scratch.then(|| th.clone()), chat: chat.then(|| th.clone()), act: None }) +} + +/// Promote a project-free Quick Chat (`project == "chats"`) into an existing project, preserving history and clearing its old chat folder/session. +fn move_project(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx) -> Option<Plan> { + let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, chat: None, act: None }); + let (th, project) = (s(p, "thread", ""), s(p, "project", "")); + let Some(t) = f.threads.get(&th).filter(|t| !t.deleted).cloned() else { return refuse("No such thread.") }; + if t.project != crate::sidebar::CHATS { return refuse("Only project-free chats can be moved to a project.") } + if running(f, &th) { return refuse("Finish or stop the current turn before moving this chat to a project.") } + if project == crate::sidebar::SCRATCH || project == crate::sidebar::CHATS { return refuse("Choose an existing project.") } + let Some(pr) = f.projects.get(&project).filter(|x| !x.removed && !x.root.is_empty()).cloned() else { return refuse("Choose an existing project.") }; + let n = f.n(); + let mut ev = vec![json!({"$":"ThreadProjectSet","id":th,"project":project,"at":at})]; + if !t.session.is_empty() { ev.push(json!({"$":"SessionSet","id":th,"session":"","at":at})); } + for (m, _) in f.queue(&th) { + if m.starts_with("handoff:move:") { ev.push(json!({"$":"QueueRemoved","thread":th,"msg":m,"at":at})); } + } + if !cx.entries.is_empty() { + let why = format!("This chat was moved into the project \"{}\" ({}). Continue here in the project folder; the conversation so far, oldest first:", pr.title, pr.root); + ev.push(json!({"$":"TurnQueued","thread":th,"msg":format!("handoff:move:{n}"),"text":hand_text(&why, &cx.entries, &th),"at":at})); + } + ev.push(json!({"$":"ActivityLogged","thread":th,"act":hub_id("p", at, n),"tone":"info","kind":"project","summary":format!("Moved to {}", pr.title),"at":at})); + let reply = json!({"t":"reply","id":id,"ok":true,"thread":th,"project":project}); + Some(Plan { events: ev, reply, stop: Some(th), wt: None, scratch: None, chat: None, act: None }) } @@ -378,8 +411,8 @@ fn buy_title(f: &Fold, project: &str) -> String { fn buy_recent(th: &str, now: u64) -> bool { th.strip_prefix('t').and_then(|r| r.split('-').next()).and_then(|a| a.parse::<u64>().ok()).map_or(false, |made| now >= made && now - made <= 2) } /// Buy.start: a thread of its own in the source's folder, marked buy.<thread>, started by the person's "Buy it"; the client that asked goes to it. fn buy(f: &Fold, at: u64, id: &Value, src: &str, b: &Buy) -> Option<Plan> { - let no = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, act: None }); - let there = |th: &str| Some(Plan { events: vec![], reply: made(id, th), stop: None, wt: None, scratch: None, act: None }); + let no = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, chat: None, act: None }); + let there = |th: &str| Some(Plan { events: vec![], reply: made(id, th), stop: None, wt: None, scratch: None, chat: None, act: None }); let Some(t) = f.threads.get(src).filter(|t| !t.deleted) else { return no("no such thread") }; if !b.on { return no("Ordering is off: turn it on in Settings to buy") } if b.buying { return there(src) } // a queued click after the client went to its buy thread: it has no Buy of its own @@ -392,18 +425,21 @@ fn buy(f: &Fold, at: u64, id: &Value, src: &str, b: &Buy) -> Option<Plan> { ev.extend(account_created(f, &th, &t.provider, at)); ev.extend(account_forked(f, &th, src, at)); ev.extend([json!({"$":"ModesSet","id":th,"runtime":if t.runtime.is_empty() { "full-access" } else { &t.runtime },"interaction":if t.interaction.is_empty() { "default" } else { &t.interaction },"model":model,"at":at}), json!({"$":"SettingSet","key":format!("buy.{th}"),"value":src,"at":at}), json!({"$":"SettingSet","key":format!("buy.last.{src}"),"value":th,"at":at})]); - Some(Plan { events: ev, reply: made(id, &th), stop: None, wt: None, scratch: None, act: Some(("post", th, "Buy it".to_string())) }) + Some(Plan { events: ev, reply: made(id, &th), stop: None, wt: None, scratch: None, chat: None, act: Some(("post", th, "Buy it".to_string())) }) } fn fork(f: &Fold, at: u64, id: &Value, src: &str, cx: &Ctx) -> Option<Plan> { - let Some(t) = f.threads.get(src) else { return Some(Plan { events: vec![], reply: err(id, "no such thread"), stop: None, wt: None, scratch: None, act: None }) }; + let Some(t) = f.threads.get(src) else { return Some(Plan { events: vec![], reply: err(id, "no such thread"), stop: None, wt: None, scratch: None, chat: None, act: None }) }; let n = f.n(); let th = hub_id("t", at, n); - let scratch = t.project == "scratch"; let root = f.projects.get(&t.project).map(|x| x.root.clone()).unwrap_or_default(); - let env = if scratch || t.worktree.is_empty() { "local" } else { "worktree" }; + let scratch = t.project == "scratch"; let chat = t.project == crate::sidebar::CHATS; let root = f.projects.get(&t.project).map(|x| x.root.clone()).unwrap_or_default(); + let env = if scratch || chat || t.worktree.is_empty() { "local" } else { "worktree" }; let why = format!("This thread is a fork of \"{}\" ({src}). You continue its work from where it stands; its conversation so far, oldest first:", t.title); let model = crate::settings::models::sanitize_model_now(&t.provider, &t.model); + let wt_dir = if scratch { format!("{root}/{th}") } + else if chat { if f.chats_root.is_empty() { format!("chats/{th}") } else { format!("{}/{th}", f.chats_root) } } + else { String::new() }; let mut ev = vec![ - json!({"$":"ThreadCreated","id":th,"project":t.project,"title":format!("Fork: {}", t.title),"env":env,"branch":"","worktree":if scratch { format!("{root}/{th}") } else { String::new() },"provider":t.provider,"model":model,"at":at})]; + json!({"$":"ThreadCreated","id":th,"project":t.project,"title":format!("Fork: {}", t.title),"env":env,"branch":"","worktree":wt_dir,"provider":t.provider,"model":model,"at":at})]; ev.extend(account_created(f, &th, &t.provider, at)); ev.extend([ json!({"$":"ModesSet","id":th,"runtime":if t.runtime.is_empty() { "full-access" } else { &t.runtime },"interaction":if t.interaction.is_empty() { "default" } else { &t.interaction },"model":model,"at":at}), @@ -413,16 +449,16 @@ fn fork(f: &Fold, at: u64, id: &Value, src: &str, cx: &Ctx) -> Option<Plan> { json!({"$":"TurnQueued","thread":th,"msg":format!("handoff:{src}"),"text":hand_text(&why, &cx.entries, src),"at":at}), json!({"$":"ActivityLogged","thread":src,"act":hub_id("k", at, n),"tone":"info","kind":"fork","summary":format!("Forked into \"Fork: {}\"", t.title),"at":at})]); // a fork with no worktree of its own shares the source's folder: it says so - if !scratch && t.worktree.is_empty() { + if !scratch && !chat && t.worktree.is_empty() { ev.push(json!({"$":"ActivityLogged","thread":th,"act":hub_id("g", at, n),"tone":"info","kind":"git","summary":format!("working in the project folder with \"{}\" (no worktree of its own): its edits change the same files", t.title),"at":at})); } - let wt = (!scratch && !t.worktree.is_empty()).then(|| (th.clone(), root, "fork".to_string(), src.to_string(), Default::default())); - Some(Plan { events: ev, reply: made(id, &th), stop: None, wt, scratch: scratch.then(|| th.clone()), act: None }) + let wt = (!scratch && !chat && !t.worktree.is_empty()).then(|| (th.clone(), root, "fork".to_string(), src.to_string(), Default::default())); + Some(Plan { events: ev, reply: made(id, &th), stop: None, wt, scratch: scratch.then(|| th.clone()), chat: chat.then(|| th.clone()), act: None }) } fn back(f: &Fold, at: u64, id: &Value, fork: &str, cx: &Ctx) -> Option<Plan> { let src = f.forks.get(fork).cloned().unwrap_or_default(); - if src.is_empty() { return Some(Plan { events: vec![], reply: err(id, "this thread is not a fork"), stop: None, wt: None, scratch: None, act: None }) } + if src.is_empty() { return Some(Plan { events: vec![], reply: err(id, "this thread is not a fork"), stop: None, wt: None, scratch: None, chat: None, act: None }) } let n = f.n(); let title = |x: &str| f.threads.get(x).map(|t| t.title.clone()).unwrap_or_default(); let why = format!("Work done in a fork of this thread, \"{}\" ({fork}), brought back here. Its files stay on its own branch; what was said and done there, oldest first:", title(fork)); done(vec![ @@ -439,7 +475,7 @@ fn switch(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx, auto: bool) -> Opt // back to the provider the failover order moved it off, with no model named (Nov 11, Bub): the very model the thread asked for there, never the provider's default if model.is_empty() && from != to { let asked = crate::settings::fallback::Target::parse(f.setting(&format!("fallback.intent.{th}"))); if asked.provider == to { model = asked.model } } model = crate::settings::models::sanitize_model_now(&to, &model); - if running(f, &th) { return Some(Plan { events: vec![], reply: err(id, "a provider changes between turns: stop this one first"), stop: None, wt: None, scratch: None, act: None }) } + if running(f, &th) { return Some(Plan { events: vec![], reply: err(id, "a provider changes between turns: stop this one first"), stop: None, wt: None, scratch: None, chat: None, act: None }) } // the same agent: the model and effort it names, if any (a picker that pressed an agent and then a model before it heard the first back asks this way) if from == to { let mut ev = vec![]; @@ -467,7 +503,7 @@ fn switch(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx, auto: bool) -> Opt if !auto { ev.extend(hold(f, &th, at)) } if auto { ev.push(json!({"$":"ActivityLogged","thread":th,"act":hub_id("p", at, n),"tone":"info","kind":"fallback","summary":s(p, "say", ""),"at":at})) } else if count > 0 { ev.push(json!({"$":"ActivityLogged","thread":th,"act":hub_id("p", at, n),"tone":"info","kind":"provider","summary":format!("Now on {to}{}", if missed == 0 { "" } else { "; it gets what it missed with the next message" }),"at":at})) } - Some(Plan { events: ev, reply: ok(id), stop: if waiting { None } else { Some(th.clone()) }, wt: None, scratch: None, act: None }) + Some(Plan { events: ev, reply: ok(id), stop: if waiting { None } else { Some(th.clone()) }, wt: None, scratch: None, chat: None, act: None }) } /// Hub.accounts.select: the thread goes on under another account of its provider from its next message, between turns. The old account's native session and how much @@ -477,7 +513,7 @@ fn switch(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx, auto: bool) -> Opt /// asked, which the tool checks and says with `asked`), "failover" (the driver, past a pin: the pin is where the thread returns) and "return" (the driver, back to where it came from). fn account_select(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx, by: &str) -> Option<Plan> { use crate::settings::accounts as ac; - let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, act: None }); + let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, chat: None, act: None }); let th = s(p, "thread", ""); let th = th.rsplit('|').next().unwrap_or("").to_string(); let profile = s(p, "profile", ""); let epoch = p.get("epoch").and_then(Value::as_u64).unwrap_or(0); let Some(t) = f.threads.get(&th).filter(|t| !t.deleted).cloned() else { return refuse("The thread or account selection changed. Reopen the account menu and try again.") }; if running(f, &th) { return refuse("Finish or stop the current turn before selecting another account.") } @@ -523,7 +559,7 @@ fn account_select(f: &Fold, at: u64, id: &Value, p: &Value, cx: &Ctx, by: &str) let summary = match by { "person" => format!("Selected {name}; conversation context is handed to this account with the next message."), "agent" | "bot" => format!("{} selected {name}; conversation context is handed to this account with the next message.", s(p, "who", "An agent")), _ => said.clone() }; if !summary.is_empty() { ev.push(json!({"$":"ActivityLogged","thread":th,"act":hub_id("account", at, n + 1),"tone":"info","kind":"account","summary":summary,"at":at})) } ev.extend(after); - Some(Plan { events: ev, reply: ok(id), stop: Some(th), wt: None, scratch: None, act: None }) + Some(Plan { events: ev, reply: ok(id), stop: Some(th), wt: None, scratch: None, chat: None, act: None }) } const NO_ACCOUNT: &str = "{\"id\":\"\",\"epoch\":0}"; @@ -549,7 +585,7 @@ pub fn norm_root(r: &str) -> String { /// Hub.project_add (`project.create`): a folder becomes a project once (the same root twice is refused; a removed project's folder brings that /// project back with its threads); a project made afresh starts with a thread, made as thread.create makes one. pub fn project_create(f: &Fold, at: u64, id: &Value, p: &Value, root: &str) -> Plan { - let refuse = |m: String| Plan { events: vec![], reply: err(id, &m), stop: None, wt: None, scratch: None, act: None }; + let refuse = |m: String| Plan { events: vec![], reply: err(id, &m), stop: None, wt: None, scratch: None, chat: None, act: None }; if root.trim().is_empty() { return refuse("no folder given".into()) } let root_n = norm_root(root); if f.projects.values().any(|x| !x.removed && norm_root(&x.root) == root_n) { return refuse(format!("already a project: {root}")) } @@ -560,12 +596,12 @@ pub fn project_create(f: &Fold, at: u64, id: &Value, p: &Value, root: &str) -> P // the removed project comes back as it was: its own name (a rename before it went is kept), unless a title is given now Some(pid) => { let title = if p.get("title").and_then(Value::as_str).is_some() { title } else { f.projects[&pid].title.clone() }; - Plan { events: vec![json!({"$":"ProjectCreated","id":pid,"title":title,"root":root_n,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, act: None } + Plan { events: vec![json!({"$":"ProjectCreated","id":pid,"title":title,"root":root_n,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, chat: None, act: None } } // `starter: false` (a phone, data/1): the project alone; the phone's own New thread screen makes its first thread, so none is left empty None if p.get("starter").and_then(Value::as_bool) == Some(false) => { let pid = hub_id("p", at, n); - Plan { events: vec![json!({"$":"ProjectCreated","id":pid,"title":title,"root":root_n,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, act: None } + Plan { events: vec![json!({"$":"ProjectCreated","id":pid,"title":title,"root":root_n,"at":at})], reply: ok(id), stop: None, wt: None, scratch: None, chat: None, act: None } } None => { let pid = hub_id("p", at, n); @@ -592,7 +628,7 @@ pub fn title_clean(answer: &str) -> String { /// Home.start: one real conversation and its first message, made atomically; the retained message id resolves to the same thread on every retry. fn start(f: &Fold, at: u64, id: &Value, p: &Value) -> Option<Plan> { let (project, msg, text) = (s(p, "project", ""), s(p, "msg", ""), s(p, "text", "")); - let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, act: None }); + let refuse = |m: &str| Some(Plan { events: vec![], reply: err(id, m), stop: None, wt: None, scratch: None, chat: None, act: None }); let live_root = f.projects.get(&project).filter(|x| !x.removed).map_or(false, |x| !x.root.is_empty()); let token = !msg.is_empty() && msg.chars().count() <= 160 && msg.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_'); if !(live_root && token && !text.trim().is_empty()) { return refuse("Choose a project and enter a message before starting a thread.") } @@ -601,7 +637,7 @@ fn start(f: &Fold, at: u64, id: &Value, p: &Value) -> Option<Plan> { let ok = f.threads.get(&th).map_or(false, |t| !t.deleted && t.project == project); // a retry finds the thread made: the message goes in if it never arrived (the hub died, or turn.start failed, between the two) let posted = f.home_msgs.contains(&format!("{th}\u{1}{msg}")); - return if ok { Some(Plan { events: vec![], reply: made(id, &th), stop: None, wt: None, scratch: None, act: (!posted).then(|| ("post", th.clone(), text.clone())) }) } else { refuse("This request belongs to a different or removed conversation. Open that conversation before retrying.") }; + return if ok { Some(Plan { events: vec![], reply: made(id, &th), stop: None, wt: None, scratch: None, chat: None, act: (!posted).then(|| ("post", th.clone(), text.clone())) }) } else { refuse("This request belongs to a different or removed conversation. Open that conversation before retrying.") }; } let title: String = text.chars().take(80).collect(); let mut pl = create(f, at, id, &json!({"project": project, "title": title}), None, Some(&th))?; diff --git a/native/host/src/commands/tests.rs b/native/host/src/commands/tests.rs index d168ebbaea..edd70de84d 100644 --- a/native/host/src/commands/tests.rs +++ b/native/host/src/commands/tests.rs @@ -757,3 +757,58 @@ async fn ask_on(h: &Arc<Hub>, c: &mut crate::hub::Conn, m: &str, p: Value) -> (V assert_eq!(e[0]["provider"], "codex"); assert_eq!(e[0]["model"], "", "fork of persisted codex+opus clears model"); } + +#[tokio::test] async fn quick_chats_create_without_git_and_move_to_project() { + let h = hub("quick-chats").await; + let dest = tmp("qc-dest"); + let dead = tmp("qc-dead"); + h.commit(&json!({"$":"ProjectCreated","id":"pdest","title":"Dest","root":dest.to_str().unwrap(),"at":10})).await.unwrap(); + h.commit(&json!({"$":"ProjectCreated","id":"prem","title":"Dead","root":dead.to_str().unwrap(),"at":11})).await.unwrap(); + h.commit(&json!({"$":"ProjectRemoved","id":"prem","at":12})).await.unwrap(); + + // thread.create {project:"chats"} makes a folder under <home>/chats/<id> with no .git and default title "New chat" + let (e, r) = ask(&h, "thread.create", json!({"project":"chats"})).await; + assert_eq!(r["ok"], true, "{r}"); + let cid = r["thread"].as_str().unwrap().to_string(); + assert_eq!(e[0]["$"], "ThreadCreated"); + assert_eq!(e[0]["project"], "chats"); + assert_eq!(e[0]["title"], "New chat"); + assert_eq!(e[0]["env"], "local"); + let wt = e[0]["worktree"].as_str().unwrap(); + assert!(std::path::Path::new(wt).is_dir(), "chat folder created: {wt}"); + assert!(!std::path::Path::new(wt).join(".git").exists(), "quick chat has no git repo"); + h.commit_many(&e).await.unwrap(); + + // Forking a quick chat keeps it in "chats" with its own gitless folder + let (fe, fr) = ask(&h, "thread.fork", json!({"thread": &cid})).await; + assert_eq!(fr["ok"], true, "{fr}"); + assert_eq!(fe[0]["project"], "chats"); + let fwt = fe[0]["worktree"].as_str().unwrap(); + assert!(std::path::Path::new(fwt).is_dir() && !std::path::Path::new(fwt).join(".git").exists()); + + // Refusals: non-chat thread, missing/removed/sentinel target, running chat + assert_eq!(ask(&h, "thread.move_project", json!({"thread":"t1","project":"pdest"})).await.1["ok"], false); + for bad in ["nope", "prem", "scratch", "chats"] { + assert_eq!(ask(&h, "thread.move_project", json!({"thread": &cid, "project": bad})).await.1["ok"], false, "target {bad}"); + } + h.commit(&json!({"$":"TurnChanged","thread": &cid,"state":"running","at":20})).await.unwrap(); + assert_eq!(ask(&h, "thread.move_project", json!({"thread": &cid, "project": "pdest"})).await.1["ok"], false); + h.commit(&json!({"$":"TurnChanged","thread": &cid,"state":"completed","at":21})).await.unwrap(); + h.commit(&json!({"$":"MessagePosted","thread": &cid,"msg":"m1","role":"user","text":"quick question","at":22})).await.unwrap(); + + // Valid move emits ThreadProjectSet + queued handoff + ActivityLogged + let (me, mr) = ask(&h, "thread.move_project", json!({"thread": &cid, "project": "pdest"})).await; + assert_eq!(mr["ok"], true, "{mr}"); + assert!(me.iter().any(|x| x["$"] == "ThreadProjectSet" && x["id"] == cid && x["project"] == "pdest"), "{me:?}"); + assert!(me.iter().any(|x| x["$"] == "TurnQueued" && x["thread"] == cid && x["msg"].as_str().unwrap_or("").starts_with("handoff:move:")), "{me:?}"); + assert!(me.iter().any(|x| x["$"] == "ActivityLogged" && x["thread"] == cid), "{me:?}"); + + // Client actions: new-thread "chats" and row-move-project + let new_out = super::actions::act(&super::actions::Req { hub: "h", session: &json!({"rid":1}), sel: "", action: "new-thread", value: "chats", title_of: &|_| String::new() }).unwrap(); + let req: Value = serde_json::from_str(new_out.cmds[0]["text"].as_str().unwrap()).unwrap(); + assert_eq!((req["m"].as_str(), &req["p"]), (Some("thread.create"), &json!({"project":"chats","title":"New chat"}))); + + let mv_out = super::actions::act(&super::actions::Req { hub: "h", session: &json!({"rid":2}), sel: "", action: "row-move-project", value: &format!("{cid}\u{1f}pdest"), title_of: &|_| String::new() }).unwrap(); + let mv_req: Value = serde_json::from_str(mv_out.cmds[0]["text"].as_str().unwrap()).unwrap(); + assert_eq!((mv_req["m"].as_str(), &mv_req["p"]), (Some("thread.move_project"), &json!({"thread": cid, "project": "pdest"}))); +} diff --git a/native/host/src/data/ext.rs b/native/host/src/data/ext.rs index 3870015447..de43acde65 100644 --- a/native/host/src/data/ext.rs +++ b/native/host/src/data/ext.rs @@ -21,7 +21,7 @@ //! through (never for a turn's end or an ask by themselves: native/host/src/push), and `{"k":"clear","keys","badge"}` when one is dealt with. use super::*; -pub const FEATURES: &[&str] = &["actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "layers", "onboard", "push", "commands", "work", "star", "accounts", "machines", "history", "devices", "find", "notifysettings", "ring", "threadContext"]; +pub const FEATURES: &[&str] = &["actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "layers", "onboard", "push", "commands", "work", "star", "accounts", "machines", "history", "devices", "find", "notifysettings", "ring", "threadContext", "chats"]; const THREAD_ACTS: &[&str] = &["pin", "unpin", "settle", "unsettle", "archive", "unarchive", "delete", "detach"]; @@ -190,6 +190,16 @@ async fn accounts(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value) -> Result<Va pub async fn call(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value, is_browser: bool) -> Option<Result<Value, Value>> { Some(match m { "thread.act" => thread_act(hub, c, p).await, + "thread.move_project" => { + let (th, proj) = (s(p, "thread"), s(p, "project")); + if th.is_empty() || proj.is_empty() { Err(err("thread and project")) } else { + match rpc(hub, c, "thread.move_project", json!({"thread":th,"project":proj})).await { + Ok(_) => thread_now(hub, th).await.map(|t| json!({"thread":t})), + Err(e) => Err(e), + } + } + } + "chats.list" => chats(hub, p).await, "device.register" | "device.drop" | "device.prefs" | "push.seen" => rpc(hub, c, m, p.clone()).await.map(|_| json!({})), "push.state" => rpc(hub, c, m, p.clone()).await.map(|r| r["result"].clone()), "push.prefs" => { @@ -446,10 +456,13 @@ async fn thread_act(hub: &Arc<Hub>, c: &mut Conn, p: &Value) -> Result<Value, Va // under another thread of its project; the hub's own check refuses a cycle, another project or a dead parent if s(p, "parent").is_empty() { return Err(err("parent")) } rpc(hub, c, "thread.reparent", json!({"thread":th,"parent":s(p, "parent")})).await?; + } else if act == "move_project" { + if s(p, "project").is_empty() { return Err(err("project")) } + rpc(hub, c, "thread.move_project", json!({"thread":th,"project":s(p, "project")})).await?; } else if THREAD_ACTS.contains(&act) { rpc(hub, c, &format!("thread.{act}"), json!({"thread":th})).await?; if act == "delete" { return Ok(json!({})) } - } else { return Err(err("action: pin, unpin, settle, unsettle, archive, unarchive, delete, detach, reparent, rename or fork")) } + } else { return Err(err("action: pin, unpin, settle, unsettle, archive, unarchive, delete, detach, reparent, rename, fork or move_project")) } thread_now(hub, th).await.map(|t| json!({"thread":t})) } @@ -457,7 +470,7 @@ async fn search(hub: &Arc<Hub>, p: &Value) -> Result<Value, Value> { let q = s(p, "q").trim().to_lowercase(); let lim = limit_of(p, 30, 100); let arch = p["archived"] == true; if q.is_empty() { return Ok(json!({"threads":[],"projects":[]})) } let g = hub.model().await; let asks = open_ask_counts(hub); - let mut ts: Vec<(u64, String)> = g.threads.iter().filter(|(i, t)| !t.deleted && !run_hidden(i) && (arch || !t.archived) && (contains(&t.title, &q) || (t.project != crate::sidebar::SCRATCH && g.projects.get(&t.project).map_or(false, |x| contains(&x.title, &q))))).map(|(i, t)| (ms(t.activity.max(t.created)), i.clone())).collect(); + let mut ts: Vec<(u64, String)> = g.threads.iter().filter(|(i, t)| !t.deleted && !run_hidden(i) && (arch || !t.archived) && (contains(&t.title, &q) || (t.project != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(&t.project) && g.projects.get(&t.project).map_or(false, |x| contains(&x.title, &q))))).map(|(i, t)| (ms(t.activity.max(t.created)), i.clone())).collect(); ts.sort_by(|a, b| b.0.cmp(&a.0).then(a.1.cmp(&b.1))); ts.truncate(lim); let threads: Vec<Value> = ts.iter().filter_map(|(_, i)| thread_json(hub, &g, i, &asks)).collect(); let mut ps: Vec<(u64, String)> = g.projects.iter().filter(|(_, x)| !x.removed && (contains(&x.title, &q) || contains(&x.root, &q))).map(|(i, _)| (0, i.clone())).collect(); ps.truncate(lim); @@ -489,6 +502,21 @@ async fn history(hub: &Arc<Hub>, p: &Value) -> Result<Value, Value> { Ok(json!({"live":live,"threads":threads,"next":next,"count":count})) } +/// `chats.list {q?, settled?, limit?=50, before?}` → `{threads, next, count}`: project-free quick chats (`project == "chats"`). +async fn chats(hub: &Arc<Hub>, p: &Value) -> Result<Value, Value> { + let (q, lim) = (s(p, "q").trim().to_string(), limit_of(p, 50, 200)); + let want = p.get("settled").and_then(Value::as_bool); + let g = hub.model().await; let asks = open_ask_counts(hub); + let count = g.threads.iter().filter(|(i, t)| crate::sidebar::is_chats(&t.project) && !t.deleted && !t.archived && !run_hidden(i)).count(); + let rows: Vec<(u64, String, Value)> = g.threads.iter() + .filter(|(i, t)| crate::sidebar::is_chats(&t.project) && !t.deleted && !t.archived && !run_hidden(i)) + .filter(|(i, t)| (q.is_empty() || crate::sidebar::word_hit(&t.title, &q)) && want.map_or(true, |w| flags_of(i).1 == w)) + .filter_map(|(i, _)| thread_json(hub, &g, i, &asks).map(|v| (v["updatedAt"].as_u64().unwrap_or(0), i.clone(), v))) + .collect(); + let (threads, next) = page_of(rows, lim, s(p, "before")); + Ok(json!({"threads":threads,"next":next,"count":count})) +} + async fn mentions(hub: &Arc<Hub>, p: &Value) -> Result<Value, Value> { let q = s(p, "q").trim().to_lowercase(); let kind = s(p, "kind"); let lim = limit_of(p, 12, 50); let want = |k: &str| kind.is_empty() || kind == k; @@ -504,9 +532,9 @@ async fn mentions(hub: &Arc<Hub>, p: &Value) -> Result<Value, Value> { let mut seen: HashMap<String, usize> = HashMap::new(); for (i, t) in g.threads.iter().filter(|(i, t)| !t.deleted && !run_hidden(i)) { *seen.entry(slug(&t.title)).or_default() += 1 } let mut ts: Vec<_> = g.threads.iter().filter(|(i, t)| !t.deleted && !run_hidden(i) && !t.archived && !slug(&t.title).is_empty()).collect(); ts.sort_by(|a, b| b.1.activity.cmp(&a.1.activity)); for (i, t) in ts.into_iter().take(200) { let w = slug(&t.title); let w = if seen.get(&w).copied().unwrap_or(0) > 1 { format!("{w}-{}", i.rsplit('-').next().unwrap_or("")) } else { w }; - push(">", i, &t.title, g.projects.get(&t.project).map_or("", |x| x.title.as_str()), format!(">{w}")) } + push(">", i, &t.title, if crate::sidebar::is_chats(&t.project) { crate::sidebar::CHATS_TITLE } else { g.projects.get(&t.project).map_or("", |x| x.title.as_str()) }, format!(">{w}")) } } - if want("%") { for (i, x) in g.projects.iter().filter(|(i, x)| !x.removed && i.as_str() != crate::sidebar::SCRATCH) { push("%", i, &x.title, &x.root, format!("%{}", slug(&x.title))) } } + if want("%") { for (i, x) in g.projects.iter().filter(|(i, x)| !x.removed && i.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(i)) { push("%", i, &x.title, &x.root, format!("%{}", slug(&x.title))) } } } if want("&") { let all: Value = serde_json::from_str(&crate::settings::models::all()).unwrap_or(json!({})); @@ -626,14 +654,19 @@ async fn viewers(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value, is_browser: b let (mut items, has) = if machines::is_far(th) { machines::far_root(hub, th).ok_or_else(|| err("that thread has no folder"))?; ( - rail(RailInput { board: true, schematic: true, mech: true, gerbers: false, simulation: false, altium: false, page, diff, present: &[] }), + rail(RailInput { board: true, schematic: true, mech: true, gerbers: false, simulation: false, altium: false, page, diff, no_project: false, present: &[] }), json!({"board": true, "schematic": true, "mech": true, "gerbers": false}), ) + } else if hub.model().await.threads.get(th).is_some_and(|t| crate::sidebar::is_chats(&t.project)) { + ( + rail(RailInput { board: false, schematic: false, mech: false, gerbers: false, simulation: false, altium: false, page, diff: false, no_project: true, present: &[] }), + json!({"board": false, "schematic": false, "mech": false, "gerbers": false}), + ) } else { let root = crate::files::kicad::canonical::design_root(&root_of(hub, th).await?); let src = crate::present::viewer::rail_sources(&root); ( - rail(RailInput { board: src.board, schematic: src.schematic, mech: src.mech, gerbers: src.gerbers, simulation: false, altium: src.altium, page, diff, present: &[] }), + rail(RailInput { board: src.board, schematic: src.schematic, mech: src.mech, gerbers: src.gerbers, simulation: false, altium: src.altium, page, diff, no_project: false, present: &[] }), json!({"board": src.board, "schematic": src.schematic, "mech": src.mech, "gerbers": src.gerbers}), ) }; diff --git a/native/host/src/data/machines.rs b/native/host/src/data/machines.rs index a17e5eff79..d8c92c5941 100644 --- a/native/host/src/data/machines.rs +++ b/native/host/src/data/machines.rs @@ -146,7 +146,7 @@ pub fn thread_keys(far: &Far, pick: &str, join: &HashMap<String, String>, projec let mut out = vec![]; for (_, st) in shown_far(far, pick) { for (id, t) in &st.threads { - if t.deleted || st.run_hidden(id) || t.archived != archived || t.project == crate::sidebar::SCRATCH { continue } + if t.deleted || st.run_hidden(id) || t.archived != archived || t.project == crate::sidebar::SCRATCH || crate::sidebar::is_chats(&t.project) { continue } let shown = project_shown(&t.project, join); if !project.is_empty() && shown != project && t.project != project { continue } let (_, settled, at) = super::shelf_flags(t); @@ -165,7 +165,7 @@ pub fn project_rows(far: &Far, pick: &str, join: &HashMap<String, String>, un: & for (m, st) in shown_far(far, pick) { let mark = un.marks.get(m).cloned().unwrap_or_else(|| crate::mirror::mark_of(m, false)); for id in st.projects.keys() { - if id == crate::sidebar::SCRATCH || join.contains_key(id) { continue } + if id == crate::sidebar::SCRATCH || crate::sidebar::is_chats(id) || join.contains_key(id) { continue } // (a copy in no merged row waits for its machine's origin, present/merged.rs: not listed until it is known) if !un.rows.is_empty() && !un.rows.contains_key(id) { continue } if let Some(v) = project_json(id, st, &mark, un, m) { out.push((v["updatedAt"].as_u64().unwrap_or(0), id.clone(), v)) } diff --git a/native/host/src/data/mod.rs b/native/host/src/data/mod.rs index f367ac1a0c..5f680f0f4b 100644 --- a/native/host/src/data/mod.rs +++ b/native/host/src/data/mod.rs @@ -24,7 +24,7 @@ use tokio_tungstenite::tungstenite::{protocol::WebSocketConfig, Message}; pub const PROTO: &str = "data/1"; /// What this hub does beyond the base of data/1; a hub from before an addition does not list it (the app can warn instead of sending what would be dropped). -pub const FEATURES: &[&str] = &["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes"]; +pub const FEATURES: &[&str] = &["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes", "chats"]; const PREVIEW: usize = 140; const ASK_SCAN: usize = 4000; @@ -167,7 +167,7 @@ fn thread_json(hub: &Hub, m: &crate::model::Model, id: &str, asks: &HashMap<Stri // the picker's title says it all) let chip = combo["short"].as_str().filter(|c| !c.is_empty()).map(str::to_string).unwrap_or_else(|| ext::chip(&t.provider, &model, &effort)); let mut row = json!({"id":id,"project":t.project,"title":t.title,"state":state,"updatedAt":ms(t.activity.max(t.created)),"pinned":pinned,"pinOrder":pin_order,"settled":settled,"settledAt":settled_at,"archived":t.archived, - "provider":t.provider,"model":model,"effort":effort,"speed":setting_of(&format!("speed.{id}")),"runtime":runtime,"chip":chip,"preview":preview,"waiting":waiting,"status":status,"parent":setting_of(&format!("thread.parent.{id}")),"history":t.project == crate::sidebar::SCRATCH,"swarm":swarm, + "provider":t.provider,"model":model,"effort":effort,"speed":setting_of(&format!("speed.{id}")),"runtime":runtime,"chip":chip,"preview":preview,"waiting":waiting,"status":status,"parent":setting_of(&format!("thread.parent.{id}")),"history":t.project == crate::sidebar::SCRATCH,"chat":t.project == crate::sidebar::CHATS,"swarm":swarm, // infinite context (bots/recall/progress.rs): how far its memory is written, the composer's bar; null for a thread without it "memory":crate::bots::recall::progress::shown(&hub.cfg.home, id).unwrap_or(Value::Null)}); if !plan_mode.is_null() && plan_mode["phase"] != "off" { row["planMode"] = plan_mode; } @@ -179,7 +179,7 @@ fn run_hidden(thread: &str) -> bool { } fn project_json(m: &crate::model::Model, id: &str, asks: &HashMap<String, u64>) -> Option<Value> { let settled = m.threads.iter().filter(|(i, t)| t.project == id && !t.deleted && !t.archived && !run_hidden(i) && flags_of(i).1).count(); - if id == crate::sidebar::SCRATCH { return None } // Conversation history (`history.list`), not a project to start a thread in + if id == crate::sidebar::SCRATCH || crate::sidebar::is_chats(id) { return None } // Conversation history (`history.list`) or Quick chats, not a project to start a thread in let p = m.projects.get(id).filter(|p| !p.removed)?; let ts: Vec<_> = m.threads.iter().filter(|(i, t)| t.project == id && !t.deleted && !run_hidden(i)).collect(); let count = ts.iter().filter(|(_, t)| !t.archived).count(); @@ -609,7 +609,7 @@ async fn call(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value, is_browser: bool pol.with_state(|st| crate::present::merged::merged_of(st, hub.mirrors(), |rows| { let c = crate::present::sections::Ctx { hub: "", now, query: &q, open: &open, selected: "" }; let mut v = json!({"sections": crate::present::sections::build(st, &rows, &Value::Null, &c), "groupsTo": crate::present::sections::move_targets(st, &rows)}); - if p["jump"] == true { v["jump"] = crate::present::sections::jump(&rows, &c); } + if p["jump"] == true { v["jump"] = crate::present::sections::jump(st, &rows, &c); } if !key.is_empty() { v["page"] = crate::present::sections::page(st, &rows, &key, &c, done); } v })).ok_or_else(|| err("state is starting")) @@ -626,6 +626,13 @@ async fn call(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value, is_browser: bool rpc(hub, c, "thread.snooze", json!({"thread":th,"for":span})).await?; return Ok(json!({})) } + if a == "row-move-project" { + let (raw_th, proj) = v.split_once('\u{1f}').unwrap_or(("", "")); + let th = raw_th.rsplit('|').next().unwrap_or(raw_th); + if th.is_empty() || proj.is_empty() { return Err(err("value: <thread>\u{1f}<project>")) } + rpc(hub, c, "thread.move_project", json!({"thread":th,"project":proj})).await?; + return Ok(json!({})) + } // `project-page` <key>: the person opened a project's page on this client, a visit (the bench orders by it; at most one write in ten minutes) if !matches!(a, "project-pin" | "project-fold" | "thread-hide" | "swarm-settle" | "group-rename" | "group-move" | "project-archive" | "project-page") { return Err(err("no such action")) } let Some(pol) = crate::statehost::policies() else { return Err(err("state is starting")) }; @@ -700,6 +707,7 @@ async fn call(hub: &Arc<Hub>, c: &mut Conn, m: &str, p: &Value, is_browser: bool if has_text && far_proj { q["preflightSend"] = json!(true); } if !s(p, "env").is_empty() { if !matches!(s(p, "env"), "auto" | "worktree" | "local") { return Err(err("env: auto, worktree or local")) } q["env"] = p["env"].clone() } for k in ["title", "provider", "model"] { if !s(p, k).is_empty() { q[k] = p[k].clone() } } + if project == crate::sidebar::CHATS && s(p, "title").is_empty() { q["title"] = json!("New chat"); } let r = rpc(hub, c, "thread.create", q).await?; let id = r["thread"].as_str().unwrap_or("").to_string(); if id.is_empty() { return Err(err("no thread was made")) } let far = machines::is_far(&id); @@ -787,7 +795,7 @@ async fn deltas(hub: &Hub, lines: &[String], subs: &mut Subs) -> Vec<Value> { for l in lines { let Ok(e) = serde_json::from_str::<Value>(l) else { continue }; let opened = if s(&e, "$") == "AskClosed" { ask_opened(hub, s(&e, "id")) } else { None }; - let th = if matches!(s(&e, "$"), "ThreadCreated" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadMerged" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" | "ProviderSet" | "ModesSet" | "ThreadDeleted") { s(&e, "id") } else if let Some(o) = &opened { s(o, "thread") } else { s(&e, "thread") }.to_string(); + let th = if matches!(s(&e, "$"), "ThreadCreated" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadMerged" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" | "ThreadProjectSet" | "ProviderSet" | "ModesSet" | "ThreadDeleted") { s(&e, "id") } else if let Some(o) = &opened { s(o, "thread") } else { s(&e, "thread") }.to_string(); let mut entry: Option<Value> = None; // a subagent's view moves with its own log line, and with its thread's background rows and turn if s(&e, "$") == "ActivityLogged" { if let Some(of) = th.strip_prefix("@sub:") { for (sub, k) in subs.sub_views(of, Some(s(&e, "tone"))) { if !viewed.contains(&(sub, of.to_string(), k.clone())) { viewed.push((sub, of.to_string(), k)) } } } } diff --git a/native/host/src/data/tests.rs b/native/host/src/data/tests.rs index 9c44dffec5..120096dbad 100644 --- a/native/host/src/data/tests.rs +++ b/native/host/src/data/tests.rs @@ -8,7 +8,7 @@ use tokio_tungstenite::connect_async; struct Fake(Arc<Hub>); impl RpcHandler for Fake { - fn methods(&self) -> &'static [&'static str] { &["project.add", "project.new", "thread.create", "thread.modes", "thread.effort", "thread.provider", "ask.answer", "turn.interrupt", "thread.pin", "thread.rename", "thread.detach", "setting.set", "thread.review", "thread.snooze"] } + fn methods(&self) -> &'static [&'static str] { &["project.add", "project.new", "thread.create", "thread.move_project", "thread.modes", "thread.effort", "thread.provider", "ask.answer", "turn.interrupt", "thread.pin", "thread.rename", "thread.detach", "setting.set", "thread.review", "thread.snooze"] } fn call<'a>(&'a self, h: &'a Arc<Hub>, _w: &'a Caller, id: &'a Value, m: &'a str, p: &'a Value) -> Fut<'a, Vec<Value>> { Box::pin(async move { let _ = &self.0; let at = now_ms() / 1000; @@ -16,6 +16,7 @@ impl RpcHandler for Fake { match m { "project.add" => { let root = s(p, "path"); h.commit(&json!({"$":"ProjectCreated","id":format!("p{n}"),"title":root.rsplit('/').next().unwrap_or(""),"root":root,"at":at})).await.unwrap(); vec![json!({"t":"reply","id":id,"ok":true})] } "thread.create" => { let t = format!("t{n}"); h.commit(&json!({"$":"ThreadCreated","id":t,"project":s(p,"project"),"title":if s(p,"title").is_empty(){"New thread"}else{s(p,"title")},"env":if s(p,"env").is_empty(){"(setting)"}else{s(p,"env")},"branch":"","worktree":"","provider":"claude","model":"","at":at})).await.unwrap(); vec![json!({"t":"reply","id":id,"ok":true,"thread":t})] } + "thread.move_project" => { h.commit(&json!({"$":"ThreadProjectSet","id":s(p,"thread"),"project":s(p,"project"),"at":at})).await.unwrap(); vec![json!({"t":"reply","id":id,"ok":true})] } // /project's request: a folder named "full" holds something, any other is made with its first thread "project.new" => if s(p, "path") == "full" { vec![json!({"t":"reply","id":id,"ok":false,"error":"/h/full is there and is not empty.","result":{"error":"/h/full is there and is not empty.","exists":"/h/full"}})] } else { assert_eq!(p["empty"], true); vec![json!({"t":"reply","id":id,"ok":true,"thread":format!("made-{}", s(p, "text").len())})] }, @@ -69,10 +70,10 @@ async fn ask(ws: &mut Ws, id: u64, m: &str, p: Value) -> Value { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn data_hello_capabilities_and_both_encodings() { - assert_eq!(crate::hub::capabilities()["data"]["proto"], "data/1"); assert_eq!(crate::hub::capabilities()["data"]["features"], json!(["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes"])); + assert_eq!(crate::hub::capabilities()["data"]["proto"], "data/1"); assert_eq!(crate::hub::capabilities()["data"]["features"], json!(["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes", "chats"])); let (_h, port) = up("hello").await; let mut ws = open(port, "&enc=json").await; let v = next(&mut ws).await; - assert_eq!((v["t"].as_str(), v["proto"].as_str()), (Some("hello"), Some("data/1"))); assert_eq!(v["hub"], format!("127.0.0.1:{port}"), "the hub as asked (the Host header)"); assert!(v["name"].is_string(), "the machine's name: {v}"); assert_eq!(v["features"], json!(["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes"]), "a hub from before images does not list it"); assert!(v["now"].as_u64().unwrap() > 1_600_000_000_000); + assert_eq!((v["t"].as_str(), v["proto"].as_str()), (Some("hello"), Some("data/1"))); assert_eq!(v["hub"], format!("127.0.0.1:{port}"), "the hub as asked (the Host header)"); assert!(v["name"].is_string(), "the machine's name: {v}"); assert_eq!(v["features"], json!(["images", "actions", "search", "models", "mentions", "bots", "notify", "viewers", "files", "browser", "diff", "review", "fold", "picker", "voice", "order", "layers", "onboard", "push", "settled", "commands", "work", "star", "accounts", "machines", "history", "terms", "links", "devices", "queue", "buy", "status", "subview", "find", "notifysettings", "ring", "hubOffer", "swarm", "sections", "telemetryNotice", "mcpsettings", "fabprofile", "plan", "mgmt", "replyImages", "cats", "projectcard", "termChat", "copy", "reviewmode", "rail", "gerbers", "follow", "unanswered", "browserstart", "restarting", "fileLinks", "layout", "clone", "reply", "deflate", "open", "shell", "home", "fork", "blobs", "keptChunks", "threadContext", "noProvider", "projecthome", "ringnotes", "chats"]), "a hub from before images does not list it"); assert!(v["now"].as_u64().unwrap() > 1_600_000_000_000); // the default is binary CBOR with plain string keys let mut c = open(port, "").await; let m = tokio::time::timeout(Duration::from_secs(5), c.next()).await.unwrap().unwrap().unwrap(); let Message::Binary(b) = m else { panic!("binary") }; assert!(b.windows(5).any(|w| w == b"proto"), "plain keys, not the hub's dictionary"); @@ -918,7 +919,7 @@ async fn viewer_rail_returns_hub_rail_for_local_and_far_threads() { assert_eq!(r["result"]["mode"], "viewer"); let expected_local = serde_json::to_value(rail(RailInput { board: src.board, schematic: src.schematic, mech: src.mech, gerbers: src.gerbers, - simulation: false, altium: src.altium, page: "files", diff: false, present: &[], + simulation: false, altium: src.altium, page: "files", diff: false, no_project: false, present: &[], })).unwrap(); assert_eq!(r["result"]["rail"], expected_local); assert_eq!(r["result"]["has"], json!({"board": src.board, "schematic": src.schematic, "mech": src.mech, "gerbers": src.gerbers})); @@ -933,7 +934,7 @@ async fn viewer_rail_returns_hub_rail_for_local_and_far_threads() { assert_eq!(rd["ok"], true); let expected_diff = serde_json::to_value(rail(RailInput { board: src.board, schematic: src.schematic, mech: src.mech, gerbers: src.gerbers, - simulation: false, altium: src.altium, page: "files", diff: true, present: &[], + simulation: false, altium: src.altium, page: "files", diff: true, no_project: false, present: &[], })).unwrap(); assert_eq!(rd["result"]["rail"], expected_diff); @@ -943,7 +944,7 @@ async fn viewer_rail_returns_hub_rail_for_local_and_far_threads() { assert_eq!(rf["result"]["mode"], "viewer"); let expected_far = serde_json::to_value(rail(RailInput { board: true, schematic: true, mech: true, gerbers: false, - simulation: false, altium: false, page: "board", diff: false, present: &[], + simulation: false, altium: false, page: "board", diff: false, no_project: false, present: &[], })).unwrap(); assert_eq!(rf["result"]["rail"], expected_far); assert_eq!(rf["result"]["has"], json!({"board": true, "schematic": true, "mech": true, "gerbers": false})); @@ -1701,3 +1702,56 @@ fn probed_models(installed: &[&str]) -> Value { let r5 = ask(&mut ws, 5, "link.resolve", json!({"url": format!("file://{}/secret.pdf", outside.to_string_lossy()), "thread": "bot_th"})).await; assert_eq!(r5["result"]["kind"], "none", "{r5}"); } + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn quick_chats_over_data_create_list_rail_and_move_to_project() { + let (_h, port) = up("chats-data").await; + let mut ws = open(port, "&enc=json").await; + let hello = next(&mut ws).await; + assert!(hello["features"].as_array().unwrap().contains(&json!("chats")), "{hello}"); + + // Scratch remains closed + let sr = ask(&mut ws, 1, "thread.create", json!({"project":"scratch","text":"hi"})).await; + assert_eq!(sr["error"], super::SCRATCH_CLOSED); + + // Quick chat creation over data/1 + let r = ask(&mut ws, 2, "thread.create", json!({"project":"chats"})).await; + assert_eq!(r["ok"], true, "{r}"); + let cid = r["result"]["thread"]["id"].as_str().unwrap().to_string(); + assert_eq!((r["result"]["thread"]["project"].as_str(), r["result"]["thread"]["chat"].as_bool(), r["result"]["thread"]["history"].as_bool(), r["result"]["thread"]["title"].as_str()), + (Some("chats"), Some(true), Some(false), Some("New chat"))); + + // Excluded from projects.list and mentions.list(%), included in threads.list and chats.list + let ps = ask(&mut ws, 3, "projects.list", json!({})).await; + assert!(!ps["result"]["projects"].as_array().unwrap().iter().any(|p| p["id"] == "chats")); + let mp = ask(&mut ws, 17, "mentions.list", json!({"kind":"%"})).await; + assert!(!mp["result"]["items"].as_array().unwrap().iter().any(|x| x["id"] == "chats")); + let mt = ask(&mut ws, 18, "mentions.list", json!({"kind":">","q":"New"})).await; + assert!(mt["result"]["items"].as_array().unwrap().iter().any(|x| x["id"] == cid && x["detail"] == "Chats")); + let ts = ask(&mut ws, 4, "threads.list", json!({})).await; + assert!(ts["result"]["threads"].as_array().unwrap().iter().any(|t| t["id"] == cid)); + let cs = ask(&mut ws, 5, "chats.list", json!({})).await; + assert_eq!(cs["result"]["count"], 1); + assert_eq!(cs["result"]["threads"][0]["id"], cid); + assert_eq!(ask(&mut ws, 6, "chats.list", json!({"q":"new"})).await["result"]["threads"].as_array().unwrap().len(), 1); + assert_eq!(ask(&mut ws, 7, "chats.list", json!({"q":"nomatch"})).await["result"]["threads"].as_array().unwrap().len(), 0); + assert_eq!(ask(&mut ws, 8, "chats.list", json!({"settled":true})).await["result"]["threads"].as_array().unwrap().len(), 0); + + // viewer.rail for a quick chat exposes only non-project tools + let vr = ask(&mut ws, 10, "viewer.rail", json!({"thread": &cid, "page": "files"})).await; + assert_eq!(vr["ok"], true, "{vr}"); + let rids: Vec<_> = vr["result"]["rail"].as_array().unwrap().iter().map(|x| x["id"].as_str().unwrap()).collect(); + assert_eq!(rids, ["files", "browser", "terminal", "commands"]); + + // thread.move_project moves the chat into p1 + let mv = ask(&mut ws, 11, "thread.move_project", json!({"thread": &cid, "project": "p1"})).await; + assert_eq!(mv["ok"], true, "{mv}"); + assert_eq!((mv["result"]["thread"]["project"].as_str(), mv["result"]["thread"]["chat"].as_bool()), (Some("p1"), Some(false))); + assert_eq!(ask(&mut ws, 12, "chats.list", json!({})).await["result"]["count"], 0); + + // sidebar.act "row-move-project" works too + let r2 = ask(&mut ws, 14, "thread.create", json!({"project":"chats","title":"Second"})).await; + let cid2 = r2["result"]["thread"]["id"].as_str().unwrap().to_string(); + let act = ask(&mut ws, 15, "sidebar.act", json!({"action":"row-move-project","value":format!("{cid2}\u{1f}p1")})).await; + assert_eq!(act["ok"], true, "{act}"); + assert_eq!(ask(&mut ws, 16, "chats.list", json!({})).await["result"]["count"], 0); +} diff --git a/native/host/src/data/webpolicy.rs b/native/host/src/data/webpolicy.rs index 42f4af94d0..edfd854202 100644 --- a/native/host/src/data/webpolicy.rs +++ b/native/host/src/data/webpolicy.rs @@ -50,6 +50,7 @@ fn classify(method: &str, params: &Value) -> Option<Policy> { | "thread.context.mcp" | "thread.create" | "thread.model" + | "thread.move_project" | "thread.planonce" | "thread.review" | "plan.approve" @@ -84,6 +85,7 @@ fn classify(method: &str, params: &Value) -> Option<Policy> { | "clone.dest" | "fab.profile" | "files.entries" + | "chats.list" | "history.list" | "improvements.project" | "improvements.projects" diff --git a/native/host/src/files/threadpath.rs b/native/host/src/files/threadpath.rs index 181252c895..17e64c6bc7 100644 --- a/native/host/src/files/threadpath.rs +++ b/native/host/src/files/threadpath.rs @@ -27,7 +27,7 @@ pub fn resolve<'a>(id: &str, thread: impl Fn(&str) -> Option<T<'a>>, project: im if id.is_empty() { return None } let t = thread(id)?; if t.deleted { return None } - if t.project.is_empty() { return folder(t.worktree) } + if t.project.is_empty() || t.project == crate::sidebar::CHATS { return folder(t.worktree) } let root = proj(t.project)?; if t.worktree.is_empty() { Some(root) } else { folder(t.worktree) } } @@ -53,7 +53,7 @@ mod tests { } fn world() -> World { World { threads: vec![("t1", "p1", "", false), ("wt", "p1", "/p/.backplane/worktrees/w", false), ("gone", "p1", "", true), ("rm", "p2", "", false), ("badwt", "p1", "relative/wt", false), - ("priv", "", "/priv", false), ("privrel", "", "rel", false), ("privempty", "", "", false), ("badroot", "p3", "", false), ("nul", "p4", "", false)], + ("priv", "", "/priv", false), ("chat1", crate::sidebar::CHATS, "/home/u/chats/chat1", false), ("privrel", "", "rel", false), ("privempty", "", "", false), ("badroot", "p3", "", false), ("nul", "p4", "", false)], projects: vec![("p1", "/p", false), ("p2", "/q", true), ("p3", "", false), ("p4", "/a\0b", false), ("p5", "/five", false)] } } // law thread_folder_refuses_job: when the folder does not resolve, no job is scheduled whatever the job, thread or arguments #[test] fn thread_folder_refuses_job() { @@ -70,7 +70,7 @@ mod tests { } } // what does resolve: a thread of a live project, its worktree, an archived thread (not a deleted one), a private thread's own folder, a project home - for (id, root) in [("t1", "/p"), ("wt", "/p/.backplane/worktrees/w"), ("priv", "/priv"), ("project-home-p1", "/p"), ("project-home-p5", "/five")] { assert_eq!(at(&w, id).as_deref(), Some(root), "{id}") } + for (id, root) in [("t1", "/p"), ("wt", "/p/.backplane/worktrees/w"), ("priv", "/priv"), ("chat1", "/home/u/chats/chat1"), ("project-home-p1", "/p"), ("project-home-p5", "/five")] { assert_eq!(at(&w, id).as_deref(), Some(root), "{id}") } let ran = Cell::new(false); assert_eq!(job(at(&w, "t1"), &json!(1), |r| { ran.set(true); r }).unwrap(), "/p"); assert!(ran.get()); } #[test] fn absolute_folders_only() { diff --git a/native/host/src/import014/plan.rs b/native/host/src/import014/plan.rs index 3585165465..3ba2588cce 100644 --- a/native/host/src/import014/plan.rs +++ b/native/host/src/import014/plan.rs @@ -84,7 +84,7 @@ pub fn fld<'a>(line: &'a str, key: &str) -> &'a str { /// Events about one thread, by the field that names it. fn thread_key(t: &str) -> Option<&'static str> { Some(match t { - "ThreadCreated" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadArchived" | "ThreadPinned" | "ThreadSnoozed" | "ThreadOrdered" | "WorktreeSet" | "WorktreeRemoved" + "ThreadCreated" | "ThreadRenamed" | "ThreadProjectSet" | "ThreadSettled" | "ThreadUnsettled" | "ThreadArchived" | "ThreadPinned" | "ThreadSnoozed" | "ThreadOrdered" | "WorktreeSet" | "WorktreeRemoved" | "WorktreeSkipped" | "SessionSet" | "ModesSet" | "ProviderSet" | "ThreadMerged" | "ThreadParentSet" | "ThreadLaunched" | "ThreadForked" => "id", "MessagePosted" | "ActivityLogged" | "MessageFrom" | "TodosSet" | "TodosChanged" => "thread", _ => return None, diff --git a/native/host/src/model.rs b/native/host/src/model.rs index 0f4dbee302..211ac9f051 100644 --- a/native/host/src/model.rs +++ b/native/host/src/model.rs @@ -154,6 +154,7 @@ impl Model { "ThreadCreated" => { self.threads.insert(t(&e.id), ThreadMeta { project: t(&e.project), title: t(&e.title), env: t(&e.env), branch: t(&e.branch), worktree: t(&e.worktree), provider: t(&e.provider), model: t(&e.model), turn: "idle".into(), created: e.at.unwrap_or(0), activity: e.at.unwrap_or(0), ..Default::default() }); return } "ThreadRenamed" => { if let Some(th) = self.threads.get_mut(&t(&e.id)) { th.title = t(&e.title) } return } + "ThreadProjectSet" => { if let Some(th) = self.threads.get_mut(&t(&e.id)) { th.project = t(&e.project); th.env = "local".into(); th.branch.clear(); th.worktree.clear(); } return } "TurnChanged" => { if let Some(th) = self.threads.get_mut(&t(&e.thread)) { th.turn = t(&e.state); th.activity = e.at.unwrap_or(th.activity) } return } "PendingChanged" => { if let Some(th) = self.threads.get_mut(&t(&e.thread)) { th.pending = e.count.unwrap_or(0) } return } "SessionSet" => { if let Some(th) = self.threads.get_mut(&t(&e.id)) { th.session = t(&e.session) } return } diff --git a/native/host/src/net/far.rs b/native/host/src/net/far.rs index 1f11b69e89..a2396d71f6 100644 --- a/native/host/src/net/far.rs +++ b/native/host/src/net/far.rs @@ -92,7 +92,7 @@ pub fn reply_on(mut r: Value, id: &Value, l: &str) -> Value { } r } -pub const VARIANTS: &[&str] = &["ProjectCreated", "ProjectRemoved", "ThreadRenamed", "ThreadSettled", "ThreadUnsettled", "ThreadWoke", "ThreadArchived", "ThreadPinned", +pub const VARIANTS: &[&str] = &["ProjectCreated", "ProjectRemoved", "ThreadRenamed", "ThreadProjectSet", "ThreadSettled", "ThreadUnsettled", "ThreadWoke", "ThreadArchived", "ThreadPinned", "ThreadDeleted", "ModesSet", "ProviderSet", "AskClosed", "BotDeleted", "RoutineDeleted", "RoutineFired", "RoutinePlan", "RoutineSlot", "RoutineDone", "ThreadCreated", "MessagePosted", "MessageFrom", "TurnChanged", "PendingChanged", "TurnQueued", "QueueTaken", "QueueEdited", "QueueRemoved", "QueueMoved", "QueueTakenOne", "TodosChanged", "TodosSet", "WorkSet", "ActivityLogged", "ThreadForked", "TaskDelegated", "TaskStateSet", "TaskDelivered", "AskOpened", "BotSet", "RoutineSet", "Reminded", "MemorySaved", @@ -103,7 +103,7 @@ fn table(variant: &str) -> Option<&'static [(&'static str, K)]> { Some(match variant { "ProjectCreated" | "ProjectRemoved" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadArchived" | "ThreadPinned" | "ThreadDeleted" | "ModesSet" | "ProviderSet" | "AskClosed" | "BotDeleted" | "RoutineDeleted" | "RoutineFired" | "RoutinePlan" | "RoutineSlot" | "RoutineDone" => &[("id", Id)], - "ThreadCreated" => &[("id", Id), ("project", Opt)], + "ThreadCreated" | "ThreadProjectSet" => &[("id", Id), ("project", Opt)], "MessagePosted" => &[("thread", Id), ("msg", Sent), ("text", Text)], "MessageFrom" => &[("thread", Id), ("msg", Sent), ("from", Addr)], "TurnChanged" | "PendingChanged" | "TurnQueued" | "QueueTaken" | "QueueEdited" | "QueueRemoved" | "QueueMoved" | "QueueTakenOne" @@ -162,7 +162,7 @@ pub fn shared(o: &dyn Owned, c: &Value) -> bool { let ts = |k: &str| thread_shared(o, f(k)); match c["$"].as_str().unwrap_or("") { "ProjectCreated" | "ProjectRemoved" => !is(f("id")), - "ThreadCreated" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" + "ThreadCreated" | "ThreadRenamed" | "ThreadProjectSet" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" | "ThreadDeleted" | "ModesSet" | "ProviderSet" | "ThreadParentSet" | "ThreadLaunched" => ts("id"), "MessagePosted" | "MessageFrom" | "TurnChanged" | "PendingChanged" | "ActivityLogged" | "TurnQueued" | "QueueTaken" | "QueueEdited" | "QueueRemoved" | "QueueMoved" | "QueueTakenOne" | "TodosChanged" | "TodosSet" | "WorkSet" | "AskOpened" => ts("thread"), diff --git a/native/host/src/net/feed.rs b/native/host/src/net/feed.rs index 5e4a2482fc..91be28c7a7 100644 --- a/native/host/src/net/feed.rs +++ b/native/host/src/net/feed.rs @@ -39,7 +39,7 @@ impl Index { let th = |t: &str| self.threads.get(t).cloned().unwrap_or_default(); match s(e, "$") { "ProjectCreated" | "ProjectRemoved" => s(e, "id").to_string(), - "ThreadCreated" | "ThreadRenamed" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" | "ThreadDeleted" + "ThreadCreated" | "ThreadRenamed" | "ThreadProjectSet" | "ThreadSettled" | "ThreadUnsettled" | "ThreadWoke" | "ThreadArchived" | "ThreadPinned" | "ThreadForked" | "ThreadDeleted" | "ModesSet" | "ProviderSet" | "ThreadParentSet" | "ThreadLaunched" => th(s(e, "id")), "MessagePosted" | "MessageFrom" | "TurnChanged" | "PendingChanged" | "ActivityLogged" | "TurnQueued" | "QueueTaken" | "QueueEdited" | "QueueRemoved" | "QueueMoved" | "QueueTakenOne" | "TodosChanged" | "TodosSet" | "WorkSet" | "AskOpened" => th(s(e, "thread")), @@ -53,7 +53,7 @@ impl Index { pub fn fold(&mut self, seq: u32, e: &Value) { match s(e, "$") { "ProjectCreated" => { self.projects.insert(s(e, "id").into(), (s(e, "title").into(), e["at"].as_u64().unwrap_or(0))); } - "ThreadCreated" => { self.threads.insert(s(e, "id").into(), s(e, "project").into()); } + "ThreadCreated" | "ThreadProjectSet" => { self.threads.insert(s(e, "id").into(), s(e, "project").into()); } "AskOpened" => { self.asks.insert(s(e, "id").into(), s(e, "thread").into()); } "TaskDelegated" => { self.tasks.insert(s(e, "task").into(), s(e, "parent").into()); } _ => {} diff --git a/native/host/src/net/registry.rs b/native/host/src/net/registry.rs index abc276ed79..9f45afe684 100644 --- a/native/host/src/net/registry.rs +++ b/native/host/src/net/registry.rs @@ -38,7 +38,7 @@ pub fn status(st: &State, id: &str) -> &'static str { pub fn rows_of(st: &State, machine: &str, now: u64, origin: &dyn Fn(&str) -> String, rel: &dyn Fn(&str) -> String) -> Value { let mut projects = vec![]; let mut keys: HashMap<&str, String> = HashMap::new(); let all = crate::present::merged::local_keys(st, machine, origin, rel); - let mut ps: Vec<_> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH).collect(); + let mut ps: Vec<_> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(id)).collect(); ps.sort_by(|a, b| a.0.cmp(b.0)); for (id, p) in ps { let o = origin(&p.root); diff --git a/native/host/src/present/keys.rs b/native/host/src/present/keys.rs index 62bd4038e9..f6e7fb9e7f 100644 --- a/native/host/src/present/keys.rs +++ b/native/host/src/present/keys.rs @@ -448,6 +448,15 @@ pub fn task_tree(st: &State, id: &str) -> Vec<String> { out } +/// Live local projects a Quick Chat can be promoted into, sorted by title then id. +pub fn move_project_targets(st: &State, qid: &str) -> Vec<Value> { + let mut ps: Vec<(&str, &str)> = st.projects.iter() + .filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(id) && !p.root.is_empty()) + .map(|(id, p)| (id.as_str(), p.title.as_str())).collect(); + ps.sort_by(|a, b| a.1.to_lowercase().cmp(&b.1.to_lowercase()).then(a.0.cmp(b.0))); + ps.into_iter().map(|(pid, title)| json!({"id":"project","label":title,"action":"row-move-project","value":format!("{qid}\u{1f}{pid}")})).collect() +} + /// `state`, `tools`, `menu`, `working`, `phase` for a thread at clock `now_s`, or None for a case not computed here. pub fn keys(st: &State, id: &str, now_s: u64, why: &str, models_text: Option<&str>) -> Option<Map<String, Value>> { let t = st.threads.get(id)?; @@ -471,9 +480,19 @@ pub fn keys(st: &State, id: &str, now_s: u64, why: &str, models_text: Option<&st m.insert("state".into(), json!(state_word(t.turn))); // a bot's chat (its page): Stop and Retry only, and no Snooze or Delete in its menu; Pin, Settle, Archive, Fork are a project thread's let bot = st.bot_threads_has(id); + let is_chat = t.project == crate::sidebar::CHATS; let mut tl = tools(t.turn, t.pinned, settled(st, id), t.archived, forked); let mut mn = menu(id, now_s < until); if bot { tl.retain(|x| matches!(x["action"].as_str(), Some("interrupt" | "retry"))); mn.retain(|x| !matches!(x["action"].as_str(), Some("snooze" | "row-delete"))); } + if is_chat { + mn.retain(|x| x["action"].as_str() != Some("diff")); + let targets = move_project_targets(st, id); + if !targets.is_empty() { + let mv = json!({"id":"move","icon":"folder","label":"Move to project\u{2026}","action":"","value":"","on":false,"danger":false,"options":[],"sub":targets}); + let pos = mn.iter().position(|x| x["action"].as_str() == Some("row-delete")).unwrap_or(mn.len()); + mn.insert(pos, mv); + } + } m.insert("tools".into(), Value::Array(tl)); m.insert("menu".into(), Value::Array(mn)); m.insert("working".into(), json!(working)); m.insert("phase".into(), json!(phase)); @@ -752,4 +771,20 @@ mod tests { assert_eq!(k["picker"]["favorites"], json!(["claude/opus", "codex/gpt-6"])); assert!(as_helper(&k["picker"]).get("favorites").is_none()); } + #[test] fn chat_keys_menu_drops_diff_and_inserts_move_before_delete() { + let mut st = State::new(); + for l in [ + r#"{"$":"ProjectCreated","id":"p1","title":"Alpha","root":"/a","at":1}"#, + r#"{"$":"ProjectCreated","id":"p2","title":"Beta","root":"/b","at":1}"#, + r#"{"$":"ThreadCreated","id":"c1","project":"chats","title":"Chat","env":"local","worktree":"/chats/c1","provider":"claude","model":"","at":1}"#, + ] { st.apply_line(l); } + let k = keys(&st, "c1", 10, "", None).unwrap(); + let mn = k["menu"].as_array().unwrap(); + assert!(!mn.iter().any(|x| x["action"] == "diff"), "chat menu drops Diff"); + let mv_pos = mn.iter().position(|x| x["id"] == "move").expect("Move to project item"); + let del_pos = mn.iter().position(|x| x["action"] == "row-delete").expect("Delete item"); + assert_eq!(mv_pos + 1, del_pos, "Move to project inserted before Delete"); + assert_eq!(mn[mv_pos]["sub"][0]["value"], "c1\u{1f}p1"); + assert_eq!(mn[mv_pos]["sub"][1]["value"], "c1\u{1f}p2"); + } } diff --git a/native/host/src/present/merged.rs b/native/host/src/present/merged.rs index d5ae25772f..eed24dd65c 100644 --- a/native/host/src/present/merged.rs +++ b/native/host/src/present/merged.rs @@ -112,7 +112,7 @@ pub fn keys_of(ps: &[(String, u64, String, String, String)], machine: &str, here /// This machine's keys (`keys_of` over its projects, `origin` and `rel` read from each folder): what the sidebar, the registry rows and /// machine_list all say, so every machine computes the same key for a copy. pub fn local_keys(st: &State, here: &str, origin: &dyn Fn(&str) -> String, rel: &dyn Fn(&str) -> String) -> HashMap<String, String> { - let ps: Vec<(String, u64, String, String, String)> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH) + let ps: Vec<(String, u64, String, String, String)> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(id)) .map(|(id, p)| (id.clone(), p.created, origin(&p.root), rel(&p.root), st.settings.get(&format!("project.link.{id}")).cloned().unwrap_or_default())).collect(); keys_of(&ps, "", here) } @@ -155,7 +155,7 @@ pub fn merged_projects_in<'a>(st: &'a State, far: &[(String, &'a State)], away: let live_act = |s: &State, id: &str, created: u64| s.threads.iter().filter(|(tid, t)| t.project == id && !t.deleted && !s.run_hidden(tid)).map(|(_, t)| t.activity.max(t.created)).max().unwrap_or(created); let set = |s: &'a State, k: String| s.settings.get(&k).map(String::as_str).unwrap_or(""); // this machine's, oldest first (so of two local projects of one repository the older names the row) - let mut lp: Vec<_> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH).collect(); + let mut lp: Vec<_> = st.projects.iter().filter(|(id, p)| !p.removed && id.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(id)).collect(); lp.sort_by(|a, b| a.1.created.cmp(&b.1.created).then(a.0.cmp(b.0))); let keys = local_keys(st, here, local_origin, local_rel); for (id, p) in lp { @@ -165,7 +165,7 @@ pub fn merged_projects_in<'a>(st: &'a State, far: &[(String, &'a State)], away: } let live_names: Vec<&str> = far.iter().map(|(n, _)| n.as_str()).collect(); for (m, f) in far { - let mut fp: Vec<_> = f.projects.iter().filter(|(id, p)| !p.removed && !id.ends_with(&format!("~{}", crate::sidebar::SCRATCH)) && id.as_str() != crate::sidebar::SCRATCH).collect(); + let mut fp: Vec<_> = f.projects.iter().filter(|(id, p)| !p.removed && !id.ends_with(&format!("~{}", crate::sidebar::SCRATCH)) && id.as_str() != crate::sidebar::SCRATCH && !crate::sidebar::is_chats(id)).collect(); fp.sort_by(|a, b| a.1.created.cmp(&b.1.created).then(a.0.cmp(b.0))); // (one machine's copies never merge with each other: `keys_of`'s rule, applied to the keys as this hub learns them) let mut taken = std::collections::HashSet::new(); diff --git a/native/host/src/present/rail.rs b/native/host/src/present/rail.rs index f5902dc372..8fa4dcb372 100644 --- a/native/host/src/present/rail.rs +++ b/native/host/src/present/rail.rs @@ -9,6 +9,7 @@ pub struct RailInput<'a> { pub gerbers: bool, pub simulation: bool, pub altium: bool, + pub no_project: bool, pub page: &'a str, pub diff: bool, /// Page kinds currently present anywhere in the thread's viewer layout (each entry gets @@ -18,7 +19,7 @@ pub struct RailInput<'a> { pub fn rail(input: RailInput<'_>) -> Value { let mut entries = Vec::new(); - let page = if input.diff { "diff" } else { input.page }; + let page = if input.diff && !input.no_project { "diff" } else { input.page }; let mut add = |id, label, icon, group, key, why: Option<&str>| { let state = if page == id { "on" } else if why.is_some() { "disabled" } else { "off" }; let present = state == "on" || input.present.contains(&id); @@ -26,17 +27,21 @@ pub fn rail(input: RailInput<'_>) -> Value { if let Some(why) = why.filter(|_| page != id) { entry["why"] = json!(why); } entries.push(entry); }; - let no_board = (!input.board).then_some("No board in this project"); - add("board", "Board", "circuit-board", "design", "b", no_board); - add("schematic", "Schematic", "cpu", "design", "s", (!input.schematic).then_some("No schematic in this project")); - add("3d", "3D", "box", "design", "3", no_board); - if input.gerbers || page == "gerbers" { add("gerbers", "Gerbers", "layers", "design", "g", None); } - if input.simulation && input.schematic && !input.altium { add("simulation", "Simulation", "gauge", "design", "i", None); } - add("split", "Split", "layout-panel-left", "layout", "v", (!(input.board && input.schematic)).then_some("Split needs a board and a schematic")); - add("mech", "Mech", "wrench", "layout", "m", (!input.mech).then_some("No mechanical parts in this project")); + if !input.no_project { + let no_board = (!input.board).then_some("No board in this project"); + add("board", "Board", "circuit-board", "design", "b", no_board); + add("schematic", "Schematic", "cpu", "design", "s", (!input.schematic).then_some("No schematic in this project")); + add("3d", "3D", "box", "design", "3", no_board); + if input.gerbers || page == "gerbers" { add("gerbers", "Gerbers", "layers", "design", "g", None); } + if input.simulation && input.schematic && !input.altium { add("simulation", "Simulation", "gauge", "design", "i", None); } + add("split", "Split", "layout-panel-left", "layout", "v", (!(input.board && input.schematic)).then_some("Split needs a board and a schematic")); + add("mech", "Mech", "wrench", "layout", "m", (!input.mech).then_some("No mechanical parts in this project")); + } add("files", "Files", "folder", "work", "f", None); - add("diff", "Diff", "diff", "work", "d", None); - add("review", "Review", "circle-check", "work", "r", None); + if !input.no_project { + add("diff", "Diff", "diff", "work", "d", None); + add("review", "Review", "circle-check", "work", "r", None); + } add("browser", "Browser", "globe", "work", "w", None); add("terminal", "Terminal", "terminal", "tools", "`", None); add("commands", "Commands", "search", "tools", "", None); @@ -95,4 +100,15 @@ mod tests { } }}}} } + + #[test] + fn no_project_rail_drops_design_diff_and_review() { + let rows = rail(RailInput { + board: true, schematic: true, mech: true, gerbers: true, simulation: true, + altium: false, page: "files", diff: true, no_project: true, present: &[], + }); + let ids: Vec<_> = rows.as_array().unwrap().iter().map(|r| r["id"].as_str().unwrap()).collect(); + assert_eq!(ids, ["files", "browser", "terminal", "commands"]); + assert_eq!(rows[0]["state"], "on"); + } } diff --git a/native/host/src/present/screen.rs b/native/host/src/present/screen.rs index b9f7f25199..c6f2edf77b 100644 --- a/native/host/src/present/screen.rs +++ b/native/host/src/present/screen.rs @@ -796,12 +796,13 @@ pub fn recent_unified(st: &State,far: &[(String,&State)],un: &Unified,p: &Value) if !thread.is_empty() { let hold: &State=far.iter().map(|(_,f)|*f).find(|f|thread.contains('~') && f.threads.contains_key(thread)).unwrap_or(st); crate::session::pages::dv_sync(&crate::session::dispatch::StateFacts(hold),hub,&mut session,&mut cmds); } // Fab.sync for every request on a thread, view.open included: the window opens a thread with view.open (no select action), and the card // (Buy it in the header) comes only from fab.look. fab_tail asks only when where the thread stands changed since the last ask (@fab.at). - if !thread.is_empty() { crate::session::dispatch::fab_tail(&crate::session::dispatch::StateFacts(st),hub,&mut session,&mut cmds); } + let is_chat = !thread.is_empty() && st.threads.get(thread).is_some_and(|t| t.project == sidebar::CHATS); + if !thread.is_empty() && !is_chat { crate::session::dispatch::fab_tail(&crate::session::dispatch::StateFacts(st),hub,&mut session,&mut cmds); } // A thread is drawn only when the async session seam supplied a native window and indexed page. // Composer fields are drawn from the same adopted draft that the action dispatcher patches. // a thread of a linked machine is drawn from that machine's display state (its page and window come from the mirror) let tst: &State=far.iter().map(|(_,f)|*f).find(|f|thread.contains('~') && f.threads.contains_key(thread)).unwrap_or(st); - if !thread.is_empty() { super::viewer::sync_gerbers(tst,hub,&mut session,&mut cmds); } + if !thread.is_empty() && !is_chat { super::viewer::sync_gerbers(tst,hub,&mut session,&mut cmds); } if thread.contains('~') && std::ptr::eq(tst,st) { return refused("thread.far-unknown") } // A remembered layout comes back by itself: only on a client that says it can draw tiles (`tiles` in its request), once per session and thread, onto a // thread of this machine with nothing open in this session; any other client, or a session with a page open, is never changed. @@ -875,7 +876,7 @@ pub fn recent_unified(st: &State,far: &[(String,&State)],un: &Unified,p: &Value) // For now an explicitly opened thread in a folded Older project is unported. The recent list // already offers only visible projects; forcing an excluded project needs the filter exception port. // (a removed project's thread still draws, with no row for it) - if mode!="active" && !selected_project.is_empty() && selected_project!=sidebar::SCRATCH && !ids.contains(&selected_project) && st.projects.get(selected_project).map_or(false,|p|!p.removed) { return refused("sidebar.selected-project-hidden") } + if mode!="active" && !selected_project.is_empty() && selected_project!=sidebar::SCRATCH && selected_project!=sidebar::CHATS && !ids.contains(&selected_project) && st.projects.get(selected_project).map_or(false,|p|!p.removed) { return refused("sidebar.selected-project-hidden") } let ids: Vec<&str>=if mode=="active" { vec![] } else { ids }; let (mut indices,projects_page)=ns.slice_ids(&ids,"projects","",project_limit,selected_project); indices.sort_unstable(); // Mob.native.keep_projects keeps source order, including the selected exception. @@ -947,7 +948,7 @@ pub fn recent_unified(st: &State,far: &[(String,&State)],un: &Unified,p: &Value) let c=super::sections::Ctx{ hub,now:opts.now,query:&query,open:&open,selected:side_sel }; let bub=shown["bots"].as_array().and_then(|b|b.iter().find(|r|r["uber"]==json!(true))).cloned().unwrap_or(Value::Null); shown["sections"]=super::sections::build(st,&rows,&bub,&c); - shown["jump"]=super::sections::jump(&rows,&c); + shown["jump"]=super::sections::jump(st,&rows,&c); shown["groupsTo"]=super::sections::move_targets(st,&rows); let key=text(&session["drafts"],"@ppage"); if !key.is_empty() { shown["projectPage"]=super::sections::page(st,&rows,key,&c,open.contains("page-done")); } } diff --git a/native/host/src/present/sections.rs b/native/host/src/present/sections.rs index e006f66206..526b175d35 100644 --- a/native/host/src/present/sections.rs +++ b/native/host/src/present/sections.rs @@ -510,6 +510,36 @@ fn fold_section(id: &str, title: &str, rows: Vec<Value>, c: &Ctx, extra: Value) s } +fn chat_row(st: &State, c: &Ctx, id: &str, t: &crate::state::Thread) -> Value { + let w = status(st, id); + let mt = MergedThread { machine: String::new(), id: id.to_string(), title: t.title.clone(), activity: t.activity, pinned: t.pinned, archived: t.archived, src: Some(st), status: String::new() }; + let wn = want(&mt, w); + let q = qid(c.hub, id); + let se = settled(st, id); + let (lbl, tone) = badge(w, wn); + let mut menu = vec![ + if t.pinned { json!({"id":"unpin","label":"Unpin","action":"row-unpin","value":q}) } else { json!({"id":"pin","label":"Pin","action":"row-pin","value":q}) }, + if se { json!({"id":"unsettle","label":"Unsettle","action":"row-unsettle","value":q}) } else { json!({"id":"settle","label":"Settle","action":"row-settle","value":q}) }, + ]; + let targets = super::keys::move_project_targets(st, &q); + if !targets.is_empty() { + menu.push(json!({"id":"move","label":"Move to project\u{2026}","action":"","value":"","sub":targets})); + } + let snooze = if t.archived || w == "needs" { json!([]) } else { + json!([{"label":"1 hour","value":format!("{q}|1h")},{"label":"Tomorrow","value":format!("{q}|tomorrow")},{"label":"1 week","value":format!("{q}|1w")}]) + }; + let settle = if t.archived || se || live(w) || w == "needs" { String::new() } else { q.clone() }; + json!({ + "id": q, "title": if t.title.is_empty() { "New chat" } else { t.title.as_str() }, "provider": t.provider, + "word": w, "say": say(w), "want": wn, "status": dot_word(w), "state": turn_word(w), + "depth": 0, "children": 0, "expanded": false, "agents": "", + "ago": crate::sidebar::ago(c.now, t.activity), "activity": t.activity, "pinned": t.pinned, + "machine": "", "mark": Value::Null, "project": crate::sidebar::CHATS_TITLE, "projectKey": "", + "chat": true, "canChild": false, "off": false, "nav": q, "hide": "", "lead": [], + "label": lbl, "tone": tone, "snooze": snooze, "settle": settle, "menu": menu, + }) +} + /// The sections, top to bottom. `bub` is the uberbot's sidebar row (screen.rs `bots`), or null. pub fn build(st: &State, rows: &[MergedProject], bub: &Value, c: &Ctx) -> Value { let facts_of: Vec<Vec<Th>> = rows.iter().map(|p| p.threads.iter().map(|t| facts(st, p, t, c.now)).filter(listed).collect()).collect(); @@ -534,13 +564,15 @@ pub fn build(st: &State, rows: &[MergedProject], bub: &Value, c: &Ctx) -> Value for p in rows { for t in &p.threads { if let Some(s) = t.src { if !t.machine.is_empty() && !states.iter().any(|(x, _)| std::ptr::eq(*x, s)) { states.push((s, t.machine.clone())); } } } } for (s, machine) in states { // (another machine's ask is believed for ACTIVE, as `far_word` has it) for (id, t) in s.threads.iter().filter(|(id, t)| !t.deleted && !s.run_hidden(id) && !listed.contains(id.as_str()) && !crate::state::visible::swarm_member(s, id) && wants_person(s, id) && (machine.is_empty() || (far_word("needs", false, c.now.saturating_sub(t.activity)) == "needs" && hidden_at(st, id) < t.activity.max(1)))) { - let place = s.bots_nav.values().find(|b| &b.thread == id).map(|b| b.name.clone()).unwrap_or_else(|| crate::sidebar::NO_PROJECT.into()); + let is_chat = t.project == crate::sidebar::CHATS; + let place = if is_chat { crate::sidebar::CHATS_TITLE.to_string() } else { s.bots_nav.values().find(|b| &b.thread == id).map(|b| b.name.clone()).unwrap_or_else(|| crate::sidebar::NO_PROJECT.into()) }; if !c.query.is_empty() && !hit(&t.title, c.query) && !hit(&place, c.query) { continue } + if is_chat && machine.is_empty() { needs.push((if want(&MergedThread { machine: String::new(), id: id.clone(), title: t.title.clone(), activity: t.activity, pinned: t.pinned, archived: t.archived, src: Some(s), status: String::new() }, "needs") == "approval" { 0 } else { 1 }, t.activity, chat_row(s, c, id, t))); continue } let mt = MergedThread { machine: machine.clone(), id: id.clone(), title: t.title.clone(), activity: t.activity, pinned: t.pinned, archived: t.archived, src: Some(s), status: String::new() }; let w = want(&mt, "needs"); let mark = if machine.is_empty() { Value::Null } else { crate::mirror::mark_of(&machine, false) }; needs.push((if w == "approval" { 0 } else { 1 }, t.activity, json!({"id":qid(c.hub,id),"title":t.title,"provider":t.provider,"word":"needs","say":say("needs"),"want":w,"status":"blocked","state":"idle","depth":0,"children":0,"expanded":false,"agents":"", - "ago":crate::sidebar::ago(c.now,t.activity),"activity":t.activity,"pinned":t.pinned,"machine":machine,"mark":mark,"project":place,"projectKey":"","off":false,"nav":qid(c.hub,id)}))); + "ago":crate::sidebar::ago(c.now,t.activity),"activity":t.activity,"pinned":t.pinned,"machine":machine,"mark":mark,"project":place,"projectKey":"","chat":is_chat,"off":false,"nav":qid(c.hub,id)}))); } } } needs.sort_by(|a, b| a.0.cmp(&b.0).then(b.1.cmp(&a.1))); if !needs.is_empty() { out.push(json!({"id":"needs","kind":"threads","title":"Needs you","count":needs.len(),"rows":needs.into_iter().map(|x| x.2).collect::<Vec<_>>()})); } @@ -557,6 +589,13 @@ pub fn build(st: &State, rows: &[MergedProject], bub: &Value, c: &Ctx) -> Value if !c.query.is_empty() && !hit(text_of(&x.row, "title"), c.query) && !hit(&p.name, c.query) { continue } running.push((x.activity, x.row)); } } + for (id, t) in st.threads.iter().filter(|(id, t)| t.project == crate::sidebar::CHATS && !t.deleted && !t.archived && !st.run_hidden(id) && !crate::state::visible::swarm_member(st, id)) { + let w = status(st, id); + let until = st.snooze_until.get(id).copied().unwrap_or(0); + if w == "needs" || !live(w) || until > c.now { continue } + if !c.query.is_empty() && !hit(&t.title, c.query) && !hit(crate::sidebar::CHATS_TITLE, c.query) { continue } + running.push((t.activity, chat_row(st, c, id, t))); + } running.sort_by(|a, b| b.0.cmp(&a.0)); if !running.is_empty() { out.push(json!({"id":"running","kind":"threads","title":"Running","count":running.len(),"rows":running.into_iter().map(|x| x.1).collect::<Vec<_>>()})); } } @@ -567,10 +606,44 @@ pub fn build(st: &State, rows: &[MergedProject], bub: &Value, c: &Ctx) -> Value let mut r = thread_row(c.hub, c.now, p, f); let until = snooze_end(f); r["wake"] = json!(format!("{}|off", qid(c.hub, &f.t.id))); r["until"] = json!(until); r["ago"] = json!(crate::sidebar::ago(until, c.now)); r["snooze"] = json!([]); r["settle"] = json!(""); snz.push((until, r)); } } + for (id, t) in st.threads.iter().filter(|(id, t)| t.project == crate::sidebar::CHATS && !t.deleted && !t.archived && !st.run_hidden(id) && !crate::state::visible::swarm_member(st, id)) { + let until = st.snooze_until.get(id).copied().unwrap_or(0); + if until <= c.now || status(st, id) == "needs" { continue } + if !c.query.is_empty() && !hit(&t.title, c.query) && !hit(crate::sidebar::CHATS_TITLE, c.query) { continue } + let mut r = chat_row(st, c, id, t); + r["wake"] = json!(format!("{}|off", qid(c.hub, id))); r["until"] = json!(until); r["ago"] = json!(crate::sidebar::ago(until, c.now)); r["snooze"] = json!([]); r["settle"] = json!(""); + snz.push((until, r)); + } snz.sort_by(|a, b| a.0.cmp(&b.0)); if !snz.is_empty() { let open = c.open.contains("sec:snoozed") || !c.query.is_empty(); out.push(json!({"id":"snoozed","kind":"threads","title":"Snoozed","count":snz.len(),"fold":true,"open":open,"toggle":"sec:snoozed","rows":if open { snz.into_iter().map(|x| x.1).collect::<Vec<_>>() } else { vec![] }})); } } + // Quick Chats (project-free threads): active unsettled chats (plus pinned or currently open), newest first; search includes settled chats too; omitted when empty + { + let mut chats: Vec<(&str, &crate::state::Thread)> = st.threads.iter() + .filter(|(id, t)| t.project == crate::sidebar::CHATS && !t.deleted && !t.archived && !st.run_hidden(id) && !crate::state::visible::swarm_member(st, id)) + .filter(|(id, t)| { + if !c.query.is_empty() { + crate::sidebar::word_hit(&t.title, c.query) || crate::sidebar::word_hit("New chat", c.query) && t.title.is_empty() + } else { + let until = st.snooze_until.get(id.as_str()).copied().unwrap_or(0); + let is_snoozed = until > c.now && status(st, id) != "needs"; + !is_snoozed && (!settled(st, id) || t.pinned || id.as_str() == c.selected) + } + }) + .map(|(id, t)| (id.as_str(), t)) + .collect(); + chats.sort_by(|(ia, a), (ib, b)| { + b.pinned.cmp(&a.pinned) + .then_with(|| if a.pinned && b.pinned { a.pinned_at.cmp(&b.pinned_at) } else { std::cmp::Ordering::Equal }) + .then_with(|| b.activity.max(b.created).cmp(&a.activity.max(a.created))) + .then_with(|| ia.cmp(ib)) + }); + if !chats.is_empty() { + let rows: Vec<Value> = chats.into_iter().map(|(id, t)| chat_row(st, c, id, t)).collect(); + out.push(json!({"id":"chats","kind":"threads","title":crate::sidebar::CHATS_TITLE,"count":rows.len(),"rows":rows})); + } + } // the projects: pinned, the bench (Recent), by group, all the rest, quiet let (mut pinned, mut active, mut quiet): (Vec<(u64, Value)>, Vec<(u64, Value)>, Vec<Value>) = (vec![], vec![], vec![]); let mut rest: Vec<(String, Value)> = vec![]; @@ -655,10 +728,22 @@ pub fn page(st: &State, rows: &[MergedProject], key: &str, c: &Ctx, done_open: b } // ---- Ctrl+K --------------------------------------------------------------------------------------------------------------- -/// Every project and thread on every machine (the registry's too), for the palette: projects open their page, threads open (one whose machine +/// Every project, Quick Chat, and thread on every machine (the registry's too), for the palette: projects open their page, threads open (one whose machine /// is off says so and opens nothing). What needs the person first, then the newest. Bounded. -pub fn jump(rows: &[MergedProject], c: &Ctx) -> Value { +pub fn jump(st: &State, rows: &[MergedProject], c: &Ctx) -> Value { let mut v: Vec<(u8, u64, Value)> = vec![]; + for (id, t) in st.threads.iter().filter(|(id, t)| t.project == crate::sidebar::CHATS && !t.deleted && !t.archived && !st.run_hidden(id) && !crate::state::visible::swarm_member(st, id)) { + let w = status(st, id); + let se = settled(st, id); + let mt = MergedThread { machine: String::new(), id: id.clone(), title: t.title.clone(), activity: t.activity, pinned: t.pinned, archived: t.archived, src: Some(st), status: String::new() }; + let wn = want(&mt, w); + let rank = if w == "needs" { 0 } else if !se || visible(st, id) { 1 } else { 3 }; + v.push((rank, t.activity.max(t.created), json!({ + "kind":"thread","label":if t.title.is_empty() { "New chat" } else { t.title.as_str() }, + "place":crate::sidebar::CHATS_TITLE,"chat":true,"word":w,"status":dot_word(w),"state":turn_word(w),"want":wn, + "action":"select","value":qid(c.hub, id),"off":false + }))); + } for p in rows { let machines: Vec<String> = p.machines.iter().filter_map(|m| m["short"].as_str().map(String::from)).collect(); v.push((2, p.last_activity, json!({"kind":"project","label":p.name,"place":machines.join(" · "),"action":"project-page","value":p.key,"pid":pid_of(p)}))); diff --git a/native/host/src/present/sections_tests.rs b/native/host/src/present/sections_tests.rs index 619838bc38..4059ec2836 100644 --- a/native/host/src/present/sections_tests.rs +++ b/native/host/src/present/sections_tests.rs @@ -352,7 +352,7 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" } #[test] fn ctrl_k_lists_every_project_and_thread_waiting_ones_first() { let s = world(); let rows = merged_projects(&s, &[], &|_| false, &|_| String::new(), "desk", &[]); - let open = HashSet::new(); let j = jump(&rows, &ctx(&open)); let a = j.as_array().unwrap(); + let open = HashSet::new(); let j = jump(&s, &rows, &ctx(&open)); let a = j.as_array().unwrap(); assert_eq!(a.iter().filter(|x| x["kind"] == "project").count(), 5); assert_eq!(a.iter().filter(|x| x["kind"] == "thread").count(), 5, "the hidden threads too"); assert_eq!(a[0]["label"], "T ta"); assert_eq!(a[0]["action"], "select"); assert_eq!(a[0]["value"], "h|ta"); let p = a.iter().find(|x| x["kind"] == "project").unwrap(); assert_eq!(p["action"], "project-page"); @@ -474,7 +474,7 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" let s4 = st(&[pc("p1", "P", "/n/p", 1), tc("a", "p1", 2), tc("b", "p1", 3), room("r1", "done", "")]); let rows4 = merged_projects(&s4, &[], &|_| false, &|_| String::new(), "desk", &[]); assert!(sec(&build(&s4, &rows4, &Value::Null, &ctx(&HashSet::new())), "needs").is_null()); - let j = jump(&rows2, &ctx(&HashSet::new())); assert!(j.as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["action"] == "room" && x["value"] == "h|r1")); + let j = jump(&s2, &rows2, &ctx(&HashSet::new())); assert!(j.as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["action"] == "room" && x["value"] == "h|r1")); let pg = page(&s2, &rows2, &rows2[0].key, &ctx(&HashSet::new()), false); assert_eq!(pg["sections"][0]["rows"][0]["kind"], "swarm"); } @@ -634,7 +634,7 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" assert!(pg_str.contains("User thread") && pg_str.contains("Test runner")); // Ctrl+K command palette - let jmp = jump(&rows, &ctx(&HashSet::new())); + let jmp = jump(&s, &rows, &ctx(&HashSet::new())); let jmp_str = jmp.to_string(); assert!(!jmp_str.contains("Bub: Launch:") && !jmp_str.contains("mailcoord-"), "no mailroom runs in Ctrl+K: {jmp_str}"); assert!(jmp_str.contains("User thread") && jmp_str.contains("Test runner")); @@ -748,7 +748,7 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" assert!(sec(&v_stale, "running").is_null() && sec(&v_stale, "needs").is_null()); let pg_stale = page(&s_stale, &rows_stale, &rows_stale[0].key, &ctx(&HashSet::new()), true); assert!(titles(&pg_stale["sections"][2]).contains(&"Swarm r_old".to_string()), "stale live swarm remains on Project Page Recent: {:?}", pg_stale["sections"][2]); - assert!(jump(&rows_stale, &ctx(&HashSet::new())).as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_old")); + assert!(jump(&s_stale, &rows_stale, &ctx(&HashSet::new())).as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_old")); // 5. swarm-settle action dismisses paused/idle swarm to Project Page Done and keeps it in Ctrl+K; newer post resurfaces it let mut paused_evs = vec![ @@ -769,7 +769,7 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" assert!(sec(&v_settled, "active")["rows"][0]["swarms"].as_array().unwrap().is_empty()); let pg_settled = page(&s_settled, &rows_settled, &rows_settled[0].key, &ctx(&HashSet::new()), true); assert_eq!(titles(&pg_settled["sections"][3]), ["Swarm r_pause"], "settled swarm moves to Project Page Done"); - assert!(jump(&rows_settled, &ctx(&HashSet::new())).as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_pause")); + assert!(jump(&s_settled, &rows_settled, &ctx(&HashSet::new())).as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_pause")); // Newer post after settle brings it back paused_evs.push(json!({"$":"RoomPosted","id":"p2","room":"r_pause","from":"opus","text":"new","hop":1,"at":NOW + 10})); let s_resurf = st(&paused_evs); @@ -791,7 +791,56 @@ fn menu_ids(m: &Value) -> Vec<String> { m.as_array().unwrap().iter().map(|i| i[" let pg_done = page(&s_done, &rows_done, &rows_done[0].key, &ctx(&HashSet::new()), true); let done_titles = titles(&pg_done["sections"][3]); assert!(done_titles.contains(&"Swarm r_done".to_string()) && done_titles.contains(&"Swarm r_stop".to_string()), "{done_titles:?}"); - let jmp = jump(&rows_done, &ctx(&HashSet::new())); + let jmp = jump(&s_done, &rows_done, &ctx(&HashSet::new())); assert!(jmp.as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_done")); assert!(jmp.as_array().unwrap().iter().any(|x| x["kind"] == "swarm" && x["value"] == "h|r_stop")); } + +#[test] fn quick_chats_appear_in_chats_section_and_jump_and_offer_move_to_project() { + let base = vec![ + pc("p1", "Beta", "/nowhere/beta", NOW - 200), + pc("p2", "Alpha", "/nowhere/alpha", NOW - 190), + ]; + let p2_key = merged_projects(&st(&base), &[], &|_| false, &|_| String::new(), "desk", &[]) + .into_iter().find(|r| r.name == "Alpha").unwrap().key; + let mut evs = base; + evs.extend([ + set(&format!("sidebar.pin.{p2_key}"), &NOW.to_string(), NOW - 185), + tc("t1", "p1", NOW - 180), + turn("t1", "failed", NOW - 160), json!({"$":"ThreadSnoozed","id":"t1","until":NOW + 3600,"at":NOW - 150}), + tc("c1", "chats", NOW - 100), + tc("c2", "chats", NOW - 90), + tc("c3", "chats", NOW - 80), json!({"$":"ThreadSettled","id":"c3","manual":true,"at":NOW - 70}), + ]); + let s = st(&evs); + let rows = merged_projects(&s, &[], &|_| false, &|_| String::new(), "desk", &[]); + let none = HashSet::new(); + let v = build(&s, &rows, &Value::Null, &ctx(&none)); + // chats appears after snoozed and before pinned (and active) + assert_eq!(ids(&v), ["snoozed", "chats", "pinned", "active"]); + let cs = sec(&v, "chats"); + assert_eq!((cs["kind"].as_str(), cs["title"].as_str(), cs["count"].as_u64()), (Some("threads"), Some("Chats"), Some(2))); + assert_eq!(titles(cs), ["T c2", "T c1"]); + let r = &cs["rows"][1]; + assert_eq!((r["project"].as_str(), r["projectKey"].as_str(), r["chat"].as_bool(), r["canChild"].as_bool()), + (Some("Chats"), Some(""), Some(true), Some(false))); + let mv = r["menu"].as_array().unwrap().iter().find(|m| m["id"] == "move").expect("move menu item"); + assert_eq!(mv["label"], "Move to project\u{2026}"); + assert_eq!(mv["sub"][0]["label"], "Alpha"); + assert_eq!(mv["sub"][0]["action"], "row-move-project"); + assert_eq!(mv["sub"][0]["value"], "h|c1\u{1f}p2"); + assert_eq!(mv["sub"][1]["label"], "Beta"); + // selected settled chat shows up; query filters chats by title + let v_sel = build(&s, &rows, &Value::Null, &Ctx { selected: "c3", ..ctx(&none) }); + assert_eq!(titles(sec(&v_sel, "chats")), ["T c3", "T c2", "T c1"]); + let v_q = build(&s, &rows, &Value::Null, &Ctx { query: "c1", ..ctx(&none) }); + assert_eq!(titles(sec(&v_q, "chats")), ["T c1"]); + // jump includes settled quick chats too with place "Chats" + let jmp = jump(&s, &rows, &ctx(&none)); + let j_c3 = jmp.as_array().unwrap().iter().find(|x| x["value"] == "h|c3").expect("settled chat in jump"); + assert_eq!((j_c3["place"].as_str(), j_c3["chat"].as_bool()), (Some("Chats"), Some(true))); + // when no unsettled/selected chat remains, section is omitted + let s_settled = st(&[pc("p1", "Beta", "/nowhere/beta", NOW - 200), tc("c3", "chats", NOW - 80), json!({"$":"ThreadSettled","id":"c3","manual":true,"at":NOW - 70})]); + let rows_settled = merged_projects(&s_settled, &[], &|_| false, &|_| String::new(), "desk", &[]); + assert!(sec(&build(&s_settled, &rows_settled, &Value::Null, &ctx(&none)), "chats").is_null()); +} diff --git a/native/host/src/present/thread.rs b/native/host/src/present/thread.rs index e19d51ebcd..215f78f973 100644 --- a/native/host/src/present/thread.rs +++ b/native/host/src/present/thread.rs @@ -689,14 +689,19 @@ pub fn thread_object_checked(st: &State, hub: &str, thread: &str, params: &Value o.insert("diff".into(), crate::session::pages::diff_json(¶ms["session"], thread)); o.insert("id".into(), json!(format!("{hub}|{thread}"))); o.insert("title".into(), json!(t.title)); + let is_chat = t.project == crate::sidebar::CHATS; // the header's crumb names the project (and opens its page): its raw id and title - o.insert("project".into(), json!({"id": t.project, "title": st.projects.get(&t.project).map(|p| p.title.as_str()).unwrap_or("")})); - o.insert("branch".into(), json!(t.branch)); + o.insert("project".into(), json!({"id": t.project, "title": if is_chat { crate::sidebar::CHATS_TITLE } else { st.projects.get(&t.project).map(|p| p.title.as_str()).unwrap_or("") }})); + o.insert("branch".into(), json!(if is_chat { "" } else { t.branch.as_str() })); + if is_chat { + o.insert("chat".into(), json!(true)); + o.insert("canChild".into(), json!(false)); + } o.insert("readingSeen".into(), json!(newest_id.as_deref().unwrap_or("-"))); // a sent message's references (@bot >thread %project #room &model) as cards the client draws under it let mut entries = entries; // `#123` and `OWNER/REPO#123` in the messages' text link to GitHub's issues, in the project's repository on GitHub, or the default one for a project with none and a bot's conversation (md/issues.rs) - let repo = if st.bot_threads_has(thread) { String::new() } else { st.projects.get(&t.project).and_then(|p| md::issues::repo_of(&crate::mirror::origin_of_root(&p.root))).unwrap_or_default() }; + let repo = if st.bot_threads_has(thread) || is_chat { String::new() } else { st.projects.get(&t.project).and_then(|p| md::issues::repo_of(&crate::mirror::origin_of_root(&p.root))).unwrap_or_default() }; { for e in entries.iter_mut() { if let Some(Value::Array(b)) = e.get_mut("blocks") { md::issues::link_nodes(b, &repo) } } } // halt cards (agents/halt.rs): a turn ended out of memory or out of context, its row drawn as a card with its actions for e in entries.iter_mut() { if e["kind"] == "act" { let id = e["id"].as_str().unwrap_or("").to_string(); @@ -749,7 +754,7 @@ pub fn thread_object_checked(st: &State, hub: &str, thread: &str, params: &Value if let Some(q) = queue.as_array_mut() { for (i, r) in crate::session::composer::unsent_rows(thread).into_iter().enumerate() { q.insert(i, r) } } o.insert("queue".into(), queue); o.insert("queued".into(), queued); // Buy it heads the thread's tools: in the window's header, and the first of the phones' overflow menu, which lists them - if let Some(b) = super::ready::header(st, thread, ¶ms["session"]) { if let Some(t) = o.get_mut("tools").and_then(Value::as_array_mut) { t.insert(0, b) } } + if !is_chat { if let Some(b) = super::ready::header(st, thread, ¶ms["session"]) { if let Some(t) = o.get_mut("tools").and_then(Value::as_array_mut) { t.insert(0, b) } } } for k in ["draft", "skills", "send", "sendAct"] { o.insert(k.into(), c[k].clone()); } Ok(Value::Object(o)) } @@ -1090,4 +1095,19 @@ mod tests { assert!(rows.iter().all(|r| !r["text"].as_str().unwrap_or("").starts_with("Snapshot")), "{rows:?}"); assert_eq!(rows.iter().find(|r| r["id"] == "u1").unwrap()["restore"]["commit"], "0bac077"); } + #[test] fn shown_thread_for_quick_chat_sets_chat_fields_and_move_menu() { + let mut st = State::new(); + for l in [ + r#"{"$":"ProjectCreated","id":"p1","title":"Alpha","root":"/tmp/alpha","at":1}"#, + r#"{"$":"ThreadCreated","id":"c1","project":"chats","title":"Quick Q","env":"local","branch":"","worktree":"/tmp/chats/c1","provider":"claude","model":"","at":2}"#, + ] { st.apply_line(l); } + let got = thread_object(&st, "h", "c1", &json!({"session":{"sel":"c1"}, "page":{"thread":"c1","rows":[]}, "now": 5000}), "").unwrap(); + assert_eq!(got["chat"], true); + assert_eq!(got["project"], json!({"id":"chats","title":"Chats"})); + assert_eq!(got["branch"], ""); + assert_eq!(got["canChild"], false); + let mn = got["menu"].as_array().unwrap(); + assert!(!mn.iter().any(|x| x["action"] == "diff")); + assert!(mn.iter().any(|x| x["id"] == "move" && x["sub"][0]["value"] == "c1\u{1f}p1"), "{got}"); + } } diff --git a/native/host/src/present/viewer.rs b/native/host/src/present/viewer.rs index 141fbcd6df..1f872173bf 100644 --- a/native/host/src/present/viewer.rs +++ b/native/host/src/present/viewer.rs @@ -1278,10 +1278,13 @@ pub fn viewer_json(st: &State, template: &Value, session: &Value) -> Option<Valu t.kind.as_str() } }).collect(); + let no_project = st.threads.get(sel).is_some_and(|t| t.project == crate::sidebar::CHATS); let input = rail::RailInput { - board: sources.board, schematic: sources.schematic, mech: sources.mech || v["mech"]["parts"].as_array().is_some_and(|p| !p.is_empty()), - gerbers: v["hasGerbers"].as_bool().unwrap_or(sources.gerbers), - simulation: v["simFrame"].is_string(), altium: sources.altium, page, diff: pages::diff_on(session, sel), + board: !no_project && sources.board, schematic: !no_project && sources.schematic, + mech: !no_project && (sources.mech || v["mech"]["parts"].as_array().is_some_and(|p| !p.is_empty())), + gerbers: !no_project && v["hasGerbers"].as_bool().unwrap_or(sources.gerbers), + simulation: !no_project && v["simFrame"].is_string(), altium: !no_project && sources.altium, + no_project, page, diff: !no_project && pages::diff_on(session, sel), present: &present, }; let has = json!({"board":input.board, "schematic":input.schematic, "mech":input.mech, "gerbers":input.gerbers}); diff --git a/native/host/src/session/search.rs b/native/host/src/session/search.rs index af18c37428..a140bf1fc3 100644 --- a/native/host/src/session/search.rs +++ b/native/host/src/session/search.rs @@ -53,7 +53,7 @@ async fn live(hub: &Arc<Hub>) -> (HashMap<String, (String, String)>, HashMap<Str .unwrap_or_else(|| meta.keys().filter(|i| crate::state::is_mail_run_id(i)).cloned().collect()); (meta, projects, activity, hidden) } -fn place(projects: &HashMap<String, String>, pid: &str) -> String { if pid == crate::sidebar::SCRATCH { crate::sidebar::NO_PROJECT.to_string() } else { projects.get(pid).cloned().unwrap_or_default() } } +fn place(projects: &HashMap<String, String>, pid: &str) -> String { if pid == crate::sidebar::SCRATCH { crate::sidebar::NO_PROJECT.to_string() } else if pid == crate::sidebar::CHATS { crate::sidebar::CHATS_TITLE.to_string() } else { projects.get(pid).cloned().unwrap_or_default() } } /// The search across every live thread (or one, `thread`), from the index (index.rs): newest first, `limit` hits at most, at most 3 a thread /// across threads; `more` when it stopped at the limit. diff --git a/native/host/src/sidebar.rs b/native/host/src/sidebar.rs index 7e349bfc1c..0dce6b48c0 100644 --- a/native/host/src/sidebar.rs +++ b/native/host/src/sidebar.rs @@ -21,6 +21,11 @@ pub fn fuzzy_hit(title: &str, q: &str) -> bool { pub fn word_hit(text: &str, q: &str) -> bool { let t = text.to_lowercase(); q.to_lowercase().split_whitespace().all(|w| t.contains(w)) } /// The Scratch project's id: conversations that belong to no project. Nothing starts there any more; its chats stay (`NO_PROJECT`). pub const SCRATCH: &str = "scratch"; +/// Project-free Quick Chats sentinel (`thread.project == CHATS`), with no `ProjectCreated` record. +pub const CHATS: &str = "chats"; +pub const CHATS_TITLE: &str = "Chats"; +/// Whether a project id (local or `<link>~chats`) is the Quick Chats sentinel. +pub fn is_chats(project: &str) -> bool { project == CHATS || project.split_once('~').is_some_and(|(_, l)| l == CHATS) } /// What every client calls the Scratch chats and says as their place: they are chats that belong to no project (the old name, "Conversation /// history", said nothing of what they are or why they are apart from the projects). pub const NO_PROJECT: &str = "Chats with no project"; @@ -351,8 +356,8 @@ pub fn plan<'a>(st: &'a State, o: &'a Opts<'a>) -> Plan<'a> { let open_project = st.threads.get(o.selected).map(|t| t.project.as_str()).unwrap_or(""); for (id, p) in &st.projects { if p.removed && id != open_project { continue } - // Side.projs.keep: the Scratch project (conversations that belong to no project) is not listed among projects - if id.rsplit('~').next() == Some("scratch") && !id.contains('~') || id.split_once('~').map_or(false, |(_, l)| l == "scratch") { continue } + // Side.projs.keep: the Scratch project and Quick Chats sentinel are not listed among projects + if (id.rsplit('~').next() == Some("scratch") && !id.contains('~')) || id.split_once('~').map_or(false, |(_, l)| l == "scratch") || is_chats(id) { continue } let mine: &[&str] = listed.get(id.as_str()).map_or(&[], Vec::as_slice); let raw = shelves_from(st, mine, o.now); // Side.latest: a thread's last move for its project's place; settling by hand counts diff --git a/native/host/src/state/mod.rs b/native/host/src/state/mod.rs index 8a4b89e493..ee864c967c 100644 --- a/native/host/src/state/mod.rs +++ b/native/host/src/state/mod.rs @@ -122,7 +122,7 @@ const KNOWN: &[&str] = &["ProjectCreated", "ProjectRemoved", "ThreadCreated", "T "TodosSet", "UsageSet", "BotSet", "BotDeleted", "RoomSet", "RoomDeleted", "RoomPosted", "HookSet", "HookHit", "RoutineSet", "RoutineDeleted", "RoutineFired", "MemorySaved", "MemoryForgot", "SpaceSet", "PeerSet", "BotWoke", "SpacePageSet", "WorkSet", "UberSet", "UberOp", "ThreadLaunched", "WakeSet", "WakeDropped", "LockChanged", "RoutinePlan", "RoutineSlot", "RoutineDone", "Reminded", "TaskSet", "TaskDeleted", "MessageFrom", "ConvSet", "MailPosted", "MailMarked", "MailTagged", - "RunSet", "CharterSet", "DecisionLogged", "TurnUsage", "DeployAsked", "DeployBuilt", "ThreadParentSet", "ThreadWoke", "TodosChanged", "DevicePrefs", "PushOrdered", "PushSent", "PushCleared"]; + "RunSet", "CharterSet", "DecisionLogged", "TurnUsage", "DeployAsked", "DeployBuilt", "ThreadParentSet", "ThreadWoke", "TodosChanged", "DevicePrefs", "PushOrdered", "PushSent", "PushCleared", "ThreadProjectSet"]; /// Link.from: the sender in a link id "t:<from>:<n>" ("" for any other id): the second ':'-field when the first is "t" and a third follows fn link_from(id: &str) -> &str { @@ -201,6 +201,11 @@ impl State { branch: s(e, "branch")?.into(), worktree: s(e, "worktree")?.into(), provider: s(e, "provider")?.into(), model: s(e, "model")?.into(), session: String::new(), deleted: false }); } "ThreadRenamed" => { let id = s(e, "id")?; let t = s(e, "title")?.to_string(); self.thread_mut(id).title = t; } + "ThreadProjectSet" => { + let id = s(e, "id")?; let p = s(e, "project")?.to_string(); + let t = self.thread_mut(id); + t.project = p; t.worktree_mode = false; t.branch.clear(); t.worktree.clear(); + } "MessagePosted" => { let th = s(e, "thread")?; let id = s(e, "msg")?; let role = s(e, "role")?; let at = n(e, "at")?; let text = s(e, "text")?; if role == "user" { let t = self.thread_mut(th); t.activity = at; t.unsettled_at = at; } diff --git a/native/host/src/state/visible.rs b/native/host/src/state/visible.rs index 261d7ccd30..e155420968 100644 --- a/native/host/src/state/visible.rs +++ b/native/host/src/state/visible.rs @@ -130,7 +130,7 @@ pub fn look(st: &State, id: &str, now: u64) -> Vec<Value> { } /// A visit is written at most once in ten minutes for a project (`sidebar.visit.<project id>`): the bench orders by it, and a log line for /// every thread opened would be noise. -pub fn visit_due(st: &State, project: &str, now: u64) -> bool { !project.is_empty() && project != "scratch" /* sidebar::SCRATCH: the chats with no project */ && num(st, &format!("sidebar.visit.{project}")) + 600 <= now } +pub fn visit_due(st: &State, project: &str, now: u64) -> bool { !project.is_empty() && project != "scratch" && project != "chats" /* sidebar::SCRATCH / CHATS: the chats with no project */ && num(st, &format!("sidebar.visit.{project}")) + 600 <= now } /// Events a viewer's view.open of a thread adds for the bench (state/policy.rs `read`): the person was in its project now. pub fn visit(st: &State, id: &str, now: u64) -> Vec<Value> { let Some(t) = st.threads.get(id) else { return vec![] };