create-principles-disciple 1.147.4 → 1.147.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,11 +12,11 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
12
12
  \u8BC6\u522B\u9700\u8981\u6539\u8FDB\u7684\u6A21\u5F0F`,phase02:"\u5F62\u6210\u539F\u5219",phase02Desc:`\u628A\u7ECF\u9A8C\u63D0\u70BC\u6210
13
13
  \u53EF\u9075\u5FAA\u7684\u539F\u5219`,phase03:"\u62E5\u6709\u8005\u5BA1\u6279",phase03Desc:`\u4F60\u51B3\u5B9A\u54EA\u4E9B\u539F\u5219
14
14
  \u53EF\u4EE5\u751F\u6548`,phase04:"\u6539\u53D8\u884C\u4E3A",phase04Desc:`\u539F\u5219\u4F5C\u7528\u4E8E
15
- \u667A\u80FD\u4F53\u4E0B\u6B21\u884C\u4E3A`,loopHint:"\u884C\u4E3A\u6539\u53D8\u540E\uFF0CPD \u7EE7\u7EED\u89C2\u5BDF \u2014\u2014 \u5F62\u6210\u95ED\u73AF\u30029 \u4E2A\u4EE3\u7406\u5206\u5E03\u5728\u8FD9\u6761\u56DE\u8DEF\u4E0A\uFF0C\u5404\u53F8\u5176\u804C\u3002"},status:{enabled:"\u5DF2\u542F\u7528",notReady:"\u672A\u5C31\u7EEA",corePipeline:"\u6838\u5FC3\u7BA1\u9053",corePipelineOk:"\u6B63\u5E38",corePipelineDegraded:"\u964D\u7EA7\u53EF\u7528",corePipelineParalyzed:"\u762B\u75EA",needsConfig:"\u9700\u914D\u7F6E"},groups:{coreTrio:"\u6838\u5FC3\u4E09\u4EF6\u5957",coreTrioTag:"\u5FC5\u987B\u4E00\u8D77\u5F00",coreTrioHint:"\u5173\u6389\u4EFB\u4F55\u4E00\u4E2A\uFF0CPD \u90FD\u65E0\u6CD5\u628A\u9519\u8BEF\u8F6C\u5316\u4E3A\u539F\u5219",codeChain:"\u4EE3\u7801\u5B9E\u73B0\u94FE",codeChainTag:"\u63A8\u8350\u4E00\u8D77\u5F00",codeChainHint:"\u53EA\u5F00 artificer \u4F1A\u964D\u7EA7\u4E3A\u7EAF\u63D0\u793A\u901A\u9053\uFF1B\u53EA\u5F00 evaluator \u65E0\u610F\u4E49",qualityPolish:"\u8D28\u91CF\u6253\u78E8",qualityPolishTag:"\u53EF\u9009 \xB7 \u5355\u72EC\u5F00\u5173",qualityPolishHint:"\u8BA9\u539F\u5219\u66F4\u7CBE\u70BC\uFF0C\u5173\u6389\u4E5F\u80FD\u7528\uFF0C\u53EA\u662F\u8D28\u91CF\u7565\u7C97",sidechain:"\u4FA7\u94FE\u670D\u52A1",sidechainTag:"\u72EC\u7ACB \xB7 \u5355\u72EC\u5F00\u5173",sidechainHint:"\u4E0D\u5F71\u54CD\u4E3B\u7BA1\u9053\uFF0C\u53EA\u5F71\u54CD pain \u4FE1\u53F7\u68C0\u6D4B\u7CBE\u5EA6"},impact:{label:"\u5173\u6389\u4F1A\u600E\u6837",confirmTitle:"\u786E\u8BA4\u5173\u95ED\u6838\u5FC3\u4EE3\u7406",confirmAck:"\u786E\u8BA4\u5173\u95ED",confirmCancel:"\u53D6\u6D88"},techDetail:"\u6280\u672F\u7EC6\u8282",profileLabelShort:"\u8FD0\u884C\u65F6",manageProfiles:"\u7BA1\u7406 Profiles",readinessChecking:"\u63A2\u6D4B\u5C31\u7EEA\u4E2D\u2026",unknownAgentsWarning:"\u68C0\u6D4B\u5230 {{count}} \u4E2A\u672A\u8BC6\u522B\u7684\u4EE3\u7406\uFF1A{{names}}\u3002\u5B83\u4EEC\u672A\u88AB\u5206\u7EC4\u663E\u793A\u3002",footerNote:"9 \u4E2A\u4EE3\u7406\u5206\u5E03\u5728\u5185\u5316\u7BA1\u9053\u4E0E\u4FA7\u94FE\u670D\u52A1\u4E24\u6761\u8DEF\u5F84\u4E0A\u3002\u6838\u5FC3\u4E09\u4EF6\u5957\u5FC5\u987B\u4E00\u8D77\u5F00\uFF0C\u5426\u5219 PD \u65E0\u6CD5\u628A\u9519\u8BEF\u8F6C\u5316\u4E3A\u539F\u5219\u3002",profiles:{sectionTitle:"\u8FD0\u884C\u65F6\u914D\u7F6E\u7BA1\u7406",sectionDescription:"\u521B\u5EFA\u3001\u7F16\u8F91\u3001\u5220\u9664 runtime profile\u3002\u88AB\u667A\u80FD\u4F53\u5F15\u7528\u6216\u8BBE\u4E3A\u9ED8\u8BA4\u7684 profile \u65E0\u6CD5\u5220\u9664\u3002",createButton:"\u65B0\u5EFA Profile",editButton:"\u7F16\u8F91",deleteButton:"\u5220\u9664",cancelButton:"\u53D6\u6D88",saveButton:"\u4FDD\u5B58",creating:"\u521B\u5EFA\u4E2D\u2026",saving:"\u4FDD\u5B58\u4E2D\u2026",deleting:"\u5220\u9664\u4E2D\u2026",empty:"\u6682\u65E0 runtime profile\u3002",columnId:"ID",columnType:"\u7C7B\u578B",columnProvider:"Provider",columnModel:"Model",columnApiKeyEnv:"API Key \u73AF\u5883\u53D8\u91CF",columnReadiness:"\u5C31\u7EEA",columnActions:"\u64CD\u4F5C",formTitleCreate:"\u65B0\u5EFA Runtime Profile",formTitleEdit:"\u7F16\u8F91 Profile: {{id}}",fieldId:"Profile ID",fieldIdHint:"\u552F\u4E00\u6807\u8BC6\u7B26\uFF0C\u521B\u5EFA\u540E\u4E0D\u53EF\u4FEE\u6539\uFF08\u5982 anthropic-cloud\uFF09",fieldIdPlaceholder:"my-profile",fieldProvider:"Provider",fieldProviderPlaceholder:"anthropic",fieldModel:"Model",fieldModelPlaceholder:"claude-sonnet-4",fieldApiKeyEnv:"API Key \u73AF\u5883\u53D8\u91CF\u540D",fieldApiKeyEnvHint:"\u73AF\u5883\u53D8\u91CF\u540D\uFF0C\u4E0D\u662F key \u503C\uFF08\u5982 ANTHROPIC_API_KEY\uFF09",fieldApiKeyEnvPlaceholder:"ANTHROPIC_API_KEY",fieldBaseUrl:"Base URL\uFF08\u53EF\u9009\uFF09",fieldBaseUrlPlaceholder:"https://api.anthropic.com",retiredBadge:"\u5DF2\u9000\u5F79",validationIdRequired:"Profile ID \u4E0D\u80FD\u4E3A\u7A7A",validationProviderRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 provider",validationModelRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 model",validationApiKeyEnvRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 apiKeyEnv",deleteConfirmTitle:"\u786E\u8BA4\u5220\u9664",deleteConfirmMessage:"\u786E\u5B9A\u8981\u5220\u9664 profile\u300C{{id}}\u300D\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",deleteConfirmAck:"\u786E\u8BA4\u5220\u9664",deleteConfirmCancel:"\u53D6\u6D88",createSuccess:"Profile \u521B\u5EFA\u6210\u529F",updateSuccess:"Profile \u5DF2\u66F4\u65B0",deleteSuccess:"Profile \u5DF2\u5220\u9664",operationFailed:"\u64CD\u4F5C\u5931\u8D25"}},login:{title:"\u767B\u5F55",description:"\u767B\u5F55 PD \u6CBB\u7406\u5DE5\u4F5C\u53F0",slogan:"\u628A\u53CD\u590D\u7EA0\u6B63\uFF0C\u6C89\u6DC0\u4E3A\u53EF\u6CBB\u7406\u7684\u539F\u5219",connectWorkspace:"\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0",detecting:"\u6B63\u5728\u68C0\u6D4B\u672C\u673A Companion\u2026",connecting:"\u6B63\u5728\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0\u2026",accessToken:"\u8BBF\u95EE\u4EE4\u724C",enterAccessToken:"\u8F93\u5165\u8BBF\u95EE\u4EE4\u724C\u5B8C\u6210\u8FDE\u63A5",connect:"\u8FDE\u63A5",errorInvalid:"\u8BBF\u95EE\u51ED\u8BC1\u65E0\u6548\u6216\u670D\u52A1\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",errorExpired:"\u4F1A\u8BDD\u5DF2\u8FC7\u671F\u6216\u4EE4\u724C\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u3002",recoveryTitle:"\u65E0\u6CD5\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0",recoveryReason:"\u539F\u56E0\uFF1A\u62E5\u6709\u8005\u51ED\u8BC1\u5DF2\u5931\u6548\u6216\u4E0E\u672C\u673A\u63A7\u5236\u53F0\u4E0D\u5339\u914D\u3002",reconnect:"\u91CD\u65B0\u8FDE\u63A5",manualEntry:"\u624B\u52A8\u8F93\u5165\u8BBF\u95EE\u4EE4\u724C",manualEntryHint:"\u624B\u52A8\u8F93\u5165\u7684\u65B0\u4EE4\u724C\u4F1A\u66F4\u65B0 Companion \u4E2D\u4FDD\u5B58\u7684\u51ED\u8BC1\u3002",readFailedTitle:"Companion \u51ED\u8BC1\u8BFB\u53D6\u5931\u8D25",readFailedHint:"\u65E0\u6CD5\u8BFB\u53D6 Companion \u4FDD\u5B58\u7684\u51ED\u8BC1\uFF08\u7248\u672C\u53EF\u80FD\u4E0D\u5339\u914D\uFF09\u3002\u8BF7\u624B\u52A8\u8F93\u5165\u4EE4\u724C\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\u8BF7\u91CD\u542F Companion\u3002",persistFailed:"\u5DF2\u8FDE\u63A5\uFF0C\u4F46\u51ED\u8BC1\u672A\u80FD\u5B89\u5168\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u9700\u91CD\u65B0\u8F93\u5165\u4EE4\u724C\u3002",persistSucceeded:"\u62E5\u6709\u8005\u51ED\u8BC1\u5DF2\u7531 Companion \u5B89\u5168\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u6253\u5F00\u5C06\u81EA\u52A8\u8FDE\u63A5\u3002",persistAttached:"\u51ED\u8BC1\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5F53\u524D\u4F7F\u7528\u7684\u662F\u5916\u90E8\u542F\u52A8\u7684\u63A7\u5236\u53F0\uFF0C\u91CD\u542F Companion \u540E\u751F\u6548\u3002",tokenSessionOnly:"\u4EE4\u724C\u4EC5\u5B58\u50A8\u5728\u6D4F\u89C8\u5668\u4F1A\u8BDD\u4E2D\u3002",noAuthFlag:"\u4F7F\u7528 --no-auth \u6807\u5FD7\u7981\u7528\u8EAB\u4EFD\u9A8C\u8BC1\u3002"},update:{eyebrow:"\u66F4\u65B0",title:"\u66F4\u65B0",subtitle:"\u68C0\u67E5 PD \u66F4\u65B0\u5E76\u67E5\u770B\u66F4\u65B0\u5386\u53F2\u3002\u66F4\u65B0\u4FDD\u6301\u4F60\u7684\u6CBB\u7406\u5DE5\u4F5C\u53F0\u5904\u4E8E\u6700\u65B0\u72B6\u6001\u3002",currentVersion:"\u5F53\u524D\u7248\u672C",latestVersion:"\u6700\u65B0\u7248\u672C",upToDate:"\u5DF2\u662F\u6700\u65B0",updateAvailable:"\u6709\u53EF\u7528\u66F4\u65B0",checkForUpdates:"\u68C0\u67E5\u66F4\u65B0",checking:"\u68C0\u67E5\u4E2D\u2026",history:"\u66F4\u65B0\u5386\u53F2",noHistory:"\u6682\u65E0\u66F4\u65B0\u5386\u53F2\u3002",version:"\u7248\u672C",failed:"\u5931\u8D25",historyKind:{update:"\u66F4\u65B0",reinstall:"\u91CD\u65B0\u5B89\u88C5",legacy_migration:"\u5386\u53F2\u8FC1\u79FB",rollback:"\u56DE\u6EDA",refusal:"\u5DF2\u62D2\u7EDD",failure:"\u5931\u8D25",recovery:"\u6062\u590D",unknown:"\u672A\u77E5\u64CD\u4F5C"},checkError:"\u68C0\u67E5\u51FA\u9519",syncPending:"\u6700\u65B0\u7248 {{pluginVersion}} \u5DF2\u53D1\u5E03\uFF0C\u5B89\u88C5\u5668\u540C\u6B65\u4E2D\uFF08\u5F53\u524D\u53EF\u66F4\u65B0\u81F3\u4E0A\u65B9\u5217\u51FA\u7684\u7248\u672C\uFF09\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",identityDivergence:"\u68C0\u6D4B\u5230\u7248\u672C\u5206\u6B67\uFF1A\u6D3B\u52A8\u7248\u672C\u4E3A {{active}}\uFF0C\u800C\u63D2\u4EF6\u76EE\u5F55\u4E3A {{plugin}}\u3002\u4EE5\u6D3B\u52A8\u7248\u672C\u4E3A\u51C6\uFF1B\u5982\u9700\u5BF9\u9F50\u526F\u672C\uFF0C\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u3002",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u66F4\u65B0\u6570\u636E\u3002\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u5237\u65B0\u9875\u9762\u3002",checkFailed:"\u66F4\u65B0\u68C0\u67E5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",blockedBadge:"\u9700\u5148\u89E3\u51B3",reasonLabel:"\u539F\u56E0\uFF1A",recoveryBanner:"\u68C0\u6D4B\u5230\u672A\u5B8C\u6210\u7684\u66F4\u65B0\u4E8B\u52A1",recoveryItem:"\u4E8B\u52A1 {{id}} \u505C\u7559\u5728\u9636\u6BB5\u300C{{phase}}\u300D",recoveryRequiredBanner:"\u4E00\u6B21\u5931\u8D25\u7684\u66F4\u65B0\u4F7F\u5B89\u88C5\u5904\u4E8E\u4E0D\u4E00\u81F4\u72B6\u6001\uFF08\u9700\u8981\u6062\u590D\uFF09",recoveryRequiredItem:"\u5931\u8D25\u4E8B\u52A1 {{id}} \u9700\u8981\u6062\u590D\u2014\u2014\u8BF7\u91CD\u65B0\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668",inProgressToast:"\u66F4\u65B0\u4E8B\u52A1\u5DF2\u53D7\u7406\uFF0C\u6B63\u5728\u540E\u53F0\u6267\u884C\uFF1B\u8BF7\u52FF\u91CD\u590D\u70B9\u51FB\u3002",inProgressPanel:"\u66F4\u65B0\u8FDB\u884C\u4E2D",inProgressPhase:"\u5F53\u524D\u9636\u6BB5\uFF1A{{phase}}",inProgressConfirmed:"\u66F4\u65B0\u5DF2\u5B8C\u6210\uFF08{{version}}\uFF09\u3002\u8BF7\u91CD\u542F\u63A7\u5236\u53F0\u52A0\u8F7D\u65B0\u7248\u672C\u3002",inProgressEnded:"\u66F4\u65B0\u4E8B\u52A1\u5DF2\u7ED3\u675F\uFF1A{{state}}",inProgressTimeout:"\u66F4\u65B0\u8017\u65F6\u8F83\u957F\uFF0C\u672A\u80FD\u786E\u8BA4\u7ED3\u679C\u3002\u8BF7\u7A0D\u540E\u5728\u66F4\u65B0\u5386\u53F2\u4E2D\u67E5\u770B\u8BE5\u4E8B\u52A1\u3002",reason:{bootstrap_too_old:"\u672C\u673A\u7684\u66F4\u65B0\u5E95\u5EA7\u7EC4\u4EF6\u7248\u672C\u8FC7\u4F4E\uFF0C\u65E0\u6CD5\u5B89\u88C5\u6B64\u7248\u672C\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\uFF08npx create-principles-disciple\uFF09\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_not_registered:"\u672C\u673A\u7F3A\u5C11\u66F4\u65B0\u5E95\u5EA7\u767B\u8BB0\uFF08\u65E7\u7248\u5B89\u88C5\uFF09\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_manifest_corrupt:"\u66F4\u65B0\u5E95\u5EA7\u7684\u767B\u8BB0\u6587\u4EF6\u635F\u574F\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_identity_mismatch:"\u66F4\u65B0\u5E95\u5EA7\u7684\u767B\u8BB0\u4E0E\u5B9E\u9645\u6587\u4EF6\u4E0D\u4E00\u81F4\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",metadata_source_unconfigured:"\u5B98\u65B9\u66F4\u65B0\u6E90\u672A\u767B\u8BB0\uFF1A\u672C\u673A\u6CA1\u6709\u7B7E\u540D\u53D1\u5E03\u5730\u5740\uFF0C\u65E0\u6CD5\u6838\u5BF9\u6700\u65B0\u7248\u672C\u3002\u8BF7\u5E26\u66F4\u65B0\u6E90\u5730\u5740\u8FD0\u884C\u4E00\u6B21\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u767B\u8BB0\u3002",install_state_corrupt:"\u5B89\u88C5\u72B6\u6001\u6587\u4EF6\u635F\u574F\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u4FEE\u590D\u540E\u518D\u8BD5\u3002",journal_not_supported:"\u66F4\u65B0\u4E8B\u52A1\u76EE\u5F55\u4E0D\u53EF\u7528\u3002\u8BF7\u68C0\u67E5 ~/.pd/transactions \u7684\u78C1\u76D8\u4E0E\u6743\u9650\u540E\u91CD\u8BD5\u3002",installer_missing:"\u66F4\u65B0\u7EC4\u4EF6\u4E0D\u53EF\u7528\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_not_installed:"\u5C1A\u672A\u68C0\u6D4B\u5230\u6709\u6548\u5B89\u88C5\u3002\u8BF7\u5148\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B89\u88C5 PD\u3002",downgrade_blocked:"\u76EE\u6807\u7248\u672C\u6BD4\u5F53\u524D\u5DF2\u5B89\u88C5\u7248\u672C\u66F4\u65E7\uFF0C\u9ED8\u8BA4\u7981\u6B62\u964D\u7EA7\u3002",sequence_regression:"\u76EE\u6807\u7248\u672C\u7684\u53D1\u5E03\u5E8F\u53F7\u4E0D\u6BD4\u5F53\u524D\u65B0\uFF0C\u5DF2\u62D2\u7EDD\u4EE5\u9632\u56DE\u9000\u3002",channel_pointer_mismatch:"\u7B7E\u540D\u9891\u9053\u6307\u9488\u4E0E\u53D1\u5E03\u5185\u5BB9\u4E0D\u4E00\u81F4\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u51FA\u73B0\u8BF7\u8054\u7CFB\u7EF4\u62A4\u8005\u3002",release_metadata_expired:"\u53D1\u5E03\u5143\u6570\u636E\u5DF2\u8FC7\u671F\u3002\u8BF7\u7B49\u5F85\u5B98\u65B9\u91CD\u65B0\u53D1\u5E03\u540E\u518D\u8BD5\u3002",channel_metadata_expired:"\u9891\u9053\u5143\u6570\u636E\u5DF2\u8FC7\u671F\u3002\u8BF7\u7B49\u5F85\u5B98\u65B9\u5237\u65B0\u540E\u518D\u8BD5\u3002",legacy_layout_not_supported:"\u6B64\u5B89\u88C5\u4F7F\u7528\u65E7\u7248\u5E03\u5C40\uFF0C\u9700\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u8FC1\u79FB\u5230\u65B0\u5E03\u5C40\u3002",metadata_refresh_failed:"\u65E0\u6CD5\u83B7\u53D6\u6216\u9A8C\u8BC1\u7B7E\u540D\u53D1\u5E03\u5143\u6570\u636E\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",destructive_migration_requires_maintenance:"\u6B64\u7248\u672C\u5305\u542B\u7834\u574F\u6027\u6570\u636E\u8FC1\u79FB\uFF0C\u65E0\u6CD5\u901A\u8FC7\u666E\u901A\u66F4\u65B0\u5B8C\u6210\u3002\u8BF7\u4F7F\u7528\u5B98\u65B9\u7EF4\u62A4\u6D41\u7A0B\u8FC1\u79FB\u6570\u636E\u3002"},applyUpdate:"\u7ACB\u5373\u66F4\u65B0",updating:"\u66F4\u65B0\u4E2D\u2026",updateFailed:"\u66F4\u65B0\u5931\u8D25\uFF1A{{message}}",networkErrorHint:"\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002",retry:"\u91CD\u8BD5",applyFullUpdate:"\u5168\u91CF\u66F4\u65B0",fullUpdateSuccess:"\u5168\u91CF\u66F4\u65B0\u5B8C\u6210\u3002",confirmFullUpdateTitle:"\u786E\u8BA4\u66F4\u65B0",confirmFullUpdateDesc:"\u5C06\u4E0B\u8F7D\u5E76\u66F4\u65B0\u5168\u90E8 PD \u4EE3\u7801\u5305\uFF08\u63D2\u4EF6\u3001\u63A7\u5236\u53F0\u3001\u6838\u5FC3\u3001CLI\uFF09\u3002\u901A\u5E38\u53EA\u9700\u51E0\u79D2\u949F\u3002\u4F60\u81EA\u5B9A\u4E49\u7684\u6587\u4EF6\uFF08AGENTS.md \u7B49\uFF09\u4E0D\u53D7\u5F71\u54CD\u3002\u66F4\u65B0\u5B8C\u6210\u540E\u9700\u8981\u91CD\u542F\u63A7\u5236\u53F0\u3002",fullUpdateRestartPrompt:"\u66F4\u65B0\u5DF2\u5B8C\u6210\u3002\u8BF7\u91CD\u542F\u63A7\u5236\u53F0\u4EE5\u52A0\u8F7D\u65B0\u7248\u672C\uFF1A\u6309 Ctrl+C \u505C\u6B62\uFF0C\u7136\u540E\u91CD\u65B0\u8FD0\u884C pd console\u3002"},intent:{eyebrow:"\u62E5\u6709\u8005\u610F\u56FE",title:"\u62E5\u6709\u8005\u610F\u56FE\u6587\u6863",subtitle:"\u5355\u9875\u951A\u70B9\uFF0C\u8BB0\u5F55\u62E5\u6709\u8005\u7684\u76EE\u6807\u3001\u4E0D\u53EF\u8FDD\u80CC\u7684\u8FB9\u754C\u3001\u4EE5\u53CA\u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5E76\u5347\u7EA7\u3002\u4EC5\u5F53 intent_engineering \u6807\u5FD7\u5F00\u542F\u65F6\uFF0CPD \u624D\u4F1A\u8BFB\u53D6\u6B64\u6587\u6863\u3002",flagStatus:{enabled:"\u6807\u5FD7\u5DF2\u5F00\u542F",disabled:"\u6807\u5FD7\u5DF2\u5173\u95ED",ariaLabel:"intent_engineering \u529F\u80FD\u6807\u5FD7\u72B6\u6001",enable:"\u542F\u7528\u610F\u56FE\u5DE5\u7A0B",enabling:"\u542F\u7528\u4E2D\u2026",enableFailed:"\u542F\u7528\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u624B\u52A8\u4FEE\u6539 .pd/config.yaml"},editEntry:{heading:"\u7F16\u8F91 INTENT.md",title:"\u62E5\u6709\u8005\u81EA\u6709\u6587\u6863",description:"PD \u4E0D\u4F1A\u4FEE\u6539\u6B64\u6587\u4EF6\u3002\u8BF7\u5728\u81EA\u5DF1\u7684\u7F16\u8F91\u5668\u4E2D\u7F16\u8F91\uFF0C\u4EE5\u58F0\u660E\u6216\u4FEE\u8BA2\u4F60\u7684\u610F\u56FE\u3002",copy:"\u590D\u5236\u8DEF\u5F84",copyAriaLabel:"\u590D\u5236 INTENT.md \u6587\u4EF6\u8DEF\u5F84\u5230\u526A\u8D34\u677F"},flagDisabled:{title:"\u610F\u56FE\u5DE5\u7A0B\u5DF2\u5173\u95ED",description:"intent_engineering \u529F\u80FD\u6807\u5FD7\u672A\u5F00\u542F\u3002PD \u5F53\u524D\u4E0D\u4F1A\u8BFB\u53D6 INTENT.md\uFF0C\u4E0D\u4F1A\u5C06\u610F\u56FE\u4E0A\u4E0B\u6587\u6CE8\u5165\u63D0\u793A\u8BCD\uFF0C\u4E5F\u4E0D\u4F1A\u5728\u8BCA\u65AD\u4E2D\u5448\u73B0\u610F\u56FE\u5F20\u529B\u3002\u8FD9\u662F\u9ED8\u8BA4\u7684\u5B89\u9759\u72B6\u6001\u3002"},notFound:{title:"\u672A\u627E\u5230 INTENT.md",description:"PD \u5728 .principles/ \u76EE\u5F55\u4E2D\u672A\u627E\u5230 INTENT.md \u6587\u4EF6\u3002\u7F3A\u5C11\u6B64\u951A\u70B9\u65F6\uFF0C\u57FA\u4E8E\u610F\u56FE\u7684\u8BCA\u65AD\u65E0\u6CD5\u8FD0\u884C\u3002",nextAction:"\u8FD0\u884C\uFF1Apd intent init --confirm --workspace <path>",createButton:"\u521B\u5EFA INTENT.md",creating:"\u521B\u5EFA\u4E2D\u2026",createFailed:"\u521B\u5EFA\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",createSuccess:"INTENT.md \u5DF2\u521B\u5EFA\uFF0C\u4F60\u53EF\u4EE5\u5F00\u59CB\u586B\u5199\u610F\u56FE"},onboarding:{title:"\u6B22\u8FCE\u4F7F\u7528\u610F\u56FE\u5DE5\u7A0B",subtitle:"\u5728\u5F00\u59CB\u4E4B\u524D\uFF0C\u8BA9\u6211\u4EEC\u5148\u4E86\u89E3\u4E00\u4E0B\u610F\u56FE\u5DE5\u7A0B",whatIsIt:{title:"\u4EC0\u4E48\u662F\u610F\u56FE\u5DE5\u7A0B\uFF1F",description:"INTENT.md \u662F\u4F60\u7684\u957F\u671F\u610F\u56FE\u951A\u70B9 \u2014 \u8BB0\u5F55\u4F60\u7684\u76EE\u6807\u3001\u4E0D\u53EF\u8FDD\u80CC\u7684\u8FB9\u754C\u3001\u4EE5\u53CA\u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5E76\u5347\u7EA7\u3002\u5B83\u5E2E\u52A9 PD \u5728\u5173\u952E\u51B3\u7B56\u70B9\u5BF9\u9F50\u4F60\u7684\u771F\u5B9E\u610F\u56FE\u3002"},whyYouFill:{title:"\u4E3A\u4EC0\u4E48\u9700\u8981\u4F60\u586B\u5199\uFF1F",description:"\u610F\u56FE\u662F\u62E5\u6709\u8005\u81EA\u6709\u7684\u3002PD \u4E0D\u4F1A\u81EA\u52A8\u751F\u6210\u610F\u56FE\uFF0C\u56E0\u4E3A\u53EA\u6709\u4F60\u77E5\u9053\u9879\u76EE\u7684\u771F\u5B9E\u76EE\u6807\u548C\u8FB9\u754C\u3002\u8FD9\u662F\u4F60\u7684\u51B3\u7B56\u6743\uFF0CPD \u53EA\u8D1F\u8D23\u5E2E\u52A9\u4F60\u6267\u884C\u548C\u5BF9\u9F50\u3002"},sectionGuide:{title:"5 \u4E2A\u7AE0\u8282\u586B\u5199\u5F15\u5BFC",description:"INTENT.md \u5305\u542B 5 \u4E2A\u7AE0\u8282\uFF0C\u6BCF\u4E2A\u7AE0\u8282\u6709\u660E\u786E\u7684\u7528\u9014\uFF1A",sections:{why:"\u4E3A\u4EC0\u4E48 \u2014 \u8FD9\u4E2A\u9879\u76EE\u7684\u6839\u672C\u52A8\u673A",desiredOutcome:"\u671F\u671B\u7ED3\u679C \u2014 \u4F60\u5E0C\u671B\u8FBE\u6210\u7684\u5177\u4F53\u7ED3\u679C",nonNegotiables:"\u4E0D\u53EF\u59A5\u534F\u9879 \u2014 \u7EDD\u5BF9\u4E0D\u80FD\u8FDD\u53CD\u7684\u8FB9\u754C",stopEscalation:"\u505C\u6B62 / \u5347\u7EA7 \u2014 \u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5F53\u524D\u64CD\u4F5C\u5E76\u5347\u7EA7\u7ED9\u4F60",currentStrategicFocus:"\u5F53\u524D\u6218\u7565\u7126\u70B9 \u2014 \u9636\u6BB5\u6027\u91CD\u70B9"}},skipOption:"\u8DF3\u8FC7\u5F15\u5BFC\uFF0C\u521B\u5EFA\u7A7A\u6A21\u677F\u7A0D\u540E\u586B\u5199",startFilling:"\u5F00\u59CB\u586B\u5199",skip:"\u8DF3\u8FC7",close:"\u5173\u95ED",dontShowAgain:"\u4E0D\u518D\u663E\u793A"},editor:{title:"\u7F16\u8F91 INTENT.md",description:"\u76F4\u63A5\u5728\u6D4F\u89C8\u5668\u4E2D\u7F16\u8F91\u4F60\u7684\u610F\u56FE\u6587\u6863\u3002\u4FDD\u5B58\u540E\u4F1A\u7ACB\u5373\u751F\u6548\u3002",placeholder:"\u5728\u6B64\u8F93\u5165 INTENT.md \u5185\u5BB9\uFF08Markdown \u683C\u5F0F\uFF09\u2026",save:"\u4FDD\u5B58",saving:"\u4FDD\u5B58\u4E2D\u2026",cancel:"\u53D6\u6D88",edit:"\u7F16\u8F91",saveSuccess:"INTENT.md \u5DF2\u4FDD\u5B58",saveFailed:"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",emptyContent:"\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",oversized:"\u5185\u5BB9\u8D85\u8FC7 32KB \u4E0A\u9650\uFF0C\u8BF7\u7CBE\u7B80\u540E\u91CD\u8BD5",confirmDiscard:"\u4F60\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u653E\u5F03\u5417\uFF1F",yes:"\u662F\uFF0C\u653E\u5F03\u4FEE\u6539",no:"\u7EE7\u7EED\u7F16\u8F91"},oversized:{title:"INTENT.md \u8D85\u8FC7 32KB",description:"\u6587\u4EF6\u8D85\u8FC7 32KB \u4E0A\u9650\u3002PD \u62D2\u7EDD\u8BFB\u53D6\u8D85\u5927\u6587\u4EF6\uFF0C\u4EE5\u4FDD\u8BC1\u610F\u56FE\u89E3\u6790\u7684\u786E\u5B9A\u6027\u4E0E\u6709\u754C\u6027\u3002",nextAction:"\u8BF7\u5C06 INTENT.md \u7CBE\u7B80\u81F3 32KB \u4EE5\u4E0B\uFF0C\u5C06\u957F\u7BC7\u7B56\u7565\u79FB\u81F3\u72EC\u7ACB\u6587\u6863\u3002"},sections:{why:"\u4E3A\u4EC0\u4E48",desiredOutcome:"\u671F\u671B\u7ED3\u679C",nonNegotiables:"\u4E0D\u53EF\u59A5\u534F\u9879",stopEscalation:"\u505C\u6B62 / \u5347\u7EA7",currentStrategicFocus:"\u5F53\u524D\u6218\u7565\u7126\u70B9"},warnings:{title:"\u5065\u5EB7\u544A\u8B66",empty:"\u65E0\u544A\u8B66\u3002INTENT.md \u683C\u5F0F\u826F\u597D\u3002",missing_section:"\u7F3A\u5931\u7AE0\u8282",empty_section:"\u7AE0\u8282\u4E3A\u7A7A",too_vague:"\u7AE0\u8282\u8FC7\u4E8E\u7B80\u7565\uFF08\u5C11\u4E8E 10 \u4E2A\u5B57\u7B26\uFF09",oversized:"\u6587\u6863\u8D85\u8FC7 32KB \u4E0A\u9650",parse_failed:"\u7AE0\u8282\u89E3\u6790\u5931\u8D25"},meta:{title:"\u6587\u6863\u5143\u4FE1\u606F",lastEditedAt:"\u4E0A\u6B21\u7F16\u8F91",contentHash:"\u5185\u5BB9\u54C8\u5E0C",path:"\u8DEF\u5F84",templateTitle:"INTENT.md \u6A21\u677F",templateDescription:"\u5C06\u5176\u590D\u5236\u5230 .principles/INTENT.md\uFF0C\u66FF\u6362\u5360\u4F4D\u7B26\u4E3A\u4F60\u7684\u610F\u56FE\u3002"},loadError:"\u52A0\u8F7D\u610F\u56FE\u6587\u6863\u5931\u8D25",validationError:"\u6570\u636E\u683C\u5F0F\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5",decisions:{sectionTitle:"\u62E5\u6709\u8005\u51B3\u7B56",sectionSubtitle:"\u57FA\u4E8E IntentDecisionRecord \u7684\u8F7B\u91CF\u5BA1\u8BA1\u6458\u8981\uFF0C\u975E\u4EEA\u8868\u76D8\u3002",countConfirmDrift:"\u786E\u8BA4\u6F02\u79FB",countReviseIntent:"\u4FEE\u8BA2\u610F\u56FE",countObserve:"\u89C2\u5BDF",countDismiss:"\u9A73\u56DE",countPromoteToPrinciple:"\u6C89\u6DC0\u4E3A\u539F\u5219",countPromoteToRulehost:"\u8F6C\u4E3A RuleHost",lastDecisionAtLabel:"\u6700\u8FD1\u51B3\u7B56",noDecisions:"\u6682\u65E0\u51B3\u7B56\u8BB0\u5F55",loadError:"\u52A0\u8F7D\u51B3\u7B56\u6458\u8981\u5931\u8D25"},langSelector:{ariaLabel:"\u9009\u62E9 INTENT.md \u8BED\u8A00",disabledWhileEditing:"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u7F16\u8F91\uFF0C\u518D\u5207\u6362\u8BED\u8A00"},versionHistory:{title:"\u7248\u672C\u5386\u53F2",reasonInit:"\u521D\u59CB\u5316",reasonSave:"\u4FDD\u5B58"},wizard:{progressLabel:"\u7B2C {{current}}/5 \u6B65",next:"\u4E0B\u4E00\u6B65",prev:"\u4E0A\u4E00\u6B65",finish:"\u5B8C\u6210",review:"\u67E5\u770B\u6458\u8981",complete:"\u5B8C\u6210\u4FDD\u5B58",cancel:"\u53D6\u6D88",emptyWarning:"\u6B64\u8282\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u8BF7\u586B\u5199\u540E\u518D\u7EE7\u7EED",stepLabels:{why:"1. \u4E3A\u4EC0\u4E48\uFF08Why\uFF09",desiredOutcome:"2. \u671F\u671B\u7ED3\u679C\uFF08Desired Outcome\uFF09",nonNegotiables:"3. \u4E0D\u53EF\u59A5\u534F\u9879\uFF08Non-negotiables\uFF09",stopEscalation:"4. \u6B62\u635F/\u5347\u7EA7\uFF08Stop / Escalation\uFF09",currentStrategicFocus:"5. \u5F53\u524D\u6218\u7565\u7126\u70B9\uFF08Current Strategic Focus\uFF09"},guidance:{why:"\u8BF4\u660E\u8FD9\u4E2A\u9879\u76EE\u4E3A\u4EC0\u4E48\u91CD\u8981\u3002\u62E5\u6709\u8005\u5173\u5FC3\u4EC0\u4E48\uFF1F\u4E0D\u89E3\u51B3\u4F1A\u600E\u6837\uFF1F",desiredOutcome:"\u63CF\u8FF0\u53EF\u89C2\u5BDF\u7684\u6539\u53D8\u3002\u505A\u5B8C\u540E\uFF0C\u4EC0\u4E48\u4F1A\u53D8\u597D\uFF1F",nonNegotiables:"\u5217\u51FA\u4E0D\u53EF\u8FDD\u53CD\u7684\u786C\u7EA6\u675F\uFF08\u5408\u89C4/\u5B89\u5168/\u8FB9\u754C\uFF09\u3002",stopEscalation:"\u4EC0\u4E48\u60C5\u51B5\u4E0B\u5E94\u8BE5\u505C\u4E0B\u6765\u5347\u7EA7\u7ED9\u62E5\u6709\u8005\uFF0C\u800C\u4E0D\u662F\u7EE7\u7EED\u63A8\u8FDB\uFF1F",currentStrategicFocus:"\u5F53\u524D\u9636\u6BB5\u6700\u4F18\u5148\u7684\u4E8B\u662F\u4EC0\u4E48\uFF1F\uFF08\u4F1A\u968F\u9636\u6BB5\u66F4\u65B0\uFF09"},discardConfirmTitle:"\u653E\u5F03\u586B\u5199\uFF1F",discardConfirmBody:"\u4F60\u5DF2\u586B\u5199\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u65E0\u6CD5\u6062\u590D\u3002",discardConfirmCancel:"\u7EE7\u7EED\u586B\u5199",discardConfirmConfirm:"\u653E\u5F03"},versionDiff:{changed:"\u5DF2\u53D8\u66F4",unchanged:"\u672A\u53D8\u66F4",oldPreview:"\u65E7\u7248\u672C",newPreview:"\u65B0\u7248\u672C",expandHint:"\u70B9\u51FB\u67E5\u770B section \u7EA7\u5DEE\u5F02",collapseHint:"\u70B9\u51FB\u6298\u53E0\u5DEE\u5F02"}},examiner:{loading:"\u6B63\u5728\u52A0\u8F7D Examiner\u2026",title:"Examiner \u9A8C\u8BC1",subtitle:"\u5BF9\u76EE\u6807\u539F\u5219\u8FDB\u884C\u53D7\u63A7 A/B \u884C\u4E3A\u6548\u679C\u9A8C\u8BC1\uFF08\u79BB\u7EBF\u4F18\u5148\uFF09\u3002",scope:{title:"\u6267\u884C\u8303\u56F4\u4E0E\u95E8\u7981"},mode:{full:"\u5B8C\u6574\u539F\u5219\u5E93\u589E\u91CF A/B\uFF08\u9ED8\u8BA4\uFF09",isolated:"\u72EC\u7ACB\u539F\u5219 A/B\uFF08\u8BCA\u65AD\u6A21\u5F0F\uFF09"},create:{title:"\u521B\u5EFA\u79BB\u7EBF Study",target:"\u76EE\u6807\u539F\u5219\uFF08\u6BCF\u6B21\u5B9E\u9A8C\u4E00\u6761\uFF09",mode:"\u5B9E\u9A8C\u6A21\u5F0F",repetitions:"\u6BCF\u9898\u91CD\u590D\u6B21\u6570",submit:"\u521B\u5EFA Study",note:"\u4F7F\u7528\u5408\u6210\u6821\u51C6\u9898\uFF08SYNTHETIC_OFFLINE Gold\uFF09\u3002Study \u8EAB\u4EFD\u7531\u670D\u52A1\u7AEF\u94F8\u9020\uFF0C\u521B\u5EFA\u540E\u4E0D\u53EF\u8986\u76D6\u3002"},studies:{title:"\u7814\u7A76\u5217\u8868",empty:"\u8FD8\u6CA1\u6709 Study\u3002\u4ECE\u4E0A\u65B9\u521B\u5EFA\u4E00\u4E2A\u79BB\u7EBF Study\u3002"},study:{title:"Study {{studyId}}",mode:"\u6A21\u5F0F",intervention:"\u5E72\u9884\u7C7B\u578B",target:"\u76EE\u6807\u539F\u5219",plannedPairs:"\u8BA1\u5212\u914D\u5BF9",run:"\u6267\u884C",finished:"\u5DF2\u5B8C\u6210",running:"\u8FDB\u884C\u4E2D",notRun:"\u672A\u6267\u884C",report:"\u62A5\u544A",preflight:"\u8FD0\u884C\u9884\u68C0",runOffline:"\u79BB\u7EBF\u6267\u884C",back:"\u539F\u5219\u8BC4\u4F30",statusTitle:"Study \u72B6\u6001",readOnly:"\u53EA\u8BFB Study",openReport:"\u6253\u5F00\u62A5\u544A",runDry:"\u5BBF\u4E3B\u6F14\u7EC3",requestF2:"\u8BF7\u6C42 F2 \u771F\u5B9E\u5BBF\u4E3B\u8FD0\u884C",modesNote:"\u79BB\u7EBF Stub \u540C\u6B65\u6267\u884C\u5E76\u9A8C\u8BC1\u5951\u7EA6\u7BA1\u7EBF\uFF1B\u5BBF\u4E3B\u6F14\u7EC3\u5F02\u6B65\u6267\u884C\u4E14\u96F6\u6A21\u578B\u8C03\u7528\uFF1BF2 \u771F\u5B9E\u5BBF\u4E3B\u8FD0\u884C\u9700\u8981\u672C Study \u5185\u5B58\u5728\u5DF2\u6279\u51C6\uFF08APPROVED\uFF09\u7684 Stage R \u6388\u6743\u3002",accepted:{dryRun:"\u5BBF\u4E3B\u6F14\u7EC3\u5DF2\u53D7\u7406\u2014\u2014\u6B63\u5728\u8F6E\u8BE2\u68C0\u67E5\u6E05\u5355\u3002",f2:"F2 \u8BF7\u6C42\u5DF2\u53D7\u7406\u2014\u2014\u6B63\u5728\u8F6E\u8BE2\u7ED3\u7B97\u7ED3\u679C\u3002"},snapshot:{title:"\u51BB\u7ED3\u751F\u4EA7\u5FEB\u7167",frozenAt:"\u51BB\u7ED3\u65F6\u95F4",route:"\u751F\u4EA7\u8DEF\u7531",budget:"\u751F\u4EA7\u9884\u7B97",divergence:"\u8D26\u672C active \u4F46\u8FD0\u884C\u65F6\u672A\u6FC0\u6D3B",activationDegraded:"\u51BB\u7ED3\u65F6\u6FC0\u6D3B\u6570\u636E\u4E0D\u53EF\u7528\uFF08\u771F\u76F8\u672A\u77E5\uFF0C\u7EDD\u975E\u96F6\uFF09",matchesProduction:"\u4E0E\u751F\u4EA7\u914D\u7F6E\u4E00\u81F4"},runs:{title:"\u63A7\u5236\u53F0\u8FD0\u884C\uFF08\u5F02\u6B65\u5951\u7EA6\uFF09",empty:"\u5C1A\u65E0\u63A7\u5236\u53F0\u8FD0\u884C\u2014\u2014\u4F7F\u7528\u5BBF\u4E3B\u6F14\u7EC3\u6216 F2 \u8BF7\u6C42\u3002",ledgerProblem:"\u8FD0\u884C\u8D26\u672C\u65E0\u6CD5\u8BFB\u53D6\u2014\u2014\u4E0B\u65B9\u5386\u53F2\u4E0D\u53EF\u4FE1"}},preflight:{status:"\u9884\u68C0\u72B6\u6001"},report:{title:"Report V2",target:"\u76EE\u6807",endpoint:"\u4E3B\u8981\u7EC8\u70B9",fidelity:"Treatment Fidelity\uFF08\u6CE8\u5165\u5FE0\u5B9E\u5EA6\uFF09",contamination:"Control \u6C61\u67D3",evictions:"\u5BB9\u91CF\u6324\u51FA",ittNote:"\u8BA1\u5212\u9002\u7528\u914D\u5BF9 {{planned}} \xB7 \u5B8C\u5168\u786E\u5B9A {{determined}} \xB7 \u672A\u77E5\u4FA7 {{unknown}} \xB7 \u4E0D\u9002\u7528 {{na}}\uFF08\u4E0D\u8FDB\u5165\u5206\u6BCD\uFF09",noExaminerBlock:"\u8BE5\u62A5\u544A\u65E9\u4E8E v0.9 \u5951\u7EA6\uFF08\u65E0 examiner \u533A\u5757\uFF09\u3002",offlineNote:"\u79BB\u7EBF Stub \u7ED3\u679C\u4EC5\u9A8C\u8BC1\u5951\u7EA6\u7BA1\u7EBF\uFF0C\u7EDD\u4E0D\u4EE3\u8868\u771F\u5B9E\u5BBF\u4E3B\u884C\u4E3A\u3002\u771F\u5B9E\u5BBF\u4E3B\u5B9E\u9A8C\u9700\u8981\u62E5\u6709\u8005\u5355\u72EC\u6388\u6743\u3002",back:"\u6267\u884C\u4E0E\u8BC1\u636E",missing:"\u5C1A\u65E0 Report V2\u2014\u2014\u8BF7\u5148\u5728 Study \u9875\u8FD0\u884C\u79BB\u7EBF\u6267\u884C\u3002",replay:"\u91CD\u653E\u6821\u9A8C",limitations:"\u9650\u5236\u8BF4\u660E",handoff:{title:"\u62E5\u6709\u8005\u51B3\u7B56\u4EA4\u63A5",note:"\u62A5\u544A\u4E3A\u51B3\u7B56\u63D0\u4F9B\u4F9D\u636E\uFF1B\u62E5\u6709\u8005\u5728\u65E2\u6709\u539F\u5219\u6CBB\u7406\u5DE5\u4F5C\u6D41\u4E2D\u4F5C\u51FA\u51B3\u5B9A\u3002Examiner \u7EDD\u4E0D\u81EA\u884C\u53D8\u66F4\u751F\u547D\u5468\u671F\u3001RuleCode \u6216\u6FC0\u6D3B\u72B6\u6001\u3002",openGovernance:"\u6253\u5F00\u539F\u5219\u6CBB\u7406",refresh:"\u5237\u65B0\u62A5\u544A"},production:{title:"\u751F\u4EA7\u89C2\u5BDF\uFF08\u72EC\u7ACB\u901A\u9053\uFF09",note:"\u540C\u4E00\u539F\u5219\u7684\u771F\u5B9E\u8FD0\u884C\u8BC1\u636E\u3002\u5B83\u4E0E\u4E0A\u65B9\u53D7\u63A7 A/B \u7ED3\u679C\u4E92\u8865\uFF0C\u4F46\u7EDD\u4E0D\u5408\u5E76\u8FDB\u5176\u6570\u5B57\u3002",missing:"\u6B64\u5904\u65E0\u6CD5\u83B7\u53D6\u76EE\u6807\u539F\u5219\u7684\u751F\u4EA7\u8BC1\u636E\u3002"}},created:"Study {{studyId}} \u5DF2\u521B\u5EFA\u3002",runDone:"\u79BB\u7EBF\u6267\u884C\u5B8C\u6210\uFF1A{{count}} \u4E2A\u5355\u5143\u6210\u529F\u3002",reportGenerated:"\u62A5\u544A\u5DF2\u751F\u6210\uFF08{{status}}\uFF09\u3002",evaluation:{title:"\u539F\u5219\u8BC4\u4F30",configureCta:"\u914D\u7F6E Study",noActive:"\u6B64\u5DE5\u4F5C\u533A\u6CA1\u6709 active \u539F\u5219\u2014\u2014\u8BF7\u5148\u6FC0\u6D3B\u4E00\u6761\u539F\u5219\u518D\u8BC4\u4F30\u3002",loadingEvidence:"\u6B63\u5728\u52A0\u8F7D\u751F\u4EA7\u8BC1\u636E\u2026",refresh:"\u5237\u65B0\u8BC1\u636E",openGovernance:"\u6253\u5F00\u539F\u5219\u6CBB\u7406",selectPrinciple:"\u9009\u62E9\u4E00\u6761\u539F\u5219\u67E5\u770B\u5176\u751F\u4EA7\u8BC1\u636E\u3002",openStudy:"\u6253\u5F00"},evidence:{runtimeDeactivated:"\u8FD0\u884C\u65F6\u5DF2\u64A4\u9500",ruleCount:"RuleCode\uFF08\u8D26\u672C\uFF09",painRefs:"Pain \u6EAF\u6E90",evaluability:"\u53EF\u8BC4\u4F30\u6027",painPrevented:"\u5DF2\u9884\u9632 Pain",activation:{title:"\u8FD0\u884C\u65F6\u6FC0\u6D3B",promptRows:"\u63D0\u793A\u8BCD\u6FC0\u6D3B",ruleCodeRows:"RuleCode \u6FC0\u6D3B"},injection:{title:"\u63D0\u793A\u8BCD\u6CE8\u5165\uFF08\u751F\u4EA7\u6295\u5F71\uFF09",noRows:"\u8BE5\u539F\u5219\u6682\u65E0\u6CE8\u5165\u884C\uFF08\u4E0D\u53EF\u7528\u7684\u6570\u636E\u901A\u9053\u7EDD\u4E0D\u4F1A\u663E\u793A\u4E3A\u96F6\u4E8B\u4EF6\uFF09\u3002",budget:"\u9884\u7B97",projectionNote:"\u6295\u5F71\u53EA\u9884\u6D4B\u751F\u4EA7\u6CE8\u5165\u8DEF\u5F84\u201C\u4F1A\u201D\u6295\u9012\u4EC0\u4E48\u2014\u2014\u5B83\u4E0D\u662F\u6A21\u578B\u5DF2\u6D88\u8D39\u5185\u5BB9\u7684\u8BC1\u660E\u3002"},receipts:{title:"\u56DE\u6267",effects:"\u6548\u679C",presence:"\u5B58\u5728"},audit:{title:"\u5E72\u9884\u8BC1\u636E\u5BA1\u8BA1",deliveries:"\u6295\u9012",applications:"\u5E94\u7528",episodes:"\u884C\u4E3A\u4E8B\u4EF6",effects:"\u6548\u679C",outcomes:"\u7ED3\u679C",unresolved:"\u672A\u89E3\u6790\u5F15\u7528",loadedSuffix:"\uFF08\u5DF2\u52A0\u8F7D\uFF0C\u4ECD\u6709\u66F4\u591A\uFF09",hasMoreNote:"\u672C\u8BFB\u53D6\u7A97\u53E3\u4E4B\u5916\u4ECD\u6709\u8BB0\u5F55\u2014\u2014\u4E0A\u65B9\u6570\u5B57\u662F\u5DF2\u52A0\u8F7D\u7684\u5206\u9875\uFF0C\u4E0D\u662F\u8BC1\u636E\u603B\u91CF\u3002",ladder:"\u786E\u8BA4\u9636\u68AF\uFF08\u7EDD\u4E0D\u81EA\u52A8\u5347\u7EA7\uFF09",asOf:"\u5BA1\u8BA1\u622A\u81F3"},asOf:"\u8BFB\u53D6\u65F6\u95F4",outcomes:{title:"\u62E5\u6709\u8005\u7ED3\u679C\u53CD\u9988\uFF08\u6700\u8FD1\uFF09"}},configure:{back:"\u539F\u5219\u8BC4\u4F30",title:"Study \u914D\u7F6E",subtitle:"\u8FD9\u6B21\u8BC4\u4F30\u7A76\u7ADF\u6BD4\u8F83\u4EC0\u4E48\uFF1F\u5728\u54EA\u4E9B\u51BB\u7ED3\u8F93\u5165\u4E4B\u4E0B\uFF1F",fullNote:"\u5BF9\u7167\u7EC4\uFF1A\u4E0D\u542B\u76EE\u6807\u539F\u5219\u7684\u5B8C\u6574\u5BBF\u4E3B\u751F\u6548\u5E93\u3002\u5B9E\u9A8C\u7EC4\uFF1A\u540C\u4E00\u5E93 + \u76EE\u6807\u539F\u5219\u3002\u76EE\u6807\u539F\u5219\u662F\u552F\u4E00\u8BA1\u5212\u5E72\u9884\u53D8\u91CF\u3002",isolatedNote:"\u8BCA\u65AD\u6A21\u5F0F\uFF1A\u5BF9\u7167\u7EC4\u4E3A\u7A7A\uFF08\u6240\u6709 PD \u539F\u5219\u5173\u95ED\uFF09\uFF0C\u5B9E\u9A8C\u7EC4\u4EC5\u542B\u76EE\u6807\u539F\u5219\u3002",suite:{title:"Challenge \u5957\u4EF6"},readiness:{title:"\u5BBF\u4E3B\u6267\u884C\u5C31\u7EEA"},difference:{title:"\u5B9E\u9A8C\u4E0E\u751F\u4EA7\u914D\u7F6E\u5DEE\u5F02",note:"Study \u51BB\u7ED3\u81EA\u5DF1\u7684\u9884\u7B97\u5E76\u786E\u5B9A\u6027\u6E32\u67D3\u4E24\u7EC4\uFF1B\u51BB\u7ED3\u7684\u751F\u4EA7\u5FEB\u7167\u8BB0\u5F55\u6BCF\u4E00\u5904\u68C0\u6D4B\u5230\u7684\u5DEE\u5F02\uFF08\u5982 EXPERIMENT_CONFIGURATION_DIFFERS_FROM_PRODUCTION \u6807\u8BB0\uFF09\u3002"},summary:"\u76EE\u6807 {{target}} \xB7 \u5957\u4EF6 {{suite}} \xB7 \u8BA1\u5212 {{pairs}} \u5BF9"},errors:{unavailable:"Examiner \u7814\u7A76\u5F15\u64CE\u5728\u6B64\u5B89\u88C5\u4E2D\u4E0D\u53EF\u7528\uFF08\u5B89\u88C5\u5305\u672A\u5305\u542B\u7814\u7A76\u6A21\u5757\uFF09\u3002",create:"\u521B\u5EFA Study \u5931\u8D25\u3002",preflight:"\u9884\u68C0\u5931\u8D25\u3002",run:"\u79BB\u7EBF\u6267\u884C\u5931\u8D25\u3002",report:"\u62A5\u544A\u751F\u6210\u5931\u8D25\u3002",evidence:"\u52A0\u8F7D\u751F\u4EA7\u8BC1\u636E\u5931\u8D25\u3002",status:"\u52A0\u8F7D Study \u72B6\u6001\u5931\u8D25\u3002"}},debt:{eyebrow:"\u539F\u5219\u503A\u52A1",title:"\u539F\u5219\u503A\u52A1\u7BA1\u7406",subtitle:"\u5BA1\u67E5\u90A3\u4E9B\u672A\u6FC0\u6D3B\u3001\u957F\u671F\u505C\u6EDE\u6216\u53EF\u80FD\u6210\u4E3A\u6280\u672F/\u884C\u4E3A\u8D1F\u503A\u7684\u539F\u5219\u3002",emptyTitle:"\u6682\u65E0\u539F\u5219\u503A\u52A1",emptyDescription:"\u592A\u68D2\u4E86\uFF01\u4F60\u7684\u6240\u6709\u6D3B\u8DC3\u539F\u5219\u5747\u8FD0\u884C\u6B63\u5E38\uFF0C\u6CA1\u6709\u53D1\u73B0\u957F\u671F\u672A\u6FC0\u6D3B\u6216\u88AB\u667E\u5728\u5BA1\u6279\u961F\u5217\u91CC\u7684\u60C5\u51B5\u3002",reasonNeverActivated:"\u8BE5\u539F\u5219\u5DF2\u88AB\u6279\u51C6\uFF0C\u4F46\u4ECE\u672A\u771F\u6B63\u90E8\u7F72\u5230\u4EFB\u4F55\u8FD0\u884C\u901A\u9053\uFF08\u5982\u63D0\u793A\u8BCD\u3001RuleHost\uFF09\u3002",reasonStagnant:"\u8BE5\u539F\u5219\u7684\u5BA1\u6279\u8BF7\u6C42\u5DF2\u5728\u961F\u5217\u4E2D\u6EDE\u7559\u8D85\u8FC7 7 \u5929\uFF0C\u53EF\u80FD\u5DF2\u88AB\u9057\u5FD8\u3002",suggestedAction:"\u5EFA\u8BAE\u64CD\u4F5C",actionArchive:"\u5F52\u6863",actionDeactivate:"\u505C\u7528\u901A\u9053",actionKeep:"\u4FDD\u7559\u89C2\u5BDF",confirmArchive:"\u5F52\u6863\u8BE5\u539F\u5219\u4F1A\u5C06\u5176\u79FB\u51FA\u5F53\u524D\u6D3B\u8DC3\u539F\u5219\u5E93\uFF0C\u786E\u8BA4\u5F52\u6863\u5417\uFF1F",confirmDeactivate:"\u505C\u7528\u8BE5\u901A\u9053\u5C06\u4F7F\u8BE5\u539F\u5219\u4E0D\u518D\u5728\u8FD0\u884C\u65F6\u5BF9\u667A\u80FD\u4F53\u8FDB\u884C\u62E6\u622A\uFF0C\u786E\u8BA4\u505C\u7528\u5417\uFF1F",deactivateSuccess:"\u901A\u9053\u505C\u7528\u6210\u529F\u3002",deactivateFailed:"\u505C\u7528\u901A\u9053\u5931\u8D25\u3002",archiveSuccess:"\u539F\u5219\u5F52\u6863\u6210\u529F\u3002",archiveFailed:"\u539F\u5219\u5F52\u6863\u5931\u8D25\u3002",undoAction:"\u64A4\u9500",undoSuccess:"\u64CD\u4F5C\u5DF2\u64A4\u9500\u3002",undoFailed:"\u64A4\u9500\u64CD\u4F5C\u5931\u8D25\u3002",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u539F\u5219\u503A\u52A1\u6570\u636E\uFF0C\u8BF7\u5C1D\u8BD5\u5237\u65B0\u9875\u9762\u3002",daysSinceAgo:"{{count}} \u5929\u524D",demoteTooltip:"\u964D\u6743\u7AEF\u70B9\u5F00\u53D1\u4E2D",principleAriaLabel:"\u539F\u5219\u503A\u52A1 {{id}}",listAriaLabel:"\u539F\u5219\u503A\u52A1\u5217\u8868"},welcome:{title:"\u6B22\u8FCE\u4F7F\u7528 Principles Disciple",subtitle:"\u628A\u4F60\u5BF9\u667A\u80FD\u4F53\u7684\u53CD\u590D\u7EA0\u6B63\uFF0C\u6C89\u6DC0\u4E3A\u53EF\u5BA1\u67E5\u3001\u53EF\u64A4\u56DE\u7684\u884C\u4E3A\u539F\u5219\u3002",stateSaveError:"\u65E0\u6CD5\u4FDD\u5B58\u5F15\u5BFC\u8FDB\u5EA6\uFF0C\u8BF7\u68C0\u67E5\u6D4F\u89C8\u5668\u5B58\u50A8\u6743\u9650\u540E\u91CD\u8BD5\u3002",stepIndicator:"\u7B2C {{current}} \u6B65 / \u5171 {{total}} \u6B65",step1:{title:"PD \u662F\u4EC0\u4E48\uFF1F",description:"\u62E5\u6709\u8005\u6CBB\u7406\u4E0B\u7684\u667A\u80FD\u4F53\u884C\u4E3A\u5185\u5316\u7CFB\u7EDF\u3002PD \u628A\u884C\u4E3A\u8BC1\u636E\u6C89\u6DC0\u4E3A\u53EF\u5BA1\u67E5\u3001\u53EF\u56DE\u6EDA\u7684\u539F\u5219\uFF0C\u8BA9\u539F\u5219\u8FDB\u5165\u667A\u80FD\u4F53\u7684\u540E\u7EED\u884C\u4E3A\u3002",circuitLabel:"\u6838\u5FC3\u6CBB\u7406\u56DE\u8DEF",circuitNodes:{evidence:"\u884C\u4E3A\u8BC1\u636E",principle:"\u539F\u5219",ownerGate:"\u62E5\u6709\u8005\u5BA1\u67E5",behavior:"\u884C\u4E3A\u53D8\u66F4"},startButton:"\u5F00\u59CB",skipButton:"\u8DF3\u8FC7\u5F15\u5BFC"},step2:{title:"\u770B\u4E00\u6B21\u5B8C\u6574\u6CBB\u7406\u56DE\u8DEF\u6F14\u793A",description:"\u8FD9\u662F\u7528\u6A21\u62DF\u8BC1\u636E\u505A\u7684\u53D7\u63A7\u6F14\u793A\u3002\u771F\u5B9E\u4F7F\u7528\u65F6\uFF0C\u7531\u4F60\u7684\u667A\u80FD\u4F53\u901A\u8FC7 pd-pain-signal \u6280\u80FD\u4EA7\u751F\u8BC1\u636E\u3002",runDemoButton:"\u8FD0\u884C\u6F14\u793A",demoRunning:"\u6F14\u793A\u8FD0\u884C\u4E2D...",demoComplete:"\u6F14\u793A\u5B8C\u6210",demoFailed:"\u6F14\u793A\u5931\u8D25",demoSimulatedNote:"\u6B64\u8BC1\u636E\u4E3A\u6F14\u793A\u6A21\u62DF\u6570\u636E\u3002",nextButton:"\u4E0B\u4E00\u6B65",evidenceLabel:"\u8BC1\u636E\uFF08\u6A21\u62DF\uFF09",candidateLabel:"\u5019\u9009\u539F\u5219",ownerGateLabel:"\u62E5\u6709\u8005\u5BA1\u67E5\uFF1A\u6279\u51C6 / \u4FEE\u6539 / \u62D2\u7EDD",activationLabel:"\u6FC0\u6D3B\u7ED3\u679C",rollbackLabel:"\u53EF\u56DE\u6EDA\u8DEF\u5F84\u5DF2\u5C31\u7EEA",stages:{evidenceSeed:"\u8BC1\u636E\uFF08\u6A21\u62DF\uFF09",principleProposal:"\u5019\u9009\u539F\u5219",ownerReview:"\u62E5\u6709\u8005\u5BA1\u67E5",activation:"\u6FC0\u6D3B\u7ED3\u679C",followUpObservation:"\u540E\u7EED\u89C2\u5BDF",rollbackProof:"\u53EF\u56DE\u6EDA\u8DEF\u5F84\u5DF2\u5C31\u7EEA"}},step3:{title:"\u5E38\u7528\u659C\u6760\u547D\u4EE4",description:"\u5728\u4E0E\u667A\u80FD\u4F53\u5BF9\u8BDD\u65F6\u8F93\u5165\u8FD9\u4E9B\u547D\u4EE4\u6765\u63A7\u5236 PD\u3002",commandsIntro:"\u4EE5\u4E0B\u662F 7 \u4E2A\u6838\u5FC3\u547D\u4EE4\uFF0C\u8F93\u5165 /pd-help \u67E5\u770B\u5B8C\u6574\u5217\u8868\u3002",commandDescriptions:{pdInit:"\u521D\u59CB\u5316\u5DE5\u4F5C\u533A\uFF08\u751F\u6210 PRINCIPLES.md\u3001THINKING_OS.md \u7B49\uFF09",pdStatus:"\u67E5\u770B\u7CFB\u7EDF\u72B6\u6001\uFF08GFI\u3001Pain \u8BCD\u5178\uFF09",pdPain:"\u4ECE OpenClaw \u4F1A\u8BDD\u62A5\u544A pain",pdHelp:"\u663E\u793A\u6240\u6709\u547D\u4EE4\u548C\u4F7F\u7528\u6307\u5357",pdContext:"\u63A7\u5236\u4E0A\u4E0B\u6587\u6CE8\u5165",pdFocus:"\u7BA1\u7406 CURRENT_FOCUS.md"},nextButton:"\u4E0B\u4E00\u6B65",emptyListFallback:"\u547D\u4EE4\u5217\u8868\u52A0\u8F7D\u5931\u8D25\uFF0C\u8F93\u5165 /pd-help \u67E5\u770B\u5B8C\u6574\u547D\u4EE4\u5217\u8868\u3002"},step4:{title:"\u51C6\u5907\u597D\u8BB0\u5F55\u771F\u5B9E\u8BC1\u636E",description:"\u5F53\u4F60\u4E0B\u6B21\u4F7F\u7528\u667A\u80FD\u4F53\u65F6\uFF0C\u5982\u679C\u667A\u80FD\u4F53\u72AF\u9519\u6216\u4F60\u91CD\u590D\u7EA0\u6B63\u4E86\u5B83\uFF0C\u544A\u8BC9\u667A\u80FD\u4F53\uFF1A'\u7528 pd-pain-signal \u8BB0\u5F55\u4E00\u4E0B'\u3002",examplePrompt:"\u7ED9\u667A\u80FD\u4F53\u7684\u793A\u4F8B\u63D0\u793A\uFF1A",examplePromptText:"\u6211\u521A\u7EA0\u6B63\u4E86\u4F60\u5173\u4E8E X \u7684\u95EE\u9898\u3002\u7528 pd-pain-signal \u628A\u8FD9\u4E2A\u8BB0\u5F55\u4E3A pain signal\u3002",tryNowButton:"\u6211\u73B0\u5728\u5C31\u8BD5\u8BD5\uFF082 \u5C0F\u65F6\u7A97\u53E3\uFF09",goToFocusButton:"\u77E5\u9053\u4E86\uFF0C\u5148\u770B Focus",skipButton:"\u6682\u65F6\u8DF3\u8FC7",windowHint:"\u6211\u4EEC\u4F1A\u5728 2 \u5C0F\u65F6\u540E\u67E5\u770B\u3002\u4E0D\u5F3A\u5236\u2014\u2014\u4F60\u968F\u65F6\u53EF\u4EE5\u7A0D\u540E\u8BB0\u5F55\u8BC1\u636E\u3002",pollingActive:"\u6B63\u5728\u76D1\u542C\u8BC1\u636E... \u6211\u4EEC\u4F1A\u6BCF 30 \u79D2\u68C0\u67E5\u4E00\u6B21\uFF0C\u6301\u7EED 2 \u5C0F\u65F6\u3002",stopPollingButton:"\u505C\u6B62\u5E76\u7EE7\u7EED",evidenceFound:"\u68C0\u6D4B\u5230\u8BC1\u636E\uFF01\u4F60\u73B0\u5728\u53EF\u4EE5\u5728 Focus \u9875\u9762\u67E5\u770B\u3002",timeoutHint:"2 \u5C0F\u65F6\u5185\u672A\u68C0\u6D4B\u5230\u8BC1\u636E\u3002\u6CA1\u5173\u7CFB\u2014\u2014\u4F60\u968F\u65F6\u53EF\u4EE5\u7528 pd-pain-signal \u8BB0\u5F55\u8BC1\u636E\u3002",pollingError:"\u65E0\u6CD5\u68C0\u67E5\u8BC1\u636E\u3002\u8BC1\u636E\u670D\u52A1\u53EF\u80FD\u4E0D\u53EF\u7528\u3002",retryButton:"\u91CD\u8BD5"},progress:{step1:"\u6B22\u8FCE",step2:"\u6F14\u793A",step3:"\u547D\u4EE4",step4:"\u8BC1\u636E"}},failedTasks:{title:"\u5931\u8D25\u4EFB\u52A1",subtitle:"\u7BA1\u9053\u4E2D\u5931\u8D25\u6216\u9700\u8981\u4EBA\u5DE5\u5BA1\u67E5\u7684\u4EFB\u52A1",empty:"\u5F53\u524D\u67E5\u8BE2\u8303\u56F4\u5185\u6CA1\u6709\u5931\u8D25\u4EFB\u52A1\u3002\u8FD9\u4E0D\u7B49\u4E8E\u7BA1\u9053\u5065\u5EB7\u2014\u2014\u8BF7\u7ED3\u5408\u4E0B\u65B9\u5B66\u4E60\u961F\u5217\u72B6\u6001\u5224\u65AD\u3002",pipeline:{title:"\u5B66\u4E60\u961F\u5217\u72B6\u6001",statusHealthy:"\u6B63\u5E38\u63A8\u8FDB",statusBacklogged:"\u6709\u79EF\u538B\uFF08\u4ECD\u5728\u63A8\u8FDB\uFF09",statusStalled:"\u7591\u4F3C\u505C\u6EDE",statusDisabled:"\u6D88\u8D39\u8005\u5DF2\u7981\u7528",statusUnknown:"\u72B6\u6001\u672A\u77E5",nextActionPrefix:"\u5EFA\u8BAE\uFF1A"},error:"\u52A0\u8F7D\u5931\u8D25\u4EFB\u52A1\u5931\u8D25",disabled:"\u5931\u8D25\u4EFB\u52A1\u53EF\u89C2\u6D4B\u6027\u5DF2\u7981\u7528\u3002\u8BF7\u5728 .pd/config.yaml \u4E2D\u542F\u7528 'failed_tasks_observability' \u4EE5\u67E5\u770B\u3002",createDraft:"\u521B\u5EFA\u53CD\u9988\u8349\u7A3F",recover:"\u7EE7\u7EED\u6F14\u5316",recoverConfirmTitle:"\u6062\u590D\u6B64\u6F14\u5316\u4EFB\u52A1\uFF1F",recoverConfirmStatus:"\u5F53\u524D\u72B6\u6001",recoverConfirmActionLabel:"\u6062\u590D\u52A8\u4F5C",recoverConfirmActionDesc:"\u91CD\u7F6E\u4EFB\u52A1\u5E76\u5141\u8BB8\u8FD0\u884C\u65F6\u91CD\u65B0\u6267\u884C",recoverConfirmImpactLabel:"\u5F71\u54CD",recoverConfirmImpactDesc:"\u65E2\u6709\u4EA7\u7269\u5C06\u88AB\u4FDD\u7559\uFF0C\u5E76\u5C06\u521B\u5EFA\u4E00\u6B21\u65B0\u7684\u6267\u884C\u5C1D\u8BD5\u3002",recoverConfirmAttempts:"\u5DF2\u7528\u91CD\u8BD5\u6B21\u6570",recoverExhaustedWarning:"\u6B64\u4EFB\u52A1\u5DF2\u7528\u5B8C\u5168\u90E8\u91CD\u8BD5\u6B21\u6570\uFF08{{attempt}}/{{max}}\uFF09\uFF0C\u666E\u901A\u6062\u590D\u5C06\u88AB\u62D2\u7EDD\u3002",recoverConfirmForceButton:"\u5F3A\u5236\u6062\u590D",recoverConfirmForceImpactDesc:"\u5F3A\u5236\u91CD\u7F6E\u4EFB\u52A1\uFF1A\u6E05\u7A7A\u9519\u8BEF\u4E0E\u79DF\u7EA6\u8BB0\u5F55\uFF0C\u91CD\u8BD5\u4E0A\u9650\u63D0\u5347 3 \u6B21\u5E76\u521B\u5EFA\u4E00\u6B21\u65B0\u7684\u6267\u884C\u5C1D\u8BD5\u3002\u65E2\u6709\u4EA7\u7269\u5C06\u88AB\u4FDD\u7559\u3002",recoverConfirmButton:"\u6062\u590D",recoverSuccess:"\u6062\u590D\u5DF2\u63A5\u53D7\u2014\u2014\u4EFB\u52A1\u5DF2\u91CD\u65B0\u8FDB\u5165\u5F85\u5904\u7406\u72B6\u6001",recoverFailed:"\u6062\u590D\u5931\u8D25",awaitingOwnerDecision:"\u7B49\u5F85\u62E5\u6709\u8005\u51B3\u7B56",goGovernanceFocus:"\u524D\u5F80\u6CBB\u7406\u7126\u70B9",taskId:"\u4EFB\u52A1 ID",painId:"Pain ID",kind:"\u7C7B\u578B",status:"\u72B6\u6001",lastError:"\u6700\u8FD1\u9519\u8BEF",attempts:"\u5C1D\u8BD5\u6B21\u6570",lastAttempt:"\u6700\u8FD1\u5C1D\u8BD5",noPainId:"\u2014",partialResults:"\u4EC5\u663E\u793A\u524D {shown} \u6761\uFF0C\u5171 {total} \u6761\u3002\u8BF7\u7F29\u5C0F\u7B5B\u9009\u8303\u56F4\u6216\u4F7F\u7528 'pd errors list --offset' \u67E5\u770B\u66F4\u591A\u3002",detailToggle:"\u5C55\u5F00/\u6536\u8D77\u4EFB\u52A1\u8BE6\u60C5",detailError:"\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5\u5931\u8D25",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u65B0\u65F6\u95F4",runsTitle:"\u6267\u884C\u5386\u53F2",runAttempt:"\u5C1D\u8BD5",runStarted:"\u5F00\u59CB\u65F6\u95F4",runEnded:"\u7ED3\u675F\u65F6\u95F4",runReason:"\u539F\u56E0",runErrorCategory:"\u9519\u8BEF\u7C7B\u522B",noRuns:"\u8BE5\u4EFB\u52A1\u6682\u65E0\u6267\u884C\u8BB0\u5F55\u3002"}},components:{errorBoundary:{title:"\u53D1\u751F\u9519\u8BEF",description:"\u9875\u9762\u52A0\u8F7D\u65F6\u53D1\u751F\u9519\u8BEF",retry:"\u91CD\u8BD5",reportAction:"\u62A5\u544A\u6B64\u95EE\u9898"},zoneSection:{empty:"\u6682\u65E0\u6570\u636E",viewAll:"\u67E5\u770B\u5168\u90E8"},taskCard:{approve:"\u6279\u51C6",reject:"\u62D2\u7EDD",cleanup:"\u6E05\u7406",undo:"\u64A4\u9500",undoCountdown:"\u64A4\u9500 ({{count}}\u79D2)",evidence:"\u8BC1\u636E",summary:"\u6458\u8981",why:"\u539F\u56E0",whatHappens:"\u5F71\u54CD"},evidencePanel:{summary:"\u6458\u8981",why:"\u539F\u56E0",whatHappens:"\u5F71\u54CD",evidenceItems:"\u8BC1\u636E\u9879"},pageHeader:{refresh:"\u5237\u65B0",lastUpdated:"\u6700\u540E\u66F4\u65B0: {{time}}",justNow:"\u521A\u521A",minutesAgo:"{{count}}\u5206\u949F\u524D",hoursAgo:"{{count}}\u5C0F\u65F6\u524D",daysAgo:"{{count}}\u5929\u524D"},themeToggle:{light:"\u4EAE\u8272\u6A21\u5F0F",dark:"\u6697\u8272\u6A21\u5F0F"},languageSwitcher:{chinese:"\u4E2D\u6587",english:"English"},sidebar:{collapse:"\u6298\u53E0\u4FA7\u8FB9\u680F",expand:"\u5C55\u5F00\u4FA7\u8FB9\u680F",focus:"\u6CBB\u7406\u7126\u70B9",pain:"\u884C\u4E3A\u8BC1\u636E",principles:"\u539F\u5219\u5BA1\u67E5",activation:"\u751F\u6548\u60C5\u51B5",debt:"\u539F\u5219\u503A\u52A1",examiner:"Examiner \u9A8C\u8BC1",controlCenter:"\u63A7\u5236\u4E2D\u5FC3",reportProblem:"\u4EA7\u54C1\u53CD\u9988",failedTasks:"\u5931\u8D25\u4EFB\u52A1",settings:"\u8BBE\u7F6E",update:"\u66F4\u65B0",pendingApprovalsAria:"{{count}} \u6761\u5F85\u5BA1\u6279\u539F\u5219",degradedSignalsAria:"{{count}} \u4E2A\u7CFB\u7EDF\u964D\u7EA7\u4FE1\u53F7",intent:"\u62E5\u6709\u8005\u610F\u56FE",themeToLight:"\u5207\u6362\u4EAE\u8272\u6A21\u5F0F",themeToDark:"\u5207\u6362\u6697\u8272\u6A21\u5F0F",switchLanguage:"\u5207\u6362\u8BED\u8A00",signOut:"\u9000\u51FA",openMenu:"\u6253\u5F00\u5BFC\u822A\u83DC\u5355",navigation:"\u4E3B\u5BFC\u822A",navigationDescription:"\u5BFC\u822A\u5230\u63A7\u5236\u53F0\u5404\u9875\u9762\uFF1B\u9009\u62E9\u540E\u62BD\u5C49\u81EA\u52A8\u5173\u95ED\u3002"},approvalCard:{confidence:{high:"\u9AD8\u7F6E\u4FE1",medium:"\u4E2D\u7F6E\u4FE1",low:"\u4F4E\u7F6E\u4FE1"},viewDetail:"\u67E5\u770B\u8BE6\u60C5",approve:"\u6279\u51C6",reject:"\u62D2\u7EDD",empty:"\u6682\u65E0\u5F85\u5BA1\u6279\u9879\u76EE",stats:{pending:"\u5F85\u5904\u7406",approved:"\u5DF2\u6279\u51C6",rejected:"\u5DF2\u62D2\u7EDD"},status:{approved:"\u5DF2\u6279\u51C6",rejected:"\u5DF2\u62D2\u7EDD",cancelled:"\u5DF2\u53D6\u6D88"},decidedBy:"\u51B3\u5B9A\u8005\uFF1A{{by}}",channel:{code_tool_hook:"RuleHost",defer_archive:"\u5EF6\u8FDF\u5F52\u6863",prompt:"\u63D0\u793A\u8BCD\u6CE8\u5165",skill:"\u6280\u80FD\u6FC0\u6D3B\uFF08\u5DF2\u505C\u7528\uFF09"},retired:"\u6B64\u901A\u9053\u5DF2\u505C\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u5BA1\u6279\u64CD\u4F5C",riskLevel:"\u98CE\u9669\u7EA7\u522B"},approvalDetail:{title:"\u5BA1\u6279\u8BE6\u60C5",whyRecommended:"\u4E3A\u4EC0\u4E48\u63A8\u8350",confidenceExplanation:"\u7F6E\u4FE1\u5EA6\u8BF4\u660E",whatHappens:"\u6279\u51C6\u540E\u4F1A\u53D1\u751F\u4EC0\u4E48",ifReject:"\u5982\u679C\u62D2\u7EDD",approve:"\u6279\u51C6",reject:"\u62D2\u7EDD"},rejectionDialog:{title:"\u62D2\u7EDD\u539F\u56E0",description:"\u8BF7\u8BF4\u660E\u4E3A\u4EC0\u4E48\u62D2\u7EDD\u6B64\u5BA1\u6279\u3002\u8FD9\u6709\u52A9\u4E8E\u7CFB\u7EDF\u6539\u8FDB\u672A\u6765\u7684\u63A8\u8350\u3002",placeholder:"\u8F93\u5165\u62D2\u7EDD\u539F\u56E0\uFF08\u81F3\u5C1110\u4E2A\u5B57\u7B26\uFF09\u2026",tooShort:"\u62D2\u7EDD\u539F\u56E0\u81F3\u5C11\u9700\u898110\u4E2A\u5B57\u7B26",cancel:"\u53D6\u6D88",submit:"\u786E\u8BA4\u62D2\u7EDD"},onboardingReset:{title:"\u5F15\u5BFC\u6D41\u7A0B",resetButton:"\u91CD\u7F6E\u5F15\u5BFC\u72B6\u6001",resetConfirm:"\u8FD9\u5C06\u5728\u4E0B\u6B21\u767B\u5F55\u65F6\u91CD\u65B0\u542F\u52A8\u5F15\u5BFC\u5411\u5BFC\u3002\u7EE7\u7EED\u5417\uFF1F",resetSuccess:"\u5F15\u5BFC\u72B6\u6001\u5DF2\u91CD\u7F6E\u3002\u4E0B\u6B21\u8BBF\u95EE\u65F6\u4F1A\u770B\u5230\u6B22\u8FCE\u9875\u3002",resetFailed:"\u65E0\u6CD5\u91CD\u7F6E\u5F15\u5BFC\uFF0C\u8BF7\u68C0\u67E5\u6D4F\u89C8\u5668\u5B58\u50A8\u6743\u9650\u540E\u91CD\u8BD5\u3002"},onboardingFlag:{title:"\u5F15\u5BFC\u529F\u80FD",label:"\u65B0\u7528\u6237\u5F15\u5BFC\u5411\u5BFC",description:"\u9996\u6B21\u8BBF\u95EE\u65F6\u663E\u793A\u6B22\u8FCE\u5411\u5BFC\u3002\u719F\u7EC3\u7528\u6237\u53EF\u5173\u95ED\u3002",toggleAriaLabel:"\u5207\u6362\u65B0\u7528\u6237\u5F15\u5BFC\u529F\u80FD",enabled:"\u5F15\u5BFC\u5411\u5BFC\u5DF2\u542F\u7528",disabled:"\u5F15\u5BFC\u5411\u5BFC\u5DF2\u5173\u95ED",toggleFailed:"\u5207\u6362\u5F15\u5BFC\u529F\u80FD\u5931\u8D25",loadFailed:"\u52A0\u8F7D\u5F15\u5BFC\u5F00\u5173\u72B6\u6001\u5931\u8D25"},fullPipelineFlag:{title:"\u7BA1\u9053\u6A21\u5F0F\uFF08PRI-720\uFF09",label:"\u5F3A\u5236 prompt \u539F\u5219\u8D70\u5B8C\u6574\u7BA1\u9053",description:"\u9ED8\u8BA4\u5173\uFF1Aprompt/defer \u539F\u5219\u8D70\u77ED\u8BED\u4E49\u8DEF\u5F84\uFF08\u4E0D\u751F\u6210\u4EE3\u7801\u3001\u4E0D\u8DD1\u6C99\u7BB1\uFF09\u3002\u5F00\u542F\u540E\uFF1A\u65B0\u79CD\u5B50\u7684 prompt \u94FE\u8D70\u5B8C\u6574\u65E7\u7BA1\u9053\uFF0C\u5305\u62EC Artificer \u4EE3\u7801\u751F\u6210\u3001Evaluator \u8BC4\u5BA1\u4E0E\u5BF9\u6297\u91CD\u653E\u2014\u2014\u7528\u4E8E\u6D4B\u8BD5\u573A\u666F\u6216\u60A8\u660E\u786E\u9700\u8981\u8DD1\u5B8C\u6574\u7BA1\u9053\u65F6\u3002\u4E0D\u5F71\u54CD\u5DF2\u5728\u8FDB\u884C\u4E2D\u7684\u94FE\u3002",toggleAriaLabel:"\u5207\u6362 prompt \u5185\u5316\u5F3A\u5236\u5B8C\u6574\u7BA1\u9053\u6A21\u5F0F",enabled:"\u65B0 prompt \u94FE\u5DF2\u5F3A\u5236\u8D70\u5B8C\u6574\u7BA1\u9053",disabled:"prompt \u94FE\u4F7F\u7528\u77ED\u8BED\u4E49\u8DEF\u5F84",toggleFailed:"\u5207\u6362\u7BA1\u9053\u6A21\u5F0F\u5931\u8D25",loadFailed:"\u52A0\u8F7D\u7BA1\u9053\u6A21\u5F0F\u72B6\u6001\u5931\u8D25"}}};var Sm={common:{loading:"Loading",refresh:"Refresh",settings:"Settings",login:"Login",logout:"Logout",confirm:"Confirm",cancel:"Cancel",yes:"Yes",no:"No",save:"Save",delete:"Delete",add:"Add",edit:"Edit",view:"View",more:"More",search:"Search",filter:"Filter",sort:"Sort",clear:"Clear",apply:"Apply",close:"Close",submit:"Submit",success:"Success",error:"Error",warning:"Warning",info:"Info",total:"Total",active:"Approved",inactive:"Inactive",pending:"Pending",completed:"Completed",failed:"Failed",unknown:"Unknown",all:"All",none:"None",lastUpdated:"Last Updated",status:"Status",name:"Name",description:"Description",type:"Type",date:"Date",time:"Time",actions:"Actions",copied:"Copied",skipToMain:"Skip to main content"},pages:{focus:{workbench:{textPreview:"Text preview",codePreview:"Rule implementation preview",fullText:"Expand complete text",fullCode:"Expand complete rule implementation",scope:"Applicable scope",compare:"Compare the previous version and retained intent",intentReviewed:"I checked the old and new versions and the intent to retain",promptConsequence:"Approval enters the existing prompt activation flow. Delivery still depends on host and capacity.",ruleConsequence:"Accepting an execution proposal is not promotion to live. Observation and promotion remain separate decisions.",approveOne:"Approve this revision",rejectOne:"Reject this revision",replaceOne:"Replace pending revision",replacementId:"Validated replacement artifact identifier",reason:"Reason for this decision",confirm:"Confirm submission",cancel:"Cancel",resultUnknown:"The submission result is unconfirmed. Read the current state before deciding again; do not resubmit.",notRecorded:"This decision is not complete. Review the refreshed material.",approved:"Approval is complete. Check activation and delivery in runtime status.",rejected:"This revision was rejected. Other subjects were not processed.",activationFailed:"Approval is complete, but activation failed. Use runtime recovery; do not approve again.",approvedRuntimeUnknown:"Approval was recorded. Activation is incomplete or unconfirmed. Check runtime status.",replaced:"The pending revision was replaced. Review the current text before deciding.",versionNeedsReview:"Revision {{index}} to review",title:"Needs your attention",subtitle:"Choose one item, understand the proposal and its consequences, then continue.",list:"Work items",count:"{{count}} items",uncertain:"Some sources could not be read. This list may be incomplete.",empty:"No work items are currently confirmed.",back:"Back to work items",next:"View next item",readingEnd:"This is the end of this item. Return to the list or review the next one.",completed:"Review outcome",notCurrent:"This item is no longer in the current list",startTitle:"Start with one item",startBody:"Choose an item to read its material, check the concerns, and see the available actions in one place.",notCurrentBody:"It may have been resolved, or its source may be unavailable. Use the freshly read state.",start:"Start review",loading:"Loading this approval\u2019s exact material\u2026",why:"What this is trying to solve",proposal:"What PD proposes to change",decision:"Your decision",proposedBehavior:"Proposed behavior (this draft)",currentApproved:"currently approved",currentRejected:"currently rejected",refusedCurrentState:"This operation was not performed; {{state}}.",currentStateConfirmed:"The record was reloaded: {{state}}. Whether this submission succeeded remains unconfirmed.",runtimeCheckLink:"Check activation and delivery on the runtime page.",sourceUnlinked:"This approval could not be linked to a principle or a readable name. Check the exact text and source first; you can reject it if the material is insufficient.",risksUnknown:"Risk notes for this revision are missing or unreadable. Risks remain unconfirmed.",risksEmpty:"This revision lists no risks; that does not establish safety.",approvalNote:"Approval note (optional)",budgetBasis:"Prompt capacity source and estimate basis",sourcesPending:"Sources unconfirmed",countExplanation:"How items are counted",archiveReview:"Defer or archive review",archiveConsequence:"Approving defers or archives this proposal; it does not activate a prompt or execution rule.",approveArchive:"Approve defer or archive",beforeDecision:"Before you decide",subjectUnconfirmed:"The complete decision material for this revision is unconfirmed. Check its source first.",revisionChanged:"The pending revision changed. Return to the list and read the new revision and intent comparison before deciding.",scopeUnknown:"Unspecified scope and exceptions remain unknown; they do not mean this applies in every situation.",principleLimits:"Principle-level risks and gaps (not validation of this revision)",reasonAndScope:"Rationale and consequences",materialUnavailable:"The material for this item is unavailable.",exactMaterialMissing:"No text matching this approval and revision was found. Check the material first.",versionLock:"You can read the material. The current approval service does not yet guarantee that the submitted version is the one you reviewed, so approve, reject, and replace actions are unavailable here.",openPrinciple:"View principle details and existing records",subjectDetails:"View approval and revision identifiers",permissionsUnknown:"Approval permissions could not be confirmed. Reading remains available; decision actions are locked.",taskDecision:"Current proposal decision",revisionDecision:"Proposal revision decision",validationReview:"Behavior validation review",approvalMaterialReview:"Approval material check",unknownReview:"Item type needs checking",promptReview:"Prompt principle review",ruleReview:"Execution proposal review",approvalSummary:"Check the proposed behavior, scope, and exact revision.",bindingReview:"Rule attribution review",bindingSummary:"Confirm which principle this rule should implement.",decisionRecorded:"The service received the decision. The list is refreshing from current state.",retry:"Read again",runtimeRecords:"Runtime and historical records",rulePromotion:"Rule promotion review",promotionSummary:"This rule is still being observed. Review the safety evidence before continuing observation, rejecting, or promoting it.",openActivation:"View rule runtime and emergency controls",safetyAlert:"{{count}} rules are safety-isolated. Check their runtime state.",approvalsUnavailable:"Some approval material could not be read. Other confirmed items remain available."},ruleBinding:{title:"Formal principle attribution for rules",separate:"Attribution only states which principle a rule belongs to; it does not approve the rule, enable it, or replace a development design approval.",unavailable:"Attribution material is unavailable. Reload the page.",countsLine:"{{candidates}} rule candidates | {{painGroups}} feedback signals | {{bound}} linked | {{unlinked}} awaiting decision | {{blocked}} blocked",truncatedNote:"Too many candidates; showing the first {{count}}. The counts above cover displayed entries only.",groupPrefix:"From feedback:",painUnrecorded:"Original words not recorded",sourceUnreadable:"Records unreadable",sourceUnknown:"Source not recorded",sourceManual:"Owner feedback",sourceToolFailure:"Tool failure",groupCount:"{{count}} rule candidates",currentStage:"Current stage: ",boundTo:"Linked principle:",viewPrinciple:"Open principle",blockedLine:'Generation stopped at "{{stage}}": {{reason}}; no new rule generated yet.',blockedNoOwnerApproval:"No Owner approval needed right now - this is a material problem; the draft must be revised first.",blockedDetail:"Show blocking detail",blockReason:{textual_basis_unanchored:"draft citation check failed (the claimed Owner quote cannot be anchored in the material)"},blockReasonUnknown:"generation blocked (server gave no reason code)",attentionLine:"Material problem ({{reason}}): shown as the server reports it; do not infer the attribution state from this.",nextLabel:"Next step: ",nextAwaitingOwner:"Choose which formal principle this rule implements - attribution only; it approves no code and enables no interception.",nextBoundGenerating:"The system is revising and validating the new rule artifact; no Owner action needed until it finishes.",nextBoundBlocked:"The draft must be revised and regenerated; no retry button is offered until the official recovery capability exists.",nextBoundBlockedNoResume:"Generation is blocked and cannot be resumed now ({{reason}}); revise the draft. An official recovery entry arrives in a later release.",nextBoundAdvanced:"Rule artifact generated; rule approval and activation happen on their own pages.",nextBoundNotBuilt:"Linked to a principle; rule generation has not started yet.",nextBoundAmbiguous:"Generation chain state is unclear; check technical details or reload.",nextRevoked:"Attribution withdrawn and artifacts kept; you may link again.",nextAttention:"Check the reason code in technical details, or reload.",techDetails:"Technical details",candidate:"Rule candidate text",pain:"Source pain signal",evidence:"Diagnosis evidence",boundSince:"link revision {{revision}} ({{date}})",chooseTarget:"Choose the principle this rule implements: attribution only - it approves no code, enables no interception, and does not mean a development SPEC was approved.",search:"Search formal principles",noTarget:"If no principle fits, keep it unlinked.",formation:"Open the principle formation flow",version:"Version",declaration:"Submitting means: this rule is one implementation of the selected principle, and you authorize exactly one controlled revision/generation/validation run under the existing configuration.",reason:"Reason for linking or withdrawing",bind:"Link and run one revision",revokeSecondary:"Withdraw attribution (secondary)",bound:"Attribution saved; one controlled revision was requested. The rule still requires separate approval.",resumeFailed:"Attribution saved but the revision has not started. Check the recovery reason; old artifacts are unchanged and will not auto-retry.",revoked:"Attribution withdrawn; artifacts kept. Running rules must be stopped separately.",revokeBoundary:"Withdrawal does not stop running rules; in-flight operations that passed final checks may still complete.",stop:"Open rule runs and stop entry",openReview:"Review and act",closeReview:"Collapse",reviseCta:"Revise and continue",reviseStarted:"One controlled revision was requested; generation and validation continue under the existing configuration.",reviseAlreadyStarted:"This revision is already in progress; no repeat request needed.",resumeUnavailable:"Automatic revision is unavailable now ({{reason}}); a generic retry is not a source revision.",sourceCorrectionCta:"Correct source material and continue",sourceCorrectionStarted:"One source-material correction was authorized: the Scribe reopens for one round on the corrected material and the original Artificer resumes on the new artifact, under the existing configuration and budgets.",sourceCorrectionAlreadyStarted:"This source correction is already in progress (idempotent replay); no repeat request needed.",sourceCorrectionUnavailable:"The source-correction entry is unavailable now ({{reason}}).",resumeReason:{revision_budget_exhausted:"the revision budget of this link is spent",dreamer_lineage_not_unique:"dreamer task lineage is not unique",dreamer_missing:"dreamer task not found",philosopher_lineage_not_unique:"philosopher task lineage is not unique",philosopher_missing:"philosopher task not found",scribe_lineage_not_unique:"scribe task lineage is not unique",scribe_metadata_invalid:"scribe task metadata is invalid",predecessor_not_succeeded:"an upstream task has not succeeded",scribe_missing:"scribe task not found",candidate_kind_invalid:"candidate kind is invalid",binding_revision_stale:"binding revision is stale; reload",task_revision_stale:"task revision epoch is stale; reload",scribe_target_mismatch:"target scribe task mismatch; reload",task_lease_present:"the task is held by a worker; retry later",revision_snapshot_stale:"task state changed; reload"},stateAwaitingOwner:"Awaiting principle choice",stateBoundGenerating:"Linked - generating",stateBoundBlocked:"Linked - blocked",stateBoundAdvanced:"Linked - generated",stateBoundNotBuilt:"Linked - not started",stateBoundAmbiguous:"Linked - chain unclear",stateRevoked:"Attribution withdrawn",stateAttention:"Material problem",stageDreamer:"dreaming",stagePhilosopher:"distilling",stageScribe:"drafting",stageArtificer:"rule generation",stageEvaluator:"rule validation",stageRolloutReviewer:"rollout review",viewRemaining:"Show the other {{count}} feedback groups",hideRemaining:"Collapse remaining feedback groups"},eyebrow:"Governance Focus",title:"What deserves your judgment right now",subtitle:"This page answers one question: what should the owner review next?",summaryLabel:"Current:",summaryPending:"pending review",summaryDeviation:"behavior deviations",summaryStagnation:"stagnation signals",summaryEvidence:"behavior evidence in progress",stratLabel:"Today's Feedback Layers",stratGateBlocks:"Auto-blocked",stratGateBlocksHint:"RuleHost handled these \u2014 no action needed",stratInProgress:"In Progress",stratInProgressHint:"Evidence/internalization pipeline running",stratPendingReview:"Needs Your Call",stratPendingReviewHint:"Awaiting your review decision",stratYouAreHere:"you are here",sectionPending:"Pending Your Review",sectionDeviation:"Behavior Deviations Worth Noting",sectionEvidenceInProgress:"Behavior Evidence In Progress",sectionSignals:"System Signals",emptyPending:"No principles pending review. When PD captures behavior deviation signals, principle candidates will appear here for your review.",emptyDeviation:"No behavior deviations captured yet. PD will detect deviations when the agent's behavior diverges from owner expectations.",emptySignals:"No stagnation signals. All approved principles appear to be active.",stagnationNeverActivated:"Approved but never activated",stagnationNoPain:"No pain signals received",stagnationDaysSince:"days ago",deviationDisclaimer:"PD presents each deviation individually. Automatic similarity detection is not available yet.",deviationDetailPending:"Individual deviation evidence will be available here once the backend provides pain signal details (CR5).",footer:"This page answers one question: what deserves your judgment right now.",dailyThought:{eyebrow:"Before you judge",ariaLabel:"Today's thought",next:"Next thought",nextAriaLabel:"Show next thought",authorPrefix:"\u2014 "},reviewAction:"Review & Decide",parkAction:"Park",viewFullChain:"View full chain",loadError:"Unable to load governance data. You can try refreshing the page.",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",tagReversible:"Reversible",tagLowRisk:"Low Risk",recordCount:"{{count}} record(s)",deviationCount:"deviation(s)",evidenceSummary:"Approval records: {{count}}",untitledCandidate:"Untitled candidate principle",promptCapacityUnconfirmed:"Host capacity unconfirmed: the applicable hosts of this workspace take different injection routes; the numbers below are not bound to a specific host.",promptCapacityStarved:"{{count}} host(s) cannot fit even one principle within their current injection budget; principles will not take effect there.",promptCapacityDetails:"Show per-host capacity details",promptCapacityPerHostCatalogMatched:" (budget derived from a unanimous catalog match on the model id)",promptCapacitySharedRoute:"shared injection (billed on the full injected block)",promptCapacityListRoute:"list injection (billed on the selected lines)",promptCapacityPerHostEntry:"{{host}}: {{billing}} \u2014 {{used}}/{{budget}} chars{{full}}{{observed}}",promptCapacityPerHostFull:" (not all entered this turn)",promptCapacityPerHostRotating:" (not all entered this turn; the rest rotate in on later turns)",promptCapacityPerHostDeclared:"(budget from the workspace config declaration)",promptCapacityPerHostObserved:" (budget from this host's most recent runtime observation at {{observedAt}})",promptCapacityPickHint:"Review/approve for a target host:",promptCapacityViewAsHost:"View as {{host}}",promptCapacityClearHost:"Clear selection",promptScopeShared:"Forecast window (shared route, billed on the full injected block, unit=chars)",promptScopeList:"Forecast window (list route, billed on the selected lines{{full}}, unit=chars)",promptScopeFullRender:"; full injected block \u2248 {{count}} chars",promptBudgetModelAwareNote:"Budget resolved from the confirmed model context ({{window}} tokens)",promptBudgetObservedNote:"Budget from the most recent runtime observation (source {{source}}, context {{window}} tokens, observed at {{observedAt}})",promptBudgetFallbackNote:"Estimated with the fixed fallback budget (console not bound to a runtime model{{reason}})",promptBudgetFallbackObservedNote:"The runtime's most recent observation did not confirm host capacity; estimated with the fixed fallback budget ({{reason}}, observed at {{observedAt}})",promptBudgetFallbackReasonSuffix:", reason: {{code}}",promptBudgetFallbackObservedSuffix:"; the runtime's most recent observation was at {{observedAt}}",budgetCapacitySourceHostWindow:"host effective context window",budgetCapacitySourcePiCatalog:"exact model catalog match",budgetCapacitySourcePiCatalogModelId:"unanimous model-id catalog match",budgetCapacitySourceOperatorDeclared:"workspace config declaration",budgetCapacitySourceOperatorDeclaredSuffix:", source: workspace config declaration",budgetFallbackReason:{host_capacity_absent:"the host provided no context capacity fact (declare contextWindowTokens under promptBudget in .pd/config.yaml to override)",host_capacity_source_untrusted:"the host capacity source is untrusted",host_capacity_invalid_value:"the host capacity value is invalid",catalog_unavailable:"the model catalog is unavailable",model_identity_absent:"model identity is missing",catalog_no_exact_match:"provider+model is not in the built-in catalog (common for custom providers; declare contextWindowTokens under promptBudget in .pd/config.yaml)",catalog_no_match_for_model_id:"the model id is not in the model catalog (declare contextWindowTokens under promptBudget in .pd/config.yaml)",catalog_ambiguous_model_id:"the model id is ambiguous in the model catalog",catalog_provider_absent:"the provider id is missing",catalog_metadata_invalid:"the model catalog metadata is invalid",runtime_budget_observation_stale:"the runtime budget observation is stale (older than 24h; not used as the current budget)"},artifactUnavailableNote:"The draft artifact this approval points to is no longer in the artifact store (likely superseded by a newer revision), so its content cannot be shown. If in doubt, reject it; the raw artifact ID is shown in the replacement section's current-artifact field.",unlinkedCandidateNote:"No principle name is available for this card: its lineage cannot be resolved to a principle, and no readable title could be extracted from its stored content. Judge it from the approval records below; if you cannot decide, you can reject it.",approveAction:"Approve",rejectAction:"Reject",editAction:"Replace pending version",confirmReject:"Confirm reject",confirmEdit:"Confirm replacement",cancelAction:"Cancel",rejectReasonLabel:"Reject reason (required)",rejectReasonPlaceholder:"Explain why this is rejected",editReasonLabel:"Replacement reason (required)",editReasonPlaceholder:"Explain why this pending version needs replacing",editNewArtifactPlaceholder:"Enter validated revision artifact ID",currentArtifactLabel:"Current artifact",approveSucceededCount:"Approved {{count}} principle(s)",decidedApproved:"Approved \u2713",decidedRejected:"Rejected",approveQueueBadge:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars).",approveQueueBadgeRotation:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars). Selection is rotating fairly, so new principles come around on later turns \u2014 no need to deactivate older principles.",approveQueueBadgeOversized:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars). This principle is itself larger than the injection limit, so rotation cannot fit it \u2014 shorten its content first.",approveWarningDetail:"Server details",goActivationCta:"Open activations",approveWarning:{budgetExcludedTitle:"Approved, but not yet in effect",budgetExcludedBody:"This principle was approved and saved, but the prompt injection budget is full ({{budget}}-char cap) and only {{earlierCount}} principle(s) fit the current window. It will not affect agent behavior until capacity frees up.",budgetExcludedBodySimple:"This principle was approved and saved, but the prompt injection budget is full. It will not affect agent behavior until capacity frees up.",queuedTitle:"Approved \u2014 queued to take effect",queuedBody:"This principle was approved and saved. The prompt injection window is full ({{budget}}-char cap), so it is not in the prompt this turn. Selection rotates fairly, advancing one position per user turn, so it will come around within at most {{turns}} consecutive turns \u2014 there is no need to deactivate other principles.",queuedBodySimple:"This principle was approved and saved and is queued for the prompt. Selection rotates fairly, so it will come around on a later turn \u2014 there is no need to deactivate other principles.",excludedTitle:"Approved, but not yet in effect",excludedNonBudgetBody:"This principle was approved and saved but is not in the agent prompt for a non-budget reason. Check the activations page for status.",checkFailedTitle:"Approved \u2014 effect unverified",checkFailedBody:"The approval was saved, but the system could not verify whether it reached the agent prompt. Check the activations page.",oversizedTitle:"Approved, but this principle alone is oversized",oversizedBody:'The approval is saved, but this single principle needs {{cost}} chars, over the injection cap \u2014 no rotation can fit it. Shorten it via "modify to injectable version" on the activations page, or deactivate it.',oversizedBodySimple:"The approval is saved, but this single principle exceeds the injection cap \u2014 no rotation can fit it. Shorten it or deactivate it.",capacityUnconfirmedTitle:"Approved, host capacity unconfirmed",capacityUnconfirmedBody:"The approval is saved, but the applicable hosts of this workspace take different injection routes, so the system cannot confirm where it takes effect. Pick a target host and retry, or let a host run once in this workspace to persist its declaration.",ledgerTitle:"Approved \u2014 principle ledger not synced",ledgerBody:"Approval and activation were saved, but the ledger upgrade did not complete. This does not block enforcement; check the library later.",overflowTitle:"{{count}} more warning(s)"},rejectSucceeded:"Rejected",editSucceeded:"Pending version replaced",approveFailed:"Approval failed, please retry.",rejectFailed:"Rejection failed, please retry.",editFailed:"Replacement failed. Please try again later.",partialFailure:"Action completed, but {{failedCount}}/{{totalCount}} record(s) failed: {{reason}}",unknownFailure:"Check the service logs.",onboardingTitle:"How PD Works",ruleCodeOwnerQueue:"RuleCode Owner decisions",ruleCodePending:"Rules awaiting live decision",ruleCodePendingCount:"{{count}} shadow rule(s) require review of evidence and scope.",ruleCodeUnavailable:"RuleCode review data is unavailable",ruleCodeUnavailableNextAction:"Open Activations or retry after the activation service recovers.",ruleCodeAlerts:"RuleCode safety alerts",ruleCodeAlertCount:"{{count}} rule(s) are safety-isolated and fail-open.",onboardingStep1:"Observe deviations \u2014 PD watches for behavior that diverges from owner expectations",onboardingStep2:"Capture evidence \u2014 Pain signals are recorded with bounded context",onboardingStep3:"Generate candidates \u2014 Principle candidates are proposed for owner review",onboardingStep4:"Review & approve \u2014 Owners decide which principles to activate",onboardingStep5:"Inject behavior \u2014 Approved principles influence future agent behavior, reversibly",stateLabel:{none:"No Data",in_progress:"In Progress",owner_review_ready:"Ready for Review",degraded:"Degraded"},nextActionLabel:"Suggested action:",experience:{attention:{setupRequired:"Setup Required",ownerDecisionRequired:"Owner Decision Required",recoveryRequired:"Recovery Required",degraded:"Degraded",backgroundProcessing:"Background Processing",allClear:"All Clear"},reason:{ownerIdentityMissing:"The Owner identity is not configured. RuleCode governance decisions are blocked until PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID are set and the console token auth is enabled.",ownerIdentityInvalid:"The Owner identity configuration is invalid, so governance actions are safely blocked.",ownerAuthenticationMissing:"The identity is registered, but Console token authentication is not enabled.",approvalPending:"Principle approvals are waiting for your decision.",rulecodeOwnerDecision:"RuleCode shadow activations are waiting for your promotion decision.",noPendingDecision:"No principle approval is waiting right now.",ownerDecisionAvailable:"The configured Owner holds the governance decision entry.",breakGlassEntry:"Emergency pause currently resolves through the local break-glass path because no Owner identity is configured.",recoveryRequired:"Some governance work stalled and needs recovery before it can continue.",sourceUnavailable:"A required governance source is unavailable, so ongoing work cannot progress.",configInvalid:"The workspace config file is invalid; the environment classification is unknown.",processing:"Governance work is running in the background. No decision is needed right now.",workspaceClear:"All governance work is settled. Nothing needs your attention.",workspaceEmpty:"No governance records yet. PD will populate this view once the pipeline runs."},next:{configureOwner:"Configure PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID, then enable console token auth.",authenticateConsole:"Enable Console token authentication, then retry.",reviewApprovals:"Review the pending decisions below.",inspectRecovery:"Open Failed Tasks and recover the stalled work.",inspectSources:"Inspect state.db and the principle ledger, then restart the console.",fixConfig:"Fix the invalid keys in .pd/config.yaml.",monitor:"Nothing to do \u2014 PD will surface the next decision here.",none:"Nothing to do right now."},ownerGuide:{title:"Set the Owner identity",intro:"Copy the command below and run it in the shell that launches OpenClaw and the PD Console (replace <owner-id> and <credential-id> with your own IDs), then restart both.",tokenAuthHint:"Console token authentication (--token or PD_CONSOLE_TOKEN) is also required for the identity to take effect; if not enabled yet, complete that step per the configuration guide.",cmdPowerShell:"PowerShell (Windows)",cmdBash:"bash (macOS / Linux)",copy:"Copy",copied:"Copied",docLink:"Configuration guide and verification \u2192"},blocker:{identityMissing:"Register the Owner identity to enable governance actions.",identityInvalid:"The Owner identity configuration is invalid; fix it in Settings.",authenticationMissing:"Identity registered; enable Console token authentication to use governance actions.",goSettings:"Go to Settings"},activity:{needsDecision:"{{count}} decision(s) waiting",needsRecovery:"{{count}} item(s) need recovery",blocked:"Progress is blocked by an unavailable source",processing:"Background processing ({{count}})"},readiness:{identity:{configured:"Owner identity: configured",missing:"Owner identity: missing",invalid:"Owner identity: invalid"},principleApproval:"Principle approvals: operator entry",rulecode:{ready:"RuleCode decisions: Owner entry",blocked:"RuleCode decisions: blocked (no Owner identity)"},pause:{owner:"Emergency pause: Owner entry",breakGlass:"Emergency pause: break-glass entry"}},trust:{environment:{production:"Environment: production",development:"Environment: development",demo:"Environment: demo",test:"Environment: test",unknown:"Environment: unknown"},lineage:{strong:"Lineage confidence: strong",weak:"Lineage confidence: weak",unknown:"Lineage confidence: unknown"}},dataQuality:{degraded:"Data quality degraded \u2014 e.g. {{reasonCode}} ({{count}} occurrence(s)). Some explanations may be incomplete."},error:{snapshotUnavailable:"The governance experience snapshot could not be loaded."}},inProgressTitle:"Governance in progress",inProgressDetail:"PD will surface a principle candidate here once the internalization pipeline completes and an owner-reviewable artifact is generated.",degradedTitle:"System Signals",degradedStateReason:"Part of the governance pipeline or data source is degraded. Decisions may be incomplete or delayed.",degradedNextActionLabel:"Next action:",advancedDiagnostics:"Advanced diagnostics",degradedSourceInternalization:"Internalization Task",degradedSourceChainIntegrity:"Chain Integrity",degradedSourceUnavailable:"Data Source",stateReason:{state_db_missing:"State database not initialized. PD has not run in this workspace yet.",no_pipeline_activity:"No governance activity recorded yet.",pending_approvals:"{{count}} principle(s) pending your review and decision.",tasks_need_human_review:"{{count}} internalization task(s) are waiting for your review decision.",pipeline_active:"Pipeline has activity, but candidate principles are not ready for review.",consumed_candidates:"Candidate records exist, but have not entered the review stage.",degraded_state:"Part of the governance pipeline or data source is degraded."},nextAction:{run_config_doctor:"Ensure the OpenClaw plugin is enabled, or run pd config doctor.",wait_for_pipeline:"PD will surface principle candidates here once behavior deviations are captured and reviewable artifacts are generated.",review_approvals:"Review pending principles and approve, reject, or park.",review_failed_tasks:"Open Failed Tasks to inspect and recover tasks awaiting your decision.",check_degraded_signals:"Check degraded signal details and follow suggested actions.",check_pipeline_status:"Wait for internalization tasks to complete. If no change for a long time, check pipeline status."},degradedReason:{task_retry_wait:"Internalization task waiting for retry",task_failed:"Internalization task failed",approval_table_missing:"Approval table does not exist",trajectory_db_unavailable:"Behavior evidence database (trajectory.db) is unavailable"},degradedNextAction:{check_task_status:"Check internalization pipeline status, or wait for automatic retry.",fix_and_retry:"Check failure details, fix the issue and retry.",run_integrity_check:"Run pd runtime internalization integrity to check and repair table structure.",check_trajectory_db:"Check trajectory.db file integrity in .state directory."},zeroStateHealthy:"No items need your judgment right now. PD has checked behavior evidence, principle review queue, and system signals.",zeroStateDbMissing:"PD has not run in this workspace yet. Once the state database is initialized, governance data will appear here.",evidenceInProgress:"{{count}} behavior evidence item(s) recorded, being diagnosed and processed.",ownerInbox:{group:{subjectMaterial:"Material for this decision (scoped to its own revision \u2014 no text borrowed from other revisions)",decision:"Needs decision",blocked:"Blocked",recovery:"Needs recovery"},sectionTitle:"Principle decisions",loadError:"Principle decision updates are temporarily unavailable.",empty:"No confirmed pending, blocked, or recovery-needed principle items right now.",viewLibrary:"View the principle library \u2192"},ownerDecision:{evidenceUnavailable:"This decision still needs you, but its evidence chain is incomplete. PD has paused all decision actions so you cannot approve the wrong version.",goRecoverCta:"View recovery details",sectionTitle:"Needs your decision",empty:"Nothing needs your decision right now. Problems the machine can solve on its own will not disturb you.",unavailable:"(unavailable)",loadError:"The decision list is temporarily unavailable \u2014 the governance summary is still shown.",kindEvaluator:"Evaluator review",kindRollout:"Rollout review",kindApproval:"Deployment approval",kindRulecode:"RuleCode decision",legacyBadge:"Inferred from history",machineRecommendationLabel:"Machine recommendation",principleLabel:"Principle",implementationLabel:"Implementation",concernLabel:"Primary concern",partialEvidenceAcknowledgement:"I understand the evidence is incomplete and still want to accept this version.",evidence:{complete:"Evidence complete",partial:"Evidence partial",insufficient:"Evidence insufficient"},rolloutSafetyNote:"Accept this review and continue. High-risk rules still require an independent deployment approval.",acceptCurrent:"Accept current version",reviseOnce:"Revise once more",rejectCurrent:"Reject",actionsLockedAuth:"Decision actions are locked: this console runs without access authentication (the Companion launches the console unauthenticated by default). Configure the console access token in Settings and restart the console to enable Accept / Revise once / Reject.",actionsLockedIdentity:"Decision actions are locked: Owner identity is missing or invalid. Configure Owner identity in Settings to enable decision actions.",goSettingsCta:"Open Settings",instructionLabel:"Revision guidance (optional, one sentence)",instructionPlaceholder:"e.g. Do not add new tool-naming requirements; only address the unresolved items from the last round.",instructionRequired:"Fill in the revision guidance, or collapse the input and submit directly.",actionConsequence:"Accept = continue with the current version (the machine verdict is preserved permanently); Revise once = authorize one extra revision round (automatic budget unchanged); Reject = terminate this evolution.",acceptBlockedHardGate:'"Accept" is unavailable: this item contains a code-rule implementation and opens only after the adversarial sandbox hard gate passes.',acceptBlockedNoCandidate:'"Accept" is unavailable: no activation candidate exists for this principle \u2014 revise or reject to continue.',acceptBlockedGeneric:'"Accept" is unavailable: the current evidence does not meet the release conditions \u2014 revise or reject.',advanced:"Advanced diagnostics",resolved:"Resolution recorded.",staleError:"The facts of this item changed (a new evaluation may exist). Your decision was NOT applied \u2014 refresh and decide again.",alreadyResolved:"This decision was already handled; no repeat action needed.",actionFailed:"Action failed, please retry later.",approvalHint:"The deployment approval for this principle is still waiting in the approval queue.",rulecodeHint:"This rule is in shadow activation and needs a decision in activation management.",goApprovalsCta:"Go to deployment approvals",goActivationCta:"Go to activation management",qualityChecklistLabel:"Quality checklist",qualityCheckStatus:{passed:"passed",failed:"failed"},qualityCheck:{understandability:"Understandability",evidence:"Evidence",actionability:"Actionability",generalization:"Generalization",boundary:"Boundary"},formationLabel:"Formation source",formationPainLabel:"Pain",formationDiagnosisLabel:"Diagnosis",formationRootCauseLabel:"Root cause",formationEvidenceLabel:"Supporting evidence",formationUnavailableNote:"The source diagnosis is currently unreadable; this principle is still decided on the evidence shown.",checksDisclosure:"Deterministic checks (technical detail)"},revisionReviewUnavailable:"Revision review is incomplete or multiple versions are pending. Check the artifacts and prior version before approval; rejection remains available.",revisionIntentReview:"Review the revised statement against the retained intent, including triggers, required actions, and exceptions.",revisionIntentConfirmed:"I reviewed the retained intent and the revised statement for consistency",intentField:{ownerIntent:"Owner intent",targetBehavior:"Expected behavior",forbiddenBehavior:"Forbidden behavior",evidenceSource:"Evidence source",validationExpectation:"Validation expectation"},conclusion:{sectionTitle:"Current status",countsNote:"Scope: the count lists the work items in this workbench; blocked and recovery items are listed separately below.",degradedLabel:"Decision updates degraded:"},ownerAttention:{sectionTitle:"Blocked & needing recovery",blockedCount:"blocked {{count}}",recoveryCount:"needing recovery {{count}}",empty:"No blocked or recovery items need individual attention.",unmatchedTitle:"These objects have decision updates but no available action surface yet (missing association or incomplete data \u2014 not merged away):",blockedAggregate:"{{count}} blocked object(s) need no individual attention and are not counted in the total above.",unmatchedItemNote:"No action surface available for this entry yet; open the principle page for its current state."}},pain:{eyebrow:"Behavior Evidence",title:"Behavior Evidence",description:"Only behavior evidence worth governing should enter principle review. This page shows real behavior signals and their chain states observed by PD \u2014 not raw chat, raw trajectories, or false claims about behavior change.",honestyNote:"PD presents each evidence item individually. Automatic similarity detection is not available yet. Evidence shown here comes from real pain_events, diagnostician tasks, and candidate records.",loadError:"Failed to load behavior evidence",validationError:"Data format validation failed, please refresh and retry",emptyTitle:"No behavior evidence captured yet",emptyDescription:"When PD detects behavior deviations worth governing, evidence will appear here. You can create feedback signals manually via /pd-pain command or pd pain record.",generatedAt:"Generated at",group_active_chain:"Active Chain",group_evidence_only:"Evidence Only (not admitted)",group_failed:"Diagnosis Failed or Awaiting Retry",state_evidence_only:"Evidence Only",state_pain_recorded:"Pain Recorded",state_diagnosis_queued:"Diagnosis Queued",state_diagnosis_running:"Diagnosis Running",state_diagnosis_succeeded:"Diagnosis Succeeded",state_diagnosis_failed:"Diagnosis Failed",state_diagnosis_retry_wait:"Awaiting Retry",state_candidate_generated:"Candidate Generated",state_internalization_started:"Internalization Started",source_manual:"Manual Trigger",source_tool_call:"Tool Call",source_rulehost:"Rule Guard",source_empathy_inferred:"Empathy Inferred",source_review:"Review Finding",source_unknown:"Unknown Source",admission_store_signal:"Signal Stored",admission_evidence_only:"Evidence Only",admission_owner_confirmation_required:"Confirmation Required",fieldFailureReason:"Failure Reason",fieldNextAction:"Suggested Action",fieldDegradedReason:"Degraded Reason",chainToggle:"View chain details",chainId:"Evidence ID",chainTaskId:"Diagnosis Task ID",chainTaskStatus:"Task Status",chainCandidateId:"Candidate ID",chainPrincipleId:"Linked Principle ID",chainSourceKind:"Source Kind",chainState:"Chain State",chainInternalizationTask:"Internalization Task ID",chainDreamerStatus:"Dreamer Status",fieldTrigger:"Trigger",hostKind:{codex:"Codex",openclaw:"OpenClaw"},fieldConclusion:"PD's Conclusion",fieldApplicability:"Applicability",fieldConfidence:"Confidence",confidenceHigh:"High",confidenceMid:"Medium",confidenceLow:"Low",techDetails:"Technical Details",copyDebugId:"Copy Debug IDs",copied:"Copied",noHumanSummary:"PD has not yet generated a behavior summary for this evidence",inReviewQueueCount:"{{count}} item(s) entered the review queue",goToGovernance:"Go to Governance Focus",expandTechDetails:"Expand technical details",intentTensionTitle:"Intent Tension",intentTensionSourceLabel:"Source",intentTensionSourceNone:"No intent tension",intentTensionSourceActionDrift:"Action drift",intentTensionSourceIntentSuspect:"Intent suspect",intentTensionSourceHealthyTension:"Healthy tension",intentTensionEvidenceStrengthLabel:"Evidence strength",intentTensionEvidenceStrengthWeak:"Weak",intentTensionEvidenceStrengthModerate:"Moderate",intentTensionEvidenceStrengthStrong:"Strong",intentTensionRelatedIntentFieldsLabel:"Related INTENT fields",intentTensionEvidenceLabel:"Evidence",intentTensionExplanationLabel:"Explanation",intentTensionSuggestedActionLabel:"Suggested owner action",intentTensionSuggestedActionConfirmDrift:"Confirm drift",intentTensionSuggestedActionReviseIntent:"Revise intent",intentTensionSuggestedActionObserve:"Observe",intentTensionSuggestedActionDismiss:"Dismiss",intentTensionSuggestedActionPromoteToPrinciple:"Promote to principle",intentTensionSuggestedActionPromoteToRulehost:"Promote to RuleHost",intentTensionIntentDocHashLabel:"INTENT doc hash",intentTensionNoTension:"No intent tension detected",intentTensionArtifactDegraded:"Diagnostician artifact for this record could not be fully parsed; intent tension may be unavailable.",ownerDecisionPanelTitle:"Owner Decision",ownerDecisionPanelSubtitle:"Record your decision on this intent tension. Follow-up actions appear only after a decision is persisted.",ownerDecisionNoteLabel:"Note (optional)",ownerDecisionNotePlaceholder:"Add context for this decision",ownerDecisionSubmitConfirmDrift:"Confirm Drift",ownerDecisionSubmitReviseIntent:"Revise Intent",ownerDecisionSubmitObserve:"Observe",ownerDecisionSubmitDismiss:"Dismiss",ownerDecisionSubmitPromoteToPrinciple:"Promote to Principle",ownerDecisionSubmitPromoteToRulehost:"Promote to RuleHost",ownerDecisionSubmitting:"Recording decision\u2026",ownerDecisionRecorded:"Decision recorded",ownerDecisionFailed:"Failed to record decision",ownerDecisionExisting:"A decision already exists for this tension",ownerDecisionFollowUpPlaceholder:"Follow-up actions will appear here after the decision is recorded.",ownerDecisionLoadingExisting:"Loading existing decisions\u2026",ownerDecisionLoadFailed:"Failed to load existing decisions",followUpActionsTitle:"Follow-up actions",followUpDispatching:"Dispatching\u2026",followUpDispatchFailed:"Failed to dispatch follow-up action",followUpLinkCandidateDescription:"Link an existing principle candidate to this decision. PD does not create a new candidate \u2014 link one from the evidence chain or paste a candidate id.",followUpLinkCandidateButton:"Link Candidate",followUpCandidateIdPlaceholder:"Paste candidate id",followUpCandidateIdAriaLabel:"Principle candidate id to link",followUpPrefilledFromEvidenceChain:"Prefilled from the evidence chain linked candidate.",followUpLinkedSuccess:"Linked candidate",followUpGuideRulehostDescription:"Get the CLI command to promote this decision to a RuleHost candidate. PD will create an approval that you can review in the Governance Queue.",followUpGuideRulehostButton:"View RuleHost Guidance",followUpCliCommandLabel:"CLI command",followUpPatchProposalDescription:"Generate a read-only Intent Patch Proposal. The proposal summarizes the tension and suggests where INTENT.md may need revision. PD never auto-applies the patch.",followUpViewPatchProposalButton:"View Intent Patch Proposal",followUpPatchProposalLabel:"Intent Patch Proposal",followUpPatchProposalReadOnlyBadge:"Display only",followUpPatchProposalWarning:"Display only \u2014 cannot be auto-applied. The Owner must manually edit .principles/INTENT.md if they accept this proposal.",followUpPromoteToPrincipleDescription:"Link an existing principle candidate to sediment this decision. PD does not create a new candidate \u2014 link one from the evidence chain or paste a candidate id."},principles:{title:"Principles",description:"Browse and manage principles and rules",active:"Active",candidate:"Candidate",probation:"Probation",deprecated:"Deprecated",total:"Total",rules:"Rules",valueScore:"Value Score",adherence:"Adherence",painPrevented:"Pain Prevented",triggerPattern:"Trigger Pattern",action:"Action",evaluability:"Evaluability",scope:"Scope",conflictsWith:"Conflicts With",associatedRules:"Associated Rules",noRules:"No associated rules",triggerCondition:"Trigger Condition",searchPlaceholder:"Search principle ID, text, trigger pattern...",allStatuses:"All Statuses",allScopes:"All Scopes",allPriorities:"All Priorities",allEvaluabilities:"All Evaluabilities",sortByValue:"Sort by Value Score",sortByAdherence:"Sort by Adherence",sortByPainPrevented:"Sort by Pain Prevented",sortByUpdated:"Sort by Updated",sortByCreated:"Sort by Created",principleList:"Principle List",keyboardHint:"Press / to search, j/k to navigate, Enter to expand, g/G to go top/bottom",noResults:"No results found",noResultsDescription:"Try adjusting your search or filters to find what you're looking for.",noPrinciples:"No principles yet",noPrinciplesDescription:"Principles will appear here once they are created in the system.",viewDetail:"View details",notFound:"Principle Not Found",notFoundDescription:'The principle "{{id}}" does not exist or has been removed.',backToList:"Back to List",browsePrinciples:"Browse Principles",copyLink:"Copy Link",share:"Share",valueMetrics:"Value Metrics",quickStats:"Quick Stats",ruleCount:"Rules",conflictCount:"Conflicts",coreAxiom:"Core Axiom",supersedes:"Supersedes",lastPainPrevented:"Last Pain Prevented",derivedFromPain:"Derived from Pain Events",createdAt:"Created",updatedAt:"Updated",coverageRate:"Coverage",falsePositiveRate:"False Positive",statusDistribution:"Status Distribution",priorityBreakdown:"Priority Breakdown",ruleCoverage:"Rule Coverage",valueDistribution:"Value Distribution",withRules:"With Rules",avgRulesPerPrinciple:"Avg Rules / Principle",bookmarked:"Bookmarked",addBookmark:"Add bookmark",removeBookmark:"Remove bookmark",select:"Select",selected:"selected",export:"Export",exportAll:"Export All",compare:"Compare",deselectAll:"Deselect All",compareTitle:"Principle Comparison",compareField:"Field",showMore:"Show more",showLess:"Show less",reviewTitle:"Principle Review",reviewSubtitle:"Review the principles distilled from observed behavior.",reviewDescription:"These are not cold rules \u2014 they are behavioral principles your Agent has distilled from real use.",viewNavLabel:"Principles views",tabWorkspace:"Workspace Principles",tabCore:"PD Core Principles",coreSectionTitle:"PRINCIPLES",coreTitle:"PD Core Principles",coreDescription:"These are the built-in principles PD uses to guide how an agent understands problems, makes judgments, and learns from experience. They are provided by the PD Runtime and are not workspace-learned principles.",coreReadOnly:"Read-only",coreLayerFoundational:"Foundational Axioms",coreLayerOperating:"Operating Principles",coreLoading:"Loading\u2026",coreLoadFailed:"Unable to load PD Core Principles",coreRetry:"Retry",metricDeposited:"Deposited Principles",metricActive:"Active Principles",metricLatest:"Last Updated",blockBasis:"Formation Basis",blockBasisFallback:"This principle was distilled from historical behavior calibration. Its detailed source is not yet linked.",contextDisclosure:"Formation and other information",libraryOverview:"Principle overview",openDetails:"View principle details",blockImpact:"Current Impact",blockImpactSeeDecisionView:"Whether this currently shapes behavior is shown on the detail page under current enforcement \u2014 this card does not assert impact from lifecycle status alone.",blockImpactActive:"This principle is currently shaping the Agent's subsequent behavior.",blockImpactPending:"Not yet active \u2014 awaiting Owner confirmation.",blockImpactRejected:"Rejected by Owner \u2014 no longer shapes the Agent's behavior.",blockImpactParked:"Parked \u2014 currently not shaping the Agent's behavior.",blockBehavior:"Behavior Change",blockBehaviorFallback:"No deterministic behavior rule recorded; the principle guides subsequent similar scenarios as a behavioral policy.",govDecision:"Governance Decision",revocationStatusUnknown:"Runtime revocation status cannot be confirmed \u2014 activation query failed. Awaiting recovery.",runtimeDeactivated:"Runtime Revoked",govApproved:"Owner Approved",govPending:"Pending Review",loading:"Loading\u2026",retry:"Retry",statusPending:"Pending",statusApproved:"Approved",statusRejected:"Rejected",statusParked:"Parked",statusCandidate:"Internalizing",emptyTitle:"No principles to review",emptyDescription:"When PD captures behavior deviation signals, principle candidates will appear here for your review.",emptyActionable:"No owner-actionable principles at this time. When PD captures behavior deviation signals, principle candidates will appear here for your review. You can check the Behavior Evidence page to see if PD is actively collecting signals.",noActionableTitle:"No actionable principles right now",noActionableDescription:'All current principles are classified as demo, smoke test, historical, or builtin axioms. Switch to "Show All" to see them.',filterActionable:"Actionable",filterAll:"Show All",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",confidence:"Confidence",evaluabilityLabel:"Evaluability",ownerDecision:{state:{needs_owner_decision:"Needs your decision",processing:"Processing",blocked:"Judgment unavailable",recovery_needed:"Needs recovery",decided:"Decided",no_action:"No action needed"}},languageHintEn:"Generated in English",languageHintZh:"Generated in Chinese",languageHintUnknown:"Language unknown",languageMismatchHint:"This principle was generated in {{lang}}. Review the behavior, not only the wording.",readabilityFallbackTitle:"Principle candidate",readabilityOriginalLabel:"Original technical text",readabilityWarning:{technical_pattern:"Title appears to be a technical pattern. Review the behavior evidence below.",diagnostic_residue:"Title may contain diagnostic residue. Review the full text for context.",title_too_long:"Title is unusually long. The readable summary may be in the text below."},detail:{loading:"Loading\u2026",backToList:"\u2190 Back to list",formationDisclosure:"How this principle formed",fullRule:"Read the complete principle",extraContext:"Other source notes and reflection questions",conclusion:"Conclusion",policyNote:"This is a behavioral policy for future similar scenarios. You can approve, modify, reject, or park it.",modifyWording:"Modify Wording",modifyWordingNote:"Principle modification will be available in a future version",channel:"Activation Channel",channelPromptReversible:"Will activate via prompt channel \xB7 Reversible",whyExists:"Why It Exists",applicableScenarios:"Applicable Scenarios",expectedBehavior:"Expected Behavior",nonApplicableScenarios:"Non-applicable Scenarios",conflictsWithNote:"Conflicts with {{count}} principle(s)",noConflicts:"No known conflicts",sideEffects:"Side Effects",sideEffectsNote:"After approval, activates via prompt channel. Can be rolled back at any time.",evidence:"Evidence",evidenceCount:"Linked to {{count}} evidence record(s)",copyEvidenceId:"Copy evidence ID",evidenceCopied:"Copied",expandTechDetails:"Expand technical details",evidenceIdLabel:"Evidence {{n}} ID",viewEvidenceChain:"View in evidence chain \u2192",ownerReflection:"Three Questions Before Deciding",reflectionQ1:"Does this principle describe behavior I want to see repeatedly?",reflectionQ2:"Do I understand which channel it will activate through?",reflectionQ3:"If it's wrong, do I know how to roll it back?",receipts:{title:"Receipt History",headline:"{{effectCount}} behavior-influence record(s) retained (last {{lastEffectAt}}) \u2014 historical observations, not a claim of current enforcement",headlinePresence:"Context injections recorded \u2014 no matching behavior-effect records yet",counts:"{{effectCount}} behavior effect(s) \xB7 {{presenceCount}} context injection(s)",empty:"No recent records \u2014 this principle has not been triggered at runtime yet.",note:"Two levels: Effect = the principle actually changed behavior (block / auto-correction / agent self-report); Presence = the principle entered task context (gray rows). Presence in a decision \u2260 changed behavior. Self-reports are probabilistic agent claims, listed separately from deterministic events.",unavailableReason:"Receipt history is unavailable right now.",coverage:{label:"Evidence coverage",statusAvailable:"Available",statusDisabled:"Receipt collection disabled",statusUnavailable:"Receipt data unavailable",observedSince:"Observed since {{date}}",observedSinceEmpty:"No records retained",asOf:"as of {{date}}",retention:"retention {{days}} days",limitation:"Historical completeness cannot be guaranteed \u2014 counts show currently retained evidence, not full history.",validationPartial:"Some records could not be displayed.",validationMalformed:"Receipt data requires recovery \u2014 counts may be unreliable.",reasonCodes:{receiptRowsDropped:"some rows were skipped during validation",ledgerLevelInvalid:"records with an invalid level exist",ledgerCountsUnreadable:"counts could not be read"}},kind:{rule_blocked:"Block",auto_correct_applied:"Auto-correct",self_reported:"Agent self-report",prompt_injected:"Context injection"},headlineNone:"No context injection or effect records observed within the current retention window",zeroEffectPresence:"Why 0 effects? Effects need evidence: a block, an auto-correction, or an agent self-report. So far this principle only has context-presence records \u2014 being present in a decision does not mean behavior changed. The first effect record will appear here as runtime evidence accumulates.",zeroEffectNone:"Why both counts are 0: zero means no records observed within the current retention window \u2014 not that nothing ever happened. History outside the retention window or during disabled collection does not appear here. Counts start moving as soon as the principle enters task context or produces its first effect.",presenceMissingNote:"No context-injection (presence) records for this principle within the current retention window; what is listed below are the effect records themselves."},trajectory:"View full trajectory when tracing is needed",stageEvidence:"Evidence",stageDiagnosis:"Diagnosis",stageProposal:"Proposal",stageReview:"Owner Review",stageDeploy:"Deployment Channel",stageBehavior:"Observable Behavior",trajectoryLoadFailed:"Failed to load trajectory data",lifecycleMetrics:"Lifecycle Metrics",lifecycleNote:"Rule quality signal, not equivalent to behavior change",insufficientData:"This principle has no rules or insufficient data to compute lifecycle metrics.",triggered:"triggered",approve:"Approve Principle",park:"Park",reject:"Reject",editAction:"Replace pending version",confirmApprove:"After approval, the principle will activate via prompt channel. Confirm approval?",confirm:"Confirm",cancel:"Cancel",rejectReasonPlaceholder:"Please explain why you reject (required)",approveNoteLabel:"Approval note (optional)",approveNotePlaceholder:"Why you approve \u2014 recorded as the decision note (may be left blank)",editReasonLabel:"Replacement reason (required)",editReasonPlaceholder:"Explain why this pending version needs replacing",editNewArtifactPlaceholder:"Enter validated revision artifact ID",currentArtifactLabel:"Current artifact",confirmReject:"Confirm Rejection",confirmEdit:"Confirm replacement",approved:"Approved / Will activate via prompt channel",rejected:"Rejected",editSucceeded:"Pending version replaced",parked:"Parked",viewActivation:"View activation status",approveFailed:"Approval failed. Please try again later.",partialFailure:"Decision applied, but {{failedCount}}/{{totalCount}} records failed: {{reason}}",rejectFailed:"Rejection failed. Please try again later.",editFailed:"Replacement failed. Please try again later.",unknownFailure:"Check the service logs.",decisionTitle:"Decision Actions",parkUnavailable:"Park is not yet available",reasonDataUnavailable:"Data temporarily unavailable",reasonAlreadyHandled:"Already handled",reasonNoRecords:"No pending approval records",reasonUnsupportedChannel:"Not a supported channel in the current version",unactionableReasonPrefix:"Unactionable reason: ",governance:{title:"Governance status",principleState:"Principle state",process:"Current stage",automation:"Automation",nextAction:"Next safe action",nextActionLabel:"Next action:",blockers:"Needs attention",uncertainty:"Evidence uncertainty",sameReasonCount:"({{n}} in total)",provenance:"Canonical evidence references",timeline:"Governance timeline",timelineEmpty:"No governance events are available yet.",unavailable:"Governance view unavailable",unavailableReason:"The governance evidence could not be validated or loaded safely.",unavailableNextAction:"Refresh once. If this persists, inspect the Console diagnostics before taking an approval action.",none:"None",fact:"Fact",derived:"Derived",actionsNotAuthorized:"No current Owner decision is required.",confidence:{strong:"Source-backed",degraded:"Incomplete evidence"},state:{candidate:"Candidate",active:"Active",archived:"Archived",deprecated:"Deprecated",probation:"Probation"},stage:{generating:"Generating",reviewing:"Reviewing",revising:"Revising",approval:"Approval",activation:"Activation"},automationState:{idle:"Idle",queued:"Queued",running:"Running",retry_scheduled:"Retry scheduled",stalled:"Stalled"},headline:{owner_decision:"Your decision is needed",recovery:"Recovery processing is needed",revision:"PD is revising this principle",processing:"PD is processing this principle",active:"This principle is active",unavailable:"Governance evidence is incomplete",recorded:"Principle recorded"},reason:{approval_pending:"A source-backed approval is waiting for your review.",recovery_required:"The current processing frontier cannot continue automatically.",automatic_revision:"A revision or retry is already in progress.",processing:"The current source-backed task is still running or queued.",activation_active:"At least one validated activation channel is active.",data_incomplete:"Available records cannot establish a complete governance view.",no_current_process:"No current processing or Owner action is recorded."},next:{review:"Review the existing approval actions below.",inspect_recovery:"A historical processing issue exists; inspect recovery info first \u2014 its relation to the current action is unconfirmed, and any decision should rely on the decision view.",wait:"No action is needed now. Wait for PD to finish the current work.",monitor:"No action is needed. Monitor the active behavior channel.",inspect_data:"Inspect the evidence diagnostics and repair the referenced durable record.",none:"No action is needed."},attention:{approval_pending:"Approval pending",task_failed:"Current Runtime task failed",human_review_required:"Runtime requested human recovery review",revision_not_materialized:"Requested revision was not materialized",verdict_missing:"Automated review finished without a durable verdict"},issue:{lineage_not_available:"Canonical lineage is not available yet.",lease_expired_unrecovered:"The current task lease is missing or expired.",ledger_activation_mismatch:"Ledger and activation records disagree.",weak_fact_ignored:"A weak fact was excluded from current authority.",lineage_conflict:"Conflicting lineage evidence was excluded.",lineage_cycle:"A lineage cycle prevents authoritative projection.",lineage_limit_exceeded:"The lineage exceeded the safe projection bound.",metadata_malformed:"A durable record is malformed and was excluded.",timestamp_invalid:"A durable record has an invalid timestamp.",source_unavailable:"The Runtime governance source is unavailable."},timelineCode:{pain_created:"Pain evidence recorded",candidate_generated:"Candidate generated",review_started:"Automated review started",revision_requested:"Revision requested",revision_reopened:"Revision task reopened",approved:"Owner approved",rejected:"Owner rejected",activated:"Channel activated",deactivated:"Channel deactivated",failed:"Runtime task failed",human_review:"Human recovery review requested"}},ownerDecision:{title:"Decision view for this principle",technicalOriginalNote:"The text above is the original technical recommendation; no readable principle statement is available yet (kept verbatim for traceability).",state:{needs_owner_decision:"A decision is waiting for your review",processing:"The system is processing this proposal",blocked:"The system cannot establish a complete governance judgment yet",recovery_needed:"This processing needs recovery",decided:"This proposal already has a completed decision",no_action:"Nothing needs your decision right now"},readsComplete:"All requested sources were read",readsPartial:"Some sources failed to read",incident:"What happened",learned:"The behavior principle the agent learned",sourceTier:"Source: {{tier}} (verbatim)",rationale:"Why PD judged it this way",applicability:"When it applies",expected:"What changes if approved (proposed, not deployed)",enforcementLabel:"Current enforcement",tier:{scribe:"Formal draft (Scribe)",distiller:"Abstracted principle (Distiller)",philosopher:"Candidate principle (Philosopher)",candidate_principle:"Original recommendation"},enforcement:{active:"An enforcement method is currently active (see details below).",deactivated:"The previous enforcement method is deactivated; nothing is enforcing right now.",partial:"Some enforcement methods are still running (see details below).",none:"No enforcement method is active for this principle.",since:"Active (since {{since}})",stopped:"Deactivated"},evidence:"Behavior evidence",uncertainty:"Risks and uncertainty",riskNotAssessed:"No risk assessment has been done; that does not mean there are no risks.",rollback:"How to stop its influence",decision:"Your decision",history:"Decision history",historyState:{approved:"Approved",rejected:"Rejected",cancelled:"Cancelled",pending:"Pending"},channel:{prompt:"context guidance channel",code_tool_hook:"RuleCode enforcement channel",defer_archive:"archive channel"},actionLabel:{approve:"Approve",reject:"Reject",edit_approval:"Replace approval artifact",disable:"Stop this enforcement going forward"},next:{review:"A decision is waiting for your review: read the material above, then approve or reject.",wait:"The system is processing this proposal; please wait.",inspect_data:"The system cannot establish a complete governance judgment yet.",inspect_recovery:"This processing has a historical issue; recovery info can be inspected.",monitor:"This proposal already has a completed decision. Review its enforcement and behavior records.",none:"Nothing needs your decision right now."},blocker:{decision_material_missing:"This subject lacks the information needed for a safe approval; rejection can still be evaluated separately.",lineage_not_available:"Governance identity is not established yet, so the system cannot tell whether your decision is needed.",historical_processing_issue:"{{n}} historical processing issue(s) exist (e.g. failed or retry-waiting tasks); their relation to the current action is unconfirmed."},noActions:"No action is currently available.",unavailable:"The decision view is temporarily unavailable; do not decide based on this page alone.",invalidTarget:"Action target missing; cannot submit.",actionDone:"Submitted.",actionFailed:"Refused: {{detail}} Available actions were refreshed \u2014 decide again from the latest state."},evidenceAudit:{title:"Intervention evidence audit",headline:"Deliveries {{d}} \xB7 Applications {{a}} \xB7 Episodes {{e}} \xB7 Effects {{f}} \xB7 Outcomes {{o}}",unresolved:'{{count}} record(s) reference objects that have not arrived yet (pending association, not "never happened")',sectionDelivery:"Delivery",sectionApplication:"Application",sectionEpisode:"Behavior episode",sectionEffect:"Effect",sectionOutcome:"Outcome",emptySection:"None observed within this scope (not the same as never happened)",pending:"pending association",loading:"Loading\u2026",loadOlder:"Load earlier records",capabilities:"Host capability declarations (Supported / Unsupported / Unknown)",technicalSummary:"Technical details (Phase 1 \xB7 revisions / digests / source identifiers)",technicalNote:"Engineering traceability data: evidence IDs, revision references, payload digests, activation and native lineage. The default view shows records and gaps; these fields do not change the semantics above.",sourceUnknown:"source verifiability unknown",contentRedacted:"content cleared on {{date}}",contentReference:"Content reference: {{resolution}} \xB7 {{principleId}}{{artifactId}}{{payloadDigest}}",referenceResolved:"resolved",referenceUnresolved:"revision unresolved",activationReference:"Activation: {{activationId}}{{activatedAt}}{{snapshotDigest}}",nativeLineage:"Native lineage: {{lineage}}",note:"This section records facts only: delivery confirmation levels, agent self-reports, and runtime facts are listed separately; missing means unknown, not invalid. No success-rate or effectiveness scoring.",unavailable:"Intervention evidence audit unavailable",noPayloadDigest:"no payload digest",noSnapshotDigest:"no snapshot digest",payloadDigestLabel:"payload digest",snapshotDigestLabel:"snapshot digest"}}},activation:{eyebrow:"Activation",title:"Activation Status",subtitle:"Which approved principles are actually in effect? This page shows activation facts \u2014 not claims about behavioral improvement.",summaryActive:"active",summaryInactive:"inactive",summaryNeverActivated:"never activated",boundaryLabel:"Capability boundary",boundaryText:"PD cannot yet count how many times a principle was triggered in subsequent tasks, nor can it automatically judge whether behavior has changed (requires semantic matching and feedback loops; not available in the current version).",sectionActive:"Active Principles",sectionInactive:"Inactive Principles",sectionNeverActivated:"Approved but Never Activated",emptyActive:"No principles are currently active. When you approve a principle, it will appear here with its activation details.",statusActive:"Active",statusInactive:"Inactive",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",tagReversible:"Reversible",tagHighRisk:"High Risk",tagNeverActivated:"Never Activated",injectionLabel:"Injection status",budgetObservedNote:"The budget figures in the injection status come from the most recent runtime observation (source {{source}}, context {{window}} tokens, observed at {{observedAt}}), not a live confirmation.",budgetFallbackNote:"The injection status is estimated with the fixed fallback budget ({{reason}}{{observed}}).",injectionInjectable:"Injectable (in current window, {{cost}}/{{budget}} chars)",injectionWindowRotates:"Out of window this turn: fits alone ({{cost}}/{{budget}} chars); rotation will reach it in later turns (forecast)",injectionWindowFifo:"Out of window this turn: fits alone ({{cost}}/{{budget}} chars); this route does not rotate, capacity must free up first",injectionOversized:"Oversized, not injectable: {{cost}} chars alone > {{budget}} cap \u2014 rotation cannot help; shorten the statement",injectionResolutionFailed:"Cannot determine: {{reason}}",injectionRouteUnconfirmed:"Host capacity unconfirmed: OpenClaw {{oc}} / Codex {{cx}} / WorkBuddy {{wb}}",revisionOpen:"Modify to injectable version",revisionPlaceholder:"Enter the new principle statement (keep trigger, required action, and necessary exception; be concise)",revisionSubmit:"Create pending new version",revisionQueued:"New version created and queued for approval; approving it replaces the current version automatically",revisionAlreadyPending:"This principle already has a pending revision approval",revisionFailed:"Failed to create the revision: {{reason}}",revisionFailedNetwork:"Failed to create the revision, please retry.",revisionResultNote:"The new version is pending approval ({{approvalId}}). Approving it deactivates and replaces the old version automatically; rejecting keeps the old version in effect.",revisionDiff:"View statement diff",revisionGoApprove:"Go to governance focus to approve the new version",principleLabel:"Principle",actionLabel:"Action",targetLabel:"Target",activatedAtLabel:"Activated",neverActivated:"Never activated",neverActivatedCard:"Approved but never activated",lifecycleToggle:"View lifecycle metrics",lifecycleUnavailable:"Lifecycle metrics are unavailable for this principle.",insufficientData:"This principle has no rules or insufficient data to compute lifecycle metrics.",adherenceLabel:"adherence",lifecycleNote:"Rule quality signal, not equivalent to behavior change",triggered:"triggered",disableAction:"Disable",confirmDisable:"After disabling, the principle will no longer influence agent behavior. Confirm disable?",disabling:"Disabling\u2026",disableSuccess:"Principle disabled",disableSuccessDescription:"Principle {{id}} has been deactivated.",disableFailed:"Failed to disable principle",undoDisable:"Disable action cancelled",viewDebt:"View in Principle Debt",loadError:"Unable to load activation data. You can try refreshing the page.",receiptsLabel:"Receipts",receiptsValue:"{{effect}} behavior effect(s) \xB7 {{presence}} context injection(s)",receiptsUnavailable:"Receipt history unavailable: {{reason}}",ownerDecisionTitle:"Owner Live Decision",ownerDecisionRecorded:"RuleCode decision recorded",ownerDecisionLoading:"Loading safety evidence\u2026",safetyIsolation:"Safety Isolation",runtimeCapability:"Runtime {{version}} \xB7 shadow evidence {{supported}}",supported:"supported",unsupported:"Unsupported",checks:{bounded_scope:"Bounded Tool Scope",runtime_compatibility:"Runtime Compatibility",host_liveness_composition:"Host Liveness Composition",emergency_controls:"Emergency Controls Health",runtime_shadow_evidence:"Runtime Shadow Evidence",owner_identity_configuration:"Owner Identity Configuration",activation_eligibility:"Activation Eligibility",lineage_binding:"Lineage & Artifact Binding",production_compile_load:"Production Compile & Load",golden_trace:"Golden Trace Evaluation",evidence_binding:"Evidence Binding"},checkStatus:{passed:"Passed",failed:"Failed"},reasonCodes:{required_check_missing:"Required safety check result missing",duplicate_check_result:"Duplicate check result recorded",runtime_shadow_evidence_unsupported:"Host runtime does not support shadow evidence collection",explicit_affected_tools_required:"Explicit affected tools must be defined",host_liveness_contract_missing_invalid_or_unsupported:"Host liveness contract is missing, invalid, or unsupported",neutral_probe_or_live_composition_failed:"Neutral probe or live composition check failed",neutral_probe_blocked:"Neutral probe was blocked by RuleCode",safety_controls_disabled:"Durable RuleCode safety controls are disabled",out_of_band_controls_unavailable:"Out-of-band emergency controls are unavailable",configured_owner_missing:"Configured Owner credential is missing or unverified",unresolved_shadow_unhealthy_evidence:"Unresolved runtime errors recorded during shadow observation",shadow_telemetry_source_unavailable:"Shadow telemetry source is missing or unreadable",artifact_digest_mismatch:"Artifact digest does not match the active version",active_shadow_activation_required:"Active shadow activation required for promotion",activation_not_unique:"Multiple active activations found",activation_artifact_mismatch:"Activation artifact does not match review subject",artifact_lineage_missing:"Artifact lineage (source task or parent artifacts) is missing",artifact_not_found:"Artifact not found in safety store",hard_check_failed:"Hard safety check failed",promotion_safety_gate_blocked:"Promotion blocked by safety gate checks",promotion_readiness_unavailable:"Promotion readiness could not be established",promotion_snapshot_stale:"Activation artifact changed during review",evidence_override_reason_required:"Evidence-insufficient promotion requires an Owner override reason",evidence_override_note_required:"Evidence-insufficient promotion requires an Owner review note",host_contract_unavailable:"Host liveness contract unavailable",promotion_commit_failed:"Failed to commit promotion to durable safety store",feature_not_enabled:"Feature is not enabled",safety_controls_unavailable:"Safety controls unavailable",owner_authentication_required:"Owner authentication required",cli_owner_note_required:"CLI promotion requires an Owner review note",confirmation_required:"Live enforcement confirmation required",promotion_request_invalid:"Promotion request parameters are invalid"},hardSafetyChecks:"Promotion Safety Checks",live24Hours:"Live monitoring \xB7 24 hours",live7Days:"Live monitoring \xB7 7 days",matched:"Matched",blocked:"Blocked",unhealthy:"Unhealthy",circuitTrips:"Circuit trips",behaviorDrift:"Behavior drift \xB7 approved block rate {{approved}} \xB7 live block rate {{live}} \xB7 delta {{delta}}",ownerDecisionHistory:"Owner and safety decision history",toolDistribution:"Tool distribution",representativeSamples:"Redacted representative samples",circuitConditions:"Circuit breaker isolates on protected-control matches, health failures, 3 consecutive errors, 5 broad consecutive blocks, >80% outside-scope blocking in 20 calls, or a failed neutral probe. It never auto-reactivates.",worstImpact:"Worst plausible impact: matching calls to {{tools}} can be blocked; PD control and recovery surfaces remain outside RuleCode authority.",eligibleEvaluations:"Eligible",wouldBlock:"Would block",wouldAllow:"Would allow",requireApproval:"Would require approval",autoCorrect:"Would auto-correct",neutralControl:"Neutral controls",shadowWindow:"Shadow window: {{first}} \u2014 {{last}}",overrideReason:"Why is limited evidence acceptable?",overrideRareBehavior:"Rare behavior",overrideControlledRollout:"Controlled rollout",overrideOwnerAccepts:"Owner accepts limited evidence",evaluationErrors:"Errors",notCollected:"Not collected",scopeArtifactCode:"Scope, artifact and implementation",ruleRevisionTitle:"Revise this rule for a new review",ruleRevisionReviewQueue:"View review queue",ruleRevisionBoundary:"Revise once using this feedback. Existing code and approvals are preserved. New code requires fresh approval and will not activate automatically.",ruleRevisionFeedback:"Required correction (up to 4000 characters)",ruleRevisionOnce:"Revise once with feedback",ruleRevisionStarted:"Revision queued. The result will appear for review; the current rule stays in shadow.",ruleRevisionAlreadyExists:"This artifact already has a revision; this request did not start a new one.",ownerReviewNote:"Owner review note",continueObserving:"Continue observing",rejectAfterShadow:"Reject and deactivate",confirmLive:"Confirm live enforcement",emergencyDeactivate:"Emergency deactivate",recoverToShadow:"Recover to a new Shadow",releaseGlobalPause:"Release global pause (do not restore rules)",globalPauseReleased:"Global pause latch released; isolated rules remain stopped",rolloutDisabled:"Owner decision rollout is disabled; emergency stop remains available.",pauseAll:"Pause all Live RuleCode",pauseAllSucceeded:"All live RuleCode enforcement paused",pendingRules:"Rules awaiting live decision",pendingRulesDescription:"Shadow Observation has produced a separate Owner Live Decision queue.",safetyAlerts:"Safety alerts",safetyAlertsDescription:"These rules are isolated and fail-open; they never return live automatically.",legacyUnknown:"Historical live activation / decision maker unknown. Review by {{due}}; PD will not fabricate Owner identity.",sevenDays:"within 7 days",footer:"This page shows activation facts \u2014 which principles are in effect and through which channels.",fitUnknown:"unknown",fitYes:"fits",fitNo:"oversized"},approvals:{title:"Approval",description:"Review and approve principle activation requests",loadFailed:"Failed to load approvals",detailFailed:"Failed to load approval details",approveFailed:"Failed to approve",rejectFailed:"Failed to reject",emptyHint:"No approval requests pending. Approvals will appear when principles are ready for activation."},reportProblem:{eyebrow:"Product Feedback",title:"Report a Problem",subtitle:"Generate a privacy-preserving local feedback draft. The Console never auto-uploads \u2014 you choose what to share, how to share it, and when.",noAutoUpload:"This Console never auto-uploads feedback. Drafts are stored locally only.",loadError:"Unable to load feedback data. You can try refreshing the page.",description:"Generate a privacy-preserving local feedback draft. The Console never auto-uploads \u2014 you choose what to share, how to share it, and when.",deepLinked:"Deep-linked from {{source}}.",entryFeedback:"Feedback",form:{title:"Describe what happened",description:"Only fields below are stored. Raw prompts, chat history, file contents, paths, env vars, and tokens are excluded by default.",type:"Type",severity:"Severity",severityNotSet:"Not set",severityLow:"Low",severityMedium:"Medium",severityHigh:"High",blockingLevelLabel:"How much does it block you",blockingLevelNotSet:"Not set",blockingLevelBlocked:"Blocked me",blockingLevelWorkaround:"Workaround possible",blockingLevelMinor:"Doesn't affect me",frequencyLabel:"How often does it occur",frequencyNotSet:"Not set",frequencyAlways:"Every time",frequencyOften:"Often",frequencySometimes:"Sometimes",frequencyOnce:"Once",goalLabel:"What were you trying to do",stuckAtLabel:"Where did you get stuck",jobLabel:"What goal are you trying to achieve",currentWorkaroundLabel:"How do you work around it now",sawWhatLabel:"What did you see that worried you",whereSeenLabel:"Where did you see it",detailsToggle:"Additional details",detailsHide:"Collapse details",titleLabel:"Title",descriptionLabel:"Description",stepsLabel:"Steps to reproduce (optional)",expectedLabel:"Expected behavior (optional)",actualLabel:"Actual behavior (optional)",submit:"Save local draft",submitting:"Saving\u2026",hidePreview:"Hide markdown preview",showPreview:"Show markdown preview",types:{bug:"Bug",confusing:"Confusing",privacy_concern:"Privacy concern",feature_request:"Feature request",other:"Other"}},privacy:{title:"Privacy boundary",description:"What this report will and will not include.",included:"Included",excluded:"Excluded by default",notes:"Redaction notes",submitFirst:"Save a draft to see exactly which sections are included.",guarantee:"No automatic upload. Drafts are stored at <workspace>/.pd/feedback/drafts/. You decide what to do with them."},draft:{title:"Draft saved locally",savedAt:"id: {{id}} \xB7 saved at {{at}}",copyMarkdown:"Copy Markdown",copyEmail:"Copy email text",openGithub:"Open GitHub issue URL",openEmail:"Open Email",delete:"Delete draft",sentBadge:"Sent",draftBadge:"Pending",markAsSent:"Mark as sent"},channel:{title:"Send feedback",description:"This feedback is redacted and contains only what you filled in above. The Console never auto-uploads \u2014 clicking a button is your explicit submission.",ingest:"Submit in one click (recommended)",github:"Submit as a GitHub issue",email:"Open email",file:"Export file",disablingReason:"Unavailable: {{reason}}",confirmTitle:"Confirm sending feedback",confirmDescription:"After submitting, this redacted feedback will be sent to the maintainer feedback service. You cannot undo it, but you can delete the local draft afterwards.",confirmBodyLabel:"Content to send",confirmSubmit:"Confirm send",confirmCancel:"Cancel",receiptTitle:"Submitted",receiptTrackingId:"Tracking id",openIssue:"View issue",alreadySubmitted:"This draft was already submitted and was not re-submitted.",writeBackNote:"Submission complete, but status write-back failed. Please record the receipt manually."},saved:{title:"Saved drafts",load:"Load"},toast:{draftCreated:"Draft saved locally",draftDeleted:"Draft deleted",markdownCopied:"Markdown copied to clipboard",emailCopied:"Email text copied to clipboard",copyFailed:"Copy failed",loadFailed:"Failed to load draft",deleteFailed:"Failed to delete draft",submitSucceeded:"Submitted. Tracking id {{trackingId}}",submitFailed:"Submission failed",markSentSucceeded:"Marked as sent",channelsFailed:"Could not load send channels"},errors:{missingRequired:"Title and description are required.",createFailed:"Failed to create draft."}},settings:{eyebrow:"Settings",title:"Settings",subtitle:"Manage authentication and workspace configuration for the governance workspace.",auth:"Authentication",bearerToken:"Bearer Token",enterAccessToken:"Enter access token",tokenSaved:"Token saved",tokenSavedRestarting:"Token encrypted and saved; restarting Console to apply it\u2026",tokenSaveFailed:"Token was not saved. Check desktop encryption and Console status, then retry.",tokenExternalAttached:"Token saved, but an external Console is still connected.",tokenSessionOnly:"Token is stored in browser session only.",tokenDesktopStored:"Desktop: encrypted with the Windows system store.",clearToken:"Clear credential",clearTokenConfirm:"Confirm clear",tokenCleared:"Credential cleared",tokenClearedRestarting:"Credential cleared; restarting Console without authentication\u2026",tokenClearedSession:"Browser session token cleared.",tokenClearedExternalAttached:"Companion credential cleared, but the externally started Console still requires its token.",tokenInheritedEnv:"The token comes from the PD_CONSOLE_TOKEN environment variable set outside PD; clearing is not durable \u2014 it will return on the next launch. Remove the variable at its source (launcher/terminal).",tokenClearFailed:"Failed to clear the credential.",ownerIdentity:{title:"Owner identity",intro:"The Owner identity gates governance decision entry points (RuleCode promotion, emergency pause, etc.). Register to ~/.pd/owner.json (install-level, shared across workspaces). If the PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID environment variables are set together, they take precedence as a pair.",loading:"Loading\u2026",statusConfigured:"Registered",statusMissing:"Not registered",statusInvalid:"Env configuration invalid",sourceEnv:"Source: environment variables (highest priority)",sourceFile:"Source: ~/.pd/owner.json",sourceInvalid:"Source: environment variables (incomplete pair)",sourceNone:"Not registered",governanceReady:"Governance: Ready",governanceNotReady:"Governance: Not ready",governanceReasonTokenAuth:"Console token authentication is required before any Owner governance action can execute.",governanceReasonIdentity:"A complete Owner identity is required before any Owner governance action can execute.",governanceNextActionTokenAuth:"Next action: start pd-console with --token <value> or set PD_CONSOLE_TOKEN, then retry.",invalidEnvHint:"PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID must be set together and both non-empty. Until the pair is completed or both variables are removed, no Owner authority is active \u2014 the file registration is NOT in effect.",ownerIdLabel:"Owner ID",credentialIdLabel:"Credential ID",register:"Register",unregister:"Unregister",registeredAt:"registered",envHint:"The identity currently comes from environment variables. To switch to file registration, remove the env vars and restart the console.",required:"Owner ID and Credential ID must not be empty.",operationFailed:"Operation failed. Please retry.",registered:"Owner identity registered.",unregistered:"Owner identity unregistered."},workspace:"Workspaces",addWorkspace:"Add Workspace",syncWorkspace:"Sync",removeWorkspace:"Remove",workspaceAdded:"Workspace added",workspaceRemoved:"Workspace removed",confirmDeleteTitle:"Remove Workspace",confirmDeleteDescription:'Remove workspace "{{name}}"? This cannot be undone.',name:"Name",path:"Path",lastSync:"Last Sync",loadError:"Unable to load settings. You can try refreshing the page.",addNamePlaceholder:"Workspace name",addPathPlaceholder:"Workspace path",principleLanguage:"Principle Language",principleLanguageDescription:"Save your language preference for principle display. Generation integration is deferred.",languageZhCN:"\u4E2D\u6587 (Chinese)",languageEn:"English",languageSaved:"Language preference saved",languageLoadError:"Failed to load language preference",notifications:"Notifications",soundAlerts:"Sound alerts",soundAlertsDescription:"Play a sound when new approvals or degraded signals arrive"},controlCenter:{eyebrow:"Control Center",title:"Config Readiness",subtitle:"PD can only work when configuration is complete. This page shows config readiness \u2014 not a system health dashboard.",designGate:{title:"Local Codex Design Declaration",description:"Record an Owner decision for a SPEC and an observed native Codex session. The server verifies the session and SPEC snapshot; it does not prove that implementation matches natural-language intent.",loadingSessions:"Loading observed Codex sessions\u2026",noSessions:"No native Codex sessions have been observed for this workspace yet. Open a Codex session with PD observation enabled, then refresh.",refresh:"Refresh",loadingDeclaration:"Loading the latest declaration\u2026",nativeSession:"Observed native session",noDeclaration:"No declaration exists for this session. Record the SPEC, covered paths, actions, and an explicit Owner decision.",specPath:"SPEC file path",specPathHint:"Relative to the selected project workspace, or an absolute path inside it",scopePathsInput:"Project-relative paths covered by this declaration (one per line)",scopePathsHint:"packages/example/src/file.ts",scopePathsHelp:"Use . for the project root. With Execute, . covers command invocations originating in this native project/session; it does not sandbox process effects or prove filesystem containment.",scopeActionsInput:"Actions covered",initialDecision:"Owner decision",decisions:{approved:"Approved",notApproved:"Not approved",notRequired:"Approval not required"},actions:{read:"Read",write:"Write",execute:"Execute"},decision:"Decision:",revision:"Revision:",spec:"SPEC:",specDigest:"SPEC snapshot digest:",scopePaths:"Covered paths:",scopeActions:"Covered actions:",owner:"Recorded by Owner:",decidedAt:"Recorded at:",revoked:"Revoked",revokedLatest:"The latest declaration is revoked (revision {{revision}}). You can record a new declaration for this session.",semanticLimit:"This Owner declaration is bound to the shown SPEC snapshot, project, session, and paths/actions. Execute with . covers commands originating in this native project/session; it does not sandbox process effects or prove filesystem containment. Host operations outside a reliably classified path/action scope remain unknown. This declaration does not prove that code satisfies the SPEC\u2019s natural-language meaning.",requiredFields:"Enter a SPEC path, at least one covered path, and one or more actions.",invalidMutationResponse:"The server returned no declaration after a successful change. Refresh before continuing.",approve:"Approve this scope",markPending:"Mark not approved",revoke:"Revoke declaration",saving:"Saving\u2026",create:"Record declaration"},configReady:"Configuration complete. All enabled agents are ready.",configNeedsSetup:"Some agents need configuration before they can run.",configNotReady:"Some agents cannot run. Check configuration errors below.",configUnknown:"Configuration status is unknown. Check your setup.",configDisabled:"All agents are disabled.",configErrors:"Configuration Errors",internalAgents:"Internal Agents",internalAgentsDescription:"Each PD internal agent runs on the runtime profile you configure \u2014 provider, model, and the name of the environment variable holding your API key. Keys stay outside PD.",defaultRuntime:"Default Runtime",defaultRuntimeDescription:"The default runtime profile for agents without explicit overrides.",advancedDiagnostics:"Advanced Diagnostics",features:"Features",runtimeProfiles:"Runtime Profiles",warnings:"Warnings",copyDiagnostics:"Copy Diagnostics",redactedNote:"Secrets and API keys are redacted from copied output.",on:"On",off:"Off",saving:"Saving\u2026",saveFailed:"Save failed",loadError:"Unable to load configuration data. You can try refreshing the page.",agentEnabled:"Enabled",agentDisabled:"Disabled",profileLabel:"Profile",readinessLabel:"Readiness",workflow:{title:"PD Behavior Loop",subtitle:"From error to principle, from principle to change",phase01:"Detect Error",phase01Desc:`Observe Agent behavior
15
+ \u667A\u80FD\u4F53\u4E0B\u6B21\u884C\u4E3A`,loopHint:"\u884C\u4E3A\u6539\u53D8\u540E\uFF0CPD \u7EE7\u7EED\u89C2\u5BDF \u2014\u2014 \u5F62\u6210\u95ED\u73AF\u30029 \u4E2A\u4EE3\u7406\u5206\u5E03\u5728\u8FD9\u6761\u56DE\u8DEF\u4E0A\uFF0C\u5404\u53F8\u5176\u804C\u3002"},status:{enabled:"\u5DF2\u542F\u7528",notReady:"\u672A\u5C31\u7EEA",corePipeline:"\u6838\u5FC3\u7BA1\u9053",corePipelineOk:"\u6B63\u5E38",corePipelineDegraded:"\u964D\u7EA7\u53EF\u7528",corePipelineParalyzed:"\u762B\u75EA",needsConfig:"\u9700\u914D\u7F6E"},groups:{coreTrio:"\u6838\u5FC3\u4E09\u4EF6\u5957",coreTrioTag:"\u5FC5\u987B\u4E00\u8D77\u5F00",coreTrioHint:"\u5173\u6389\u4EFB\u4F55\u4E00\u4E2A\uFF0CPD \u90FD\u65E0\u6CD5\u628A\u9519\u8BEF\u8F6C\u5316\u4E3A\u539F\u5219",codeChain:"\u4EE3\u7801\u5B9E\u73B0\u94FE",codeChainTag:"\u63A8\u8350\u4E00\u8D77\u5F00",codeChainHint:"\u53EA\u5F00 artificer \u4F1A\u964D\u7EA7\u4E3A\u7EAF\u63D0\u793A\u901A\u9053\uFF1B\u53EA\u5F00 evaluator \u65E0\u610F\u4E49",qualityPolish:"\u8D28\u91CF\u6253\u78E8",qualityPolishTag:"\u53EF\u9009 \xB7 \u5355\u72EC\u5F00\u5173",qualityPolishHint:"\u8BA9\u539F\u5219\u66F4\u7CBE\u70BC\uFF0C\u5173\u6389\u4E5F\u80FD\u7528\uFF0C\u53EA\u662F\u8D28\u91CF\u7565\u7C97",sidechain:"\u4FA7\u94FE\u670D\u52A1",sidechainTag:"\u72EC\u7ACB \xB7 \u5355\u72EC\u5F00\u5173",sidechainHint:"\u4E0D\u5F71\u54CD\u4E3B\u7BA1\u9053\uFF0C\u53EA\u5F71\u54CD pain \u4FE1\u53F7\u68C0\u6D4B\u7CBE\u5EA6"},impact:{label:"\u5173\u6389\u4F1A\u600E\u6837",confirmTitle:"\u786E\u8BA4\u5173\u95ED\u6838\u5FC3\u4EE3\u7406",confirmAck:"\u786E\u8BA4\u5173\u95ED",confirmCancel:"\u53D6\u6D88"},techDetail:"\u6280\u672F\u7EC6\u8282",profileLabelShort:"\u8FD0\u884C\u65F6",manageProfiles:"\u7BA1\u7406 Profiles",readinessChecking:"\u63A2\u6D4B\u5C31\u7EEA\u4E2D\u2026",unknownAgentsWarning:"\u68C0\u6D4B\u5230 {{count}} \u4E2A\u672A\u8BC6\u522B\u7684\u4EE3\u7406\uFF1A{{names}}\u3002\u5B83\u4EEC\u672A\u88AB\u5206\u7EC4\u663E\u793A\u3002",footerNote:"9 \u4E2A\u4EE3\u7406\u5206\u5E03\u5728\u5185\u5316\u7BA1\u9053\u4E0E\u4FA7\u94FE\u670D\u52A1\u4E24\u6761\u8DEF\u5F84\u4E0A\u3002\u6838\u5FC3\u4E09\u4EF6\u5957\u5FC5\u987B\u4E00\u8D77\u5F00\uFF0C\u5426\u5219 PD \u65E0\u6CD5\u628A\u9519\u8BEF\u8F6C\u5316\u4E3A\u539F\u5219\u3002",profiles:{sectionTitle:"\u8FD0\u884C\u65F6\u914D\u7F6E\u7BA1\u7406",sectionDescription:"\u521B\u5EFA\u3001\u7F16\u8F91\u3001\u5220\u9664 runtime profile\u3002\u88AB\u667A\u80FD\u4F53\u5F15\u7528\u6216\u8BBE\u4E3A\u9ED8\u8BA4\u7684 profile \u65E0\u6CD5\u5220\u9664\u3002",createButton:"\u65B0\u5EFA Profile",editButton:"\u7F16\u8F91",deleteButton:"\u5220\u9664",cancelButton:"\u53D6\u6D88",saveButton:"\u4FDD\u5B58",creating:"\u521B\u5EFA\u4E2D\u2026",saving:"\u4FDD\u5B58\u4E2D\u2026",deleting:"\u5220\u9664\u4E2D\u2026",empty:"\u6682\u65E0 runtime profile\u3002",columnId:"ID",columnType:"\u7C7B\u578B",columnProvider:"Provider",columnModel:"Model",columnApiKeyEnv:"API Key \u73AF\u5883\u53D8\u91CF",columnReadiness:"\u5C31\u7EEA",columnActions:"\u64CD\u4F5C",formTitleCreate:"\u65B0\u5EFA Runtime Profile",formTitleEdit:"\u7F16\u8F91 Profile: {{id}}",fieldId:"Profile ID",fieldIdHint:"\u552F\u4E00\u6807\u8BC6\u7B26\uFF0C\u521B\u5EFA\u540E\u4E0D\u53EF\u4FEE\u6539\uFF08\u5982 anthropic-cloud\uFF09",fieldIdPlaceholder:"my-profile",fieldProvider:"Provider",fieldProviderPlaceholder:"anthropic",fieldModel:"Model",fieldModelPlaceholder:"claude-sonnet-4",fieldApiKeyEnv:"API Key \u73AF\u5883\u53D8\u91CF\u540D",fieldApiKeyEnvHint:"\u73AF\u5883\u53D8\u91CF\u540D\uFF0C\u4E0D\u662F key \u503C\uFF08\u5982 ANTHROPIC_API_KEY\uFF09",fieldApiKeyEnvPlaceholder:"ANTHROPIC_API_KEY",fieldBaseUrl:"Base URL\uFF08\u53EF\u9009\uFF09",fieldBaseUrlPlaceholder:"https://api.anthropic.com",retiredBadge:"\u5DF2\u9000\u5F79",validationIdRequired:"Profile ID \u4E0D\u80FD\u4E3A\u7A7A",validationProviderRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 provider",validationModelRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 model",validationApiKeyEnvRequired:"pi-ai profile \u5FC5\u987B\u586B\u5199 apiKeyEnv",deleteConfirmTitle:"\u786E\u8BA4\u5220\u9664",deleteConfirmMessage:"\u786E\u5B9A\u8981\u5220\u9664 profile\u300C{{id}}\u300D\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002",deleteConfirmAck:"\u786E\u8BA4\u5220\u9664",deleteConfirmCancel:"\u53D6\u6D88",createSuccess:"Profile \u521B\u5EFA\u6210\u529F",updateSuccess:"Profile \u5DF2\u66F4\u65B0",deleteSuccess:"Profile \u5DF2\u5220\u9664",operationFailed:"\u64CD\u4F5C\u5931\u8D25"}},login:{title:"\u767B\u5F55",description:"\u767B\u5F55 PD \u6CBB\u7406\u5DE5\u4F5C\u53F0",slogan:"\u628A\u53CD\u590D\u7EA0\u6B63\uFF0C\u6C89\u6DC0\u4E3A\u53EF\u6CBB\u7406\u7684\u539F\u5219",connectWorkspace:"\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0",detecting:"\u6B63\u5728\u68C0\u6D4B\u672C\u673A Companion\u2026",connecting:"\u6B63\u5728\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0\u2026",accessToken:"\u8BBF\u95EE\u4EE4\u724C",enterAccessToken:"\u8F93\u5165\u8BBF\u95EE\u4EE4\u724C\u5B8C\u6210\u8FDE\u63A5",connect:"\u8FDE\u63A5",errorInvalid:"\u8BBF\u95EE\u51ED\u8BC1\u65E0\u6548\u6216\u670D\u52A1\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",errorExpired:"\u4F1A\u8BDD\u5DF2\u8FC7\u671F\u6216\u4EE4\u724C\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u3002",recoveryTitle:"\u65E0\u6CD5\u8FDE\u63A5 PD \u5DE5\u4F5C\u53F0",recoveryReason:"\u539F\u56E0\uFF1A\u62E5\u6709\u8005\u51ED\u8BC1\u5DF2\u5931\u6548\u6216\u4E0E\u672C\u673A\u63A7\u5236\u53F0\u4E0D\u5339\u914D\u3002",reconnect:"\u91CD\u65B0\u8FDE\u63A5",manualEntry:"\u624B\u52A8\u8F93\u5165\u8BBF\u95EE\u4EE4\u724C",manualEntryHint:"\u624B\u52A8\u8F93\u5165\u7684\u65B0\u4EE4\u724C\u4F1A\u66F4\u65B0 Companion \u4E2D\u4FDD\u5B58\u7684\u51ED\u8BC1\u3002",readFailedTitle:"Companion \u51ED\u8BC1\u8BFB\u53D6\u5931\u8D25",readFailedHint:"\u65E0\u6CD5\u8BFB\u53D6 Companion \u4FDD\u5B58\u7684\u51ED\u8BC1\uFF08\u7248\u672C\u53EF\u80FD\u4E0D\u5339\u914D\uFF09\u3002\u8BF7\u624B\u52A8\u8F93\u5165\u4EE4\u724C\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\u8BF7\u91CD\u542F Companion\u3002",persistFailed:"\u5DF2\u8FDE\u63A5\uFF0C\u4F46\u51ED\u8BC1\u672A\u80FD\u5B89\u5168\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u9700\u91CD\u65B0\u8F93\u5165\u4EE4\u724C\u3002",persistSucceeded:"\u62E5\u6709\u8005\u51ED\u8BC1\u5DF2\u7531 Companion \u5B89\u5168\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u6253\u5F00\u5C06\u81EA\u52A8\u8FDE\u63A5\u3002",persistAttached:"\u51ED\u8BC1\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5F53\u524D\u4F7F\u7528\u7684\u662F\u5916\u90E8\u542F\u52A8\u7684\u63A7\u5236\u53F0\uFF0C\u91CD\u542F Companion \u540E\u751F\u6548\u3002",tokenSessionOnly:"\u4EE4\u724C\u4EC5\u5B58\u50A8\u5728\u6D4F\u89C8\u5668\u4F1A\u8BDD\u4E2D\u3002",noAuthFlag:"\u4F7F\u7528 --no-auth \u6807\u5FD7\u7981\u7528\u8EAB\u4EFD\u9A8C\u8BC1\u3002"},update:{eyebrow:"\u66F4\u65B0",title:"\u66F4\u65B0",subtitle:"\u68C0\u67E5 PD \u66F4\u65B0\u5E76\u67E5\u770B\u66F4\u65B0\u5386\u53F2\u3002\u66F4\u65B0\u4FDD\u6301\u4F60\u7684\u6CBB\u7406\u5DE5\u4F5C\u53F0\u5904\u4E8E\u6700\u65B0\u72B6\u6001\u3002",currentVersion:"\u5F53\u524D\u7248\u672C",latestVersion:"\u6700\u65B0\u7248\u672C",upToDate:"\u5DF2\u662F\u6700\u65B0",updateAvailable:"\u6709\u53EF\u7528\u66F4\u65B0",checkForUpdates:"\u68C0\u67E5\u66F4\u65B0",checking:"\u68C0\u67E5\u4E2D\u2026",history:"\u66F4\u65B0\u5386\u53F2",noHistory:"\u6682\u65E0\u66F4\u65B0\u5386\u53F2\u3002",version:"\u7248\u672C",failed:"\u5931\u8D25",historyKind:{update:"\u66F4\u65B0",reinstall:"\u91CD\u65B0\u5B89\u88C5",legacy_migration:"\u5386\u53F2\u8FC1\u79FB",rollback:"\u56DE\u6EDA",refusal:"\u5DF2\u62D2\u7EDD",failure:"\u5931\u8D25",recovery:"\u6062\u590D",unknown:"\u672A\u77E5\u64CD\u4F5C"},checkError:"\u68C0\u67E5\u51FA\u9519",syncPending:"\u6700\u65B0\u7248 {{pluginVersion}} \u5DF2\u53D1\u5E03\uFF0C\u5B89\u88C5\u5668\u540C\u6B65\u4E2D\uFF08\u5F53\u524D\u53EF\u66F4\u65B0\u81F3\u4E0A\u65B9\u5217\u51FA\u7684\u7248\u672C\uFF09\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u66F4\u65B0\u6570\u636E\u3002\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u5237\u65B0\u9875\u9762\u3002",checkFailed:"\u66F4\u65B0\u68C0\u67E5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",blockedBadge:"\u9700\u5148\u89E3\u51B3",reasonLabel:"\u539F\u56E0\uFF1A",recoveryBanner:"\u68C0\u6D4B\u5230\u672A\u5B8C\u6210\u7684\u66F4\u65B0\u4E8B\u52A1",recoveryItem:"\u4E8B\u52A1 {{id}} \u505C\u7559\u5728\u9636\u6BB5\u300C{{phase}}\u300D",recoveryRequiredBanner:"\u4E00\u6B21\u5931\u8D25\u7684\u66F4\u65B0\u4F7F\u5B89\u88C5\u5904\u4E8E\u4E0D\u4E00\u81F4\u72B6\u6001\uFF08\u9700\u8981\u6062\u590D\uFF09",recoveryRequiredItem:"\u5931\u8D25\u4E8B\u52A1 {{id}} \u9700\u8981\u6062\u590D\u2014\u2014\u8BF7\u91CD\u65B0\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668",inProgressToast:"\u66F4\u65B0\u4E8B\u52A1\u5DF2\u53D7\u7406\uFF0C\u6B63\u5728\u540E\u53F0\u6267\u884C\uFF1B\u8BF7\u52FF\u91CD\u590D\u70B9\u51FB\u3002",inProgressPanel:"\u66F4\u65B0\u8FDB\u884C\u4E2D",inProgressPhase:"\u5F53\u524D\u9636\u6BB5\uFF1A{{phase}}",inProgressConfirmed:"\u66F4\u65B0\u5DF2\u5B8C\u6210\uFF08{{version}}\uFF09\u3002\u8BF7\u91CD\u542F\u63A7\u5236\u53F0\u52A0\u8F7D\u65B0\u7248\u672C\u3002",inProgressEnded:"\u66F4\u65B0\u4E8B\u52A1\u5DF2\u7ED3\u675F\uFF1A{{state}}",inProgressTimeout:"\u66F4\u65B0\u8017\u65F6\u8F83\u957F\uFF0C\u672A\u80FD\u786E\u8BA4\u7ED3\u679C\u3002\u8BF7\u7A0D\u540E\u5728\u66F4\u65B0\u5386\u53F2\u4E2D\u67E5\u770B\u8BE5\u4E8B\u52A1\u3002",reason:{bootstrap_too_old:"\u672C\u673A\u7684\u66F4\u65B0\u5E95\u5EA7\u7EC4\u4EF6\u7248\u672C\u8FC7\u4F4E\uFF0C\u65E0\u6CD5\u5B89\u88C5\u6B64\u7248\u672C\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\uFF08npx create-principles-disciple\uFF09\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_not_registered:"\u672C\u673A\u7F3A\u5C11\u66F4\u65B0\u5E95\u5EA7\u767B\u8BB0\uFF08\u65E7\u7248\u5B89\u88C5\uFF09\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_manifest_corrupt:"\u66F4\u65B0\u5E95\u5EA7\u7684\u767B\u8BB0\u6587\u4EF6\u635F\u574F\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_identity_mismatch:"\u66F4\u65B0\u5E95\u5EA7\u7684\u767B\u8BB0\u4E0E\u5B9E\u9645\u6587\u4EF6\u4E0D\u4E00\u81F4\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u4FEE\u590D\u540E\u518D\u8BD5\u3002",metadata_source_unconfigured:"\u5B98\u65B9\u66F4\u65B0\u6E90\u672A\u767B\u8BB0\uFF1A\u672C\u673A\u6CA1\u6709\u7B7E\u540D\u53D1\u5E03\u5730\u5740\uFF0C\u65E0\u6CD5\u6838\u5BF9\u6700\u65B0\u7248\u672C\u3002\u8BF7\u5E26\u66F4\u65B0\u6E90\u5730\u5740\u8FD0\u884C\u4E00\u6B21\u5B98\u65B9\u5B89\u88C5\u5668\u5B8C\u6210\u767B\u8BB0\u3002",install_state_corrupt:"\u5B89\u88C5\u72B6\u6001\u6587\u4EF6\u635F\u574F\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u4FEE\u590D\u540E\u518D\u8BD5\u3002",journal_not_supported:"\u66F4\u65B0\u4E8B\u52A1\u76EE\u5F55\u4E0D\u53EF\u7528\u3002\u8BF7\u68C0\u67E5 ~/.pd/transactions \u7684\u78C1\u76D8\u4E0E\u6743\u9650\u540E\u91CD\u8BD5\u3002",installer_missing:"\u66F4\u65B0\u7EC4\u4EF6\u4E0D\u53EF\u7528\u3002\u8BF7\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u4FEE\u590D\u540E\u518D\u8BD5\u3002",bootstrap_not_installed:"\u5C1A\u672A\u68C0\u6D4B\u5230\u6709\u6548\u5B89\u88C5\u3002\u8BF7\u5148\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u5B89\u88C5 PD\u3002",downgrade_blocked:"\u76EE\u6807\u7248\u672C\u6BD4\u5F53\u524D\u5DF2\u5B89\u88C5\u7248\u672C\u66F4\u65E7\uFF0C\u9ED8\u8BA4\u7981\u6B62\u964D\u7EA7\u3002",sequence_regression:"\u76EE\u6807\u7248\u672C\u7684\u53D1\u5E03\u5E8F\u53F7\u4E0D\u6BD4\u5F53\u524D\u65B0\uFF0C\u5DF2\u62D2\u7EDD\u4EE5\u9632\u56DE\u9000\u3002",channel_pointer_mismatch:"\u7B7E\u540D\u9891\u9053\u6307\u9488\u4E0E\u53D1\u5E03\u5185\u5BB9\u4E0D\u4E00\u81F4\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u51FA\u73B0\u8BF7\u8054\u7CFB\u7EF4\u62A4\u8005\u3002",release_metadata_expired:"\u53D1\u5E03\u5143\u6570\u636E\u5DF2\u8FC7\u671F\u3002\u8BF7\u7B49\u5F85\u5B98\u65B9\u91CD\u65B0\u53D1\u5E03\u540E\u518D\u8BD5\u3002",channel_metadata_expired:"\u9891\u9053\u5143\u6570\u636E\u5DF2\u8FC7\u671F\u3002\u8BF7\u7B49\u5F85\u5B98\u65B9\u5237\u65B0\u540E\u518D\u8BD5\u3002",legacy_layout_not_supported:"\u6B64\u5B89\u88C5\u4F7F\u7528\u65E7\u7248\u5E03\u5C40\uFF0C\u9700\u8FD0\u884C\u5B98\u65B9\u5B89\u88C5\u5668\u8FC1\u79FB\u5230\u65B0\u5E03\u5C40\u3002",metadata_refresh_failed:"\u65E0\u6CD5\u83B7\u53D6\u6216\u9A8C\u8BC1\u7B7E\u540D\u53D1\u5E03\u5143\u6570\u636E\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",destructive_migration_requires_maintenance:"\u6B64\u7248\u672C\u5305\u542B\u7834\u574F\u6027\u6570\u636E\u8FC1\u79FB\uFF0C\u65E0\u6CD5\u901A\u8FC7\u666E\u901A\u66F4\u65B0\u5B8C\u6210\u3002\u8BF7\u4F7F\u7528\u5B98\u65B9\u7EF4\u62A4\u6D41\u7A0B\u8FC1\u79FB\u6570\u636E\u3002"},applyUpdate:"\u7ACB\u5373\u66F4\u65B0",updating:"\u66F4\u65B0\u4E2D\u2026",updateFailed:"\u66F4\u65B0\u5931\u8D25\uFF1A{{message}}",networkErrorHint:"\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002",retry:"\u91CD\u8BD5",applyFullUpdate:"\u5168\u91CF\u66F4\u65B0",fullUpdateSuccess:"\u5168\u91CF\u66F4\u65B0\u5B8C\u6210\u3002",confirmFullUpdateTitle:"\u786E\u8BA4\u66F4\u65B0",confirmFullUpdateDesc:"\u5C06\u4E0B\u8F7D\u5E76\u66F4\u65B0\u5168\u90E8 PD \u4EE3\u7801\u5305\uFF08\u63D2\u4EF6\u3001\u63A7\u5236\u53F0\u3001\u6838\u5FC3\u3001CLI\uFF09\u3002\u901A\u5E38\u53EA\u9700\u51E0\u79D2\u949F\u3002\u4F60\u81EA\u5B9A\u4E49\u7684\u6587\u4EF6\uFF08AGENTS.md \u7B49\uFF09\u4E0D\u53D7\u5F71\u54CD\u3002\u66F4\u65B0\u5B8C\u6210\u540E\u9700\u8981\u91CD\u542F\u63A7\u5236\u53F0\u3002",fullUpdateRestartPrompt:"\u66F4\u65B0\u5DF2\u5B8C\u6210\u3002\u8BF7\u91CD\u542F\u63A7\u5236\u53F0\u4EE5\u52A0\u8F7D\u65B0\u7248\u672C\uFF1A\u6309 Ctrl+C \u505C\u6B62\uFF0C\u7136\u540E\u91CD\u65B0\u8FD0\u884C pd console\u3002"},intent:{eyebrow:"\u62E5\u6709\u8005\u610F\u56FE",title:"\u62E5\u6709\u8005\u610F\u56FE\u6587\u6863",subtitle:"\u5355\u9875\u951A\u70B9\uFF0C\u8BB0\u5F55\u62E5\u6709\u8005\u7684\u76EE\u6807\u3001\u4E0D\u53EF\u8FDD\u80CC\u7684\u8FB9\u754C\u3001\u4EE5\u53CA\u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5E76\u5347\u7EA7\u3002\u4EC5\u5F53 intent_engineering \u6807\u5FD7\u5F00\u542F\u65F6\uFF0CPD \u624D\u4F1A\u8BFB\u53D6\u6B64\u6587\u6863\u3002",flagStatus:{enabled:"\u6807\u5FD7\u5DF2\u5F00\u542F",disabled:"\u6807\u5FD7\u5DF2\u5173\u95ED",ariaLabel:"intent_engineering \u529F\u80FD\u6807\u5FD7\u72B6\u6001",enable:"\u542F\u7528\u610F\u56FE\u5DE5\u7A0B",enabling:"\u542F\u7528\u4E2D\u2026",enableFailed:"\u542F\u7528\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u624B\u52A8\u4FEE\u6539 .pd/config.yaml"},editEntry:{heading:"\u7F16\u8F91 INTENT.md",title:"\u62E5\u6709\u8005\u81EA\u6709\u6587\u6863",description:"PD \u4E0D\u4F1A\u4FEE\u6539\u6B64\u6587\u4EF6\u3002\u8BF7\u5728\u81EA\u5DF1\u7684\u7F16\u8F91\u5668\u4E2D\u7F16\u8F91\uFF0C\u4EE5\u58F0\u660E\u6216\u4FEE\u8BA2\u4F60\u7684\u610F\u56FE\u3002",copy:"\u590D\u5236\u8DEF\u5F84",copyAriaLabel:"\u590D\u5236 INTENT.md \u6587\u4EF6\u8DEF\u5F84\u5230\u526A\u8D34\u677F"},flagDisabled:{title:"\u610F\u56FE\u5DE5\u7A0B\u5DF2\u5173\u95ED",description:"intent_engineering \u529F\u80FD\u6807\u5FD7\u672A\u5F00\u542F\u3002PD \u5F53\u524D\u4E0D\u4F1A\u8BFB\u53D6 INTENT.md\uFF0C\u4E0D\u4F1A\u5C06\u610F\u56FE\u4E0A\u4E0B\u6587\u6CE8\u5165\u63D0\u793A\u8BCD\uFF0C\u4E5F\u4E0D\u4F1A\u5728\u8BCA\u65AD\u4E2D\u5448\u73B0\u610F\u56FE\u5F20\u529B\u3002\u8FD9\u662F\u9ED8\u8BA4\u7684\u5B89\u9759\u72B6\u6001\u3002"},notFound:{title:"\u672A\u627E\u5230 INTENT.md",description:"PD \u5728 .principles/ \u76EE\u5F55\u4E2D\u672A\u627E\u5230 INTENT.md \u6587\u4EF6\u3002\u7F3A\u5C11\u6B64\u951A\u70B9\u65F6\uFF0C\u57FA\u4E8E\u610F\u56FE\u7684\u8BCA\u65AD\u65E0\u6CD5\u8FD0\u884C\u3002",nextAction:"\u8FD0\u884C\uFF1Apd intent init --confirm --workspace <path>",createButton:"\u521B\u5EFA INTENT.md",creating:"\u521B\u5EFA\u4E2D\u2026",createFailed:"\u521B\u5EFA\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",createSuccess:"INTENT.md \u5DF2\u521B\u5EFA\uFF0C\u4F60\u53EF\u4EE5\u5F00\u59CB\u586B\u5199\u610F\u56FE"},onboarding:{title:"\u6B22\u8FCE\u4F7F\u7528\u610F\u56FE\u5DE5\u7A0B",subtitle:"\u5728\u5F00\u59CB\u4E4B\u524D\uFF0C\u8BA9\u6211\u4EEC\u5148\u4E86\u89E3\u4E00\u4E0B\u610F\u56FE\u5DE5\u7A0B",whatIsIt:{title:"\u4EC0\u4E48\u662F\u610F\u56FE\u5DE5\u7A0B\uFF1F",description:"INTENT.md \u662F\u4F60\u7684\u957F\u671F\u610F\u56FE\u951A\u70B9 \u2014 \u8BB0\u5F55\u4F60\u7684\u76EE\u6807\u3001\u4E0D\u53EF\u8FDD\u80CC\u7684\u8FB9\u754C\u3001\u4EE5\u53CA\u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5E76\u5347\u7EA7\u3002\u5B83\u5E2E\u52A9 PD \u5728\u5173\u952E\u51B3\u7B56\u70B9\u5BF9\u9F50\u4F60\u7684\u771F\u5B9E\u610F\u56FE\u3002"},whyYouFill:{title:"\u4E3A\u4EC0\u4E48\u9700\u8981\u4F60\u586B\u5199\uFF1F",description:"\u610F\u56FE\u662F\u62E5\u6709\u8005\u81EA\u6709\u7684\u3002PD \u4E0D\u4F1A\u81EA\u52A8\u751F\u6210\u610F\u56FE\uFF0C\u56E0\u4E3A\u53EA\u6709\u4F60\u77E5\u9053\u9879\u76EE\u7684\u771F\u5B9E\u76EE\u6807\u548C\u8FB9\u754C\u3002\u8FD9\u662F\u4F60\u7684\u51B3\u7B56\u6743\uFF0CPD \u53EA\u8D1F\u8D23\u5E2E\u52A9\u4F60\u6267\u884C\u548C\u5BF9\u9F50\u3002"},sectionGuide:{title:"5 \u4E2A\u7AE0\u8282\u586B\u5199\u5F15\u5BFC",description:"INTENT.md \u5305\u542B 5 \u4E2A\u7AE0\u8282\uFF0C\u6BCF\u4E2A\u7AE0\u8282\u6709\u660E\u786E\u7684\u7528\u9014\uFF1A",sections:{why:"\u4E3A\u4EC0\u4E48 \u2014 \u8FD9\u4E2A\u9879\u76EE\u7684\u6839\u672C\u52A8\u673A",desiredOutcome:"\u671F\u671B\u7ED3\u679C \u2014 \u4F60\u5E0C\u671B\u8FBE\u6210\u7684\u5177\u4F53\u7ED3\u679C",nonNegotiables:"\u4E0D\u53EF\u59A5\u534F\u9879 \u2014 \u7EDD\u5BF9\u4E0D\u80FD\u8FDD\u53CD\u7684\u8FB9\u754C",stopEscalation:"\u505C\u6B62 / \u5347\u7EA7 \u2014 \u4F55\u65F6\u5E94\u5F53\u505C\u6B62\u5F53\u524D\u64CD\u4F5C\u5E76\u5347\u7EA7\u7ED9\u4F60",currentStrategicFocus:"\u5F53\u524D\u6218\u7565\u7126\u70B9 \u2014 \u9636\u6BB5\u6027\u91CD\u70B9"}},skipOption:"\u8DF3\u8FC7\u5F15\u5BFC\uFF0C\u521B\u5EFA\u7A7A\u6A21\u677F\u7A0D\u540E\u586B\u5199",startFilling:"\u5F00\u59CB\u586B\u5199",skip:"\u8DF3\u8FC7",close:"\u5173\u95ED",dontShowAgain:"\u4E0D\u518D\u663E\u793A"},editor:{title:"\u7F16\u8F91 INTENT.md",description:"\u76F4\u63A5\u5728\u6D4F\u89C8\u5668\u4E2D\u7F16\u8F91\u4F60\u7684\u610F\u56FE\u6587\u6863\u3002\u4FDD\u5B58\u540E\u4F1A\u7ACB\u5373\u751F\u6548\u3002",placeholder:"\u5728\u6B64\u8F93\u5165 INTENT.md \u5185\u5BB9\uFF08Markdown \u683C\u5F0F\uFF09\u2026",save:"\u4FDD\u5B58",saving:"\u4FDD\u5B58\u4E2D\u2026",cancel:"\u53D6\u6D88",edit:"\u7F16\u8F91",saveSuccess:"INTENT.md \u5DF2\u4FDD\u5B58",saveFailed:"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",emptyContent:"\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",oversized:"\u5185\u5BB9\u8D85\u8FC7 32KB \u4E0A\u9650\uFF0C\u8BF7\u7CBE\u7B80\u540E\u91CD\u8BD5",confirmDiscard:"\u4F60\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u653E\u5F03\u5417\uFF1F",yes:"\u662F\uFF0C\u653E\u5F03\u4FEE\u6539",no:"\u7EE7\u7EED\u7F16\u8F91"},oversized:{title:"INTENT.md \u8D85\u8FC7 32KB",description:"\u6587\u4EF6\u8D85\u8FC7 32KB \u4E0A\u9650\u3002PD \u62D2\u7EDD\u8BFB\u53D6\u8D85\u5927\u6587\u4EF6\uFF0C\u4EE5\u4FDD\u8BC1\u610F\u56FE\u89E3\u6790\u7684\u786E\u5B9A\u6027\u4E0E\u6709\u754C\u6027\u3002",nextAction:"\u8BF7\u5C06 INTENT.md \u7CBE\u7B80\u81F3 32KB \u4EE5\u4E0B\uFF0C\u5C06\u957F\u7BC7\u7B56\u7565\u79FB\u81F3\u72EC\u7ACB\u6587\u6863\u3002"},sections:{why:"\u4E3A\u4EC0\u4E48",desiredOutcome:"\u671F\u671B\u7ED3\u679C",nonNegotiables:"\u4E0D\u53EF\u59A5\u534F\u9879",stopEscalation:"\u505C\u6B62 / \u5347\u7EA7",currentStrategicFocus:"\u5F53\u524D\u6218\u7565\u7126\u70B9"},warnings:{title:"\u5065\u5EB7\u544A\u8B66",empty:"\u65E0\u544A\u8B66\u3002INTENT.md \u683C\u5F0F\u826F\u597D\u3002",missing_section:"\u7F3A\u5931\u7AE0\u8282",empty_section:"\u7AE0\u8282\u4E3A\u7A7A",too_vague:"\u7AE0\u8282\u8FC7\u4E8E\u7B80\u7565\uFF08\u5C11\u4E8E 10 \u4E2A\u5B57\u7B26\uFF09",oversized:"\u6587\u6863\u8D85\u8FC7 32KB \u4E0A\u9650",parse_failed:"\u7AE0\u8282\u89E3\u6790\u5931\u8D25"},meta:{title:"\u6587\u6863\u5143\u4FE1\u606F",lastEditedAt:"\u4E0A\u6B21\u7F16\u8F91",contentHash:"\u5185\u5BB9\u54C8\u5E0C",path:"\u8DEF\u5F84",templateTitle:"INTENT.md \u6A21\u677F",templateDescription:"\u5C06\u5176\u590D\u5236\u5230 .principles/INTENT.md\uFF0C\u66FF\u6362\u5360\u4F4D\u7B26\u4E3A\u4F60\u7684\u610F\u56FE\u3002"},loadError:"\u52A0\u8F7D\u610F\u56FE\u6587\u6863\u5931\u8D25",validationError:"\u6570\u636E\u683C\u5F0F\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5",decisions:{sectionTitle:"\u62E5\u6709\u8005\u51B3\u7B56",sectionSubtitle:"\u57FA\u4E8E IntentDecisionRecord \u7684\u8F7B\u91CF\u5BA1\u8BA1\u6458\u8981\uFF0C\u975E\u4EEA\u8868\u76D8\u3002",countConfirmDrift:"\u786E\u8BA4\u6F02\u79FB",countReviseIntent:"\u4FEE\u8BA2\u610F\u56FE",countObserve:"\u89C2\u5BDF",countDismiss:"\u9A73\u56DE",countPromoteToPrinciple:"\u6C89\u6DC0\u4E3A\u539F\u5219",countPromoteToRulehost:"\u8F6C\u4E3A RuleHost",lastDecisionAtLabel:"\u6700\u8FD1\u51B3\u7B56",noDecisions:"\u6682\u65E0\u51B3\u7B56\u8BB0\u5F55",loadError:"\u52A0\u8F7D\u51B3\u7B56\u6458\u8981\u5931\u8D25"},langSelector:{ariaLabel:"\u9009\u62E9 INTENT.md \u8BED\u8A00",disabledWhileEditing:"\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u7F16\u8F91\uFF0C\u518D\u5207\u6362\u8BED\u8A00"},versionHistory:{title:"\u7248\u672C\u5386\u53F2",reasonInit:"\u521D\u59CB\u5316",reasonSave:"\u4FDD\u5B58"},wizard:{progressLabel:"\u7B2C {{current}}/5 \u6B65",next:"\u4E0B\u4E00\u6B65",prev:"\u4E0A\u4E00\u6B65",finish:"\u5B8C\u6210",review:"\u67E5\u770B\u6458\u8981",complete:"\u5B8C\u6210\u4FDD\u5B58",cancel:"\u53D6\u6D88",emptyWarning:"\u6B64\u8282\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u8BF7\u586B\u5199\u540E\u518D\u7EE7\u7EED",stepLabels:{why:"1. \u4E3A\u4EC0\u4E48\uFF08Why\uFF09",desiredOutcome:"2. \u671F\u671B\u7ED3\u679C\uFF08Desired Outcome\uFF09",nonNegotiables:"3. \u4E0D\u53EF\u59A5\u534F\u9879\uFF08Non-negotiables\uFF09",stopEscalation:"4. \u6B62\u635F/\u5347\u7EA7\uFF08Stop / Escalation\uFF09",currentStrategicFocus:"5. \u5F53\u524D\u6218\u7565\u7126\u70B9\uFF08Current Strategic Focus\uFF09"},guidance:{why:"\u8BF4\u660E\u8FD9\u4E2A\u9879\u76EE\u4E3A\u4EC0\u4E48\u91CD\u8981\u3002\u62E5\u6709\u8005\u5173\u5FC3\u4EC0\u4E48\uFF1F\u4E0D\u89E3\u51B3\u4F1A\u600E\u6837\uFF1F",desiredOutcome:"\u63CF\u8FF0\u53EF\u89C2\u5BDF\u7684\u6539\u53D8\u3002\u505A\u5B8C\u540E\uFF0C\u4EC0\u4E48\u4F1A\u53D8\u597D\uFF1F",nonNegotiables:"\u5217\u51FA\u4E0D\u53EF\u8FDD\u53CD\u7684\u786C\u7EA6\u675F\uFF08\u5408\u89C4/\u5B89\u5168/\u8FB9\u754C\uFF09\u3002",stopEscalation:"\u4EC0\u4E48\u60C5\u51B5\u4E0B\u5E94\u8BE5\u505C\u4E0B\u6765\u5347\u7EA7\u7ED9\u62E5\u6709\u8005\uFF0C\u800C\u4E0D\u662F\u7EE7\u7EED\u63A8\u8FDB\uFF1F",currentStrategicFocus:"\u5F53\u524D\u9636\u6BB5\u6700\u4F18\u5148\u7684\u4E8B\u662F\u4EC0\u4E48\uFF1F\uFF08\u4F1A\u968F\u9636\u6BB5\u66F4\u65B0\uFF09"},discardConfirmTitle:"\u653E\u5F03\u586B\u5199\uFF1F",discardConfirmBody:"\u4F60\u5DF2\u586B\u5199\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u65E0\u6CD5\u6062\u590D\u3002",discardConfirmCancel:"\u7EE7\u7EED\u586B\u5199",discardConfirmConfirm:"\u653E\u5F03"},versionDiff:{changed:"\u5DF2\u53D8\u66F4",unchanged:"\u672A\u53D8\u66F4",oldPreview:"\u65E7\u7248\u672C",newPreview:"\u65B0\u7248\u672C",expandHint:"\u70B9\u51FB\u67E5\u770B section \u7EA7\u5DEE\u5F02",collapseHint:"\u70B9\u51FB\u6298\u53E0\u5DEE\u5F02"}},examiner:{loading:"\u6B63\u5728\u52A0\u8F7D Examiner\u2026",title:"Examiner \u9A8C\u8BC1",subtitle:"\u5BF9\u76EE\u6807\u539F\u5219\u8FDB\u884C\u53D7\u63A7 A/B \u884C\u4E3A\u6548\u679C\u9A8C\u8BC1\uFF08\u79BB\u7EBF\u4F18\u5148\uFF09\u3002",scope:{title:"\u6267\u884C\u8303\u56F4\u4E0E\u95E8\u7981"},mode:{full:"\u5B8C\u6574\u539F\u5219\u5E93\u589E\u91CF A/B\uFF08\u9ED8\u8BA4\uFF09",isolated:"\u72EC\u7ACB\u539F\u5219 A/B\uFF08\u8BCA\u65AD\u6A21\u5F0F\uFF09"},create:{title:"\u521B\u5EFA\u79BB\u7EBF Study",target:"\u76EE\u6807\u539F\u5219\uFF08\u6BCF\u6B21\u5B9E\u9A8C\u4E00\u6761\uFF09",mode:"\u5B9E\u9A8C\u6A21\u5F0F",repetitions:"\u6BCF\u9898\u91CD\u590D\u6B21\u6570",submit:"\u521B\u5EFA Study",note:"\u4F7F\u7528\u5408\u6210\u6821\u51C6\u9898\uFF08SYNTHETIC_OFFLINE Gold\uFF09\u3002Study \u8EAB\u4EFD\u7531\u670D\u52A1\u7AEF\u94F8\u9020\uFF0C\u521B\u5EFA\u540E\u4E0D\u53EF\u8986\u76D6\u3002"},studies:{title:"\u7814\u7A76\u5217\u8868",empty:"\u8FD8\u6CA1\u6709 Study\u3002\u4ECE\u4E0A\u65B9\u521B\u5EFA\u4E00\u4E2A\u79BB\u7EBF Study\u3002"},study:{title:"Study {{studyId}}",mode:"\u6A21\u5F0F",intervention:"\u5E72\u9884\u7C7B\u578B",target:"\u76EE\u6807\u539F\u5219",plannedPairs:"\u8BA1\u5212\u914D\u5BF9",run:"\u6267\u884C",finished:"\u5DF2\u5B8C\u6210",running:"\u8FDB\u884C\u4E2D",notRun:"\u672A\u6267\u884C",report:"\u62A5\u544A",preflight:"\u8FD0\u884C\u9884\u68C0",runOffline:"\u79BB\u7EBF\u6267\u884C",back:"\u539F\u5219\u8BC4\u4F30",statusTitle:"Study \u72B6\u6001",readOnly:"\u53EA\u8BFB Study",openReport:"\u6253\u5F00\u62A5\u544A",runDry:"\u5BBF\u4E3B\u6F14\u7EC3",requestF2:"\u8BF7\u6C42 F2 \u771F\u5B9E\u5BBF\u4E3B\u8FD0\u884C",modesNote:"\u79BB\u7EBF Stub \u540C\u6B65\u6267\u884C\u5E76\u9A8C\u8BC1\u5951\u7EA6\u7BA1\u7EBF\uFF1B\u5BBF\u4E3B\u6F14\u7EC3\u5F02\u6B65\u6267\u884C\u4E14\u96F6\u6A21\u578B\u8C03\u7528\uFF1BF2 \u771F\u5B9E\u5BBF\u4E3B\u8FD0\u884C\u9700\u8981\u672C Study \u5185\u5B58\u5728\u5DF2\u6279\u51C6\uFF08APPROVED\uFF09\u7684 Stage R \u6388\u6743\u3002",accepted:{dryRun:"\u5BBF\u4E3B\u6F14\u7EC3\u5DF2\u53D7\u7406\u2014\u2014\u6B63\u5728\u8F6E\u8BE2\u68C0\u67E5\u6E05\u5355\u3002",f2:"F2 \u8BF7\u6C42\u5DF2\u53D7\u7406\u2014\u2014\u6B63\u5728\u8F6E\u8BE2\u7ED3\u7B97\u7ED3\u679C\u3002"},snapshot:{title:"\u51BB\u7ED3\u751F\u4EA7\u5FEB\u7167",frozenAt:"\u51BB\u7ED3\u65F6\u95F4",route:"\u751F\u4EA7\u8DEF\u7531",budget:"\u751F\u4EA7\u9884\u7B97",divergence:"\u8D26\u672C active \u4F46\u8FD0\u884C\u65F6\u672A\u6FC0\u6D3B",activationDegraded:"\u51BB\u7ED3\u65F6\u6FC0\u6D3B\u6570\u636E\u4E0D\u53EF\u7528\uFF08\u771F\u76F8\u672A\u77E5\uFF0C\u7EDD\u975E\u96F6\uFF09",matchesProduction:"\u4E0E\u751F\u4EA7\u914D\u7F6E\u4E00\u81F4"},runs:{title:"\u63A7\u5236\u53F0\u8FD0\u884C\uFF08\u5F02\u6B65\u5951\u7EA6\uFF09",empty:"\u5C1A\u65E0\u63A7\u5236\u53F0\u8FD0\u884C\u2014\u2014\u4F7F\u7528\u5BBF\u4E3B\u6F14\u7EC3\u6216 F2 \u8BF7\u6C42\u3002",ledgerProblem:"\u8FD0\u884C\u8D26\u672C\u65E0\u6CD5\u8BFB\u53D6\u2014\u2014\u4E0B\u65B9\u5386\u53F2\u4E0D\u53EF\u4FE1"}},preflight:{status:"\u9884\u68C0\u72B6\u6001"},report:{title:"Report V2",target:"\u76EE\u6807",endpoint:"\u4E3B\u8981\u7EC8\u70B9",fidelity:"Treatment Fidelity\uFF08\u6CE8\u5165\u5FE0\u5B9E\u5EA6\uFF09",contamination:"Control \u6C61\u67D3",evictions:"\u5BB9\u91CF\u6324\u51FA",ittNote:"\u8BA1\u5212\u9002\u7528\u914D\u5BF9 {{planned}} \xB7 \u5B8C\u5168\u786E\u5B9A {{determined}} \xB7 \u672A\u77E5\u4FA7 {{unknown}} \xB7 \u4E0D\u9002\u7528 {{na}}\uFF08\u4E0D\u8FDB\u5165\u5206\u6BCD\uFF09",noExaminerBlock:"\u8BE5\u62A5\u544A\u65E9\u4E8E v0.9 \u5951\u7EA6\uFF08\u65E0 examiner \u533A\u5757\uFF09\u3002",offlineNote:"\u79BB\u7EBF Stub \u7ED3\u679C\u4EC5\u9A8C\u8BC1\u5951\u7EA6\u7BA1\u7EBF\uFF0C\u7EDD\u4E0D\u4EE3\u8868\u771F\u5B9E\u5BBF\u4E3B\u884C\u4E3A\u3002\u771F\u5B9E\u5BBF\u4E3B\u5B9E\u9A8C\u9700\u8981\u62E5\u6709\u8005\u5355\u72EC\u6388\u6743\u3002",back:"\u6267\u884C\u4E0E\u8BC1\u636E",missing:"\u5C1A\u65E0 Report V2\u2014\u2014\u8BF7\u5148\u5728 Study \u9875\u8FD0\u884C\u79BB\u7EBF\u6267\u884C\u3002",replay:"\u91CD\u653E\u6821\u9A8C",limitations:"\u9650\u5236\u8BF4\u660E",handoff:{title:"\u62E5\u6709\u8005\u51B3\u7B56\u4EA4\u63A5",note:"\u62A5\u544A\u4E3A\u51B3\u7B56\u63D0\u4F9B\u4F9D\u636E\uFF1B\u62E5\u6709\u8005\u5728\u65E2\u6709\u539F\u5219\u6CBB\u7406\u5DE5\u4F5C\u6D41\u4E2D\u4F5C\u51FA\u51B3\u5B9A\u3002Examiner \u7EDD\u4E0D\u81EA\u884C\u53D8\u66F4\u751F\u547D\u5468\u671F\u3001RuleCode \u6216\u6FC0\u6D3B\u72B6\u6001\u3002",openGovernance:"\u6253\u5F00\u539F\u5219\u6CBB\u7406",refresh:"\u5237\u65B0\u62A5\u544A"},production:{title:"\u751F\u4EA7\u89C2\u5BDF\uFF08\u72EC\u7ACB\u901A\u9053\uFF09",note:"\u540C\u4E00\u539F\u5219\u7684\u771F\u5B9E\u8FD0\u884C\u8BC1\u636E\u3002\u5B83\u4E0E\u4E0A\u65B9\u53D7\u63A7 A/B \u7ED3\u679C\u4E92\u8865\uFF0C\u4F46\u7EDD\u4E0D\u5408\u5E76\u8FDB\u5176\u6570\u5B57\u3002",missing:"\u6B64\u5904\u65E0\u6CD5\u83B7\u53D6\u76EE\u6807\u539F\u5219\u7684\u751F\u4EA7\u8BC1\u636E\u3002"}},created:"Study {{studyId}} \u5DF2\u521B\u5EFA\u3002",runDone:"\u79BB\u7EBF\u6267\u884C\u5B8C\u6210\uFF1A{{count}} \u4E2A\u5355\u5143\u6210\u529F\u3002",reportGenerated:"\u62A5\u544A\u5DF2\u751F\u6210\uFF08{{status}}\uFF09\u3002",evaluation:{title:"\u539F\u5219\u8BC4\u4F30",configureCta:"\u914D\u7F6E Study",noActive:"\u6B64\u5DE5\u4F5C\u533A\u6CA1\u6709 active \u539F\u5219\u2014\u2014\u8BF7\u5148\u6FC0\u6D3B\u4E00\u6761\u539F\u5219\u518D\u8BC4\u4F30\u3002",loadingEvidence:"\u6B63\u5728\u52A0\u8F7D\u751F\u4EA7\u8BC1\u636E\u2026",refresh:"\u5237\u65B0\u8BC1\u636E",openGovernance:"\u6253\u5F00\u539F\u5219\u6CBB\u7406",selectPrinciple:"\u9009\u62E9\u4E00\u6761\u539F\u5219\u67E5\u770B\u5176\u751F\u4EA7\u8BC1\u636E\u3002",openStudy:"\u6253\u5F00"},evidence:{runtimeDeactivated:"\u8FD0\u884C\u65F6\u5DF2\u64A4\u9500",ruleCount:"RuleCode\uFF08\u8D26\u672C\uFF09",painRefs:"Pain \u6EAF\u6E90",evaluability:"\u53EF\u8BC4\u4F30\u6027",painPrevented:"\u5DF2\u9884\u9632 Pain",activation:{title:"\u8FD0\u884C\u65F6\u6FC0\u6D3B",promptRows:"\u63D0\u793A\u8BCD\u6FC0\u6D3B",ruleCodeRows:"RuleCode \u6FC0\u6D3B"},injection:{title:"\u63D0\u793A\u8BCD\u6CE8\u5165\uFF08\u751F\u4EA7\u6295\u5F71\uFF09",noRows:"\u8BE5\u539F\u5219\u6682\u65E0\u6CE8\u5165\u884C\uFF08\u4E0D\u53EF\u7528\u7684\u6570\u636E\u901A\u9053\u7EDD\u4E0D\u4F1A\u663E\u793A\u4E3A\u96F6\u4E8B\u4EF6\uFF09\u3002",budget:"\u9884\u7B97",projectionNote:"\u6295\u5F71\u53EA\u9884\u6D4B\u751F\u4EA7\u6CE8\u5165\u8DEF\u5F84\u201C\u4F1A\u201D\u6295\u9012\u4EC0\u4E48\u2014\u2014\u5B83\u4E0D\u662F\u6A21\u578B\u5DF2\u6D88\u8D39\u5185\u5BB9\u7684\u8BC1\u660E\u3002"},receipts:{title:"\u56DE\u6267",effects:"\u6548\u679C",presence:"\u5B58\u5728"},audit:{title:"\u5E72\u9884\u8BC1\u636E\u5BA1\u8BA1",deliveries:"\u6295\u9012",applications:"\u5E94\u7528",episodes:"\u884C\u4E3A\u4E8B\u4EF6",effects:"\u6548\u679C",outcomes:"\u7ED3\u679C",unresolved:"\u672A\u89E3\u6790\u5F15\u7528",loadedSuffix:"\uFF08\u5DF2\u52A0\u8F7D\uFF0C\u4ECD\u6709\u66F4\u591A\uFF09",hasMoreNote:"\u672C\u8BFB\u53D6\u7A97\u53E3\u4E4B\u5916\u4ECD\u6709\u8BB0\u5F55\u2014\u2014\u4E0A\u65B9\u6570\u5B57\u662F\u5DF2\u52A0\u8F7D\u7684\u5206\u9875\uFF0C\u4E0D\u662F\u8BC1\u636E\u603B\u91CF\u3002",ladder:"\u786E\u8BA4\u9636\u68AF\uFF08\u7EDD\u4E0D\u81EA\u52A8\u5347\u7EA7\uFF09",asOf:"\u5BA1\u8BA1\u622A\u81F3"},asOf:"\u8BFB\u53D6\u65F6\u95F4",outcomes:{title:"\u62E5\u6709\u8005\u7ED3\u679C\u53CD\u9988\uFF08\u6700\u8FD1\uFF09"}},configure:{back:"\u539F\u5219\u8BC4\u4F30",title:"Study \u914D\u7F6E",subtitle:"\u8FD9\u6B21\u8BC4\u4F30\u7A76\u7ADF\u6BD4\u8F83\u4EC0\u4E48\uFF1F\u5728\u54EA\u4E9B\u51BB\u7ED3\u8F93\u5165\u4E4B\u4E0B\uFF1F",fullNote:"\u5BF9\u7167\u7EC4\uFF1A\u4E0D\u542B\u76EE\u6807\u539F\u5219\u7684\u5B8C\u6574\u5BBF\u4E3B\u751F\u6548\u5E93\u3002\u5B9E\u9A8C\u7EC4\uFF1A\u540C\u4E00\u5E93 + \u76EE\u6807\u539F\u5219\u3002\u76EE\u6807\u539F\u5219\u662F\u552F\u4E00\u8BA1\u5212\u5E72\u9884\u53D8\u91CF\u3002",isolatedNote:"\u8BCA\u65AD\u6A21\u5F0F\uFF1A\u5BF9\u7167\u7EC4\u4E3A\u7A7A\uFF08\u6240\u6709 PD \u539F\u5219\u5173\u95ED\uFF09\uFF0C\u5B9E\u9A8C\u7EC4\u4EC5\u542B\u76EE\u6807\u539F\u5219\u3002",suite:{title:"Challenge \u5957\u4EF6"},readiness:{title:"\u5BBF\u4E3B\u6267\u884C\u5C31\u7EEA"},difference:{title:"\u5B9E\u9A8C\u4E0E\u751F\u4EA7\u914D\u7F6E\u5DEE\u5F02",note:"Study \u51BB\u7ED3\u81EA\u5DF1\u7684\u9884\u7B97\u5E76\u786E\u5B9A\u6027\u6E32\u67D3\u4E24\u7EC4\uFF1B\u51BB\u7ED3\u7684\u751F\u4EA7\u5FEB\u7167\u8BB0\u5F55\u6BCF\u4E00\u5904\u68C0\u6D4B\u5230\u7684\u5DEE\u5F02\uFF08\u5982 EXPERIMENT_CONFIGURATION_DIFFERS_FROM_PRODUCTION \u6807\u8BB0\uFF09\u3002"},summary:"\u76EE\u6807 {{target}} \xB7 \u5957\u4EF6 {{suite}} \xB7 \u8BA1\u5212 {{pairs}} \u5BF9"},errors:{unavailable:"Examiner \u7814\u7A76\u5F15\u64CE\u5728\u6B64\u5B89\u88C5\u4E2D\u4E0D\u53EF\u7528\uFF08\u5B89\u88C5\u5305\u672A\u5305\u542B\u7814\u7A76\u6A21\u5757\uFF09\u3002",create:"\u521B\u5EFA Study \u5931\u8D25\u3002",preflight:"\u9884\u68C0\u5931\u8D25\u3002",run:"\u79BB\u7EBF\u6267\u884C\u5931\u8D25\u3002",report:"\u62A5\u544A\u751F\u6210\u5931\u8D25\u3002",evidence:"\u52A0\u8F7D\u751F\u4EA7\u8BC1\u636E\u5931\u8D25\u3002",status:"\u52A0\u8F7D Study \u72B6\u6001\u5931\u8D25\u3002"}},debt:{eyebrow:"\u539F\u5219\u503A\u52A1",title:"\u539F\u5219\u503A\u52A1\u7BA1\u7406",subtitle:"\u5BA1\u67E5\u90A3\u4E9B\u672A\u6FC0\u6D3B\u3001\u957F\u671F\u505C\u6EDE\u6216\u53EF\u80FD\u6210\u4E3A\u6280\u672F/\u884C\u4E3A\u8D1F\u503A\u7684\u539F\u5219\u3002",emptyTitle:"\u6682\u65E0\u539F\u5219\u503A\u52A1",emptyDescription:"\u592A\u68D2\u4E86\uFF01\u4F60\u7684\u6240\u6709\u6D3B\u8DC3\u539F\u5219\u5747\u8FD0\u884C\u6B63\u5E38\uFF0C\u6CA1\u6709\u53D1\u73B0\u957F\u671F\u672A\u6FC0\u6D3B\u6216\u88AB\u667E\u5728\u5BA1\u6279\u961F\u5217\u91CC\u7684\u60C5\u51B5\u3002",reasonNeverActivated:"\u8BE5\u539F\u5219\u5DF2\u88AB\u6279\u51C6\uFF0C\u4F46\u4ECE\u672A\u771F\u6B63\u90E8\u7F72\u5230\u4EFB\u4F55\u8FD0\u884C\u901A\u9053\uFF08\u5982\u63D0\u793A\u8BCD\u3001RuleHost\uFF09\u3002",reasonStagnant:"\u8BE5\u539F\u5219\u7684\u5BA1\u6279\u8BF7\u6C42\u5DF2\u5728\u961F\u5217\u4E2D\u6EDE\u7559\u8D85\u8FC7 7 \u5929\uFF0C\u53EF\u80FD\u5DF2\u88AB\u9057\u5FD8\u3002",suggestedAction:"\u5EFA\u8BAE\u64CD\u4F5C",actionArchive:"\u5F52\u6863",actionDeactivate:"\u505C\u7528\u901A\u9053",actionKeep:"\u4FDD\u7559\u89C2\u5BDF",confirmArchive:"\u5F52\u6863\u8BE5\u539F\u5219\u4F1A\u5C06\u5176\u79FB\u51FA\u5F53\u524D\u6D3B\u8DC3\u539F\u5219\u5E93\uFF0C\u786E\u8BA4\u5F52\u6863\u5417\uFF1F",confirmDeactivate:"\u505C\u7528\u8BE5\u901A\u9053\u5C06\u4F7F\u8BE5\u539F\u5219\u4E0D\u518D\u5728\u8FD0\u884C\u65F6\u5BF9\u667A\u80FD\u4F53\u8FDB\u884C\u62E6\u622A\uFF0C\u786E\u8BA4\u505C\u7528\u5417\uFF1F",deactivateSuccess:"\u901A\u9053\u505C\u7528\u6210\u529F\u3002",deactivateFailed:"\u505C\u7528\u901A\u9053\u5931\u8D25\u3002",archiveSuccess:"\u539F\u5219\u5F52\u6863\u6210\u529F\u3002",archiveFailed:"\u539F\u5219\u5F52\u6863\u5931\u8D25\u3002",undoAction:"\u64A4\u9500",undoSuccess:"\u64CD\u4F5C\u5DF2\u64A4\u9500\u3002",undoFailed:"\u64A4\u9500\u64CD\u4F5C\u5931\u8D25\u3002",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u539F\u5219\u503A\u52A1\u6570\u636E\uFF0C\u8BF7\u5C1D\u8BD5\u5237\u65B0\u9875\u9762\u3002",daysSinceAgo:"{{count}} \u5929\u524D",demoteTooltip:"\u964D\u6743\u7AEF\u70B9\u5F00\u53D1\u4E2D",principleAriaLabel:"\u539F\u5219\u503A\u52A1 {{id}}",listAriaLabel:"\u539F\u5219\u503A\u52A1\u5217\u8868"},welcome:{title:"\u6B22\u8FCE\u4F7F\u7528 Principles Disciple",subtitle:"\u628A\u4F60\u5BF9\u667A\u80FD\u4F53\u7684\u53CD\u590D\u7EA0\u6B63\uFF0C\u6C89\u6DC0\u4E3A\u53EF\u5BA1\u67E5\u3001\u53EF\u64A4\u56DE\u7684\u884C\u4E3A\u539F\u5219\u3002",stateSaveError:"\u65E0\u6CD5\u4FDD\u5B58\u5F15\u5BFC\u8FDB\u5EA6\uFF0C\u8BF7\u68C0\u67E5\u6D4F\u89C8\u5668\u5B58\u50A8\u6743\u9650\u540E\u91CD\u8BD5\u3002",stepIndicator:"\u7B2C {{current}} \u6B65 / \u5171 {{total}} \u6B65",step1:{title:"PD \u662F\u4EC0\u4E48\uFF1F",description:"\u62E5\u6709\u8005\u6CBB\u7406\u4E0B\u7684\u667A\u80FD\u4F53\u884C\u4E3A\u5185\u5316\u7CFB\u7EDF\u3002PD \u628A\u884C\u4E3A\u8BC1\u636E\u6C89\u6DC0\u4E3A\u53EF\u5BA1\u67E5\u3001\u53EF\u56DE\u6EDA\u7684\u539F\u5219\uFF0C\u8BA9\u539F\u5219\u8FDB\u5165\u667A\u80FD\u4F53\u7684\u540E\u7EED\u884C\u4E3A\u3002",circuitLabel:"\u6838\u5FC3\u6CBB\u7406\u56DE\u8DEF",circuitNodes:{evidence:"\u884C\u4E3A\u8BC1\u636E",principle:"\u539F\u5219",ownerGate:"\u62E5\u6709\u8005\u5BA1\u67E5",behavior:"\u884C\u4E3A\u53D8\u66F4"},startButton:"\u5F00\u59CB",skipButton:"\u8DF3\u8FC7\u5F15\u5BFC"},step2:{title:"\u770B\u4E00\u6B21\u5B8C\u6574\u6CBB\u7406\u56DE\u8DEF\u6F14\u793A",description:"\u8FD9\u662F\u7528\u6A21\u62DF\u8BC1\u636E\u505A\u7684\u53D7\u63A7\u6F14\u793A\u3002\u771F\u5B9E\u4F7F\u7528\u65F6\uFF0C\u7531\u4F60\u7684\u667A\u80FD\u4F53\u901A\u8FC7 pd-pain-signal \u6280\u80FD\u4EA7\u751F\u8BC1\u636E\u3002",runDemoButton:"\u8FD0\u884C\u6F14\u793A",demoRunning:"\u6F14\u793A\u8FD0\u884C\u4E2D...",demoComplete:"\u6F14\u793A\u5B8C\u6210",demoFailed:"\u6F14\u793A\u5931\u8D25",demoSimulatedNote:"\u6B64\u8BC1\u636E\u4E3A\u6F14\u793A\u6A21\u62DF\u6570\u636E\u3002",nextButton:"\u4E0B\u4E00\u6B65",evidenceLabel:"\u8BC1\u636E\uFF08\u6A21\u62DF\uFF09",candidateLabel:"\u5019\u9009\u539F\u5219",ownerGateLabel:"\u62E5\u6709\u8005\u5BA1\u67E5\uFF1A\u6279\u51C6 / \u4FEE\u6539 / \u62D2\u7EDD",activationLabel:"\u6FC0\u6D3B\u7ED3\u679C",rollbackLabel:"\u53EF\u56DE\u6EDA\u8DEF\u5F84\u5DF2\u5C31\u7EEA",stages:{evidenceSeed:"\u8BC1\u636E\uFF08\u6A21\u62DF\uFF09",principleProposal:"\u5019\u9009\u539F\u5219",ownerReview:"\u62E5\u6709\u8005\u5BA1\u67E5",activation:"\u6FC0\u6D3B\u7ED3\u679C",followUpObservation:"\u540E\u7EED\u89C2\u5BDF",rollbackProof:"\u53EF\u56DE\u6EDA\u8DEF\u5F84\u5DF2\u5C31\u7EEA"}},step3:{title:"\u5E38\u7528\u659C\u6760\u547D\u4EE4",description:"\u5728\u4E0E\u667A\u80FD\u4F53\u5BF9\u8BDD\u65F6\u8F93\u5165\u8FD9\u4E9B\u547D\u4EE4\u6765\u63A7\u5236 PD\u3002",commandsIntro:"\u4EE5\u4E0B\u662F 7 \u4E2A\u6838\u5FC3\u547D\u4EE4\uFF0C\u8F93\u5165 /pd-help \u67E5\u770B\u5B8C\u6574\u5217\u8868\u3002",commandDescriptions:{pdInit:"\u521D\u59CB\u5316\u5DE5\u4F5C\u533A\uFF08\u751F\u6210 PRINCIPLES.md\u3001THINKING_OS.md \u7B49\uFF09",pdStatus:"\u67E5\u770B\u7CFB\u7EDF\u72B6\u6001\uFF08GFI\u3001Pain \u8BCD\u5178\uFF09",pdPain:"\u4ECE OpenClaw \u4F1A\u8BDD\u62A5\u544A pain",pdHelp:"\u663E\u793A\u6240\u6709\u547D\u4EE4\u548C\u4F7F\u7528\u6307\u5357",pdContext:"\u63A7\u5236\u4E0A\u4E0B\u6587\u6CE8\u5165",pdFocus:"\u7BA1\u7406 CURRENT_FOCUS.md"},nextButton:"\u4E0B\u4E00\u6B65",emptyListFallback:"\u547D\u4EE4\u5217\u8868\u52A0\u8F7D\u5931\u8D25\uFF0C\u8F93\u5165 /pd-help \u67E5\u770B\u5B8C\u6574\u547D\u4EE4\u5217\u8868\u3002"},step4:{title:"\u51C6\u5907\u597D\u8BB0\u5F55\u771F\u5B9E\u8BC1\u636E",description:"\u5F53\u4F60\u4E0B\u6B21\u4F7F\u7528\u667A\u80FD\u4F53\u65F6\uFF0C\u5982\u679C\u667A\u80FD\u4F53\u72AF\u9519\u6216\u4F60\u91CD\u590D\u7EA0\u6B63\u4E86\u5B83\uFF0C\u544A\u8BC9\u667A\u80FD\u4F53\uFF1A'\u7528 pd-pain-signal \u8BB0\u5F55\u4E00\u4E0B'\u3002",examplePrompt:"\u7ED9\u667A\u80FD\u4F53\u7684\u793A\u4F8B\u63D0\u793A\uFF1A",examplePromptText:"\u6211\u521A\u7EA0\u6B63\u4E86\u4F60\u5173\u4E8E X \u7684\u95EE\u9898\u3002\u7528 pd-pain-signal \u628A\u8FD9\u4E2A\u8BB0\u5F55\u4E3A pain signal\u3002",tryNowButton:"\u6211\u73B0\u5728\u5C31\u8BD5\u8BD5\uFF082 \u5C0F\u65F6\u7A97\u53E3\uFF09",goToFocusButton:"\u77E5\u9053\u4E86\uFF0C\u5148\u770B Focus",skipButton:"\u6682\u65F6\u8DF3\u8FC7",windowHint:"\u6211\u4EEC\u4F1A\u5728 2 \u5C0F\u65F6\u540E\u67E5\u770B\u3002\u4E0D\u5F3A\u5236\u2014\u2014\u4F60\u968F\u65F6\u53EF\u4EE5\u7A0D\u540E\u8BB0\u5F55\u8BC1\u636E\u3002",pollingActive:"\u6B63\u5728\u76D1\u542C\u8BC1\u636E... \u6211\u4EEC\u4F1A\u6BCF 30 \u79D2\u68C0\u67E5\u4E00\u6B21\uFF0C\u6301\u7EED 2 \u5C0F\u65F6\u3002",stopPollingButton:"\u505C\u6B62\u5E76\u7EE7\u7EED",evidenceFound:"\u68C0\u6D4B\u5230\u8BC1\u636E\uFF01\u4F60\u73B0\u5728\u53EF\u4EE5\u5728 Focus \u9875\u9762\u67E5\u770B\u3002",timeoutHint:"2 \u5C0F\u65F6\u5185\u672A\u68C0\u6D4B\u5230\u8BC1\u636E\u3002\u6CA1\u5173\u7CFB\u2014\u2014\u4F60\u968F\u65F6\u53EF\u4EE5\u7528 pd-pain-signal \u8BB0\u5F55\u8BC1\u636E\u3002",pollingError:"\u65E0\u6CD5\u68C0\u67E5\u8BC1\u636E\u3002\u8BC1\u636E\u670D\u52A1\u53EF\u80FD\u4E0D\u53EF\u7528\u3002",retryButton:"\u91CD\u8BD5"},progress:{step1:"\u6B22\u8FCE",step2:"\u6F14\u793A",step3:"\u547D\u4EE4",step4:"\u8BC1\u636E"}},failedTasks:{title:"\u5931\u8D25\u4EFB\u52A1",subtitle:"\u7BA1\u9053\u4E2D\u5931\u8D25\u6216\u9700\u8981\u4EBA\u5DE5\u5BA1\u67E5\u7684\u4EFB\u52A1",empty:"\u5F53\u524D\u67E5\u8BE2\u8303\u56F4\u5185\u6CA1\u6709\u5931\u8D25\u4EFB\u52A1\u3002\u8FD9\u4E0D\u7B49\u4E8E\u7BA1\u9053\u5065\u5EB7\u2014\u2014\u8BF7\u7ED3\u5408\u4E0B\u65B9\u5B66\u4E60\u961F\u5217\u72B6\u6001\u5224\u65AD\u3002",pipeline:{title:"\u5B66\u4E60\u961F\u5217\u72B6\u6001",statusHealthy:"\u6B63\u5E38\u63A8\u8FDB",statusBacklogged:"\u6709\u79EF\u538B\uFF08\u4ECD\u5728\u63A8\u8FDB\uFF09",statusStalled:"\u7591\u4F3C\u505C\u6EDE",statusDisabled:"\u6D88\u8D39\u8005\u5DF2\u7981\u7528",statusUnknown:"\u72B6\u6001\u672A\u77E5",nextActionPrefix:"\u5EFA\u8BAE\uFF1A"},error:"\u52A0\u8F7D\u5931\u8D25\u4EFB\u52A1\u5931\u8D25",disabled:"\u5931\u8D25\u4EFB\u52A1\u53EF\u89C2\u6D4B\u6027\u5DF2\u7981\u7528\u3002\u8BF7\u5728 .pd/config.yaml \u4E2D\u542F\u7528 'failed_tasks_observability' \u4EE5\u67E5\u770B\u3002",createDraft:"\u521B\u5EFA\u53CD\u9988\u8349\u7A3F",recover:"\u7EE7\u7EED\u6F14\u5316",recoverConfirmTitle:"\u6062\u590D\u6B64\u6F14\u5316\u4EFB\u52A1\uFF1F",recoverConfirmStatus:"\u5F53\u524D\u72B6\u6001",recoverConfirmActionLabel:"\u6062\u590D\u52A8\u4F5C",recoverConfirmActionDesc:"\u91CD\u7F6E\u4EFB\u52A1\u5E76\u5141\u8BB8\u8FD0\u884C\u65F6\u91CD\u65B0\u6267\u884C",recoverConfirmImpactLabel:"\u5F71\u54CD",recoverConfirmImpactDesc:"\u65E2\u6709\u4EA7\u7269\u5C06\u88AB\u4FDD\u7559\uFF0C\u5E76\u5C06\u521B\u5EFA\u4E00\u6B21\u65B0\u7684\u6267\u884C\u5C1D\u8BD5\u3002",recoverConfirmAttempts:"\u5DF2\u7528\u91CD\u8BD5\u6B21\u6570",recoverExhaustedWarning:"\u6B64\u4EFB\u52A1\u5DF2\u7528\u5B8C\u5168\u90E8\u91CD\u8BD5\u6B21\u6570\uFF08{{attempt}}/{{max}}\uFF09\uFF0C\u666E\u901A\u6062\u590D\u5C06\u88AB\u62D2\u7EDD\u3002",recoverConfirmForceButton:"\u5F3A\u5236\u6062\u590D",recoverConfirmForceImpactDesc:"\u5F3A\u5236\u91CD\u7F6E\u4EFB\u52A1\uFF1A\u6E05\u7A7A\u9519\u8BEF\u4E0E\u79DF\u7EA6\u8BB0\u5F55\uFF0C\u91CD\u8BD5\u4E0A\u9650\u63D0\u5347 3 \u6B21\u5E76\u521B\u5EFA\u4E00\u6B21\u65B0\u7684\u6267\u884C\u5C1D\u8BD5\u3002\u65E2\u6709\u4EA7\u7269\u5C06\u88AB\u4FDD\u7559\u3002",recoverConfirmButton:"\u6062\u590D",recoverSuccess:"\u6062\u590D\u5DF2\u63A5\u53D7\u2014\u2014\u4EFB\u52A1\u5DF2\u91CD\u65B0\u8FDB\u5165\u5F85\u5904\u7406\u72B6\u6001",recoverFailed:"\u6062\u590D\u5931\u8D25",awaitingOwnerDecision:"\u7B49\u5F85\u62E5\u6709\u8005\u51B3\u7B56",goGovernanceFocus:"\u524D\u5F80\u6CBB\u7406\u7126\u70B9",taskId:"\u4EFB\u52A1 ID",painId:"Pain ID",kind:"\u7C7B\u578B",status:"\u72B6\u6001",lastError:"\u6700\u8FD1\u9519\u8BEF",attempts:"\u5C1D\u8BD5\u6B21\u6570",lastAttempt:"\u6700\u8FD1\u5C1D\u8BD5",noPainId:"\u2014",partialResults:"\u4EC5\u663E\u793A\u524D {shown} \u6761\uFF0C\u5171 {total} \u6761\u3002\u8BF7\u7F29\u5C0F\u7B5B\u9009\u8303\u56F4\u6216\u4F7F\u7528 'pd errors list --offset' \u67E5\u770B\u66F4\u591A\u3002",detailToggle:"\u5C55\u5F00/\u6536\u8D77\u4EFB\u52A1\u8BE6\u60C5",detailError:"\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5\u5931\u8D25",createdAt:"\u521B\u5EFA\u65F6\u95F4",updatedAt:"\u66F4\u65B0\u65F6\u95F4",runsTitle:"\u6267\u884C\u5386\u53F2",runAttempt:"\u5C1D\u8BD5",runStarted:"\u5F00\u59CB\u65F6\u95F4",runEnded:"\u7ED3\u675F\u65F6\u95F4",runReason:"\u539F\u56E0",runErrorCategory:"\u9519\u8BEF\u7C7B\u522B",noRuns:"\u8BE5\u4EFB\u52A1\u6682\u65E0\u6267\u884C\u8BB0\u5F55\u3002"}},components:{errorBoundary:{title:"\u53D1\u751F\u9519\u8BEF",description:"\u9875\u9762\u52A0\u8F7D\u65F6\u53D1\u751F\u9519\u8BEF",retry:"\u91CD\u8BD5",reportAction:"\u62A5\u544A\u6B64\u95EE\u9898"},zoneSection:{empty:"\u6682\u65E0\u6570\u636E",viewAll:"\u67E5\u770B\u5168\u90E8"},taskCard:{approve:"\u6279\u51C6",reject:"\u62D2\u7EDD",cleanup:"\u6E05\u7406",undo:"\u64A4\u9500",undoCountdown:"\u64A4\u9500 ({{count}}\u79D2)",evidence:"\u8BC1\u636E",summary:"\u6458\u8981",why:"\u539F\u56E0",whatHappens:"\u5F71\u54CD"},evidencePanel:{summary:"\u6458\u8981",why:"\u539F\u56E0",whatHappens:"\u5F71\u54CD",evidenceItems:"\u8BC1\u636E\u9879"},pageHeader:{refresh:"\u5237\u65B0",lastUpdated:"\u6700\u540E\u66F4\u65B0: {{time}}",justNow:"\u521A\u521A",minutesAgo:"{{count}}\u5206\u949F\u524D",hoursAgo:"{{count}}\u5C0F\u65F6\u524D",daysAgo:"{{count}}\u5929\u524D"},themeToggle:{light:"\u4EAE\u8272\u6A21\u5F0F",dark:"\u6697\u8272\u6A21\u5F0F"},languageSwitcher:{chinese:"\u4E2D\u6587",english:"English"},sidebar:{collapse:"\u6298\u53E0\u4FA7\u8FB9\u680F",expand:"\u5C55\u5F00\u4FA7\u8FB9\u680F",focus:"\u6CBB\u7406\u7126\u70B9",pain:"\u884C\u4E3A\u8BC1\u636E",principles:"\u539F\u5219\u5BA1\u67E5",activation:"\u751F\u6548\u60C5\u51B5",debt:"\u539F\u5219\u503A\u52A1",examiner:"Examiner \u9A8C\u8BC1",controlCenter:"\u63A7\u5236\u4E2D\u5FC3",reportProblem:"\u4EA7\u54C1\u53CD\u9988",failedTasks:"\u5931\u8D25\u4EFB\u52A1",settings:"\u8BBE\u7F6E",update:"\u66F4\u65B0",pendingApprovalsAria:"{{count}} \u6761\u5F85\u5BA1\u6279\u539F\u5219",degradedSignalsAria:"{{count}} \u4E2A\u7CFB\u7EDF\u964D\u7EA7\u4FE1\u53F7",intent:"\u62E5\u6709\u8005\u610F\u56FE",themeToLight:"\u5207\u6362\u4EAE\u8272\u6A21\u5F0F",themeToDark:"\u5207\u6362\u6697\u8272\u6A21\u5F0F",switchLanguage:"\u5207\u6362\u8BED\u8A00",signOut:"\u9000\u51FA",openMenu:"\u6253\u5F00\u5BFC\u822A\u83DC\u5355",navigation:"\u4E3B\u5BFC\u822A",navigationDescription:"\u5BFC\u822A\u5230\u63A7\u5236\u53F0\u5404\u9875\u9762\uFF1B\u9009\u62E9\u540E\u62BD\u5C49\u81EA\u52A8\u5173\u95ED\u3002"},approvalCard:{confidence:{high:"\u9AD8\u7F6E\u4FE1",medium:"\u4E2D\u7F6E\u4FE1",low:"\u4F4E\u7F6E\u4FE1"},viewDetail:"\u67E5\u770B\u8BE6\u60C5",approve:"\u6279\u51C6",reject:"\u62D2\u7EDD",empty:"\u6682\u65E0\u5F85\u5BA1\u6279\u9879\u76EE",stats:{pending:"\u5F85\u5904\u7406",approved:"\u5DF2\u6279\u51C6",rejected:"\u5DF2\u62D2\u7EDD"},status:{approved:"\u5DF2\u6279\u51C6",rejected:"\u5DF2\u62D2\u7EDD",cancelled:"\u5DF2\u53D6\u6D88"},decidedBy:"\u51B3\u5B9A\u8005\uFF1A{{by}}",channel:{code_tool_hook:"RuleHost",defer_archive:"\u5EF6\u8FDF\u5F52\u6863",prompt:"\u63D0\u793A\u8BCD\u6CE8\u5165",skill:"\u6280\u80FD\u6FC0\u6D3B\uFF08\u5DF2\u505C\u7528\uFF09"},retired:"\u6B64\u901A\u9053\u5DF2\u505C\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u5BA1\u6279\u64CD\u4F5C",riskLevel:"\u98CE\u9669\u7EA7\u522B"},approvalDetail:{title:"\u5BA1\u6279\u8BE6\u60C5",whyRecommended:"\u4E3A\u4EC0\u4E48\u63A8\u8350",confidenceExplanation:"\u7F6E\u4FE1\u5EA6\u8BF4\u660E",whatHappens:"\u6279\u51C6\u540E\u4F1A\u53D1\u751F\u4EC0\u4E48",ifReject:"\u5982\u679C\u62D2\u7EDD",approve:"\u6279\u51C6",reject:"\u62D2\u7EDD"},rejectionDialog:{title:"\u62D2\u7EDD\u539F\u56E0",description:"\u8BF7\u8BF4\u660E\u4E3A\u4EC0\u4E48\u62D2\u7EDD\u6B64\u5BA1\u6279\u3002\u8FD9\u6709\u52A9\u4E8E\u7CFB\u7EDF\u6539\u8FDB\u672A\u6765\u7684\u63A8\u8350\u3002",placeholder:"\u8F93\u5165\u62D2\u7EDD\u539F\u56E0\uFF08\u81F3\u5C1110\u4E2A\u5B57\u7B26\uFF09\u2026",tooShort:"\u62D2\u7EDD\u539F\u56E0\u81F3\u5C11\u9700\u898110\u4E2A\u5B57\u7B26",cancel:"\u53D6\u6D88",submit:"\u786E\u8BA4\u62D2\u7EDD"},onboardingReset:{title:"\u5F15\u5BFC\u6D41\u7A0B",resetButton:"\u91CD\u7F6E\u5F15\u5BFC\u72B6\u6001",resetConfirm:"\u8FD9\u5C06\u5728\u4E0B\u6B21\u767B\u5F55\u65F6\u91CD\u65B0\u542F\u52A8\u5F15\u5BFC\u5411\u5BFC\u3002\u7EE7\u7EED\u5417\uFF1F",resetSuccess:"\u5F15\u5BFC\u72B6\u6001\u5DF2\u91CD\u7F6E\u3002\u4E0B\u6B21\u8BBF\u95EE\u65F6\u4F1A\u770B\u5230\u6B22\u8FCE\u9875\u3002",resetFailed:"\u65E0\u6CD5\u91CD\u7F6E\u5F15\u5BFC\uFF0C\u8BF7\u68C0\u67E5\u6D4F\u89C8\u5668\u5B58\u50A8\u6743\u9650\u540E\u91CD\u8BD5\u3002"},onboardingFlag:{title:"\u5F15\u5BFC\u529F\u80FD",label:"\u65B0\u7528\u6237\u5F15\u5BFC\u5411\u5BFC",description:"\u9996\u6B21\u8BBF\u95EE\u65F6\u663E\u793A\u6B22\u8FCE\u5411\u5BFC\u3002\u719F\u7EC3\u7528\u6237\u53EF\u5173\u95ED\u3002",toggleAriaLabel:"\u5207\u6362\u65B0\u7528\u6237\u5F15\u5BFC\u529F\u80FD",enabled:"\u5F15\u5BFC\u5411\u5BFC\u5DF2\u542F\u7528",disabled:"\u5F15\u5BFC\u5411\u5BFC\u5DF2\u5173\u95ED",toggleFailed:"\u5207\u6362\u5F15\u5BFC\u529F\u80FD\u5931\u8D25",loadFailed:"\u52A0\u8F7D\u5F15\u5BFC\u5F00\u5173\u72B6\u6001\u5931\u8D25"},fullPipelineFlag:{title:"\u7BA1\u9053\u6A21\u5F0F\uFF08PRI-720\uFF09",label:"\u5F3A\u5236 prompt \u539F\u5219\u8D70\u5B8C\u6574\u7BA1\u9053",description:"\u9ED8\u8BA4\u5173\uFF1Aprompt/defer \u539F\u5219\u8D70\u77ED\u8BED\u4E49\u8DEF\u5F84\uFF08\u4E0D\u751F\u6210\u4EE3\u7801\u3001\u4E0D\u8DD1\u6C99\u7BB1\uFF09\u3002\u5F00\u542F\u540E\uFF1A\u65B0\u79CD\u5B50\u7684 prompt \u94FE\u8D70\u5B8C\u6574\u65E7\u7BA1\u9053\uFF0C\u5305\u62EC Artificer \u4EE3\u7801\u751F\u6210\u3001Evaluator \u8BC4\u5BA1\u4E0E\u5BF9\u6297\u91CD\u653E\u2014\u2014\u7528\u4E8E\u6D4B\u8BD5\u573A\u666F\u6216\u60A8\u660E\u786E\u9700\u8981\u8DD1\u5B8C\u6574\u7BA1\u9053\u65F6\u3002\u4E0D\u5F71\u54CD\u5DF2\u5728\u8FDB\u884C\u4E2D\u7684\u94FE\u3002",toggleAriaLabel:"\u5207\u6362 prompt \u5185\u5316\u5F3A\u5236\u5B8C\u6574\u7BA1\u9053\u6A21\u5F0F",enabled:"\u65B0 prompt \u94FE\u5DF2\u5F3A\u5236\u8D70\u5B8C\u6574\u7BA1\u9053",disabled:"prompt \u94FE\u4F7F\u7528\u77ED\u8BED\u4E49\u8DEF\u5F84",toggleFailed:"\u5207\u6362\u7BA1\u9053\u6A21\u5F0F\u5931\u8D25",loadFailed:"\u52A0\u8F7D\u7BA1\u9053\u6A21\u5F0F\u72B6\u6001\u5931\u8D25"}}};var Sm={common:{loading:"Loading",refresh:"Refresh",settings:"Settings",login:"Login",logout:"Logout",confirm:"Confirm",cancel:"Cancel",yes:"Yes",no:"No",save:"Save",delete:"Delete",add:"Add",edit:"Edit",view:"View",more:"More",search:"Search",filter:"Filter",sort:"Sort",clear:"Clear",apply:"Apply",close:"Close",submit:"Submit",success:"Success",error:"Error",warning:"Warning",info:"Info",total:"Total",active:"Approved",inactive:"Inactive",pending:"Pending",completed:"Completed",failed:"Failed",unknown:"Unknown",all:"All",none:"None",lastUpdated:"Last Updated",status:"Status",name:"Name",description:"Description",type:"Type",date:"Date",time:"Time",actions:"Actions",copied:"Copied",skipToMain:"Skip to main content"},pages:{focus:{workbench:{textPreview:"Text preview",codePreview:"Rule implementation preview",fullText:"Expand complete text",fullCode:"Expand complete rule implementation",scope:"Applicable scope",compare:"Compare the previous version and retained intent",intentReviewed:"I checked the old and new versions and the intent to retain",promptConsequence:"Approval enters the existing prompt activation flow. Delivery still depends on host and capacity.",ruleConsequence:"Accepting an execution proposal is not promotion to live. Observation and promotion remain separate decisions.",approveOne:"Approve this revision",rejectOne:"Reject this revision",replaceOne:"Replace pending revision",replacementId:"Validated replacement artifact identifier",reason:"Reason for this decision",confirm:"Confirm submission",cancel:"Cancel",resultUnknown:"The submission result is unconfirmed. Read the current state before deciding again; do not resubmit.",notRecorded:"This decision is not complete. Review the refreshed material.",approved:"Approval is complete. Check activation and delivery in runtime status.",rejected:"This revision was rejected. Other subjects were not processed.",activationFailed:"Approval is complete, but activation failed. Use runtime recovery; do not approve again.",approvedRuntimeUnknown:"Approval was recorded. Activation is incomplete or unconfirmed. Check runtime status.",replaced:"The pending revision was replaced. Review the current text before deciding.",versionNeedsReview:"Revision {{index}} to review",title:"Needs your attention",subtitle:"Choose one item, understand the proposal and its consequences, then continue.",list:"Work items",count:"{{count}} items",uncertain:"Some sources could not be read. This list may be incomplete.",empty:"No work items are currently confirmed.",back:"Back to work items",next:"View next item",readingEnd:"This is the end of this item. Return to the list or review the next one.",completed:"Review outcome",notCurrent:"This item is no longer in the current list",startTitle:"Start with one item",startBody:"Choose an item to read its material, check the concerns, and see the available actions in one place.",notCurrentBody:"It may have been resolved, or its source may be unavailable. Use the freshly read state.",start:"Start review",loading:"Loading this approval\u2019s exact material\u2026",why:"What this is trying to solve",proposal:"What PD proposes to change",decision:"Your decision",proposedBehavior:"Proposed behavior (this draft)",currentApproved:"currently approved",currentRejected:"currently rejected",refusedCurrentState:"This operation was not performed; {{state}}.",currentStateConfirmed:"The record was reloaded: {{state}}. Whether this submission succeeded remains unconfirmed.",runtimeCheckLink:"Check activation and delivery on the runtime page.",sourceUnlinked:"This approval could not be linked to a principle or a readable name. Check the exact text and source first; you can reject it if the material is insufficient.",risksUnknown:"Risk notes for this revision are missing or unreadable. Risks remain unconfirmed.",risksEmpty:"This revision lists no risks; that does not establish safety.",approvalNote:"Approval note (optional)",budgetBasis:"Prompt capacity source and estimate basis",sourcesPending:"Sources unconfirmed",countExplanation:"How items are counted",archiveReview:"Defer or archive review",archiveConsequence:"Approving defers or archives this proposal; it does not activate a prompt or execution rule.",approveArchive:"Approve defer or archive",beforeDecision:"Before you decide",subjectUnconfirmed:"The complete decision material for this revision is unconfirmed. Check its source first.",revisionChanged:"The pending revision changed. Return to the list and read the new revision and intent comparison before deciding.",scopeUnknown:"Unspecified scope and exceptions remain unknown; they do not mean this applies in every situation.",principleLimits:"Principle-level risks and gaps (not validation of this revision)",reasonAndScope:"Rationale and consequences",materialUnavailable:"The material for this item is unavailable.",exactMaterialMissing:"No text matching this approval and revision was found. Check the material first.",versionLock:"You can read the material. The current approval service does not yet guarantee that the submitted version is the one you reviewed, so approve, reject, and replace actions are unavailable here.",openPrinciple:"View principle details and existing records",subjectDetails:"View approval and revision identifiers",permissionsUnknown:"Approval permissions could not be confirmed. Reading remains available; decision actions are locked.",taskDecision:"Current proposal decision",revisionDecision:"Proposal revision decision",validationReview:"Behavior validation review",approvalMaterialReview:"Approval material check",unknownReview:"Item type needs checking",promptReview:"Prompt principle review",ruleReview:"Execution proposal review",approvalSummary:"Check the proposed behavior, scope, and exact revision.",bindingReview:"Rule attribution review",bindingSummary:"Confirm which principle this rule should implement.",decisionRecorded:"The service received the decision. The list is refreshing from current state.",retry:"Read again",runtimeRecords:"Runtime and historical records",rulePromotion:"Rule promotion review",promotionSummary:"This rule is still being observed. Review the safety evidence before continuing observation, rejecting, or promoting it.",openActivation:"View rule runtime and emergency controls",safetyAlert:"{{count}} rules are safety-isolated. Check their runtime state.",approvalsUnavailable:"Some approval material could not be read. Other confirmed items remain available."},ruleBinding:{title:"Formal principle attribution for rules",separate:"Attribution only states which principle a rule belongs to; it does not approve the rule, enable it, or replace a development design approval.",unavailable:"Attribution material is unavailable. Reload the page.",countsLine:"{{candidates}} rule candidates | {{painGroups}} feedback signals | {{bound}} linked | {{unlinked}} awaiting decision | {{blocked}} blocked",truncatedNote:"Too many candidates; showing the first {{count}}. The counts above cover displayed entries only.",groupPrefix:"From feedback:",painUnrecorded:"Original words not recorded",sourceUnreadable:"Records unreadable",sourceUnknown:"Source not recorded",sourceManual:"Owner feedback",sourceToolFailure:"Tool failure",groupCount:"{{count}} rule candidates",currentStage:"Current stage: ",boundTo:"Linked principle:",viewPrinciple:"Open principle",blockedLine:'Generation stopped at "{{stage}}": {{reason}}; no new rule generated yet.',blockedNoOwnerApproval:"No Owner approval needed right now - this is a material problem; the draft must be revised first.",blockedDetail:"Show blocking detail",blockReason:{textual_basis_unanchored:"draft citation check failed (the claimed Owner quote cannot be anchored in the material)"},blockReasonUnknown:"generation blocked (server gave no reason code)",attentionLine:"Material problem ({{reason}}): shown as the server reports it; do not infer the attribution state from this.",nextLabel:"Next step: ",nextAwaitingOwner:"Choose which formal principle this rule implements - attribution only; it approves no code and enables no interception.",nextBoundGenerating:"The system is revising and validating the new rule artifact; no Owner action needed until it finishes.",nextBoundBlocked:"The draft must be revised and regenerated; no retry button is offered until the official recovery capability exists.",nextBoundBlockedNoResume:"Generation is blocked and cannot be resumed now ({{reason}}); revise the draft. An official recovery entry arrives in a later release.",nextBoundAdvanced:"Rule artifact generated; rule approval and activation happen on their own pages.",nextBoundNotBuilt:"Linked to a principle; rule generation has not started yet.",nextBoundAmbiguous:"Generation chain state is unclear; check technical details or reload.",nextRevoked:"Attribution withdrawn and artifacts kept; you may link again.",nextAttention:"Check the reason code in technical details, or reload.",techDetails:"Technical details",candidate:"Rule candidate text",pain:"Source pain signal",evidence:"Diagnosis evidence",boundSince:"link revision {{revision}} ({{date}})",chooseTarget:"Choose the principle this rule implements: attribution only - it approves no code, enables no interception, and does not mean a development SPEC was approved.",search:"Search formal principles",noTarget:"If no principle fits, keep it unlinked.",formation:"Open the principle formation flow",version:"Version",declaration:"Submitting means: this rule is one implementation of the selected principle, and you authorize exactly one controlled revision/generation/validation run under the existing configuration.",reason:"Reason for linking or withdrawing",bind:"Link and run one revision",revokeSecondary:"Withdraw attribution (secondary)",bound:"Attribution saved; one controlled revision was requested. The rule still requires separate approval.",resumeFailed:"Attribution saved but the revision has not started. Check the recovery reason; old artifacts are unchanged and will not auto-retry.",revoked:"Attribution withdrawn; artifacts kept. Running rules must be stopped separately.",revokeBoundary:"Withdrawal does not stop running rules; in-flight operations that passed final checks may still complete.",stop:"Open rule runs and stop entry",openReview:"Review and act",closeReview:"Collapse",reviseCta:"Revise and continue",reviseStarted:"One controlled revision was requested; generation and validation continue under the existing configuration.",reviseAlreadyStarted:"This revision is already in progress; no repeat request needed.",resumeUnavailable:"Automatic revision is unavailable now ({{reason}}); a generic retry is not a source revision.",sourceCorrectionCta:"Correct source material and continue",sourceCorrectionStarted:"One source-material correction was authorized: the Scribe reopens for one round on the corrected material and the original Artificer resumes on the new artifact, under the existing configuration and budgets.",sourceCorrectionAlreadyStarted:"This source correction is already in progress (idempotent replay); no repeat request needed.",sourceCorrectionUnavailable:"The source-correction entry is unavailable now ({{reason}}).",resumeReason:{revision_budget_exhausted:"the revision budget of this link is spent",dreamer_lineage_not_unique:"dreamer task lineage is not unique",dreamer_missing:"dreamer task not found",philosopher_lineage_not_unique:"philosopher task lineage is not unique",philosopher_missing:"philosopher task not found",scribe_lineage_not_unique:"scribe task lineage is not unique",scribe_metadata_invalid:"scribe task metadata is invalid",predecessor_not_succeeded:"an upstream task has not succeeded",scribe_missing:"scribe task not found",candidate_kind_invalid:"candidate kind is invalid",binding_revision_stale:"binding revision is stale; reload",task_revision_stale:"task revision epoch is stale; reload",scribe_target_mismatch:"target scribe task mismatch; reload",task_lease_present:"the task is held by a worker; retry later",revision_snapshot_stale:"task state changed; reload"},stateAwaitingOwner:"Awaiting principle choice",stateBoundGenerating:"Linked - generating",stateBoundBlocked:"Linked - blocked",stateBoundAdvanced:"Linked - generated",stateBoundNotBuilt:"Linked - not started",stateBoundAmbiguous:"Linked - chain unclear",stateRevoked:"Attribution withdrawn",stateAttention:"Material problem",stageDreamer:"dreaming",stagePhilosopher:"distilling",stageScribe:"drafting",stageArtificer:"rule generation",stageEvaluator:"rule validation",stageRolloutReviewer:"rollout review",viewRemaining:"Show the other {{count}} feedback groups",hideRemaining:"Collapse remaining feedback groups"},eyebrow:"Governance Focus",title:"What deserves your judgment right now",subtitle:"This page answers one question: what should the owner review next?",summaryLabel:"Current:",summaryPending:"pending review",summaryDeviation:"behavior deviations",summaryStagnation:"stagnation signals",summaryEvidence:"behavior evidence in progress",stratLabel:"Today's Feedback Layers",stratGateBlocks:"Auto-blocked",stratGateBlocksHint:"RuleHost handled these \u2014 no action needed",stratInProgress:"In Progress",stratInProgressHint:"Evidence/internalization pipeline running",stratPendingReview:"Needs Your Call",stratPendingReviewHint:"Awaiting your review decision",stratYouAreHere:"you are here",sectionPending:"Pending Your Review",sectionDeviation:"Behavior Deviations Worth Noting",sectionEvidenceInProgress:"Behavior Evidence In Progress",sectionSignals:"System Signals",emptyPending:"No principles pending review. When PD captures behavior deviation signals, principle candidates will appear here for your review.",emptyDeviation:"No behavior deviations captured yet. PD will detect deviations when the agent's behavior diverges from owner expectations.",emptySignals:"No stagnation signals. All approved principles appear to be active.",stagnationNeverActivated:"Approved but never activated",stagnationNoPain:"No pain signals received",stagnationDaysSince:"days ago",deviationDisclaimer:"PD presents each deviation individually. Automatic similarity detection is not available yet.",deviationDetailPending:"Individual deviation evidence will be available here once the backend provides pain signal details (CR5).",footer:"This page answers one question: what deserves your judgment right now.",dailyThought:{eyebrow:"Before you judge",ariaLabel:"Today's thought",next:"Next thought",nextAriaLabel:"Show next thought",authorPrefix:"\u2014 "},reviewAction:"Review & Decide",parkAction:"Park",viewFullChain:"View full chain",loadError:"Unable to load governance data. You can try refreshing the page.",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",tagReversible:"Reversible",tagLowRisk:"Low Risk",recordCount:"{{count}} record(s)",deviationCount:"deviation(s)",evidenceSummary:"Approval records: {{count}}",untitledCandidate:"Untitled candidate principle",promptCapacityUnconfirmed:"Host capacity unconfirmed: the applicable hosts of this workspace take different injection routes; the numbers below are not bound to a specific host.",promptCapacityStarved:"{{count}} host(s) cannot fit even one principle within their current injection budget; principles will not take effect there.",promptCapacityDetails:"Show per-host capacity details",promptCapacityPerHostCatalogMatched:" (budget derived from a unanimous catalog match on the model id)",promptCapacitySharedRoute:"shared injection (billed on the full injected block)",promptCapacityListRoute:"list injection (billed on the selected lines)",promptCapacityPerHostEntry:"{{host}}: {{billing}} \u2014 {{used}}/{{budget}} chars{{full}}{{observed}}",promptCapacityPerHostFull:" (not all entered this turn)",promptCapacityPerHostRotating:" (not all entered this turn; the rest rotate in on later turns)",promptCapacityPerHostDeclared:"(budget from the workspace config declaration)",promptCapacityPerHostObserved:" (budget from this host's most recent runtime observation at {{observedAt}})",promptCapacityPickHint:"Review/approve for a target host:",promptCapacityViewAsHost:"View as {{host}}",promptCapacityClearHost:"Clear selection",promptScopeShared:"Forecast window (shared route, billed on the full injected block, unit=chars)",promptScopeList:"Forecast window (list route, billed on the selected lines{{full}}, unit=chars)",promptScopeFullRender:"; full injected block \u2248 {{count}} chars",promptBudgetModelAwareNote:"Budget resolved from the confirmed model context ({{window}} tokens)",promptBudgetObservedNote:"Budget from the most recent runtime observation (source {{source}}, context {{window}} tokens, observed at {{observedAt}})",promptBudgetFallbackNote:"Estimated with the fixed fallback budget (console not bound to a runtime model{{reason}})",promptBudgetFallbackObservedNote:"The runtime's most recent observation did not confirm host capacity; estimated with the fixed fallback budget ({{reason}}, observed at {{observedAt}})",promptBudgetFallbackReasonSuffix:", reason: {{code}}",promptBudgetFallbackObservedSuffix:"; the runtime's most recent observation was at {{observedAt}}",budgetCapacitySourceHostWindow:"host effective context window",budgetCapacitySourcePiCatalog:"exact model catalog match",budgetCapacitySourcePiCatalogModelId:"unanimous model-id catalog match",budgetCapacitySourceOperatorDeclared:"workspace config declaration",budgetCapacitySourceOperatorDeclaredSuffix:", source: workspace config declaration",budgetFallbackReason:{host_capacity_absent:"the host provided no context capacity fact (declare contextWindowTokens under promptBudget in .pd/config.yaml to override)",host_capacity_source_untrusted:"the host capacity source is untrusted",host_capacity_invalid_value:"the host capacity value is invalid",catalog_unavailable:"the model catalog is unavailable",model_identity_absent:"model identity is missing",catalog_no_exact_match:"provider+model is not in the built-in catalog (common for custom providers; declare contextWindowTokens under promptBudget in .pd/config.yaml)",catalog_no_match_for_model_id:"the model id is not in the model catalog (declare contextWindowTokens under promptBudget in .pd/config.yaml)",catalog_ambiguous_model_id:"the model id is ambiguous in the model catalog",catalog_provider_absent:"the provider id is missing",catalog_metadata_invalid:"the model catalog metadata is invalid",runtime_budget_observation_stale:"the runtime budget observation is stale (older than 24h; not used as the current budget)"},artifactUnavailableNote:"The draft artifact this approval points to is no longer in the artifact store (likely superseded by a newer revision), so its content cannot be shown. If in doubt, reject it; the raw artifact ID is shown in the replacement section's current-artifact field.",unlinkedCandidateNote:"No principle name is available for this card: its lineage cannot be resolved to a principle, and no readable title could be extracted from its stored content. Judge it from the approval records below; if you cannot decide, you can reject it.",approveAction:"Approve",rejectAction:"Reject",editAction:"Replace pending version",confirmReject:"Confirm reject",confirmEdit:"Confirm replacement",cancelAction:"Cancel",rejectReasonLabel:"Reject reason (required)",rejectReasonPlaceholder:"Explain why this is rejected",editReasonLabel:"Replacement reason (required)",editReasonPlaceholder:"Explain why this pending version needs replacing",editNewArtifactPlaceholder:"Enter validated revision artifact ID",currentArtifactLabel:"Current artifact",approveSucceededCount:"Approved {{count}} principle(s)",decidedApproved:"Approved \u2713",decidedRejected:"Rejected",approveQueueBadge:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars).",approveQueueBadgeRotation:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars). Selection is rotating fairly, so new principles come around on later turns \u2014 no need to deactivate older principles.",approveQueueBadgeOversized:"May queue after approval: prompt injection slots are full ({{used}}/{{budget}} chars). This principle is itself larger than the injection limit, so rotation cannot fit it \u2014 shorten its content first.",approveWarningDetail:"Server details",goActivationCta:"Open activations",approveWarning:{budgetExcludedTitle:"Approved, but not yet in effect",budgetExcludedBody:"This principle was approved and saved, but the prompt injection budget is full ({{budget}}-char cap) and only {{earlierCount}} principle(s) fit the current window. It will not affect agent behavior until capacity frees up.",budgetExcludedBodySimple:"This principle was approved and saved, but the prompt injection budget is full. It will not affect agent behavior until capacity frees up.",queuedTitle:"Approved \u2014 queued to take effect",queuedBody:"This principle was approved and saved. The prompt injection window is full ({{budget}}-char cap), so it is not in the prompt this turn. Selection rotates fairly, advancing one position per user turn, so it will come around within at most {{turns}} consecutive turns \u2014 there is no need to deactivate other principles.",queuedBodySimple:"This principle was approved and saved and is queued for the prompt. Selection rotates fairly, so it will come around on a later turn \u2014 there is no need to deactivate other principles.",excludedTitle:"Approved, but not yet in effect",excludedNonBudgetBody:"This principle was approved and saved but is not in the agent prompt for a non-budget reason. Check the activations page for status.",checkFailedTitle:"Approved \u2014 effect unverified",checkFailedBody:"The approval was saved, but the system could not verify whether it reached the agent prompt. Check the activations page.",oversizedTitle:"Approved, but this principle alone is oversized",oversizedBody:'The approval is saved, but this single principle needs {{cost}} chars, over the injection cap \u2014 no rotation can fit it. Shorten it via "modify to injectable version" on the activations page, or deactivate it.',oversizedBodySimple:"The approval is saved, but this single principle exceeds the injection cap \u2014 no rotation can fit it. Shorten it or deactivate it.",capacityUnconfirmedTitle:"Approved, host capacity unconfirmed",capacityUnconfirmedBody:"The approval is saved, but the applicable hosts of this workspace take different injection routes, so the system cannot confirm where it takes effect. Pick a target host and retry, or let a host run once in this workspace to persist its declaration.",ledgerTitle:"Approved \u2014 principle ledger not synced",ledgerBody:"Approval and activation were saved, but the ledger upgrade did not complete. This does not block enforcement; check the library later.",overflowTitle:"{{count}} more warning(s)"},rejectSucceeded:"Rejected",editSucceeded:"Pending version replaced",approveFailed:"Approval failed, please retry.",rejectFailed:"Rejection failed, please retry.",editFailed:"Replacement failed. Please try again later.",partialFailure:"Action completed, but {{failedCount}}/{{totalCount}} record(s) failed: {{reason}}",unknownFailure:"Check the service logs.",onboardingTitle:"How PD Works",ruleCodeOwnerQueue:"RuleCode Owner decisions",ruleCodePending:"Rules awaiting live decision",ruleCodePendingCount:"{{count}} shadow rule(s) require review of evidence and scope.",ruleCodeUnavailable:"RuleCode review data is unavailable",ruleCodeUnavailableNextAction:"Open Activations or retry after the activation service recovers.",ruleCodeAlerts:"RuleCode safety alerts",ruleCodeAlertCount:"{{count}} rule(s) are safety-isolated and fail-open.",onboardingStep1:"Observe deviations \u2014 PD watches for behavior that diverges from owner expectations",onboardingStep2:"Capture evidence \u2014 Pain signals are recorded with bounded context",onboardingStep3:"Generate candidates \u2014 Principle candidates are proposed for owner review",onboardingStep4:"Review & approve \u2014 Owners decide which principles to activate",onboardingStep5:"Inject behavior \u2014 Approved principles influence future agent behavior, reversibly",stateLabel:{none:"No Data",in_progress:"In Progress",owner_review_ready:"Ready for Review",degraded:"Degraded"},nextActionLabel:"Suggested action:",experience:{attention:{setupRequired:"Setup Required",ownerDecisionRequired:"Owner Decision Required",recoveryRequired:"Recovery Required",degraded:"Degraded",backgroundProcessing:"Background Processing",allClear:"All Clear"},reason:{ownerIdentityMissing:"The Owner identity is not configured. RuleCode governance decisions are blocked until PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID are set and the console token auth is enabled.",ownerIdentityInvalid:"The Owner identity configuration is invalid, so governance actions are safely blocked.",ownerAuthenticationMissing:"The identity is registered, but Console token authentication is not enabled.",approvalPending:"Principle approvals are waiting for your decision.",rulecodeOwnerDecision:"RuleCode shadow activations are waiting for your promotion decision.",noPendingDecision:"No principle approval is waiting right now.",ownerDecisionAvailable:"The configured Owner holds the governance decision entry.",breakGlassEntry:"Emergency pause currently resolves through the local break-glass path because no Owner identity is configured.",recoveryRequired:"Some governance work stalled and needs recovery before it can continue.",sourceUnavailable:"A required governance source is unavailable, so ongoing work cannot progress.",configInvalid:"The workspace config file is invalid; the environment classification is unknown.",processing:"Governance work is running in the background. No decision is needed right now.",workspaceClear:"All governance work is settled. Nothing needs your attention.",workspaceEmpty:"No governance records yet. PD will populate this view once the pipeline runs."},next:{configureOwner:"Configure PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID, then enable console token auth.",authenticateConsole:"Enable Console token authentication, then retry.",reviewApprovals:"Review the pending decisions below.",inspectRecovery:"Open Failed Tasks and recover the stalled work.",inspectSources:"Inspect state.db and the principle ledger, then restart the console.",fixConfig:"Fix the invalid keys in .pd/config.yaml.",monitor:"Nothing to do \u2014 PD will surface the next decision here.",none:"Nothing to do right now."},ownerGuide:{title:"Set the Owner identity",intro:"Copy the command below and run it in the shell that launches OpenClaw and the PD Console (replace <owner-id> and <credential-id> with your own IDs), then restart both.",tokenAuthHint:"Console token authentication (--token or PD_CONSOLE_TOKEN) is also required for the identity to take effect; if not enabled yet, complete that step per the configuration guide.",cmdPowerShell:"PowerShell (Windows)",cmdBash:"bash (macOS / Linux)",copy:"Copy",copied:"Copied",docLink:"Configuration guide and verification \u2192"},blocker:{identityMissing:"Register the Owner identity to enable governance actions.",identityInvalid:"The Owner identity configuration is invalid; fix it in Settings.",authenticationMissing:"Identity registered; enable Console token authentication to use governance actions.",goSettings:"Go to Settings"},activity:{needsDecision:"{{count}} decision(s) waiting",needsRecovery:"{{count}} item(s) need recovery",blocked:"Progress is blocked by an unavailable source",processing:"Background processing ({{count}})"},readiness:{identity:{configured:"Owner identity: configured",missing:"Owner identity: missing",invalid:"Owner identity: invalid"},principleApproval:"Principle approvals: operator entry",rulecode:{ready:"RuleCode decisions: Owner entry",blocked:"RuleCode decisions: blocked (no Owner identity)"},pause:{owner:"Emergency pause: Owner entry",breakGlass:"Emergency pause: break-glass entry"}},trust:{environment:{production:"Environment: production",development:"Environment: development",demo:"Environment: demo",test:"Environment: test",unknown:"Environment: unknown"},lineage:{strong:"Lineage confidence: strong",weak:"Lineage confidence: weak",unknown:"Lineage confidence: unknown"}},dataQuality:{degraded:"Data quality degraded \u2014 e.g. {{reasonCode}} ({{count}} occurrence(s)). Some explanations may be incomplete."},error:{snapshotUnavailable:"The governance experience snapshot could not be loaded."}},inProgressTitle:"Governance in progress",inProgressDetail:"PD will surface a principle candidate here once the internalization pipeline completes and an owner-reviewable artifact is generated.",degradedTitle:"System Signals",degradedStateReason:"Part of the governance pipeline or data source is degraded. Decisions may be incomplete or delayed.",degradedNextActionLabel:"Next action:",advancedDiagnostics:"Advanced diagnostics",degradedSourceInternalization:"Internalization Task",degradedSourceChainIntegrity:"Chain Integrity",degradedSourceUnavailable:"Data Source",stateReason:{state_db_missing:"State database not initialized. PD has not run in this workspace yet.",no_pipeline_activity:"No governance activity recorded yet.",pending_approvals:"{{count}} principle(s) pending your review and decision.",tasks_need_human_review:"{{count}} internalization task(s) are waiting for your review decision.",pipeline_active:"Pipeline has activity, but candidate principles are not ready for review.",consumed_candidates:"Candidate records exist, but have not entered the review stage.",degraded_state:"Part of the governance pipeline or data source is degraded."},nextAction:{run_config_doctor:"Ensure the OpenClaw plugin is enabled, or run pd config doctor.",wait_for_pipeline:"PD will surface principle candidates here once behavior deviations are captured and reviewable artifacts are generated.",review_approvals:"Review pending principles and approve, reject, or park.",review_failed_tasks:"Open Failed Tasks to inspect and recover tasks awaiting your decision.",check_degraded_signals:"Check degraded signal details and follow suggested actions.",check_pipeline_status:"Wait for internalization tasks to complete. If no change for a long time, check pipeline status."},degradedReason:{task_retry_wait:"Internalization task waiting for retry",task_failed:"Internalization task failed",approval_table_missing:"Approval table does not exist",trajectory_db_unavailable:"Behavior evidence database (trajectory.db) is unavailable"},degradedNextAction:{check_task_status:"Check internalization pipeline status, or wait for automatic retry.",fix_and_retry:"Check failure details, fix the issue and retry.",run_integrity_check:"Run pd runtime internalization integrity to check and repair table structure.",check_trajectory_db:"Check trajectory.db file integrity in .state directory."},zeroStateHealthy:"No items need your judgment right now. PD has checked behavior evidence, principle review queue, and system signals.",zeroStateDbMissing:"PD has not run in this workspace yet. Once the state database is initialized, governance data will appear here.",evidenceInProgress:"{{count}} behavior evidence item(s) recorded, being diagnosed and processed.",ownerInbox:{group:{subjectMaterial:"Material for this decision (scoped to its own revision \u2014 no text borrowed from other revisions)",decision:"Needs decision",blocked:"Blocked",recovery:"Needs recovery"},sectionTitle:"Principle decisions",loadError:"Principle decision updates are temporarily unavailable.",empty:"No confirmed pending, blocked, or recovery-needed principle items right now.",viewLibrary:"View the principle library \u2192"},ownerDecision:{evidenceUnavailable:"This decision still needs you, but its evidence chain is incomplete. PD has paused all decision actions so you cannot approve the wrong version.",goRecoverCta:"View recovery details",sectionTitle:"Needs your decision",empty:"Nothing needs your decision right now. Problems the machine can solve on its own will not disturb you.",unavailable:"(unavailable)",loadError:"The decision list is temporarily unavailable \u2014 the governance summary is still shown.",kindEvaluator:"Evaluator review",kindRollout:"Rollout review",kindApproval:"Deployment approval",kindRulecode:"RuleCode decision",legacyBadge:"Inferred from history",machineRecommendationLabel:"Machine recommendation",principleLabel:"Principle",implementationLabel:"Implementation",concernLabel:"Primary concern",partialEvidenceAcknowledgement:"I understand the evidence is incomplete and still want to accept this version.",evidence:{complete:"Evidence complete",partial:"Evidence partial",insufficient:"Evidence insufficient"},rolloutSafetyNote:"Accept this review and continue. High-risk rules still require an independent deployment approval.",acceptCurrent:"Accept current version",reviseOnce:"Revise once more",rejectCurrent:"Reject",actionsLockedAuth:"Decision actions are locked: this console runs without access authentication (the Companion launches the console unauthenticated by default). Configure the console access token in Settings and restart the console to enable Accept / Revise once / Reject.",actionsLockedIdentity:"Decision actions are locked: Owner identity is missing or invalid. Configure Owner identity in Settings to enable decision actions.",goSettingsCta:"Open Settings",instructionLabel:"Revision guidance (optional, one sentence)",instructionPlaceholder:"e.g. Do not add new tool-naming requirements; only address the unresolved items from the last round.",instructionRequired:"Fill in the revision guidance, or collapse the input and submit directly.",actionConsequence:"Accept = continue with the current version (the machine verdict is preserved permanently); Revise once = authorize one extra revision round (automatic budget unchanged); Reject = terminate this evolution.",acceptBlockedHardGate:'"Accept" is unavailable: this item contains a code-rule implementation and opens only after the adversarial sandbox hard gate passes.',acceptBlockedNoCandidate:'"Accept" is unavailable: no activation candidate exists for this principle \u2014 revise or reject to continue.',acceptBlockedGeneric:'"Accept" is unavailable: the current evidence does not meet the release conditions \u2014 revise or reject.',advanced:"Advanced diagnostics",resolved:"Resolution recorded.",staleError:"The facts of this item changed (a new evaluation may exist). Your decision was NOT applied \u2014 refresh and decide again.",alreadyResolved:"This decision was already handled; no repeat action needed.",actionFailed:"Action failed, please retry later.",approvalHint:"The deployment approval for this principle is still waiting in the approval queue.",rulecodeHint:"This rule is in shadow activation and needs a decision in activation management.",goApprovalsCta:"Go to deployment approvals",goActivationCta:"Go to activation management",qualityChecklistLabel:"Quality checklist",qualityCheckStatus:{passed:"passed",failed:"failed"},qualityCheck:{understandability:"Understandability",evidence:"Evidence",actionability:"Actionability",generalization:"Generalization",boundary:"Boundary"},formationLabel:"Formation source",formationPainLabel:"Pain",formationDiagnosisLabel:"Diagnosis",formationRootCauseLabel:"Root cause",formationEvidenceLabel:"Supporting evidence",formationUnavailableNote:"The source diagnosis is currently unreadable; this principle is still decided on the evidence shown.",checksDisclosure:"Deterministic checks (technical detail)"},revisionReviewUnavailable:"Revision review is incomplete or multiple versions are pending. Check the artifacts and prior version before approval; rejection remains available.",revisionIntentReview:"Review the revised statement against the retained intent, including triggers, required actions, and exceptions.",revisionIntentConfirmed:"I reviewed the retained intent and the revised statement for consistency",intentField:{ownerIntent:"Owner intent",targetBehavior:"Expected behavior",forbiddenBehavior:"Forbidden behavior",evidenceSource:"Evidence source",validationExpectation:"Validation expectation"},conclusion:{sectionTitle:"Current status",countsNote:"Scope: the count lists the work items in this workbench; blocked and recovery items are listed separately below.",degradedLabel:"Decision updates degraded:"},ownerAttention:{sectionTitle:"Blocked & needing recovery",blockedCount:"blocked {{count}}",recoveryCount:"needing recovery {{count}}",empty:"No blocked or recovery items need individual attention.",unmatchedTitle:"These objects have decision updates but no available action surface yet (missing association or incomplete data \u2014 not merged away):",blockedAggregate:"{{count}} blocked object(s) need no individual attention and are not counted in the total above.",unmatchedItemNote:"No action surface available for this entry yet; open the principle page for its current state."}},pain:{eyebrow:"Behavior Evidence",title:"Behavior Evidence",description:"Only behavior evidence worth governing should enter principle review. This page shows real behavior signals and their chain states observed by PD \u2014 not raw chat, raw trajectories, or false claims about behavior change.",honestyNote:"PD presents each evidence item individually. Automatic similarity detection is not available yet. Evidence shown here comes from real pain_events, diagnostician tasks, and candidate records.",loadError:"Failed to load behavior evidence",validationError:"Data format validation failed, please refresh and retry",emptyTitle:"No behavior evidence captured yet",emptyDescription:"When PD detects behavior deviations worth governing, evidence will appear here. You can create feedback signals manually via /pd-pain command or pd pain record.",generatedAt:"Generated at",group_active_chain:"Active Chain",group_evidence_only:"Evidence Only (not admitted)",group_failed:"Diagnosis Failed or Awaiting Retry",state_evidence_only:"Evidence Only",state_pain_recorded:"Pain Recorded",state_diagnosis_queued:"Diagnosis Queued",state_diagnosis_running:"Diagnosis Running",state_diagnosis_succeeded:"Diagnosis Succeeded",state_diagnosis_failed:"Diagnosis Failed",state_diagnosis_retry_wait:"Awaiting Retry",state_candidate_generated:"Candidate Generated",state_internalization_started:"Internalization Started",source_manual:"Manual Trigger",source_tool_call:"Tool Call",source_rulehost:"Rule Guard",source_empathy_inferred:"Empathy Inferred",source_review:"Review Finding",source_unknown:"Unknown Source",admission_store_signal:"Signal Stored",admission_evidence_only:"Evidence Only",admission_owner_confirmation_required:"Confirmation Required",fieldFailureReason:"Failure Reason",fieldNextAction:"Suggested Action",fieldDegradedReason:"Degraded Reason",chainToggle:"View chain details",chainId:"Evidence ID",chainTaskId:"Diagnosis Task ID",chainTaskStatus:"Task Status",chainCandidateId:"Candidate ID",chainPrincipleId:"Linked Principle ID",chainSourceKind:"Source Kind",chainState:"Chain State",chainInternalizationTask:"Internalization Task ID",chainDreamerStatus:"Dreamer Status",fieldTrigger:"Trigger",hostKind:{codex:"Codex",openclaw:"OpenClaw"},fieldConclusion:"PD's Conclusion",fieldApplicability:"Applicability",fieldConfidence:"Confidence",confidenceHigh:"High",confidenceMid:"Medium",confidenceLow:"Low",techDetails:"Technical Details",copyDebugId:"Copy Debug IDs",copied:"Copied",noHumanSummary:"PD has not yet generated a behavior summary for this evidence",inReviewQueueCount:"{{count}} item(s) entered the review queue",goToGovernance:"Go to Governance Focus",expandTechDetails:"Expand technical details",intentTensionTitle:"Intent Tension",intentTensionSourceLabel:"Source",intentTensionSourceNone:"No intent tension",intentTensionSourceActionDrift:"Action drift",intentTensionSourceIntentSuspect:"Intent suspect",intentTensionSourceHealthyTension:"Healthy tension",intentTensionEvidenceStrengthLabel:"Evidence strength",intentTensionEvidenceStrengthWeak:"Weak",intentTensionEvidenceStrengthModerate:"Moderate",intentTensionEvidenceStrengthStrong:"Strong",intentTensionRelatedIntentFieldsLabel:"Related INTENT fields",intentTensionEvidenceLabel:"Evidence",intentTensionExplanationLabel:"Explanation",intentTensionSuggestedActionLabel:"Suggested owner action",intentTensionSuggestedActionConfirmDrift:"Confirm drift",intentTensionSuggestedActionReviseIntent:"Revise intent",intentTensionSuggestedActionObserve:"Observe",intentTensionSuggestedActionDismiss:"Dismiss",intentTensionSuggestedActionPromoteToPrinciple:"Promote to principle",intentTensionSuggestedActionPromoteToRulehost:"Promote to RuleHost",intentTensionIntentDocHashLabel:"INTENT doc hash",intentTensionNoTension:"No intent tension detected",intentTensionArtifactDegraded:"Diagnostician artifact for this record could not be fully parsed; intent tension may be unavailable.",ownerDecisionPanelTitle:"Owner Decision",ownerDecisionPanelSubtitle:"Record your decision on this intent tension. Follow-up actions appear only after a decision is persisted.",ownerDecisionNoteLabel:"Note (optional)",ownerDecisionNotePlaceholder:"Add context for this decision",ownerDecisionSubmitConfirmDrift:"Confirm Drift",ownerDecisionSubmitReviseIntent:"Revise Intent",ownerDecisionSubmitObserve:"Observe",ownerDecisionSubmitDismiss:"Dismiss",ownerDecisionSubmitPromoteToPrinciple:"Promote to Principle",ownerDecisionSubmitPromoteToRulehost:"Promote to RuleHost",ownerDecisionSubmitting:"Recording decision\u2026",ownerDecisionRecorded:"Decision recorded",ownerDecisionFailed:"Failed to record decision",ownerDecisionExisting:"A decision already exists for this tension",ownerDecisionFollowUpPlaceholder:"Follow-up actions will appear here after the decision is recorded.",ownerDecisionLoadingExisting:"Loading existing decisions\u2026",ownerDecisionLoadFailed:"Failed to load existing decisions",followUpActionsTitle:"Follow-up actions",followUpDispatching:"Dispatching\u2026",followUpDispatchFailed:"Failed to dispatch follow-up action",followUpLinkCandidateDescription:"Link an existing principle candidate to this decision. PD does not create a new candidate \u2014 link one from the evidence chain or paste a candidate id.",followUpLinkCandidateButton:"Link Candidate",followUpCandidateIdPlaceholder:"Paste candidate id",followUpCandidateIdAriaLabel:"Principle candidate id to link",followUpPrefilledFromEvidenceChain:"Prefilled from the evidence chain linked candidate.",followUpLinkedSuccess:"Linked candidate",followUpGuideRulehostDescription:"Get the CLI command to promote this decision to a RuleHost candidate. PD will create an approval that you can review in the Governance Queue.",followUpGuideRulehostButton:"View RuleHost Guidance",followUpCliCommandLabel:"CLI command",followUpPatchProposalDescription:"Generate a read-only Intent Patch Proposal. The proposal summarizes the tension and suggests where INTENT.md may need revision. PD never auto-applies the patch.",followUpViewPatchProposalButton:"View Intent Patch Proposal",followUpPatchProposalLabel:"Intent Patch Proposal",followUpPatchProposalReadOnlyBadge:"Display only",followUpPatchProposalWarning:"Display only \u2014 cannot be auto-applied. The Owner must manually edit .principles/INTENT.md if they accept this proposal.",followUpPromoteToPrincipleDescription:"Link an existing principle candidate to sediment this decision. PD does not create a new candidate \u2014 link one from the evidence chain or paste a candidate id."},principles:{title:"Principles",description:"Browse and manage principles and rules",active:"Active",candidate:"Candidate",probation:"Probation",deprecated:"Deprecated",total:"Total",rules:"Rules",valueScore:"Value Score",adherence:"Adherence",painPrevented:"Pain Prevented",triggerPattern:"Trigger Pattern",action:"Action",evaluability:"Evaluability",scope:"Scope",conflictsWith:"Conflicts With",associatedRules:"Associated Rules",noRules:"No associated rules",triggerCondition:"Trigger Condition",searchPlaceholder:"Search principle ID, text, trigger pattern...",allStatuses:"All Statuses",allScopes:"All Scopes",allPriorities:"All Priorities",allEvaluabilities:"All Evaluabilities",sortByValue:"Sort by Value Score",sortByAdherence:"Sort by Adherence",sortByPainPrevented:"Sort by Pain Prevented",sortByUpdated:"Sort by Updated",sortByCreated:"Sort by Created",principleList:"Principle List",keyboardHint:"Press / to search, j/k to navigate, Enter to expand, g/G to go top/bottom",noResults:"No results found",noResultsDescription:"Try adjusting your search or filters to find what you're looking for.",noPrinciples:"No principles yet",noPrinciplesDescription:"Principles will appear here once they are created in the system.",viewDetail:"View details",notFound:"Principle Not Found",notFoundDescription:'The principle "{{id}}" does not exist or has been removed.',backToList:"Back to List",browsePrinciples:"Browse Principles",copyLink:"Copy Link",share:"Share",valueMetrics:"Value Metrics",quickStats:"Quick Stats",ruleCount:"Rules",conflictCount:"Conflicts",coreAxiom:"Core Axiom",supersedes:"Supersedes",lastPainPrevented:"Last Pain Prevented",derivedFromPain:"Derived from Pain Events",createdAt:"Created",updatedAt:"Updated",coverageRate:"Coverage",falsePositiveRate:"False Positive",statusDistribution:"Status Distribution",priorityBreakdown:"Priority Breakdown",ruleCoverage:"Rule Coverage",valueDistribution:"Value Distribution",withRules:"With Rules",avgRulesPerPrinciple:"Avg Rules / Principle",bookmarked:"Bookmarked",addBookmark:"Add bookmark",removeBookmark:"Remove bookmark",select:"Select",selected:"selected",export:"Export",exportAll:"Export All",compare:"Compare",deselectAll:"Deselect All",compareTitle:"Principle Comparison",compareField:"Field",showMore:"Show more",showLess:"Show less",reviewTitle:"Principle Review",reviewSubtitle:"Review the principles distilled from observed behavior.",reviewDescription:"These are not cold rules \u2014 they are behavioral principles your Agent has distilled from real use.",viewNavLabel:"Principles views",tabWorkspace:"Workspace Principles",tabCore:"PD Core Principles",coreSectionTitle:"PRINCIPLES",coreTitle:"PD Core Principles",coreDescription:"These are the built-in principles PD uses to guide how an agent understands problems, makes judgments, and learns from experience. They are provided by the PD Runtime and are not workspace-learned principles.",coreReadOnly:"Read-only",coreLayerFoundational:"Foundational Axioms",coreLayerOperating:"Operating Principles",coreLoading:"Loading\u2026",coreLoadFailed:"Unable to load PD Core Principles",coreRetry:"Retry",metricDeposited:"Deposited Principles",metricActive:"Active Principles",metricLatest:"Last Updated",blockBasis:"Formation Basis",blockBasisFallback:"This principle was distilled from historical behavior calibration. Its detailed source is not yet linked.",contextDisclosure:"Formation and other information",libraryOverview:"Principle overview",openDetails:"View principle details",blockImpact:"Current Impact",blockImpactSeeDecisionView:"Whether this currently shapes behavior is shown on the detail page under current enforcement \u2014 this card does not assert impact from lifecycle status alone.",blockImpactActive:"This principle is currently shaping the Agent's subsequent behavior.",blockImpactPending:"Not yet active \u2014 awaiting Owner confirmation.",blockImpactRejected:"Rejected by Owner \u2014 no longer shapes the Agent's behavior.",blockImpactParked:"Parked \u2014 currently not shaping the Agent's behavior.",blockBehavior:"Behavior Change",blockBehaviorFallback:"No deterministic behavior rule recorded; the principle guides subsequent similar scenarios as a behavioral policy.",govDecision:"Governance Decision",revocationStatusUnknown:"Runtime revocation status cannot be confirmed \u2014 activation query failed. Awaiting recovery.",runtimeDeactivated:"Runtime Revoked",govApproved:"Owner Approved",govPending:"Pending Review",loading:"Loading\u2026",retry:"Retry",statusPending:"Pending",statusApproved:"Approved",statusRejected:"Rejected",statusParked:"Parked",statusCandidate:"Internalizing",emptyTitle:"No principles to review",emptyDescription:"When PD captures behavior deviation signals, principle candidates will appear here for your review.",emptyActionable:"No owner-actionable principles at this time. When PD captures behavior deviation signals, principle candidates will appear here for your review. You can check the Behavior Evidence page to see if PD is actively collecting signals.",noActionableTitle:"No actionable principles right now",noActionableDescription:'All current principles are classified as demo, smoke test, historical, or builtin axioms. Switch to "Show All" to see them.',filterActionable:"Actionable",filterAll:"Show All",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",confidence:"Confidence",evaluabilityLabel:"Evaluability",ownerDecision:{state:{needs_owner_decision:"Needs your decision",processing:"Processing",blocked:"Judgment unavailable",recovery_needed:"Needs recovery",decided:"Decided",no_action:"No action needed"}},languageHintEn:"Generated in English",languageHintZh:"Generated in Chinese",languageHintUnknown:"Language unknown",languageMismatchHint:"This principle was generated in {{lang}}. Review the behavior, not only the wording.",readabilityFallbackTitle:"Principle candidate",readabilityOriginalLabel:"Original technical text",readabilityWarning:{technical_pattern:"Title appears to be a technical pattern. Review the behavior evidence below.",diagnostic_residue:"Title may contain diagnostic residue. Review the full text for context.",title_too_long:"Title is unusually long. The readable summary may be in the text below."},detail:{loading:"Loading\u2026",backToList:"\u2190 Back to list",formationDisclosure:"How this principle formed",fullRule:"Read the complete principle",extraContext:"Other source notes and reflection questions",conclusion:"Conclusion",policyNote:"This is a behavioral policy for future similar scenarios. You can approve, modify, reject, or park it.",modifyWording:"Modify Wording",modifyWordingNote:"Principle modification will be available in a future version",channel:"Activation Channel",channelPromptReversible:"Will activate via prompt channel \xB7 Reversible",whyExists:"Why It Exists",applicableScenarios:"Applicable Scenarios",expectedBehavior:"Expected Behavior",nonApplicableScenarios:"Non-applicable Scenarios",conflictsWithNote:"Conflicts with {{count}} principle(s)",noConflicts:"No known conflicts",sideEffects:"Side Effects",sideEffectsNote:"After approval, activates via prompt channel. Can be rolled back at any time.",evidence:"Evidence",evidenceCount:"Linked to {{count}} evidence record(s)",copyEvidenceId:"Copy evidence ID",evidenceCopied:"Copied",expandTechDetails:"Expand technical details",evidenceIdLabel:"Evidence {{n}} ID",viewEvidenceChain:"View in evidence chain \u2192",ownerReflection:"Three Questions Before Deciding",reflectionQ1:"Does this principle describe behavior I want to see repeatedly?",reflectionQ2:"Do I understand which channel it will activate through?",reflectionQ3:"If it's wrong, do I know how to roll it back?",receipts:{title:"Receipt History",headline:"{{effectCount}} behavior-influence record(s) retained (last {{lastEffectAt}}) \u2014 historical observations, not a claim of current enforcement",headlinePresence:"Context injections recorded \u2014 no matching behavior-effect records yet",counts:"{{effectCount}} behavior effect(s) \xB7 {{presenceCount}} context injection(s)",empty:"No recent records \u2014 this principle has not been triggered at runtime yet.",note:"Two levels: Effect = the principle actually changed behavior (block / auto-correction / agent self-report); Presence = the principle entered task context (gray rows). Presence in a decision \u2260 changed behavior. Self-reports are probabilistic agent claims, listed separately from deterministic events.",unavailableReason:"Receipt history is unavailable right now.",coverage:{label:"Evidence coverage",statusAvailable:"Available",statusDisabled:"Receipt collection disabled",statusUnavailable:"Receipt data unavailable",observedSince:"Observed since {{date}}",observedSinceEmpty:"No records retained",asOf:"as of {{date}}",retention:"retention {{days}} days",limitation:"Historical completeness cannot be guaranteed \u2014 counts show currently retained evidence, not full history.",validationPartial:"Some records could not be displayed.",validationMalformed:"Receipt data requires recovery \u2014 counts may be unreliable.",reasonCodes:{receiptRowsDropped:"some rows were skipped during validation",ledgerLevelInvalid:"records with an invalid level exist",ledgerCountsUnreadable:"counts could not be read"}},kind:{rule_blocked:"Block",auto_correct_applied:"Auto-correct",self_reported:"Agent self-report",prompt_injected:"Context injection"},headlineNone:"No context injection or effect records observed within the current retention window",zeroEffectPresence:"Why 0 effects? Effects need evidence: a block, an auto-correction, or an agent self-report. So far this principle only has context-presence records \u2014 being present in a decision does not mean behavior changed. The first effect record will appear here as runtime evidence accumulates.",zeroEffectNone:"Why both counts are 0: zero means no records observed within the current retention window \u2014 not that nothing ever happened. History outside the retention window or during disabled collection does not appear here. Counts start moving as soon as the principle enters task context or produces its first effect.",presenceMissingNote:"No context-injection (presence) records for this principle within the current retention window; what is listed below are the effect records themselves."},trajectory:"View full trajectory when tracing is needed",stageEvidence:"Evidence",stageDiagnosis:"Diagnosis",stageProposal:"Proposal",stageReview:"Owner Review",stageDeploy:"Deployment Channel",stageBehavior:"Observable Behavior",trajectoryLoadFailed:"Failed to load trajectory data",lifecycleMetrics:"Lifecycle Metrics",lifecycleNote:"Rule quality signal, not equivalent to behavior change",insufficientData:"This principle has no rules or insufficient data to compute lifecycle metrics.",triggered:"triggered",approve:"Approve Principle",park:"Park",reject:"Reject",editAction:"Replace pending version",confirmApprove:"After approval, the principle will activate via prompt channel. Confirm approval?",confirm:"Confirm",cancel:"Cancel",rejectReasonPlaceholder:"Please explain why you reject (required)",approveNoteLabel:"Approval note (optional)",approveNotePlaceholder:"Why you approve \u2014 recorded as the decision note (may be left blank)",editReasonLabel:"Replacement reason (required)",editReasonPlaceholder:"Explain why this pending version needs replacing",editNewArtifactPlaceholder:"Enter validated revision artifact ID",currentArtifactLabel:"Current artifact",confirmReject:"Confirm Rejection",confirmEdit:"Confirm replacement",approved:"Approved / Will activate via prompt channel",rejected:"Rejected",editSucceeded:"Pending version replaced",parked:"Parked",viewActivation:"View activation status",approveFailed:"Approval failed. Please try again later.",partialFailure:"Decision applied, but {{failedCount}}/{{totalCount}} records failed: {{reason}}",rejectFailed:"Rejection failed. Please try again later.",editFailed:"Replacement failed. Please try again later.",unknownFailure:"Check the service logs.",decisionTitle:"Decision Actions",parkUnavailable:"Park is not yet available",reasonDataUnavailable:"Data temporarily unavailable",reasonAlreadyHandled:"Already handled",reasonNoRecords:"No pending approval records",reasonUnsupportedChannel:"Not a supported channel in the current version",unactionableReasonPrefix:"Unactionable reason: ",governance:{title:"Governance status",principleState:"Principle state",process:"Current stage",automation:"Automation",nextAction:"Next safe action",nextActionLabel:"Next action:",blockers:"Needs attention",uncertainty:"Evidence uncertainty",sameReasonCount:"({{n}} in total)",provenance:"Canonical evidence references",timeline:"Governance timeline",timelineEmpty:"No governance events are available yet.",unavailable:"Governance view unavailable",unavailableReason:"The governance evidence could not be validated or loaded safely.",unavailableNextAction:"Refresh once. If this persists, inspect the Console diagnostics before taking an approval action.",none:"None",fact:"Fact",derived:"Derived",actionsNotAuthorized:"No current Owner decision is required.",confidence:{strong:"Source-backed",degraded:"Incomplete evidence"},state:{candidate:"Candidate",active:"Active",archived:"Archived",deprecated:"Deprecated",probation:"Probation"},stage:{generating:"Generating",reviewing:"Reviewing",revising:"Revising",approval:"Approval",activation:"Activation"},automationState:{idle:"Idle",queued:"Queued",running:"Running",retry_scheduled:"Retry scheduled",stalled:"Stalled"},headline:{owner_decision:"Your decision is needed",recovery:"Recovery processing is needed",revision:"PD is revising this principle",processing:"PD is processing this principle",active:"This principle is active",unavailable:"Governance evidence is incomplete",recorded:"Principle recorded"},reason:{approval_pending:"A source-backed approval is waiting for your review.",recovery_required:"The current processing frontier cannot continue automatically.",automatic_revision:"A revision or retry is already in progress.",processing:"The current source-backed task is still running or queued.",activation_active:"At least one validated activation channel is active.",data_incomplete:"Available records cannot establish a complete governance view.",no_current_process:"No current processing or Owner action is recorded."},next:{review:"Review the existing approval actions below.",inspect_recovery:"A historical processing issue exists; inspect recovery info first \u2014 its relation to the current action is unconfirmed, and any decision should rely on the decision view.",wait:"No action is needed now. Wait for PD to finish the current work.",monitor:"No action is needed. Monitor the active behavior channel.",inspect_data:"Inspect the evidence diagnostics and repair the referenced durable record.",none:"No action is needed."},attention:{approval_pending:"Approval pending",task_failed:"Current Runtime task failed",human_review_required:"Runtime requested human recovery review",revision_not_materialized:"Requested revision was not materialized",verdict_missing:"Automated review finished without a durable verdict"},issue:{lineage_not_available:"Canonical lineage is not available yet.",lease_expired_unrecovered:"The current task lease is missing or expired.",ledger_activation_mismatch:"Ledger and activation records disagree.",weak_fact_ignored:"A weak fact was excluded from current authority.",lineage_conflict:"Conflicting lineage evidence was excluded.",lineage_cycle:"A lineage cycle prevents authoritative projection.",lineage_limit_exceeded:"The lineage exceeded the safe projection bound.",metadata_malformed:"A durable record is malformed and was excluded.",timestamp_invalid:"A durable record has an invalid timestamp.",source_unavailable:"The Runtime governance source is unavailable."},timelineCode:{pain_created:"Pain evidence recorded",candidate_generated:"Candidate generated",review_started:"Automated review started",revision_requested:"Revision requested",revision_reopened:"Revision task reopened",approved:"Owner approved",rejected:"Owner rejected",activated:"Channel activated",deactivated:"Channel deactivated",failed:"Runtime task failed",human_review:"Human recovery review requested"}},ownerDecision:{title:"Decision view for this principle",technicalOriginalNote:"The text above is the original technical recommendation; no readable principle statement is available yet (kept verbatim for traceability).",state:{needs_owner_decision:"A decision is waiting for your review",processing:"The system is processing this proposal",blocked:"The system cannot establish a complete governance judgment yet",recovery_needed:"This processing needs recovery",decided:"This proposal already has a completed decision",no_action:"Nothing needs your decision right now"},readsComplete:"All requested sources were read",readsPartial:"Some sources failed to read",incident:"What happened",learned:"The behavior principle the agent learned",sourceTier:"Source: {{tier}} (verbatim)",rationale:"Why PD judged it this way",applicability:"When it applies",expected:"What changes if approved (proposed, not deployed)",enforcementLabel:"Current enforcement",tier:{scribe:"Formal draft (Scribe)",distiller:"Abstracted principle (Distiller)",philosopher:"Candidate principle (Philosopher)",candidate_principle:"Original recommendation"},enforcement:{active:"An enforcement method is currently active (see details below).",deactivated:"The previous enforcement method is deactivated; nothing is enforcing right now.",partial:"Some enforcement methods are still running (see details below).",none:"No enforcement method is active for this principle.",since:"Active (since {{since}})",stopped:"Deactivated"},evidence:"Behavior evidence",uncertainty:"Risks and uncertainty",riskNotAssessed:"No risk assessment has been done; that does not mean there are no risks.",rollback:"How to stop its influence",decision:"Your decision",history:"Decision history",historyState:{approved:"Approved",rejected:"Rejected",cancelled:"Cancelled",pending:"Pending"},channel:{prompt:"context guidance channel",code_tool_hook:"RuleCode enforcement channel",defer_archive:"archive channel"},actionLabel:{approve:"Approve",reject:"Reject",edit_approval:"Replace approval artifact",disable:"Stop this enforcement going forward"},next:{review:"A decision is waiting for your review: read the material above, then approve or reject.",wait:"The system is processing this proposal; please wait.",inspect_data:"The system cannot establish a complete governance judgment yet.",inspect_recovery:"This processing has a historical issue; recovery info can be inspected.",monitor:"This proposal already has a completed decision. Review its enforcement and behavior records.",none:"Nothing needs your decision right now."},blocker:{decision_material_missing:"This subject lacks the information needed for a safe approval; rejection can still be evaluated separately.",lineage_not_available:"Governance identity is not established yet, so the system cannot tell whether your decision is needed.",historical_processing_issue:"{{n}} historical processing issue(s) exist (e.g. failed or retry-waiting tasks); their relation to the current action is unconfirmed."},noActions:"No action is currently available.",unavailable:"The decision view is temporarily unavailable; do not decide based on this page alone.",invalidTarget:"Action target missing; cannot submit.",actionDone:"Submitted.",actionFailed:"Refused: {{detail}} Available actions were refreshed \u2014 decide again from the latest state."},evidenceAudit:{title:"Intervention evidence audit",headline:"Deliveries {{d}} \xB7 Applications {{a}} \xB7 Episodes {{e}} \xB7 Effects {{f}} \xB7 Outcomes {{o}}",unresolved:'{{count}} record(s) reference objects that have not arrived yet (pending association, not "never happened")',sectionDelivery:"Delivery",sectionApplication:"Application",sectionEpisode:"Behavior episode",sectionEffect:"Effect",sectionOutcome:"Outcome",emptySection:"None observed within this scope (not the same as never happened)",pending:"pending association",loading:"Loading\u2026",loadOlder:"Load earlier records",capabilities:"Host capability declarations (Supported / Unsupported / Unknown)",technicalSummary:"Technical details (Phase 1 \xB7 revisions / digests / source identifiers)",technicalNote:"Engineering traceability data: evidence IDs, revision references, payload digests, activation and native lineage. The default view shows records and gaps; these fields do not change the semantics above.",sourceUnknown:"source verifiability unknown",contentRedacted:"content cleared on {{date}}",contentReference:"Content reference: {{resolution}} \xB7 {{principleId}}{{artifactId}}{{payloadDigest}}",referenceResolved:"resolved",referenceUnresolved:"revision unresolved",activationReference:"Activation: {{activationId}}{{activatedAt}}{{snapshotDigest}}",nativeLineage:"Native lineage: {{lineage}}",note:"This section records facts only: delivery confirmation levels, agent self-reports, and runtime facts are listed separately; missing means unknown, not invalid. No success-rate or effectiveness scoring.",unavailable:"Intervention evidence audit unavailable",noPayloadDigest:"no payload digest",noSnapshotDigest:"no snapshot digest",payloadDigestLabel:"payload digest",snapshotDigestLabel:"snapshot digest"}}},activation:{eyebrow:"Activation",title:"Activation Status",subtitle:"Which approved principles are actually in effect? This page shows activation facts \u2014 not claims about behavioral improvement.",summaryActive:"active",summaryInactive:"inactive",summaryNeverActivated:"never activated",boundaryLabel:"Capability boundary",boundaryText:"PD cannot yet count how many times a principle was triggered in subsequent tasks, nor can it automatically judge whether behavior has changed (requires semantic matching and feedback loops; not available in the current version).",sectionActive:"Active Principles",sectionInactive:"Inactive Principles",sectionNeverActivated:"Approved but Never Activated",emptyActive:"No principles are currently active. When you approve a principle, it will appear here with its activation details.",statusActive:"Active",statusInactive:"Inactive",channelPrompt:"Prompt / Reversible",channelDeferArchive:"Defer Archive",channelCodeToolHook:"Code Tool Hook",tagReversible:"Reversible",tagHighRisk:"High Risk",tagNeverActivated:"Never Activated",injectionLabel:"Injection status",budgetObservedNote:"The budget figures in the injection status come from the most recent runtime observation (source {{source}}, context {{window}} tokens, observed at {{observedAt}}), not a live confirmation.",budgetFallbackNote:"The injection status is estimated with the fixed fallback budget ({{reason}}{{observed}}).",injectionInjectable:"Injectable (in current window, {{cost}}/{{budget}} chars)",injectionWindowRotates:"Out of window this turn: fits alone ({{cost}}/{{budget}} chars); rotation will reach it in later turns (forecast)",injectionWindowFifo:"Out of window this turn: fits alone ({{cost}}/{{budget}} chars); this route does not rotate, capacity must free up first",injectionOversized:"Oversized, not injectable: {{cost}} chars alone > {{budget}} cap \u2014 rotation cannot help; shorten the statement",injectionResolutionFailed:"Cannot determine: {{reason}}",injectionRouteUnconfirmed:"Host capacity unconfirmed: OpenClaw {{oc}} / Codex {{cx}} / WorkBuddy {{wb}}",revisionOpen:"Modify to injectable version",revisionPlaceholder:"Enter the new principle statement (keep trigger, required action, and necessary exception; be concise)",revisionSubmit:"Create pending new version",revisionQueued:"New version created and queued for approval; approving it replaces the current version automatically",revisionAlreadyPending:"This principle already has a pending revision approval",revisionFailed:"Failed to create the revision: {{reason}}",revisionFailedNetwork:"Failed to create the revision, please retry.",revisionResultNote:"The new version is pending approval ({{approvalId}}). Approving it deactivates and replaces the old version automatically; rejecting keeps the old version in effect.",revisionDiff:"View statement diff",revisionGoApprove:"Go to governance focus to approve the new version",principleLabel:"Principle",actionLabel:"Action",targetLabel:"Target",activatedAtLabel:"Activated",neverActivated:"Never activated",neverActivatedCard:"Approved but never activated",lifecycleToggle:"View lifecycle metrics",lifecycleUnavailable:"Lifecycle metrics are unavailable for this principle.",insufficientData:"This principle has no rules or insufficient data to compute lifecycle metrics.",adherenceLabel:"adherence",lifecycleNote:"Rule quality signal, not equivalent to behavior change",triggered:"triggered",disableAction:"Disable",confirmDisable:"After disabling, the principle will no longer influence agent behavior. Confirm disable?",disabling:"Disabling\u2026",disableSuccess:"Principle disabled",disableSuccessDescription:"Principle {{id}} has been deactivated.",disableFailed:"Failed to disable principle",undoDisable:"Disable action cancelled",viewDebt:"View in Principle Debt",loadError:"Unable to load activation data. You can try refreshing the page.",receiptsLabel:"Receipts",receiptsValue:"{{effect}} behavior effect(s) \xB7 {{presence}} context injection(s)",receiptsUnavailable:"Receipt history unavailable: {{reason}}",ownerDecisionTitle:"Owner Live Decision",ownerDecisionRecorded:"RuleCode decision recorded",ownerDecisionLoading:"Loading safety evidence\u2026",safetyIsolation:"Safety Isolation",runtimeCapability:"Runtime {{version}} \xB7 shadow evidence {{supported}}",supported:"supported",unsupported:"Unsupported",checks:{bounded_scope:"Bounded Tool Scope",runtime_compatibility:"Runtime Compatibility",host_liveness_composition:"Host Liveness Composition",emergency_controls:"Emergency Controls Health",runtime_shadow_evidence:"Runtime Shadow Evidence",owner_identity_configuration:"Owner Identity Configuration",activation_eligibility:"Activation Eligibility",lineage_binding:"Lineage & Artifact Binding",production_compile_load:"Production Compile & Load",golden_trace:"Golden Trace Evaluation",evidence_binding:"Evidence Binding"},checkStatus:{passed:"Passed",failed:"Failed"},reasonCodes:{required_check_missing:"Required safety check result missing",duplicate_check_result:"Duplicate check result recorded",runtime_shadow_evidence_unsupported:"Host runtime does not support shadow evidence collection",explicit_affected_tools_required:"Explicit affected tools must be defined",host_liveness_contract_missing_invalid_or_unsupported:"Host liveness contract is missing, invalid, or unsupported",neutral_probe_or_live_composition_failed:"Neutral probe or live composition check failed",neutral_probe_blocked:"Neutral probe was blocked by RuleCode",safety_controls_disabled:"Durable RuleCode safety controls are disabled",out_of_band_controls_unavailable:"Out-of-band emergency controls are unavailable",configured_owner_missing:"Configured Owner credential is missing or unverified",unresolved_shadow_unhealthy_evidence:"Unresolved runtime errors recorded during shadow observation",shadow_telemetry_source_unavailable:"Shadow telemetry source is missing or unreadable",artifact_digest_mismatch:"Artifact digest does not match the active version",active_shadow_activation_required:"Active shadow activation required for promotion",activation_not_unique:"Multiple active activations found",activation_artifact_mismatch:"Activation artifact does not match review subject",artifact_lineage_missing:"Artifact lineage (source task or parent artifacts) is missing",artifact_not_found:"Artifact not found in safety store",hard_check_failed:"Hard safety check failed",promotion_safety_gate_blocked:"Promotion blocked by safety gate checks",promotion_readiness_unavailable:"Promotion readiness could not be established",promotion_snapshot_stale:"Activation artifact changed during review",evidence_override_reason_required:"Evidence-insufficient promotion requires an Owner override reason",evidence_override_note_required:"Evidence-insufficient promotion requires an Owner review note",host_contract_unavailable:"Host liveness contract unavailable",promotion_commit_failed:"Failed to commit promotion to durable safety store",feature_not_enabled:"Feature is not enabled",safety_controls_unavailable:"Safety controls unavailable",owner_authentication_required:"Owner authentication required",cli_owner_note_required:"CLI promotion requires an Owner review note",confirmation_required:"Live enforcement confirmation required",promotion_request_invalid:"Promotion request parameters are invalid"},hardSafetyChecks:"Promotion Safety Checks",live24Hours:"Live monitoring \xB7 24 hours",live7Days:"Live monitoring \xB7 7 days",matched:"Matched",blocked:"Blocked",unhealthy:"Unhealthy",circuitTrips:"Circuit trips",behaviorDrift:"Behavior drift \xB7 approved block rate {{approved}} \xB7 live block rate {{live}} \xB7 delta {{delta}}",ownerDecisionHistory:"Owner and safety decision history",toolDistribution:"Tool distribution",representativeSamples:"Redacted representative samples",circuitConditions:"Circuit breaker isolates on protected-control matches, health failures, 3 consecutive errors, 5 broad consecutive blocks, >80% outside-scope blocking in 20 calls, or a failed neutral probe. It never auto-reactivates.",worstImpact:"Worst plausible impact: matching calls to {{tools}} can be blocked; PD control and recovery surfaces remain outside RuleCode authority.",eligibleEvaluations:"Eligible",wouldBlock:"Would block",wouldAllow:"Would allow",requireApproval:"Would require approval",autoCorrect:"Would auto-correct",neutralControl:"Neutral controls",shadowWindow:"Shadow window: {{first}} \u2014 {{last}}",overrideReason:"Why is limited evidence acceptable?",overrideRareBehavior:"Rare behavior",overrideControlledRollout:"Controlled rollout",overrideOwnerAccepts:"Owner accepts limited evidence",evaluationErrors:"Errors",notCollected:"Not collected",scopeArtifactCode:"Scope, artifact and implementation",ruleRevisionTitle:"Revise this rule for a new review",ruleRevisionReviewQueue:"View review queue",ruleRevisionBoundary:"Revise once using this feedback. Existing code and approvals are preserved. New code requires fresh approval and will not activate automatically.",ruleRevisionFeedback:"Required correction (up to 4000 characters)",ruleRevisionOnce:"Revise once with feedback",ruleRevisionStarted:"Revision queued. The result will appear for review; the current rule stays in shadow.",ruleRevisionAlreadyExists:"This artifact already has a revision; this request did not start a new one.",ownerReviewNote:"Owner review note",continueObserving:"Continue observing",rejectAfterShadow:"Reject and deactivate",confirmLive:"Confirm live enforcement",emergencyDeactivate:"Emergency deactivate",recoverToShadow:"Recover to a new Shadow",releaseGlobalPause:"Release global pause (do not restore rules)",globalPauseReleased:"Global pause latch released; isolated rules remain stopped",rolloutDisabled:"Owner decision rollout is disabled; emergency stop remains available.",pauseAll:"Pause all Live RuleCode",pauseAllSucceeded:"All live RuleCode enforcement paused",pendingRules:"Rules awaiting live decision",pendingRulesDescription:"Shadow Observation has produced a separate Owner Live Decision queue.",safetyAlerts:"Safety alerts",safetyAlertsDescription:"These rules are isolated and fail-open; they never return live automatically.",legacyUnknown:"Historical live activation / decision maker unknown. Review by {{due}}; PD will not fabricate Owner identity.",sevenDays:"within 7 days",footer:"This page shows activation facts \u2014 which principles are in effect and through which channels.",fitUnknown:"unknown",fitYes:"fits",fitNo:"oversized"},approvals:{title:"Approval",description:"Review and approve principle activation requests",loadFailed:"Failed to load approvals",detailFailed:"Failed to load approval details",approveFailed:"Failed to approve",rejectFailed:"Failed to reject",emptyHint:"No approval requests pending. Approvals will appear when principles are ready for activation."},reportProblem:{eyebrow:"Product Feedback",title:"Report a Problem",subtitle:"Generate a privacy-preserving local feedback draft. The Console never auto-uploads \u2014 you choose what to share, how to share it, and when.",noAutoUpload:"This Console never auto-uploads feedback. Drafts are stored locally only.",loadError:"Unable to load feedback data. You can try refreshing the page.",description:"Generate a privacy-preserving local feedback draft. The Console never auto-uploads \u2014 you choose what to share, how to share it, and when.",deepLinked:"Deep-linked from {{source}}.",entryFeedback:"Feedback",form:{title:"Describe what happened",description:"Only fields below are stored. Raw prompts, chat history, file contents, paths, env vars, and tokens are excluded by default.",type:"Type",severity:"Severity",severityNotSet:"Not set",severityLow:"Low",severityMedium:"Medium",severityHigh:"High",blockingLevelLabel:"How much does it block you",blockingLevelNotSet:"Not set",blockingLevelBlocked:"Blocked me",blockingLevelWorkaround:"Workaround possible",blockingLevelMinor:"Doesn't affect me",frequencyLabel:"How often does it occur",frequencyNotSet:"Not set",frequencyAlways:"Every time",frequencyOften:"Often",frequencySometimes:"Sometimes",frequencyOnce:"Once",goalLabel:"What were you trying to do",stuckAtLabel:"Where did you get stuck",jobLabel:"What goal are you trying to achieve",currentWorkaroundLabel:"How do you work around it now",sawWhatLabel:"What did you see that worried you",whereSeenLabel:"Where did you see it",detailsToggle:"Additional details",detailsHide:"Collapse details",titleLabel:"Title",descriptionLabel:"Description",stepsLabel:"Steps to reproduce (optional)",expectedLabel:"Expected behavior (optional)",actualLabel:"Actual behavior (optional)",submit:"Save local draft",submitting:"Saving\u2026",hidePreview:"Hide markdown preview",showPreview:"Show markdown preview",types:{bug:"Bug",confusing:"Confusing",privacy_concern:"Privacy concern",feature_request:"Feature request",other:"Other"}},privacy:{title:"Privacy boundary",description:"What this report will and will not include.",included:"Included",excluded:"Excluded by default",notes:"Redaction notes",submitFirst:"Save a draft to see exactly which sections are included.",guarantee:"No automatic upload. Drafts are stored at <workspace>/.pd/feedback/drafts/. You decide what to do with them."},draft:{title:"Draft saved locally",savedAt:"id: {{id}} \xB7 saved at {{at}}",copyMarkdown:"Copy Markdown",copyEmail:"Copy email text",openGithub:"Open GitHub issue URL",openEmail:"Open Email",delete:"Delete draft",sentBadge:"Sent",draftBadge:"Pending",markAsSent:"Mark as sent"},channel:{title:"Send feedback",description:"This feedback is redacted and contains only what you filled in above. The Console never auto-uploads \u2014 clicking a button is your explicit submission.",ingest:"Submit in one click (recommended)",github:"Submit as a GitHub issue",email:"Open email",file:"Export file",disablingReason:"Unavailable: {{reason}}",confirmTitle:"Confirm sending feedback",confirmDescription:"After submitting, this redacted feedback will be sent to the maintainer feedback service. You cannot undo it, but you can delete the local draft afterwards.",confirmBodyLabel:"Content to send",confirmSubmit:"Confirm send",confirmCancel:"Cancel",receiptTitle:"Submitted",receiptTrackingId:"Tracking id",openIssue:"View issue",alreadySubmitted:"This draft was already submitted and was not re-submitted.",writeBackNote:"Submission complete, but status write-back failed. Please record the receipt manually."},saved:{title:"Saved drafts",load:"Load"},toast:{draftCreated:"Draft saved locally",draftDeleted:"Draft deleted",markdownCopied:"Markdown copied to clipboard",emailCopied:"Email text copied to clipboard",copyFailed:"Copy failed",loadFailed:"Failed to load draft",deleteFailed:"Failed to delete draft",submitSucceeded:"Submitted. Tracking id {{trackingId}}",submitFailed:"Submission failed",markSentSucceeded:"Marked as sent",channelsFailed:"Could not load send channels"},errors:{missingRequired:"Title and description are required.",createFailed:"Failed to create draft."}},settings:{eyebrow:"Settings",title:"Settings",subtitle:"Manage authentication and workspace configuration for the governance workspace.",auth:"Authentication",bearerToken:"Bearer Token",enterAccessToken:"Enter access token",tokenSaved:"Token saved",tokenSavedRestarting:"Token encrypted and saved; restarting Console to apply it\u2026",tokenSaveFailed:"Token was not saved. Check desktop encryption and Console status, then retry.",tokenExternalAttached:"Token saved, but an external Console is still connected.",tokenSessionOnly:"Token is stored in browser session only.",tokenDesktopStored:"Desktop: encrypted with the Windows system store.",clearToken:"Clear credential",clearTokenConfirm:"Confirm clear",tokenCleared:"Credential cleared",tokenClearedRestarting:"Credential cleared; restarting Console without authentication\u2026",tokenClearedSession:"Browser session token cleared.",tokenClearedExternalAttached:"Companion credential cleared, but the externally started Console still requires its token.",tokenInheritedEnv:"The token comes from the PD_CONSOLE_TOKEN environment variable set outside PD; clearing is not durable \u2014 it will return on the next launch. Remove the variable at its source (launcher/terminal).",tokenClearFailed:"Failed to clear the credential.",ownerIdentity:{title:"Owner identity",intro:"The Owner identity gates governance decision entry points (RuleCode promotion, emergency pause, etc.). Register to ~/.pd/owner.json (install-level, shared across workspaces). If the PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID environment variables are set together, they take precedence as a pair.",loading:"Loading\u2026",statusConfigured:"Registered",statusMissing:"Not registered",statusInvalid:"Env configuration invalid",sourceEnv:"Source: environment variables (highest priority)",sourceFile:"Source: ~/.pd/owner.json",sourceInvalid:"Source: environment variables (incomplete pair)",sourceNone:"Not registered",governanceReady:"Governance: Ready",governanceNotReady:"Governance: Not ready",governanceReasonTokenAuth:"Console token authentication is required before any Owner governance action can execute.",governanceReasonIdentity:"A complete Owner identity is required before any Owner governance action can execute.",governanceNextActionTokenAuth:"Next action: start pd-console with --token <value> or set PD_CONSOLE_TOKEN, then retry.",invalidEnvHint:"PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID must be set together and both non-empty. Until the pair is completed or both variables are removed, no Owner authority is active \u2014 the file registration is NOT in effect.",ownerIdLabel:"Owner ID",credentialIdLabel:"Credential ID",register:"Register",unregister:"Unregister",registeredAt:"registered",envHint:"The identity currently comes from environment variables. To switch to file registration, remove the env vars and restart the console.",required:"Owner ID and Credential ID must not be empty.",operationFailed:"Operation failed. Please retry.",registered:"Owner identity registered.",unregistered:"Owner identity unregistered."},workspace:"Workspaces",addWorkspace:"Add Workspace",syncWorkspace:"Sync",removeWorkspace:"Remove",workspaceAdded:"Workspace added",workspaceRemoved:"Workspace removed",confirmDeleteTitle:"Remove Workspace",confirmDeleteDescription:'Remove workspace "{{name}}"? This cannot be undone.',name:"Name",path:"Path",lastSync:"Last Sync",loadError:"Unable to load settings. You can try refreshing the page.",addNamePlaceholder:"Workspace name",addPathPlaceholder:"Workspace path",principleLanguage:"Principle Language",principleLanguageDescription:"Save your language preference for principle display. Generation integration is deferred.",languageZhCN:"\u4E2D\u6587 (Chinese)",languageEn:"English",languageSaved:"Language preference saved",languageLoadError:"Failed to load language preference",notifications:"Notifications",soundAlerts:"Sound alerts",soundAlertsDescription:"Play a sound when new approvals or degraded signals arrive"},controlCenter:{eyebrow:"Control Center",title:"Config Readiness",subtitle:"PD can only work when configuration is complete. This page shows config readiness \u2014 not a system health dashboard.",designGate:{title:"Local Codex Design Declaration",description:"Record an Owner decision for a SPEC and an observed native Codex session. The server verifies the session and SPEC snapshot; it does not prove that implementation matches natural-language intent.",loadingSessions:"Loading observed Codex sessions\u2026",noSessions:"No native Codex sessions have been observed for this workspace yet. Open a Codex session with PD observation enabled, then refresh.",refresh:"Refresh",loadingDeclaration:"Loading the latest declaration\u2026",nativeSession:"Observed native session",noDeclaration:"No declaration exists for this session. Record the SPEC, covered paths, actions, and an explicit Owner decision.",specPath:"SPEC file path",specPathHint:"Relative to the selected project workspace, or an absolute path inside it",scopePathsInput:"Project-relative paths covered by this declaration (one per line)",scopePathsHint:"packages/example/src/file.ts",scopePathsHelp:"Use . for the project root. With Execute, . covers command invocations originating in this native project/session; it does not sandbox process effects or prove filesystem containment.",scopeActionsInput:"Actions covered",initialDecision:"Owner decision",decisions:{approved:"Approved",notApproved:"Not approved",notRequired:"Approval not required"},actions:{read:"Read",write:"Write",execute:"Execute"},decision:"Decision:",revision:"Revision:",spec:"SPEC:",specDigest:"SPEC snapshot digest:",scopePaths:"Covered paths:",scopeActions:"Covered actions:",owner:"Recorded by Owner:",decidedAt:"Recorded at:",revoked:"Revoked",revokedLatest:"The latest declaration is revoked (revision {{revision}}). You can record a new declaration for this session.",semanticLimit:"This Owner declaration is bound to the shown SPEC snapshot, project, session, and paths/actions. Execute with . covers commands originating in this native project/session; it does not sandbox process effects or prove filesystem containment. Host operations outside a reliably classified path/action scope remain unknown. This declaration does not prove that code satisfies the SPEC\u2019s natural-language meaning.",requiredFields:"Enter a SPEC path, at least one covered path, and one or more actions.",invalidMutationResponse:"The server returned no declaration after a successful change. Refresh before continuing.",approve:"Approve this scope",markPending:"Mark not approved",revoke:"Revoke declaration",saving:"Saving\u2026",create:"Record declaration"},configReady:"Configuration complete. All enabled agents are ready.",configNeedsSetup:"Some agents need configuration before they can run.",configNotReady:"Some agents cannot run. Check configuration errors below.",configUnknown:"Configuration status is unknown. Check your setup.",configDisabled:"All agents are disabled.",configErrors:"Configuration Errors",internalAgents:"Internal Agents",internalAgentsDescription:"Each PD internal agent runs on the runtime profile you configure \u2014 provider, model, and the name of the environment variable holding your API key. Keys stay outside PD.",defaultRuntime:"Default Runtime",defaultRuntimeDescription:"The default runtime profile for agents without explicit overrides.",advancedDiagnostics:"Advanced Diagnostics",features:"Features",runtimeProfiles:"Runtime Profiles",warnings:"Warnings",copyDiagnostics:"Copy Diagnostics",redactedNote:"Secrets and API keys are redacted from copied output.",on:"On",off:"Off",saving:"Saving\u2026",saveFailed:"Save failed",loadError:"Unable to load configuration data. You can try refreshing the page.",agentEnabled:"Enabled",agentDisabled:"Disabled",profileLabel:"Profile",readinessLabel:"Readiness",workflow:{title:"PD Behavior Loop",subtitle:"From error to principle, from principle to change",phase01:"Detect Error",phase01Desc:`Observe Agent behavior
16
16
  Identify patterns to improve`,phase02:"Form Principle",phase02Desc:`Distill experience into
17
17
  a followable principle`,phase03:"Owner Approval",phase03Desc:`You decide which principles
18
18
  can take effect`,phase04:"Change Behavior",phase04Desc:`Principle acts on
19
- Agent's next behavior`,loopHint:"After behavior changes, PD keeps observing \u2014 forming a closed loop. 9 agents are distributed across this loop, each with its own role."},status:{enabled:"Enabled",notReady:"Not Ready",corePipeline:"Core Pipeline",corePipelineOk:"OK",corePipelineDegraded:"Degraded",corePipelineParalyzed:"Paralyzed",needsConfig:"Needs Config"},groups:{coreTrio:"Core Trio",coreTrioTag:"Must together",coreTrioHint:"Disabling any one breaks the error-to-principle pipeline",codeChain:"Code Chain",codeChainTag:"Recommend together",codeChainHint:"Only artificer degrades to prompt-only; only evaluator is meaningless",qualityPolish:"Quality Polish",qualityPolishTag:"Optional \xB7 toggle individually",qualityPolishHint:"Refines principles; disabling is fine, just slightly rougher quality",sidechain:"Sidechain",sidechainTag:"Independent \xB7 toggle individually",sidechainHint:"Does not affect the main pipeline; only pain signal detection precision"},impact:{label:"If disabled",confirmTitle:"Confirm disabling core agent",confirmAck:"Confirm disable",confirmCancel:"Cancel"},techDetail:"Technical Details",profileLabelShort:"Runtime",manageProfiles:"Manage Profiles",readinessChecking:"Checking readiness\u2026",unknownAgentsWarning:"Detected {{count}} unrecognized agent(s): {{names}}. They are not shown in groups.",footerNote:"9 agents are distributed across the internalization pipeline and sidechain services. The Core Trio must be enabled together \u2014 otherwise PD cannot turn errors into principles.",profiles:{sectionTitle:"Runtime Profile Management",sectionDescription:"Create, edit, and delete runtime profiles. Profiles referenced by an agent or set as default cannot be deleted.",createButton:"Create Profile",editButton:"Edit",deleteButton:"Delete",cancelButton:"Cancel",saveButton:"Save",creating:"Creating\u2026",saving:"Saving\u2026",deleting:"Deleting\u2026",empty:"No runtime profiles yet.",columnId:"ID",columnType:"Type",columnProvider:"Provider",columnModel:"Model",columnApiKeyEnv:"API Key Env Var",columnReadiness:"Readiness",columnActions:"Actions",formTitleCreate:"Create Runtime Profile",formTitleEdit:"Edit Profile: {{id}}",fieldId:"Profile ID",fieldIdHint:"Unique identifier, cannot be changed after creation (e.g. anthropic-cloud)",fieldIdPlaceholder:"my-profile",fieldProvider:"Provider",fieldProviderPlaceholder:"anthropic",fieldModel:"Model",fieldModelPlaceholder:"claude-sonnet-4",fieldApiKeyEnv:"API Key Env Var Name",fieldApiKeyEnvHint:"Environment variable name, not the key value (e.g. ANTHROPIC_API_KEY)",fieldApiKeyEnvPlaceholder:"ANTHROPIC_API_KEY",fieldBaseUrl:"Base URL (optional)",fieldBaseUrlPlaceholder:"https://api.anthropic.com",retiredBadge:"retired",validationIdRequired:"Profile ID is required",validationProviderRequired:"pi-ai profile requires provider",validationModelRequired:"pi-ai profile requires model",validationApiKeyEnvRequired:"pi-ai profile requires apiKeyEnv",deleteConfirmTitle:"Confirm Delete",deleteConfirmMessage:'Delete profile "{{id}}"? This action cannot be undone.',deleteConfirmAck:"Confirm Delete",deleteConfirmCancel:"Cancel",createSuccess:"Profile created",updateSuccess:"Profile updated",deleteSuccess:"Profile deleted",operationFailed:"Operation failed"}},login:{title:"Login",description:"Login to PD Governance Workspace",slogan:"Turn repeated corrections into governed principles",connectWorkspace:"Connect to PD Workspace",detecting:"Detecting local Companion\u2026",connecting:"Connecting to PD Workspace\u2026",accessToken:"Access token",enterAccessToken:"Enter the access token to connect",connect:"Connect",errorInvalid:"Invalid access credential or service not ready. Check and retry.",errorExpired:"Session expired or token invalid. Please re-enter.",recoveryTitle:"Cannot connect to PD Workspace",recoveryReason:"Reason: the stored Owner credential has expired or does not match the local Console.",reconnect:"Reconnect",manualEntry:"Enter access token manually",manualEntryHint:"A manually entered token updates the credential saved in Companion.",readFailedTitle:"Companion credential read failed",readFailedHint:"Could not read the credential saved by Companion (possible version mismatch). Please enter the token manually; if this persists, restart Companion.",persistFailed:"Connected, but the credential was not securely saved \u2014 the token will be needed again next time.",persistSucceeded:"Owner credential securely saved by Companion; the next open will connect automatically.",persistAttached:"Credential saved, but the Console in use was started externally \u2014 restart Companion to apply it.",tokenSessionOnly:"Token is stored in browser session only.",noAuthFlag:"Use --no-auth flag to disable authentication."},update:{eyebrow:"Updates",title:"Updates",subtitle:"Check for PD updates and view update history. Updates keep your governance workspace current.",currentVersion:"Current Version",latestVersion:"Latest Version",upToDate:"Up to date",updateAvailable:"Update available",checkForUpdates:"Check for Updates",checking:"Checking\u2026",history:"Update History",noHistory:"No update history available.",version:"Version",failed:"Failed",historyKind:{update:"Update",reinstall:"Reinstall",legacy_migration:"Legacy migration",rollback:"Rollback",refusal:"Refused",failure:"Failed",recovery:"Recovery",unknown:"Unknown operation"},checkError:"Check error",syncPending:"Version {{pluginVersion}} is published, but the installer is syncing (you can update to the version shown above for now). Please try again later.",identityDivergence:"Version divergence: the active release is {{active}}, while the plugin directory holds {{plugin}}. The active release stays authoritative; run the official installer if you want the copies re-synced.",loadError:"Unable to load update data. You can try refreshing the page.",checkFailed:"Update check failed. Please try again later.",blockedBadge:"Action needed",reasonLabel:"Reason: ",recoveryBanner:"An unfinished update transaction was found",recoveryItem:'Transaction {{id}} stopped at phase "{{phase}}"',recoveryRequiredBanner:"A failed update left the installation inconsistent (recovery required)",recoveryRequiredItem:"Failed transaction {{id}} needs recovery \u2014 re-run the official installer",inProgressToast:"Update transaction accepted and running in the background; do not click again.",inProgressPanel:"Update in progress",inProgressPhase:"Current phase: {{phase}}",inProgressConfirmed:"Update finished ({{version}}). Restart the console to load the new version.",inProgressEnded:"Update transaction ended: {{state}}",inProgressTimeout:"The update is taking long and its result is unconfirmed. Check the transaction in the update history later.",reason:{bootstrap_too_old:"The update bootstrap component on this machine is too old for this release. Run the official installer (npx create-principles-disciple) to repair, then retry.",bootstrap_not_registered:"The update bootstrap is not registered on this machine (older install). Run the official installer to repair, then retry.",bootstrap_manifest_corrupt:"The update bootstrap registration file is corrupt. Run the official installer to repair, then retry.",bootstrap_identity_mismatch:"The update bootstrap registration does not match the deployed files. Run the official installer to repair, then retry.",metadata_source_unconfigured:"The official update source is not registered: this machine has no signed-release address to check against. Run the official installer once with the update source address to register it.",install_state_corrupt:"The installation state file is corrupt. Run the official installer to repair, then retry.",journal_not_supported:"The update transaction directory is unavailable. Check disk space and permissions for ~/.pd/transactions, then retry.",installer_missing:"Update components are unavailable. Run the official installer to repair, then retry.",bootstrap_not_installed:"No valid installation detected. Install PD with the official installer first.",downgrade_blocked:"The target version is older than the installed one; downgrades are refused by default.",sequence_regression:"The target release sequence is not newer than the current one; refused to prevent rollback.",channel_pointer_mismatch:"The signed channel pointer disagrees with the release content. Retry later; contact the maintainer if it persists.",release_metadata_expired:"The release metadata has expired. Wait for an official re-publication, then retry.",channel_metadata_expired:"The channel metadata has expired. Wait for an official refresh, then retry.",legacy_layout_not_supported:"This installation uses the legacy layout. Run the official installer to migrate to the supported layout.",metadata_refresh_failed:"Could not fetch or verify the signed release metadata. Check your network and retry.",destructive_migration_requires_maintenance:"This release contains a destructive data migration and cannot ship through an ordinary update. Use the official maintenance workflow to migrate your data."},applyUpdate:"Update Now",updating:"Updating\u2026",updateFailed:"Update failed: {{message}}",networkErrorHint:"Please check your network connection and try again.",retry:"Retry",applyFullUpdate:"Full Update",fullUpdateSuccess:"Full update completed.",confirmFullUpdateTitle:"Confirm Update",confirmFullUpdateDesc:"Downloads and updates all PD packages (plugin, console, core, CLI). Usually takes just a few seconds. Your custom files (AGENTS.md etc.) are not affected. You will need to restart the console after completion.",fullUpdateRestartPrompt:"Update complete. Please restart the console to load the new version: press Ctrl+C, then run pd console again."},intent:{eyebrow:"Owner Intent",title:"Owner Intent Document",subtitle:"A single-page anchor for what the owner wants, what must not be violated, and where to escalate. Read by PD only when the intent_engineering flag is on.",flagStatus:{enabled:"Flag on",disabled:"Flag off",ariaLabel:"intent_engineering feature flag status",enable:"Enable Intent Engineering",enabling:"Enabling\u2026",enableFailed:"Failed to enable. Try again later or manually edit .pd/config.yaml"},editEntry:{heading:"Edit INTENT.md",title:"Owner-owned document",description:"PD never modifies this file. Edit it in your own editor to declare or revise your intent.",copy:"Copy path",copyAriaLabel:"Copy INTENT.md file path to clipboard"},flagDisabled:{title:"Intent Engineering is off",description:"The intent_engineering feature flag is disabled. PD is not reading INTENT.md, not injecting intent context into prompts, and not surfacing intent tension in diagnosis. This is the default quiet state."},notFound:{title:"No INTENT.md found",description:"PD did not find an INTENT.md file in the .principles/ directory. Without this anchor, intent-grounded diagnosis cannot run.",nextAction:"Run: pd intent init --confirm --workspace <path>",createButton:"Create INTENT.md",creating:"Creating\u2026",createFailed:"Creation failed, please try again later",createSuccess:"INTENT.md created. You can start filling in your intent."},onboarding:{title:"Welcome to Intent Engineering",subtitle:"Before we begin, let's understand what intent engineering is",whatIsIt:{title:"What is Intent Engineering?",description:"INTENT.md is your long-term intent anchor \u2014 recording your goals, non-negotiable boundaries, and when to stop and escalate. It helps PD align with your true intent at key decision points."},whyYouFill:{title:"Why do you need to fill it in?",description:"Intent is Owner-owned. PD will not auto-generate intent because only you know the project's real goals and boundaries. This is your decision authority; PD only helps you execute and align."},sectionGuide:{title:"5-section guide",description:"INTENT.md contains 5 sections, each with a clear purpose:",sections:{why:"Why \u2014 the fundamental motivation for this project",desiredOutcome:"Desired Outcome \u2014 the specific results you want to achieve",nonNegotiables:"Non-Negotiables \u2014 boundaries that must never be violated",stopEscalation:"Stop / Escalation \u2014 when to stop the current action and escalate to you",currentStrategicFocus:"Current Strategic Focus \u2014 phase-specific priorities"}},skipOption:"Skip guide, create empty template to fill in later",startFilling:"Start filling",skip:"Skip",close:"Close",dontShowAgain:"Don't show again"},editor:{title:"Edit INTENT.md",description:"Edit your intent document directly in the browser. Changes take effect immediately after saving.",placeholder:"Enter INTENT.md content here (Markdown format)\u2026",save:"Save",saving:"Saving\u2026",cancel:"Cancel",edit:"Edit",saveSuccess:"INTENT.md saved",saveFailed:"Save failed, please try again later",emptyContent:"Content cannot be empty",oversized:"Content exceeds 32KB limit, please trim and retry",confirmDiscard:"You have unsaved changes. Discard them?",yes:"Yes, discard changes",no:"Continue editing"},oversized:{title:"INTENT.md exceeds 32KB",description:"The file is larger than the 32KB cap. PD refuses to read oversized files to keep intent parsing deterministic and bounded.",nextAction:"Trim INTENT.md to under 32KB. Move long-form strategy to a separate doc."},sections:{why:"Why",desiredOutcome:"Desired Outcome",nonNegotiables:"Non-negotiables",stopEscalation:"Stop / Escalation",currentStrategicFocus:"Current Strategic Focus"},warnings:{title:"Health Warnings",empty:"No warnings. INTENT.md is well-formed.",missing_section:"Missing section",empty_section:"Empty section",too_vague:"Section too vague (under 10 characters)",oversized:"Document exceeds 32KB cap",parse_failed:"Section failed to parse"},meta:{title:"Document Metadata",lastEditedAt:"Last edited",contentHash:"Content hash",path:"Path",templateTitle:"INTENT.md Template",templateDescription:"Copy this into .principles/INTENT.md. Replace placeholders with your intent."},loadError:"Failed to load intent document",validationError:"Data format validation failed, please refresh and retry",decisions:{sectionTitle:"Owner Decisions",sectionSubtitle:"Lightweight audit summary derived from IntentDecisionRecord. Not a dashboard.",countConfirmDrift:"Confirm drift",countReviseIntent:"Revise intent",countObserve:"Observe",countDismiss:"Dismiss",countPromoteToPrinciple:"Promote to principle",countPromoteToRulehost:"Promote to RuleHost",lastDecisionAtLabel:"Last decision",noDecisions:"No decisions recorded yet",loadError:"Failed to load decision summary"},langSelector:{ariaLabel:"Select INTENT.md language",disabledWhileEditing:"Save or cancel your edit before switching language"},versionHistory:{title:"Version History",reasonInit:"Initialized",reasonSave:"Saved"},wizard:{progressLabel:"Step {{current}}/5",next:"Next",prev:"Previous",finish:"Finish",review:"Review",complete:"Complete",cancel:"Cancel",emptyWarning:"This section cannot be empty. Please fill it in before continuing.",stepLabels:{why:"1. Why",desiredOutcome:"2. Desired Outcome",nonNegotiables:"3. Non-negotiables",stopEscalation:"4. Stop / Escalation",currentStrategicFocus:"5. Current Strategic Focus"},guidance:{why:"Explain why this project matters. What does the Owner care about? What happens if it is not solved?",desiredOutcome:"Describe an observable change. After completion, what will be better?",nonNegotiables:"List hard constraints that cannot be violated (compliance / safety / boundaries).",stopEscalation:"Under what circumstances should the Agent stop and escalate to the Owner instead of pushing forward?",currentStrategicFocus:"What is the top priority for the current phase? (Will be updated as phases change.)"},discardConfirmTitle:"Discard your input?",discardConfirmBody:"Content you have entered will be lost and cannot be recovered.",discardConfirmCancel:"Continue editing",discardConfirmConfirm:"Discard"},versionDiff:{changed:"Changed",unchanged:"Unchanged",oldPreview:"Previous version",newPreview:"New version",expandHint:"Click to view section-level diff",collapseHint:"Click to collapse diff"}},examiner:{loading:"Loading Examiner\u2026",title:"Examiner Verification",subtitle:"Controlled A/B behavior-effect verification for a target principle (offline-first).",scope:{title:"Execution scope & gates"},mode:{full:"Full Library Incremental A/B (default)",isolated:"Isolated Principle A/B (diagnostic)"},create:{title:"Create an offline study",target:"Target principle (one per study)",mode:"Experiment mode",repetitions:"Repetitions per case",submit:"Create study",note:"Synthetic calibration cases (SYNTHETIC_OFFLINE gold). Study identities are server-minted and never overwritten."},studies:{title:"Studies",empty:"No studies yet \u2014 create an offline study above."},study:{title:"Study {{studyId}}",mode:"Mode",intervention:"Intervention",target:"Target",plannedPairs:"Planned pairs",run:"Execution",finished:"finished",running:"running",notRun:"not run",report:"Report",preflight:"Run preflight",runOffline:"Run offline",back:"Principle Evaluation",statusTitle:"Study status",readOnly:"Read-only study",openReport:"Open report",runDry:"Host dry-run",requestF2:"Request F2 real-host run",modesNote:"Offline-stub runs synchronously and validates the contract pipeline; Host dry-run executes asynchronously with ZERO model calls; F2 real-host runs require an APPROVED Stage R authorization inside this study.",accepted:{dryRun:"Host dry-run accepted \u2014 polling for the checklist.",f2:"F2 request accepted \u2014 polling for settlement."},snapshot:{title:"Frozen production snapshot",frozenAt:"Frozen at",route:"Production route",budget:"Production budget",divergence:"Ledger-active without runtime activation",activationDegraded:"Activation data was UNAVAILABLE at freeze time (truth unknown, not zero)",matchesProduction:"matches production configuration"},runs:{title:"Console runs (async contract)",empty:"No console runs yet \u2014 use Host dry-run or an F2 request.",ledgerProblem:"The run ledger cannot be read \u2014 the history below is NOT trustworthy"}},preflight:{status:"Preflight status"},report:{title:"Report V2",target:"Target",endpoint:"Primary endpoint",fidelity:"Treatment Fidelity",contamination:"Control contamination",evictions:"Capacity evictions",ittNote:"planned applicable {{planned}} \xB7 determined {{determined}} \xB7 unknown sides {{unknown}} \xB7 NOT_APPLICABLE {{na}} (excluded from the denominator)",noExaminerBlock:"This report predates the v0.9 contract (no examiner block).",offlineNote:"Offline-stub results validate the contract pipeline only \u2014 never real-host behavior. Real host experiments require separate Owner authorization.",back:"Execution & Evidence",missing:"No Report V2 yet \u2014 run the offline execution on the study page first.",replay:"Replay verification",limitations:"Limitations",handoff:{title:"Owner decision handoff",note:"The report informs the decision; the Owner decides in the existing principle governance workflow. Examiner never mutates lifecycle, RuleCode or activation state by itself.",openGovernance:"Open principle governance",refresh:"Refresh report"},production:{title:"Production observation (separate lane)",note:"Real-run evidence for the same principle. It complements the controlled A/B result above and is never merged into its numbers.",missing:"Production evidence for the target principle is unavailable here."}},created:"Study {{studyId}} created.",runDone:"Offline execution finished: {{count}} units succeeded.",reportGenerated:"Report generated ({{status}}).",evaluation:{title:"Principle Evaluation",configureCta:"Configure a study",noActive:"No active principles in this workspace \u2014 activate a principle before evaluating it.",loadingEvidence:"Loading production evidence\u2026",refresh:"Refresh evidence",openGovernance:"Open principle governance",selectPrinciple:"Select a principle to see its production evidence.",openStudy:"Open"},evidence:{runtimeDeactivated:"runtime revoked",ruleCount:"RuleCodes (ledger)",painRefs:"Pain lineage",evaluability:"Evaluability",painPrevented:"Pains prevented",activation:{title:"Runtime activation",promptRows:"Prompt activations",ruleCodeRows:"RuleCode activations"},injection:{title:"Prompt injection (production projection)",noRows:"No injection rows for this principle (unavailable lanes are never reported as zero events).",budget:"Budget",projectionNote:"A projection forecasts what the production prompt path WOULD deliver \u2014 it is not proof the model consumed the content."},receipts:{title:"Receipts",effects:"Effects",presence:"Presence"},audit:{title:"Intervention evidence audit",deliveries:"Deliveries",applications:"Applications",episodes:"Episodes",effects:"Effects",outcomes:"Outcomes",unresolved:"Unresolved refs",loadedSuffix:"(loaded; more exist)",hasMoreNote:"More records exist beyond this read window \u2014 the counts above are the LOADED page, not the evidence total.",ladder:"Confirmation ladder (never promoted)",asOf:"Audit as of"},asOf:"Read at",outcomes:{title:"Owner outcomes (recent)"}},configure:{back:"Principle Evaluation",title:"Study Configuration",subtitle:"What exactly will this evaluation compare, and under which frozen inputs?",fullNote:"Control: the full host-effective library WITHOUT the target. Treatment: the same library WITH the target. The target is the only planned intervention variable.",isolatedNote:"Diagnostic mode: control is EMPTY (all PD principles off), treatment carries the target only.",suite:{title:"Challenge suite"},readiness:{title:"Host execution readiness"},difference:{title:"Experiment vs production configuration",note:"The study freezes its own budget and renders arms deterministically; the frozen production snapshot records every detected difference (markers such as EXPERIMENT_CONFIGURATION_DIFFERS_FROM_PRODUCTION)."},summary:"Target {{target}} \xB7 suite {{suite}} \xB7 {{pairs}} planned pairs"},errors:{unavailable:"The Examiner research engine is unavailable in this installation (the installer payload does not include the research modules).",create:"Failed to create the study.",preflight:"Preflight failed.",run:"Offline execution failed.",report:"Report generation failed.",evidence:"Failed to load production evidence.",status:"Failed to load the study status."}},debt:{eyebrow:"Principle Debt",title:"Principle Debt Management",subtitle:"Review active principles that may be stagnant, never activated, or flagged as technical/behavioral debt.",emptyTitle:"No Principle Debts",emptyDescription:"Excellent! All your active principles are either recently active, verified in execution, or have no pending stagnation alerts.",reasonNeverActivated:"This principle has been approved but never deployed to any active channel (e.g. prompt, RuleHost).",reasonStagnant:"This principle approval request has been stagnant/pending for more than 7 days.",suggestedAction:"Suggested Action",actionArchive:"Archive",actionDeactivate:"Deactivate",actionKeep:"Keep and Observe",confirmArchive:"Archiving this principle will remove it from the active ruleset. Are you sure you want to archive?",confirmDeactivate:"Deactivating this channel will stop enforcing this rule at runtime. Are you sure you want to deactivate?",deactivateSuccess:"Channel deactivated successfully.",deactivateFailed:"Failed to deactivate channel.",archiveSuccess:"Principle archived successfully.",archiveFailed:"Failed to archive principle.",undoAction:"Undo",undoSuccess:"Operation undone successfully.",undoFailed:"Undo operation failed.",loadError:"Unable to load principle debt data. Please try refreshing the page.",daysSinceAgo:"{{count}} days ago",demoteTooltip:"Demote endpoint under development",principleAriaLabel:"Debt Principle {{id}}",listAriaLabel:"Debt principles list"},welcome:{title:"Welcome to Principles Disciple",subtitle:"Turn your repeated corrections into reviewed, reversible principles.",stateSaveError:"Couldn't save onboarding progress. Check browser storage permissions and retry.",stepIndicator:"Step {{current}} of {{total}}",step1:{title:"What is PD?",description:"An owner-governed behavior internalization system. PD turns behavioral evidence into reviewed, reversible principles that shape future agent behavior.",circuitLabel:"Core governance loop",circuitNodes:{evidence:"Evidence",principle:"Principle",ownerGate:"Owner Gate",behavior:"Behavior Change"},startButton:"Start",skipButton:"Skip onboarding"},step2:{title:"See the full governance loop in action",description:"This is a controlled demo using simulated evidence. In real use, your agent produces evidence through the pd-pain-signal skill.",runDemoButton:"Run demo",demoRunning:"Running demo...",demoComplete:"Demo complete",demoFailed:"Demo failed",demoSimulatedNote:"This evidence is simulated for demo purposes.",nextButton:"Next",evidenceLabel:"Evidence (simulated)",candidateLabel:"Candidate Principle",ownerGateLabel:"Owner Gate: Review and approve",activationLabel:"Activation Result",rollbackLabel:"Rollback path available",stages:{evidenceSeed:"Evidence (simulated)",principleProposal:"Candidate principle",ownerReview:"Owner review",activation:"Activation result",followUpObservation:"Follow-up observation",rollbackProof:"Rollback path ready"}},step3:{title:"Essential Slash Commands",description:"Type these commands in your agent conversation to control PD.",commandsIntro:"Here are 7 core commands. Type /pd-help for the full list.",commandDescriptions:{pdInit:"Initialize workspace (generate PRINCIPLES.md, THINKING_OS.md, etc.)",pdStatus:"View system status (GFI, Pain dictionary)",pdPain:"Report pain from OpenClaw session",pdHelp:"Show all commands and usage guide",pdContext:"Control context injection",pdFocus:"Manage CURRENT_FOCUS.md"},nextButton:"Next",emptyListFallback:"Failed to load command list. Type /pd-help to see all commands."},step4:{title:"Ready to record real evidence",description:"When your agent makes a mistake or you repeatedly correct it, tell the agent: 'Use pd-pain-signal to record this.'",examplePrompt:"Example prompt to agent:",examplePromptText:"I just corrected you on X. Use pd-pain-signal to record this as a pain signal.",tryNowButton:"Try it now (2-hour window)",goToFocusButton:"Got it, go to Focus",skipButton:"Skip for now",windowHint:"We'll check back in 2 hours. No pressure \u2014 you can always record evidence later.",pollingActive:"Listening for evidence... We'll check every 30 seconds for 2 hours.",stopPollingButton:"Stop and continue",evidenceFound:"Evidence detected! You can now review it in the Focus page.",timeoutHint:"No evidence detected in 2 hours. That's okay \u2014 you can record evidence anytime with pd-pain-signal.",pollingError:"Couldn't check for evidence. The evidence service may be unavailable.",retryButton:"Retry"},progress:{step1:"Welcome",step2:"Demo",step3:"Commands",step4:"Evidence"}},failedTasks:{title:"Failed Tasks",subtitle:"Pipeline tasks that failed or need human review",empty:"No failed tasks in the queried range. This does not mean the pipeline is healthy \u2014 check the learning-queue status below.",pipeline:{title:"Learning queue status",statusHealthy:"Progressing",statusBacklogged:"Backlogged (still progressing)",statusStalled:"Possibly stalled",statusDisabled:"Consumer disabled",statusUnknown:"Status unknown",nextActionPrefix:"Suggested: "},error:"Failed to load failed tasks",disabled:"Failed tasks observability is disabled. Enable 'failed_tasks_observability' in .pd/config.yaml to view.",createDraft:"Create Feedback Draft",recover:"Resume Evolution",recoverConfirmTitle:"Recover this evolution task?",recoverConfirmStatus:"Current status",recoverConfirmActionLabel:"Action",recoverConfirmActionDesc:"Reset the task and allow runtime execution",recoverConfirmImpactLabel:"Impact",recoverConfirmImpactDesc:"Existing artifacts are preserved. A new execution attempt will be created.",recoverConfirmAttempts:"Attempts used",recoverExhaustedWarning:"This task has used its entire retry budget ({{attempt}}/{{max}}). A plain recovery will be refused.",recoverConfirmForceButton:"Force recover",recoverConfirmForceImpactDesc:"Force-reset the task: clear its error and lease, raise the retry budget by 3, and create a new execution attempt. Existing artifacts are preserved.",recoverConfirmButton:"Recover",recoverSuccess:"Recovery accepted \u2014 the task is pending again",recoverFailed:"Recovery failed",awaitingOwnerDecision:"Awaiting owner decision",goGovernanceFocus:"Go to governance focus",taskId:"Task ID",painId:"Pain ID",kind:"Kind",status:"Status",lastError:"Last Error",attempts:"Attempts",lastAttempt:"Last Attempt",noPainId:"\u2014",partialResults:"Showing first {shown} of {total} records. Narrow filters or use 'pd errors list' with --offset to see more.",detailToggle:"Toggle task detail",detailError:"Failed to load task detail",createdAt:"Created",updatedAt:"Updated",runsTitle:"Run history",runAttempt:"Attempt",runStarted:"Started",runEnded:"Ended",runReason:"Reason",runErrorCategory:"Error category",noRuns:"No run records for this task."}},components:{errorBoundary:{title:"An Error Occurred",description:"An error occurred while loading the page",retry:"Retry",reportAction:"Report this problem"},zoneSection:{empty:"No data",viewAll:"View All"},taskCard:{approve:"Approve",reject:"Reject",cleanup:"Cleanup",undo:"Undo",undoCountdown:"Undo ({{count}}s)",evidence:"Evidence",summary:"Summary",why:"Why",whatHappens:"What Happens"},evidencePanel:{summary:"Summary",why:"Why",whatHappens:"What Happens",evidenceItems:"Evidence Items"},pageHeader:{refresh:"Refresh",lastUpdated:"Last Updated: {{time}}",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},themeToggle:{light:"Light Mode",dark:"Dark Mode"},languageSwitcher:{chinese:"\u4E2D\u6587",english:"English"},sidebar:{collapse:"Collapse Sidebar",expand:"Expand Sidebar",focus:"Governance Focus",pain:"Behavior Evidence",principles:"Principles Review",activation:"Activation",debt:"Principle Debt",examiner:"Examiner Verification",controlCenter:"Control Center",reportProblem:"Feedback",failedTasks:"Failed Tasks",settings:"Settings",update:"Updates",pendingApprovalsAria:"{{count}} pending approvals",degradedSignalsAria:"{{count}} degraded signals",intent:"Owner Intent",themeToLight:"Switch to light mode",themeToDark:"Switch to dark mode",switchLanguage:"Switch language",signOut:"Sign out",openMenu:"Open navigation menu",navigation:"Main navigation",navigationDescription:"Navigate the console pages; the drawer closes after a selection."},approvalCard:{confidence:{high:"High",medium:"Medium",low:"Low"},viewDetail:"View Detail",approve:"Approve",reject:"Reject",empty:"No pending approvals",stats:{pending:"Pending",approved:"Approved",rejected:"Rejected"},status:{approved:"Approved",rejected:"Rejected",cancelled:"Cancelled"},decidedBy:"Decided by {{by}}",channel:{code_tool_hook:"RuleHost",defer_archive:"Defer Archive",prompt:"Prompt",skill:"Skill (retired)"},retired:"This channel is retired and cannot be actioned",riskLevel:"Risk Level"},approvalDetail:{title:"Approval Detail",whyRecommended:"Why Recommended",confidenceExplanation:"Confidence Explanation",whatHappens:"What Happens if Approved",ifReject:"If You Reject",approve:"Approve",reject:"Reject"},rejectionDialog:{title:"Rejection Reason",description:"Please explain why you are rejecting this approval. This helps improve future recommendations.",placeholder:"Enter rejection reason (at least 10 characters)\u2026",tooShort:"Reason must be at least 10 characters",cancel:"Cancel",submit:"Confirm Rejection"},onboardingReset:{title:"Onboarding",resetButton:"Reset onboarding state",resetConfirm:"This will restart the onboarding wizard on next login. Continue?",resetSuccess:"Onboarding state reset. You'll see the welcome page on next visit.",resetFailed:"Couldn't reset onboarding. Check browser storage permissions and retry."},onboardingFlag:{title:"Onboarding Feature",label:"New user onboarding wizard",description:"Show the welcome wizard on first visit. Disable for experienced users.",toggleAriaLabel:"Toggle new user onboarding feature",enabled:"Onboarding wizard enabled",disabled:"Onboarding wizard disabled",toggleFailed:"Failed to toggle onboarding feature",loadFailed:"Failed to load onboarding flag state"},fullPipelineFlag:{title:"Pipeline Mode (PRI-720)",label:"Force full pipeline for prompt principles",description:"Default OFF: prompt/defer principles take the short semantic path (no code generation, no sandbox). ON: newly seeded prompt chains run the complete legacy pipeline including Artificer code generation, Evaluator review and adversarial replay \u2014 for test scenarios or when you explicitly want the full pipeline. Does not affect chains already in progress.",toggleAriaLabel:"Toggle force-full-pipeline mode for prompt internalization",enabled:"Full pipeline forced for new prompt chains",disabled:"Prompt chains use the short semantic path",toggleFailed:"Failed to toggle pipeline mode",loadFailed:"Failed to load pipeline mode state"}}};var hF=()=>typeof window>"u"?"zh-CN":localStorage.getItem("pd-language")||"zh-CN";function HA(e){typeof document>"u"||(document.documentElement.lang=e.toLowerCase())}Ea.use(vm).init({resources:{"zh-CN":{common:km,pages:km.pages,components:km.components},en:{common:Sm,pages:Sm.pages,components:Sm.components}},lng:hF(),fallbackLng:"zh-CN",ns:["common","pages","components"],defaultNS:"common",interpolation:{escapeValue:!1}});HA(Ea.language??"zh-CN");Ea.on("languageChanged",HA);var ar=Ea;var ts=D(ee(),1),WA=D(W(),1),xF={theme:"light",setTheme:()=>{}},GA=ts.createContext(xF);function $A({children:e,defaultTheme:t,storageKey:a="pd-theme"}){let[n,r]=ts.useState(()=>{if(typeof window<"u"){let o=localStorage.getItem(a);return o==="light"||o==="dark"?o:t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}return t??"light"});ts.useEffect(()=>{window.document.documentElement.setAttribute("data-theme",n),localStorage.setItem(a,n)},[n,a]);let i=o=>{r(o)};return(0,WA.jsx)(GA.Provider,{value:{theme:n,setTheme:i},children:e})}function Rm(){let e=ts.useContext(GA);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var qu=D(ee(),1);var Dm=D(ee(),1);var Im=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var KA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var YA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Lx=e=>{let t=YA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ou=D(ee(),1);var Am={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var XA=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Cc=D(ee(),1);var yF=(0,Cc.createContext)({});var ZA=()=>(0,Cc.useContext)(yF);var QA=(0,ou.forwardRef)(({color:e,size:t,strokeWidth:a,absoluteStrokeWidth:n,className:r="",children:i,iconNode:o,...s},l)=>{let{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:m=""}=ZA()??{},p=n??d?Number(a??u)*24/Number(t??c):a??u;return(0,ou.createElement)("svg",{ref:l,...Am,width:t??c??Am.width,height:t??c??Am.height,stroke:e??f,strokeWidth:p,className:Im("lucide",m,r),...!i&&!XA(s)&&{"aria-hidden":"true"},...s},[...o.map(([b,v])=>(0,ou.createElement)(b,v)),...Array.isArray(i)?i:[i]])});var Se=(e,t)=>{let a=(0,Dm.forwardRef)(({className:n,...r},i)=>(0,Dm.createElement)(QA,{ref:i,iconNode:t,className:Im(`lucide-${KA(Lx(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Lx(e),a};var wF=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],no=Se("archive",wF);var kF=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ro=Se("arrow-left",kF);var SF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],$r=Se("arrow-right",SF);var CF=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],su=Se("book-open",CF);var RF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],io=Se("chevron-right",RF);var IF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ni=Se("circle-alert",IF);var AF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],as=Se("circle-check",AF);var DF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wr=Se("circle-question-mark",DF);var LF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ns=Se("circle-x",LF);var NF=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],lu=Se("clipboard-check",NF);var EF=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],rs=Se("code-xml",EF);var OF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],cu=Se("compass",OF);var TF=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],du=Se("external-link",TF);var PF=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],is=Se("file-pen-line",PF);var _F=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Zs=Se("file-text",_F);var BF=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Kr=Se("flask-conical",BF);var MF=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],uu=Se("focus",MF);var FF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],fu=Se("info",FF);var UF=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],pu=Se("languages",UF);var jF=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],mu=Se("link-2",jF);var HF=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pa=Se("loader-circle",HF);var zF=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gu=Se("log-out",zF);var qF=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],hu=Se("menu",qF);var VF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],bu=Se("message-square-text",VF);var GF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Qs=Se("message-square",GF);var $F=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Js=Se("moon",$F);var WF=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],vu=Se("play",WF);var KF=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],xu=Se("radio",KF);var YF=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],nr=Se("refresh-cw",YF);var XF=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],yu=Se("scale",XF);var ZF=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],wu=Se("server-cog",ZF);var QF=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Rc=Se("settings",QF);var JF=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],oo=Se("shield-check",JF);var e4=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],el=Se("sun",e4);var t4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ku=Se("trash-2",t4);var a4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ar=Se("triangle-alert",a4);var n4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tl=Se("x",n4);var r4=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],Su=Se("zap",r4);var JL=D(ee(),1);var Ca=D(ee(),1);var JA=["ingest","github","email","file"];function w(e){return typeof e=="string"}function Ye(e){return typeof e=="number"&&!Number.isNaN(e)}function xt(e){return typeof e=="boolean"}function P(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vt(e,t){if(!Object.hasOwn(e,t))return{valid:!0,value:null};let a=e[t];return a===null||typeof a=="string"?{valid:!0,value:a}:{valid:!1}}function i4(e,t){if(!Object.hasOwn(e,t))return{valid:!0,value:null};let a=e[t];return a===null||typeof a=="number"&&!Number.isNaN(a)?{valid:!0,value:a}:{valid:!1}}function Yt(e,t){if(!Array.isArray(e))return null;let a=[];for(let n of e){let r=t(n);if(r===null)return null;a.push(r)}return a}var o4=new Set(["principle","artifact","task","run","approval","activation","trajectory"]),eD=new Set(["prompt","code_tool_hook","defer_archive"]),s4=new Set(["governance.headline.owner_decision","governance.headline.recovery","governance.headline.revision","governance.headline.processing","governance.headline.active","governance.headline.unavailable","governance.headline.recorded"]),l4=new Set(["governance.reason.approval_pending","governance.reason.recovery_required","governance.reason.automatic_revision","governance.reason.processing","governance.reason.activation_active","governance.reason.data_incomplete","governance.reason.no_current_process"]),c4=new Set(["governance.next.review","governance.next.inspect_recovery","governance.next.wait","governance.next.monitor","governance.next.inspect_data","governance.next.none"]),oD=new Set(["strong","weak","unknown"]),d4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;function Lm(e){if(typeof e!="string"||!d4.test(e))return!1;let t=new Date(e);return Number.isFinite(t.getTime())?t.toISOString()===(e.includes(".")?e:e.replace("Z",".000Z")):!1}function nt(e,t){return t.every(a=>Object.hasOwn(e,a))}var u4=new Set(["host_capacity_absent","host_capacity_source_untrusted","host_capacity_invalid_value","catalog_unavailable","model_identity_absent","catalog_no_exact_match","catalog_no_match_for_model_id","catalog_ambiguous_model_id","catalog_provider_absent","catalog_metadata_invalid","runtime_budget_observation_stale"]);function Nx(e){return w(e)&&u4.has(e)}function Ex(e){return e==="operator_declared"||e==="host_effective_window"||e==="pi_catalog_exact"||e==="pi_catalog_model_id"||e==="legacy_fallback"}function Ox(e){return e==="confirmed"||e==="unknown"}function pt(e,t){return typeof e=="string"&&t.has(e)}function Em(e){return P(e)&&nt(e,["type","id"])&&pt(e.type,o4)&&typeof e.id=="string"&&e.id.length>0}function os(e){return Array.isArray(e)&&e.every(Em)}function f4(e){return P(e)&&nt(e,["source","reasonCode","nextActionCode"])&&pt(e.source,new Set(["ledger","artifact","task","approval","activation","trajectory","lineage"]))&&typeof e.reasonCode=="string"&&e.reasonCode.length>0&&typeof e.nextActionCode=="string"&&e.nextActionCode.length>0&&(!Object.hasOwn(e,"sourceRef")||Em(e.sourceRef))}function p4(e){return P(e)&&nt(e,["code","recordedAt","summaryCode","sourceRef","lineageConfidence"])&&pt(e.code,new Set(["pain_created","candidate_generated","review_started","revision_requested","revision_reopened","approved","rejected","activated","deactivated","failed","human_review"]))&&Lm(e.recordedAt)&&(!Object.hasOwn(e,"occurredAt")||Lm(e.occurredAt))&&typeof e.summaryCode=="string"&&e.summaryCode.length>0&&Em(e.sourceRef)&&pt(e.lineageConfidence,oD)}function m4(e){if(!P(e)||!nt(e,["schemaVersion","principleId","asOf","summary","principleState","process","automation","attention","activationSummary","timeline","sourceRefs","dataQuality"])||e.schemaVersion!=="1"||typeof e.principleId!="string"||e.principleId.length===0||!Lm(e.asOf))return!1;let{summary:t,principleState:a,process:n,automation:r,attention:i,activationSummary:o,dataQuality:s}=e;return!P(t)||!nt(t,["headlineCode","reasonCode","nextActionCode","ownerActionRequired","sourceRefs"])||!pt(t.headlineCode,s4)||!pt(t.reasonCode,l4)||!pt(t.nextActionCode,c4)||typeof t.ownerActionRequired!="boolean"||!os(t.sourceRefs)||Object.hasOwn(t,"safeReasonSummary")&&(typeof t.safeReasonSummary!="string"||t.safeReasonSummary.length===0)||!P(a)||!nt(a,["value","sourceRefs"])||!pt(a.value,new Set(["candidate","active","archived","deprecated","probation"]))||!os(a.sourceRefs)||!P(n)||!nt(n,["sourceRefs"])||!os(n.sourceRefs)||Object.hasOwn(n,"stage")&&!pt(n.stage,new Set(["generating","reviewing","revising","approval","activation"]))||Object.hasOwn(n,"currentTaskKind")&&!pt(n.currentTaskKind,new Set(["dreamer","philosopher","scribe","artificer","evaluator","rollout_reviewer"]))||!P(r)||!nt(r,["state","sourceRefs"])||!pt(r.state,new Set(["idle","queued","running","retry_scheduled","stalled"]))||!os(r.sourceRefs)||!P(i)||!nt(i,["primary","items"])||!pt(i.primary,new Set(["none","owner_required","recovery_required"]))||!Array.isArray(i.items)||!i.items.every(l=>P(l)&&nt(l,["kind","reasonCode","sourceRef"])&&pt(l.kind,new Set(["owner_decision","recovery"]))&&typeof l.reasonCode=="string"&&l.reasonCode.length>0&&Em(l.sourceRef))||!P(o)||!nt(o,["state","channels","observedChannels","sourceRefs"])||!pt(o.state,new Set(["none","active","partially_active","deactivated"]))||!Array.isArray(o.channels)||!o.channels.every(l=>pt(l,eD))||!Array.isArray(o.observedChannels)||!o.observedChannels.every(l=>pt(l,eD))||!os(o.sourceRefs)?!1:Array.isArray(e.timeline)&&e.timeline.every(p4)&&os(e.sourceRefs)&&P(s)&&nt(s,["degraded","issues"])&&typeof s.degraded=="boolean"&&Array.isArray(s.issues)&&s.issues.every(f4)}function sD(e){return m4(e)?e:null}var lD=new Set(["needs_owner_decision","processing","blocked","recovery_needed","decided","no_action"]),g4=new Set(["decision","blocked","recovery","none"]),h4=new Set(["individual","aggregate","none"]);function b4(e){if(!P(e)||!nt(e,["principleId","decisionState","learnedPrinciple","inbox","blockerCodes","nextAction"])||!w(e.principleId)||e.principleId.length===0||!w(e.decisionState)||!lD.has(e.decisionState))return!1;let t=e.learnedPrinciple;if(!P(t))return!1;if(t.status==="known"){if(!nt(t,["text","sourceTier"])||!w(t.text)||t.text.length===0||!w(t.sourceTier))return!1}else if(t.status==="unknown"){if(!nt(t,["reasonText"])||!w(t.reasonText))return!1}else return!1;return!P(e.inbox)||!nt(e.inbox,["group","attention"])||!pt(e.inbox.group,g4)||!pt(e.inbox.attention,h4)||!Array.isArray(e.blockerCodes)||!e.blockerCodes.every(w)?!1:P(e.nextAction)&&nt(e.nextAction,["ownerText"])&&w(e.nextAction.ownerText)}function tD(e){return!P(e)||!nt(e,["code","ownerText","sourceRefs"])||!w(e.code)||e.code.length===0||!w(e.ownerText)||e.ownerText.length===0||!Array.isArray(e.sourceRefs)?!1:nt(e,["count"])?typeof e.count=="number"&&Number.isInteger(e.count)&&e.count>=1:!0}function v4(e){return P(e)&&nt(e,["key","semantic","label","channel","confirmation","expectedConsequence"])&&w(e.key)&&e.key.length>0&&w(e.semantic)&&e.semantic.length>0&&w(e.label)&&P(e.confirmation)&&typeof e.confirmation.required=="boolean"&&w(e.confirmation.text)}function x4(e){return!P(e)||!nt(e,["schemaVersion","principleId","asOf","sourceReadStatus","sourceReads","incidentSummary","learnedPrinciple","rationale","applicability","nonApplicabilityOrUnknown","expectedBehavior","currentEnforcement","evidenceSummary","uncertainty","risk","rollback","decisionState","decisionSubjects","availableActions","blockers","nextAction","inbox","technicalDetails"])||e.schemaVersion!=="1"||!w(e.principleId)||!w(e.asOf)||e.sourceReadStatus!=="complete"&&e.sourceReadStatus!=="partial"||!pt(e.decisionState,lD)||!Array.isArray(e.availableActions)||!e.availableActions.every(v4)||!Array.isArray(e.blockers)||!e.blockers.every(t=>P(t)&&nt(t,["subjectKey","kind","reason"])&&tD(t.reason))?!1:P(e.nextAction)&&nt(e.nextAction,["code","ownerText"])&&w(e.nextAction.ownerText)&&P(e.inbox)&&nt(e.inbox,["group","attention","reason"])&&tD(e.inbox.reason)}function cD(e){return x4(e)?e:null}function y4(e){return P(e)&&nt(e,["schemaVersion","generatedAt","totalPrinciples","groups","historicalUnknown"])&&e.schemaVersion==="1"&&w(e.generatedAt)&&typeof e.totalPrinciples=="number"&&P(e.groups)&&nt(e.groups,["decision","blocked","recovery"])&&["decision","blocked","recovery"].every(t=>{let a=e.groups[t];return Array.isArray(a)&&a.every(b4)})&&P(e.historicalUnknown)&&typeof e.historicalUnknown.count=="number"}function dD(e){return y4(e)?e:null}function w4(e){return P(e)&&nt(e,["decisionState","learnedPrinciple"])&&w(e.decisionState)&&P(e.learnedPrinciple)&&(e.learnedPrinciple.status==="known"?w(e.learnedPrinciple.text)&&w(e.learnedPrinciple.sourceTier):e.learnedPrinciple.status==="unknown"&&w(e.learnedPrinciple.reasonText))}function k4(e){return P(e)&&nt(e,["schemaVersion","generatedAt","entries"])&&e.schemaVersion==="1"&&w(e.generatedAt)&&P(e.entries)&&Object.values(e.entries).every(w4)}function uD(e){return k4(e)?e:null}var aD=new Set(["setup_required","owner_decision_required","recovery_required","degraded","background_processing","all_clear"]),fD=new Set(["governance.exp.reason.owner_identity_missing","governance.exp.reason.owner_identity_invalid","governance.exp.reason.owner_authentication_missing","governance.exp.reason.approval_pending","governance.exp.reason.rulecode_owner_decision","governance.exp.reason.no_pending_decision","governance.exp.reason.owner_decision_available","governance.exp.reason.break_glass_entry","governance.exp.reason.recovery_required","governance.exp.reason.source_unavailable","governance.exp.reason.config_invalid","governance.exp.reason.processing","governance.exp.reason.workspace_clear","governance.exp.reason.workspace_empty"]),pD=new Set(["governance.exp.next.configure_owner","governance.exp.next.authenticate_console","governance.exp.next.review_approvals","governance.exp.next.inspect_recovery","governance.exp.next.inspect_sources","governance.exp.next.fix_config","governance.exp.next.monitor","governance.exp.next.none"]),S4=new Set(["operator_legacy","configured_owner","break_glass"]),C4=new Set(["principle_approval","rulecode_owner_decision","emergency_pause"]),mD=new Set(["blocked","needs_recovery","needs_decision","processing"]),R4=new Set(["production","development","demo","test","unknown"]),I4=new Set(["workspace_config","missing"]),A4=new Set(["ledger","artifact","task","approval","activation","trajectory","lineage","workspace"]);function D4(e){return P(e)&&nt(e,["category","reasonCode","sourceRefs"])&&pt(e.category,mD)&&typeof e.reasonCode=="string"&&e.reasonCode.length>0&&os(e.sourceRefs)&&(!Object.hasOwn(e,"principleId")||typeof e.principleId=="string"&&e.principleId.length>0)}function L4(e){return P(e)&&nt(e,["kind","observedAuthority","status","reasonCode","nextActionCode"])&&pt(e.kind,C4)&&pt(e.observedAuthority,S4)&&pt(e.status,new Set(["entry_conditions_met","blocked"]))&&pt(e.reasonCode,fD)&&pt(e.nextActionCode,pD)}function N4(e){return P(e)&&nt(e,["environment","source"])&&pt(e.environment,R4)&&pt(e.source,I4)&&(!Object.hasOwn(e,"configIssue")||typeof e.configIssue=="string"&&e.configIssue.length>0)}function E4(e){if(!P(e)||!nt(e,["schemaVersion","snapshotId","asOf","summary","readiness","activity","trustContext","dataQuality"])||e.schemaVersion!=="1"||typeof e.snapshotId!="string"||e.snapshotId.length===0||!Lm(e.asOf))return!1;let{summary:t,readiness:a,activity:n,trustContext:r,dataQuality:i}=e;return!P(t)||!nt(t,["primaryAttention","headlineCode","reasonCode","nextActionCode"])||!pt(t.primaryAttention,aD)||typeof t.headlineCode!="string"||t.headlineCode.length===0||!pt(t.reasonCode,fD)||!pt(t.nextActionCode,pD)||!P(a)||!nt(a,["authenticationMode","ownerIdentityConfiguration","governanceActions"])||!pt(a.authenticationMode,new Set(["authenticated","no_auth"]))||!pt(a.ownerIdentityConfiguration,new Set(["configured","missing","invalid"]))||!Array.isArray(a.governanceActions)||a.governanceActions.length!==3||!a.governanceActions.every(L4)||!P(n)||!nt(n,["primaryAttention","categories"])||!pt(n.primaryAttention,aD)||!Array.isArray(n.categories)||!n.categories.every(o=>P(o)&&nt(o,["category","count","items","hasMore"])&&pt(o.category,mD)&&typeof o.count=="number"&&Number.isInteger(o.count)&&o.count>=0&&Array.isArray(o.items)&&o.items.length<=10&&o.items.every(D4)&&typeof o.hasMore=="boolean")||!P(r)||!nt(r,["environmentContext","lineageTransparency"])||!N4(r.environmentContext)||!P(r.lineageTransparency)||!nt(r.lineageTransparency,["confidence","strongViewCount","weakViewCount","unknownViewCount"])||!pt(r.lineageTransparency.confidence,oD)||[r.lineageTransparency.strongViewCount,r.lineageTransparency.weakViewCount,r.lineageTransparency.unknownViewCount].some(o=>typeof o!="number"||!Number.isInteger(o)||o<0)?!1:P(i)&&nt(i,["degraded","issueGroups","hasMore"])&&typeof i.degraded=="boolean"&&typeof i.hasMore=="boolean"&&Array.isArray(i.issueGroups)&&i.issueGroups.length<=10&&i.issueGroups.every(o=>P(o)&&nt(o,["source","reasonCode","nextActionCode","count","sampleRefs"])&&pt(o.source,A4)&&typeof o.reasonCode=="string"&&o.reasonCode.length>0&&typeof o.nextActionCode=="string"&&o.nextActionCode.length>0&&typeof o.count=="number"&&Number.isInteger(o.count)&&o.count>=1&&os(o.sampleRefs))}function gD(e){return E4(e)?e:null}function hD(e){if(!P(e))return null;let t={};return Object.hasOwn(e,"message")&&w(e.message)&&(t.message=e.message),Object.hasOwn(e,"error")&&w(e.error)&&(t.error=e.error),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),t}function bD(e){if(e==null||!P(e))return null;let t={};for(let a of Object.keys(e)){let n=e[a];if(!w(n))return null;t[a]=n}return t}function vD(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"report")||!P(e.report)?null:{id:e.id,createdAt:e.createdAt,report:e.report}}function xD(e){return!P(e)||!Object.hasOwn(e,"drafts")||!Array.isArray(e.drafts)?null:Yt(e.drafts,t=>!P(t)||!Object.hasOwn(t,"id")||!w(t.id)||!Object.hasOwn(t,"createdAt")||!w(t.createdAt)||!Object.hasOwn(t,"type")||!w(t.type)||!Object.hasOwn(t,"title")||!w(t.title)?null:{id:t.id,createdAt:t.createdAt,type:t.type,title:t.title})}function yD(e){return!P(e)||!Object.hasOwn(e,"report")||!P(e.report)?null:{report:e.report}}function wD(e){return!P(e)||!Object.hasOwn(e,"deleted")||!xt(e.deleted)?null:{deleted:e.deleted}}function O4(e){if(!Object.hasOwn(e,"id")||!w(e.id)||!JA.includes(e.id)||!Object.hasOwn(e,"available")||!xt(e.available))return null;let t=vt(e,"reason"),a=vt(e,"nextAction");if(!t.valid||!a.valid)return null;let n={id:e.id,available:e.available};return t.value!==null&&(n.reason=t.value),a.value!==null&&(n.nextAction=a.value),n}function kD(e){if(!P(e)||!Object.hasOwn(e,"channels")||!Array.isArray(e.channels))return null;let t=[];for(let a of e.channels){if(!P(a))continue;let n=O4(a);n!==null&&t.push(n)}return{channels:t}}function Tx(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"alreadySubmitted")||!xt(e.alreadySubmitted)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t={ok:e.ok,alreadySubmitted:e.alreadySubmitted,status:e.status},a=vt(e,"submittedVia"),n=vt(e,"trackingId"),r=vt(e,"externalUrl"),i=vt(e,"nextAction");return!a.valid||!n.valid||!r.valid||!i.valid||(a.value!==null&&(t.submittedVia=a.value),n.value!==null&&(t.trackingId=n.value),r.value!==null&&(t.externalUrl=r.value),i.value!==null&&(t.nextAction=i.value),Object.hasOwn(e,"writeBackFailed")&&!xt(e.writeBackFailed))?null:(xt(e.writeBackFailed)&&(t.writeBackFailed=e.writeBackFailed),t)}function T4(e){if(!P(e)||!Object.hasOwn(e,"workspaceName")||!w(e.workspaceName)||!Object.hasOwn(e,"enabled")||!xt(e.enabled))return null;let t=vt(e,"displayName");return!t.valid||!Object.hasOwn(e,"syncEnabled")||!xt(e.syncEnabled)?null:{workspaceName:e.workspaceName,enabled:e.enabled,displayName:t.value,syncEnabled:e.syncEnabled}}function Px(e){if(!P(e)||!Object.hasOwn(e,"name")||!w(e.name)||!Object.hasOwn(e,"path")||!w(e.path))return null;let t=vt(e,"lastSync");if(!t.valid)return null;let a=null;return Object.hasOwn(e,"config")&&e.config!==null&&(a=T4(e.config),a===null)?null:{name:e.name,path:e.path,lastSync:t.value,config:a}}function SD(e){return Yt(e,Px)}function CD(e){return!P(e)||!Object.hasOwn(e,"removed")||!w(e.removed)?null:{removed:e.removed}}function RD(e){return!P(e)||!Object.hasOwn(e,"success")||!xt(e.success)||!Object.hasOwn(e,"syncedAt")||!w(e.syncedAt)?null:{success:e.success,syncedAt:e.syncedAt}}function _x(e){switch(e){case"ready":case"not_ready":case"needs_setup":case"disabled":case"unknown":return e;default:return null}}function ID(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"type")||!w(e.type)||!Object.hasOwn(e,"label")||!w(e.label)||Object.hasOwn(e,"apiKeyEnv")&&!w(e.apiKeyEnv)||Object.hasOwn(e,"provider")&&!w(e.provider)||Object.hasOwn(e,"model")&&!w(e.model)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);return t===null?null:{id:e.id,type:e.type,label:e.label,...Object.hasOwn(e,"apiKeyEnv")&&w(e.apiKeyEnv)?{apiKeyEnv:e.apiKeyEnv}:{},...Object.hasOwn(e,"provider")&&w(e.provider)?{provider:e.provider}:{},...Object.hasOwn(e,"model")&&w(e.model)?{model:e.model}:{},readiness:t}}function P4(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"category")||!w(e.category)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{id:e.id,category:e.category,enabled:e.enabled}}function _4(e){if(!P(e)||!Object.hasOwn(e,"name")||!w(e.name)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)||!Object.hasOwn(e,"runtimeProfileId")||!w(e.runtimeProfileId)||!Object.hasOwn(e,"runtimeProfileLabel")||!w(e.runtimeProfileLabel)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);return t===null?null:{name:e.name,enabled:e.enabled,runtimeProfileId:e.runtimeProfileId,runtimeProfileLabel:e.runtimeProfileLabel,readiness:t}}function AD(e){return!P(e)||!Object.hasOwn(e,"path")||!w(e.path)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction)?null:{path:e.path,reason:e.reason,nextAction:e.nextAction}}function B4(e){switch(e){case"defaults":case"user_config":return e;default:return null}}function DD(e){if(!P(e)||!Object.hasOwn(e,"version")||!Ye(e.version)||!Object.hasOwn(e,"source"))return null;let t=B4(e.source);if(t===null||!Object.hasOwn(e,"features")||!Array.isArray(e.features)||!Object.hasOwn(e,"runtimeProfiles")||!Array.isArray(e.runtimeProfiles)||!Object.hasOwn(e,"defaultRuntime")||!w(e.defaultRuntime)||!Object.hasOwn(e,"agents")||!Array.isArray(e.agents)||!Object.hasOwn(e,"ui")||!P(e.ui)||!Object.hasOwn(e,"warnings")||!Array.isArray(e.warnings))return null;let a=Yt(e.features,P4);if(a===null)return null;let n=Yt(e.runtimeProfiles,ID);if(n===null)return null;let r=Yt(e.agents,_4);if(r===null)return null;let i=Yt(e.warnings,l=>w(l)?l:null);if(i===null)return null;let{ui:o}=e;if(!Object.hasOwn(o,"diagnostics")||!P(o.diagnostics)||!Object.hasOwn(o.diagnostics,"mode")||!w(o.diagnostics.mode))return null;let s;return Object.hasOwn(e,"errors")&&Array.isArray(e.errors)&&(s=Yt(e.errors,AD)??void 0),{version:e.version,source:t,features:a,runtimeProfiles:n,defaultRuntime:e.defaultRuntime,agents:r,ui:{diagnostics:{mode:o.diagnostics.mode}},warnings:i,errors:s}}function LD(e){if(!P(e)||!Object.hasOwn(e,"profiles")||!Array.isArray(e.profiles))return null;let t=Yt(e.profiles,ID);if(t===null)return null;let a;return Object.hasOwn(e,"errors")&&Array.isArray(e.errors)&&(a=Yt(e.errors,AD)??void 0),{profiles:t,errors:a}}function ND(e){return!P(e)||!Object.hasOwn(e,"agent")||!w(e.agent)||!Object.hasOwn(e,"runtimeProfile")||!w(e.runtimeProfile)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{agent:e.agent,runtimeProfile:e.runtimeProfile,enabled:e.enabled}}function ED(e){return!P(e)||!Object.hasOwn(e,"feature")||!w(e.feature)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{feature:e.feature,enabled:e.enabled}}function OD(e){if(!P(e)||!Object.hasOwn(e,"agent")||!w(e.agent)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);if(t===null||!Object.hasOwn(e,"profileId")||!w(e.profileId)||!Object.hasOwn(e,"profileLabel")||!w(e.profileLabel))return null;let a={agent:e.agent,readiness:t,profileId:e.profileId,profileLabel:e.profileLabel};return Object.hasOwn(e,"reason")&&w(e.reason)&&(a.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(a.nextAction=e.nextAction),a}function TD(e){return!P(e)||!Object.hasOwn(e,"defaultRuntime")||!w(e.defaultRuntime)?null:{defaultRuntime:e.defaultRuntime}}function Om(e){if(!P(e)||!Object.hasOwn(e,"profileId")||!w(e.profileId)||!Object.hasOwn(e,"profile")||!P(e.profile))return null;let{profile:t}=e;if(!Object.hasOwn(t,"type")||!w(t.type))return null;let a=t.type;return{profileId:e.profileId,profile:{...t,type:a}}}function M4(e){return!P(e)||!Object.hasOwn(e,"type")||!w(e.type)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"daysSince")||!Ye(e.daysSince)?null:{type:e.type,principleId:e.principleId,daysSince:e.daysSince}}var nD=new Set(["none","in_progress","owner_review_ready","degraded"]),F4=new Set(["state_db_missing","no_pipeline_activity","pending_approvals","tasks_need_human_review","pipeline_active","consumed_candidates","degraded_state"]),U4=new Set(["run_config_doctor","wait_for_pipeline","review_approvals","review_failed_tasks","check_degraded_signals","check_pipeline_status"]),j4=new Set(["task_retry_wait","task_failed","approval_table_missing","trajectory_db_unavailable"]),H4=new Set(["check_task_status","fix_and_retry","run_integrity_check","check_trajectory_db"]);function z4(e){return!P(e)||!Object.hasOwn(e,"reasonCode")||!w(e.reasonCode)||!j4.has(e.reasonCode)||!Object.hasOwn(e,"nextActionCode")||!w(e.nextActionCode)||!H4.has(e.nextActionCode)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction)||!Object.hasOwn(e,"source")||!w(e.source)?null:{reasonCode:e.reasonCode,nextActionCode:e.nextActionCode,reason:e.reason,nextAction:e.nextAction,source:e.source}}function q4(e){if(!P(e)||!Object.hasOwn(e,"runId")||!w(e.runId)||!Object.hasOwn(e,"taskId")||!w(e.taskId)||!Object.hasOwn(e,"attemptNumber")||!Ye(e.attemptNumber)||!Object.hasOwn(e,"executionStatus")||!w(e.executionStatus)||!Object.hasOwn(e,"startedAt")||!w(e.startedAt))return null;let t=vt(e,"endedAt");if(!t.valid)return null;let a=vt(e,"reason");if(!a.valid)return null;let n=vt(e,"errorCategory");return n.valid?{runId:e.runId,taskId:e.taskId,attemptNumber:e.attemptNumber,executionStatus:e.executionStatus,startedAt:e.startedAt,endedAt:t.value,reason:a.value,errorCategory:n.value}:null}function PD(e){if(!P(e)||!Object.hasOwn(e,"task")||!P(e.task)||!Object.hasOwn(e,"runs")||!Array.isArray(e.runs))return null;let t=e.task;if(!Object.hasOwn(t,"taskId")||!w(t.taskId)||!Object.hasOwn(t,"taskKind")||!w(t.taskKind)||!Object.hasOwn(t,"status")||!w(t.status)||!Object.hasOwn(t,"createdAt")||!w(t.createdAt)||!Object.hasOwn(t,"updatedAt")||!w(t.updatedAt)||!Object.hasOwn(t,"attemptCount")||!Ye(t.attemptCount)||!Object.hasOwn(t,"maxAttempts")||!Ye(t.maxAttempts))return null;let a=vt(t,"lastError");if(!a.valid)return null;let n=vt(e,"lastError");if(!n.valid)return null;let r=Yt(e.runs,q4);if(r===null)return null;for(let i of r)if(i.taskId!==t.taskId)return null;return{taskId:t.taskId,taskKind:t.taskKind,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt,attemptCount:t.attemptCount,maxAttempts:t.maxAttempts,lastError:n.value??a.value,runs:r}}function _D(e){if(!P(e)||!Object.hasOwn(e,"taskId")||!w(e.taskId)||!Object.hasOwn(e,"previousStatus")||!w(e.previousStatus)||!Object.hasOwn(e,"newStatus")||!w(e.newStatus)||!Object.hasOwn(e,"result")||!w(e.result))return null;let t={taskId:e.taskId,previousStatus:e.previousStatus,newStatus:e.newStatus,result:e.result};if(Object.hasOwn(e,"forceApplied")){if(!xt(e.forceApplied))return null;t.forceApplied=e.forceApplied}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}return t}function Tm(e){if(!P(e)||!Object.hasOwn(e,"pendingReviewCount")||!Ye(e.pendingReviewCount)||!Object.hasOwn(e,"behaviorDeviationCount")||!Ye(e.behaviorDeviationCount)||!Object.hasOwn(e,"stagnationSignals")||!Array.isArray(e.stagnationSignals)||!Object.hasOwn(e,"governanceState")||!w(e.governanceState)||!nD.has(e.governanceState)||!Object.hasOwn(e,"stateReasonCode")||!w(e.stateReasonCode)||!F4.has(e.stateReasonCode)||!Object.hasOwn(e,"nextActionCode")||!w(e.nextActionCode)||!U4.has(e.nextActionCode)||!Object.hasOwn(e,"stateReason")||!w(e.stateReason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction))return null;let t=Yt(e.stagnationSignals,M4);if(t===null)return null;let a={pendingReviewCount:e.pendingReviewCount,behaviorDeviationCount:e.behaviorDeviationCount,stagnationSignals:t,governanceState:nD.has(e.governanceState)?e.governanceState:"none",stateReasonCode:e.stateReasonCode,nextActionCode:e.nextActionCode,stateReason:e.stateReason,nextAction:e.nextAction};if(Object.hasOwn(e,"inProgressSummary")){if(!w(e.inProgressSummary))return null;a.inProgressSummary=e.inProgressSummary}if(Object.hasOwn(e,"degradedSignals")){if(!Array.isArray(e.degradedSignals))return null;let n=Yt(e.degradedSignals,z4);if(n===null)return null;a.degradedSignals=n}if(Object.hasOwn(e,"note")){if(!w(e.note))return null;a.note=e.note}if(Object.hasOwn(e,"generatedAt")){if(!w(e.generatedAt))return null;a.generatedAt=e.generatedAt}if(Object.hasOwn(e,"evidenceInProgressCount")){if(!Ye(e.evidenceInProgressCount))return null;a.evidenceInProgressCount=e.evidenceInProgressCount}if(Object.hasOwn(e,"pendingHumanReviewCount")){if(!Ye(e.pendingHumanReviewCount))return null;a.pendingHumanReviewCount=e.pendingHumanReviewCount}if(Object.hasOwn(e,"gateBlocksToday")){if(!Ye(e.gateBlocksToday))return null;a.gateBlocksToday=e.gateBlocksToday}return a}var V4=new Set(["injectable","oversized","model_dependent","window_excluded","resolution_failed","route_unconfirmed"]);function G4(e){if(!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"status")||!w(e.status)||!V4.has(e.status))return null;let t={activationId:e.activationId,status:e.status};if(Object.hasOwn(e,"inCurrentWindow")&&typeof e.inCurrentWindow=="boolean"&&(t.inCurrentWindow=e.inCurrentWindow),Object.hasOwn(e,"costChars")&&typeof e.costChars=="number"&&Number.isInteger(e.costChars)&&e.costChars>=0&&(t.costChars=e.costChars),Object.hasOwn(e,"budget")&&typeof e.budget=="number"&&Number.isInteger(e.budget)&&e.budget>0&&(t.budget=e.budget),Object.hasOwn(e,"budgetScope")&&(e.budgetScope==="selected_lines"||e.budgetScope==="full_directive_context")&&(t.budgetScope=e.budgetScope),Object.hasOwn(e,"route")&&(e.route==="legacy_trim"||e.route==="shared_render")&&(t.route=e.route),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"perHostFits")&&Array.isArray(e.perHostFits)){let a=[];for(let n of e.perHostFits){if(!P(n)||n.hostKind!=="openclaw"&&n.hostKind!=="codex"&&n.hostKind!=="workbuddy"||n.tierFit!=="fits_all_tiers"&&n.tierFit!=="model_dependent"&&n.tierFit!=="exceeds_max_tier")return null;a.push({hostKind:n.hostKind,tierFit:n.tierFit})}t.perHostFits=a}return t}function $4(e){if(!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"action")||!w(e.action)||!Object.hasOwn(e,"targetRef")||!w(e.targetRef))return null;let t=vt(e,"activatedAt");if(!t.valid||!Object.hasOwn(e,"status")||!w(e.status))return null;let a=Object.hasOwn(e,"enforcement")&&(e.enforcement==="eligible"||e.enforcement==="safety_isolated")?e.enforcement:void 0;return{activationId:e.activationId,artifactId:e.artifactId,principleId:e.principleId,channel:e.channel,action:e.action,targetRef:e.targetRef,activatedAt:t.value,status:e.status,...a?{enforcement:a}:{},...Object.hasOwn(e,"legacyDecisionUnknown")&&e.legacyDecisionUnknown===!0?{legacyDecisionUnknown:!0}:{},...Object.hasOwn(e,"ownerReviewDueAt")&&w(e.ownerReviewDueAt)?{ownerReviewDueAt:e.ownerReviewDueAt}:{},...Object.hasOwn(e,"promptInjection")?(()=>{let n=G4(e.promptInjection);return n!==null?{promptInjection:n}:{}})():{}}}function Pm(e){if(!P(e)||!Object.hasOwn(e,"activations")||!Array.isArray(e.activations)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t=Yt(e.activations,$4);if(t===null)return null;let a={activations:t,status:e.status};if(Object.hasOwn(e,"reason")&&w(e.reason)&&(a.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(a.nextAction=e.nextAction),Object.hasOwn(e,"promptInjectionRoute")&&P(e.promptInjectionRoute)){let n=e.promptInjectionRoute;if((n.status==="confirmed"||n.status==="unconfirmed")&&typeof n.flagEnabled=="boolean"){let r={status:n.status,flagEnabled:n.flagEnabled};Object.hasOwn(n,"hostKind")&&(n.hostKind==="openclaw"||n.hostKind==="codex"||n.hostKind==="workbuddy")&&(r.hostKind=n.hostKind),Object.hasOwn(n,"route")&&(n.route==="legacy_trim"||n.route==="shared_render")&&(r.route=n.route),Object.hasOwn(n,"unconfirmedReason")&&w(n.unconfirmedReason)&&(r.unconfirmedReason=n.unconfirmedReason),Object.hasOwn(n,"nextAction")&&w(n.nextAction)&&(r.nextAction=n.nextAction),Object.hasOwn(n,"globalReason")&&w(n.globalReason)&&(r.globalReason=n.globalReason),Object.hasOwn(n,"budgetObservedAt")&&w(n.budgetObservedAt)&&n.budgetObservedAt.length>0&&Number.isFinite(Date.parse(n.budgetObservedAt))&&(r.budgetObservedAt=n.budgetObservedAt),Object.hasOwn(n,"budgetCapacitySource")&&Ex(n.budgetCapacitySource)&&(r.budgetCapacitySource=n.budgetCapacitySource),Object.hasOwn(n,"budgetCapacityStatus")&&Ox(n.budgetCapacityStatus)&&(r.budgetCapacityStatus=n.budgetCapacityStatus),Object.hasOwn(n,"budgetContextWindowTokens")&&typeof n.budgetContextWindowTokens=="number"&&Number.isInteger(n.budgetContextWindowTokens)&&n.budgetContextWindowTokens>0&&(r.budgetContextWindowTokens=n.budgetContextWindowTokens),Object.hasOwn(n,"budgetFallbackReason")&&Nx(n.budgetFallbackReason)&&(r.budgetFallbackReason=n.budgetFallbackReason),a.promptInjectionRoute=r}}return a}function rD(e){return!P(e)||!["eligible","matched","blocked","unhealthy"].every(a=>e[a]===null||Ye(e[a]))||!Ye(e.circuitTrips)||e.toolDistribution!==null&&(!P(e.toolDistribution)||!Object.values(e.toolDistribution).every(Ye))?null:{eligible:typeof e.eligible=="number"?e.eligible:null,matched:typeof e.matched=="number"?e.matched:null,blocked:typeof e.blocked=="number"?e.blocked:null,unhealthy:typeof e.unhealthy=="number"?e.unhealthy:null,circuitTrips:e.circuitTrips,toolDistribution:P(e.toolDistribution)?Object.fromEntries(Object.entries(e.toolDistribution).filter(a=>typeof a[1]=="number")):null}}function W4(e){if(!P(e)||!w(e.decisionId)||!w(e.decision)||!P(e.principal)||!w(e.principal.kind)||!P(e.authentication)||!w(e.authentication.method)||!w(e.reasonCode)||e.note!==null&&!w(e.note)||!w(e.decidedAt))return null;let t=typeof e.principal.ownerId=="string"?e.principal.ownerId:typeof e.principal.policyVersion=="string"?e.principal.policyVersion:typeof e.principal.reason=="string"?e.principal.reason:e.principal.kind;return{decisionId:e.decisionId,decision:e.decision,principalKind:e.principal.kind,actorId:t,authenticationMethod:e.authentication.method,reasonCode:e.reasonCode,note:typeof e.note=="string"?e.note:null,decidedAt:e.decidedAt}}function BD(e){if(!P(e)||!P(e.activation)||!P(e.artifact)||!P(e.readiness))return null;let{activation:t,artifact:a,readiness:n}=e;if(!w(t.activationId)||!w(t.artifactId)||!w(t.action)||!w(a.artifactId)||!w(a.digest)||a.content!==null&&!P(a.content)||!w(n.status)||!["ready","evidence_insufficient","blocked","unavailable"].includes(n.status)||!w(n.evaluationId)||!Array.isArray(n.failedChecks)||!n.failedChecks.every(b=>P(b)&&w(b.checkId)&&w(b.reasonCode))||!P(n.evidenceSnapshot)||!w(n.evidenceSnapshot.snapshotDigest)||!P(n.evidenceSnapshot.shadowSummary)||!Array.isArray(n.evidenceSnapshot.safetyGateResults)||!n.evidenceSnapshot.safetyGateResults.every(b=>P(b)&&w(b.checkId)&&(b.status==="passed"||b.status==="failed")&&(!Object.hasOwn(b,"reasonCode")||w(b.reasonCode))))return null;let r=n.evidenceSnapshot.shadowSummary;if(!["observed","matched","wouldBlock","wouldAllow","requireApproval","autoCorrect","errors","neutralControl"].every(b=>r[b]===null||Ye(r[b]))||![r.firstObservedAt,r.lastObservedAt].every(b=>b===null||w(b)))return null;let o=null;if(e.controlState!==null){if(!P(e.controlState)||e.controlState.enforcement!=="eligible"&&e.controlState.enforcement!=="safety_isolated"||!Ye(e.controlState.version))return null;o={enforcement:e.controlState.enforcement,version:e.controlState.version}}let s=null;if(e.globalPause!==null){if(!P(e.globalPause)||!w(e.globalPause.pauseId)||e.globalPause.status!=="paused"&&e.globalPause.status!=="released"||!Ye(e.globalPause.version))return null;s={pauseId:e.globalPause.pauseId,status:e.globalPause.status,version:e.globalPause.version}}if(!xt(e.ownerDecisionEnabled)||!Array.isArray(e.decisions)||!P(e.runtimeCapability)||!w(e.runtimeCapability.hostRuntimeVersion)||!xt(e.runtimeCapability.shadowEvidence)||!P(e.liveMetrics)||!Array.isArray(e.liveMetrics.representativeSamples)||!e.liveMetrics.representativeSamples.every(b=>P(b)&&w(b.toolName)&&w(b.decision)&&w(b.pathCategory))||!P(e.behaviorDrift))return null;let{behaviorDrift:l}=e,c=e.decisions.map(W4);if(c.some(b=>b===null)||!["approvedBlockRate","liveBlockRate","delta"].every(b=>l[b]===null||Ye(l[b])))return null;let d=rD(e.liveMetrics.last24Hours),f=rD(e.liveMetrics.last7Days);if(!d||!f)return null;let m=n.status==="ready"||n.status==="evidence_insufficient"||n.status==="blocked"||n.status==="unavailable"?n.status:null,p={observed:typeof r.observed=="number"?r.observed:null,matched:typeof r.matched=="number"?r.matched:null,wouldBlock:typeof r.wouldBlock=="number"?r.wouldBlock:null,wouldAllow:typeof r.wouldAllow=="number"?r.wouldAllow:null,requireApproval:typeof r.requireApproval=="number"?r.requireApproval:null,autoCorrect:typeof r.autoCorrect=="number"?r.autoCorrect:null,errors:typeof r.errors=="number"?r.errors:null,neutralControl:typeof r.neutralControl=="number"?r.neutralControl:null,firstObservedAt:typeof r.firstObservedAt=="string"?r.firstObservedAt:null,lastObservedAt:typeof r.lastObservedAt=="string"?r.lastObservedAt:null};return m===null?null:{activation:{activationId:t.activationId,artifactId:t.artifactId,action:t.action},artifact:{artifactId:a.artifactId,digest:a.digest,content:a.content},readiness:{status:m,evaluationId:n.evaluationId,failedChecks:n.failedChecks.map(b=>({checkId:b.checkId,reasonCode:b.reasonCode})),evidenceSnapshot:{snapshotDigest:n.evidenceSnapshot.snapshotDigest,shadowSummary:p,safetyGateResults:n.evidenceSnapshot.safetyGateResults.map(b=>({checkId:b.checkId,status:b.status,...typeof b.reasonCode=="string"?{reasonCode:b.reasonCode}:{}}))}},controlState:o,globalPause:s,decisions:c.filter(b=>b!==null),ownerDecisionEnabled:e.ownerDecisionEnabled,runtimeCapability:{hostRuntimeVersion:e.runtimeCapability.hostRuntimeVersion,shadowEvidence:e.runtimeCapability.shadowEvidence},liveMetrics:{last24Hours:d,last7Days:f,representativeSamples:e.liveMetrics.representativeSamples.map(b=>({toolName:b.toolName,decision:b.decision,pathCategory:b.pathCategory}))},behaviorDrift:{approvedBlockRate:typeof l.approvedBlockRate=="number"?l.approvedBlockRate:null,liveBlockRate:typeof l.liveBlockRate=="number"?l.liveBlockRate:null,delta:typeof l.delta=="number"?l.delta:null}}}function MD(e){if(!P(e))return null;let t={};for(let a of["decisionId","activationId","status","pauseId"])if(Object.hasOwn(e,a)){if(!w(e[a]))return null;t[a]=e[a]}if(Object.hasOwn(e,"version")){if(!Ye(e.version))return null;t.version=e.version}return t}function FD(e){return!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"status")||!w(e.status)?null:{activationId:e.activationId,status:e.status}}function K4(e){if(!P(e)||!Object.hasOwn(e,"insufficientData")||!xt(e.insufficientData))return null;let t=i4(e,"rate");return!t.valid||!Object.hasOwn(e,"note")||!w(e.note)?null:{insufficientData:e.insufficientData,rate:t.value,note:e.note}}function Y4(e){if(!P(e)||!Object.hasOwn(e,"ruleId")||!w(e.ruleId)||!Object.hasOwn(e,"triggered")||!Ye(e.triggered))return null;let t=vt(e,"lastTriggeredAt");return t.valid?{ruleId:e.ruleId,triggered:e.triggered,lastTriggeredAt:t.value}:null}function UD(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"adherence"))return null;let t=K4(e.adherence);if(t===null||!Object.hasOwn(e,"ruleMetrics")||!Array.isArray(e.ruleMetrics))return null;let a=Yt(e.ruleMetrics,Y4);return a===null?null:{principleId:e.principleId,adherence:t,ruleMetrics:a}}var X4=["up_to_date","update_available","update_blocked","check_failed"];function Cu(e){if(!P(e)||!Object.hasOwn(e,"currentVersion")||!w(e.currentVersion)||!Object.hasOwn(e,"latestVersion")||!w(e.latestVersion)||!Object.hasOwn(e,"hasUpdate")||!xt(e.hasUpdate))return null;let t={currentVersion:e.currentVersion,latestVersion:e.latestVersion,hasUpdate:e.hasUpdate};if(Object.hasOwn(e,"state")&&w(e.state)&&X4.includes(e.state)&&(t.state=e.state),Object.hasOwn(e,"error")&&w(e.error)&&(t.error=e.error),Object.hasOwn(e,"message")&&w(e.message)&&(t.message=e.message),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),Object.hasOwn(e,"versionSource")&&(e.versionSource==="active-release"||e.versionSource==="plugin-package")&&(t.versionSource=e.versionSource),Object.hasOwn(e,"identityDivergence")&&P(e.identityDivergence)){let a=e.identityDivergence;Object.hasOwn(a,"activeVersion")&&w(a.activeVersion)&&Object.hasOwn(a,"pluginVersion")&&w(a.pluginVersion)&&Object.hasOwn(a,"releaseId")&&w(a.releaseId)&&Object.hasOwn(a,"generation")&&typeof a.generation=="number"&&(t.identityDivergence={activeVersion:a.activeVersion,pluginVersion:a.pluginVersion,releaseId:a.releaseId,generation:a.generation})}return t}var Z4=["update","reinstall","legacy_migration","rollback","refusal","failure","recovery","unknown"];function Q4(e){return typeof e=="string"&&Z4.includes(e)}function iD(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"timestamp")||!w(e.timestamp)||!Object.hasOwn(e,"fromVersion")||!w(e.fromVersion)||!Object.hasOwn(e,"toVersion")||!w(e.toVersion)||!Object.hasOwn(e,"success")||!xt(e.success)||!Object.hasOwn(e,"kind")||!Q4(e.kind))return null;let t={id:e.id,timestamp:e.timestamp,fromVersion:e.fromVersion,toVersion:e.toVersion,success:e.success,kind:e.kind};return Object.hasOwn(e,"backupPath")&&w(e.backupPath)&&(t.backupPath=e.backupPath),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),t}function _m(e){if(Array.isArray(e)){let a=Yt(e,iD);return a===null?null:{updates:a}}if(!P(e)||!Object.hasOwn(e,"updates")||!Array.isArray(e.updates))return null;let t=Yt(e.updates,iD);return t===null?null:{updates:t}}function Ic(e){if(!P(e)||!Object.hasOwn(e,"approvalId")||!w(e.approvalId)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"riskLevel")||!w(e.riskLevel)||!Object.hasOwn(e,"status")||!w(e.status)||Object.hasOwn(e,"confidence")&&!Ye(e.confidence)||!Object.hasOwn(e,"requestedAt")||!w(e.requestedAt))return null;let t={approvalId:e.approvalId,artifactId:e.artifactId,channel:e.channel,riskLevel:e.riskLevel,status:e.status,confidence:Object.hasOwn(e,"confidence")&&Ye(e.confidence)?e.confidence:void 0,requestedAt:e.requestedAt,decidedAt:Object.hasOwn(e,"decidedAt")&&w(e.decidedAt)?e.decidedAt:void 0,decidedBy:Object.hasOwn(e,"decidedBy")&&w(e.decidedBy)?e.decidedBy:void 0,decisionNote:Object.hasOwn(e,"decisionNote")&&w(e.decisionNote)?e.decisionNote:void 0,rejectionReason:Object.hasOwn(e,"rejectionReason")&&w(e.rejectionReason)?e.rejectionReason:void 0,summary:Object.hasOwn(e,"summary")&&w(e.summary)?e.summary:void 0,triggerReason:Object.hasOwn(e,"triggerReason")&&w(e.triggerReason)?e.triggerReason:void 0,confidenceLabel:Object.hasOwn(e,"confidenceLabel")&&w(e.confidenceLabel)?e.confidenceLabel:void 0,confidenceExplanation:Object.hasOwn(e,"confidenceExplanation")&&w(e.confidenceExplanation)?e.confidenceExplanation:void 0,effectDescription:Object.hasOwn(e,"effectDescription")&&w(e.effectDescription)?e.effectDescription:void 0,rejectionEffect:Object.hasOwn(e,"rejectionEffect")&&w(e.rejectionEffect)?e.rejectionEffect:void 0};return Object.hasOwn(e,"isMvpProven")&&xt(e.isMvpProven)&&(t.isMvpProven=e.isMvpProven),Object.hasOwn(e,"warning")&&w(e.warning)&&(t.warning=e.warning),t}var J4=["technical_pattern","diagnostic_residue","title_too_long"];function eU(e){return w(e)&&J4.includes(e)}function tU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"text")||!w(e.text)||!Object.hasOwn(e,"triggerPattern")||!w(e.triggerPattern)||!Object.hasOwn(e,"action")||!w(e.action)||!Object.hasOwn(e,"status")||!w(e.status)||!Object.hasOwn(e,"priority")||!w(e.priority)||!Object.hasOwn(e,"scope")||!w(e.scope))return null;let t=vt(e,"domain");if(!t.valid||!Object.hasOwn(e,"evaluability")||!w(e.evaluability)||!Object.hasOwn(e,"valueScore")||!Ye(e.valueScore)||!Object.hasOwn(e,"adherenceRate")||!Ye(e.adherenceRate)||!Object.hasOwn(e,"painPreventedCount")||!Ye(e.painPreventedCount)||!Object.hasOwn(e,"ruleCount")||!Ye(e.ruleCount)||!Object.hasOwn(e,"conflictsWithCount")||!Ye(e.conflictsWithCount)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"updatedAt")||!w(e.updatedAt))return null;let a={id:e.id,text:e.text,triggerPattern:e.triggerPattern,action:e.action,status:e.status,priority:e.priority,scope:e.scope,domain:t.value,evaluability:e.evaluability,valueScore:e.valueScore,adherenceRate:e.adherenceRate,painPreventedCount:e.painPreventedCount,ruleCount:e.ruleCount,conflictsWithCount:e.conflictsWithCount,createdAt:e.createdAt,updatedAt:e.updatedAt,detectedLanguage:"unknown"};if(Object.hasOwn(e,"detectedLanguage")){if(!w(e.detectedLanguage))return null;a.detectedLanguage=e.detectedLanguage}if(Object.hasOwn(e,"readabilityWarningCode")){if(!eU(e.readabilityWarningCode))return null;a.readabilityWarningCode=e.readabilityWarningCode}if(Object.hasOwn(e,"runtimeDeactivated")){if(e.runtimeDeactivated!==!0)return null;a.runtimeDeactivated=!0}return a}function aU(e){return!P(e)||!w(e.id)||e.id.length===0||e.layer!=="foundational"&&e.layer!=="operating"||!w(e.name)||e.name.length===0||!w(e.nameZh)||e.nameZh.length===0||!w(e.statement)||e.statement.length===0||!w(e.statementZh)||e.statementZh.length===0?null:{id:e.id,layer:e.layer,name:e.name,nameZh:e.nameZh,statement:e.statement,statementZh:e.statementZh}}function jD(e){if(!P(e)||!Object.hasOwn(e,"principles")||!Array.isArray(e.principles))return null;let t=Yt(e.principles,aU);return t===null?null:{principles:t}}function Bm(e){if(!P(e)||!Object.hasOwn(e,"principles")||!Array.isArray(e.principles)||!Object.hasOwn(e,"summary")||!P(e.summary))return null;let t=e.summary,{candidate:a,probation:n,active:r,deprecated:i,archived:o,total:s}=t;if(!Ye(a)||!Ye(n)||!Ye(r)||!Ye(i)||!Ye(o)||!Ye(s))return null;let l=Yt(e.principles,tU);if(l===null)return null;let c;if(Object.hasOwn(e,"categories")){if(!P(e.categories))return null;let f=e.categories,m={};for(let[p,b]of Object.entries(f)){if(!Ye(b))return null;m[p]=b}Object.keys(m).length>0&&(c=m)}if(Object.hasOwn(e,"approvalCrossCheckUnavailable")&&!w(e.approvalCrossCheckUnavailable))return null;let u=w(e.approvalCrossCheckUnavailable)?e.approvalCrossCheckUnavailable:void 0;if(Object.hasOwn(e,"revocationCheckUnavailable")&&!w(e.revocationCheckUnavailable))return null;let d=w(e.revocationCheckUnavailable)?e.revocationCheckUnavailable:void 0;return{principles:l,summary:{candidate:a,probation:n,active:r,deprecated:i,archived:o,total:s},...c!==void 0?{categories:c}:{},...u!==void 0?{approvalCrossCheckUnavailable:u}:{},...d!==void 0?{revocationCheckUnavailable:d}:{}}}function nU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t={id:e.id,artifactId:e.artifactId,channel:e.channel,createdAt:e.createdAt,status:e.status};if(Object.hasOwn(e,"revisionReviewUnavailable")){if(typeof e.revisionReviewUnavailable!="boolean")return null;t.revisionReviewUnavailable=e.revisionReviewUnavailable}return t}function rU(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"principleTitle")||!w(e.principleTitle)||!Object.hasOwn(e,"status")||!w(e.status)||!Object.hasOwn(e,"records")||!Array.isArray(e.records))return null;let t=Yt(e.records,nU);if(t===null)return null;let a={principleId:e.principleId,principleTitle:e.principleTitle,status:e.status,records:t};if(Object.hasOwn(e,"revisionReviewUnavailable")){if(typeof e.revisionReviewUnavailable!="boolean")return null;a.revisionReviewUnavailable=e.revisionReviewUnavailable}if(Object.hasOwn(e,"revisionReview")){let n=e.revisionReview;if(!P(n)||typeof n.oldStatement!="string"||typeof n.newStatement!="string"||!P(n.intentFields))return null;let r={};for(let i of["ownerIntent","targetBehavior","forbiddenBehavior","evidenceSource","validationExpectation"]){let o=n.intentFields[i];if(o!==void 0&&typeof o!="string")return null;typeof o=="string"&&(r[i]=o)}a.revisionReview={oldStatement:n.oldStatement,newStatement:n.newStatement,intentFields:r,...typeof n.artifactId=="string"?{artifactId:n.artifactId}:{},...typeof n.artifactDigest=="string"&&/^sha256:[a-f0-9]{64}$/.test(n.artifactDigest)?{artifactDigest:n.artifactDigest}:{}}}return Object.hasOwn(e,"candidateDescription")&&w(e.candidateDescription)&&e.candidateDescription.length>0&&(a.candidateDescription=e.candidateDescription),Object.hasOwn(e,"fitsPromptBudget")&&typeof e.fitsPromptBudget=="boolean"&&(a.fitsPromptBudget=e.fitsPromptBudget),Object.hasOwn(e,"promptBudgetTierFit")&&(e.promptBudgetTierFit==="fits_all_tiers"||e.promptBudgetTierFit==="model_dependent"||e.promptBudgetTierFit==="exceeds_max_tier"||e.promptBudgetTierFit==="unconfirmed")&&(a.promptBudgetTierFit=e.promptBudgetTierFit),Object.hasOwn(e,"artifactUnavailable")&&typeof e.artifactUnavailable=="boolean"&&(a.artifactUnavailable=e.artifactUnavailable),a}function Bx(e){if(!P(e)||!Object.hasOwn(e,"budget")||!Object.hasOwn(e,"usedChars")||!Object.hasOwn(e,"truncated"))return null;let{budget:t,usedChars:a,truncated:n}=e;if(typeof t!="number"||!Number.isInteger(t)||t<=0||typeof a!="number"||!Number.isInteger(a)||a<0||typeof n!="boolean")return null;let r={budget:t,usedChars:a,truncated:n};if(Object.hasOwn(e,"productionRotates")&&typeof e.productionRotates=="boolean"&&(r.productionRotates=e.productionRotates),Object.hasOwn(e,"eligibleCount")&&typeof e.eligibleCount=="number"&&Number.isInteger(e.eligibleCount)&&e.eligibleCount>=0&&(r.eligibleCount=e.eligibleCount),Object.hasOwn(e,"capacityStatus")&&(e.capacityStatus==="confirmed"||e.capacityStatus==="unconfirmed")&&(r.capacityStatus=e.capacityStatus),Object.hasOwn(e,"hostKind")&&(e.hostKind==="openclaw"||e.hostKind==="codex"||e.hostKind==="workbuddy")&&(r.hostKind=e.hostKind),Object.hasOwn(e,"route")&&(e.route==="legacy_trim"||e.route==="shared_render")&&(r.route=e.route),Object.hasOwn(e,"unit")&&e.unit==="utf16_code_units"&&(r.unit=e.unit),Object.hasOwn(e,"budgetScope")&&(e.budgetScope==="selected_lines"||e.budgetScope==="full_directive_context")&&(r.budgetScope=e.budgetScope),Object.hasOwn(e,"fullRenderChars")&&typeof e.fullRenderChars=="number"&&Number.isInteger(e.fullRenderChars)&&e.fullRenderChars>=0&&(r.fullRenderChars=e.fullRenderChars),Object.hasOwn(e,"oversizedActivationIds")&&Array.isArray(e.oversizedActivationIds)&&e.oversizedActivationIds.every(w)&&(r.oversizedActivationIds=e.oversizedActivationIds),Object.hasOwn(e,"oversizedDiagnosticTruncated")&&typeof e.oversizedDiagnosticTruncated=="boolean"&&(r.oversizedDiagnosticTruncated=e.oversizedDiagnosticTruncated),Object.hasOwn(e,"unconfirmedReason")&&w(e.unconfirmedReason)&&(r.unconfirmedReason=e.unconfirmedReason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(r.nextAction=e.nextAction),Object.hasOwn(e,"budgetCapacitySource")&&Ex(e.budgetCapacitySource)&&(r.budgetCapacitySource=e.budgetCapacitySource),Object.hasOwn(e,"budgetFallbackReason")&&Nx(e.budgetFallbackReason)&&(r.budgetFallbackReason=e.budgetFallbackReason),Object.hasOwn(e,"budgetCapacityStatus")&&Ox(e.budgetCapacityStatus)&&(r.budgetCapacityStatus=e.budgetCapacityStatus),Object.hasOwn(e,"budgetContextWindowTokens")&&typeof e.budgetContextWindowTokens=="number"&&Number.isInteger(e.budgetContextWindowTokens)&&e.budgetContextWindowTokens>0&&(r.budgetContextWindowTokens=e.budgetContextWindowTokens),Object.hasOwn(e,"budgetObservedAt")&&w(e.budgetObservedAt)&&e.budgetObservedAt.length>0&&Number.isFinite(Date.parse(e.budgetObservedAt))&&(r.budgetObservedAt=e.budgetObservedAt),Object.hasOwn(e,"perHost")&&Array.isArray(e.perHost)){let i=[];for(let o of e.perHost){if(!P(o))return null;let{hostKind:s,route:l,usedChars:c,truncated:u}=o;if(s!=="openclaw"&&s!=="codex"&&s!=="workbuddy"||l!=="legacy_trim"&&l!=="shared_render"||typeof c!="number"||!Number.isInteger(c)||c<0||typeof u!="boolean")return null;let d={hostKind:s,route:l,usedChars:c,truncated:u};Object.hasOwn(o,"budget")&&typeof o.budget=="number"&&Number.isInteger(o.budget)&&o.budget>0&&(d.budget=o.budget),Object.hasOwn(o,"budgetCapacitySource")&&Ex(o.budgetCapacitySource)&&(d.budgetCapacitySource=o.budgetCapacitySource),Object.hasOwn(o,"budgetCapacityStatus")&&Ox(o.budgetCapacityStatus)&&(d.budgetCapacityStatus=o.budgetCapacityStatus),Object.hasOwn(o,"budgetObservedAt")&&w(o.budgetObservedAt)&&o.budgetObservedAt.length>0&&Number.isFinite(Date.parse(o.budgetObservedAt))&&(d.budgetObservedAt=o.budgetObservedAt),Object.hasOwn(o,"budgetFallbackReason")&&Nx(o.budgetFallbackReason)&&(d.budgetFallbackReason=o.budgetFallbackReason),i.push(d)}r.perHost=i}return r}function HD(e){if(!P(e)||!Object.hasOwn(e,"groups")||!Array.isArray(e.groups)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt))return null;let t=Yt(e.groups,rU);if(t===null)return null;let a={groups:t,generatedAt:e.generatedAt};if(Object.hasOwn(e,"note")&&w(e.note)&&(a.note=e.note),Object.hasOwn(e,"promptInjection")){let n=Bx(e.promptInjection);n!==null&&(a.promptInjection=n)}return a}var iU=new Set(["recorded-only","evidence-only","diagnosis-queued","diagnosis-running","diagnosis-succeeded","diagnosis-failed","diagnosis-retry-wait","candidate-generated","internalization-missing","internalization-pending","internalization-running","internalization-failed","internalization-succeeded","owner-reviewable","malformed","degraded"]),zD=["none","action_drift","intent_suspect","healthy_tension"],qD=["weak","moderate","strong"],VD=["why","desired_outcome","non_negotiables","stop_escalation","current_strategic_focus"],GD=["confirm_drift","revise_intent","observe","dismiss","promote_to_principle","promote_to_rulehost"];function oU(e){if(!P(e)||Object.hasOwn(e,"confidence")||!Object.hasOwn(e,"source")||!w(e.source)||!zD.includes(e.source)||!Object.hasOwn(e,"evidenceStrength")||!w(e.evidenceStrength)||!qD.includes(e.evidenceStrength)||!Object.hasOwn(e,"relatedIntentFields")||!Array.isArray(e.relatedIntentFields))return null;let t=[];for(let i of e.relatedIntentFields){if(typeof i!="string"||!VD.includes(i))return null;t.push(i)}if(!Object.hasOwn(e,"evidence")||!Array.isArray(e.evidence))return null;let a=[];for(let i of e.evidence){if(typeof i!="string")return null;a.push(i)}let n=a.slice(0,3);if(!Object.hasOwn(e,"explanation")||!w(e.explanation)||e.explanation.length===0||!Object.hasOwn(e,"suggestedOwnerAction")||!w(e.suggestedOwnerAction)||!GD.includes(e.suggestedOwnerAction))return null;let r={source:e.source,evidenceStrength:e.evidenceStrength,relatedIntentFields:t,evidence:n,explanation:e.explanation,suggestedOwnerAction:e.suggestedOwnerAction};if(Object.hasOwn(e,"intentDocHash")){if(!w(e.intentDocHash))return null;r.intentDocHash=e.intentDocHash}return r}function Nm(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"source")||!w(e.source)||!zD.includes(e.source)||!Object.hasOwn(e,"evidenceStrength")||!w(e.evidenceStrength)||!qD.includes(e.evidenceStrength)||!Object.hasOwn(e,"relatedIntentFields")||!Array.isArray(e.relatedIntentFields))return null;let t=[];for(let r of e.relatedIntentFields){if(typeof r!="string"||!VD.includes(r))return null;t.push(r)}if(!Object.hasOwn(e,"ownerAction")||!w(e.ownerAction)||!GD.includes(e.ownerAction)||!Object.hasOwn(e,"evidenceRefs")||!Array.isArray(e.evidenceRefs))return null;let a=[];for(let r of e.evidenceRefs){if(typeof r!="string")return null;a.push(r)}if(!Object.hasOwn(e,"createdAt")||!w(e.createdAt))return null;let n={id:e.id,source:e.source,evidenceStrength:e.evidenceStrength,relatedIntentFields:t,ownerAction:e.ownerAction,evidenceRefs:a,createdAt:e.createdAt};if(Object.hasOwn(e,"painId")){if(!w(e.painId))return null;n.painId=e.painId}if(Object.hasOwn(e,"taskId")){if(!w(e.taskId))return null;n.taskId=e.taskId}if(Object.hasOwn(e,"runId")){if(!w(e.runId))return null;n.runId=e.runId}if(Object.hasOwn(e,"intentDocHash")){if(!w(e.intentDocHash))return null;n.intentDocHash=e.intentDocHash}if(Object.hasOwn(e,"resultingCandidateId")){if(!w(e.resultingCandidateId))return null;n.resultingCandidateId=e.resultingCandidateId}if(Object.hasOwn(e,"resultingRuleCandidateId")){if(!w(e.resultingRuleCandidateId))return null;n.resultingRuleCandidateId=e.resultingRuleCandidateId}if(Object.hasOwn(e,"patchProposalId")){if(!w(e.patchProposalId))return null;n.patchProposalId=e.patchProposalId}return n}function Mx(e){return Yt(e,Nm)}function $D(e){if(!P(e)||!Object.hasOwn(e,"record"))return null;let t=Nm(e.record);return t===null||!Object.hasOwn(e,"created")||!xt(e.created)?null:{record:t,created:e.created}}function WD(e){if(!P(e)||!Object.hasOwn(e,"counts")||!P(e.counts))return null;let{counts:t}=e;if(!Object.hasOwn(t,"confirm_drift")||!Ye(t.confirm_drift)||t.confirm_drift<0||!Object.hasOwn(t,"revise_intent")||!Ye(t.revise_intent)||t.revise_intent<0||!Object.hasOwn(t,"observe")||!Ye(t.observe)||t.observe<0||!Object.hasOwn(t,"dismiss")||!Ye(t.dismiss)||t.dismiss<0||!Object.hasOwn(t,"promote_to_principle")||!Ye(t.promote_to_principle)||t.promote_to_principle<0||!Object.hasOwn(t,"promote_to_rulehost")||!Ye(t.promote_to_rulehost)||t.promote_to_rulehost<0||!Object.hasOwn(e,"lastDecisionAt"))return null;let{lastDecisionAt:a}=e;return a!==null&&!w(a)?null:{counts:{confirm_drift:t.confirm_drift,revise_intent:t.revise_intent,observe:t.observe,dismiss:t.dismiss,promote_to_principle:t.promote_to_principle,promote_to_rulehost:t.promote_to_rulehost},lastDecisionAt:a}}var sU=new Set(["link_candidate","guide_rulehost","generate_patch_proposal"]);function KD(e){if(!P(e)||!Object.hasOwn(e,"type")||!w(e.type)||!sU.has(e.type)||!Object.hasOwn(e,"decisionId")||!w(e.decisionId))return null;let t=e.type,{decisionId:a}=e;if(t==="link_candidate"){if(!Object.hasOwn(e,"record"))return null;let i=Nm(e.record);return i===null||!Object.hasOwn(e,"linkedCandidateId")||!w(e.linkedCandidateId)?null:{type:"link_candidate",decisionId:a,record:i,linkedCandidateId:e.linkedCandidateId}}if(t==="guide_rulehost")return!Object.hasOwn(e,"cliCommand")||!w(e.cliCommand)||!Object.hasOwn(e,"note")||!w(e.note)?null:{type:"guide_rulehost",decisionId:a,cliCommand:e.cliCommand,note:e.note};if(!Object.hasOwn(e,"record"))return null;let n=Nm(e.record);if(n===null||!Object.hasOwn(e,"patchProposal")||!P(e.patchProposal))return null;let r=e.patchProposal;return!Object.hasOwn(r,"id")||!w(r.id)||!Object.hasOwn(r,"markdown")||!w(r.markdown)?null:{type:"generate_patch_proposal",decisionId:a,record:n,patchProposal:{id:r.id,markdown:r.markdown}}}function lU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"sourceKind")||!w(e.sourceKind)||!Object.hasOwn(e,"observedAt")||!w(e.observedAt)||!Object.hasOwn(e,"state")||!w(e.state)||!iU.has(e.state)||!Object.hasOwn(e,"summary")||!w(e.summary))return null;let t={id:e.id,sourceKind:e.sourceKind,observedAt:e.observedAt,state:e.state,summary:e.summary};if(Object.hasOwn(e,"hostKind")){if(!w(e.hostKind)||e.hostKind!=="openclaw"&&e.hostKind!=="codex"&&e.hostKind!=="unknown")return null;t.hostKind=e.hostKind}if(Object.hasOwn(e,"admissionDecision")){if(!w(e.admissionDecision))return null;t.admissionDecision=e.admissionDecision}if(Object.hasOwn(e,"linkedPainId")){if(!w(e.linkedPainId))return null;t.linkedPainId=e.linkedPainId}if(Object.hasOwn(e,"linkedTaskId")){if(!w(e.linkedTaskId))return null;t.linkedTaskId=e.linkedTaskId}if(Object.hasOwn(e,"linkedTaskStatus")){if(!w(e.linkedTaskStatus))return null;t.linkedTaskStatus=e.linkedTaskStatus}if(Object.hasOwn(e,"linkedCandidateId")){if(!w(e.linkedCandidateId))return null;t.linkedCandidateId=e.linkedCandidateId}if(Object.hasOwn(e,"linkedPrincipleId")){if(!w(e.linkedPrincipleId))return null;t.linkedPrincipleId=e.linkedPrincipleId}if(Object.hasOwn(e,"failureReason")){if(!w(e.failureReason))return null;t.failureReason=e.failureReason}if(Object.hasOwn(e,"degradedReason")){if(!w(e.degradedReason))return null;t.degradedReason=e.degradedReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}if(Object.hasOwn(e,"candidateTitle")){if(!w(e.candidateTitle))return null;t.candidateTitle=e.candidateTitle}if(Object.hasOwn(e,"candidateSummary")){if(!w(e.candidateSummary))return null;t.candidateSummary=e.candidateSummary}if(Object.hasOwn(e,"rootCauseSummary")){if(!w(e.rootCauseSummary))return null;t.rootCauseSummary=e.rootCauseSummary}if(Object.hasOwn(e,"confidence")){if(typeof e.confidence!="number"||!Number.isFinite(e.confidence))return null;t.confidence=e.confidence}if(Object.hasOwn(e,"recommendationKind")){if(!w(e.recommendationKind))return null;t.recommendationKind=e.recommendationKind}if(Object.hasOwn(e,"internalizationTaskId")){if(!w(e.internalizationTaskId))return null;t.internalizationTaskId=e.internalizationTaskId}if(Object.hasOwn(e,"dreamerTaskStatus")){if(!w(e.dreamerTaskStatus))return null;t.dreamerTaskStatus=e.dreamerTaskStatus}if(Object.hasOwn(e,"intentTension")){let a=oU(e.intentTension);a!==null&&(t.intentTension=a)}return t}function YD(e){if(!P(e)||!Object.hasOwn(e,"records")||!Array.isArray(e.records)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt))return null;let t=Yt(e.records,lU);if(t===null)return null;let a={records:t,generatedAt:e.generatedAt};if(Object.hasOwn(e,"degradedReason")){if(!w(e.degradedReason))return null;a.degradedReason=e.degradedReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;a.nextAction=e.nextAction}if(Object.hasOwn(e,"note")){if(!w(e.note))return null;a.note=e.note}return a}var cU=["zh-CN","en"];function Fx(e){return!P(e)||!Object.hasOwn(e,"outputLanguage")||!w(e.outputLanguage)||!cU.includes(e.outputLanguage)||!Object.hasOwn(e,"source")||!w(e.source)?null:{outputLanguage:e.outputLanguage,source:e.source}}function XD(e){if(!P(e)||!Object.hasOwn(e,"success")||typeof e.success!="boolean"||!Object.hasOwn(e,"message")||!w(e.message))return null;let t={success:e.success,message:e.message};return Object.hasOwn(e,"refusal")&&typeof e.refusal=="boolean"&&(t.refusal=e.refusal),Object.hasOwn(e,"state")&&w(e.state)&&(e.state==="update_blocked"||e.state==="awaiting_restart"||e.state==="update_in_progress")&&(t.state=e.state),Object.hasOwn(e,"transactionId")&&w(e.transactionId)&&(t.transactionId=e.transactionId),Object.hasOwn(e,"updatedFiles")&&Array.isArray(e.updatedFiles)&&(t.updatedFiles=e.updatedFiles.filter(a=>typeof a=="string")),Object.hasOwn(e,"backupPath")&&w(e.backupPath)&&(t.backupPath=e.backupPath),Object.hasOwn(e,"newVersion")&&w(e.newVersion)&&(t.newVersion=e.newVersion),Object.hasOwn(e,"partialUpdate")&&typeof e.partialUpdate=="boolean"&&(t.partialUpdate=e.partialUpdate),Object.hasOwn(e,"requiresRestart")&&typeof e.requiresRestart=="boolean"&&(t.requiresRestart=e.requiresRestart),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),Object.hasOwn(e,"gatewayNotice")&&w(e.gatewayNotice)&&(t.gatewayNotice=e.gatewayNotice),t}function Mm(e){if(!P(e)||!Object.hasOwn(e,"needsRecovery")||typeof e.needsRecovery!="boolean")return null;let t=[];if(Object.hasOwn(e,"unfinished")&&Array.isArray(e.unfinished))for(let o of e.unfinished)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||t.push({transactionId:o.transactionId,lastState:Object.hasOwn(o,"lastState")&&w(o.lastState)?o.lastState:null,lastAt:Object.hasOwn(o,"lastAt")&&w(o.lastAt)?o.lastAt:null,productVersion:Object.hasOwn(o,"productVersion")&&w(o.productVersion)?o.productVersion:null,tornTailDetected:Object.hasOwn(o,"tornTailDetected")&&typeof o.tornTailDetected=="boolean"?o.tornTailDetected:!1});let a=[];if(Object.hasOwn(e,"broken")&&Array.isArray(e.broken))for(let o of e.broken)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||a.push({transactionId:o.transactionId,reason:o.reason});let n=[];if(Object.hasOwn(e,"superseded")&&Array.isArray(e.superseded))for(let o of e.superseded)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||n.push({transactionId:o.transactionId,reason:o.reason});let r=[];if(Object.hasOwn(e,"recoveryRequired")&&Array.isArray(e.recoveryRequired))for(let o of e.recoveryRequired)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||r.push({transactionId:o.transactionId,reason:o.reason});let i={needsRecovery:e.needsRecovery,unfinished:t,broken:a,superseded:n,recoveryRequired:r};return Object.hasOwn(e,"activeRecordUnreadable")&&typeof e.activeRecordUnreadable=="boolean"&&(i.activeRecordUnreadable=e.activeRecordUnreadable),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(i.nextAction=e.nextAction),i}function Fm(e){return!P(e)||!Object.hasOwn(e,"transactionId")||!w(e.transactionId)||!Object.hasOwn(e,"exists")||typeof e.exists!="boolean"?null:{transactionId:e.transactionId,exists:e.exists,lastState:Object.hasOwn(e,"lastState")&&w(e.lastState)?e.lastState:null,terminal:Object.hasOwn(e,"terminal")&&typeof e.terminal=="boolean"?e.terminal:!1,tornTailDetected:Object.hasOwn(e,"tornTailDetected")&&typeof e.tornTailDetected=="boolean"?e.tornTailDetected:!1,startedAt:Object.hasOwn(e,"startedAt")&&w(e.startedAt)?e.startedAt:null,lastAt:Object.hasOwn(e,"lastAt")&&w(e.lastAt)?e.lastAt:null,productVersion:Object.hasOwn(e,"productVersion")&&w(e.productVersion)?e.productVersion:null,reason:Object.hasOwn(e,"reason")&&w(e.reason)?e.reason:void 0}}var dU=["evidence","diagnosis","proposal","review","deploy","behavior"],uU=["available","unavailable","not_applicable"];function fU(e){return w(e)&&dU.includes(e)}function pU(e){return w(e)&&uU.includes(e)}function mU(e){if(!P(e)||!Object.hasOwn(e,"key")||!fU(e.key)||!Object.hasOwn(e,"status")||!pU(e.status)||!Object.hasOwn(e,"summary")||!w(e.summary))return null;let t={key:e.key,status:e.status,summary:e.summary};if(Object.hasOwn(e,"detail")){if(!w(e.detail))return null;t.detail=e.detail}if(Object.hasOwn(e,"timestamp")){if(!w(e.timestamp))return null;t.timestamp=e.timestamp}if(Object.hasOwn(e,"unavailableReason")){if(!w(e.unavailableReason))return null;t.unavailableReason=e.unavailableReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}if(Object.hasOwn(e,"meta")){if(!P(e.meta))return null;t.meta=e.meta}return t}function ZD(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"stages")||!Array.isArray(e.stages))return null;let t=Yt(e.stages,mU);if(t===null)return null;let a={principleId:e.principleId,stages:t};if(Object.hasOwn(e,"degraded")){if(!P(e.degraded))return null;let n=e.degraded;if(!Object.hasOwn(n,"reason")||!w(n.reason)||!Object.hasOwn(n,"nextAction")||!w(n.nextAction))return null;a.degraded={reason:n.reason,nextAction:n.nextAction}}return a}var gU=["flag_disabled","not_found","read_error","parse_error","oversized"],hU=["missing_section","empty_section","too_vague","oversized","parse_failed"],bU=["why","desiredOutcome","nonNegotiables","stopEscalation","currentStrategicFocus"];function QD(e){if(!P(e)||!Object.hasOwn(e,"code")||!w(e.code)||!hU.includes(e.code)||!Object.hasOwn(e,"message")||!w(e.message))return null;let t={code:e.code,message:e.message};if(Object.hasOwn(e,"section")){if(!w(e.section))return null;t.section=e.section}return t}function vU(e){if(!P(e))return null;let t={};for(let a of bU)if(Object.hasOwn(e,a)){let n=e[a];if(n!==null&&!w(n))return null;w(n)&&(t[a]=n)}return t}function JD(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"found")||!xt(e.found)||!Object.hasOwn(e,"flagEnabled")||!xt(e.flagEnabled)||!Object.hasOwn(e,"warnings")||!Array.isArray(e.warnings))return null;let t=Yt(e.warnings,QD);if(t===null)return null;let a={ok:e.ok,found:e.found,flagEnabled:e.flagEnabled,warnings:t};if(Object.hasOwn(e,"reason")){if(!w(e.reason)||!gU.includes(e.reason))return null;a.reason=e.reason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;a.nextAction=e.nextAction}if(Object.hasOwn(e,"path")){if(!w(e.path))return null;a.path=e.path}if(Object.hasOwn(e,"contentHash")){if(!w(e.contentHash))return null;a.contentHash=e.contentHash}if(Object.hasOwn(e,"lastEditedAt")){if(!w(e.lastEditedAt))return null;a.lastEditedAt=e.lastEditedAt}if(Object.hasOwn(e,"sections")){let n=vU(e.sections);if(n===null)return null;a.sections=n}return a}function e1(e){return!P(e)||!Object.hasOwn(e,"content")||!w(e.content)||!Object.hasOwn(e,"path")||!w(e.path)?null:{content:e.content,path:e.path}}function t1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"created")||!xt(e.created))return null;let t={ok:e.ok,created:e.created},a=vt(e,"path");if(!a.valid)return null;a.value!==null&&(t.path=a.value);let n=vt(e,"reason");if(!n.valid)return null;n.value!==null&&(t.reason=n.value);let r=vt(e,"nextAction");return r.valid?(r.value!==null&&(t.nextAction=r.value),t):null}function a1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"saved")||!xt(e.saved))return null;let t={ok:e.ok,saved:e.saved},a=vt(e,"path");if(!a.valid)return null;a.value!==null&&(t.path=a.value);let n=vt(e,"contentHash");if(!n.valid)return null;n.value!==null&&(t.contentHash=n.value);let r=vt(e,"lastEditedAt");if(!r.valid)return null;r.value!==null&&(t.lastEditedAt=r.value);let i=vt(e,"reason");if(!i.valid)return null;i.value!==null&&(t.reason=i.value);let o=vt(e,"nextAction");if(!o.valid)return null;if(o.value!==null&&(t.nextAction=o.value),Object.hasOwn(e,"warnings")){if(!Array.isArray(e.warnings))return null;let s=Yt(e.warnings,QD);if(s===null)return null;t.warnings=s}return t}function xU(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"lang")||!w(e.lang)||!Object.hasOwn(e,"contentHash")||!w(e.contentHash)||!Object.hasOwn(e,"contentSnapshot")||!w(e.contentSnapshot)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)?null:{id:e.id,lang:e.lang,contentHash:e.contentHash,contentSnapshot:e.contentSnapshot,reason:e.reason,createdAt:e.createdAt}}function n1(e){if(!P(e)||!Object.hasOwn(e,"versions")||!Array.isArray(e.versions))return null;let t=Yt(e.versions,xU);return t===null?null:{versions:t}}function Ux(e){return!P(e)||!Object.hasOwn(e,"authenticationMode")||e.authenticationMode!=="authenticated"&&e.authenticationMode!=="no_auth"||!Object.hasOwn(e,"ownerIdentityConfiguration")||e.ownerIdentityConfiguration!=="configured"&&e.ownerIdentityConfiguration!=="missing"&&e.ownerIdentityConfiguration!=="invalid"?null:{authenticationMode:e.authenticationMode,ownerIdentityConfiguration:e.ownerIdentityConfiguration}}function yU(e){if(e==null||!P(e))return null;let t=e;return!Object.hasOwn(t,"schemaVersion")||!Ye(t.schemaVersion)||!Object.hasOwn(t,"ownerId")||!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||!w(t.credentialId)||!Object.hasOwn(t,"registeredAt")||!w(t.registeredAt)?null:{schemaVersion:t.schemaVersion,ownerId:t.ownerId,credentialId:t.credentialId,registeredAt:t.registeredAt}}function r1(e){if(!P(e)||!Object.hasOwn(e,"resolved")||!P(e.resolved))return null;let t=e.resolved;if(!Object.hasOwn(t,"ownerId")||t.ownerId!==null&&!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||t.credentialId!==null&&!w(t.credentialId)||!Object.hasOwn(t,"source")||t.source!=="env"&&t.source!=="file"&&t.source!=="none"&&t.source!=="invalid_env")return null;let a=Ux(e.governance);if(a===null)return null;let n={resolved:{ownerId:t.ownerId,credentialId:t.credentialId,source:t.source,...Object.hasOwn(t,"error")&&w(t.error)?{error:t.error}:{}},fileRecord:yU(e.fileRecord),governance:a};return Object.hasOwn(e,"fileError")&&w(e.fileError)&&(n.fileError=e.fileError),n}function i1(e){if(!P(e)||!Object.hasOwn(e,"source")||e.source!=="file"||!Object.hasOwn(e,"record")||!P(e.record))return null;let t=e.record;if(!Object.hasOwn(t,"schemaVersion")||!Ye(t.schemaVersion)||!Object.hasOwn(t,"ownerId")||!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||!w(t.credentialId)||!Object.hasOwn(t,"registeredAt")||!w(t.registeredAt))return null;let a=Ux(e.governance);return a===null?null:{source:"file",record:{schemaVersion:t.schemaVersion,ownerId:t.ownerId,credentialId:t.credentialId,registeredAt:t.registeredAt},governance:a}}function o1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||e.ok!==!0||!Object.hasOwn(e,"source")||e.source!=="none")return null;let t=Ux(e.governance);return t===null?null:{ok:!0,source:"none",governance:t}}var wU=new Set(["evaluator_review","rollout_review","activation_approval","rulecode_decision"]),kU=new Set(["accept_current","revise_once","reject_current","approve","reject","promote","reject_after_shadow"]);function SU(e){if(!P(e))return null;let{provenance:t}=e;if(!w(e.version))return null;let a=vt(e,"sourcePainId");if(!a.valid||!Array.isArray(e.notes))return null;let n=[];for(let l of e.notes){if(!w(l))return null;n.push(l)}if(!P(t))return null;let r=vt(t,"sourceDreamerArtifactId");if(!r.valid||r.value===null)return null;let i=vt(t,"sourceDiagnosisArtifactId"),o=vt(t,"sourceDiagnosisTaskId");if(!i.valid||!o.valid)return null;let s={version:e.version,sourcePainId:a.value,provenance:{sourceDreamerArtifactId:r.value,sourceDiagnosisArtifactId:i.value,sourceDiagnosisTaskId:o.value},notes:n};if(e.diagnosis!==void 0){if(!P(e.diagnosis))return null;let{diagnosis:l}=e,c=vt(l,"rootCause"),u=vt(l,"summary");if(!c.valid||!u.valid||!Array.isArray(l.evidence))return null;let d=[];for(let f of l.evidence){if(!P(f))return null;let m=vt(f,"sourceRef"),p=vt(f,"note");if(!m.valid||m.value===null||!p.valid||p.value===null)return null;d.push({sourceRef:m.value,note:p.value})}s.diagnosis={rootCause:c.value,summary:u.value,evidence:d}}return s}function al(e){return!Array.isArray(e)||e.some(t=>typeof t!="string")?null:e}function CU(e){if(!P(e)||!P(e.brief)||!P(e.evidence)||!P(e.capability))return null;let{brief:t,evidence:a,capability:n}=e;if(t.kind!=="evaluator"&&t.kind!=="rollout")return null;let r=al(t.requiredChanges);if(r===null)return null;let i={kind:t.kind,requiredChanges:r};if(t.kind==="evaluator"){if(!P(t.principle)||!P(t.implementation))return null;let c=al(t.principle.scope),u=al(t.implementation.affectedTools),d=al(t.implementation.risks),f=al(t.strengths),m=al(t.concerns);if(c===null||u===null||d===null||f===null||m===null)return null;i.principle={scope:c};for(let p of["title","statement","rationale"]){let b=t.principle[p];if(b!==void 0&&!w(b))return null;w(b)&&(i.principle[p]=b)}if(i.implementation={affectedTools:u,risks:d},t.implementation.summary!==void 0&&!w(t.implementation.summary)||(w(t.implementation.summary)&&(i.implementation.summary=t.implementation.summary),i.strengths=f,i.concerns=m,t.score!==void 0&&!Ye(t.score)))return null;if(Ye(t.score)&&(i.score=t.score),t.qualityChecklist!==void 0){let p=["understandability","evidence","actionability","generalization","boundary"],b=t.qualityChecklist;if(P(b)&&b.schemaVersion===1&&Array.isArray(b.items)){let v=[],g=!0,h=new Set;for(let y of b.items){if(!P(y)||!w(y.id)||typeof y.pass!="boolean"||!w(y.note)){g=!1;break}h.add(y.id),v.push({id:y.id,pass:y.pass,note:y.note})}g&&v.length===p.length&&p.every(y=>h.has(y))&&(i.qualityChecklist={schemaVersion:1,items:v})}}if(t.formationEvidence!==void 0){let p=SU(t.formationEvidence);p!==null&&(i.formationEvidence=p)}}else{let c=al(t.risks);if(c===null||t.summary!==void 0&&!w(t.summary))return null;w(t.summary)&&(i.summary=t.summary),i.risks=c}if(a.completeness!=="complete"&&a.completeness!=="partial"&&a.completeness!=="insufficient"||!w(a.digest)||!Array.isArray(a.deterministicChecks)||!Array.isArray(a.items))return null;let o=[];for(let c of a.deterministicChecks){if(!P(c)||!w(c.check)||c.status!=="passed"&&c.status!=="failed"&&c.status!=="not_run"&&c.status!=="unavailable")return null;o.push({check:c.check,status:c.status})}let s=[];for(let c of a.items){if(!P(c)||!w(c.evidenceClass)||!w(c.label)||!w(c.value))return null;s.push({evidenceClass:c.evidenceClass,label:c.label,value:c.value})}if(!P(n.acceptRequirement))return null;let l=n.acceptRequirement;return l.kind!=="none"&&l.kind!=="acknowledge_partial_evidence"&&l.kind!=="forbidden"||l.reasonCode!==void 0&&!w(l.reasonCode)?null:{brief:i,evidence:{completeness:a.completeness,deterministicChecks:o,items:s,digest:a.digest},capability:{acceptRequirement:{kind:l.kind,...w(l.reasonCode)?{reasonCode:l.reasonCode}:{}}}}}function RU(e){if(!P(e))return null;let{reviewKey:t}=e,{kind:a}=e,{taskId:n}=e,{title:r}=e,{summary:i}=e,{reasonCode:o}=e,{createdAt:s}=e;if(!w(t)||!w(a)||!w(n)||!w(r)||!w(i)||!w(o)||!w(s)||!wU.has(a)||!Object.hasOwn(e,"legacy")||!xt(e.legacy)||!Object.hasOwn(e,"allowedActions")||!Array.isArray(e.allowedActions))return null;for(let m of e.allowedActions)if(typeof m!="string"||!kU.has(m))return null;if(!Object.hasOwn(e,"expectedRevisionEpoch")||!Ye(e.expectedRevisionEpoch))return null;let{expectedRevisionEpoch:l}=e,{expectedSourceRunId:c}=e,{expectedSourceArtifactId:u}=e,{expectedSourceArtifactHash:d}=e;if(!w(c)||!w(u)||!w(d))return null;let f={reviewKey:t,kind:a,taskId:n,title:r,summary:i,reasonCode:o,legacy:e.legacy,allowedActions:e.allowedActions,expectedRevisionEpoch:l,expectedSourceRunId:c,expectedSourceArtifactId:u,expectedSourceArtifactHash:d,createdAt:s};if(Object.hasOwn(e,"expectedEvidenceDigest")){if(!w(e.expectedEvidenceDigest))return null;f.expectedEvidenceDigest=e.expectedEvidenceDigest}if(Object.hasOwn(e,"review")){let m=CU(e.review);if(m===null||f.expectedEvidenceDigest!==void 0&&f.expectedEvidenceDigest!==m.evidence.digest)return null;f.review=m}if(Object.hasOwn(e,"evidenceUnavailableReason")){if(!w(e.evidenceUnavailableReason)||e.evidenceUnavailableReason.trim()==="")return null;f.evidenceUnavailableReason=e.evidenceUnavailableReason}if((a==="evaluator_review"||a==="rollout_review")&&f.evidenceUnavailableReason===void 0&&(f.expectedEvidenceDigest===void 0||f.review===void 0))return null;if(Object.hasOwn(e,"machineRecommendation")){if(!w(e.machineRecommendation))return null;f.machineRecommendation=e.machineRecommendation}if(Object.hasOwn(e,"score")){if(!Ye(e.score))return null;f.score=e.score}if(Object.hasOwn(e,"principleId")){if(!w(e.principleId))return null;f.principleId=e.principleId}return f}function s1(e){if(!P(e)||!Object.hasOwn(e,"items")||!Array.isArray(e.items))return null;let t=[];for(let a of e.items){let n=RU(a);if(n===null)return null;t.push(n)}return!Object.hasOwn(e,"total")||!Ye(e.total)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt)?null:{items:t,total:e.total,generatedAt:e.generatedAt}}function l1(e){if(!P(e)||!Object.hasOwn(e,"status")||e.status!=="resolved")return null;let{resolutionId:t}=e,{reviewKey:a}=e,{action:n}=e;if(!w(t)||!w(a)||!w(n)||!Object.hasOwn(e,"applied")||!xt(e.applied)||!Object.hasOwn(e,"runnerWillApply")||!xt(e.runnerWillApply))return null;let r={status:"resolved",resolutionId:t,reviewKey:a,action:n,applied:e.applied,runnerWillApply:e.runnerWillApply};if(Object.hasOwn(e,"effectiveDecision")){if(!w(e.effectiveDecision))return null;r.effectiveDecision=e.effectiveDecision}if(Object.hasOwn(e,"targetTaskId")){if(!w(e.targetTaskId))return null;r.targetTaskId=e.targetTaskId}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;r.nextAction=e.nextAction}return r}function Ru(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function c1(e){if(!Ru(e)||e.writeGuardVersion!=="approval-review-v1"||!Ru(e.review))return null;let t=Ic(e),a=e.review.expectedReview,{material:n}=e.review;if(!t||!Ru(a)||a.schemaVersion!=="approval-review-v1"||a.approvalId!==t.approvalId||a.artifactId!==t.artifactId||a.channel!==t.channel||!["prompt","code_tool_hook","defer_archive"].includes(String(a.channel))||a.artifactState!=="present"&&a.artifactState!=="missing"||a.artifactState==="present"&&(typeof a.artifactDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(a.artifactDigest))||!Ru(n)||n.artifactId!==t.artifactId||!["available","missing","unreadable"].includes(String(n.availability))||n.statement!==null&&typeof n.statement!="string"||n.rationale!==null&&typeof n.rationale!="string"||n.targetBehavior!==null&&typeof n.targetBehavior!="string"||!Array.isArray(n.scope)||!n.scope.every(c=>typeof c=="string")||n.risks!==null&&(!Array.isArray(n.risks)||!n.risks.every(c=>typeof c=="string"))||a.artifactState==="missing"&&(n.availability!=="missing"||n.exactBody!==null||n.statement!==null||Object.hasOwn(a,"artifactDigest"))||a.artifactState==="present"&&n.availability==="missing")return null;let r=n.exactBody,i=null;if(r!==null){if(!Ru(r)||r.kind!=="principle"&&r.kind!=="rule_code"||typeof r.text!="string")return null;i={kind:r.kind,text:r.text}}let{channel:o}=a;if(o!=="prompt"&&o!=="code_tool_hook"&&o!=="defer_archive"||n.availability==="available"!=(i!==null)||i!==null&&o==="code_tool_hook"!=(i.kind==="rule_code"))return null;let s=a.artifactState==="present"&&typeof a.artifactDigest=="string"?{schemaVersion:"approval-review-v1",approvalId:t.approvalId,artifactId:t.artifactId,channel:o,artifactState:"present",artifactDigest:a.artifactDigest}:{schemaVersion:"approval-review-v1",approvalId:t.approvalId,artifactId:t.artifactId,channel:o,artifactState:"missing"},{availability:l}=n;return l!=="available"&&l!=="missing"&&l!=="unreadable"?null:{approval:t,expectedReview:s,material:{availability:l,artifactId:t.artifactId,statement:n.statement,rationale:n.rationale,targetBehavior:n.targetBehavior,scope:n.scope,risks:n.risks,exactBody:i}}}var ss="pd_token";function Ac(e){let t=globalThis;return(e==="local"?t.localStorage:t.sessionStorage)??null}function d1(e,t){let a=e??Ac("local"),n=t??Ac("session"),r=a?.getItem(ss)??null;if(r!==null)return r;let i=n?.getItem(ss)??null;return i===null?null:(a?.setItem(ss,i),n?.removeItem(ss),i)}function u1(e,t,a){let n=t??Ac("local"),r=a??Ac("session");n?.setItem(ss,e),r?.removeItem(ss)}function f1(e,t){let a=e??Ac("local"),n=t??Ac("session");a?.removeItem(ss),n?.removeItem(ss)}function p1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ei(e){return typeof e=="string"&&e.trim().length>0}function Um(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function m1(e){return e.status==="refused"&&Ei(e.reason)&&Ei(e.nextAction)?{status:"refused",reason:e.reason,nextAction:e.nextAction}:null}function g1(e){return p1(e)?e.status==="refused"?m1(e):e.status!=="ready"||!Ei(e.activationId)||!Ei(e.candidateId)||!Ei(e.principleId)||!Ei(e.artificerTaskId)||!Ei(e.expectedArtifactId)||!Ei(e.expectedArtifactDigest)||!/^sha256:[a-f0-9]{64}$/.test(e.expectedArtifactDigest)||!Um(e.expectedBindingRevision)||!Um(e.expectedControlVersion)||!Um(e.expectedTaskRevisionEpoch)?null:{status:"ready",activationId:e.activationId,candidateId:e.candidateId,principleId:e.principleId,artificerTaskId:e.artificerTaskId,expectedArtifactId:e.expectedArtifactId,expectedArtifactDigest:e.expectedArtifactDigest,expectedBindingRevision:e.expectedBindingRevision,expectedControlVersion:e.expectedControlVersion,expectedTaskRevisionEpoch:e.expectedTaskRevisionEpoch}:null}function h1(e){return p1(e)?e.status==="refused"?m1(e):e.status!=="started"&&e.status!=="already_started"||!Ei(e.artificerTaskId)||!Ei(e.causeId)||!Um(e.taskRevisionEpoch)?null:{status:e.status,artificerTaskId:e.artificerTaskId,causeId:e.causeId,taskRevisionEpoch:e.taskRevisionEpoch}:null}function tn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Yr(e){return e===null||typeof e=="string"}function b1(e){return!tn(e)||typeof e.painId!="string"||!Yr(e.text)||typeof e.source!="string"||!Yr(e.createdAt)?null:{painId:e.painId,text:e.text,source:e.source,createdAt:e.createdAt}}var IU=["not_built","in_progress","blocked","advanced","ambiguous"];function AU(e){return typeof e=="string"&&IU.includes(e)}function v1(e){return e===null?null:!tn(e)||!AU(e.stage)||!Yr(e.stageKind)||!Yr(e.reasonCode)||!Yr(e.detail)?"invalid":{stage:e.stage,stageKind:e.stageKind,reasonCode:e.reasonCode,detail:e.detail}}function x1(e){return e===null?null:!tn(e)||e.status!=="ready"&&e.status!=="refused"||!Yr(e.reason)||!Yr(e.scribeTaskId)||!(e.taskRevisionEpoch===null||Bn(e.taskRevisionEpoch))?"invalid":{status:e.status,reason:e.reason,scribeTaskId:e.scribeTaskId,taskRevisionEpoch:e.taskRevisionEpoch}}function y1(e){return e===null?null:!tn(e)||e.status!=="ready"&&e.status!=="unavailable"||!Yr(e.reason)||!Yr(e.scribeTaskId)||!Yr(e.artificerTaskId)||!Yr(e.scribeArtifactDigest)||!(e.expectedBindingRevision===null||Bn(e.expectedBindingRevision))||e.status==="ready"&&(e.scribeTaskId===null||e.artificerTaskId===null||e.scribeArtifactDigest===null||e.expectedBindingRevision===null)?"invalid":{status:e.status,reason:e.reason,scribeTaskId:e.scribeTaskId,artificerTaskId:e.artificerTaskId,scribeArtifactDigest:e.scribeArtifactDigest,expectedBindingRevision:e.expectedBindingRevision}}function DU(e){return tn(e)?e.status==="unlinked"?{status:"unlinked"}:e.status==="binding_revoked"?{status:"binding_revoked"}:e.status==="attention"&&typeof e.reason=="string"?{status:"attention",reason:e.reason}:e.status==="bound"&&tn(e.principle)&&typeof e.principle.principleId=="string"&&typeof e.principle.text=="string"&&typeof e.principle.status=="string"&&Bn(e.principle.version)&&Bn(e.principle.revision)&&typeof e.principle.decidedAt=="string"?{status:"bound",principle:{principleId:e.principle.principleId,text:e.principle.text,status:e.principle.status,version:e.principle.version,revision:e.principle.revision,decidedAt:e.principle.decidedAt}}:null:null}function w1(e){if(!tn(e)||!Array.isArray(e.items)||typeof e.truncated!="boolean"||!tn(e.summary)||!Bn(e.summary.painGroups)||!Bn(e.summary.candidates)||!Bn(e.summary.bound)||!Bn(e.summary.unlinked)||!Bn(e.summary.blocked))return null;let t=[],a=new Set;for(let n of e.items){if(!tn(n)||typeof n.candidateId!="string"||typeof n.text!="string"||typeof n.diagnosisStatus!="string"||a.has(n.candidateId))return null;a.add(n.candidateId);let r=b1(n.pain),i=DU(n.binding),o=v1(n.generation),s=x1(n.resume),l=y1(n.sourceCorrection);if(!r||!i||o==="invalid"||s==="invalid"||l==="invalid"||!Object.hasOwn(n,"generation")||!Object.hasOwn(n,"resume")||!Object.hasOwn(n,"sourceCorrection"))return null;t.push({candidateId:n.candidateId,text:n.text,pain:r,diagnosisStatus:n.diagnosisStatus,binding:i,generation:o,resume:s,sourceCorrection:l})}return{items:t,summary:{painGroups:e.summary.painGroups,candidates:e.summary.candidates,bound:e.summary.bound,unlinked:e.summary.unlinked,blocked:e.summary.blocked},truncated:e.truncated}}function k1(e){if(!tn(e)||typeof e.candidateId!="string"||typeof e.candidateText!="string"||typeof e.evidence!="string"||typeof e.candidateDigest!="string"||!Bn(e.currentRevision)||typeof e.resumeNotice!="string"||!Array.isArray(e.eligibleTargets)||e.eligibleTargets.length>20)return null;let t=b1(e.sourcePain);if(!t)return null;let a=null;if(e.currentBinding!==null){let l=e.currentBinding;if(!tn(l)||l.action!=="bind"&&l.action!=="revoke"||typeof l.principleId!="string"||typeof l.reason!="string"||!Bn(l.revision))return null;a={action:l.action,principleId:l.principleId,reason:l.reason,revision:l.revision}}let n=null;if(e.boundPrinciple!==null){if(!tn(e.boundPrinciple)||typeof e.boundPrinciple.principleId!="string"||typeof e.boundPrinciple.text!="string"||typeof e.boundPrinciple.status!="string"||!Bn(e.boundPrinciple.version)||!Bn(e.boundPrinciple.revision)||typeof e.boundPrinciple.decidedAt!="string")return null;n={principleId:e.boundPrinciple.principleId,text:e.boundPrinciple.text,status:e.boundPrinciple.status,version:e.boundPrinciple.version,revision:e.boundPrinciple.revision,decidedAt:e.boundPrinciple.decidedAt}}let r=[];for(let l of e.eligibleTargets){if(!tn(l)||typeof l.principleId!="string"||typeof l.text!="string"||typeof l.status!="string"||!Bn(l.version)||typeof l.digest!="string")return null;r.push({principleId:l.principleId,text:l.text,status:l.status,version:l.version,digest:l.digest})}if(!Object.hasOwn(e,"generation")||!Object.hasOwn(e,"resume")||!Object.hasOwn(e,"sourceCorrection"))return null;let i=v1(e.generation),o=x1(e.resume),s=y1(e.sourceCorrection);return i==="invalid"||o==="invalid"||s==="invalid"?null:{candidateId:e.candidateId,candidateText:e.candidateText,sourcePain:t,evidence:e.evidence,candidateDigest:e.candidateDigest,currentRevision:e.currentRevision,currentBinding:a,boundPrinciple:n,eligibleTargets:r,generation:i,resume:o,sourceCorrection:s,resumeNotice:e.resumeNotice}}function S1(e){return!tn(e)||!["bound","already_bound","revoked","already_revoked"].includes(String(e.status))||typeof e.status!="string"||e.runtimeDeactivated!==!1||e.inFlightOperationsMayComplete!==!0||e.nextAction!==void 0&&typeof e.nextAction!="string"||e.revision!==void 0&&(!tn(e.revision)||typeof e.revision.status!="string")?null:{status:e.status,...tn(e.revision)&&typeof e.revision.status=="string"?{revisionStatus:e.revision.status}:{},...typeof e.nextAction=="string"?{nextAction:e.nextAction}:{}}}function jx(e){return!tn(e)||typeof e.status!="string"||e.status.length===0||e.reason!==void 0&&typeof e.reason!="string"||e.nextAction!==void 0&&typeof e.nextAction!="string"?null:{status:e.status,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.nextAction=="string"?{nextAction:e.nextAction}:{}}}function Hm(){return d1()}function Iu(e){u1(e)}function so(){f1()}function LU(e){return!(e==="#/login"||e.startsWith("#/login?"))}function NU(e,t){return t===e}async function J(e,t,a){let n=Hm(),r={"Content-Type":"application/json"};n&&(r.Authorization=`Bearer ${n}`);try{let i=await fetch(e,{...t,headers:{...r,...bD(t?.headers)??{}}});if(!i.ok){i.status===401&&NU(n,Hm())&&(so(),LU(window.location.hash)&&(window.location.hash="#/login?session_expired=true"));let l=`HTTP ${i.status}`,c,u,d;try{let f=await i.json(),m=hD(f);m&&(m.message?l=m.message:m.error&&(l=m.error),m.error&&({error:c}=m),m.reason&&({reason:d}=m),m.nextAction&&({nextAction:u}=m))}catch{}return{success:!1,error:l,code:c,reason:d,nextAction:u,status:i.status}}let o=await i.json(),s=o&&typeof o=="object"&&Object.hasOwn(o,"success")&&Object.hasOwn(o,"data")?o.data:o;if(a){let l=a(s);return l!==null?{success:!0,data:l}:{success:!1,error:"Response validation failed: unexpected data shape from server",nextAction:"Try refreshing the page. If the problem persists, report it."}}return{success:!0,data:s}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Network error"}}}async function Au(){return(await J("/api/health")).success}function Du(){return J("/api/v1/governance/rule-candidate-bindings",void 0,w1)}function C1(e,t=""){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/review?search=${encodeURIComponent(t)}`,void 0,k1)}function R1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)},S1)}function I1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/revise-once`,{method:"POST",body:JSON.stringify(t)},jx)}function A1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/source-correct-once`,{method:"POST",body:JSON.stringify(t)},jx)}async function zm(){return J("/api/workspaces",void 0,SD)}async function D1(e,t){return J("/api/workspaces",{method:"POST",body:JSON.stringify({name:e,path:t})},Px)}async function L1(e){return J(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"},CD)}async function N1(e){return J(`/api/workspaces/${encodeURIComponent(e)}/sync`,{method:"POST"},RD)}async function qm(e){let t=e===void 0?"":`?filter=${e}`;return J(`/api/principles${t}`,void 0,Bm)}async function E1(){return J("/api/principles/core",void 0,jD)}async function O1(e){return J(`/api/principles/${encodeURIComponent(e)}`)}async function T1(e){return J(`/api/v1/principles/${encodeURIComponent(e)}/governance`,void 0,sD)}async function Vm(e){return J(`/api/v1/principles/${encodeURIComponent(e)}/owner-decision-view`,void 0,cD)}async function P1(){return J("/api/v1/principles/owner-decision-inbox",void 0,dD)}async function _1(){return J("/api/v1/principles/owner-decision-library",void 0,uD)}async function B1(e){return J(`/api/principles/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function M1(e){return J(`/api/principles/${encodeURIComponent(e)}/unarchive`,{method:"POST"})}async function F1(e){return J(`/api/principles/${encodeURIComponent(e)}/trajectory`,void 0,ZD)}var EU=new Set(["available","disabled","unavailable"]),OU=new Set(["valid","partial","malformed"]);function Hx(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.sourceStatus!="string"||!EU.has(t.sourceStatus)||typeof t.validationStatus!="string"||!OU.has(t.validationStatus)||t.observedFrom!==null&&typeof t.observedFrom!="string"||typeof t.asOf!="string"||typeof t.retentionPolicyDays!="number"?null:{sourceStatus:t.sourceStatus,validationStatus:t.validationStatus,observedFrom:t.observedFrom,asOf:t.asOf,retentionPolicyDays:t.retentionPolicyDays,...typeof t.reasonCode=="string"?{reasonCode:t.reasonCode}:{},...typeof t.nextActionCode=="string"?{nextActionCode:t.nextActionCode}:{}}}var TU=new Set(["rule_blocked","auto_correct_applied","self_reported","prompt_injected"]);function PU(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.kind!="string"||!TU.has(t.kind)||t.level!=="effect"&&t.level!=="presence"||typeof t.createdAt!="string")return null;let a=n=>typeof n=="string"&&n.length>0?n:null;return{kind:t.kind,level:t.level,sessionId:a(t.sessionId),toolName:a(t.toolName),filePath:a(t.filePath),digest:a(t.digest),createdAt:t.createdAt}}function _U(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.principleId!="string")return null;let a=Hx(t.coverage);if(a===null)return null;let n=[];if(Array.isArray(t.events))for(let r of t.events){let i=PU(r);i&&n.push(i)}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,principleId:t.principleId,effectCount:typeof t.effectCount=="number"?t.effectCount:0,presenceCount:typeof t.presenceCount=="number"?t.presenceCount:0,lastEffectAt:typeof t.lastEffectAt=="string"?t.lastEffectAt:null,events:n,coverage:a}}function BU(e){if(typeof e!="object"||e===null)return null;let t=e,a=Hx(t.coverage);if(a===null)return null;let n=[];if(Array.isArray(t.counts))for(let r of t.counts){if(typeof r!="object"||r===null)continue;let i=r;typeof i.principleId=="string"&&n.push({principleId:i.principleId,effectCount:typeof i.effectCount=="number"?i.effectCount:0,presenceCount:typeof i.presenceCount=="number"?i.presenceCount:0,lastEffectAt:typeof i.lastEffectAt=="string"?i.lastEffectAt:null})}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,counts:n,coverage:a}}async function U1(e){return J(`/api/v1/receipts/principles/${encodeURIComponent(e)}`,void 0,_U)}async function j1(){return J("/api/v1/receipts/counts",void 0,BU)}var MU=new Set(["delivery","application","behavior_episode","effect","outcome"]);function jm(e){let t=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{1,3}))?Z$/.exec(e);return t!==null&&Number.isFinite(Date.parse(e))&&new Date(Date.parse(e)).toISOString()===`${t[1]}.${(t[2]??"").padEnd(3,"0")}Z`}function FU(e){let t=typeof e.payload=="object"&&e.payload!==null?e.payload:null;if(t===null)return null;let{kind:a}=e;return a==="delivery"?{summary:`${String(t.confirmation??"?")} / ${String(t.outcome??"?")}`,detail:`target: ${String(t.targetKind??"?")}${typeof t.failureReason=="string"?` \u2014 ${t.failureReason}`:""}`}:a==="application"?{summary:String(t.proofMethod??"?"),detail:String(t.action??"?")+(typeof t.claimText=="string"?` \u2014 ${t.claimText}`:"")}:a==="behavior_episode"?{summary:String(t.status??"?"),detail:String(t.actionSummary??"?")+(typeof t.resultSummary=="string"?` \u2192 ${t.resultSummary}`:"")}:a==="effect"?{summary:String(t.status??"?"),detail:String(t.observationSummary??"?")}:{summary:String(t.outcomeSource??"?"),detail:String(t.observationSummary??"?")}}function UU(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.evidenceId!="string"||t.evidenceId.length===0||t.evidenceId.length>256||typeof t.kind!="string"||!MU.has(t.kind)||typeof t.observationKey!="string"||t.observationKey.length===0||t.observationKey.length>256||typeof t.recordedAt!="string"||!jm(t.recordedAt)||t.occurredAt!==void 0&&(typeof t.occurredAt!="string"||!jm(t.occurredAt))||t.associationStatus!=="linked"&&t.associationStatus!=="pending_association"||t.sourceStatus!==void 0&&t.sourceStatus!=="unknown"||t.contentRedactedAt!==void 0&&(typeof t.contentRedactedAt!="string"||!jm(t.contentRedactedAt)))return null;let a=typeof t.nativeRefs=="object"&&t.nativeRefs!==null?t.nativeRefs:null;if(!a||a.hostKind!=="openclaw"&&a.hostKind!=="codex"||["sessionId","runId","turnId","toolCallId","toolName","rolloutIdentity"].some(l=>Object.hasOwn(a,l)&&(typeof a[l]!="string"||a[l].length===0||a[l].length>256)))return null;let n=Object.hasOwn(t,"contentRef"),r=typeof t.contentRef=="object"&&t.contentRef!==null&&!Array.isArray(t.contentRef)?t.contentRef:null;if(n&&r===null||r&&(typeof r.principleId!="string"||r.principleId.length===0||r.principleId.length>256||r.resolution!=="resolved"&&r.resolution!=="revision_reference_unresolved"||r.payloadDigest!==void 0&&(typeof r.payloadDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(r.payloadDigest))||r.resolution==="resolved"&&typeof r.payloadDigest!="string"||typeof t.principleId=="string"&&r.principleId!==t.principleId||["artifactId","version","approvalRef"].some(l=>Object.hasOwn(r,l)&&(typeof r[l]!="string"||r[l].length===0||r[l].length>256))))return null;let i=Object.hasOwn(t,"activationRef"),o=typeof t.activationRef=="object"&&t.activationRef!==null&&!Array.isArray(t.activationRef)?t.activationRef:null;if(i&&o===null||o&&(typeof o.activationId!="string"||o.activationId.length===0||o.activationId.length>256||typeof o.sourceSnapshotDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(o.sourceSnapshotDigest)||o.activationId!==t.activationId||o.activatedAt!==void 0&&(typeof o.activatedAt!="string"||!jm(o.activatedAt))||["idempotencyKey","artifactId","channel"].some(l=>Object.hasOwn(o,l)&&(typeof o[l]!="string"||o[l].length===0||o[l].length>256)))||r&&o&&typeof r.artifactId=="string"&&typeof o.artifactId=="string"&&r.artifactId!==o.artifactId||r&&o&&typeof t.occurredAt=="string"&&typeof o.activatedAt=="string"&&Date.parse(o.activatedAt)>Date.parse(t.occurredAt))return null;let s=FU(t);return s===null?null:{evidenceId:t.evidenceId,kind:t.kind,observationKey:t.observationKey,recordedAt:t.recordedAt,occurredAt:typeof t.occurredAt=="string"?t.occurredAt:void 0,principleId:typeof t.principleId=="string"?t.principleId:void 0,activationId:typeof t.activationId=="string"?t.activationId:void 0,episodeKey:typeof t.episodeKey=="string"?t.episodeKey:void 0,effectKey:typeof t.effectKey=="string"?t.effectKey:void 0,associationStatus:t.associationStatus,...t.sourceStatus==="unknown"?{sourceStatus:"unknown"}:{},...typeof t.contentRedactedAt=="string"?{contentRedactedAt:t.contentRedactedAt}:{},...r?{contentReference:{principleId:String(r.principleId),resolution:r.resolution,...typeof r.payloadDigest=="string"?{payloadDigest:r.payloadDigest}:{},...typeof r.artifactId=="string"?{artifactId:r.artifactId}:{},...typeof r.version=="string"?{version:r.version}:{},...typeof r.approvalRef=="string"?{approvalRef:r.approvalRef}:{}}}:{},...o?{activationReference:{activationId:String(o.activationId),sourceSnapshotDigest:String(o.sourceSnapshotDigest),...typeof o.activatedAt=="string"?{activatedAt:o.activatedAt}:{},...typeof o.idempotencyKey=="string"?{idempotencyKey:o.idempotencyKey}:{},...typeof o.artifactId=="string"?{artifactId:o.artifactId}:{},...typeof o.channel=="string"?{channel:o.channel}:{}}}:{},nativeLineage:[`hostKind=${a.hostKind}`,...Object.entries(a).filter(([l,c])=>l!=="hostKind"&&typeof c=="string").map(([l,c])=>`${l}=${String(c)}`)].slice(0,7),summary:s.summary,detail:s.detail}}function jU(e){if(typeof e!="object"||e===null)return null;let t=e,a=Hx(t.coverage);if(a===null)return null;let n=["delivery","application","behavior_episode","effect","outcome"],r={};if(typeof t.pages!="object"||t.pages===null)return null;let i=t.pages;for(let c of n){let u=i[c];if(typeof u!="object"||u===null)return null;let d=u;if(typeof d.hasMore!="boolean")return null;let f=null;if(d.nextCursor!==null){if(typeof d.nextCursor!="object"||d.nextCursor===null)return null;let m=d.nextCursor;if(typeof m.recordedAt!="string"||typeof m.evidenceId!="string")return null;f={recordedAt:m.recordedAt,evidenceId:m.evidenceId}}r[c]={hasMore:d.hasMore,nextCursor:f}}let o={};for(let c of["deliveries","applications","episodes","effects","outcomes"]){let u=[];if(!Array.isArray(t[c]))return null;for(let d of t[c]){let f=UU(d);if(!f)return null;u.push(f)}o[c]=u}let s=[];if(Array.isArray(t.unresolvedReferences))for(let c of t.unresolvedReferences){if(typeof c!="object"||c===null)continue;let u=c;typeof u.evidenceId=="string"&&typeof u.missingKey=="string"&&typeof u.field=="string"&&s.push({evidenceId:u.evidenceId,missingKey:u.missingKey,field:u.field})}let l=[];if(Array.isArray(t.capabilityDeclarations))for(let c of t.capabilityDeclarations){if(typeof c!="object"||c===null)continue;let u=c;u.hostKind!=="openclaw"&&u.hostKind!=="codex"||u.status!=="supported"&&u.status!=="unsupported"&&u.status!=="unknown"||typeof u.capability!="string"||typeof u.adapterVersion!="string"||typeof u.channel!="string"||l.push({hostKind:u.hostKind,capability:u.capability,status:u.status,adapterVersion:u.adapterVersion,channel:u.channel,...typeof u.note=="string"?{note:u.note}:{}})}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,deliveries:o.deliveries??[],applications:o.applications??[],episodes:o.episodes??[],effects:o.effects??[],outcomes:o.outcomes??[],pages:r,unresolvedReferences:s,capabilityDeclarations:l,coverage:a}}async function zx(e,t,a){let n=new URLSearchParams({type:e,id:t});return a&&(n.set("afterKind",a.kind),n.set("afterRecordedAt",a.after.recordedAt),n.set("afterEvidenceId",a.after.evidenceId)),J(`/api/v1/receipts/evidence-audit?${n.toString()}`,void 0,jU)}function H1(e){return J("/api/v1/approvals/"+encodeURIComponent(e),void 0,c1)}async function z1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/approve",{method:"POST",body:JSON.stringify({note:t,...a?.expectedReview===void 0?{}:{expectedReview:a.expectedReview},...a?.targetHost!==void 0?{host:a.targetHost}:{},...a?.intentReviewed!==void 0?{intentReviewed:a.intentReviewed,reviewedArtifactId:a.reviewedArtifactId}:{}})},Ic)}async function q1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/reject",{method:"POST",body:JSON.stringify({reason:t,...a===void 0?{}:{expectedReview:a}})},Ic)}async function V1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/edit",{method:"POST",body:JSON.stringify({newArtifactId:t,editReason:typeof a=="string"?a:a.reason,...typeof a=="string"?{}:{expectedReview:a.expectedReview}})},Ic)}async function G1(e,t){return J("/api/feedback/reports",{method:"POST",body:JSON.stringify({input:e,diagnostics:t??{}})},vD)}async function $1(){return J("/api/feedback/reports",void 0,e=>{let t=xD(e);return t===null?null:{drafts:t}})}async function qx(e){return J("/api/feedback/reports/"+encodeURIComponent(e),void 0,yD)}async function W1(e){return J("/api/feedback/reports/"+encodeURIComponent(e),{method:"DELETE"},wD)}async function K1(){return J("/api/feedback/submit/channels",void 0,kD)}async function Y1(e,t){return J("/api/feedback/reports/"+encodeURIComponent(e)+"/submit",{method:"POST",body:JSON.stringify({channel:t})},Tx)}async function X1(e,t){return J("/api/feedback/reports/"+encodeURIComponent(e)+"/mark-sent",{method:"POST",body:JSON.stringify({via:t})},Tx)}async function Zr(){return J("/api/v1/config/summary",void 0,DD)}async function Z1(){return J("/api/v1/config/catalog",void 0,LD)}async function Q1(e,t,a){return J(`/api/v1/config/agents/${encodeURIComponent(e)}/binding`,{method:"PATCH",body:JSON.stringify({runtimeProfile:t,enabled:a})},ND)}async function J1(e){return J("/api/v1/config/default-runtime",{method:"PATCH",body:JSON.stringify({defaultRuntime:e})},TD)}async function Gm(){return J("/api/v1/owner-identity",void 0,r1)}async function eL(e,t){return J("/api/v1/owner-identity",{method:"POST",body:JSON.stringify({ownerId:e,credentialId:t})},i1)}async function tL(){return J("/api/v1/owner-identity",{method:"DELETE"},o1)}async function aL(e,t){return J("/api/v1/config/profiles",{method:"POST",body:JSON.stringify({id:e,profile:t})},Om)}async function nL(e,t){return J(`/api/v1/config/profiles/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)},Om)}async function rL(e){return J(`/api/v1/config/profiles/${encodeURIComponent(e)}`,{method:"DELETE"},Om)}async function iL(e){return J(`/api/v1/config/readiness/${encodeURIComponent(e)}`,void 0,OD)}async function Lu(e,t){return J(`/api/v1/config/features/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({enabled:t})},ED)}async function oL(){return J("/api/v1/config/principles/output-language",void 0,Fx)}async function sL(e){return J("/api/v1/config/principles/output-language",{method:"PATCH",body:JSON.stringify({outputLanguage:e})},Fx)}async function Lc(){return J("/api/v1/governance/queue",void 0,Tm)}async function lL(){return J("/api/v1/governance/experience",void 0,gD)}async function cL(e,t,a){let n={};return t!==void 0&&t.length>0&&(n.reason=t),a===!0&&(n.force=!0),J("/api/v1/failed-tasks/"+encodeURIComponent(e)+"/recover",{method:"POST",body:JSON.stringify(n)},_D)}async function dL(e){return J("/api/v1/failed-tasks/"+encodeURIComponent(e),void 0,PD)}async function $m(){return J("/api/v1/governance/owner-decisions",void 0,s1)}async function uL(e,t){return J("/api/v1/governance/owner-decisions/"+encodeURIComponent(e)+"/resolve",{method:"POST",body:JSON.stringify(t)},l1)}async function Nc(e){let t=e!==void 0?`?host=${e}`:"";return J(`/api/v1/approvals/grouped${t}`,void 0,HD)}async function ls(e){let t=e!==void 0?`?host=${e}`:"";return J(`/api/v1/activations${t}`,void 0,Pm)}async function Ec(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/disable`,{method:"POST",body:JSON.stringify({confirmed:!0})},FD)}async function fL(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/owner-review`,void 0,BD)}async function pL(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/rule-revision-preview`,void 0,g1)}async function mL(e,t){return J(`/api/v1/activations/${encodeURIComponent(e)}/revise-rule-once`,{method:"POST",body:JSON.stringify(t)},h1)}async function gL(e,t,a){return J(`/api/v1/activations/${encodeURIComponent(e)}/propose-revision`,{method:"POST",body:JSON.stringify({statement:t,...a!==void 0?{host:a}:{}})},n=>{if(typeof n!="object"||n===null||Array.isArray(n))return null;let r=n;if(r.ok!==!0&&r.ok!==!1)return null;let i={ok:r.ok};return typeof r.alreadyPending=="boolean"&&(i.alreadyPending=r.alreadyPending),typeof r.newArtifactId=="string"&&(i.newArtifactId=r.newArtifactId),typeof r.approvalId=="string"&&(i.approvalId=r.approvalId),typeof r.supersededActivationId=="string"&&(i.supersededActivationId=r.supersededActivationId),typeof r.oldStatement=="string"&&(i.oldStatement=r.oldStatement),typeof r.newStatement=="string"&&(i.newStatement=r.newStatement),typeof r.title=="string"&&(i.title=r.title),typeof r.reason=="string"&&(i.reason=r.reason),typeof r.nextAction=="string"&&(i.nextAction=r.nextAction),typeof r.error=="string"&&(i.error=r.error),i})}async function Vx(e,t){return J(e,{method:"POST",body:JSON.stringify(t)},MD)}function hL(e,t,a){return Vx(`/api/v1/activations/${encodeURIComponent(e)}/${t}`,a)}function bL(e){return Vx("/api/v1/activations/emergency-pause",e)}function vL(e,t){return Vx(`/api/v1/activations/emergency-pause/${encodeURIComponent(e)}/release`,t)}async function Wm(e){return J(`/api/v1/lifecycle/principles/${encodeURIComponent(e)}`,void 0,UD)}async function Gx(){return J("/api/update/check",void 0,Cu)}async function xL(){return J("/api/update/history",void 0,_m)}async function yL(){return J("/api/update/apply-full",{method:"POST",body:JSON.stringify({})},XD)}async function wL(){return J("/api/update/recovery",void 0,Mm)}async function kL(e){return J(`/api/update/transaction/${encodeURIComponent(e)}`,void 0,Fm)}async function SL(){return J("/api/v1/evidence-chain",void 0,YD)}async function CL(e="zh-CN"){return J(`/api/v1/intent?lang=${e}`,void 0,JD)}async function $x(e="zh-CN"){return J(`/api/v1/intent/content?lang=${e}`,void 0,e1)}async function Wx(e=!1,t="zh-CN"){return J(`/api/v1/intent/init?lang=${t}`,{method:"POST",body:JSON.stringify({force:e})},t1)}async function Kx(e,t="zh-CN"){return J(`/api/v1/intent/content?lang=${t}`,{method:"PUT",body:JSON.stringify({content:e})},a1)}async function RL(e="zh-CN"){return J(`/api/v1/intent/versions?lang=${e}`,void 0,n1)}async function IL(e){return J("/api/v1/intent-decisions",{method:"POST",body:JSON.stringify(e)},$D)}async function AL(e){return J(`/api/v1/intent-decisions?painId=${encodeURIComponent(e)}`,void 0,Mx)}async function DL(e){return J(`/api/v1/intent-decisions?taskId=${encodeURIComponent(e)}`,void 0,Mx)}async function LL(){return J("/api/v1/intent-decisions/summary",void 0,WD)}async function NL(e,t){return J(`/api/v1/intent-decisions/${encodeURIComponent(e)}/follow-up`,{method:"POST",body:JSON.stringify(t)},KD)}function Dc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function HU(e){if(!Dc(e)||!Array.isArray(e.sessions))return null;let t=[];for(let a of e.sessions){if(!Dc(a)||typeof a.projectWorkspacePath!="string"||a.projectWorkspacePath.trim()===""||typeof a.hostSessionId!="string"||a.hostSessionId.trim()==="")return null;t.push({projectWorkspacePath:a.projectWorkspacePath,hostSessionId:a.hostSessionId})}return{sessions:t}}function zU(e){return e==="read"||e==="write"||e==="execute"}function qU(e){return e==="approved"||e==="not_approved"||e==="not_required"}function Xr(e){return typeof e=="string"&&e.trim().length>0}function VU(e){if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t+=1)if(!Object.hasOwn(e,t)||!Xr(e[t]))return!1;return!0}function GU(e){if(!Dc(e)||!Object.hasOwn(e,"sourceRef")||!Xr(e.sourceRef)||!Xr(e.governanceWorkspacePath)||!Xr(e.projectWorkspacePath)||!Xr(e.hostSessionId)||!Xr(e.taskRef)||!Xr(e.specPath)||!Xr(e.specDigest)||!Dc(e.scope)||!Object.hasOwn(e.scope,"paths")||!Object.hasOwn(e.scope,"actions")||!VU(e.scope.paths)||e.scope.paths.length===0||!Array.isArray(e.scope.actions)||e.scope.actions.length===0)return!1;for(let t=0;t<e.scope.actions.length;t+=1)if(!Object.hasOwn(e.scope.actions,t)||!zU(e.scope.actions[t]))return!1;return!(!qU(e.decision)||typeof e.revision!="number"||!Number.isSafeInteger(e.revision)||e.revision<1||typeof e.revoked!="boolean"||!Dc(e.actor)||!Object.hasOwn(e.actor,"ownerId")||!Object.hasOwn(e.actor,"credentialId")||!Xr(e.actor.ownerId)||!Xr(e.actor.credentialId)||!Xr(e.decidedAt))}function Km(e){return!Dc(e)||!Object.hasOwn(e,"declaration")?null:e.declaration===null?{declaration:null}:GU(e.declaration)?{declaration:e.declaration}:null}var Nu="/api/v1/governance/design-gate";async function EL(){return J(`${Nu}/sessions`,void 0,HU)}async function OL(e,t){let a=new URLSearchParams({projectWorkspacePath:e,hostSessionId:t});return J(`${Nu}/declaration?${a.toString()}`,void 0,Km)}async function TL(e){return J(`${Nu}/declarations`,{method:"POST",body:JSON.stringify(e)},Km)}async function PL(e,t,a){return J(`${Nu}/declarations/${encodeURIComponent(e)}/decision`,{method:"POST",body:JSON.stringify({expectedRevision:t,decision:a})},Km)}async function _L(e,t){return J(`${Nu}/declarations/${encodeURIComponent(e)}/revoke`,{method:"POST",body:JSON.stringify({expectedRevision:t})},Km)}async function Yx(){return J("/api/v1/examiner/overview",void 0,e=>e!==null&&typeof e=="object"&&Object.hasOwn(e,"studies")?e:null)}async function Ym(){return J("/api/v1/examiner/principles",void 0,e=>e&&typeof e=="object"&&Array.isArray(e.principles)?e:null)}async function BL(e){return J("/api/v1/examiner/studies",{method:"POST",body:JSON.stringify(e)},t=>t&&typeof t.studyId=="string"?t:null)}async function Xm(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}`,void 0,t=>t&&typeof t.studyId=="string"?t:null)}async function ML(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/preflight`,{method:"POST"},t=>t&&typeof t.ok=="boolean"?t:null)}async function FL(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({mode:"offline-stub"})},t=>t&&Array.isArray(t.units)?t:null)}async function UL(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/report`,{method:"POST"},t=>t&&typeof t.status=="string"?t:null)}async function Xx(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/report`,void 0,t=>t&&t.report?t:null)}async function Eu(e){return J(`/api/v1/examiner/principles/${encodeURIComponent(e)}/evidence`,void 0,t=>t&&typeof t.principleId=="string"&&t.principle?t:null)}async function jL(){return J("/api/v1/examiner/suites",void 0,e=>e&&Array.isArray(e.suites)?e:null)}async function HL(){return J("/api/v1/examiner/hosts/openclaw/readiness",void 0,e=>e&&typeof e.host=="string"&&Array.isArray(e.requirements)?e:null)}async function zL(e,t){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({mode:t})},a=>a&&typeof a.runId=="string"?a:null)}var Oi=D(ee(),1),$U={pending:{waveform:"sine",frequency:880,durationMs:150,volume:.3},degraded:{waveform:"triangle",frequency:440,durationMs:200,volume:.3}};function qL(){let[e,t]=(0,Oi.useState)(!1),a=(0,Oi.useRef)(null),n=(0,Oi.useRef)(!0);(0,Oi.useEffect)(()=>()=>{n.current=!1;let o=a.current;a.current=null,o&&o.state!=="closed"&&o.close().catch(s=>{console.warn("Failed to close notification audio context:",s)})},[]);let r=(0,Oi.useCallback)(()=>{if(!e&&!(typeof window>"u"||!window.AudioContext))try{let o=a.current??new AudioContext;a.current=o,o.state==="suspended"?o.resume().then(()=>{n.current&&t(!0)}).catch(()=>{}):n.current&&t(!0)}catch(o){console.warn("Failed to unlock audio:",o)}},[e]);return{playSound:(0,Oi.useCallback)(o=>{if(e&&!(typeof window>"u"||!window.AudioContext))try{let s=a.current??new AudioContext;if(a.current=s,s.state==="suspended"){s.resume().catch(()=>{});return}let l=$U[o],c=s.createOscillator(),u=s.createGain();c.type=l.waveform,c.frequency.setValueAtTime(l.frequency,s.currentTime),u.gain.setValueAtTime(l.volume,s.currentTime),u.gain.exponentialRampToValueAtTime(.001,s.currentTime+l.durationMs/1e3),c.connect(u),u.connect(s.destination),c.start(s.currentTime),c.stop(s.currentTime+l.durationMs/1e3)}catch(s){console.warn("Failed to play notification sound:",s)}},[e]),unlockAudio:r,audioUnlocked:e}}function Zx(e,t){return t===null?{pendingIncreased:!1,degradedIncreased:!1}:{pendingIncreased:e.pendingCount>t.pendingCount,degradedIncreased:e.degradedCount>t.degradedCount}}var VL="pd-sound-enabled";function GL(){if(typeof window>"u")return null;try{return window.localStorage}catch(e){return console.warn("Sound preference storage is unavailable:",e),null}}function $L(){let e=GL();if(!e)return!0;try{let t=e.getItem(VL);return t===null?!0:t==="true"}catch(t){return console.warn("Failed to read sound preference:",t),!0}}function WL(e){let t=GL();if(t)try{t.setItem(VL,String(e))}catch(a){console.warn("Failed to save sound preference:",a)}}var KL="PD Console";var Qx="pd-dynamic-favicon";function WU(e){e.fillStyle="#1a1a1a",e.fillRect(0,0,32,32),e.fillStyle="#d4a853",e.font="bold 14px sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("PD",32/2,32/2)}function KU(e){e.fillStyle="#dc2626",e.beginPath(),e.arc(26,6,5,0,Math.PI*2),e.fill()}function YU(e){if(typeof document>"u")return"";let t=document.createElement("canvas");t.width=32,t.height=32;let a=t.getContext("2d");return a?(WU(a),e>0&&KU(a),t.toDataURL("image/png")):""}function YL(e,t){if(typeof document>"u")return;let a=e+t;document.title=a>0?`(${a}) PD Governance Workspace`:KL;let n=document.getElementById(Qx),r=n instanceof HTMLLinkElement?n:null;r||(n?.remove(),r=document.createElement("link"),r.id=Qx,r.rel="icon",r.type="image/png",document.head.appendChild(r));let i=YU(a);i&&(r.href=i)}function XL(){typeof document>"u"||(document.title=KL,document.getElementById(Qx)?.remove())}var QL=D(W(),1),XU=3e4,Jx=(0,Ca.createContext)(null);function ZL({children:e}){let[t,a]=(0,Ca.useState)({pendingCount:0,degradedCount:0,soundEnabled:$L()}),{playSound:n,unlockAudio:r,audioUnlocked:i}=qL(),o=(0,Ca.useRef)(null),s=(0,Ca.useRef)(!1),l=(0,Ca.useRef)(!1),c=(0,Ca.useRef)(!1),u=(0,Ca.useRef)(!1),d=(0,Ca.useCallback)(m=>{WL(m),a(p=>({...p,soundEnabled:m}))},[]),f=(0,Ca.useCallback)(async()=>{if(!l.current){l.current=!0;try{let m=await Lc();if(!m.success){console.warn("Notification poll failed:",m.error);return}let p=m.data.degradedSignals?.length??0,b=await $m(),v=b.success?b.data.total:m.data.pendingReviewCount;s.current=!0,a(g=>({...g,pendingCount:v,degradedCount:p}))}finally{l.current=!1}}},[]);return(0,Ca.useEffect)(()=>{f();let m=setInterval(f,XU);return()=>clearInterval(m)},[f]),(0,Ca.useEffect)(()=>{if(!s.current)return;if(typeof document<"u"&&document.hidden){let p=Zx(t,o.current);t.soundEnabled&&p.pendingIncreased&&(c.current=!0),t.soundEnabled&&p.degradedIncreased&&(u.current=!0),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount};return}if(!t.soundEnabled||!i){t.soundEnabled||(c.current=!1,u.current=!1),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount};return}let m=Zx(t,o.current);(m.pendingIncreased||c.current)&&(n("pending"),c.current=!1),(m.degradedIncreased||u.current)&&(n("degraded"),u.current=!1),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount}},[t,n,i]),(0,Ca.useEffect)(()=>{YL(t.pendingCount,t.degradedCount)},[t.pendingCount,t.degradedCount]),(0,Ca.useEffect)(()=>()=>{XL()},[]),(0,Ca.useEffect)(()=>{if(typeof window>"u")return;let m=()=>{r()};return window.addEventListener("click",m,{once:!0}),window.addEventListener("keydown",m,{once:!0}),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",m)}},[r]),(0,Ca.useEffect)(()=>{if(typeof document>"u")return;let m=()=>{document.hidden||f()};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[f]),(0,QL.jsx)(Jx.Provider,{value:{...t,setSoundEnabled:d,audioUnlocked:i},children:e})}function Zm(){let e=(0,JL.useContext)(Jx);if(!e)throw new Error("useNotifications must be used within NotificationProvider");return e}function eN(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=eN(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function Qm(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=eN(e))&&(n&&(n+=" "),n+=t);return n}var ZU=(e,t)=>{let a=new Array(e.length+t.length);for(let n=0;n<e.length;n++)a[n]=e[n];for(let n=0;n<t.length;n++)a[e.length+n]=t[n];return a},QU=(e,t)=>({classGroupId:e,validator:t}),oN=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var tN=[],JU="arbitrary..",ej=e=>{let t=aj(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return tj(o);let s=o.split("-"),l=s[0]===""&&s.length>1?1:0;return sN(s,l,t)},getConflictingClassGroupIds:(o,s)=>{if(s){let l=n[o],c=a[o];return l?c?ZU(c,l):l:c||tN}return a[o]||tN}}},sN=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let r=e[t],i=a.nextPart.get(r);if(i){let c=sN(e,t+1,i);if(c)return c}let o=a.validators;if(o===null)return;let s=t===0?e.join("-"):e.slice(t).join("-"),l=o.length;for(let c=0;c<l;c++){let u=o[c];if(u.validator(s))return u.classGroupId}},tj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(":"),n=t.slice(0,a);return n?JU+n:void 0})(),aj=e=>{let{theme:t,classGroups:a}=e;return nj(a,t)},nj=(e,t)=>{let a=oN();for(let n in e){let r=e[n];ty(r,a,n,t)}return a},ty=(e,t,a,n)=>{let r=e.length;for(let i=0;i<r;i++){let o=e[i];rj(o,t,a,n)}},rj=(e,t,a,n)=>{if(typeof e=="string"){ij(e,t,a);return}if(typeof e=="function"){oj(e,t,a,n);return}sj(e,t,a,n)},ij=(e,t,a)=>{let n=e===""?t:lN(t,e);n.classGroupId=a},oj=(e,t,a,n)=>{if(lj(e)){ty(e(n),t,a,n);return}t.validators===null&&(t.validators=[]),t.validators.push(QU(a,e))},sj=(e,t,a,n)=>{let r=Object.entries(e),i=r.length;for(let o=0;o<i;o++){let[s,l]=r[o];ty(l,lN(t,s),a,n)}},lN=(e,t)=>{let a=e,n=t.split("-"),r=n.length;for(let i=0;i<r;i++){let o=n[i],s=a.nextPart.get(o);s||(s=oN(),a.nextPart.set(o,s)),a=s}return a},lj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),n=Object.create(null),r=(i,o)=>{a[i]=o,t++,t>e&&(t=0,n=a,a=Object.create(null))};return{get(i){let o=a[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return r(i,o),o},set(i,o){i in a?a[i]=o:r(i,o)}}};var dj=[],aN=(e,t,a,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:n,isExternal:r}),uj=e=>{let{prefix:t,experimentalParseClassName:a}=e,n=r=>{let i=[],o=0,s=0,l=0,c,u=r.length;for(let b=0;b<u;b++){let v=r[b];if(o===0&&s===0){if(v===":"){i.push(r.slice(l,b)),l=b+1;continue}if(v==="/"){c=b;continue}}v==="["?o++:v==="]"?o--:v==="("?s++:v===")"&&s--}let d=i.length===0?r:r.slice(l),f=d,m=!1;d.endsWith("!")?(f=d.slice(0,-1),m=!0):d.startsWith("!")&&(f=d.slice(1),m=!0);let p=c&&c>l?c-l:void 0;return aN(i,m,f,p)};if(t){let r=t+":",i=n;n=o=>o.startsWith(r)?i(o.slice(r.length)):aN(dj,!1,o,void 0,!0)}if(a){let r=n;n=i=>a({className:i,parseClassName:r})}return n},fj=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,n)=>{t.set(a,1e6+n)}),a=>{let n=[],r=[];for(let i=0;i<a.length;i++){let o=a[i],s=o[0]==="[",l=t.has(o);s||l?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},pj=e=>({cache:cj(e.cacheSize),parseClassName:uj(e),sortModifiers:fj(e),postfixLookupClassGroupIds:mj(e),...ej(e)}),mj=e=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let n=0;n<a.length;n++)t[a[n]]=!0;return t},gj=/\s+/,hj=(e,t)=>{let{parseClassName:a,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:i,postfixLookupClassGroupIds:o}=t,s=[],l=e.trim().split(gj),c="";for(let u=l.length-1;u>=0;u-=1){let d=l[u],{isExternal:f,modifiers:m,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:v}=a(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!v,h;if(g){let I=b.substring(0,v);h=n(I);let k=h&&o[h]?n(b):void 0;k&&k!==h&&(h=k,g=!1)}else h=n(b);if(!h){if(!g){c=d+(c.length>0?" "+c:c);continue}if(h=n(b),!h){c=d+(c.length>0?" "+c:c);continue}g=!1}let x=m.length===0?"":m.length===1?m[0]:i(m).join(":"),y=p?x+"!":x,C=y+h;if(s.indexOf(C)>-1)continue;s.push(C);let A=r(h,g);for(let I=0;I<A.length;++I){let k=A[I];s.push(y+k)}c=d+(c.length>0?" "+c:c)}return c},bj=(...e)=>{let t=0,a,n,r="";for(;t<e.length;)(a=e[t++])&&(n=cN(a))&&(r&&(r+=" "),r+=n);return r},cN=e=>{if(typeof e=="string")return e;let t,a="";for(let n=0;n<e.length;n++)e[n]&&(t=cN(e[n]))&&(a&&(a+=" "),a+=t);return a},vj=(e,...t)=>{let a,n,r,i,o=l=>{let c=t.reduce((u,d)=>d(u),e());return a=pj(c),n=a.cache.get,r=a.cache.set,i=s,s(l)},s=l=>{let c=n(l);if(c)return c;let u=hj(l,a);return r(l,u),u};return i=o,(...l)=>i(bj(...l))},xj=[],Oa=e=>{let t=a=>a[e]||xj;return t.isThemeGetter=!0,t.themeKey=e,t},dN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Sj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Cj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>yj.test(e),it=e=>!!e&&!Number.isNaN(Number(e)),Ti=e=>!!e&&Number.isInteger(Number(e)),ey=e=>e.endsWith("%")&&it(e.slice(0,-1)),lo=e=>wj.test(e),fN=()=>!0,Ij=e=>kj.test(e)&&!Sj.test(e),ay=()=>!1,Aj=e=>Cj.test(e),Dj=e=>Rj.test(e),Lj=e=>!Ae(e)&&!De(e),Nj=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ej=e=>ds(e,gN,ay),Ae=e=>dN.test(e),nl=e=>ds(e,hN,Ij),nN=e=>ds(e,Uj,it),Oj=e=>ds(e,vN,fN),Tj=e=>ds(e,bN,ay),rN=e=>ds(e,pN,ay),Pj=e=>ds(e,mN,Dj),Jm=e=>ds(e,xN,Aj),De=e=>uN.test(e),Ou=e=>rl(e,hN),_j=e=>rl(e,bN),iN=e=>rl(e,pN),Bj=e=>rl(e,gN),Mj=e=>rl(e,mN),eg=e=>rl(e,xN,!0),Fj=e=>rl(e,vN,!0),ds=(e,t,a)=>{let n=dN.exec(e);return n?n[1]?t(n[1]):a(n[2]):!1},rl=(e,t,a=!1)=>{let n=uN.exec(e);return n?n[1]?t(n[1]):a:!1},pN=e=>e==="position"||e==="percentage",mN=e=>e==="image"||e==="url",gN=e=>e==="length"||e==="size"||e==="bg-size",hN=e=>e==="length",Uj=e=>e==="number",bN=e=>e==="family-name",vN=e=>e==="number"||e==="weight",xN=e=>e==="shadow";var jj=()=>{let e=Oa("color"),t=Oa("font"),a=Oa("text"),n=Oa("font-weight"),r=Oa("tracking"),i=Oa("leading"),o=Oa("breakpoint"),s=Oa("container"),l=Oa("spacing"),c=Oa("radius"),u=Oa("shadow"),d=Oa("inset-shadow"),f=Oa("text-shadow"),m=Oa("drop-shadow"),p=Oa("blur"),b=Oa("perspective"),v=Oa("aspect"),g=Oa("ease"),h=Oa("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...y(),De,Ae],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[De,Ae,l],T=()=>[cs,"full","auto",...k()],_=()=>[Ti,"none","subgrid",De,Ae],M=()=>["auto",{span:["full",Ti,De,Ae]},Ti,De,Ae],H=()=>[Ti,"auto",De,Ae],Y=()=>["auto","min","max","fr",De,Ae],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...k()],F=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],se=()=>[s,cs,"screen","full","dvw","lvw","svw","min","max","fit",...k()],ve=()=>[cs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],z=()=>[e,De,Ae],L=()=>[...y(),iN,rN,{position:[De,Ae]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",Bj,Ej,{size:[De,Ae]}],Ee=()=>[ey,Ou,nl],G=()=>["","none","full",c,De,Ae],ae=()=>["",it,Ou,nl],we=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ke=()=>[it,ey,iN,rN],tt=()=>["","none",p,De,Ae],Ct=()=>["none",it,De,Ae],ne=()=>["none",it,De,Ae],Ce=()=>[it,De,Ae],ot=()=>[cs,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lo],breakpoint:[lo],color:[fN],container:[lo],"drop-shadow":[lo],ease:["in","out","in-out"],font:[Lj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lo],shadow:[lo],spacing:["px",it],text:[lo],"text-shadow":[lo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,Ae,De,v]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Ae]}],"container-named":[Nj],columns:[{columns:[it,"auto",Ae,De,s]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Ti,"auto",De,Ae]}],basis:[{basis:[cs,"full","auto",s,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,cs,"auto","initial","none",Ae]}],grow:[{grow:["",it,De,Ae]}],shrink:[{shrink:["",it,De,Ae]}],order:[{order:[Ti,"first","last","none",De,Ae]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...se()]}],"min-inline-size":[{"min-inline":["auto",...se()]}],"max-inline-size":[{"max-inline":["none",...se()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[s,"screen",...F()]}],"min-w":[{"min-w":[s,"screen","none",...F()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh","none",...F()]}],"font-size":[{text:["base",a,Ou,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Fj,Oj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ey,Ae]}],"font-family":[{font:[_j,Tj,t]}],"font-features":[{"font-features":[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,De,Ae]}],"line-clamp":[{"line-clamp":[it,"none",De,nN]}],leading:[{leading:["none",i,...k()]}],"list-image":[{"list-image":["none",De,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",De,nl]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[it,"auto",De,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[Ti,De,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ti,De,Ae],radial:["",De,Ae],conic:["",Ti,De,Ae]},Mj,Pj]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:Ee()}],"gradient-via-pos":[{via:Ee()}],"gradient-to-pos":[{to:Ee()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,De,Ae]}],"outline-w":[{outline:["",it,Ou,nl]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",u,eg,Jm]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,eg,Jm]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[it,nl]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,eg,Jm]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[it,De,Ae]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":ke()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ke()}],"mask-image-t-to-pos":[{"mask-t-to":ke()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ke()}],"mask-image-r-to-pos":[{"mask-r-to":ke()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ke()}],"mask-image-b-to-pos":[{"mask-b-to":ke()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ke()}],"mask-image-l-to-pos":[{"mask-l-to":ke()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ke()}],"mask-image-x-to-pos":[{"mask-x-to":ke()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ke()}],"mask-image-y-to-pos":[{"mask-y-to":ke()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[De,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":ke()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":ke()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Ae]}],filter:[{filter:["","none",De,Ae]}],blur:[{blur:tt()}],brightness:[{brightness:[it,De,Ae]}],contrast:[{contrast:[it,De,Ae]}],"drop-shadow":[{"drop-shadow":["","none",m,eg,Jm]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",it,De,Ae]}],"hue-rotate":[{"hue-rotate":[it,De,Ae]}],invert:[{invert:["",it,De,Ae]}],saturate:[{saturate:[it,De,Ae]}],sepia:[{sepia:["",it,De,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Ae]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[it,De,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[it,De,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,De,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,De,Ae]}],"backdrop-invert":[{"backdrop-invert":["",it,De,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[it,De,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[it,De,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",it,De,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",De,Ae]}],ease:[{ease:["linear","initial",g,De,Ae]}],delay:[{delay:[it,De,Ae]}],animate:[{animate:["none",h,De,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,De,Ae]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Ct()}],"rotate-x":[{"rotate-x":Ct()}],"rotate-y":[{"rotate-y":Ct()}],"rotate-z":[{"rotate-z":Ct()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[De,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[Ti,De,Ae]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Ae]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[it,Ou,nl,nN]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var yN=vj(jj);function xe(...e){return yN(Qm(e))}var zu=D(ee(),1);var Tt=D(ee(),1);var Hj=Object.defineProperty,Oc=(e,t)=>Hj(e,"name",{value:t,configurable:!0}),wN=!!(typeof window<"u"&&window.document&&window.document.createElement);function rr(e,t,{checkForDefaultPrevented:a=!0}={}){return Oc(function(r){if(e?.(r),a===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}Oc(rr,"composeEventHandlers");function zj(e){if(!wN)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Oc(zj,"getOwnerWindow");function ny(e){if(!wN)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Oc(ny,"getOwnerDocument");function kN(e,t=!1){let{activeElement:a}=ny(e);if(!a?.nodeName)return null;if(SN(a)&&a.contentDocument)return kN(a.contentDocument.body,t);if(t){let n=a.getAttribute("aria-activedescendant");if(n){let r=ny(a).getElementById(n);if(r)return r}}return a}Oc(kN,"getActiveElement");function SN(e){return e.tagName==="IFRAME"}Oc(SN,"isFrame");var CN=D(ee(),1),qj=Object.defineProperty,iy=(e,t)=>qj(e,"name",{value:t,configurable:!0});function ry(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}iy(ry,"setRef");function RN(...e){return t=>{let a=!1,n=e.map(r=>{let i=ry(r,t);return!a&&typeof i=="function"&&(a=!0),i});if(a)return()=>{for(let r=0;r<n.length;r++){let i=n[r];typeof i=="function"?i():ry(e[r],null)}}}}iy(RN,"composeRefs");function qa(...e){return CN.useCallback(RN(...e),e)}iy(qa,"useComposedRefs");var Lr=D(ee(),1),oy=D(W(),1),Vj=Object.defineProperty,Dr=(e,t)=>Vj(e,"name",{value:t,configurable:!0});function Gj(e,t){let a=Lr.createContext(t);a.displayName=e+"Context";let n=Dr(i=>{let{children:o,...s}=i,l=Lr.useMemo(()=>s,Object.values(s));return(0,oy.jsx)(a.Provider,{value:l,children:o})},"Provider");n.displayName=e+"Provider";function r(i,o={}){let{optional:s=!1}=o,l=Lr.useContext(a);if(l)return l;if(t!==void 0)return t;if(!s)throw new Error(`\`${i}\` must be used within \`${e}\``)}return Dr(r,"useContext"),[n,r]}Dr(Gj,"createContext");function Tu(e,t=[]){let a=[];function n(i,o){let s=Lr.createContext(o);s.displayName=i+"Context";let l=a.length;a=[...a,o];let c=Dr(d=>{let{scope:f,children:m,...p}=d,b=f?.[e]?.[l]||s,v=Lr.useMemo(()=>p,Object.values(p));return(0,oy.jsx)(b.Provider,{value:v,children:m})},"Provider");c.displayName=i+"Provider";function u(d,f,m={}){let{optional:p=!1}=m,b=f?.[e]?.[l]||s,v=Lr.useContext(b);if(v)return v;if(o!==void 0)return o;if(!p)throw new Error(`\`${d}\` must be used within \`${i}\``)}return Dr(u,"useContext"),[c,u]}Dr(n,"createContext");let r=Dr(()=>{let i=a.map(o=>Lr.createContext(o));return Dr(function(s){let l=s?.[e]||i;return Lr.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])},"useScope")},"createScope");return r.scopeName=e,[n,IN(r,...t)]}Dr(Tu,"createContextScope");function IN(...e){let t=e[0];if(e.length===1)return t;let a=Dr(()=>{let n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Dr(function(i){let o=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(i)[`__scope${c}`];return{...s,...d}},{});return Lr.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return a.scopeName=t.scopeName,a}Dr(IN,"composeContextScopes");var sy=D(ee(),1);var AN=D(ee(),1),fn=globalThis?.document?AN.useLayoutEffect:()=>{};var $j=Object.defineProperty,Wj=(e,t)=>$j(e,"name",{value:t,configurable:!0}),Kj=sy[" useId ".trim().toString()]||(()=>{}),Yj=0;function Pu(e){let[t,a]=sy.useState(Kj());return fn(()=>{e||a(n=>n??String(Yj++))},[e]),e||(t?`radix-${t}`:"")}Wj(Pu,"useId");var Nr=D(ee(),1);var tg=!1;var Qr=D(ee(),1);var Tc=D(ee(),1),Xj=Object.defineProperty,Zj=(e,t)=>Xj(e,"name",{value:t,configurable:!0}),DN=Tc[" useEffectEvent ".trim().toString()],LN=Tc[" useInsertionEffect ".trim().toString()];function ly(e){if(typeof DN=="function")return DN(e);let t=Tc.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof LN=="function"?LN(()=>{t.current=e}):fn(()=>{t.current=e}),Tc.useMemo(()=>((...a)=>t.current?.(...a)),[])}Zj(ly,"useEffectEvent");var Qj=Object.defineProperty,_u=(e,t)=>Qj(e,"name",{value:t,configurable:!0}),Jj=Nr[" useInsertionEffect ".trim().toString()]||fn;function cy({prop:e,defaultProp:t,onChange:a=_u(()=>{},"onChange"),caller:n}){let[r,i,o]=EN({defaultProp:t,onChange:a}),s=e!==void 0,l=s?e:r;if(tg){let u=Nr.useRef(e!==void 0);Nr.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=Nr.useCallback(u=>{if(s){let d=ON(u)?u(e):u;d!==e&&o.current?.(d)}else i(u)},[s,e,i,o]);return[l,c]}_u(cy,"useControllableState");function EN({defaultProp:e,onChange:t}){let[a,n]=Nr.useState(e),r=Nr.useRef(a),i=Nr.useRef(t);return Jj(()=>{i.current=t},[t]),Nr.useEffect(()=>{r.current!==a&&(i.current?.(a),r.current=a)},[a,r]),[a,n,i]}_u(EN,"useUncontrolledState");function ON(e){return typeof e=="function"}_u(ON,"isFunction");var NN=Symbol("RADIX:SYNC_STATE");function e5(e,t,a,n){let{prop:r,defaultProp:i,onChange:o,caller:s}=t,l=r!==void 0,c=ly(o);if(tg){let v=Qr.useRef(r!==void 0);Qr.useEffect(()=>{let g=v.current;g!==l&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=l},[l,s])}let u=[{...a,state:i}];n&&u.push(n);let[d,f]=Qr.useReducer((v,g)=>{if(g.type===NN)return{...v,state:g.state};let h=e(v,g);return l&&!Object.is(h.state,v.state)&&c(h.state),h},...u),m=d.state,p=Qr.useRef(m);Qr.useEffect(()=>{p.current!==m&&(p.current=m,l||c(m))},[m,p,l]);let b=Qr.useMemo(()=>r!==void 0?{...d,state:r}:d,[d,r]);return Qr.useEffect(()=>{l&&!Object.is(r,d.state)&&f({type:NN,state:r})},[r,d.state,l]),[b,f]}_u(e5,"useControllableStateReducer");var Ot=D(ee(),1);var jN=D(ee(),1),HN=D(Zc(),1);var an=D(ee(),1);var t5=Object.defineProperty,ir=(e,t)=>t5(e,"name",{value:t,configurable:!0});function dy(e){let t=an.forwardRef((a,n)=>{let{children:r,...i}=a,o=null,s=!1,l=[];r=FN(r),an.Children.forEach(r,f=>{if(BN(f)){s=!0;let m=f,p="child"in m.props?m.props.child:m.props.children;for(;uy(p)&&typeof ag=="function";)p=ag(p._payload);o=n5(m,p),l.push(o?.props?.children)}else l.push(f)}),o?o=an.cloneElement(o,void 0,l):!s&&an.Children.count(r)===1&&an.isValidElement(r)&&(o=r);let c=o?_N(o):void 0,u=qa(n,c);if(!o){if(r||r===0)throw new Error(s?o5(e):i5(e));return r}let d=PN(i,o.props??{});return o.type!==an.Fragment&&(d.ref=n?u:c),an.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}ir(dy,"createSlot");var TN=Symbol.for("radix.slottable");function a5(e){let t=ir(a=>"child"in a?a.children(a.child):a.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=TN,t}ir(a5,"createSlottable");var n5=ir((e,t)=>"child"in e.props?an.isValidElement(t)?an.cloneElement(t,void 0,e.props.children(t.props.children)):null:an.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function PN(e,t){let a={...t};for(let n in t){let r=e[n],i=t[n];/^on[A-Z]/.test(n)?r&&i?a[n]=(...s)=>{let l=i(...s);return r(...s),l}:r&&(a[n]=r):n==="style"?a[n]={...r,...i}:n==="className"?a[n]=[r,i].filter(Boolean).join(" "):n==="aria-describedby"&&(a[n]=UN(i,r))}return{...e,...a}}ir(PN,"mergeProps");function _N(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}ir(_N,"getElementRef");function BN(e){return an.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TN}ir(BN,"isSlottable");var r5=Symbol.for("react.lazy");function uy(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===r5&&"_payload"in e&&MN(e._payload)}ir(uy,"isLazyComponent");function MN(e){return typeof e=="object"&&e!==null&&"then"in e}ir(MN,"isPromiseLike");function FN(e){let t=e;for(;uy(t)&&typeof ag=="function";)t=ag(t._payload);return t}ir(FN,"useUnwrappedLazy");function UN(...e){let t=new Set;for(let a of e)if(typeof a=="string")for(let n of String(a).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}ir(UN,"concatAriaDescribedby");var i5=ir(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),o5=ir(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ag=an[" use ".trim().toString()];var zN=D(W(),1),s5=Object.defineProperty,l5=(e,t)=>s5(e,"name",{value:t,configurable:!0}),c5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Er=c5.reduce((e,t)=>{let a=dy(`Primitive.${t}`),n=jN.forwardRef((r,i)=>{let{asChild:o,...s}=r,l=o?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,zN.jsx)(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fy(e,t){e&&HN.flushSync(()=>e.dispatchEvent(t))}l5(fy,"dispatchDiscreteCustomEvent");var Bu=D(ee(),1),d5=Object.defineProperty,u5=(e,t)=>d5(e,"name",{value:t,configurable:!0}),qN=Bu[" useInsertionEffect ".trim().toString()];function us(e){let t=Bu.useRef(e);return typeof qN=="function"?qN(()=>{t.current=e}):fn(()=>{t.current=e}),Bu.useMemo(()=>((...a)=>t.current?.(...a)),[])}u5(us,"useCallbackRef");var GN=D(W(),1),f5=Object.defineProperty,Va=(e,t)=>f5(e,"name",{value:t,configurable:!0}),py="dismissableLayer.update",p5="dismissableLayer.pointerDownOutside",m5="dismissableLayer.focusOutside",VN,$N=Ot.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),WN=Ot.forwardRef(Va(function(t,a){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=Ot.useContext($N),[f,m]=Ot.useState(null),p=f?.ownerDocument??globalThis?.document,[,b]=Ot.useState({}),v=qa(a,m),g=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=h?g.indexOf(h):-1,y=f?g.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,A=y>=x,I=Ot.useRef(!1),k=KN(H=>{o?.(H),l?.(H),H.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:Ot.useCallback(H=>{if(!(H instanceof Node))return!1;let Y=[...d.branches].some(oe=>oe.contains(H));return A&&!Y},[d.branches,A])}),T=YN(H=>{if(r&&I.current)return;let Y=H.target;[...d.branches].some(q=>q.contains(Y))||(s?.(H),l?.(H),H.defaultPrevented||c?.())},p),_=f?y===g.length-1:!1,M=us(H=>{H.key==="Escape"&&(i?.(H),!H.defaultPrevented&&c&&(H.preventDefault(),c()))});return Ot.useEffect(()=>{if(_)return p.addEventListener("keydown",M,{capture:!0}),()=>p.removeEventListener("keydown",M,{capture:!0})},[p,_,M]),Ot.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(VN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),my(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=VN))}},[f,p,n,d]),Ot.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),my())},[f,d]),Ot.useEffect(()=>{let H=Va(()=>b({}),"handleUpdate");return document.addEventListener(py,H),()=>document.removeEventListener(py,H)},[]),(0,GN.jsx)(Er.div,{...u,ref:v,style:{pointerEvents:C?A?"auto":"none":void 0,...t.style},onFocusCapture:rr(t.onFocusCapture,T.onFocusCapture),onBlurCapture:rr(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:rr(t.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function gy(){let e=Ot.useContext($N),[t,a]=Ot.useState(null);return Ot.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),a}Va(gy,"useDismissableLayerSurface");var g5=Va(()=>!0,"IS_TRUE");function KN(e,t){let{ownerDocument:a=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=g5}=t,s=us(e),l=Ot.useRef(!1),c=Ot.useRef(!1),u=Ot.useRef(new Map),d=Ot.useRef(()=>{});return Ot.useEffect(()=>{function f(){c.current=!1,r.current=!1,u.current.clear()}Va(f,"resetOutsideInteraction");function m(){return Array.from(u.current.values()).some(Boolean)}Va(m,"isOutsideInteractionIntercepted");function p(x){if(!c.current)return;let y=x.target;y instanceof Node&&[...i].some(A=>A.contains(y))||u.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{c.current&&d.current()},0)}Va(p,"handleInteractionCapture");function b(x){c.current&&u.current.set(x.type,!1)}Va(b,"handleInteractionBubble");let v=Va(x=>{if(x.target&&!l.current){let C=function(){a.removeEventListener("click",d.current);let I=m();f(),I||hy(p5,s,A,{discrete:!0})};var y=C;if(Va(C,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){a.removeEventListener("click",d.current),f(),l.current=!1;return}let A={originalEvent:x};c.current=!0,r.current=n&&x.button===0,u.current.clear(),!n||x.button!==0?C():(a.removeEventListener("click",d.current),d.current=C,a.addEventListener("click",d.current,{once:!0}))}else a.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let x of g)a.addEventListener(x,p,!0),a.addEventListener(x,b);let h=window.setTimeout(()=>{a.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",v),a.removeEventListener("click",d.current);for(let x of g)a.removeEventListener(x,p,!0),a.removeEventListener(x,b)}},[a,s,n,r,i,o]),{onPointerDownCapture:Va(()=>l.current=!0,"onPointerDownCapture")}}Va(KN,"usePointerDownOutside");function YN(e,t=globalThis?.document){let a=us(e),n=Ot.useRef(!1);return Ot.useEffect(()=>{let r=Va(i=>{i.target&&!n.current&&hy(m5,a,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:Va(()=>n.current=!0,"onFocusCapture"),onBlurCapture:Va(()=>n.current=!1,"onBlurCapture")}}Va(YN,"useFocusOutside");function my(){let e=new CustomEvent(py);document.dispatchEvent(e)}Va(my,"dispatchUpdate");function hy(e,t,a,{discrete:n}){let r=a.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?fy(r,i):r.dispatchEvent(i)}Va(hy,"handleAndDispatchCustomEvent");var sa=D(ee(),1);var wy=D(W(),1),h5=Object.defineProperty,Ra=(e,t)=>h5(e,"name",{value:t,configurable:!0}),by="focusScope.autoFocusOnMount",vy="focusScope.autoFocusOnUnmount",XN={bubbles:!1,cancelable:!0},QN=sa.forwardRef(Ra(function(t,a){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=t,[c,u]=sa.useState(null),d=us(o),f=us(s),m=sa.useRef(null),p=qa(a,u),b=sa.useRef(i);sa.useEffect(()=>{b.current=i});let v=sa.useCallback(x=>x?c?.contains(x)?!0:!!b.current?.some(y=>y.contains(x)):!1,[c]),g=sa.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;sa.useEffect(()=>{if(r){let A=function(_){if(g.paused||!c)return;let M=_.target;v(M)?m.current=M:co(m.current,{select:!0})},I=function(_){if(g.paused||!c)return;let M=_.relatedTarget;M!==null&&(v(M)||co(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(let H of _)H.removedNodes.length>0&&co(c)};var x=A,y=I,C=k;Ra(A,"handleFocusIn"),Ra(I,"handleFocusOut"),Ra(k,"handleMutations"),document.addEventListener("focusin",A),document.addEventListener("focusout",I);let T=new MutationObserver(k);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",A),document.removeEventListener("focusout",I),T.disconnect()}}},[r,c,g.paused,v]),sa.useEffect(()=>{if(c){ZN.add(g);let x=document.activeElement;if(!c.contains(x)){let C=new CustomEvent(by,XN);c.addEventListener(by,d),c.dispatchEvent(C),C.defaultPrevented||(eE(iE(Cy(c)),{select:!0}),document.activeElement===x&&co(c))}return()=>{c.removeEventListener(by,d);let C=c.ownerDocument,A=CustomEvent;setTimeout(()=>{let I=new A(vy,XN);c.addEventListener(vy,f),c.dispatchEvent(I),I.defaultPrevented||co(x??C.body,{select:!0}),c.removeEventListener(vy,f),ZN.remove(g)},0)}}},[c,d,f,g]);let h=sa.useCallback(x=>{if(!n&&!r||g.paused)return;let y=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(y&&C){let A=x.currentTarget,[I,k]=tE(A);I&&k?!x.shiftKey&&C===k?(x.preventDefault(),n&&co(I,{select:!0})):x.shiftKey&&C===I&&(x.preventDefault(),n&&co(k,{select:!0})):C===A&&x.preventDefault()}},[n,r,g.paused]);return(0,wy.jsx)(Er.div,{tabIndex:-1,...l,ref:p,onKeyDown:h})},"FocusScope")),JN=sa.createContext(null);function ky({registry:e,children:t}){return e?(0,wy.jsx)(JN.Provider,{value:e,children:t}):t}Ra(ky,"FocusScopeBranchProvider");function Sy(){let[e,t]=sa.useState([]),a=sa.useMemo(()=>({add:Ra(n=>t(r=>r.includes(n)?r:[...r,n]),"add"),remove:Ra(n=>t(r=>r.filter(i=>i!==n)),"remove")}),[]);return{nodes:e,registry:a}}Ra(Sy,"useFocusScopeBranchRegistry");function b5(e){let t=sa.useContext(JN);sa.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}Ra(b5,"useFocusScopeBranch");function eE(e,{select:t=!1}={}){let a=document.activeElement;for(let n of e)if(co(n,{select:t}),document.activeElement!==a)return}Ra(eE,"focusFirst");function tE(e){let t=Cy(e),a=xy(t,e),n=xy(t.reverse(),e);return[a,n]}Ra(tE,"getTabbableEdges");function Cy(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ra(r=>{let i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Ra(Cy,"getTabbableCandidates");function xy(e,t){let a=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(a?!n.checkVisibility({checkVisibilityCSS:!0}):aE(n,{upTo:t})))return n}Ra(xy,"findVisible");function aE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ra(aE,"isHidden");function nE(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ra(nE,"isSelectableInput");function co(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&nE(e)&&t&&e.select()}}Ra(co,"focus");var ZN=rE();function rE(){let e=[];return{add(t){let a=e[0];t!==a&&a?.pause(),e=yy(e,t),e.unshift(t)},remove(t){e=yy(e,t),e[0]?.resume()}}}Ra(rE,"createFocusScopesStack");function yy(e,t){let a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}Ra(yy,"arrayRemove");function iE(e){return e.filter(t=>t.tagName!=="A")}Ra(iE,"removeLinks");var ng=D(ee(),1),oE=D(Zc(),1);var sE=D(W(),1),v5=Object.defineProperty,x5=(e,t)=>v5(e,"name",{value:t,configurable:!0}),lE=ng.forwardRef(x5(function(t,a){let{container:n,...r}=t,[i,o]=ng.useState(!1);fn(()=>o(!0),[]);let s=n||i&&globalThis?.document?.body;return s?oE.createPortal((0,sE.jsx)(Er.div,{...r,ref:a}),s):null},"Portal"));var nn=D(ee(),1);var cE=D(ee(),1),y5=Object.defineProperty,uo=(e,t)=>y5(e,"name",{value:t,configurable:!0});function dE(e,t){return cE.useReducer((a,n)=>t[a][n]??a,e)}uo(dE,"useStateMachine");var rg=uo(e=>{let{present:t,children:a}=e,n=uE(t),r=typeof a=="function"?a({present:n.isPresent}):nn.Children.only(a),i=fE(n.ref,pE(r));return typeof a=="function"||n.isPresent?nn.cloneElement(r,{ref:i}):null},"Presence");function uE(e){let[t,a]=nn.useState(),n=nn.useRef(null),r=nn.useRef(e),i=nn.useRef("none"),o=nn.useRef(void 0),s=e?"mounted":"unmounted",[l,c]=dE(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return nn.useEffect(()=>{l==="mounted"?(i.current=o.current??Pc(n.current),o.current=void 0):i.current="none"},[l]),fn(()=>{let u=n.current,d=r.current;if(d!==e){let m=i.current,p=Pc(u);e?(o.current=p,c("MOUNT")):p==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),fn(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,f=uo(p=>{let v=Pc(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!r.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},"handleAnimationEnd"),m=uo(p=>{p.target===t&&(i.current=Pc(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:nn.useCallback(u=>{if(u){let d=getComputedStyle(u);n.current=d,o.current=Pc(d)}else n.current=null;a(u)},[])}}uo(uE,"usePresence");function Ry(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}uo(Ry,"setRef");function fE(...e){let t=nn.useRef(e);return t.current=e,nn.useCallback(a=>{let n=t.current,r=!1,i=n.map(o=>{let s=Ry(o,a);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<i.length;o++){let s=i[o];typeof s=="function"?s():Ry(n[o],null)}}},[])}uo(fE,"useStableComposedRefs");function Pc(e){return e?.animationName||"none"}uo(Pc,"getAnimationName");function pE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}uo(pE,"getElementRef");var mE=D(ee(),1),w5=Object.defineProperty,Ay=(e,t)=>w5(e,"name",{value:t,configurable:!0}),ig=0,_c=null;function k5(e){return og(),e.children}Ay(k5,"FocusGuards");function og(){mE.useEffect(()=>{_c||(_c={start:Iy(),end:Iy()});let{start:e,end:t}=_c;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ig++,()=>{ig===1&&(_c?.start.remove(),_c?.end.remove(),_c=null),ig=Math.max(0,ig-1)}},[])}Ay(og,"useFocusGuards");function Iy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Ay(Iy,"createFocusGuard");var Mn=function(){return Mn=Object.assign||function(t){for(var a,n=1,r=arguments.length;n<r;n++){a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},Mn.apply(this,arguments)};function sg(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a}function gE(e,t,a){if(a||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var fg=D(ee());var pn=D(ee());var il="right-scroll-bar-position",ol="width-before-scroll-bar",Dy="with-scroll-bars-hidden",Ly="--removed-body-scroll-bar-size";function lg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var hE=D(ee());function bE(e,t){var a=(0,hE.useState)(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(n){var r=a.value;r!==n&&(a.value=n,a.callback(n,r))}}}})[0];return a.callback=t,a.facade}var cg=D(ee());var S5=typeof window<"u"?cg.useLayoutEffect:cg.useEffect,vE=new WeakMap;function Ny(e,t){var a=bE(t||null,function(n){return e.forEach(function(r){return lg(r,n)})});return S5(function(){var n=vE.get(a);if(n){var r=new Set(n),i=new Set(e),o=a.current;r.forEach(function(s){i.has(s)||lg(s,null)}),i.forEach(function(s){r.has(s)||lg(s,o)})}vE.set(a,e)},[e]),a}function C5(e){return e}function R5(e,t){t===void 0&&(t=C5);var a=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(i){var o=t(i,n);return a.push(o),function(){a=a.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(n=!0;a.length;){var o=a;a=[],o.forEach(i)}a={push:function(s){return i(s)},filter:function(){return a}}},assignMedium:function(i){n=!0;var o=[];if(a.length){var s=a;a=[],s.forEach(i),o=a}var l=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),a={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),a}}}};return r}function Ey(e){e===void 0&&(e={});var t=R5(null);return t.options=Mn({async:!0,ssr:!1},e),t}var xE=D(ee()),yE=function(e){var t=e.sideCar,a=sg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return xE.createElement(n,Mn({},a))};yE.isSideCarExport=!0;function Oy(e,t){return e.useMedium(t),yE}var dg=Ey();var Ty=function(){},Mu=pn.forwardRef(function(e,t){var a=pn.useRef(null),n=pn.useState({onScrollCapture:Ty,onWheelCapture:Ty,onTouchMoveCapture:Ty}),r=n[0],i=n[1],o=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,p=e.noIsolation,b=e.inert,v=e.allowPinchZoom,g=e.as,h=g===void 0?"div":g,x=e.gapMode,y=sg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,A=Ny([a,t]),I=Mn(Mn({},y),r);return pn.createElement(pn.Fragment,null,u&&pn.createElement(C,{sideCar:dg,removeScrollBar:c,shards:d,noRelative:m,noIsolation:p,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:a,gapMode:x}),o?pn.cloneElement(pn.Children.only(s),Mn(Mn({},I),{ref:A})):pn.createElement(h,Mn({},I,{className:l,ref:A}),s))});Mu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mu.classNames={fullWidth:ol,zeroRight:il};var Jt=D(ee());var Mc=D(ee());var SE=D(ee());var wE;var kE=function(){if(wE)return wE;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function I5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kE();return t&&e.setAttribute("nonce",t),e}function A5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function D5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Py=function(){var e=0,t=null;return{add:function(a){e==0&&(t=I5())&&(A5(t,a),D5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var _y=function(){var e=Py();return function(t,a){SE.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}};var Fu=function(){var e=_y(),t=function(a){var n=a.styles,r=a.dynamic;return e(n,r),null};return t};var L5={left:0,top:0,right:0,gap:0},By=function(e){return parseInt(e||"",10)||0},N5=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[By(a),By(n),By(r)]},My=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return L5;var t=N5(e),a=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-a+t[2]-t[0])}};var E5=Fu(),Bc="data-scroll-locked",O5=function(e,t,a,n){var r=e.left,i=e.top,o=e.right,s=e.gap;return a===void 0&&(a="margin"),`
19
+ Agent's next behavior`,loopHint:"After behavior changes, PD keeps observing \u2014 forming a closed loop. 9 agents are distributed across this loop, each with its own role."},status:{enabled:"Enabled",notReady:"Not Ready",corePipeline:"Core Pipeline",corePipelineOk:"OK",corePipelineDegraded:"Degraded",corePipelineParalyzed:"Paralyzed",needsConfig:"Needs Config"},groups:{coreTrio:"Core Trio",coreTrioTag:"Must together",coreTrioHint:"Disabling any one breaks the error-to-principle pipeline",codeChain:"Code Chain",codeChainTag:"Recommend together",codeChainHint:"Only artificer degrades to prompt-only; only evaluator is meaningless",qualityPolish:"Quality Polish",qualityPolishTag:"Optional \xB7 toggle individually",qualityPolishHint:"Refines principles; disabling is fine, just slightly rougher quality",sidechain:"Sidechain",sidechainTag:"Independent \xB7 toggle individually",sidechainHint:"Does not affect the main pipeline; only pain signal detection precision"},impact:{label:"If disabled",confirmTitle:"Confirm disabling core agent",confirmAck:"Confirm disable",confirmCancel:"Cancel"},techDetail:"Technical Details",profileLabelShort:"Runtime",manageProfiles:"Manage Profiles",readinessChecking:"Checking readiness\u2026",unknownAgentsWarning:"Detected {{count}} unrecognized agent(s): {{names}}. They are not shown in groups.",footerNote:"9 agents are distributed across the internalization pipeline and sidechain services. The Core Trio must be enabled together \u2014 otherwise PD cannot turn errors into principles.",profiles:{sectionTitle:"Runtime Profile Management",sectionDescription:"Create, edit, and delete runtime profiles. Profiles referenced by an agent or set as default cannot be deleted.",createButton:"Create Profile",editButton:"Edit",deleteButton:"Delete",cancelButton:"Cancel",saveButton:"Save",creating:"Creating\u2026",saving:"Saving\u2026",deleting:"Deleting\u2026",empty:"No runtime profiles yet.",columnId:"ID",columnType:"Type",columnProvider:"Provider",columnModel:"Model",columnApiKeyEnv:"API Key Env Var",columnReadiness:"Readiness",columnActions:"Actions",formTitleCreate:"Create Runtime Profile",formTitleEdit:"Edit Profile: {{id}}",fieldId:"Profile ID",fieldIdHint:"Unique identifier, cannot be changed after creation (e.g. anthropic-cloud)",fieldIdPlaceholder:"my-profile",fieldProvider:"Provider",fieldProviderPlaceholder:"anthropic",fieldModel:"Model",fieldModelPlaceholder:"claude-sonnet-4",fieldApiKeyEnv:"API Key Env Var Name",fieldApiKeyEnvHint:"Environment variable name, not the key value (e.g. ANTHROPIC_API_KEY)",fieldApiKeyEnvPlaceholder:"ANTHROPIC_API_KEY",fieldBaseUrl:"Base URL (optional)",fieldBaseUrlPlaceholder:"https://api.anthropic.com",retiredBadge:"retired",validationIdRequired:"Profile ID is required",validationProviderRequired:"pi-ai profile requires provider",validationModelRequired:"pi-ai profile requires model",validationApiKeyEnvRequired:"pi-ai profile requires apiKeyEnv",deleteConfirmTitle:"Confirm Delete",deleteConfirmMessage:'Delete profile "{{id}}"? This action cannot be undone.',deleteConfirmAck:"Confirm Delete",deleteConfirmCancel:"Cancel",createSuccess:"Profile created",updateSuccess:"Profile updated",deleteSuccess:"Profile deleted",operationFailed:"Operation failed"}},login:{title:"Login",description:"Login to PD Governance Workspace",slogan:"Turn repeated corrections into governed principles",connectWorkspace:"Connect to PD Workspace",detecting:"Detecting local Companion\u2026",connecting:"Connecting to PD Workspace\u2026",accessToken:"Access token",enterAccessToken:"Enter the access token to connect",connect:"Connect",errorInvalid:"Invalid access credential or service not ready. Check and retry.",errorExpired:"Session expired or token invalid. Please re-enter.",recoveryTitle:"Cannot connect to PD Workspace",recoveryReason:"Reason: the stored Owner credential has expired or does not match the local Console.",reconnect:"Reconnect",manualEntry:"Enter access token manually",manualEntryHint:"A manually entered token updates the credential saved in Companion.",readFailedTitle:"Companion credential read failed",readFailedHint:"Could not read the credential saved by Companion (possible version mismatch). Please enter the token manually; if this persists, restart Companion.",persistFailed:"Connected, but the credential was not securely saved \u2014 the token will be needed again next time.",persistSucceeded:"Owner credential securely saved by Companion; the next open will connect automatically.",persistAttached:"Credential saved, but the Console in use was started externally \u2014 restart Companion to apply it.",tokenSessionOnly:"Token is stored in browser session only.",noAuthFlag:"Use --no-auth flag to disable authentication."},update:{eyebrow:"Updates",title:"Updates",subtitle:"Check for PD updates and view update history. Updates keep your governance workspace current.",currentVersion:"Current Version",latestVersion:"Latest Version",upToDate:"Up to date",updateAvailable:"Update available",checkForUpdates:"Check for Updates",checking:"Checking\u2026",history:"Update History",noHistory:"No update history available.",version:"Version",failed:"Failed",historyKind:{update:"Update",reinstall:"Reinstall",legacy_migration:"Legacy migration",rollback:"Rollback",refusal:"Refused",failure:"Failed",recovery:"Recovery",unknown:"Unknown operation"},checkError:"Check error",syncPending:"Version {{pluginVersion}} is published, but the installer is syncing (you can update to the version shown above for now). Please try again later.",loadError:"Unable to load update data. You can try refreshing the page.",checkFailed:"Update check failed. Please try again later.",blockedBadge:"Action needed",reasonLabel:"Reason: ",recoveryBanner:"An unfinished update transaction was found",recoveryItem:'Transaction {{id}} stopped at phase "{{phase}}"',recoveryRequiredBanner:"A failed update left the installation inconsistent (recovery required)",recoveryRequiredItem:"Failed transaction {{id}} needs recovery \u2014 re-run the official installer",inProgressToast:"Update transaction accepted and running in the background; do not click again.",inProgressPanel:"Update in progress",inProgressPhase:"Current phase: {{phase}}",inProgressConfirmed:"Update finished ({{version}}). Restart the console to load the new version.",inProgressEnded:"Update transaction ended: {{state}}",inProgressTimeout:"The update is taking long and its result is unconfirmed. Check the transaction in the update history later.",reason:{bootstrap_too_old:"The update bootstrap component on this machine is too old for this release. Run the official installer (npx create-principles-disciple) to repair, then retry.",bootstrap_not_registered:"The update bootstrap is not registered on this machine (older install). Run the official installer to repair, then retry.",bootstrap_manifest_corrupt:"The update bootstrap registration file is corrupt. Run the official installer to repair, then retry.",bootstrap_identity_mismatch:"The update bootstrap registration does not match the deployed files. Run the official installer to repair, then retry.",metadata_source_unconfigured:"The official update source is not registered: this machine has no signed-release address to check against. Run the official installer once with the update source address to register it.",install_state_corrupt:"The installation state file is corrupt. Run the official installer to repair, then retry.",journal_not_supported:"The update transaction directory is unavailable. Check disk space and permissions for ~/.pd/transactions, then retry.",installer_missing:"Update components are unavailable. Run the official installer to repair, then retry.",bootstrap_not_installed:"No valid installation detected. Install PD with the official installer first.",downgrade_blocked:"The target version is older than the installed one; downgrades are refused by default.",sequence_regression:"The target release sequence is not newer than the current one; refused to prevent rollback.",channel_pointer_mismatch:"The signed channel pointer disagrees with the release content. Retry later; contact the maintainer if it persists.",release_metadata_expired:"The release metadata has expired. Wait for an official re-publication, then retry.",channel_metadata_expired:"The channel metadata has expired. Wait for an official refresh, then retry.",legacy_layout_not_supported:"This installation uses the legacy layout. Run the official installer to migrate to the supported layout.",metadata_refresh_failed:"Could not fetch or verify the signed release metadata. Check your network and retry.",destructive_migration_requires_maintenance:"This release contains a destructive data migration and cannot ship through an ordinary update. Use the official maintenance workflow to migrate your data."},applyUpdate:"Update Now",updating:"Updating\u2026",updateFailed:"Update failed: {{message}}",networkErrorHint:"Please check your network connection and try again.",retry:"Retry",applyFullUpdate:"Full Update",fullUpdateSuccess:"Full update completed.",confirmFullUpdateTitle:"Confirm Update",confirmFullUpdateDesc:"Downloads and updates all PD packages (plugin, console, core, CLI). Usually takes just a few seconds. Your custom files (AGENTS.md etc.) are not affected. You will need to restart the console after completion.",fullUpdateRestartPrompt:"Update complete. Please restart the console to load the new version: press Ctrl+C, then run pd console again."},intent:{eyebrow:"Owner Intent",title:"Owner Intent Document",subtitle:"A single-page anchor for what the owner wants, what must not be violated, and where to escalate. Read by PD only when the intent_engineering flag is on.",flagStatus:{enabled:"Flag on",disabled:"Flag off",ariaLabel:"intent_engineering feature flag status",enable:"Enable Intent Engineering",enabling:"Enabling\u2026",enableFailed:"Failed to enable. Try again later or manually edit .pd/config.yaml"},editEntry:{heading:"Edit INTENT.md",title:"Owner-owned document",description:"PD never modifies this file. Edit it in your own editor to declare or revise your intent.",copy:"Copy path",copyAriaLabel:"Copy INTENT.md file path to clipboard"},flagDisabled:{title:"Intent Engineering is off",description:"The intent_engineering feature flag is disabled. PD is not reading INTENT.md, not injecting intent context into prompts, and not surfacing intent tension in diagnosis. This is the default quiet state."},notFound:{title:"No INTENT.md found",description:"PD did not find an INTENT.md file in the .principles/ directory. Without this anchor, intent-grounded diagnosis cannot run.",nextAction:"Run: pd intent init --confirm --workspace <path>",createButton:"Create INTENT.md",creating:"Creating\u2026",createFailed:"Creation failed, please try again later",createSuccess:"INTENT.md created. You can start filling in your intent."},onboarding:{title:"Welcome to Intent Engineering",subtitle:"Before we begin, let's understand what intent engineering is",whatIsIt:{title:"What is Intent Engineering?",description:"INTENT.md is your long-term intent anchor \u2014 recording your goals, non-negotiable boundaries, and when to stop and escalate. It helps PD align with your true intent at key decision points."},whyYouFill:{title:"Why do you need to fill it in?",description:"Intent is Owner-owned. PD will not auto-generate intent because only you know the project's real goals and boundaries. This is your decision authority; PD only helps you execute and align."},sectionGuide:{title:"5-section guide",description:"INTENT.md contains 5 sections, each with a clear purpose:",sections:{why:"Why \u2014 the fundamental motivation for this project",desiredOutcome:"Desired Outcome \u2014 the specific results you want to achieve",nonNegotiables:"Non-Negotiables \u2014 boundaries that must never be violated",stopEscalation:"Stop / Escalation \u2014 when to stop the current action and escalate to you",currentStrategicFocus:"Current Strategic Focus \u2014 phase-specific priorities"}},skipOption:"Skip guide, create empty template to fill in later",startFilling:"Start filling",skip:"Skip",close:"Close",dontShowAgain:"Don't show again"},editor:{title:"Edit INTENT.md",description:"Edit your intent document directly in the browser. Changes take effect immediately after saving.",placeholder:"Enter INTENT.md content here (Markdown format)\u2026",save:"Save",saving:"Saving\u2026",cancel:"Cancel",edit:"Edit",saveSuccess:"INTENT.md saved",saveFailed:"Save failed, please try again later",emptyContent:"Content cannot be empty",oversized:"Content exceeds 32KB limit, please trim and retry",confirmDiscard:"You have unsaved changes. Discard them?",yes:"Yes, discard changes",no:"Continue editing"},oversized:{title:"INTENT.md exceeds 32KB",description:"The file is larger than the 32KB cap. PD refuses to read oversized files to keep intent parsing deterministic and bounded.",nextAction:"Trim INTENT.md to under 32KB. Move long-form strategy to a separate doc."},sections:{why:"Why",desiredOutcome:"Desired Outcome",nonNegotiables:"Non-negotiables",stopEscalation:"Stop / Escalation",currentStrategicFocus:"Current Strategic Focus"},warnings:{title:"Health Warnings",empty:"No warnings. INTENT.md is well-formed.",missing_section:"Missing section",empty_section:"Empty section",too_vague:"Section too vague (under 10 characters)",oversized:"Document exceeds 32KB cap",parse_failed:"Section failed to parse"},meta:{title:"Document Metadata",lastEditedAt:"Last edited",contentHash:"Content hash",path:"Path",templateTitle:"INTENT.md Template",templateDescription:"Copy this into .principles/INTENT.md. Replace placeholders with your intent."},loadError:"Failed to load intent document",validationError:"Data format validation failed, please refresh and retry",decisions:{sectionTitle:"Owner Decisions",sectionSubtitle:"Lightweight audit summary derived from IntentDecisionRecord. Not a dashboard.",countConfirmDrift:"Confirm drift",countReviseIntent:"Revise intent",countObserve:"Observe",countDismiss:"Dismiss",countPromoteToPrinciple:"Promote to principle",countPromoteToRulehost:"Promote to RuleHost",lastDecisionAtLabel:"Last decision",noDecisions:"No decisions recorded yet",loadError:"Failed to load decision summary"},langSelector:{ariaLabel:"Select INTENT.md language",disabledWhileEditing:"Save or cancel your edit before switching language"},versionHistory:{title:"Version History",reasonInit:"Initialized",reasonSave:"Saved"},wizard:{progressLabel:"Step {{current}}/5",next:"Next",prev:"Previous",finish:"Finish",review:"Review",complete:"Complete",cancel:"Cancel",emptyWarning:"This section cannot be empty. Please fill it in before continuing.",stepLabels:{why:"1. Why",desiredOutcome:"2. Desired Outcome",nonNegotiables:"3. Non-negotiables",stopEscalation:"4. Stop / Escalation",currentStrategicFocus:"5. Current Strategic Focus"},guidance:{why:"Explain why this project matters. What does the Owner care about? What happens if it is not solved?",desiredOutcome:"Describe an observable change. After completion, what will be better?",nonNegotiables:"List hard constraints that cannot be violated (compliance / safety / boundaries).",stopEscalation:"Under what circumstances should the Agent stop and escalate to the Owner instead of pushing forward?",currentStrategicFocus:"What is the top priority for the current phase? (Will be updated as phases change.)"},discardConfirmTitle:"Discard your input?",discardConfirmBody:"Content you have entered will be lost and cannot be recovered.",discardConfirmCancel:"Continue editing",discardConfirmConfirm:"Discard"},versionDiff:{changed:"Changed",unchanged:"Unchanged",oldPreview:"Previous version",newPreview:"New version",expandHint:"Click to view section-level diff",collapseHint:"Click to collapse diff"}},examiner:{loading:"Loading Examiner\u2026",title:"Examiner Verification",subtitle:"Controlled A/B behavior-effect verification for a target principle (offline-first).",scope:{title:"Execution scope & gates"},mode:{full:"Full Library Incremental A/B (default)",isolated:"Isolated Principle A/B (diagnostic)"},create:{title:"Create an offline study",target:"Target principle (one per study)",mode:"Experiment mode",repetitions:"Repetitions per case",submit:"Create study",note:"Synthetic calibration cases (SYNTHETIC_OFFLINE gold). Study identities are server-minted and never overwritten."},studies:{title:"Studies",empty:"No studies yet \u2014 create an offline study above."},study:{title:"Study {{studyId}}",mode:"Mode",intervention:"Intervention",target:"Target",plannedPairs:"Planned pairs",run:"Execution",finished:"finished",running:"running",notRun:"not run",report:"Report",preflight:"Run preflight",runOffline:"Run offline",back:"Principle Evaluation",statusTitle:"Study status",readOnly:"Read-only study",openReport:"Open report",runDry:"Host dry-run",requestF2:"Request F2 real-host run",modesNote:"Offline-stub runs synchronously and validates the contract pipeline; Host dry-run executes asynchronously with ZERO model calls; F2 real-host runs require an APPROVED Stage R authorization inside this study.",accepted:{dryRun:"Host dry-run accepted \u2014 polling for the checklist.",f2:"F2 request accepted \u2014 polling for settlement."},snapshot:{title:"Frozen production snapshot",frozenAt:"Frozen at",route:"Production route",budget:"Production budget",divergence:"Ledger-active without runtime activation",activationDegraded:"Activation data was UNAVAILABLE at freeze time (truth unknown, not zero)",matchesProduction:"matches production configuration"},runs:{title:"Console runs (async contract)",empty:"No console runs yet \u2014 use Host dry-run or an F2 request.",ledgerProblem:"The run ledger cannot be read \u2014 the history below is NOT trustworthy"}},preflight:{status:"Preflight status"},report:{title:"Report V2",target:"Target",endpoint:"Primary endpoint",fidelity:"Treatment Fidelity",contamination:"Control contamination",evictions:"Capacity evictions",ittNote:"planned applicable {{planned}} \xB7 determined {{determined}} \xB7 unknown sides {{unknown}} \xB7 NOT_APPLICABLE {{na}} (excluded from the denominator)",noExaminerBlock:"This report predates the v0.9 contract (no examiner block).",offlineNote:"Offline-stub results validate the contract pipeline only \u2014 never real-host behavior. Real host experiments require separate Owner authorization.",back:"Execution & Evidence",missing:"No Report V2 yet \u2014 run the offline execution on the study page first.",replay:"Replay verification",limitations:"Limitations",handoff:{title:"Owner decision handoff",note:"The report informs the decision; the Owner decides in the existing principle governance workflow. Examiner never mutates lifecycle, RuleCode or activation state by itself.",openGovernance:"Open principle governance",refresh:"Refresh report"},production:{title:"Production observation (separate lane)",note:"Real-run evidence for the same principle. It complements the controlled A/B result above and is never merged into its numbers.",missing:"Production evidence for the target principle is unavailable here."}},created:"Study {{studyId}} created.",runDone:"Offline execution finished: {{count}} units succeeded.",reportGenerated:"Report generated ({{status}}).",evaluation:{title:"Principle Evaluation",configureCta:"Configure a study",noActive:"No active principles in this workspace \u2014 activate a principle before evaluating it.",loadingEvidence:"Loading production evidence\u2026",refresh:"Refresh evidence",openGovernance:"Open principle governance",selectPrinciple:"Select a principle to see its production evidence.",openStudy:"Open"},evidence:{runtimeDeactivated:"runtime revoked",ruleCount:"RuleCodes (ledger)",painRefs:"Pain lineage",evaluability:"Evaluability",painPrevented:"Pains prevented",activation:{title:"Runtime activation",promptRows:"Prompt activations",ruleCodeRows:"RuleCode activations"},injection:{title:"Prompt injection (production projection)",noRows:"No injection rows for this principle (unavailable lanes are never reported as zero events).",budget:"Budget",projectionNote:"A projection forecasts what the production prompt path WOULD deliver \u2014 it is not proof the model consumed the content."},receipts:{title:"Receipts",effects:"Effects",presence:"Presence"},audit:{title:"Intervention evidence audit",deliveries:"Deliveries",applications:"Applications",episodes:"Episodes",effects:"Effects",outcomes:"Outcomes",unresolved:"Unresolved refs",loadedSuffix:"(loaded; more exist)",hasMoreNote:"More records exist beyond this read window \u2014 the counts above are the LOADED page, not the evidence total.",ladder:"Confirmation ladder (never promoted)",asOf:"Audit as of"},asOf:"Read at",outcomes:{title:"Owner outcomes (recent)"}},configure:{back:"Principle Evaluation",title:"Study Configuration",subtitle:"What exactly will this evaluation compare, and under which frozen inputs?",fullNote:"Control: the full host-effective library WITHOUT the target. Treatment: the same library WITH the target. The target is the only planned intervention variable.",isolatedNote:"Diagnostic mode: control is EMPTY (all PD principles off), treatment carries the target only.",suite:{title:"Challenge suite"},readiness:{title:"Host execution readiness"},difference:{title:"Experiment vs production configuration",note:"The study freezes its own budget and renders arms deterministically; the frozen production snapshot records every detected difference (markers such as EXPERIMENT_CONFIGURATION_DIFFERS_FROM_PRODUCTION)."},summary:"Target {{target}} \xB7 suite {{suite}} \xB7 {{pairs}} planned pairs"},errors:{unavailable:"The Examiner research engine is unavailable in this installation (the installer payload does not include the research modules).",create:"Failed to create the study.",preflight:"Preflight failed.",run:"Offline execution failed.",report:"Report generation failed.",evidence:"Failed to load production evidence.",status:"Failed to load the study status."}},debt:{eyebrow:"Principle Debt",title:"Principle Debt Management",subtitle:"Review active principles that may be stagnant, never activated, or flagged as technical/behavioral debt.",emptyTitle:"No Principle Debts",emptyDescription:"Excellent! All your active principles are either recently active, verified in execution, or have no pending stagnation alerts.",reasonNeverActivated:"This principle has been approved but never deployed to any active channel (e.g. prompt, RuleHost).",reasonStagnant:"This principle approval request has been stagnant/pending for more than 7 days.",suggestedAction:"Suggested Action",actionArchive:"Archive",actionDeactivate:"Deactivate",actionKeep:"Keep and Observe",confirmArchive:"Archiving this principle will remove it from the active ruleset. Are you sure you want to archive?",confirmDeactivate:"Deactivating this channel will stop enforcing this rule at runtime. Are you sure you want to deactivate?",deactivateSuccess:"Channel deactivated successfully.",deactivateFailed:"Failed to deactivate channel.",archiveSuccess:"Principle archived successfully.",archiveFailed:"Failed to archive principle.",undoAction:"Undo",undoSuccess:"Operation undone successfully.",undoFailed:"Undo operation failed.",loadError:"Unable to load principle debt data. Please try refreshing the page.",daysSinceAgo:"{{count}} days ago",demoteTooltip:"Demote endpoint under development",principleAriaLabel:"Debt Principle {{id}}",listAriaLabel:"Debt principles list"},welcome:{title:"Welcome to Principles Disciple",subtitle:"Turn your repeated corrections into reviewed, reversible principles.",stateSaveError:"Couldn't save onboarding progress. Check browser storage permissions and retry.",stepIndicator:"Step {{current}} of {{total}}",step1:{title:"What is PD?",description:"An owner-governed behavior internalization system. PD turns behavioral evidence into reviewed, reversible principles that shape future agent behavior.",circuitLabel:"Core governance loop",circuitNodes:{evidence:"Evidence",principle:"Principle",ownerGate:"Owner Gate",behavior:"Behavior Change"},startButton:"Start",skipButton:"Skip onboarding"},step2:{title:"See the full governance loop in action",description:"This is a controlled demo using simulated evidence. In real use, your agent produces evidence through the pd-pain-signal skill.",runDemoButton:"Run demo",demoRunning:"Running demo...",demoComplete:"Demo complete",demoFailed:"Demo failed",demoSimulatedNote:"This evidence is simulated for demo purposes.",nextButton:"Next",evidenceLabel:"Evidence (simulated)",candidateLabel:"Candidate Principle",ownerGateLabel:"Owner Gate: Review and approve",activationLabel:"Activation Result",rollbackLabel:"Rollback path available",stages:{evidenceSeed:"Evidence (simulated)",principleProposal:"Candidate principle",ownerReview:"Owner review",activation:"Activation result",followUpObservation:"Follow-up observation",rollbackProof:"Rollback path ready"}},step3:{title:"Essential Slash Commands",description:"Type these commands in your agent conversation to control PD.",commandsIntro:"Here are 7 core commands. Type /pd-help for the full list.",commandDescriptions:{pdInit:"Initialize workspace (generate PRINCIPLES.md, THINKING_OS.md, etc.)",pdStatus:"View system status (GFI, Pain dictionary)",pdPain:"Report pain from OpenClaw session",pdHelp:"Show all commands and usage guide",pdContext:"Control context injection",pdFocus:"Manage CURRENT_FOCUS.md"},nextButton:"Next",emptyListFallback:"Failed to load command list. Type /pd-help to see all commands."},step4:{title:"Ready to record real evidence",description:"When your agent makes a mistake or you repeatedly correct it, tell the agent: 'Use pd-pain-signal to record this.'",examplePrompt:"Example prompt to agent:",examplePromptText:"I just corrected you on X. Use pd-pain-signal to record this as a pain signal.",tryNowButton:"Try it now (2-hour window)",goToFocusButton:"Got it, go to Focus",skipButton:"Skip for now",windowHint:"We'll check back in 2 hours. No pressure \u2014 you can always record evidence later.",pollingActive:"Listening for evidence... We'll check every 30 seconds for 2 hours.",stopPollingButton:"Stop and continue",evidenceFound:"Evidence detected! You can now review it in the Focus page.",timeoutHint:"No evidence detected in 2 hours. That's okay \u2014 you can record evidence anytime with pd-pain-signal.",pollingError:"Couldn't check for evidence. The evidence service may be unavailable.",retryButton:"Retry"},progress:{step1:"Welcome",step2:"Demo",step3:"Commands",step4:"Evidence"}},failedTasks:{title:"Failed Tasks",subtitle:"Pipeline tasks that failed or need human review",empty:"No failed tasks in the queried range. This does not mean the pipeline is healthy \u2014 check the learning-queue status below.",pipeline:{title:"Learning queue status",statusHealthy:"Progressing",statusBacklogged:"Backlogged (still progressing)",statusStalled:"Possibly stalled",statusDisabled:"Consumer disabled",statusUnknown:"Status unknown",nextActionPrefix:"Suggested: "},error:"Failed to load failed tasks",disabled:"Failed tasks observability is disabled. Enable 'failed_tasks_observability' in .pd/config.yaml to view.",createDraft:"Create Feedback Draft",recover:"Resume Evolution",recoverConfirmTitle:"Recover this evolution task?",recoverConfirmStatus:"Current status",recoverConfirmActionLabel:"Action",recoverConfirmActionDesc:"Reset the task and allow runtime execution",recoverConfirmImpactLabel:"Impact",recoverConfirmImpactDesc:"Existing artifacts are preserved. A new execution attempt will be created.",recoverConfirmAttempts:"Attempts used",recoverExhaustedWarning:"This task has used its entire retry budget ({{attempt}}/{{max}}). A plain recovery will be refused.",recoverConfirmForceButton:"Force recover",recoverConfirmForceImpactDesc:"Force-reset the task: clear its error and lease, raise the retry budget by 3, and create a new execution attempt. Existing artifacts are preserved.",recoverConfirmButton:"Recover",recoverSuccess:"Recovery accepted \u2014 the task is pending again",recoverFailed:"Recovery failed",awaitingOwnerDecision:"Awaiting owner decision",goGovernanceFocus:"Go to governance focus",taskId:"Task ID",painId:"Pain ID",kind:"Kind",status:"Status",lastError:"Last Error",attempts:"Attempts",lastAttempt:"Last Attempt",noPainId:"\u2014",partialResults:"Showing first {shown} of {total} records. Narrow filters or use 'pd errors list' with --offset to see more.",detailToggle:"Toggle task detail",detailError:"Failed to load task detail",createdAt:"Created",updatedAt:"Updated",runsTitle:"Run history",runAttempt:"Attempt",runStarted:"Started",runEnded:"Ended",runReason:"Reason",runErrorCategory:"Error category",noRuns:"No run records for this task."}},components:{errorBoundary:{title:"An Error Occurred",description:"An error occurred while loading the page",retry:"Retry",reportAction:"Report this problem"},zoneSection:{empty:"No data",viewAll:"View All"},taskCard:{approve:"Approve",reject:"Reject",cleanup:"Cleanup",undo:"Undo",undoCountdown:"Undo ({{count}}s)",evidence:"Evidence",summary:"Summary",why:"Why",whatHappens:"What Happens"},evidencePanel:{summary:"Summary",why:"Why",whatHappens:"What Happens",evidenceItems:"Evidence Items"},pageHeader:{refresh:"Refresh",lastUpdated:"Last Updated: {{time}}",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},themeToggle:{light:"Light Mode",dark:"Dark Mode"},languageSwitcher:{chinese:"\u4E2D\u6587",english:"English"},sidebar:{collapse:"Collapse Sidebar",expand:"Expand Sidebar",focus:"Governance Focus",pain:"Behavior Evidence",principles:"Principles Review",activation:"Activation",debt:"Principle Debt",examiner:"Examiner Verification",controlCenter:"Control Center",reportProblem:"Feedback",failedTasks:"Failed Tasks",settings:"Settings",update:"Updates",pendingApprovalsAria:"{{count}} pending approvals",degradedSignalsAria:"{{count}} degraded signals",intent:"Owner Intent",themeToLight:"Switch to light mode",themeToDark:"Switch to dark mode",switchLanguage:"Switch language",signOut:"Sign out",openMenu:"Open navigation menu",navigation:"Main navigation",navigationDescription:"Navigate the console pages; the drawer closes after a selection."},approvalCard:{confidence:{high:"High",medium:"Medium",low:"Low"},viewDetail:"View Detail",approve:"Approve",reject:"Reject",empty:"No pending approvals",stats:{pending:"Pending",approved:"Approved",rejected:"Rejected"},status:{approved:"Approved",rejected:"Rejected",cancelled:"Cancelled"},decidedBy:"Decided by {{by}}",channel:{code_tool_hook:"RuleHost",defer_archive:"Defer Archive",prompt:"Prompt",skill:"Skill (retired)"},retired:"This channel is retired and cannot be actioned",riskLevel:"Risk Level"},approvalDetail:{title:"Approval Detail",whyRecommended:"Why Recommended",confidenceExplanation:"Confidence Explanation",whatHappens:"What Happens if Approved",ifReject:"If You Reject",approve:"Approve",reject:"Reject"},rejectionDialog:{title:"Rejection Reason",description:"Please explain why you are rejecting this approval. This helps improve future recommendations.",placeholder:"Enter rejection reason (at least 10 characters)\u2026",tooShort:"Reason must be at least 10 characters",cancel:"Cancel",submit:"Confirm Rejection"},onboardingReset:{title:"Onboarding",resetButton:"Reset onboarding state",resetConfirm:"This will restart the onboarding wizard on next login. Continue?",resetSuccess:"Onboarding state reset. You'll see the welcome page on next visit.",resetFailed:"Couldn't reset onboarding. Check browser storage permissions and retry."},onboardingFlag:{title:"Onboarding Feature",label:"New user onboarding wizard",description:"Show the welcome wizard on first visit. Disable for experienced users.",toggleAriaLabel:"Toggle new user onboarding feature",enabled:"Onboarding wizard enabled",disabled:"Onboarding wizard disabled",toggleFailed:"Failed to toggle onboarding feature",loadFailed:"Failed to load onboarding flag state"},fullPipelineFlag:{title:"Pipeline Mode (PRI-720)",label:"Force full pipeline for prompt principles",description:"Default OFF: prompt/defer principles take the short semantic path (no code generation, no sandbox). ON: newly seeded prompt chains run the complete legacy pipeline including Artificer code generation, Evaluator review and adversarial replay \u2014 for test scenarios or when you explicitly want the full pipeline. Does not affect chains already in progress.",toggleAriaLabel:"Toggle force-full-pipeline mode for prompt internalization",enabled:"Full pipeline forced for new prompt chains",disabled:"Prompt chains use the short semantic path",toggleFailed:"Failed to toggle pipeline mode",loadFailed:"Failed to load pipeline mode state"}}};var hF=()=>typeof window>"u"?"zh-CN":localStorage.getItem("pd-language")||"zh-CN";function HA(e){typeof document>"u"||(document.documentElement.lang=e.toLowerCase())}Ea.use(vm).init({resources:{"zh-CN":{common:km,pages:km.pages,components:km.components},en:{common:Sm,pages:Sm.pages,components:Sm.components}},lng:hF(),fallbackLng:"zh-CN",ns:["common","pages","components"],defaultNS:"common",interpolation:{escapeValue:!1}});HA(Ea.language??"zh-CN");Ea.on("languageChanged",HA);var ar=Ea;var ts=D(ee(),1),WA=D(W(),1),xF={theme:"light",setTheme:()=>{}},GA=ts.createContext(xF);function $A({children:e,defaultTheme:t,storageKey:a="pd-theme"}){let[n,r]=ts.useState(()=>{if(typeof window<"u"){let o=localStorage.getItem(a);return o==="light"||o==="dark"?o:t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}return t??"light"});ts.useEffect(()=>{window.document.documentElement.setAttribute("data-theme",n),localStorage.setItem(a,n)},[n,a]);let i=o=>{r(o)};return(0,WA.jsx)(GA.Provider,{value:{theme:n,setTheme:i},children:e})}function Rm(){let e=ts.useContext(GA);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var qu=D(ee(),1);var Dm=D(ee(),1);var Im=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var KA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var YA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());var Lx=e=>{let t=YA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ou=D(ee(),1);var Am={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var XA=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Cc=D(ee(),1);var yF=(0,Cc.createContext)({});var ZA=()=>(0,Cc.useContext)(yF);var QA=(0,ou.forwardRef)(({color:e,size:t,strokeWidth:a,absoluteStrokeWidth:n,className:r="",children:i,iconNode:o,...s},l)=>{let{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:m=""}=ZA()??{},p=n??d?Number(a??u)*24/Number(t??c):a??u;return(0,ou.createElement)("svg",{ref:l,...Am,width:t??c??Am.width,height:t??c??Am.height,stroke:e??f,strokeWidth:p,className:Im("lucide",m,r),...!i&&!XA(s)&&{"aria-hidden":"true"},...s},[...o.map(([b,v])=>(0,ou.createElement)(b,v)),...Array.isArray(i)?i:[i]])});var Se=(e,t)=>{let a=(0,Dm.forwardRef)(({className:n,...r},i)=>(0,Dm.createElement)(QA,{ref:i,iconNode:t,className:Im(`lucide-${KA(Lx(e))}`,`lucide-${e}`,n),...r}));return a.displayName=Lx(e),a};var wF=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],no=Se("archive",wF);var kF=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ro=Se("arrow-left",kF);var SF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],$r=Se("arrow-right",SF);var CF=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],su=Se("book-open",CF);var RF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],io=Se("chevron-right",RF);var IF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ni=Se("circle-alert",IF);var AF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],as=Se("circle-check",AF);var DF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wr=Se("circle-question-mark",DF);var LF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ns=Se("circle-x",LF);var NF=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],lu=Se("clipboard-check",NF);var EF=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],rs=Se("code-xml",EF);var OF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],cu=Se("compass",OF);var TF=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],du=Se("external-link",TF);var PF=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],is=Se("file-pen-line",PF);var _F=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Zs=Se("file-text",_F);var BF=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Kr=Se("flask-conical",BF);var MF=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],uu=Se("focus",MF);var FF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],fu=Se("info",FF);var UF=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],pu=Se("languages",UF);var jF=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],mu=Se("link-2",jF);var HF=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pa=Se("loader-circle",HF);var zF=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gu=Se("log-out",zF);var qF=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],hu=Se("menu",qF);var VF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],bu=Se("message-square-text",VF);var GF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Qs=Se("message-square",GF);var $F=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Js=Se("moon",$F);var WF=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],vu=Se("play",WF);var KF=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],xu=Se("radio",KF);var YF=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],nr=Se("refresh-cw",YF);var XF=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],yu=Se("scale",XF);var ZF=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],wu=Se("server-cog",ZF);var QF=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Rc=Se("settings",QF);var JF=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],oo=Se("shield-check",JF);var e4=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],el=Se("sun",e4);var t4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ku=Se("trash-2",t4);var a4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ar=Se("triangle-alert",a4);var n4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tl=Se("x",n4);var r4=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],Su=Se("zap",r4);var JL=D(ee(),1);var Ca=D(ee(),1);var JA=["ingest","github","email","file"];function w(e){return typeof e=="string"}function Ye(e){return typeof e=="number"&&!Number.isNaN(e)}function xt(e){return typeof e=="boolean"}function P(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vt(e,t){if(!Object.hasOwn(e,t))return{valid:!0,value:null};let a=e[t];return a===null||typeof a=="string"?{valid:!0,value:a}:{valid:!1}}function i4(e,t){if(!Object.hasOwn(e,t))return{valid:!0,value:null};let a=e[t];return a===null||typeof a=="number"&&!Number.isNaN(a)?{valid:!0,value:a}:{valid:!1}}function Yt(e,t){if(!Array.isArray(e))return null;let a=[];for(let n of e){let r=t(n);if(r===null)return null;a.push(r)}return a}var o4=new Set(["principle","artifact","task","run","approval","activation","trajectory"]),eD=new Set(["prompt","code_tool_hook","defer_archive"]),s4=new Set(["governance.headline.owner_decision","governance.headline.recovery","governance.headline.revision","governance.headline.processing","governance.headline.active","governance.headline.unavailable","governance.headline.recorded"]),l4=new Set(["governance.reason.approval_pending","governance.reason.recovery_required","governance.reason.automatic_revision","governance.reason.processing","governance.reason.activation_active","governance.reason.data_incomplete","governance.reason.no_current_process"]),c4=new Set(["governance.next.review","governance.next.inspect_recovery","governance.next.wait","governance.next.monitor","governance.next.inspect_data","governance.next.none"]),oD=new Set(["strong","weak","unknown"]),d4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;function Lm(e){if(typeof e!="string"||!d4.test(e))return!1;let t=new Date(e);return Number.isFinite(t.getTime())?t.toISOString()===(e.includes(".")?e:e.replace("Z",".000Z")):!1}function nt(e,t){return t.every(a=>Object.hasOwn(e,a))}var u4=new Set(["host_capacity_absent","host_capacity_source_untrusted","host_capacity_invalid_value","catalog_unavailable","model_identity_absent","catalog_no_exact_match","catalog_no_match_for_model_id","catalog_ambiguous_model_id","catalog_provider_absent","catalog_metadata_invalid","runtime_budget_observation_stale"]);function Nx(e){return w(e)&&u4.has(e)}function Ex(e){return e==="operator_declared"||e==="host_effective_window"||e==="pi_catalog_exact"||e==="pi_catalog_model_id"||e==="legacy_fallback"}function Ox(e){return e==="confirmed"||e==="unknown"}function pt(e,t){return typeof e=="string"&&t.has(e)}function Em(e){return P(e)&&nt(e,["type","id"])&&pt(e.type,o4)&&typeof e.id=="string"&&e.id.length>0}function os(e){return Array.isArray(e)&&e.every(Em)}function f4(e){return P(e)&&nt(e,["source","reasonCode","nextActionCode"])&&pt(e.source,new Set(["ledger","artifact","task","approval","activation","trajectory","lineage"]))&&typeof e.reasonCode=="string"&&e.reasonCode.length>0&&typeof e.nextActionCode=="string"&&e.nextActionCode.length>0&&(!Object.hasOwn(e,"sourceRef")||Em(e.sourceRef))}function p4(e){return P(e)&&nt(e,["code","recordedAt","summaryCode","sourceRef","lineageConfidence"])&&pt(e.code,new Set(["pain_created","candidate_generated","review_started","revision_requested","revision_reopened","approved","rejected","activated","deactivated","failed","human_review"]))&&Lm(e.recordedAt)&&(!Object.hasOwn(e,"occurredAt")||Lm(e.occurredAt))&&typeof e.summaryCode=="string"&&e.summaryCode.length>0&&Em(e.sourceRef)&&pt(e.lineageConfidence,oD)}function m4(e){if(!P(e)||!nt(e,["schemaVersion","principleId","asOf","summary","principleState","process","automation","attention","activationSummary","timeline","sourceRefs","dataQuality"])||e.schemaVersion!=="1"||typeof e.principleId!="string"||e.principleId.length===0||!Lm(e.asOf))return!1;let{summary:t,principleState:a,process:n,automation:r,attention:i,activationSummary:o,dataQuality:s}=e;return!P(t)||!nt(t,["headlineCode","reasonCode","nextActionCode","ownerActionRequired","sourceRefs"])||!pt(t.headlineCode,s4)||!pt(t.reasonCode,l4)||!pt(t.nextActionCode,c4)||typeof t.ownerActionRequired!="boolean"||!os(t.sourceRefs)||Object.hasOwn(t,"safeReasonSummary")&&(typeof t.safeReasonSummary!="string"||t.safeReasonSummary.length===0)||!P(a)||!nt(a,["value","sourceRefs"])||!pt(a.value,new Set(["candidate","active","archived","deprecated","probation"]))||!os(a.sourceRefs)||!P(n)||!nt(n,["sourceRefs"])||!os(n.sourceRefs)||Object.hasOwn(n,"stage")&&!pt(n.stage,new Set(["generating","reviewing","revising","approval","activation"]))||Object.hasOwn(n,"currentTaskKind")&&!pt(n.currentTaskKind,new Set(["dreamer","philosopher","scribe","artificer","evaluator","rollout_reviewer"]))||!P(r)||!nt(r,["state","sourceRefs"])||!pt(r.state,new Set(["idle","queued","running","retry_scheduled","stalled"]))||!os(r.sourceRefs)||!P(i)||!nt(i,["primary","items"])||!pt(i.primary,new Set(["none","owner_required","recovery_required"]))||!Array.isArray(i.items)||!i.items.every(l=>P(l)&&nt(l,["kind","reasonCode","sourceRef"])&&pt(l.kind,new Set(["owner_decision","recovery"]))&&typeof l.reasonCode=="string"&&l.reasonCode.length>0&&Em(l.sourceRef))||!P(o)||!nt(o,["state","channels","observedChannels","sourceRefs"])||!pt(o.state,new Set(["none","active","partially_active","deactivated"]))||!Array.isArray(o.channels)||!o.channels.every(l=>pt(l,eD))||!Array.isArray(o.observedChannels)||!o.observedChannels.every(l=>pt(l,eD))||!os(o.sourceRefs)?!1:Array.isArray(e.timeline)&&e.timeline.every(p4)&&os(e.sourceRefs)&&P(s)&&nt(s,["degraded","issues"])&&typeof s.degraded=="boolean"&&Array.isArray(s.issues)&&s.issues.every(f4)}function sD(e){return m4(e)?e:null}var lD=new Set(["needs_owner_decision","processing","blocked","recovery_needed","decided","no_action"]),g4=new Set(["decision","blocked","recovery","none"]),h4=new Set(["individual","aggregate","none"]);function b4(e){if(!P(e)||!nt(e,["principleId","decisionState","learnedPrinciple","inbox","blockerCodes","nextAction"])||!w(e.principleId)||e.principleId.length===0||!w(e.decisionState)||!lD.has(e.decisionState))return!1;let t=e.learnedPrinciple;if(!P(t))return!1;if(t.status==="known"){if(!nt(t,["text","sourceTier"])||!w(t.text)||t.text.length===0||!w(t.sourceTier))return!1}else if(t.status==="unknown"){if(!nt(t,["reasonText"])||!w(t.reasonText))return!1}else return!1;return!P(e.inbox)||!nt(e.inbox,["group","attention"])||!pt(e.inbox.group,g4)||!pt(e.inbox.attention,h4)||!Array.isArray(e.blockerCodes)||!e.blockerCodes.every(w)?!1:P(e.nextAction)&&nt(e.nextAction,["ownerText"])&&w(e.nextAction.ownerText)}function tD(e){return!P(e)||!nt(e,["code","ownerText","sourceRefs"])||!w(e.code)||e.code.length===0||!w(e.ownerText)||e.ownerText.length===0||!Array.isArray(e.sourceRefs)?!1:nt(e,["count"])?typeof e.count=="number"&&Number.isInteger(e.count)&&e.count>=1:!0}function v4(e){return P(e)&&nt(e,["key","semantic","label","channel","confirmation","expectedConsequence"])&&w(e.key)&&e.key.length>0&&w(e.semantic)&&e.semantic.length>0&&w(e.label)&&P(e.confirmation)&&typeof e.confirmation.required=="boolean"&&w(e.confirmation.text)}function x4(e){return!P(e)||!nt(e,["schemaVersion","principleId","asOf","sourceReadStatus","sourceReads","incidentSummary","learnedPrinciple","rationale","applicability","nonApplicabilityOrUnknown","expectedBehavior","currentEnforcement","evidenceSummary","uncertainty","risk","rollback","decisionState","decisionSubjects","availableActions","blockers","nextAction","inbox","technicalDetails"])||e.schemaVersion!=="1"||!w(e.principleId)||!w(e.asOf)||e.sourceReadStatus!=="complete"&&e.sourceReadStatus!=="partial"||!pt(e.decisionState,lD)||!Array.isArray(e.availableActions)||!e.availableActions.every(v4)||!Array.isArray(e.blockers)||!e.blockers.every(t=>P(t)&&nt(t,["subjectKey","kind","reason"])&&tD(t.reason))?!1:P(e.nextAction)&&nt(e.nextAction,["code","ownerText"])&&w(e.nextAction.ownerText)&&P(e.inbox)&&nt(e.inbox,["group","attention","reason"])&&tD(e.inbox.reason)}function cD(e){return x4(e)?e:null}function y4(e){return P(e)&&nt(e,["schemaVersion","generatedAt","totalPrinciples","groups","historicalUnknown"])&&e.schemaVersion==="1"&&w(e.generatedAt)&&typeof e.totalPrinciples=="number"&&P(e.groups)&&nt(e.groups,["decision","blocked","recovery"])&&["decision","blocked","recovery"].every(t=>{let a=e.groups[t];return Array.isArray(a)&&a.every(b4)})&&P(e.historicalUnknown)&&typeof e.historicalUnknown.count=="number"}function dD(e){return y4(e)?e:null}function w4(e){return P(e)&&nt(e,["decisionState","learnedPrinciple"])&&w(e.decisionState)&&P(e.learnedPrinciple)&&(e.learnedPrinciple.status==="known"?w(e.learnedPrinciple.text)&&w(e.learnedPrinciple.sourceTier):e.learnedPrinciple.status==="unknown"&&w(e.learnedPrinciple.reasonText))}function k4(e){return P(e)&&nt(e,["schemaVersion","generatedAt","entries"])&&e.schemaVersion==="1"&&w(e.generatedAt)&&P(e.entries)&&Object.values(e.entries).every(w4)}function uD(e){return k4(e)?e:null}var aD=new Set(["setup_required","owner_decision_required","recovery_required","degraded","background_processing","all_clear"]),fD=new Set(["governance.exp.reason.owner_identity_missing","governance.exp.reason.owner_identity_invalid","governance.exp.reason.owner_authentication_missing","governance.exp.reason.approval_pending","governance.exp.reason.rulecode_owner_decision","governance.exp.reason.no_pending_decision","governance.exp.reason.owner_decision_available","governance.exp.reason.break_glass_entry","governance.exp.reason.recovery_required","governance.exp.reason.source_unavailable","governance.exp.reason.config_invalid","governance.exp.reason.processing","governance.exp.reason.workspace_clear","governance.exp.reason.workspace_empty"]),pD=new Set(["governance.exp.next.configure_owner","governance.exp.next.authenticate_console","governance.exp.next.review_approvals","governance.exp.next.inspect_recovery","governance.exp.next.inspect_sources","governance.exp.next.fix_config","governance.exp.next.monitor","governance.exp.next.none"]),S4=new Set(["operator_legacy","configured_owner","break_glass"]),C4=new Set(["principle_approval","rulecode_owner_decision","emergency_pause"]),mD=new Set(["blocked","needs_recovery","needs_decision","processing"]),R4=new Set(["production","development","demo","test","unknown"]),I4=new Set(["workspace_config","missing"]),A4=new Set(["ledger","artifact","task","approval","activation","trajectory","lineage","workspace"]);function D4(e){return P(e)&&nt(e,["category","reasonCode","sourceRefs"])&&pt(e.category,mD)&&typeof e.reasonCode=="string"&&e.reasonCode.length>0&&os(e.sourceRefs)&&(!Object.hasOwn(e,"principleId")||typeof e.principleId=="string"&&e.principleId.length>0)}function L4(e){return P(e)&&nt(e,["kind","observedAuthority","status","reasonCode","nextActionCode"])&&pt(e.kind,C4)&&pt(e.observedAuthority,S4)&&pt(e.status,new Set(["entry_conditions_met","blocked"]))&&pt(e.reasonCode,fD)&&pt(e.nextActionCode,pD)}function N4(e){return P(e)&&nt(e,["environment","source"])&&pt(e.environment,R4)&&pt(e.source,I4)&&(!Object.hasOwn(e,"configIssue")||typeof e.configIssue=="string"&&e.configIssue.length>0)}function E4(e){if(!P(e)||!nt(e,["schemaVersion","snapshotId","asOf","summary","readiness","activity","trustContext","dataQuality"])||e.schemaVersion!=="1"||typeof e.snapshotId!="string"||e.snapshotId.length===0||!Lm(e.asOf))return!1;let{summary:t,readiness:a,activity:n,trustContext:r,dataQuality:i}=e;return!P(t)||!nt(t,["primaryAttention","headlineCode","reasonCode","nextActionCode"])||!pt(t.primaryAttention,aD)||typeof t.headlineCode!="string"||t.headlineCode.length===0||!pt(t.reasonCode,fD)||!pt(t.nextActionCode,pD)||!P(a)||!nt(a,["authenticationMode","ownerIdentityConfiguration","governanceActions"])||!pt(a.authenticationMode,new Set(["authenticated","no_auth"]))||!pt(a.ownerIdentityConfiguration,new Set(["configured","missing","invalid"]))||!Array.isArray(a.governanceActions)||a.governanceActions.length!==3||!a.governanceActions.every(L4)||!P(n)||!nt(n,["primaryAttention","categories"])||!pt(n.primaryAttention,aD)||!Array.isArray(n.categories)||!n.categories.every(o=>P(o)&&nt(o,["category","count","items","hasMore"])&&pt(o.category,mD)&&typeof o.count=="number"&&Number.isInteger(o.count)&&o.count>=0&&Array.isArray(o.items)&&o.items.length<=10&&o.items.every(D4)&&typeof o.hasMore=="boolean")||!P(r)||!nt(r,["environmentContext","lineageTransparency"])||!N4(r.environmentContext)||!P(r.lineageTransparency)||!nt(r.lineageTransparency,["confidence","strongViewCount","weakViewCount","unknownViewCount"])||!pt(r.lineageTransparency.confidence,oD)||[r.lineageTransparency.strongViewCount,r.lineageTransparency.weakViewCount,r.lineageTransparency.unknownViewCount].some(o=>typeof o!="number"||!Number.isInteger(o)||o<0)?!1:P(i)&&nt(i,["degraded","issueGroups","hasMore"])&&typeof i.degraded=="boolean"&&typeof i.hasMore=="boolean"&&Array.isArray(i.issueGroups)&&i.issueGroups.length<=10&&i.issueGroups.every(o=>P(o)&&nt(o,["source","reasonCode","nextActionCode","count","sampleRefs"])&&pt(o.source,A4)&&typeof o.reasonCode=="string"&&o.reasonCode.length>0&&typeof o.nextActionCode=="string"&&o.nextActionCode.length>0&&typeof o.count=="number"&&Number.isInteger(o.count)&&o.count>=1&&os(o.sampleRefs))}function gD(e){return E4(e)?e:null}function hD(e){if(!P(e))return null;let t={};return Object.hasOwn(e,"message")&&w(e.message)&&(t.message=e.message),Object.hasOwn(e,"error")&&w(e.error)&&(t.error=e.error),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),t}function bD(e){if(e==null||!P(e))return null;let t={};for(let a of Object.keys(e)){let n=e[a];if(!w(n))return null;t[a]=n}return t}function vD(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"report")||!P(e.report)?null:{id:e.id,createdAt:e.createdAt,report:e.report}}function xD(e){return!P(e)||!Object.hasOwn(e,"drafts")||!Array.isArray(e.drafts)?null:Yt(e.drafts,t=>!P(t)||!Object.hasOwn(t,"id")||!w(t.id)||!Object.hasOwn(t,"createdAt")||!w(t.createdAt)||!Object.hasOwn(t,"type")||!w(t.type)||!Object.hasOwn(t,"title")||!w(t.title)?null:{id:t.id,createdAt:t.createdAt,type:t.type,title:t.title})}function yD(e){return!P(e)||!Object.hasOwn(e,"report")||!P(e.report)?null:{report:e.report}}function wD(e){return!P(e)||!Object.hasOwn(e,"deleted")||!xt(e.deleted)?null:{deleted:e.deleted}}function O4(e){if(!Object.hasOwn(e,"id")||!w(e.id)||!JA.includes(e.id)||!Object.hasOwn(e,"available")||!xt(e.available))return null;let t=vt(e,"reason"),a=vt(e,"nextAction");if(!t.valid||!a.valid)return null;let n={id:e.id,available:e.available};return t.value!==null&&(n.reason=t.value),a.value!==null&&(n.nextAction=a.value),n}function kD(e){if(!P(e)||!Object.hasOwn(e,"channels")||!Array.isArray(e.channels))return null;let t=[];for(let a of e.channels){if(!P(a))continue;let n=O4(a);n!==null&&t.push(n)}return{channels:t}}function Tx(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"alreadySubmitted")||!xt(e.alreadySubmitted)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t={ok:e.ok,alreadySubmitted:e.alreadySubmitted,status:e.status},a=vt(e,"submittedVia"),n=vt(e,"trackingId"),r=vt(e,"externalUrl"),i=vt(e,"nextAction");return!a.valid||!n.valid||!r.valid||!i.valid||(a.value!==null&&(t.submittedVia=a.value),n.value!==null&&(t.trackingId=n.value),r.value!==null&&(t.externalUrl=r.value),i.value!==null&&(t.nextAction=i.value),Object.hasOwn(e,"writeBackFailed")&&!xt(e.writeBackFailed))?null:(xt(e.writeBackFailed)&&(t.writeBackFailed=e.writeBackFailed),t)}function T4(e){if(!P(e)||!Object.hasOwn(e,"workspaceName")||!w(e.workspaceName)||!Object.hasOwn(e,"enabled")||!xt(e.enabled))return null;let t=vt(e,"displayName");return!t.valid||!Object.hasOwn(e,"syncEnabled")||!xt(e.syncEnabled)?null:{workspaceName:e.workspaceName,enabled:e.enabled,displayName:t.value,syncEnabled:e.syncEnabled}}function Px(e){if(!P(e)||!Object.hasOwn(e,"name")||!w(e.name)||!Object.hasOwn(e,"path")||!w(e.path))return null;let t=vt(e,"lastSync");if(!t.valid)return null;let a=null;return Object.hasOwn(e,"config")&&e.config!==null&&(a=T4(e.config),a===null)?null:{name:e.name,path:e.path,lastSync:t.value,config:a}}function SD(e){return Yt(e,Px)}function CD(e){return!P(e)||!Object.hasOwn(e,"removed")||!w(e.removed)?null:{removed:e.removed}}function RD(e){return!P(e)||!Object.hasOwn(e,"success")||!xt(e.success)||!Object.hasOwn(e,"syncedAt")||!w(e.syncedAt)?null:{success:e.success,syncedAt:e.syncedAt}}function _x(e){switch(e){case"ready":case"not_ready":case"needs_setup":case"disabled":case"unknown":return e;default:return null}}function ID(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"type")||!w(e.type)||!Object.hasOwn(e,"label")||!w(e.label)||Object.hasOwn(e,"apiKeyEnv")&&!w(e.apiKeyEnv)||Object.hasOwn(e,"provider")&&!w(e.provider)||Object.hasOwn(e,"model")&&!w(e.model)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);return t===null?null:{id:e.id,type:e.type,label:e.label,...Object.hasOwn(e,"apiKeyEnv")&&w(e.apiKeyEnv)?{apiKeyEnv:e.apiKeyEnv}:{},...Object.hasOwn(e,"provider")&&w(e.provider)?{provider:e.provider}:{},...Object.hasOwn(e,"model")&&w(e.model)?{model:e.model}:{},readiness:t}}function P4(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"category")||!w(e.category)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{id:e.id,category:e.category,enabled:e.enabled}}function _4(e){if(!P(e)||!Object.hasOwn(e,"name")||!w(e.name)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)||!Object.hasOwn(e,"runtimeProfileId")||!w(e.runtimeProfileId)||!Object.hasOwn(e,"runtimeProfileLabel")||!w(e.runtimeProfileLabel)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);return t===null?null:{name:e.name,enabled:e.enabled,runtimeProfileId:e.runtimeProfileId,runtimeProfileLabel:e.runtimeProfileLabel,readiness:t}}function AD(e){return!P(e)||!Object.hasOwn(e,"path")||!w(e.path)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction)?null:{path:e.path,reason:e.reason,nextAction:e.nextAction}}function B4(e){switch(e){case"defaults":case"user_config":return e;default:return null}}function DD(e){if(!P(e)||!Object.hasOwn(e,"version")||!Ye(e.version)||!Object.hasOwn(e,"source"))return null;let t=B4(e.source);if(t===null||!Object.hasOwn(e,"features")||!Array.isArray(e.features)||!Object.hasOwn(e,"runtimeProfiles")||!Array.isArray(e.runtimeProfiles)||!Object.hasOwn(e,"defaultRuntime")||!w(e.defaultRuntime)||!Object.hasOwn(e,"agents")||!Array.isArray(e.agents)||!Object.hasOwn(e,"ui")||!P(e.ui)||!Object.hasOwn(e,"warnings")||!Array.isArray(e.warnings))return null;let a=Yt(e.features,P4);if(a===null)return null;let n=Yt(e.runtimeProfiles,ID);if(n===null)return null;let r=Yt(e.agents,_4);if(r===null)return null;let i=Yt(e.warnings,l=>w(l)?l:null);if(i===null)return null;let{ui:o}=e;if(!Object.hasOwn(o,"diagnostics")||!P(o.diagnostics)||!Object.hasOwn(o.diagnostics,"mode")||!w(o.diagnostics.mode))return null;let s;return Object.hasOwn(e,"errors")&&Array.isArray(e.errors)&&(s=Yt(e.errors,AD)??void 0),{version:e.version,source:t,features:a,runtimeProfiles:n,defaultRuntime:e.defaultRuntime,agents:r,ui:{diagnostics:{mode:o.diagnostics.mode}},warnings:i,errors:s}}function LD(e){if(!P(e)||!Object.hasOwn(e,"profiles")||!Array.isArray(e.profiles))return null;let t=Yt(e.profiles,ID);if(t===null)return null;let a;return Object.hasOwn(e,"errors")&&Array.isArray(e.errors)&&(a=Yt(e.errors,AD)??void 0),{profiles:t,errors:a}}function ND(e){return!P(e)||!Object.hasOwn(e,"agent")||!w(e.agent)||!Object.hasOwn(e,"runtimeProfile")||!w(e.runtimeProfile)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{agent:e.agent,runtimeProfile:e.runtimeProfile,enabled:e.enabled}}function ED(e){return!P(e)||!Object.hasOwn(e,"feature")||!w(e.feature)||!Object.hasOwn(e,"enabled")||!xt(e.enabled)?null:{feature:e.feature,enabled:e.enabled}}function OD(e){if(!P(e)||!Object.hasOwn(e,"agent")||!w(e.agent)||!Object.hasOwn(e,"readiness"))return null;let t=_x(e.readiness);if(t===null||!Object.hasOwn(e,"profileId")||!w(e.profileId)||!Object.hasOwn(e,"profileLabel")||!w(e.profileLabel))return null;let a={agent:e.agent,readiness:t,profileId:e.profileId,profileLabel:e.profileLabel};return Object.hasOwn(e,"reason")&&w(e.reason)&&(a.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(a.nextAction=e.nextAction),a}function TD(e){return!P(e)||!Object.hasOwn(e,"defaultRuntime")||!w(e.defaultRuntime)?null:{defaultRuntime:e.defaultRuntime}}function Om(e){if(!P(e)||!Object.hasOwn(e,"profileId")||!w(e.profileId)||!Object.hasOwn(e,"profile")||!P(e.profile))return null;let{profile:t}=e;if(!Object.hasOwn(t,"type")||!w(t.type))return null;let a=t.type;return{profileId:e.profileId,profile:{...t,type:a}}}function M4(e){return!P(e)||!Object.hasOwn(e,"type")||!w(e.type)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"daysSince")||!Ye(e.daysSince)?null:{type:e.type,principleId:e.principleId,daysSince:e.daysSince}}var nD=new Set(["none","in_progress","owner_review_ready","degraded"]),F4=new Set(["state_db_missing","no_pipeline_activity","pending_approvals","tasks_need_human_review","pipeline_active","consumed_candidates","degraded_state"]),U4=new Set(["run_config_doctor","wait_for_pipeline","review_approvals","review_failed_tasks","check_degraded_signals","check_pipeline_status"]),j4=new Set(["task_retry_wait","task_failed","approval_table_missing","trajectory_db_unavailable"]),H4=new Set(["check_task_status","fix_and_retry","run_integrity_check","check_trajectory_db"]);function z4(e){return!P(e)||!Object.hasOwn(e,"reasonCode")||!w(e.reasonCode)||!j4.has(e.reasonCode)||!Object.hasOwn(e,"nextActionCode")||!w(e.nextActionCode)||!H4.has(e.nextActionCode)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction)||!Object.hasOwn(e,"source")||!w(e.source)?null:{reasonCode:e.reasonCode,nextActionCode:e.nextActionCode,reason:e.reason,nextAction:e.nextAction,source:e.source}}function q4(e){if(!P(e)||!Object.hasOwn(e,"runId")||!w(e.runId)||!Object.hasOwn(e,"taskId")||!w(e.taskId)||!Object.hasOwn(e,"attemptNumber")||!Ye(e.attemptNumber)||!Object.hasOwn(e,"executionStatus")||!w(e.executionStatus)||!Object.hasOwn(e,"startedAt")||!w(e.startedAt))return null;let t=vt(e,"endedAt");if(!t.valid)return null;let a=vt(e,"reason");if(!a.valid)return null;let n=vt(e,"errorCategory");return n.valid?{runId:e.runId,taskId:e.taskId,attemptNumber:e.attemptNumber,executionStatus:e.executionStatus,startedAt:e.startedAt,endedAt:t.value,reason:a.value,errorCategory:n.value}:null}function PD(e){if(!P(e)||!Object.hasOwn(e,"task")||!P(e.task)||!Object.hasOwn(e,"runs")||!Array.isArray(e.runs))return null;let t=e.task;if(!Object.hasOwn(t,"taskId")||!w(t.taskId)||!Object.hasOwn(t,"taskKind")||!w(t.taskKind)||!Object.hasOwn(t,"status")||!w(t.status)||!Object.hasOwn(t,"createdAt")||!w(t.createdAt)||!Object.hasOwn(t,"updatedAt")||!w(t.updatedAt)||!Object.hasOwn(t,"attemptCount")||!Ye(t.attemptCount)||!Object.hasOwn(t,"maxAttempts")||!Ye(t.maxAttempts))return null;let a=vt(t,"lastError");if(!a.valid)return null;let n=vt(e,"lastError");if(!n.valid)return null;let r=Yt(e.runs,q4);if(r===null)return null;for(let i of r)if(i.taskId!==t.taskId)return null;return{taskId:t.taskId,taskKind:t.taskKind,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt,attemptCount:t.attemptCount,maxAttempts:t.maxAttempts,lastError:n.value??a.value,runs:r}}function _D(e){if(!P(e)||!Object.hasOwn(e,"taskId")||!w(e.taskId)||!Object.hasOwn(e,"previousStatus")||!w(e.previousStatus)||!Object.hasOwn(e,"newStatus")||!w(e.newStatus)||!Object.hasOwn(e,"result")||!w(e.result))return null;let t={taskId:e.taskId,previousStatus:e.previousStatus,newStatus:e.newStatus,result:e.result};if(Object.hasOwn(e,"forceApplied")){if(!xt(e.forceApplied))return null;t.forceApplied=e.forceApplied}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}return t}function Tm(e){if(!P(e)||!Object.hasOwn(e,"pendingReviewCount")||!Ye(e.pendingReviewCount)||!Object.hasOwn(e,"behaviorDeviationCount")||!Ye(e.behaviorDeviationCount)||!Object.hasOwn(e,"stagnationSignals")||!Array.isArray(e.stagnationSignals)||!Object.hasOwn(e,"governanceState")||!w(e.governanceState)||!nD.has(e.governanceState)||!Object.hasOwn(e,"stateReasonCode")||!w(e.stateReasonCode)||!F4.has(e.stateReasonCode)||!Object.hasOwn(e,"nextActionCode")||!w(e.nextActionCode)||!U4.has(e.nextActionCode)||!Object.hasOwn(e,"stateReason")||!w(e.stateReason)||!Object.hasOwn(e,"nextAction")||!w(e.nextAction))return null;let t=Yt(e.stagnationSignals,M4);if(t===null)return null;let a={pendingReviewCount:e.pendingReviewCount,behaviorDeviationCount:e.behaviorDeviationCount,stagnationSignals:t,governanceState:nD.has(e.governanceState)?e.governanceState:"none",stateReasonCode:e.stateReasonCode,nextActionCode:e.nextActionCode,stateReason:e.stateReason,nextAction:e.nextAction};if(Object.hasOwn(e,"inProgressSummary")){if(!w(e.inProgressSummary))return null;a.inProgressSummary=e.inProgressSummary}if(Object.hasOwn(e,"degradedSignals")){if(!Array.isArray(e.degradedSignals))return null;let n=Yt(e.degradedSignals,z4);if(n===null)return null;a.degradedSignals=n}if(Object.hasOwn(e,"note")){if(!w(e.note))return null;a.note=e.note}if(Object.hasOwn(e,"generatedAt")){if(!w(e.generatedAt))return null;a.generatedAt=e.generatedAt}if(Object.hasOwn(e,"evidenceInProgressCount")){if(!Ye(e.evidenceInProgressCount))return null;a.evidenceInProgressCount=e.evidenceInProgressCount}if(Object.hasOwn(e,"pendingHumanReviewCount")){if(!Ye(e.pendingHumanReviewCount))return null;a.pendingHumanReviewCount=e.pendingHumanReviewCount}if(Object.hasOwn(e,"gateBlocksToday")){if(!Ye(e.gateBlocksToday))return null;a.gateBlocksToday=e.gateBlocksToday}return a}var V4=new Set(["injectable","oversized","model_dependent","window_excluded","resolution_failed","route_unconfirmed"]);function G4(e){if(!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"status")||!w(e.status)||!V4.has(e.status))return null;let t={activationId:e.activationId,status:e.status};if(Object.hasOwn(e,"inCurrentWindow")&&typeof e.inCurrentWindow=="boolean"&&(t.inCurrentWindow=e.inCurrentWindow),Object.hasOwn(e,"costChars")&&typeof e.costChars=="number"&&Number.isInteger(e.costChars)&&e.costChars>=0&&(t.costChars=e.costChars),Object.hasOwn(e,"budget")&&typeof e.budget=="number"&&Number.isInteger(e.budget)&&e.budget>0&&(t.budget=e.budget),Object.hasOwn(e,"budgetScope")&&(e.budgetScope==="selected_lines"||e.budgetScope==="full_directive_context")&&(t.budgetScope=e.budgetScope),Object.hasOwn(e,"route")&&(e.route==="legacy_trim"||e.route==="shared_render")&&(t.route=e.route),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"perHostFits")&&Array.isArray(e.perHostFits)){let a=[];for(let n of e.perHostFits){if(!P(n)||n.hostKind!=="openclaw"&&n.hostKind!=="codex"&&n.hostKind!=="workbuddy"||n.tierFit!=="fits_all_tiers"&&n.tierFit!=="model_dependent"&&n.tierFit!=="exceeds_max_tier")return null;a.push({hostKind:n.hostKind,tierFit:n.tierFit})}t.perHostFits=a}return t}function $4(e){if(!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"action")||!w(e.action)||!Object.hasOwn(e,"targetRef")||!w(e.targetRef))return null;let t=vt(e,"activatedAt");if(!t.valid||!Object.hasOwn(e,"status")||!w(e.status))return null;let a=Object.hasOwn(e,"enforcement")&&(e.enforcement==="eligible"||e.enforcement==="safety_isolated")?e.enforcement:void 0;return{activationId:e.activationId,artifactId:e.artifactId,principleId:e.principleId,channel:e.channel,action:e.action,targetRef:e.targetRef,activatedAt:t.value,status:e.status,...a?{enforcement:a}:{},...Object.hasOwn(e,"legacyDecisionUnknown")&&e.legacyDecisionUnknown===!0?{legacyDecisionUnknown:!0}:{},...Object.hasOwn(e,"ownerReviewDueAt")&&w(e.ownerReviewDueAt)?{ownerReviewDueAt:e.ownerReviewDueAt}:{},...Object.hasOwn(e,"promptInjection")?(()=>{let n=G4(e.promptInjection);return n!==null?{promptInjection:n}:{}})():{}}}function Pm(e){if(!P(e)||!Object.hasOwn(e,"activations")||!Array.isArray(e.activations)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t=Yt(e.activations,$4);if(t===null)return null;let a={activations:t,status:e.status};if(Object.hasOwn(e,"reason")&&w(e.reason)&&(a.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(a.nextAction=e.nextAction),Object.hasOwn(e,"promptInjectionRoute")&&P(e.promptInjectionRoute)){let n=e.promptInjectionRoute;if((n.status==="confirmed"||n.status==="unconfirmed")&&typeof n.flagEnabled=="boolean"){let r={status:n.status,flagEnabled:n.flagEnabled};Object.hasOwn(n,"hostKind")&&(n.hostKind==="openclaw"||n.hostKind==="codex"||n.hostKind==="workbuddy")&&(r.hostKind=n.hostKind),Object.hasOwn(n,"route")&&(n.route==="legacy_trim"||n.route==="shared_render")&&(r.route=n.route),Object.hasOwn(n,"unconfirmedReason")&&w(n.unconfirmedReason)&&(r.unconfirmedReason=n.unconfirmedReason),Object.hasOwn(n,"nextAction")&&w(n.nextAction)&&(r.nextAction=n.nextAction),Object.hasOwn(n,"globalReason")&&w(n.globalReason)&&(r.globalReason=n.globalReason),Object.hasOwn(n,"budgetObservedAt")&&w(n.budgetObservedAt)&&n.budgetObservedAt.length>0&&Number.isFinite(Date.parse(n.budgetObservedAt))&&(r.budgetObservedAt=n.budgetObservedAt),Object.hasOwn(n,"budgetCapacitySource")&&Ex(n.budgetCapacitySource)&&(r.budgetCapacitySource=n.budgetCapacitySource),Object.hasOwn(n,"budgetCapacityStatus")&&Ox(n.budgetCapacityStatus)&&(r.budgetCapacityStatus=n.budgetCapacityStatus),Object.hasOwn(n,"budgetContextWindowTokens")&&typeof n.budgetContextWindowTokens=="number"&&Number.isInteger(n.budgetContextWindowTokens)&&n.budgetContextWindowTokens>0&&(r.budgetContextWindowTokens=n.budgetContextWindowTokens),Object.hasOwn(n,"budgetFallbackReason")&&Nx(n.budgetFallbackReason)&&(r.budgetFallbackReason=n.budgetFallbackReason),a.promptInjectionRoute=r}}return a}function rD(e){return!P(e)||!["eligible","matched","blocked","unhealthy"].every(a=>e[a]===null||Ye(e[a]))||!Ye(e.circuitTrips)||e.toolDistribution!==null&&(!P(e.toolDistribution)||!Object.values(e.toolDistribution).every(Ye))?null:{eligible:typeof e.eligible=="number"?e.eligible:null,matched:typeof e.matched=="number"?e.matched:null,blocked:typeof e.blocked=="number"?e.blocked:null,unhealthy:typeof e.unhealthy=="number"?e.unhealthy:null,circuitTrips:e.circuitTrips,toolDistribution:P(e.toolDistribution)?Object.fromEntries(Object.entries(e.toolDistribution).filter(a=>typeof a[1]=="number")):null}}function W4(e){if(!P(e)||!w(e.decisionId)||!w(e.decision)||!P(e.principal)||!w(e.principal.kind)||!P(e.authentication)||!w(e.authentication.method)||!w(e.reasonCode)||e.note!==null&&!w(e.note)||!w(e.decidedAt))return null;let t=typeof e.principal.ownerId=="string"?e.principal.ownerId:typeof e.principal.policyVersion=="string"?e.principal.policyVersion:typeof e.principal.reason=="string"?e.principal.reason:e.principal.kind;return{decisionId:e.decisionId,decision:e.decision,principalKind:e.principal.kind,actorId:t,authenticationMethod:e.authentication.method,reasonCode:e.reasonCode,note:typeof e.note=="string"?e.note:null,decidedAt:e.decidedAt}}function BD(e){if(!P(e)||!P(e.activation)||!P(e.artifact)||!P(e.readiness))return null;let{activation:t,artifact:a,readiness:n}=e;if(!w(t.activationId)||!w(t.artifactId)||!w(t.action)||!w(a.artifactId)||!w(a.digest)||a.content!==null&&!P(a.content)||!w(n.status)||!["ready","evidence_insufficient","blocked","unavailable"].includes(n.status)||!w(n.evaluationId)||!Array.isArray(n.failedChecks)||!n.failedChecks.every(b=>P(b)&&w(b.checkId)&&w(b.reasonCode))||!P(n.evidenceSnapshot)||!w(n.evidenceSnapshot.snapshotDigest)||!P(n.evidenceSnapshot.shadowSummary)||!Array.isArray(n.evidenceSnapshot.safetyGateResults)||!n.evidenceSnapshot.safetyGateResults.every(b=>P(b)&&w(b.checkId)&&(b.status==="passed"||b.status==="failed")&&(!Object.hasOwn(b,"reasonCode")||w(b.reasonCode))))return null;let r=n.evidenceSnapshot.shadowSummary;if(!["observed","matched","wouldBlock","wouldAllow","requireApproval","autoCorrect","errors","neutralControl"].every(b=>r[b]===null||Ye(r[b]))||![r.firstObservedAt,r.lastObservedAt].every(b=>b===null||w(b)))return null;let o=null;if(e.controlState!==null){if(!P(e.controlState)||e.controlState.enforcement!=="eligible"&&e.controlState.enforcement!=="safety_isolated"||!Ye(e.controlState.version))return null;o={enforcement:e.controlState.enforcement,version:e.controlState.version}}let s=null;if(e.globalPause!==null){if(!P(e.globalPause)||!w(e.globalPause.pauseId)||e.globalPause.status!=="paused"&&e.globalPause.status!=="released"||!Ye(e.globalPause.version))return null;s={pauseId:e.globalPause.pauseId,status:e.globalPause.status,version:e.globalPause.version}}if(!xt(e.ownerDecisionEnabled)||!Array.isArray(e.decisions)||!P(e.runtimeCapability)||!w(e.runtimeCapability.hostRuntimeVersion)||!xt(e.runtimeCapability.shadowEvidence)||!P(e.liveMetrics)||!Array.isArray(e.liveMetrics.representativeSamples)||!e.liveMetrics.representativeSamples.every(b=>P(b)&&w(b.toolName)&&w(b.decision)&&w(b.pathCategory))||!P(e.behaviorDrift))return null;let{behaviorDrift:l}=e,c=e.decisions.map(W4);if(c.some(b=>b===null)||!["approvedBlockRate","liveBlockRate","delta"].every(b=>l[b]===null||Ye(l[b])))return null;let d=rD(e.liveMetrics.last24Hours),f=rD(e.liveMetrics.last7Days);if(!d||!f)return null;let m=n.status==="ready"||n.status==="evidence_insufficient"||n.status==="blocked"||n.status==="unavailable"?n.status:null,p={observed:typeof r.observed=="number"?r.observed:null,matched:typeof r.matched=="number"?r.matched:null,wouldBlock:typeof r.wouldBlock=="number"?r.wouldBlock:null,wouldAllow:typeof r.wouldAllow=="number"?r.wouldAllow:null,requireApproval:typeof r.requireApproval=="number"?r.requireApproval:null,autoCorrect:typeof r.autoCorrect=="number"?r.autoCorrect:null,errors:typeof r.errors=="number"?r.errors:null,neutralControl:typeof r.neutralControl=="number"?r.neutralControl:null,firstObservedAt:typeof r.firstObservedAt=="string"?r.firstObservedAt:null,lastObservedAt:typeof r.lastObservedAt=="string"?r.lastObservedAt:null};return m===null?null:{activation:{activationId:t.activationId,artifactId:t.artifactId,action:t.action},artifact:{artifactId:a.artifactId,digest:a.digest,content:a.content},readiness:{status:m,evaluationId:n.evaluationId,failedChecks:n.failedChecks.map(b=>({checkId:b.checkId,reasonCode:b.reasonCode})),evidenceSnapshot:{snapshotDigest:n.evidenceSnapshot.snapshotDigest,shadowSummary:p,safetyGateResults:n.evidenceSnapshot.safetyGateResults.map(b=>({checkId:b.checkId,status:b.status,...typeof b.reasonCode=="string"?{reasonCode:b.reasonCode}:{}}))}},controlState:o,globalPause:s,decisions:c.filter(b=>b!==null),ownerDecisionEnabled:e.ownerDecisionEnabled,runtimeCapability:{hostRuntimeVersion:e.runtimeCapability.hostRuntimeVersion,shadowEvidence:e.runtimeCapability.shadowEvidence},liveMetrics:{last24Hours:d,last7Days:f,representativeSamples:e.liveMetrics.representativeSamples.map(b=>({toolName:b.toolName,decision:b.decision,pathCategory:b.pathCategory}))},behaviorDrift:{approvedBlockRate:typeof l.approvedBlockRate=="number"?l.approvedBlockRate:null,liveBlockRate:typeof l.liveBlockRate=="number"?l.liveBlockRate:null,delta:typeof l.delta=="number"?l.delta:null}}}function MD(e){if(!P(e))return null;let t={};for(let a of["decisionId","activationId","status","pauseId"])if(Object.hasOwn(e,a)){if(!w(e[a]))return null;t[a]=e[a]}if(Object.hasOwn(e,"version")){if(!Ye(e.version))return null;t.version=e.version}return t}function FD(e){return!P(e)||!Object.hasOwn(e,"activationId")||!w(e.activationId)||!Object.hasOwn(e,"status")||!w(e.status)?null:{activationId:e.activationId,status:e.status}}function K4(e){if(!P(e)||!Object.hasOwn(e,"insufficientData")||!xt(e.insufficientData))return null;let t=i4(e,"rate");return!t.valid||!Object.hasOwn(e,"note")||!w(e.note)?null:{insufficientData:e.insufficientData,rate:t.value,note:e.note}}function Y4(e){if(!P(e)||!Object.hasOwn(e,"ruleId")||!w(e.ruleId)||!Object.hasOwn(e,"triggered")||!Ye(e.triggered))return null;let t=vt(e,"lastTriggeredAt");return t.valid?{ruleId:e.ruleId,triggered:e.triggered,lastTriggeredAt:t.value}:null}function UD(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"adherence"))return null;let t=K4(e.adherence);if(t===null||!Object.hasOwn(e,"ruleMetrics")||!Array.isArray(e.ruleMetrics))return null;let a=Yt(e.ruleMetrics,Y4);return a===null?null:{principleId:e.principleId,adherence:t,ruleMetrics:a}}var X4=["up_to_date","update_available","update_blocked","check_failed"];function Cu(e){if(!P(e)||!Object.hasOwn(e,"currentVersion")||!w(e.currentVersion)||!Object.hasOwn(e,"latestVersion")||!w(e.latestVersion)||!Object.hasOwn(e,"hasUpdate")||!xt(e.hasUpdate))return null;let t={currentVersion:e.currentVersion,latestVersion:e.latestVersion,hasUpdate:e.hasUpdate};return Object.hasOwn(e,"state")&&w(e.state)&&X4.includes(e.state)&&(t.state=e.state),Object.hasOwn(e,"error")&&w(e.error)&&(t.error=e.error),Object.hasOwn(e,"message")&&w(e.message)&&(t.message=e.message),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),Object.hasOwn(e,"versionSource")&&e.versionSource==="active-release"&&(t.versionSource=e.versionSource),t}var Z4=["update","reinstall","legacy_migration","rollback","refusal","failure","recovery","unknown"];function Q4(e){return typeof e=="string"&&Z4.includes(e)}function iD(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"timestamp")||!w(e.timestamp)||!Object.hasOwn(e,"fromVersion")||!w(e.fromVersion)||!Object.hasOwn(e,"toVersion")||!w(e.toVersion)||!Object.hasOwn(e,"success")||!xt(e.success)||!Object.hasOwn(e,"kind")||!Q4(e.kind))return null;let t={id:e.id,timestamp:e.timestamp,fromVersion:e.fromVersion,toVersion:e.toVersion,success:e.success,kind:e.kind};return Object.hasOwn(e,"backupPath")&&w(e.backupPath)&&(t.backupPath=e.backupPath),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),t}function _m(e){if(Array.isArray(e)){let a=Yt(e,iD);return a===null?null:{updates:a}}if(!P(e)||!Object.hasOwn(e,"updates")||!Array.isArray(e.updates))return null;let t=Yt(e.updates,iD);return t===null?null:{updates:t}}function Ic(e){if(!P(e)||!Object.hasOwn(e,"approvalId")||!w(e.approvalId)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"riskLevel")||!w(e.riskLevel)||!Object.hasOwn(e,"status")||!w(e.status)||Object.hasOwn(e,"confidence")&&!Ye(e.confidence)||!Object.hasOwn(e,"requestedAt")||!w(e.requestedAt))return null;let t={approvalId:e.approvalId,artifactId:e.artifactId,channel:e.channel,riskLevel:e.riskLevel,status:e.status,confidence:Object.hasOwn(e,"confidence")&&Ye(e.confidence)?e.confidence:void 0,requestedAt:e.requestedAt,decidedAt:Object.hasOwn(e,"decidedAt")&&w(e.decidedAt)?e.decidedAt:void 0,decidedBy:Object.hasOwn(e,"decidedBy")&&w(e.decidedBy)?e.decidedBy:void 0,decisionNote:Object.hasOwn(e,"decisionNote")&&w(e.decisionNote)?e.decisionNote:void 0,rejectionReason:Object.hasOwn(e,"rejectionReason")&&w(e.rejectionReason)?e.rejectionReason:void 0,summary:Object.hasOwn(e,"summary")&&w(e.summary)?e.summary:void 0,triggerReason:Object.hasOwn(e,"triggerReason")&&w(e.triggerReason)?e.triggerReason:void 0,confidenceLabel:Object.hasOwn(e,"confidenceLabel")&&w(e.confidenceLabel)?e.confidenceLabel:void 0,confidenceExplanation:Object.hasOwn(e,"confidenceExplanation")&&w(e.confidenceExplanation)?e.confidenceExplanation:void 0,effectDescription:Object.hasOwn(e,"effectDescription")&&w(e.effectDescription)?e.effectDescription:void 0,rejectionEffect:Object.hasOwn(e,"rejectionEffect")&&w(e.rejectionEffect)?e.rejectionEffect:void 0};return Object.hasOwn(e,"isMvpProven")&&xt(e.isMvpProven)&&(t.isMvpProven=e.isMvpProven),Object.hasOwn(e,"warning")&&w(e.warning)&&(t.warning=e.warning),t}var J4=["technical_pattern","diagnostic_residue","title_too_long"];function eU(e){return w(e)&&J4.includes(e)}function tU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"text")||!w(e.text)||!Object.hasOwn(e,"triggerPattern")||!w(e.triggerPattern)||!Object.hasOwn(e,"action")||!w(e.action)||!Object.hasOwn(e,"status")||!w(e.status)||!Object.hasOwn(e,"priority")||!w(e.priority)||!Object.hasOwn(e,"scope")||!w(e.scope))return null;let t=vt(e,"domain");if(!t.valid||!Object.hasOwn(e,"evaluability")||!w(e.evaluability)||!Object.hasOwn(e,"valueScore")||!Ye(e.valueScore)||!Object.hasOwn(e,"adherenceRate")||!Ye(e.adherenceRate)||!Object.hasOwn(e,"painPreventedCount")||!Ye(e.painPreventedCount)||!Object.hasOwn(e,"ruleCount")||!Ye(e.ruleCount)||!Object.hasOwn(e,"conflictsWithCount")||!Ye(e.conflictsWithCount)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"updatedAt")||!w(e.updatedAt))return null;let a={id:e.id,text:e.text,triggerPattern:e.triggerPattern,action:e.action,status:e.status,priority:e.priority,scope:e.scope,domain:t.value,evaluability:e.evaluability,valueScore:e.valueScore,adherenceRate:e.adherenceRate,painPreventedCount:e.painPreventedCount,ruleCount:e.ruleCount,conflictsWithCount:e.conflictsWithCount,createdAt:e.createdAt,updatedAt:e.updatedAt,detectedLanguage:"unknown"};if(Object.hasOwn(e,"detectedLanguage")){if(!w(e.detectedLanguage))return null;a.detectedLanguage=e.detectedLanguage}if(Object.hasOwn(e,"readabilityWarningCode")){if(!eU(e.readabilityWarningCode))return null;a.readabilityWarningCode=e.readabilityWarningCode}if(Object.hasOwn(e,"runtimeDeactivated")){if(e.runtimeDeactivated!==!0)return null;a.runtimeDeactivated=!0}return a}function aU(e){return!P(e)||!w(e.id)||e.id.length===0||e.layer!=="foundational"&&e.layer!=="operating"||!w(e.name)||e.name.length===0||!w(e.nameZh)||e.nameZh.length===0||!w(e.statement)||e.statement.length===0||!w(e.statementZh)||e.statementZh.length===0?null:{id:e.id,layer:e.layer,name:e.name,nameZh:e.nameZh,statement:e.statement,statementZh:e.statementZh}}function jD(e){if(!P(e)||!Object.hasOwn(e,"principles")||!Array.isArray(e.principles))return null;let t=Yt(e.principles,aU);return t===null?null:{principles:t}}function Bm(e){if(!P(e)||!Object.hasOwn(e,"principles")||!Array.isArray(e.principles)||!Object.hasOwn(e,"summary")||!P(e.summary))return null;let t=e.summary,{candidate:a,probation:n,active:r,deprecated:i,archived:o,total:s}=t;if(!Ye(a)||!Ye(n)||!Ye(r)||!Ye(i)||!Ye(o)||!Ye(s))return null;let l=Yt(e.principles,tU);if(l===null)return null;let c;if(Object.hasOwn(e,"categories")){if(!P(e.categories))return null;let f=e.categories,m={};for(let[p,b]of Object.entries(f)){if(!Ye(b))return null;m[p]=b}Object.keys(m).length>0&&(c=m)}if(Object.hasOwn(e,"approvalCrossCheckUnavailable")&&!w(e.approvalCrossCheckUnavailable))return null;let u=w(e.approvalCrossCheckUnavailable)?e.approvalCrossCheckUnavailable:void 0;if(Object.hasOwn(e,"revocationCheckUnavailable")&&!w(e.revocationCheckUnavailable))return null;let d=w(e.revocationCheckUnavailable)?e.revocationCheckUnavailable:void 0;return{principles:l,summary:{candidate:a,probation:n,active:r,deprecated:i,archived:o,total:s},...c!==void 0?{categories:c}:{},...u!==void 0?{approvalCrossCheckUnavailable:u}:{},...d!==void 0?{revocationCheckUnavailable:d}:{}}}function nU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"artifactId")||!w(e.artifactId)||!Object.hasOwn(e,"channel")||!w(e.channel)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)||!Object.hasOwn(e,"status")||!w(e.status))return null;let t={id:e.id,artifactId:e.artifactId,channel:e.channel,createdAt:e.createdAt,status:e.status};if(Object.hasOwn(e,"revisionReviewUnavailable")){if(typeof e.revisionReviewUnavailable!="boolean")return null;t.revisionReviewUnavailable=e.revisionReviewUnavailable}return t}function rU(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"principleTitle")||!w(e.principleTitle)||!Object.hasOwn(e,"status")||!w(e.status)||!Object.hasOwn(e,"records")||!Array.isArray(e.records))return null;let t=Yt(e.records,nU);if(t===null)return null;let a={principleId:e.principleId,principleTitle:e.principleTitle,status:e.status,records:t};if(Object.hasOwn(e,"revisionReviewUnavailable")){if(typeof e.revisionReviewUnavailable!="boolean")return null;a.revisionReviewUnavailable=e.revisionReviewUnavailable}if(Object.hasOwn(e,"revisionReview")){let n=e.revisionReview;if(!P(n)||typeof n.oldStatement!="string"||typeof n.newStatement!="string"||!P(n.intentFields))return null;let r={};for(let i of["ownerIntent","targetBehavior","forbiddenBehavior","evidenceSource","validationExpectation"]){let o=n.intentFields[i];if(o!==void 0&&typeof o!="string")return null;typeof o=="string"&&(r[i]=o)}a.revisionReview={oldStatement:n.oldStatement,newStatement:n.newStatement,intentFields:r,...typeof n.artifactId=="string"?{artifactId:n.artifactId}:{},...typeof n.artifactDigest=="string"&&/^sha256:[a-f0-9]{64}$/.test(n.artifactDigest)?{artifactDigest:n.artifactDigest}:{}}}return Object.hasOwn(e,"candidateDescription")&&w(e.candidateDescription)&&e.candidateDescription.length>0&&(a.candidateDescription=e.candidateDescription),Object.hasOwn(e,"fitsPromptBudget")&&typeof e.fitsPromptBudget=="boolean"&&(a.fitsPromptBudget=e.fitsPromptBudget),Object.hasOwn(e,"promptBudgetTierFit")&&(e.promptBudgetTierFit==="fits_all_tiers"||e.promptBudgetTierFit==="model_dependent"||e.promptBudgetTierFit==="exceeds_max_tier"||e.promptBudgetTierFit==="unconfirmed")&&(a.promptBudgetTierFit=e.promptBudgetTierFit),Object.hasOwn(e,"artifactUnavailable")&&typeof e.artifactUnavailable=="boolean"&&(a.artifactUnavailable=e.artifactUnavailable),a}function Bx(e){if(!P(e)||!Object.hasOwn(e,"budget")||!Object.hasOwn(e,"usedChars")||!Object.hasOwn(e,"truncated"))return null;let{budget:t,usedChars:a,truncated:n}=e;if(typeof t!="number"||!Number.isInteger(t)||t<=0||typeof a!="number"||!Number.isInteger(a)||a<0||typeof n!="boolean")return null;let r={budget:t,usedChars:a,truncated:n};if(Object.hasOwn(e,"productionRotates")&&typeof e.productionRotates=="boolean"&&(r.productionRotates=e.productionRotates),Object.hasOwn(e,"eligibleCount")&&typeof e.eligibleCount=="number"&&Number.isInteger(e.eligibleCount)&&e.eligibleCount>=0&&(r.eligibleCount=e.eligibleCount),Object.hasOwn(e,"capacityStatus")&&(e.capacityStatus==="confirmed"||e.capacityStatus==="unconfirmed")&&(r.capacityStatus=e.capacityStatus),Object.hasOwn(e,"hostKind")&&(e.hostKind==="openclaw"||e.hostKind==="codex"||e.hostKind==="workbuddy")&&(r.hostKind=e.hostKind),Object.hasOwn(e,"route")&&(e.route==="legacy_trim"||e.route==="shared_render")&&(r.route=e.route),Object.hasOwn(e,"unit")&&e.unit==="utf16_code_units"&&(r.unit=e.unit),Object.hasOwn(e,"budgetScope")&&(e.budgetScope==="selected_lines"||e.budgetScope==="full_directive_context")&&(r.budgetScope=e.budgetScope),Object.hasOwn(e,"fullRenderChars")&&typeof e.fullRenderChars=="number"&&Number.isInteger(e.fullRenderChars)&&e.fullRenderChars>=0&&(r.fullRenderChars=e.fullRenderChars),Object.hasOwn(e,"oversizedActivationIds")&&Array.isArray(e.oversizedActivationIds)&&e.oversizedActivationIds.every(w)&&(r.oversizedActivationIds=e.oversizedActivationIds),Object.hasOwn(e,"oversizedDiagnosticTruncated")&&typeof e.oversizedDiagnosticTruncated=="boolean"&&(r.oversizedDiagnosticTruncated=e.oversizedDiagnosticTruncated),Object.hasOwn(e,"unconfirmedReason")&&w(e.unconfirmedReason)&&(r.unconfirmedReason=e.unconfirmedReason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(r.nextAction=e.nextAction),Object.hasOwn(e,"budgetCapacitySource")&&Ex(e.budgetCapacitySource)&&(r.budgetCapacitySource=e.budgetCapacitySource),Object.hasOwn(e,"budgetFallbackReason")&&Nx(e.budgetFallbackReason)&&(r.budgetFallbackReason=e.budgetFallbackReason),Object.hasOwn(e,"budgetCapacityStatus")&&Ox(e.budgetCapacityStatus)&&(r.budgetCapacityStatus=e.budgetCapacityStatus),Object.hasOwn(e,"budgetContextWindowTokens")&&typeof e.budgetContextWindowTokens=="number"&&Number.isInteger(e.budgetContextWindowTokens)&&e.budgetContextWindowTokens>0&&(r.budgetContextWindowTokens=e.budgetContextWindowTokens),Object.hasOwn(e,"budgetObservedAt")&&w(e.budgetObservedAt)&&e.budgetObservedAt.length>0&&Number.isFinite(Date.parse(e.budgetObservedAt))&&(r.budgetObservedAt=e.budgetObservedAt),Object.hasOwn(e,"perHost")&&Array.isArray(e.perHost)){let i=[];for(let o of e.perHost){if(!P(o))return null;let{hostKind:s,route:l,usedChars:c,truncated:u}=o;if(s!=="openclaw"&&s!=="codex"&&s!=="workbuddy"||l!=="legacy_trim"&&l!=="shared_render"||typeof c!="number"||!Number.isInteger(c)||c<0||typeof u!="boolean")return null;let d={hostKind:s,route:l,usedChars:c,truncated:u};Object.hasOwn(o,"budget")&&typeof o.budget=="number"&&Number.isInteger(o.budget)&&o.budget>0&&(d.budget=o.budget),Object.hasOwn(o,"budgetCapacitySource")&&Ex(o.budgetCapacitySource)&&(d.budgetCapacitySource=o.budgetCapacitySource),Object.hasOwn(o,"budgetCapacityStatus")&&Ox(o.budgetCapacityStatus)&&(d.budgetCapacityStatus=o.budgetCapacityStatus),Object.hasOwn(o,"budgetObservedAt")&&w(o.budgetObservedAt)&&o.budgetObservedAt.length>0&&Number.isFinite(Date.parse(o.budgetObservedAt))&&(d.budgetObservedAt=o.budgetObservedAt),Object.hasOwn(o,"budgetFallbackReason")&&Nx(o.budgetFallbackReason)&&(d.budgetFallbackReason=o.budgetFallbackReason),i.push(d)}r.perHost=i}return r}function HD(e){if(!P(e)||!Object.hasOwn(e,"groups")||!Array.isArray(e.groups)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt))return null;let t=Yt(e.groups,rU);if(t===null)return null;let a={groups:t,generatedAt:e.generatedAt};if(Object.hasOwn(e,"note")&&w(e.note)&&(a.note=e.note),Object.hasOwn(e,"promptInjection")){let n=Bx(e.promptInjection);n!==null&&(a.promptInjection=n)}return a}var iU=new Set(["recorded-only","evidence-only","diagnosis-queued","diagnosis-running","diagnosis-succeeded","diagnosis-failed","diagnosis-retry-wait","candidate-generated","internalization-missing","internalization-pending","internalization-running","internalization-failed","internalization-succeeded","owner-reviewable","malformed","degraded"]),zD=["none","action_drift","intent_suspect","healthy_tension"],qD=["weak","moderate","strong"],VD=["why","desired_outcome","non_negotiables","stop_escalation","current_strategic_focus"],GD=["confirm_drift","revise_intent","observe","dismiss","promote_to_principle","promote_to_rulehost"];function oU(e){if(!P(e)||Object.hasOwn(e,"confidence")||!Object.hasOwn(e,"source")||!w(e.source)||!zD.includes(e.source)||!Object.hasOwn(e,"evidenceStrength")||!w(e.evidenceStrength)||!qD.includes(e.evidenceStrength)||!Object.hasOwn(e,"relatedIntentFields")||!Array.isArray(e.relatedIntentFields))return null;let t=[];for(let i of e.relatedIntentFields){if(typeof i!="string"||!VD.includes(i))return null;t.push(i)}if(!Object.hasOwn(e,"evidence")||!Array.isArray(e.evidence))return null;let a=[];for(let i of e.evidence){if(typeof i!="string")return null;a.push(i)}let n=a.slice(0,3);if(!Object.hasOwn(e,"explanation")||!w(e.explanation)||e.explanation.length===0||!Object.hasOwn(e,"suggestedOwnerAction")||!w(e.suggestedOwnerAction)||!GD.includes(e.suggestedOwnerAction))return null;let r={source:e.source,evidenceStrength:e.evidenceStrength,relatedIntentFields:t,evidence:n,explanation:e.explanation,suggestedOwnerAction:e.suggestedOwnerAction};if(Object.hasOwn(e,"intentDocHash")){if(!w(e.intentDocHash))return null;r.intentDocHash=e.intentDocHash}return r}function Nm(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"source")||!w(e.source)||!zD.includes(e.source)||!Object.hasOwn(e,"evidenceStrength")||!w(e.evidenceStrength)||!qD.includes(e.evidenceStrength)||!Object.hasOwn(e,"relatedIntentFields")||!Array.isArray(e.relatedIntentFields))return null;let t=[];for(let r of e.relatedIntentFields){if(typeof r!="string"||!VD.includes(r))return null;t.push(r)}if(!Object.hasOwn(e,"ownerAction")||!w(e.ownerAction)||!GD.includes(e.ownerAction)||!Object.hasOwn(e,"evidenceRefs")||!Array.isArray(e.evidenceRefs))return null;let a=[];for(let r of e.evidenceRefs){if(typeof r!="string")return null;a.push(r)}if(!Object.hasOwn(e,"createdAt")||!w(e.createdAt))return null;let n={id:e.id,source:e.source,evidenceStrength:e.evidenceStrength,relatedIntentFields:t,ownerAction:e.ownerAction,evidenceRefs:a,createdAt:e.createdAt};if(Object.hasOwn(e,"painId")){if(!w(e.painId))return null;n.painId=e.painId}if(Object.hasOwn(e,"taskId")){if(!w(e.taskId))return null;n.taskId=e.taskId}if(Object.hasOwn(e,"runId")){if(!w(e.runId))return null;n.runId=e.runId}if(Object.hasOwn(e,"intentDocHash")){if(!w(e.intentDocHash))return null;n.intentDocHash=e.intentDocHash}if(Object.hasOwn(e,"resultingCandidateId")){if(!w(e.resultingCandidateId))return null;n.resultingCandidateId=e.resultingCandidateId}if(Object.hasOwn(e,"resultingRuleCandidateId")){if(!w(e.resultingRuleCandidateId))return null;n.resultingRuleCandidateId=e.resultingRuleCandidateId}if(Object.hasOwn(e,"patchProposalId")){if(!w(e.patchProposalId))return null;n.patchProposalId=e.patchProposalId}return n}function Mx(e){return Yt(e,Nm)}function $D(e){if(!P(e)||!Object.hasOwn(e,"record"))return null;let t=Nm(e.record);return t===null||!Object.hasOwn(e,"created")||!xt(e.created)?null:{record:t,created:e.created}}function WD(e){if(!P(e)||!Object.hasOwn(e,"counts")||!P(e.counts))return null;let{counts:t}=e;if(!Object.hasOwn(t,"confirm_drift")||!Ye(t.confirm_drift)||t.confirm_drift<0||!Object.hasOwn(t,"revise_intent")||!Ye(t.revise_intent)||t.revise_intent<0||!Object.hasOwn(t,"observe")||!Ye(t.observe)||t.observe<0||!Object.hasOwn(t,"dismiss")||!Ye(t.dismiss)||t.dismiss<0||!Object.hasOwn(t,"promote_to_principle")||!Ye(t.promote_to_principle)||t.promote_to_principle<0||!Object.hasOwn(t,"promote_to_rulehost")||!Ye(t.promote_to_rulehost)||t.promote_to_rulehost<0||!Object.hasOwn(e,"lastDecisionAt"))return null;let{lastDecisionAt:a}=e;return a!==null&&!w(a)?null:{counts:{confirm_drift:t.confirm_drift,revise_intent:t.revise_intent,observe:t.observe,dismiss:t.dismiss,promote_to_principle:t.promote_to_principle,promote_to_rulehost:t.promote_to_rulehost},lastDecisionAt:a}}var sU=new Set(["link_candidate","guide_rulehost","generate_patch_proposal"]);function KD(e){if(!P(e)||!Object.hasOwn(e,"type")||!w(e.type)||!sU.has(e.type)||!Object.hasOwn(e,"decisionId")||!w(e.decisionId))return null;let t=e.type,{decisionId:a}=e;if(t==="link_candidate"){if(!Object.hasOwn(e,"record"))return null;let i=Nm(e.record);return i===null||!Object.hasOwn(e,"linkedCandidateId")||!w(e.linkedCandidateId)?null:{type:"link_candidate",decisionId:a,record:i,linkedCandidateId:e.linkedCandidateId}}if(t==="guide_rulehost")return!Object.hasOwn(e,"cliCommand")||!w(e.cliCommand)||!Object.hasOwn(e,"note")||!w(e.note)?null:{type:"guide_rulehost",decisionId:a,cliCommand:e.cliCommand,note:e.note};if(!Object.hasOwn(e,"record"))return null;let n=Nm(e.record);if(n===null||!Object.hasOwn(e,"patchProposal")||!P(e.patchProposal))return null;let r=e.patchProposal;return!Object.hasOwn(r,"id")||!w(r.id)||!Object.hasOwn(r,"markdown")||!w(r.markdown)?null:{type:"generate_patch_proposal",decisionId:a,record:n,patchProposal:{id:r.id,markdown:r.markdown}}}function lU(e){if(!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"sourceKind")||!w(e.sourceKind)||!Object.hasOwn(e,"observedAt")||!w(e.observedAt)||!Object.hasOwn(e,"state")||!w(e.state)||!iU.has(e.state)||!Object.hasOwn(e,"summary")||!w(e.summary))return null;let t={id:e.id,sourceKind:e.sourceKind,observedAt:e.observedAt,state:e.state,summary:e.summary};if(Object.hasOwn(e,"hostKind")){if(!w(e.hostKind)||e.hostKind!=="openclaw"&&e.hostKind!=="codex"&&e.hostKind!=="unknown")return null;t.hostKind=e.hostKind}if(Object.hasOwn(e,"admissionDecision")){if(!w(e.admissionDecision))return null;t.admissionDecision=e.admissionDecision}if(Object.hasOwn(e,"linkedPainId")){if(!w(e.linkedPainId))return null;t.linkedPainId=e.linkedPainId}if(Object.hasOwn(e,"linkedTaskId")){if(!w(e.linkedTaskId))return null;t.linkedTaskId=e.linkedTaskId}if(Object.hasOwn(e,"linkedTaskStatus")){if(!w(e.linkedTaskStatus))return null;t.linkedTaskStatus=e.linkedTaskStatus}if(Object.hasOwn(e,"linkedCandidateId")){if(!w(e.linkedCandidateId))return null;t.linkedCandidateId=e.linkedCandidateId}if(Object.hasOwn(e,"linkedPrincipleId")){if(!w(e.linkedPrincipleId))return null;t.linkedPrincipleId=e.linkedPrincipleId}if(Object.hasOwn(e,"failureReason")){if(!w(e.failureReason))return null;t.failureReason=e.failureReason}if(Object.hasOwn(e,"degradedReason")){if(!w(e.degradedReason))return null;t.degradedReason=e.degradedReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}if(Object.hasOwn(e,"candidateTitle")){if(!w(e.candidateTitle))return null;t.candidateTitle=e.candidateTitle}if(Object.hasOwn(e,"candidateSummary")){if(!w(e.candidateSummary))return null;t.candidateSummary=e.candidateSummary}if(Object.hasOwn(e,"rootCauseSummary")){if(!w(e.rootCauseSummary))return null;t.rootCauseSummary=e.rootCauseSummary}if(Object.hasOwn(e,"confidence")){if(typeof e.confidence!="number"||!Number.isFinite(e.confidence))return null;t.confidence=e.confidence}if(Object.hasOwn(e,"recommendationKind")){if(!w(e.recommendationKind))return null;t.recommendationKind=e.recommendationKind}if(Object.hasOwn(e,"internalizationTaskId")){if(!w(e.internalizationTaskId))return null;t.internalizationTaskId=e.internalizationTaskId}if(Object.hasOwn(e,"dreamerTaskStatus")){if(!w(e.dreamerTaskStatus))return null;t.dreamerTaskStatus=e.dreamerTaskStatus}if(Object.hasOwn(e,"intentTension")){let a=oU(e.intentTension);a!==null&&(t.intentTension=a)}return t}function YD(e){if(!P(e)||!Object.hasOwn(e,"records")||!Array.isArray(e.records)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt))return null;let t=Yt(e.records,lU);if(t===null)return null;let a={records:t,generatedAt:e.generatedAt};if(Object.hasOwn(e,"degradedReason")){if(!w(e.degradedReason))return null;a.degradedReason=e.degradedReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;a.nextAction=e.nextAction}if(Object.hasOwn(e,"note")){if(!w(e.note))return null;a.note=e.note}return a}var cU=["zh-CN","en"];function Fx(e){return!P(e)||!Object.hasOwn(e,"outputLanguage")||!w(e.outputLanguage)||!cU.includes(e.outputLanguage)||!Object.hasOwn(e,"source")||!w(e.source)?null:{outputLanguage:e.outputLanguage,source:e.source}}function XD(e){if(!P(e)||!Object.hasOwn(e,"success")||typeof e.success!="boolean"||!Object.hasOwn(e,"message")||!w(e.message))return null;let t={success:e.success,message:e.message};return Object.hasOwn(e,"refusal")&&typeof e.refusal=="boolean"&&(t.refusal=e.refusal),Object.hasOwn(e,"state")&&w(e.state)&&(e.state==="update_blocked"||e.state==="awaiting_restart"||e.state==="update_in_progress")&&(t.state=e.state),Object.hasOwn(e,"transactionId")&&w(e.transactionId)&&(t.transactionId=e.transactionId),Object.hasOwn(e,"updatedFiles")&&Array.isArray(e.updatedFiles)&&(t.updatedFiles=e.updatedFiles.filter(a=>typeof a=="string")),Object.hasOwn(e,"backupPath")&&w(e.backupPath)&&(t.backupPath=e.backupPath),Object.hasOwn(e,"newVersion")&&w(e.newVersion)&&(t.newVersion=e.newVersion),Object.hasOwn(e,"partialUpdate")&&typeof e.partialUpdate=="boolean"&&(t.partialUpdate=e.partialUpdate),Object.hasOwn(e,"requiresRestart")&&typeof e.requiresRestart=="boolean"&&(t.requiresRestart=e.requiresRestart),Object.hasOwn(e,"reason")&&w(e.reason)&&(t.reason=e.reason),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(t.nextAction=e.nextAction),Object.hasOwn(e,"gatewayNotice")&&w(e.gatewayNotice)&&(t.gatewayNotice=e.gatewayNotice),t}function Mm(e){if(!P(e)||!Object.hasOwn(e,"needsRecovery")||typeof e.needsRecovery!="boolean")return null;let t=[];if(Object.hasOwn(e,"unfinished")&&Array.isArray(e.unfinished))for(let o of e.unfinished)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||t.push({transactionId:o.transactionId,lastState:Object.hasOwn(o,"lastState")&&w(o.lastState)?o.lastState:null,lastAt:Object.hasOwn(o,"lastAt")&&w(o.lastAt)?o.lastAt:null,productVersion:Object.hasOwn(o,"productVersion")&&w(o.productVersion)?o.productVersion:null,tornTailDetected:Object.hasOwn(o,"tornTailDetected")&&typeof o.tornTailDetected=="boolean"?o.tornTailDetected:!1});let a=[];if(Object.hasOwn(e,"broken")&&Array.isArray(e.broken))for(let o of e.broken)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||a.push({transactionId:o.transactionId,reason:o.reason});let n=[];if(Object.hasOwn(e,"superseded")&&Array.isArray(e.superseded))for(let o of e.superseded)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||n.push({transactionId:o.transactionId,reason:o.reason});let r=[];if(Object.hasOwn(e,"recoveryRequired")&&Array.isArray(e.recoveryRequired))for(let o of e.recoveryRequired)!P(o)||!Object.hasOwn(o,"transactionId")||!w(o.transactionId)||!Object.hasOwn(o,"reason")||!w(o.reason)||r.push({transactionId:o.transactionId,reason:o.reason});let i={needsRecovery:e.needsRecovery,unfinished:t,broken:a,superseded:n,recoveryRequired:r};return Object.hasOwn(e,"activeRecordUnreadable")&&typeof e.activeRecordUnreadable=="boolean"&&(i.activeRecordUnreadable=e.activeRecordUnreadable),Object.hasOwn(e,"nextAction")&&w(e.nextAction)&&(i.nextAction=e.nextAction),i}function Fm(e){return!P(e)||!Object.hasOwn(e,"transactionId")||!w(e.transactionId)||!Object.hasOwn(e,"exists")||typeof e.exists!="boolean"?null:{transactionId:e.transactionId,exists:e.exists,lastState:Object.hasOwn(e,"lastState")&&w(e.lastState)?e.lastState:null,terminal:Object.hasOwn(e,"terminal")&&typeof e.terminal=="boolean"?e.terminal:!1,tornTailDetected:Object.hasOwn(e,"tornTailDetected")&&typeof e.tornTailDetected=="boolean"?e.tornTailDetected:!1,startedAt:Object.hasOwn(e,"startedAt")&&w(e.startedAt)?e.startedAt:null,lastAt:Object.hasOwn(e,"lastAt")&&w(e.lastAt)?e.lastAt:null,productVersion:Object.hasOwn(e,"productVersion")&&w(e.productVersion)?e.productVersion:null,reason:Object.hasOwn(e,"reason")&&w(e.reason)?e.reason:void 0}}var dU=["evidence","diagnosis","proposal","review","deploy","behavior"],uU=["available","unavailable","not_applicable"];function fU(e){return w(e)&&dU.includes(e)}function pU(e){return w(e)&&uU.includes(e)}function mU(e){if(!P(e)||!Object.hasOwn(e,"key")||!fU(e.key)||!Object.hasOwn(e,"status")||!pU(e.status)||!Object.hasOwn(e,"summary")||!w(e.summary))return null;let t={key:e.key,status:e.status,summary:e.summary};if(Object.hasOwn(e,"detail")){if(!w(e.detail))return null;t.detail=e.detail}if(Object.hasOwn(e,"timestamp")){if(!w(e.timestamp))return null;t.timestamp=e.timestamp}if(Object.hasOwn(e,"unavailableReason")){if(!w(e.unavailableReason))return null;t.unavailableReason=e.unavailableReason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;t.nextAction=e.nextAction}if(Object.hasOwn(e,"meta")){if(!P(e.meta))return null;t.meta=e.meta}return t}function ZD(e){if(!P(e)||!Object.hasOwn(e,"principleId")||!w(e.principleId)||!Object.hasOwn(e,"stages")||!Array.isArray(e.stages))return null;let t=Yt(e.stages,mU);if(t===null)return null;let a={principleId:e.principleId,stages:t};if(Object.hasOwn(e,"degraded")){if(!P(e.degraded))return null;let n=e.degraded;if(!Object.hasOwn(n,"reason")||!w(n.reason)||!Object.hasOwn(n,"nextAction")||!w(n.nextAction))return null;a.degraded={reason:n.reason,nextAction:n.nextAction}}return a}var gU=["flag_disabled","not_found","read_error","parse_error","oversized"],hU=["missing_section","empty_section","too_vague","oversized","parse_failed"],bU=["why","desiredOutcome","nonNegotiables","stopEscalation","currentStrategicFocus"];function QD(e){if(!P(e)||!Object.hasOwn(e,"code")||!w(e.code)||!hU.includes(e.code)||!Object.hasOwn(e,"message")||!w(e.message))return null;let t={code:e.code,message:e.message};if(Object.hasOwn(e,"section")){if(!w(e.section))return null;t.section=e.section}return t}function vU(e){if(!P(e))return null;let t={};for(let a of bU)if(Object.hasOwn(e,a)){let n=e[a];if(n!==null&&!w(n))return null;w(n)&&(t[a]=n)}return t}function JD(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"found")||!xt(e.found)||!Object.hasOwn(e,"flagEnabled")||!xt(e.flagEnabled)||!Object.hasOwn(e,"warnings")||!Array.isArray(e.warnings))return null;let t=Yt(e.warnings,QD);if(t===null)return null;let a={ok:e.ok,found:e.found,flagEnabled:e.flagEnabled,warnings:t};if(Object.hasOwn(e,"reason")){if(!w(e.reason)||!gU.includes(e.reason))return null;a.reason=e.reason}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;a.nextAction=e.nextAction}if(Object.hasOwn(e,"path")){if(!w(e.path))return null;a.path=e.path}if(Object.hasOwn(e,"contentHash")){if(!w(e.contentHash))return null;a.contentHash=e.contentHash}if(Object.hasOwn(e,"lastEditedAt")){if(!w(e.lastEditedAt))return null;a.lastEditedAt=e.lastEditedAt}if(Object.hasOwn(e,"sections")){let n=vU(e.sections);if(n===null)return null;a.sections=n}return a}function e1(e){return!P(e)||!Object.hasOwn(e,"content")||!w(e.content)||!Object.hasOwn(e,"path")||!w(e.path)?null:{content:e.content,path:e.path}}function t1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"created")||!xt(e.created))return null;let t={ok:e.ok,created:e.created},a=vt(e,"path");if(!a.valid)return null;a.value!==null&&(t.path=a.value);let n=vt(e,"reason");if(!n.valid)return null;n.value!==null&&(t.reason=n.value);let r=vt(e,"nextAction");return r.valid?(r.value!==null&&(t.nextAction=r.value),t):null}function a1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||!Object.hasOwn(e,"saved")||!xt(e.saved))return null;let t={ok:e.ok,saved:e.saved},a=vt(e,"path");if(!a.valid)return null;a.value!==null&&(t.path=a.value);let n=vt(e,"contentHash");if(!n.valid)return null;n.value!==null&&(t.contentHash=n.value);let r=vt(e,"lastEditedAt");if(!r.valid)return null;r.value!==null&&(t.lastEditedAt=r.value);let i=vt(e,"reason");if(!i.valid)return null;i.value!==null&&(t.reason=i.value);let o=vt(e,"nextAction");if(!o.valid)return null;if(o.value!==null&&(t.nextAction=o.value),Object.hasOwn(e,"warnings")){if(!Array.isArray(e.warnings))return null;let s=Yt(e.warnings,QD);if(s===null)return null;t.warnings=s}return t}function xU(e){return!P(e)||!Object.hasOwn(e,"id")||!w(e.id)||!Object.hasOwn(e,"lang")||!w(e.lang)||!Object.hasOwn(e,"contentHash")||!w(e.contentHash)||!Object.hasOwn(e,"contentSnapshot")||!w(e.contentSnapshot)||!Object.hasOwn(e,"reason")||!w(e.reason)||!Object.hasOwn(e,"createdAt")||!w(e.createdAt)?null:{id:e.id,lang:e.lang,contentHash:e.contentHash,contentSnapshot:e.contentSnapshot,reason:e.reason,createdAt:e.createdAt}}function n1(e){if(!P(e)||!Object.hasOwn(e,"versions")||!Array.isArray(e.versions))return null;let t=Yt(e.versions,xU);return t===null?null:{versions:t}}function Ux(e){return!P(e)||!Object.hasOwn(e,"authenticationMode")||e.authenticationMode!=="authenticated"&&e.authenticationMode!=="no_auth"||!Object.hasOwn(e,"ownerIdentityConfiguration")||e.ownerIdentityConfiguration!=="configured"&&e.ownerIdentityConfiguration!=="missing"&&e.ownerIdentityConfiguration!=="invalid"?null:{authenticationMode:e.authenticationMode,ownerIdentityConfiguration:e.ownerIdentityConfiguration}}function yU(e){if(e==null||!P(e))return null;let t=e;return!Object.hasOwn(t,"schemaVersion")||!Ye(t.schemaVersion)||!Object.hasOwn(t,"ownerId")||!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||!w(t.credentialId)||!Object.hasOwn(t,"registeredAt")||!w(t.registeredAt)?null:{schemaVersion:t.schemaVersion,ownerId:t.ownerId,credentialId:t.credentialId,registeredAt:t.registeredAt}}function r1(e){if(!P(e)||!Object.hasOwn(e,"resolved")||!P(e.resolved))return null;let t=e.resolved;if(!Object.hasOwn(t,"ownerId")||t.ownerId!==null&&!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||t.credentialId!==null&&!w(t.credentialId)||!Object.hasOwn(t,"source")||t.source!=="env"&&t.source!=="file"&&t.source!=="none"&&t.source!=="invalid_env")return null;let a=Ux(e.governance);if(a===null)return null;let n={resolved:{ownerId:t.ownerId,credentialId:t.credentialId,source:t.source,...Object.hasOwn(t,"error")&&w(t.error)?{error:t.error}:{}},fileRecord:yU(e.fileRecord),governance:a};return Object.hasOwn(e,"fileError")&&w(e.fileError)&&(n.fileError=e.fileError),n}function i1(e){if(!P(e)||!Object.hasOwn(e,"source")||e.source!=="file"||!Object.hasOwn(e,"record")||!P(e.record))return null;let t=e.record;if(!Object.hasOwn(t,"schemaVersion")||!Ye(t.schemaVersion)||!Object.hasOwn(t,"ownerId")||!w(t.ownerId)||!Object.hasOwn(t,"credentialId")||!w(t.credentialId)||!Object.hasOwn(t,"registeredAt")||!w(t.registeredAt))return null;let a=Ux(e.governance);return a===null?null:{source:"file",record:{schemaVersion:t.schemaVersion,ownerId:t.ownerId,credentialId:t.credentialId,registeredAt:t.registeredAt},governance:a}}function o1(e){if(!P(e)||!Object.hasOwn(e,"ok")||!xt(e.ok)||e.ok!==!0||!Object.hasOwn(e,"source")||e.source!=="none")return null;let t=Ux(e.governance);return t===null?null:{ok:!0,source:"none",governance:t}}var wU=new Set(["evaluator_review","rollout_review","activation_approval","rulecode_decision"]),kU=new Set(["accept_current","revise_once","reject_current","approve","reject","promote","reject_after_shadow"]);function SU(e){if(!P(e))return null;let{provenance:t}=e;if(!w(e.version))return null;let a=vt(e,"sourcePainId");if(!a.valid||!Array.isArray(e.notes))return null;let n=[];for(let l of e.notes){if(!w(l))return null;n.push(l)}if(!P(t))return null;let r=vt(t,"sourceDreamerArtifactId");if(!r.valid||r.value===null)return null;let i=vt(t,"sourceDiagnosisArtifactId"),o=vt(t,"sourceDiagnosisTaskId");if(!i.valid||!o.valid)return null;let s={version:e.version,sourcePainId:a.value,provenance:{sourceDreamerArtifactId:r.value,sourceDiagnosisArtifactId:i.value,sourceDiagnosisTaskId:o.value},notes:n};if(e.diagnosis!==void 0){if(!P(e.diagnosis))return null;let{diagnosis:l}=e,c=vt(l,"rootCause"),u=vt(l,"summary");if(!c.valid||!u.valid||!Array.isArray(l.evidence))return null;let d=[];for(let f of l.evidence){if(!P(f))return null;let m=vt(f,"sourceRef"),p=vt(f,"note");if(!m.valid||m.value===null||!p.valid||p.value===null)return null;d.push({sourceRef:m.value,note:p.value})}s.diagnosis={rootCause:c.value,summary:u.value,evidence:d}}return s}function al(e){return!Array.isArray(e)||e.some(t=>typeof t!="string")?null:e}function CU(e){if(!P(e)||!P(e.brief)||!P(e.evidence)||!P(e.capability))return null;let{brief:t,evidence:a,capability:n}=e;if(t.kind!=="evaluator"&&t.kind!=="rollout")return null;let r=al(t.requiredChanges);if(r===null)return null;let i={kind:t.kind,requiredChanges:r};if(t.kind==="evaluator"){if(!P(t.principle)||!P(t.implementation))return null;let c=al(t.principle.scope),u=al(t.implementation.affectedTools),d=al(t.implementation.risks),f=al(t.strengths),m=al(t.concerns);if(c===null||u===null||d===null||f===null||m===null)return null;i.principle={scope:c};for(let p of["title","statement","rationale"]){let b=t.principle[p];if(b!==void 0&&!w(b))return null;w(b)&&(i.principle[p]=b)}if(i.implementation={affectedTools:u,risks:d},t.implementation.summary!==void 0&&!w(t.implementation.summary)||(w(t.implementation.summary)&&(i.implementation.summary=t.implementation.summary),i.strengths=f,i.concerns=m,t.score!==void 0&&!Ye(t.score)))return null;if(Ye(t.score)&&(i.score=t.score),t.qualityChecklist!==void 0){let p=["understandability","evidence","actionability","generalization","boundary"],b=t.qualityChecklist;if(P(b)&&b.schemaVersion===1&&Array.isArray(b.items)){let v=[],g=!0,h=new Set;for(let y of b.items){if(!P(y)||!w(y.id)||typeof y.pass!="boolean"||!w(y.note)){g=!1;break}h.add(y.id),v.push({id:y.id,pass:y.pass,note:y.note})}g&&v.length===p.length&&p.every(y=>h.has(y))&&(i.qualityChecklist={schemaVersion:1,items:v})}}if(t.formationEvidence!==void 0){let p=SU(t.formationEvidence);p!==null&&(i.formationEvidence=p)}}else{let c=al(t.risks);if(c===null||t.summary!==void 0&&!w(t.summary))return null;w(t.summary)&&(i.summary=t.summary),i.risks=c}if(a.completeness!=="complete"&&a.completeness!=="partial"&&a.completeness!=="insufficient"||!w(a.digest)||!Array.isArray(a.deterministicChecks)||!Array.isArray(a.items))return null;let o=[];for(let c of a.deterministicChecks){if(!P(c)||!w(c.check)||c.status!=="passed"&&c.status!=="failed"&&c.status!=="not_run"&&c.status!=="unavailable")return null;o.push({check:c.check,status:c.status})}let s=[];for(let c of a.items){if(!P(c)||!w(c.evidenceClass)||!w(c.label)||!w(c.value))return null;s.push({evidenceClass:c.evidenceClass,label:c.label,value:c.value})}if(!P(n.acceptRequirement))return null;let l=n.acceptRequirement;return l.kind!=="none"&&l.kind!=="acknowledge_partial_evidence"&&l.kind!=="forbidden"||l.reasonCode!==void 0&&!w(l.reasonCode)?null:{brief:i,evidence:{completeness:a.completeness,deterministicChecks:o,items:s,digest:a.digest},capability:{acceptRequirement:{kind:l.kind,...w(l.reasonCode)?{reasonCode:l.reasonCode}:{}}}}}function RU(e){if(!P(e))return null;let{reviewKey:t}=e,{kind:a}=e,{taskId:n}=e,{title:r}=e,{summary:i}=e,{reasonCode:o}=e,{createdAt:s}=e;if(!w(t)||!w(a)||!w(n)||!w(r)||!w(i)||!w(o)||!w(s)||!wU.has(a)||!Object.hasOwn(e,"legacy")||!xt(e.legacy)||!Object.hasOwn(e,"allowedActions")||!Array.isArray(e.allowedActions))return null;for(let m of e.allowedActions)if(typeof m!="string"||!kU.has(m))return null;if(!Object.hasOwn(e,"expectedRevisionEpoch")||!Ye(e.expectedRevisionEpoch))return null;let{expectedRevisionEpoch:l}=e,{expectedSourceRunId:c}=e,{expectedSourceArtifactId:u}=e,{expectedSourceArtifactHash:d}=e;if(!w(c)||!w(u)||!w(d))return null;let f={reviewKey:t,kind:a,taskId:n,title:r,summary:i,reasonCode:o,legacy:e.legacy,allowedActions:e.allowedActions,expectedRevisionEpoch:l,expectedSourceRunId:c,expectedSourceArtifactId:u,expectedSourceArtifactHash:d,createdAt:s};if(Object.hasOwn(e,"expectedEvidenceDigest")){if(!w(e.expectedEvidenceDigest))return null;f.expectedEvidenceDigest=e.expectedEvidenceDigest}if(Object.hasOwn(e,"review")){let m=CU(e.review);if(m===null||f.expectedEvidenceDigest!==void 0&&f.expectedEvidenceDigest!==m.evidence.digest)return null;f.review=m}if(Object.hasOwn(e,"evidenceUnavailableReason")){if(!w(e.evidenceUnavailableReason)||e.evidenceUnavailableReason.trim()==="")return null;f.evidenceUnavailableReason=e.evidenceUnavailableReason}if((a==="evaluator_review"||a==="rollout_review")&&f.evidenceUnavailableReason===void 0&&(f.expectedEvidenceDigest===void 0||f.review===void 0))return null;if(Object.hasOwn(e,"machineRecommendation")){if(!w(e.machineRecommendation))return null;f.machineRecommendation=e.machineRecommendation}if(Object.hasOwn(e,"score")){if(!Ye(e.score))return null;f.score=e.score}if(Object.hasOwn(e,"principleId")){if(!w(e.principleId))return null;f.principleId=e.principleId}return f}function s1(e){if(!P(e)||!Object.hasOwn(e,"items")||!Array.isArray(e.items))return null;let t=[];for(let a of e.items){let n=RU(a);if(n===null)return null;t.push(n)}return!Object.hasOwn(e,"total")||!Ye(e.total)||!Object.hasOwn(e,"generatedAt")||!w(e.generatedAt)?null:{items:t,total:e.total,generatedAt:e.generatedAt}}function l1(e){if(!P(e)||!Object.hasOwn(e,"status")||e.status!=="resolved")return null;let{resolutionId:t}=e,{reviewKey:a}=e,{action:n}=e;if(!w(t)||!w(a)||!w(n)||!Object.hasOwn(e,"applied")||!xt(e.applied)||!Object.hasOwn(e,"runnerWillApply")||!xt(e.runnerWillApply))return null;let r={status:"resolved",resolutionId:t,reviewKey:a,action:n,applied:e.applied,runnerWillApply:e.runnerWillApply};if(Object.hasOwn(e,"effectiveDecision")){if(!w(e.effectiveDecision))return null;r.effectiveDecision=e.effectiveDecision}if(Object.hasOwn(e,"targetTaskId")){if(!w(e.targetTaskId))return null;r.targetTaskId=e.targetTaskId}if(Object.hasOwn(e,"nextAction")){if(!w(e.nextAction))return null;r.nextAction=e.nextAction}return r}function Ru(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function c1(e){if(!Ru(e)||e.writeGuardVersion!=="approval-review-v1"||!Ru(e.review))return null;let t=Ic(e),a=e.review.expectedReview,{material:n}=e.review;if(!t||!Ru(a)||a.schemaVersion!=="approval-review-v1"||a.approvalId!==t.approvalId||a.artifactId!==t.artifactId||a.channel!==t.channel||!["prompt","code_tool_hook","defer_archive"].includes(String(a.channel))||a.artifactState!=="present"&&a.artifactState!=="missing"||a.artifactState==="present"&&(typeof a.artifactDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(a.artifactDigest))||!Ru(n)||n.artifactId!==t.artifactId||!["available","missing","unreadable"].includes(String(n.availability))||n.statement!==null&&typeof n.statement!="string"||n.rationale!==null&&typeof n.rationale!="string"||n.targetBehavior!==null&&typeof n.targetBehavior!="string"||!Array.isArray(n.scope)||!n.scope.every(c=>typeof c=="string")||n.risks!==null&&(!Array.isArray(n.risks)||!n.risks.every(c=>typeof c=="string"))||a.artifactState==="missing"&&(n.availability!=="missing"||n.exactBody!==null||n.statement!==null||Object.hasOwn(a,"artifactDigest"))||a.artifactState==="present"&&n.availability==="missing")return null;let r=n.exactBody,i=null;if(r!==null){if(!Ru(r)||r.kind!=="principle"&&r.kind!=="rule_code"||typeof r.text!="string")return null;i={kind:r.kind,text:r.text}}let{channel:o}=a;if(o!=="prompt"&&o!=="code_tool_hook"&&o!=="defer_archive"||n.availability==="available"!=(i!==null)||i!==null&&o==="code_tool_hook"!=(i.kind==="rule_code"))return null;let s=a.artifactState==="present"&&typeof a.artifactDigest=="string"?{schemaVersion:"approval-review-v1",approvalId:t.approvalId,artifactId:t.artifactId,channel:o,artifactState:"present",artifactDigest:a.artifactDigest}:{schemaVersion:"approval-review-v1",approvalId:t.approvalId,artifactId:t.artifactId,channel:o,artifactState:"missing"},{availability:l}=n;return l!=="available"&&l!=="missing"&&l!=="unreadable"?null:{approval:t,expectedReview:s,material:{availability:l,artifactId:t.artifactId,statement:n.statement,rationale:n.rationale,targetBehavior:n.targetBehavior,scope:n.scope,risks:n.risks,exactBody:i}}}var ss="pd_token";function Ac(e){let t=globalThis;return(e==="local"?t.localStorage:t.sessionStorage)??null}function d1(e,t){let a=e??Ac("local"),n=t??Ac("session"),r=a?.getItem(ss)??null;if(r!==null)return r;let i=n?.getItem(ss)??null;return i===null?null:(a?.setItem(ss,i),n?.removeItem(ss),i)}function u1(e,t,a){let n=t??Ac("local"),r=a??Ac("session");n?.setItem(ss,e),r?.removeItem(ss)}function f1(e,t){let a=e??Ac("local"),n=t??Ac("session");a?.removeItem(ss),n?.removeItem(ss)}function p1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ei(e){return typeof e=="string"&&e.trim().length>0}function Um(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function m1(e){return e.status==="refused"&&Ei(e.reason)&&Ei(e.nextAction)?{status:"refused",reason:e.reason,nextAction:e.nextAction}:null}function g1(e){return p1(e)?e.status==="refused"?m1(e):e.status!=="ready"||!Ei(e.activationId)||!Ei(e.candidateId)||!Ei(e.principleId)||!Ei(e.artificerTaskId)||!Ei(e.expectedArtifactId)||!Ei(e.expectedArtifactDigest)||!/^sha256:[a-f0-9]{64}$/.test(e.expectedArtifactDigest)||!Um(e.expectedBindingRevision)||!Um(e.expectedControlVersion)||!Um(e.expectedTaskRevisionEpoch)?null:{status:"ready",activationId:e.activationId,candidateId:e.candidateId,principleId:e.principleId,artificerTaskId:e.artificerTaskId,expectedArtifactId:e.expectedArtifactId,expectedArtifactDigest:e.expectedArtifactDigest,expectedBindingRevision:e.expectedBindingRevision,expectedControlVersion:e.expectedControlVersion,expectedTaskRevisionEpoch:e.expectedTaskRevisionEpoch}:null}function h1(e){return p1(e)?e.status==="refused"?m1(e):e.status!=="started"&&e.status!=="already_started"||!Ei(e.artificerTaskId)||!Ei(e.causeId)||!Um(e.taskRevisionEpoch)?null:{status:e.status,artificerTaskId:e.artificerTaskId,causeId:e.causeId,taskRevisionEpoch:e.taskRevisionEpoch}:null}function tn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Yr(e){return e===null||typeof e=="string"}function b1(e){return!tn(e)||typeof e.painId!="string"||!Yr(e.text)||typeof e.source!="string"||!Yr(e.createdAt)?null:{painId:e.painId,text:e.text,source:e.source,createdAt:e.createdAt}}var IU=["not_built","in_progress","blocked","advanced","ambiguous"];function AU(e){return typeof e=="string"&&IU.includes(e)}function v1(e){return e===null?null:!tn(e)||!AU(e.stage)||!Yr(e.stageKind)||!Yr(e.reasonCode)||!Yr(e.detail)?"invalid":{stage:e.stage,stageKind:e.stageKind,reasonCode:e.reasonCode,detail:e.detail}}function x1(e){return e===null?null:!tn(e)||e.status!=="ready"&&e.status!=="refused"||!Yr(e.reason)||!Yr(e.scribeTaskId)||!(e.taskRevisionEpoch===null||Bn(e.taskRevisionEpoch))?"invalid":{status:e.status,reason:e.reason,scribeTaskId:e.scribeTaskId,taskRevisionEpoch:e.taskRevisionEpoch}}function y1(e){return e===null?null:!tn(e)||e.status!=="ready"&&e.status!=="unavailable"||!Yr(e.reason)||!Yr(e.scribeTaskId)||!Yr(e.artificerTaskId)||!Yr(e.scribeArtifactDigest)||!(e.expectedBindingRevision===null||Bn(e.expectedBindingRevision))||e.status==="ready"&&(e.scribeTaskId===null||e.artificerTaskId===null||e.scribeArtifactDigest===null||e.expectedBindingRevision===null)?"invalid":{status:e.status,reason:e.reason,scribeTaskId:e.scribeTaskId,artificerTaskId:e.artificerTaskId,scribeArtifactDigest:e.scribeArtifactDigest,expectedBindingRevision:e.expectedBindingRevision}}function DU(e){return tn(e)?e.status==="unlinked"?{status:"unlinked"}:e.status==="binding_revoked"?{status:"binding_revoked"}:e.status==="attention"&&typeof e.reason=="string"?{status:"attention",reason:e.reason}:e.status==="bound"&&tn(e.principle)&&typeof e.principle.principleId=="string"&&typeof e.principle.text=="string"&&typeof e.principle.status=="string"&&Bn(e.principle.version)&&Bn(e.principle.revision)&&typeof e.principle.decidedAt=="string"?{status:"bound",principle:{principleId:e.principle.principleId,text:e.principle.text,status:e.principle.status,version:e.principle.version,revision:e.principle.revision,decidedAt:e.principle.decidedAt}}:null:null}function w1(e){if(!tn(e)||!Array.isArray(e.items)||typeof e.truncated!="boolean"||!tn(e.summary)||!Bn(e.summary.painGroups)||!Bn(e.summary.candidates)||!Bn(e.summary.bound)||!Bn(e.summary.unlinked)||!Bn(e.summary.blocked))return null;let t=[],a=new Set;for(let n of e.items){if(!tn(n)||typeof n.candidateId!="string"||typeof n.text!="string"||typeof n.diagnosisStatus!="string"||a.has(n.candidateId))return null;a.add(n.candidateId);let r=b1(n.pain),i=DU(n.binding),o=v1(n.generation),s=x1(n.resume),l=y1(n.sourceCorrection);if(!r||!i||o==="invalid"||s==="invalid"||l==="invalid"||!Object.hasOwn(n,"generation")||!Object.hasOwn(n,"resume")||!Object.hasOwn(n,"sourceCorrection"))return null;t.push({candidateId:n.candidateId,text:n.text,pain:r,diagnosisStatus:n.diagnosisStatus,binding:i,generation:o,resume:s,sourceCorrection:l})}return{items:t,summary:{painGroups:e.summary.painGroups,candidates:e.summary.candidates,bound:e.summary.bound,unlinked:e.summary.unlinked,blocked:e.summary.blocked},truncated:e.truncated}}function k1(e){if(!tn(e)||typeof e.candidateId!="string"||typeof e.candidateText!="string"||typeof e.evidence!="string"||typeof e.candidateDigest!="string"||!Bn(e.currentRevision)||typeof e.resumeNotice!="string"||!Array.isArray(e.eligibleTargets)||e.eligibleTargets.length>20)return null;let t=b1(e.sourcePain);if(!t)return null;let a=null;if(e.currentBinding!==null){let l=e.currentBinding;if(!tn(l)||l.action!=="bind"&&l.action!=="revoke"||typeof l.principleId!="string"||typeof l.reason!="string"||!Bn(l.revision))return null;a={action:l.action,principleId:l.principleId,reason:l.reason,revision:l.revision}}let n=null;if(e.boundPrinciple!==null){if(!tn(e.boundPrinciple)||typeof e.boundPrinciple.principleId!="string"||typeof e.boundPrinciple.text!="string"||typeof e.boundPrinciple.status!="string"||!Bn(e.boundPrinciple.version)||!Bn(e.boundPrinciple.revision)||typeof e.boundPrinciple.decidedAt!="string")return null;n={principleId:e.boundPrinciple.principleId,text:e.boundPrinciple.text,status:e.boundPrinciple.status,version:e.boundPrinciple.version,revision:e.boundPrinciple.revision,decidedAt:e.boundPrinciple.decidedAt}}let r=[];for(let l of e.eligibleTargets){if(!tn(l)||typeof l.principleId!="string"||typeof l.text!="string"||typeof l.status!="string"||!Bn(l.version)||typeof l.digest!="string")return null;r.push({principleId:l.principleId,text:l.text,status:l.status,version:l.version,digest:l.digest})}if(!Object.hasOwn(e,"generation")||!Object.hasOwn(e,"resume")||!Object.hasOwn(e,"sourceCorrection"))return null;let i=v1(e.generation),o=x1(e.resume),s=y1(e.sourceCorrection);return i==="invalid"||o==="invalid"||s==="invalid"?null:{candidateId:e.candidateId,candidateText:e.candidateText,sourcePain:t,evidence:e.evidence,candidateDigest:e.candidateDigest,currentRevision:e.currentRevision,currentBinding:a,boundPrinciple:n,eligibleTargets:r,generation:i,resume:o,sourceCorrection:s,resumeNotice:e.resumeNotice}}function S1(e){return!tn(e)||!["bound","already_bound","revoked","already_revoked"].includes(String(e.status))||typeof e.status!="string"||e.runtimeDeactivated!==!1||e.inFlightOperationsMayComplete!==!0||e.nextAction!==void 0&&typeof e.nextAction!="string"||e.revision!==void 0&&(!tn(e.revision)||typeof e.revision.status!="string")?null:{status:e.status,...tn(e.revision)&&typeof e.revision.status=="string"?{revisionStatus:e.revision.status}:{},...typeof e.nextAction=="string"?{nextAction:e.nextAction}:{}}}function jx(e){return!tn(e)||typeof e.status!="string"||e.status.length===0||e.reason!==void 0&&typeof e.reason!="string"||e.nextAction!==void 0&&typeof e.nextAction!="string"?null:{status:e.status,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.nextAction=="string"?{nextAction:e.nextAction}:{}}}function Hm(){return d1()}function Iu(e){u1(e)}function so(){f1()}function LU(e){return!(e==="#/login"||e.startsWith("#/login?"))}function NU(e,t){return t===e}async function J(e,t,a){let n=Hm(),r={"Content-Type":"application/json"};n&&(r.Authorization=`Bearer ${n}`);try{let i=await fetch(e,{...t,headers:{...r,...bD(t?.headers)??{}}});if(!i.ok){i.status===401&&NU(n,Hm())&&(so(),LU(window.location.hash)&&(window.location.hash="#/login?session_expired=true"));let l=`HTTP ${i.status}`,c,u,d;try{let f=await i.json(),m=hD(f);m&&(m.message?l=m.message:m.error&&(l=m.error),m.error&&({error:c}=m),m.reason&&({reason:d}=m),m.nextAction&&({nextAction:u}=m))}catch{}return{success:!1,error:l,code:c,reason:d,nextAction:u,status:i.status}}let o=await i.json(),s=o&&typeof o=="object"&&Object.hasOwn(o,"success")&&Object.hasOwn(o,"data")?o.data:o;if(a){let l=a(s);return l!==null?{success:!0,data:l}:{success:!1,error:"Response validation failed: unexpected data shape from server",nextAction:"Try refreshing the page. If the problem persists, report it."}}return{success:!0,data:s}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Network error"}}}async function Au(){return(await J("/api/health")).success}function Du(){return J("/api/v1/governance/rule-candidate-bindings",void 0,w1)}function C1(e,t=""){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/review?search=${encodeURIComponent(t)}`,void 0,k1)}function R1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)},S1)}function I1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/revise-once`,{method:"POST",body:JSON.stringify(t)},jx)}function A1(e,t){return J(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(e)}/source-correct-once`,{method:"POST",body:JSON.stringify(t)},jx)}async function zm(){return J("/api/workspaces",void 0,SD)}async function D1(e,t){return J("/api/workspaces",{method:"POST",body:JSON.stringify({name:e,path:t})},Px)}async function L1(e){return J(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"},CD)}async function N1(e){return J(`/api/workspaces/${encodeURIComponent(e)}/sync`,{method:"POST"},RD)}async function qm(e){let t=e===void 0?"":`?filter=${e}`;return J(`/api/principles${t}`,void 0,Bm)}async function E1(){return J("/api/principles/core",void 0,jD)}async function O1(e){return J(`/api/principles/${encodeURIComponent(e)}`)}async function T1(e){return J(`/api/v1/principles/${encodeURIComponent(e)}/governance`,void 0,sD)}async function Vm(e){return J(`/api/v1/principles/${encodeURIComponent(e)}/owner-decision-view`,void 0,cD)}async function P1(){return J("/api/v1/principles/owner-decision-inbox",void 0,dD)}async function _1(){return J("/api/v1/principles/owner-decision-library",void 0,uD)}async function B1(e){return J(`/api/principles/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function M1(e){return J(`/api/principles/${encodeURIComponent(e)}/unarchive`,{method:"POST"})}async function F1(e){return J(`/api/principles/${encodeURIComponent(e)}/trajectory`,void 0,ZD)}var EU=new Set(["available","disabled","unavailable"]),OU=new Set(["valid","partial","malformed"]);function Hx(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.sourceStatus!="string"||!EU.has(t.sourceStatus)||typeof t.validationStatus!="string"||!OU.has(t.validationStatus)||t.observedFrom!==null&&typeof t.observedFrom!="string"||typeof t.asOf!="string"||typeof t.retentionPolicyDays!="number"?null:{sourceStatus:t.sourceStatus,validationStatus:t.validationStatus,observedFrom:t.observedFrom,asOf:t.asOf,retentionPolicyDays:t.retentionPolicyDays,...typeof t.reasonCode=="string"?{reasonCode:t.reasonCode}:{},...typeof t.nextActionCode=="string"?{nextActionCode:t.nextActionCode}:{}}}var TU=new Set(["rule_blocked","auto_correct_applied","self_reported","prompt_injected"]);function PU(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.kind!="string"||!TU.has(t.kind)||t.level!=="effect"&&t.level!=="presence"||typeof t.createdAt!="string")return null;let a=n=>typeof n=="string"&&n.length>0?n:null;return{kind:t.kind,level:t.level,sessionId:a(t.sessionId),toolName:a(t.toolName),filePath:a(t.filePath),digest:a(t.digest),createdAt:t.createdAt}}function _U(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.principleId!="string")return null;let a=Hx(t.coverage);if(a===null)return null;let n=[];if(Array.isArray(t.events))for(let r of t.events){let i=PU(r);i&&n.push(i)}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,principleId:t.principleId,effectCount:typeof t.effectCount=="number"?t.effectCount:0,presenceCount:typeof t.presenceCount=="number"?t.presenceCount:0,lastEffectAt:typeof t.lastEffectAt=="string"?t.lastEffectAt:null,events:n,coverage:a}}function BU(e){if(typeof e!="object"||e===null)return null;let t=e,a=Hx(t.coverage);if(a===null)return null;let n=[];if(Array.isArray(t.counts))for(let r of t.counts){if(typeof r!="object"||r===null)continue;let i=r;typeof i.principleId=="string"&&n.push({principleId:i.principleId,effectCount:typeof i.effectCount=="number"?i.effectCount:0,presenceCount:typeof i.presenceCount=="number"?i.presenceCount:0,lastEffectAt:typeof i.lastEffectAt=="string"?i.lastEffectAt:null})}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,counts:n,coverage:a}}async function U1(e){return J(`/api/v1/receipts/principles/${encodeURIComponent(e)}`,void 0,_U)}async function j1(){return J("/api/v1/receipts/counts",void 0,BU)}var MU=new Set(["delivery","application","behavior_episode","effect","outcome"]);function jm(e){let t=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d{1,3}))?Z$/.exec(e);return t!==null&&Number.isFinite(Date.parse(e))&&new Date(Date.parse(e)).toISOString()===`${t[1]}.${(t[2]??"").padEnd(3,"0")}Z`}function FU(e){let t=typeof e.payload=="object"&&e.payload!==null?e.payload:null;if(t===null)return null;let{kind:a}=e;return a==="delivery"?{summary:`${String(t.confirmation??"?")} / ${String(t.outcome??"?")}`,detail:`target: ${String(t.targetKind??"?")}${typeof t.failureReason=="string"?` \u2014 ${t.failureReason}`:""}`}:a==="application"?{summary:String(t.proofMethod??"?"),detail:String(t.action??"?")+(typeof t.claimText=="string"?` \u2014 ${t.claimText}`:"")}:a==="behavior_episode"?{summary:String(t.status??"?"),detail:String(t.actionSummary??"?")+(typeof t.resultSummary=="string"?` \u2192 ${t.resultSummary}`:"")}:a==="effect"?{summary:String(t.status??"?"),detail:String(t.observationSummary??"?")}:{summary:String(t.outcomeSource??"?"),detail:String(t.observationSummary??"?")}}function UU(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.evidenceId!="string"||t.evidenceId.length===0||t.evidenceId.length>256||typeof t.kind!="string"||!MU.has(t.kind)||typeof t.observationKey!="string"||t.observationKey.length===0||t.observationKey.length>256||typeof t.recordedAt!="string"||!jm(t.recordedAt)||t.occurredAt!==void 0&&(typeof t.occurredAt!="string"||!jm(t.occurredAt))||t.associationStatus!=="linked"&&t.associationStatus!=="pending_association"||t.sourceStatus!==void 0&&t.sourceStatus!=="unknown"||t.contentRedactedAt!==void 0&&(typeof t.contentRedactedAt!="string"||!jm(t.contentRedactedAt)))return null;let a=typeof t.nativeRefs=="object"&&t.nativeRefs!==null?t.nativeRefs:null;if(!a||a.hostKind!=="openclaw"&&a.hostKind!=="codex"||["sessionId","runId","turnId","toolCallId","toolName","rolloutIdentity"].some(l=>Object.hasOwn(a,l)&&(typeof a[l]!="string"||a[l].length===0||a[l].length>256)))return null;let n=Object.hasOwn(t,"contentRef"),r=typeof t.contentRef=="object"&&t.contentRef!==null&&!Array.isArray(t.contentRef)?t.contentRef:null;if(n&&r===null||r&&(typeof r.principleId!="string"||r.principleId.length===0||r.principleId.length>256||r.resolution!=="resolved"&&r.resolution!=="revision_reference_unresolved"||r.payloadDigest!==void 0&&(typeof r.payloadDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(r.payloadDigest))||r.resolution==="resolved"&&typeof r.payloadDigest!="string"||typeof t.principleId=="string"&&r.principleId!==t.principleId||["artifactId","version","approvalRef"].some(l=>Object.hasOwn(r,l)&&(typeof r[l]!="string"||r[l].length===0||r[l].length>256))))return null;let i=Object.hasOwn(t,"activationRef"),o=typeof t.activationRef=="object"&&t.activationRef!==null&&!Array.isArray(t.activationRef)?t.activationRef:null;if(i&&o===null||o&&(typeof o.activationId!="string"||o.activationId.length===0||o.activationId.length>256||typeof o.sourceSnapshotDigest!="string"||!/^sha256:[a-f0-9]{64}$/.test(o.sourceSnapshotDigest)||o.activationId!==t.activationId||o.activatedAt!==void 0&&(typeof o.activatedAt!="string"||!jm(o.activatedAt))||["idempotencyKey","artifactId","channel"].some(l=>Object.hasOwn(o,l)&&(typeof o[l]!="string"||o[l].length===0||o[l].length>256)))||r&&o&&typeof r.artifactId=="string"&&typeof o.artifactId=="string"&&r.artifactId!==o.artifactId||r&&o&&typeof t.occurredAt=="string"&&typeof o.activatedAt=="string"&&Date.parse(o.activatedAt)>Date.parse(t.occurredAt))return null;let s=FU(t);return s===null?null:{evidenceId:t.evidenceId,kind:t.kind,observationKey:t.observationKey,recordedAt:t.recordedAt,occurredAt:typeof t.occurredAt=="string"?t.occurredAt:void 0,principleId:typeof t.principleId=="string"?t.principleId:void 0,activationId:typeof t.activationId=="string"?t.activationId:void 0,episodeKey:typeof t.episodeKey=="string"?t.episodeKey:void 0,effectKey:typeof t.effectKey=="string"?t.effectKey:void 0,associationStatus:t.associationStatus,...t.sourceStatus==="unknown"?{sourceStatus:"unknown"}:{},...typeof t.contentRedactedAt=="string"?{contentRedactedAt:t.contentRedactedAt}:{},...r?{contentReference:{principleId:String(r.principleId),resolution:r.resolution,...typeof r.payloadDigest=="string"?{payloadDigest:r.payloadDigest}:{},...typeof r.artifactId=="string"?{artifactId:r.artifactId}:{},...typeof r.version=="string"?{version:r.version}:{},...typeof r.approvalRef=="string"?{approvalRef:r.approvalRef}:{}}}:{},...o?{activationReference:{activationId:String(o.activationId),sourceSnapshotDigest:String(o.sourceSnapshotDigest),...typeof o.activatedAt=="string"?{activatedAt:o.activatedAt}:{},...typeof o.idempotencyKey=="string"?{idempotencyKey:o.idempotencyKey}:{},...typeof o.artifactId=="string"?{artifactId:o.artifactId}:{},...typeof o.channel=="string"?{channel:o.channel}:{}}}:{},nativeLineage:[`hostKind=${a.hostKind}`,...Object.entries(a).filter(([l,c])=>l!=="hostKind"&&typeof c=="string").map(([l,c])=>`${l}=${String(c)}`)].slice(0,7),summary:s.summary,detail:s.detail}}function jU(e){if(typeof e!="object"||e===null)return null;let t=e,a=Hx(t.coverage);if(a===null)return null;let n=["delivery","application","behavior_episode","effect","outcome"],r={};if(typeof t.pages!="object"||t.pages===null)return null;let i=t.pages;for(let c of n){let u=i[c];if(typeof u!="object"||u===null)return null;let d=u;if(typeof d.hasMore!="boolean")return null;let f=null;if(d.nextCursor!==null){if(typeof d.nextCursor!="object"||d.nextCursor===null)return null;let m=d.nextCursor;if(typeof m.recordedAt!="string"||typeof m.evidenceId!="string")return null;f={recordedAt:m.recordedAt,evidenceId:m.evidenceId}}r[c]={hasMore:d.hasMore,nextCursor:f}}let o={};for(let c of["deliveries","applications","episodes","effects","outcomes"]){let u=[];if(!Array.isArray(t[c]))return null;for(let d of t[c]){let f=UU(d);if(!f)return null;u.push(f)}o[c]=u}let s=[];if(Array.isArray(t.unresolvedReferences))for(let c of t.unresolvedReferences){if(typeof c!="object"||c===null)continue;let u=c;typeof u.evidenceId=="string"&&typeof u.missingKey=="string"&&typeof u.field=="string"&&s.push({evidenceId:u.evidenceId,missingKey:u.missingKey,field:u.field})}let l=[];if(Array.isArray(t.capabilityDeclarations))for(let c of t.capabilityDeclarations){if(typeof c!="object"||c===null)continue;let u=c;u.hostKind!=="openclaw"&&u.hostKind!=="codex"||u.status!=="supported"&&u.status!=="unsupported"&&u.status!=="unknown"||typeof u.capability!="string"||typeof u.adapterVersion!="string"||typeof u.channel!="string"||l.push({hostKind:u.hostKind,capability:u.capability,status:u.status,adapterVersion:u.adapterVersion,channel:u.channel,...typeof u.note=="string"?{note:u.note}:{}})}return{status:t.status==="ok"?"ok":"degraded",reason:typeof t.reason=="string"?t.reason:void 0,nextAction:typeof t.nextAction=="string"?t.nextAction:void 0,deliveries:o.deliveries??[],applications:o.applications??[],episodes:o.episodes??[],effects:o.effects??[],outcomes:o.outcomes??[],pages:r,unresolvedReferences:s,capabilityDeclarations:l,coverage:a}}async function zx(e,t,a){let n=new URLSearchParams({type:e,id:t});return a&&(n.set("afterKind",a.kind),n.set("afterRecordedAt",a.after.recordedAt),n.set("afterEvidenceId",a.after.evidenceId)),J(`/api/v1/receipts/evidence-audit?${n.toString()}`,void 0,jU)}function H1(e){return J("/api/v1/approvals/"+encodeURIComponent(e),void 0,c1)}async function z1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/approve",{method:"POST",body:JSON.stringify({note:t,...a?.expectedReview===void 0?{}:{expectedReview:a.expectedReview},...a?.targetHost!==void 0?{host:a.targetHost}:{},...a?.intentReviewed!==void 0?{intentReviewed:a.intentReviewed,reviewedArtifactId:a.reviewedArtifactId}:{}})},Ic)}async function q1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/reject",{method:"POST",body:JSON.stringify({reason:t,...a===void 0?{}:{expectedReview:a}})},Ic)}async function V1(e,t,a){return J("/api/v1/approvals/"+encodeURIComponent(e)+"/edit",{method:"POST",body:JSON.stringify({newArtifactId:t,editReason:typeof a=="string"?a:a.reason,...typeof a=="string"?{}:{expectedReview:a.expectedReview}})},Ic)}async function G1(e,t){return J("/api/feedback/reports",{method:"POST",body:JSON.stringify({input:e,diagnostics:t??{}})},vD)}async function $1(){return J("/api/feedback/reports",void 0,e=>{let t=xD(e);return t===null?null:{drafts:t}})}async function qx(e){return J("/api/feedback/reports/"+encodeURIComponent(e),void 0,yD)}async function W1(e){return J("/api/feedback/reports/"+encodeURIComponent(e),{method:"DELETE"},wD)}async function K1(){return J("/api/feedback/submit/channels",void 0,kD)}async function Y1(e,t){return J("/api/feedback/reports/"+encodeURIComponent(e)+"/submit",{method:"POST",body:JSON.stringify({channel:t})},Tx)}async function X1(e,t){return J("/api/feedback/reports/"+encodeURIComponent(e)+"/mark-sent",{method:"POST",body:JSON.stringify({via:t})},Tx)}async function Zr(){return J("/api/v1/config/summary",void 0,DD)}async function Z1(){return J("/api/v1/config/catalog",void 0,LD)}async function Q1(e,t,a){return J(`/api/v1/config/agents/${encodeURIComponent(e)}/binding`,{method:"PATCH",body:JSON.stringify({runtimeProfile:t,enabled:a})},ND)}async function J1(e){return J("/api/v1/config/default-runtime",{method:"PATCH",body:JSON.stringify({defaultRuntime:e})},TD)}async function Gm(){return J("/api/v1/owner-identity",void 0,r1)}async function eL(e,t){return J("/api/v1/owner-identity",{method:"POST",body:JSON.stringify({ownerId:e,credentialId:t})},i1)}async function tL(){return J("/api/v1/owner-identity",{method:"DELETE"},o1)}async function aL(e,t){return J("/api/v1/config/profiles",{method:"POST",body:JSON.stringify({id:e,profile:t})},Om)}async function nL(e,t){return J(`/api/v1/config/profiles/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)},Om)}async function rL(e){return J(`/api/v1/config/profiles/${encodeURIComponent(e)}`,{method:"DELETE"},Om)}async function iL(e){return J(`/api/v1/config/readiness/${encodeURIComponent(e)}`,void 0,OD)}async function Lu(e,t){return J(`/api/v1/config/features/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({enabled:t})},ED)}async function oL(){return J("/api/v1/config/principles/output-language",void 0,Fx)}async function sL(e){return J("/api/v1/config/principles/output-language",{method:"PATCH",body:JSON.stringify({outputLanguage:e})},Fx)}async function Lc(){return J("/api/v1/governance/queue",void 0,Tm)}async function lL(){return J("/api/v1/governance/experience",void 0,gD)}async function cL(e,t,a){let n={};return t!==void 0&&t.length>0&&(n.reason=t),a===!0&&(n.force=!0),J("/api/v1/failed-tasks/"+encodeURIComponent(e)+"/recover",{method:"POST",body:JSON.stringify(n)},_D)}async function dL(e){return J("/api/v1/failed-tasks/"+encodeURIComponent(e),void 0,PD)}async function $m(){return J("/api/v1/governance/owner-decisions",void 0,s1)}async function uL(e,t){return J("/api/v1/governance/owner-decisions/"+encodeURIComponent(e)+"/resolve",{method:"POST",body:JSON.stringify(t)},l1)}async function Nc(e){let t=e!==void 0?`?host=${e}`:"";return J(`/api/v1/approvals/grouped${t}`,void 0,HD)}async function ls(e){let t=e!==void 0?`?host=${e}`:"";return J(`/api/v1/activations${t}`,void 0,Pm)}async function Ec(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/disable`,{method:"POST",body:JSON.stringify({confirmed:!0})},FD)}async function fL(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/owner-review`,void 0,BD)}async function pL(e){return J(`/api/v1/activations/${encodeURIComponent(e)}/rule-revision-preview`,void 0,g1)}async function mL(e,t){return J(`/api/v1/activations/${encodeURIComponent(e)}/revise-rule-once`,{method:"POST",body:JSON.stringify(t)},h1)}async function gL(e,t,a){return J(`/api/v1/activations/${encodeURIComponent(e)}/propose-revision`,{method:"POST",body:JSON.stringify({statement:t,...a!==void 0?{host:a}:{}})},n=>{if(typeof n!="object"||n===null||Array.isArray(n))return null;let r=n;if(r.ok!==!0&&r.ok!==!1)return null;let i={ok:r.ok};return typeof r.alreadyPending=="boolean"&&(i.alreadyPending=r.alreadyPending),typeof r.newArtifactId=="string"&&(i.newArtifactId=r.newArtifactId),typeof r.approvalId=="string"&&(i.approvalId=r.approvalId),typeof r.supersededActivationId=="string"&&(i.supersededActivationId=r.supersededActivationId),typeof r.oldStatement=="string"&&(i.oldStatement=r.oldStatement),typeof r.newStatement=="string"&&(i.newStatement=r.newStatement),typeof r.title=="string"&&(i.title=r.title),typeof r.reason=="string"&&(i.reason=r.reason),typeof r.nextAction=="string"&&(i.nextAction=r.nextAction),typeof r.error=="string"&&(i.error=r.error),i})}async function Vx(e,t){return J(e,{method:"POST",body:JSON.stringify(t)},MD)}function hL(e,t,a){return Vx(`/api/v1/activations/${encodeURIComponent(e)}/${t}`,a)}function bL(e){return Vx("/api/v1/activations/emergency-pause",e)}function vL(e,t){return Vx(`/api/v1/activations/emergency-pause/${encodeURIComponent(e)}/release`,t)}async function Wm(e){return J(`/api/v1/lifecycle/principles/${encodeURIComponent(e)}`,void 0,UD)}async function Gx(){return J("/api/update/check",void 0,Cu)}async function xL(){return J("/api/update/history",void 0,_m)}async function yL(){return J("/api/update/apply-full",{method:"POST",body:JSON.stringify({})},XD)}async function wL(){return J("/api/update/recovery",void 0,Mm)}async function kL(e){return J(`/api/update/transaction/${encodeURIComponent(e)}`,void 0,Fm)}async function SL(){return J("/api/v1/evidence-chain",void 0,YD)}async function CL(e="zh-CN"){return J(`/api/v1/intent?lang=${e}`,void 0,JD)}async function $x(e="zh-CN"){return J(`/api/v1/intent/content?lang=${e}`,void 0,e1)}async function Wx(e=!1,t="zh-CN"){return J(`/api/v1/intent/init?lang=${t}`,{method:"POST",body:JSON.stringify({force:e})},t1)}async function Kx(e,t="zh-CN"){return J(`/api/v1/intent/content?lang=${t}`,{method:"PUT",body:JSON.stringify({content:e})},a1)}async function RL(e="zh-CN"){return J(`/api/v1/intent/versions?lang=${e}`,void 0,n1)}async function IL(e){return J("/api/v1/intent-decisions",{method:"POST",body:JSON.stringify(e)},$D)}async function AL(e){return J(`/api/v1/intent-decisions?painId=${encodeURIComponent(e)}`,void 0,Mx)}async function DL(e){return J(`/api/v1/intent-decisions?taskId=${encodeURIComponent(e)}`,void 0,Mx)}async function LL(){return J("/api/v1/intent-decisions/summary",void 0,WD)}async function NL(e,t){return J(`/api/v1/intent-decisions/${encodeURIComponent(e)}/follow-up`,{method:"POST",body:JSON.stringify(t)},KD)}function Dc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function HU(e){if(!Dc(e)||!Array.isArray(e.sessions))return null;let t=[];for(let a of e.sessions){if(!Dc(a)||typeof a.projectWorkspacePath!="string"||a.projectWorkspacePath.trim()===""||typeof a.hostSessionId!="string"||a.hostSessionId.trim()==="")return null;t.push({projectWorkspacePath:a.projectWorkspacePath,hostSessionId:a.hostSessionId})}return{sessions:t}}function zU(e){return e==="read"||e==="write"||e==="execute"}function qU(e){return e==="approved"||e==="not_approved"||e==="not_required"}function Xr(e){return typeof e=="string"&&e.trim().length>0}function VU(e){if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t+=1)if(!Object.hasOwn(e,t)||!Xr(e[t]))return!1;return!0}function GU(e){if(!Dc(e)||!Object.hasOwn(e,"sourceRef")||!Xr(e.sourceRef)||!Xr(e.governanceWorkspacePath)||!Xr(e.projectWorkspacePath)||!Xr(e.hostSessionId)||!Xr(e.taskRef)||!Xr(e.specPath)||!Xr(e.specDigest)||!Dc(e.scope)||!Object.hasOwn(e.scope,"paths")||!Object.hasOwn(e.scope,"actions")||!VU(e.scope.paths)||e.scope.paths.length===0||!Array.isArray(e.scope.actions)||e.scope.actions.length===0)return!1;for(let t=0;t<e.scope.actions.length;t+=1)if(!Object.hasOwn(e.scope.actions,t)||!zU(e.scope.actions[t]))return!1;return!(!qU(e.decision)||typeof e.revision!="number"||!Number.isSafeInteger(e.revision)||e.revision<1||typeof e.revoked!="boolean"||!Dc(e.actor)||!Object.hasOwn(e.actor,"ownerId")||!Object.hasOwn(e.actor,"credentialId")||!Xr(e.actor.ownerId)||!Xr(e.actor.credentialId)||!Xr(e.decidedAt))}function Km(e){return!Dc(e)||!Object.hasOwn(e,"declaration")?null:e.declaration===null?{declaration:null}:GU(e.declaration)?{declaration:e.declaration}:null}var Nu="/api/v1/governance/design-gate";async function EL(){return J(`${Nu}/sessions`,void 0,HU)}async function OL(e,t){let a=new URLSearchParams({projectWorkspacePath:e,hostSessionId:t});return J(`${Nu}/declaration?${a.toString()}`,void 0,Km)}async function TL(e){return J(`${Nu}/declarations`,{method:"POST",body:JSON.stringify(e)},Km)}async function PL(e,t,a){return J(`${Nu}/declarations/${encodeURIComponent(e)}/decision`,{method:"POST",body:JSON.stringify({expectedRevision:t,decision:a})},Km)}async function _L(e,t){return J(`${Nu}/declarations/${encodeURIComponent(e)}/revoke`,{method:"POST",body:JSON.stringify({expectedRevision:t})},Km)}async function Yx(){return J("/api/v1/examiner/overview",void 0,e=>e!==null&&typeof e=="object"&&Object.hasOwn(e,"studies")?e:null)}async function Ym(){return J("/api/v1/examiner/principles",void 0,e=>e&&typeof e=="object"&&Array.isArray(e.principles)?e:null)}async function BL(e){return J("/api/v1/examiner/studies",{method:"POST",body:JSON.stringify(e)},t=>t&&typeof t.studyId=="string"?t:null)}async function Xm(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}`,void 0,t=>t&&typeof t.studyId=="string"?t:null)}async function ML(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/preflight`,{method:"POST"},t=>t&&typeof t.ok=="boolean"?t:null)}async function FL(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({mode:"offline-stub"})},t=>t&&Array.isArray(t.units)?t:null)}async function UL(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/report`,{method:"POST"},t=>t&&typeof t.status=="string"?t:null)}async function Xx(e){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/report`,void 0,t=>t&&t.report?t:null)}async function Eu(e){return J(`/api/v1/examiner/principles/${encodeURIComponent(e)}/evidence`,void 0,t=>t&&typeof t.principleId=="string"&&t.principle?t:null)}async function jL(){return J("/api/v1/examiner/suites",void 0,e=>e&&Array.isArray(e.suites)?e:null)}async function HL(){return J("/api/v1/examiner/hosts/openclaw/readiness",void 0,e=>e&&typeof e.host=="string"&&Array.isArray(e.requirements)?e:null)}async function zL(e,t){return J(`/api/v1/examiner/studies/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({mode:t})},a=>a&&typeof a.runId=="string"?a:null)}var Oi=D(ee(),1),$U={pending:{waveform:"sine",frequency:880,durationMs:150,volume:.3},degraded:{waveform:"triangle",frequency:440,durationMs:200,volume:.3}};function qL(){let[e,t]=(0,Oi.useState)(!1),a=(0,Oi.useRef)(null),n=(0,Oi.useRef)(!0);(0,Oi.useEffect)(()=>()=>{n.current=!1;let o=a.current;a.current=null,o&&o.state!=="closed"&&o.close().catch(s=>{console.warn("Failed to close notification audio context:",s)})},[]);let r=(0,Oi.useCallback)(()=>{if(!e&&!(typeof window>"u"||!window.AudioContext))try{let o=a.current??new AudioContext;a.current=o,o.state==="suspended"?o.resume().then(()=>{n.current&&t(!0)}).catch(()=>{}):n.current&&t(!0)}catch(o){console.warn("Failed to unlock audio:",o)}},[e]);return{playSound:(0,Oi.useCallback)(o=>{if(e&&!(typeof window>"u"||!window.AudioContext))try{let s=a.current??new AudioContext;if(a.current=s,s.state==="suspended"){s.resume().catch(()=>{});return}let l=$U[o],c=s.createOscillator(),u=s.createGain();c.type=l.waveform,c.frequency.setValueAtTime(l.frequency,s.currentTime),u.gain.setValueAtTime(l.volume,s.currentTime),u.gain.exponentialRampToValueAtTime(.001,s.currentTime+l.durationMs/1e3),c.connect(u),u.connect(s.destination),c.start(s.currentTime),c.stop(s.currentTime+l.durationMs/1e3)}catch(s){console.warn("Failed to play notification sound:",s)}},[e]),unlockAudio:r,audioUnlocked:e}}function Zx(e,t){return t===null?{pendingIncreased:!1,degradedIncreased:!1}:{pendingIncreased:e.pendingCount>t.pendingCount,degradedIncreased:e.degradedCount>t.degradedCount}}var VL="pd-sound-enabled";function GL(){if(typeof window>"u")return null;try{return window.localStorage}catch(e){return console.warn("Sound preference storage is unavailable:",e),null}}function $L(){let e=GL();if(!e)return!0;try{let t=e.getItem(VL);return t===null?!0:t==="true"}catch(t){return console.warn("Failed to read sound preference:",t),!0}}function WL(e){let t=GL();if(t)try{t.setItem(VL,String(e))}catch(a){console.warn("Failed to save sound preference:",a)}}var KL="PD Console";var Qx="pd-dynamic-favicon";function WU(e){e.fillStyle="#1a1a1a",e.fillRect(0,0,32,32),e.fillStyle="#d4a853",e.font="bold 14px sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("PD",32/2,32/2)}function KU(e){e.fillStyle="#dc2626",e.beginPath(),e.arc(26,6,5,0,Math.PI*2),e.fill()}function YU(e){if(typeof document>"u")return"";let t=document.createElement("canvas");t.width=32,t.height=32;let a=t.getContext("2d");return a?(WU(a),e>0&&KU(a),t.toDataURL("image/png")):""}function YL(e,t){if(typeof document>"u")return;let a=e+t;document.title=a>0?`(${a}) PD Governance Workspace`:KL;let n=document.getElementById(Qx),r=n instanceof HTMLLinkElement?n:null;r||(n?.remove(),r=document.createElement("link"),r.id=Qx,r.rel="icon",r.type="image/png",document.head.appendChild(r));let i=YU(a);i&&(r.href=i)}function XL(){typeof document>"u"||(document.title=KL,document.getElementById(Qx)?.remove())}var QL=D(W(),1),XU=3e4,Jx=(0,Ca.createContext)(null);function ZL({children:e}){let[t,a]=(0,Ca.useState)({pendingCount:0,degradedCount:0,soundEnabled:$L()}),{playSound:n,unlockAudio:r,audioUnlocked:i}=qL(),o=(0,Ca.useRef)(null),s=(0,Ca.useRef)(!1),l=(0,Ca.useRef)(!1),c=(0,Ca.useRef)(!1),u=(0,Ca.useRef)(!1),d=(0,Ca.useCallback)(m=>{WL(m),a(p=>({...p,soundEnabled:m}))},[]),f=(0,Ca.useCallback)(async()=>{if(!l.current){l.current=!0;try{let m=await Lc();if(!m.success){console.warn("Notification poll failed:",m.error);return}let p=m.data.degradedSignals?.length??0,b=await $m(),v=b.success?b.data.total:m.data.pendingReviewCount;s.current=!0,a(g=>({...g,pendingCount:v,degradedCount:p}))}finally{l.current=!1}}},[]);return(0,Ca.useEffect)(()=>{f();let m=setInterval(f,XU);return()=>clearInterval(m)},[f]),(0,Ca.useEffect)(()=>{if(!s.current)return;if(typeof document<"u"&&document.hidden){let p=Zx(t,o.current);t.soundEnabled&&p.pendingIncreased&&(c.current=!0),t.soundEnabled&&p.degradedIncreased&&(u.current=!0),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount};return}if(!t.soundEnabled||!i){t.soundEnabled||(c.current=!1,u.current=!1),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount};return}let m=Zx(t,o.current);(m.pendingIncreased||c.current)&&(n("pending"),c.current=!1),(m.degradedIncreased||u.current)&&(n("degraded"),u.current=!1),o.current={pendingCount:t.pendingCount,degradedCount:t.degradedCount}},[t,n,i]),(0,Ca.useEffect)(()=>{YL(t.pendingCount,t.degradedCount)},[t.pendingCount,t.degradedCount]),(0,Ca.useEffect)(()=>()=>{XL()},[]),(0,Ca.useEffect)(()=>{if(typeof window>"u")return;let m=()=>{r()};return window.addEventListener("click",m,{once:!0}),window.addEventListener("keydown",m,{once:!0}),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",m)}},[r]),(0,Ca.useEffect)(()=>{if(typeof document>"u")return;let m=()=>{document.hidden||f()};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[f]),(0,QL.jsx)(Jx.Provider,{value:{...t,setSoundEnabled:d,audioUnlocked:i},children:e})}function Zm(){let e=(0,JL.useContext)(Jx);if(!e)throw new Error("useNotifications must be used within NotificationProvider");return e}function eN(e){var t,a,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=eN(e[t]))&&(n&&(n+=" "),n+=a)}else for(a in e)e[a]&&(n&&(n+=" "),n+=a);return n}function Qm(){for(var e,t,a=0,n="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=eN(e))&&(n&&(n+=" "),n+=t);return n}var ZU=(e,t)=>{let a=new Array(e.length+t.length);for(let n=0;n<e.length;n++)a[n]=e[n];for(let n=0;n<t.length;n++)a[e.length+n]=t[n];return a},QU=(e,t)=>({classGroupId:e,validator:t}),oN=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var tN=[],JU="arbitrary..",ej=e=>{let t=aj(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return tj(o);let s=o.split("-"),l=s[0]===""&&s.length>1?1:0;return sN(s,l,t)},getConflictingClassGroupIds:(o,s)=>{if(s){let l=n[o],c=a[o];return l?c?ZU(c,l):l:c||tN}return a[o]||tN}}},sN=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let r=e[t],i=a.nextPart.get(r);if(i){let c=sN(e,t+1,i);if(c)return c}let o=a.validators;if(o===null)return;let s=t===0?e.join("-"):e.slice(t).join("-"),l=o.length;for(let c=0;c<l;c++){let u=o[c];if(u.validator(s))return u.classGroupId}},tj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(":"),n=t.slice(0,a);return n?JU+n:void 0})(),aj=e=>{let{theme:t,classGroups:a}=e;return nj(a,t)},nj=(e,t)=>{let a=oN();for(let n in e){let r=e[n];ty(r,a,n,t)}return a},ty=(e,t,a,n)=>{let r=e.length;for(let i=0;i<r;i++){let o=e[i];rj(o,t,a,n)}},rj=(e,t,a,n)=>{if(typeof e=="string"){ij(e,t,a);return}if(typeof e=="function"){oj(e,t,a,n);return}sj(e,t,a,n)},ij=(e,t,a)=>{let n=e===""?t:lN(t,e);n.classGroupId=a},oj=(e,t,a,n)=>{if(lj(e)){ty(e(n),t,a,n);return}t.validators===null&&(t.validators=[]),t.validators.push(QU(a,e))},sj=(e,t,a,n)=>{let r=Object.entries(e),i=r.length;for(let o=0;o<i;o++){let[s,l]=r[o];ty(l,lN(t,s),a,n)}},lN=(e,t)=>{let a=e,n=t.split("-"),r=n.length;for(let i=0;i<r;i++){let o=n[i],s=a.nextPart.get(o);s||(s=oN(),a.nextPart.set(o,s)),a=s}return a},lj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),n=Object.create(null),r=(i,o)=>{a[i]=o,t++,t>e&&(t=0,n=a,a=Object.create(null))};return{get(i){let o=a[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return r(i,o),o},set(i,o){i in a?a[i]=o:r(i,o)}}};var dj=[],aN=(e,t,a,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:n,isExternal:r}),uj=e=>{let{prefix:t,experimentalParseClassName:a}=e,n=r=>{let i=[],o=0,s=0,l=0,c,u=r.length;for(let b=0;b<u;b++){let v=r[b];if(o===0&&s===0){if(v===":"){i.push(r.slice(l,b)),l=b+1;continue}if(v==="/"){c=b;continue}}v==="["?o++:v==="]"?o--:v==="("?s++:v===")"&&s--}let d=i.length===0?r:r.slice(l),f=d,m=!1;d.endsWith("!")?(f=d.slice(0,-1),m=!0):d.startsWith("!")&&(f=d.slice(1),m=!0);let p=c&&c>l?c-l:void 0;return aN(i,m,f,p)};if(t){let r=t+":",i=n;n=o=>o.startsWith(r)?i(o.slice(r.length)):aN(dj,!1,o,void 0,!0)}if(a){let r=n;n=i=>a({className:i,parseClassName:r})}return n},fj=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,n)=>{t.set(a,1e6+n)}),a=>{let n=[],r=[];for(let i=0;i<a.length;i++){let o=a[i],s=o[0]==="[",l=t.has(o);s||l?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},pj=e=>({cache:cj(e.cacheSize),parseClassName:uj(e),sortModifiers:fj(e),postfixLookupClassGroupIds:mj(e),...ej(e)}),mj=e=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let n=0;n<a.length;n++)t[a[n]]=!0;return t},gj=/\s+/,hj=(e,t)=>{let{parseClassName:a,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:i,postfixLookupClassGroupIds:o}=t,s=[],l=e.trim().split(gj),c="";for(let u=l.length-1;u>=0;u-=1){let d=l[u],{isExternal:f,modifiers:m,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:v}=a(d);if(f){c=d+(c.length>0?" "+c:c);continue}let g=!!v,h;if(g){let I=b.substring(0,v);h=n(I);let k=h&&o[h]?n(b):void 0;k&&k!==h&&(h=k,g=!1)}else h=n(b);if(!h){if(!g){c=d+(c.length>0?" "+c:c);continue}if(h=n(b),!h){c=d+(c.length>0?" "+c:c);continue}g=!1}let x=m.length===0?"":m.length===1?m[0]:i(m).join(":"),y=p?x+"!":x,C=y+h;if(s.indexOf(C)>-1)continue;s.push(C);let A=r(h,g);for(let I=0;I<A.length;++I){let k=A[I];s.push(y+k)}c=d+(c.length>0?" "+c:c)}return c},bj=(...e)=>{let t=0,a,n,r="";for(;t<e.length;)(a=e[t++])&&(n=cN(a))&&(r&&(r+=" "),r+=n);return r},cN=e=>{if(typeof e=="string")return e;let t,a="";for(let n=0;n<e.length;n++)e[n]&&(t=cN(e[n]))&&(a&&(a+=" "),a+=t);return a},vj=(e,...t)=>{let a,n,r,i,o=l=>{let c=t.reduce((u,d)=>d(u),e());return a=pj(c),n=a.cache.get,r=a.cache.set,i=s,s(l)},s=l=>{let c=n(l);if(c)return c;let u=hj(l,a);return r(l,u),u};return i=o,(...l)=>i(bj(...l))},xj=[],Oa=e=>{let t=a=>a[e]||xj;return t.isThemeGetter=!0,t.themeKey=e,t},dN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Sj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Cj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>yj.test(e),it=e=>!!e&&!Number.isNaN(Number(e)),Ti=e=>!!e&&Number.isInteger(Number(e)),ey=e=>e.endsWith("%")&&it(e.slice(0,-1)),lo=e=>wj.test(e),fN=()=>!0,Ij=e=>kj.test(e)&&!Sj.test(e),ay=()=>!1,Aj=e=>Cj.test(e),Dj=e=>Rj.test(e),Lj=e=>!Ae(e)&&!De(e),Nj=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ej=e=>ds(e,gN,ay),Ae=e=>dN.test(e),nl=e=>ds(e,hN,Ij),nN=e=>ds(e,Uj,it),Oj=e=>ds(e,vN,fN),Tj=e=>ds(e,bN,ay),rN=e=>ds(e,pN,ay),Pj=e=>ds(e,mN,Dj),Jm=e=>ds(e,xN,Aj),De=e=>uN.test(e),Ou=e=>rl(e,hN),_j=e=>rl(e,bN),iN=e=>rl(e,pN),Bj=e=>rl(e,gN),Mj=e=>rl(e,mN),eg=e=>rl(e,xN,!0),Fj=e=>rl(e,vN,!0),ds=(e,t,a)=>{let n=dN.exec(e);return n?n[1]?t(n[1]):a(n[2]):!1},rl=(e,t,a=!1)=>{let n=uN.exec(e);return n?n[1]?t(n[1]):a:!1},pN=e=>e==="position"||e==="percentage",mN=e=>e==="image"||e==="url",gN=e=>e==="length"||e==="size"||e==="bg-size",hN=e=>e==="length",Uj=e=>e==="number",bN=e=>e==="family-name",vN=e=>e==="number"||e==="weight",xN=e=>e==="shadow";var jj=()=>{let e=Oa("color"),t=Oa("font"),a=Oa("text"),n=Oa("font-weight"),r=Oa("tracking"),i=Oa("leading"),o=Oa("breakpoint"),s=Oa("container"),l=Oa("spacing"),c=Oa("radius"),u=Oa("shadow"),d=Oa("inset-shadow"),f=Oa("text-shadow"),m=Oa("drop-shadow"),p=Oa("blur"),b=Oa("perspective"),v=Oa("aspect"),g=Oa("ease"),h=Oa("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...y(),De,Ae],A=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[De,Ae,l],T=()=>[cs,"full","auto",...k()],_=()=>[Ti,"none","subgrid",De,Ae],M=()=>["auto",{span:["full",Ti,De,Ae]},Ti,De,Ae],H=()=>[Ti,"auto",De,Ae],Y=()=>["auto","min","max","fr",De,Ae],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...k()],F=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],se=()=>[s,cs,"screen","full","dvw","lvw","svw","min","max","fit",...k()],ve=()=>[cs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],z=()=>[e,De,Ae],L=()=>[...y(),iN,rN,{position:[De,Ae]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",Bj,Ej,{size:[De,Ae]}],Ee=()=>[ey,Ou,nl],G=()=>["","none","full",c,De,Ae],ae=()=>["",it,Ou,nl],we=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ke=()=>[it,ey,iN,rN],tt=()=>["","none",p,De,Ae],Ct=()=>["none",it,De,Ae],ne=()=>["none",it,De,Ae],Ce=()=>[it,De,Ae],ot=()=>[cs,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lo],breakpoint:[lo],color:[fN],container:[lo],"drop-shadow":[lo],ease:["in","out","in-out"],font:[Lj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lo],shadow:[lo],spacing:["px",it],text:[lo],"text-shadow":[lo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,Ae,De,v]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Ae]}],"container-named":[Nj],columns:[{columns:[it,"auto",Ae,De,s]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[Ti,"auto",De,Ae]}],basis:[{basis:[cs,"full","auto",s,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,cs,"auto","initial","none",Ae]}],grow:[{grow:["",it,De,Ae]}],shrink:[{shrink:["",it,De,Ae]}],order:[{order:[Ti,"first","last","none",De,Ae]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...se()]}],"min-inline-size":[{"min-inline":["auto",...se()]}],"max-inline-size":[{"max-inline":["none",...se()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[s,"screen",...F()]}],"min-w":[{"min-w":[s,"screen","none",...F()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh","none",...F()]}],"font-size":[{text:["base",a,Ou,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Fj,Oj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ey,Ae]}],"font-family":[{font:[_j,Tj,t]}],"font-features":[{"font-features":[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,De,Ae]}],"line-clamp":[{"line-clamp":[it,"none",De,nN]}],leading:[{leading:["none",i,...k()]}],"list-image":[{"list-image":["none",De,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",De,nl]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[it,"auto",De,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[Ti,De,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ti,De,Ae],radial:["",De,Ae],conic:["",Ti,De,Ae]},Mj,Pj]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:Ee()}],"gradient-via-pos":[{via:Ee()}],"gradient-to-pos":[{to:Ee()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,De,Ae]}],"outline-w":[{outline:["",it,Ou,nl]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",u,eg,Jm]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,eg,Jm]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[it,nl]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,eg,Jm]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[it,De,Ae]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":ke()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ke()}],"mask-image-t-to-pos":[{"mask-t-to":ke()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ke()}],"mask-image-r-to-pos":[{"mask-r-to":ke()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ke()}],"mask-image-b-to-pos":[{"mask-b-to":ke()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ke()}],"mask-image-l-to-pos":[{"mask-l-to":ke()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ke()}],"mask-image-x-to-pos":[{"mask-x-to":ke()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ke()}],"mask-image-y-to-pos":[{"mask-y-to":ke()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[De,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":ke()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":ke()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Ae]}],filter:[{filter:["","none",De,Ae]}],blur:[{blur:tt()}],brightness:[{brightness:[it,De,Ae]}],contrast:[{contrast:[it,De,Ae]}],"drop-shadow":[{"drop-shadow":["","none",m,eg,Jm]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",it,De,Ae]}],"hue-rotate":[{"hue-rotate":[it,De,Ae]}],invert:[{invert:["",it,De,Ae]}],saturate:[{saturate:[it,De,Ae]}],sepia:[{sepia:["",it,De,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Ae]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[it,De,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[it,De,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,De,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,De,Ae]}],"backdrop-invert":[{"backdrop-invert":["",it,De,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[it,De,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[it,De,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",it,De,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",De,Ae]}],ease:[{ease:["linear","initial",g,De,Ae]}],delay:[{delay:[it,De,Ae]}],animate:[{animate:["none",h,De,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,De,Ae]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Ct()}],"rotate-x":[{"rotate-x":Ct()}],"rotate-y":[{"rotate-y":Ct()}],"rotate-z":[{"rotate-z":Ct()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[De,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[Ti,De,Ae]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Ae]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[it,Ou,nl,nN]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var yN=vj(jj);function xe(...e){return yN(Qm(e))}var zu=D(ee(),1);var Tt=D(ee(),1);var Hj=Object.defineProperty,Oc=(e,t)=>Hj(e,"name",{value:t,configurable:!0}),wN=!!(typeof window<"u"&&window.document&&window.document.createElement);function rr(e,t,{checkForDefaultPrevented:a=!0}={}){return Oc(function(r){if(e?.(r),a===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}Oc(rr,"composeEventHandlers");function zj(e){if(!wN)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Oc(zj,"getOwnerWindow");function ny(e){if(!wN)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Oc(ny,"getOwnerDocument");function kN(e,t=!1){let{activeElement:a}=ny(e);if(!a?.nodeName)return null;if(SN(a)&&a.contentDocument)return kN(a.contentDocument.body,t);if(t){let n=a.getAttribute("aria-activedescendant");if(n){let r=ny(a).getElementById(n);if(r)return r}}return a}Oc(kN,"getActiveElement");function SN(e){return e.tagName==="IFRAME"}Oc(SN,"isFrame");var CN=D(ee(),1),qj=Object.defineProperty,iy=(e,t)=>qj(e,"name",{value:t,configurable:!0});function ry(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}iy(ry,"setRef");function RN(...e){return t=>{let a=!1,n=e.map(r=>{let i=ry(r,t);return!a&&typeof i=="function"&&(a=!0),i});if(a)return()=>{for(let r=0;r<n.length;r++){let i=n[r];typeof i=="function"?i():ry(e[r],null)}}}}iy(RN,"composeRefs");function qa(...e){return CN.useCallback(RN(...e),e)}iy(qa,"useComposedRefs");var Lr=D(ee(),1),oy=D(W(),1),Vj=Object.defineProperty,Dr=(e,t)=>Vj(e,"name",{value:t,configurable:!0});function Gj(e,t){let a=Lr.createContext(t);a.displayName=e+"Context";let n=Dr(i=>{let{children:o,...s}=i,l=Lr.useMemo(()=>s,Object.values(s));return(0,oy.jsx)(a.Provider,{value:l,children:o})},"Provider");n.displayName=e+"Provider";function r(i,o={}){let{optional:s=!1}=o,l=Lr.useContext(a);if(l)return l;if(t!==void 0)return t;if(!s)throw new Error(`\`${i}\` must be used within \`${e}\``)}return Dr(r,"useContext"),[n,r]}Dr(Gj,"createContext");function Tu(e,t=[]){let a=[];function n(i,o){let s=Lr.createContext(o);s.displayName=i+"Context";let l=a.length;a=[...a,o];let c=Dr(d=>{let{scope:f,children:m,...p}=d,b=f?.[e]?.[l]||s,v=Lr.useMemo(()=>p,Object.values(p));return(0,oy.jsx)(b.Provider,{value:v,children:m})},"Provider");c.displayName=i+"Provider";function u(d,f,m={}){let{optional:p=!1}=m,b=f?.[e]?.[l]||s,v=Lr.useContext(b);if(v)return v;if(o!==void 0)return o;if(!p)throw new Error(`\`${d}\` must be used within \`${i}\``)}return Dr(u,"useContext"),[c,u]}Dr(n,"createContext");let r=Dr(()=>{let i=a.map(o=>Lr.createContext(o));return Dr(function(s){let l=s?.[e]||i;return Lr.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])},"useScope")},"createScope");return r.scopeName=e,[n,IN(r,...t)]}Dr(Tu,"createContextScope");function IN(...e){let t=e[0];if(e.length===1)return t;let a=Dr(()=>{let n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Dr(function(i){let o=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(i)[`__scope${c}`];return{...s,...d}},{});return Lr.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return a.scopeName=t.scopeName,a}Dr(IN,"composeContextScopes");var sy=D(ee(),1);var AN=D(ee(),1),fn=globalThis?.document?AN.useLayoutEffect:()=>{};var $j=Object.defineProperty,Wj=(e,t)=>$j(e,"name",{value:t,configurable:!0}),Kj=sy[" useId ".trim().toString()]||(()=>{}),Yj=0;function Pu(e){let[t,a]=sy.useState(Kj());return fn(()=>{e||a(n=>n??String(Yj++))},[e]),e||(t?`radix-${t}`:"")}Wj(Pu,"useId");var Nr=D(ee(),1);var tg=!1;var Qr=D(ee(),1);var Tc=D(ee(),1),Xj=Object.defineProperty,Zj=(e,t)=>Xj(e,"name",{value:t,configurable:!0}),DN=Tc[" useEffectEvent ".trim().toString()],LN=Tc[" useInsertionEffect ".trim().toString()];function ly(e){if(typeof DN=="function")return DN(e);let t=Tc.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof LN=="function"?LN(()=>{t.current=e}):fn(()=>{t.current=e}),Tc.useMemo(()=>((...a)=>t.current?.(...a)),[])}Zj(ly,"useEffectEvent");var Qj=Object.defineProperty,_u=(e,t)=>Qj(e,"name",{value:t,configurable:!0}),Jj=Nr[" useInsertionEffect ".trim().toString()]||fn;function cy({prop:e,defaultProp:t,onChange:a=_u(()=>{},"onChange"),caller:n}){let[r,i,o]=EN({defaultProp:t,onChange:a}),s=e!==void 0,l=s?e:r;if(tg){let u=Nr.useRef(e!==void 0);Nr.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=Nr.useCallback(u=>{if(s){let d=ON(u)?u(e):u;d!==e&&o.current?.(d)}else i(u)},[s,e,i,o]);return[l,c]}_u(cy,"useControllableState");function EN({defaultProp:e,onChange:t}){let[a,n]=Nr.useState(e),r=Nr.useRef(a),i=Nr.useRef(t);return Jj(()=>{i.current=t},[t]),Nr.useEffect(()=>{r.current!==a&&(i.current?.(a),r.current=a)},[a,r]),[a,n,i]}_u(EN,"useUncontrolledState");function ON(e){return typeof e=="function"}_u(ON,"isFunction");var NN=Symbol("RADIX:SYNC_STATE");function e5(e,t,a,n){let{prop:r,defaultProp:i,onChange:o,caller:s}=t,l=r!==void 0,c=ly(o);if(tg){let v=Qr.useRef(r!==void 0);Qr.useEffect(()=>{let g=v.current;g!==l&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=l},[l,s])}let u=[{...a,state:i}];n&&u.push(n);let[d,f]=Qr.useReducer((v,g)=>{if(g.type===NN)return{...v,state:g.state};let h=e(v,g);return l&&!Object.is(h.state,v.state)&&c(h.state),h},...u),m=d.state,p=Qr.useRef(m);Qr.useEffect(()=>{p.current!==m&&(p.current=m,l||c(m))},[m,p,l]);let b=Qr.useMemo(()=>r!==void 0?{...d,state:r}:d,[d,r]);return Qr.useEffect(()=>{l&&!Object.is(r,d.state)&&f({type:NN,state:r})},[r,d.state,l]),[b,f]}_u(e5,"useControllableStateReducer");var Ot=D(ee(),1);var jN=D(ee(),1),HN=D(Zc(),1);var an=D(ee(),1);var t5=Object.defineProperty,ir=(e,t)=>t5(e,"name",{value:t,configurable:!0});function dy(e){let t=an.forwardRef((a,n)=>{let{children:r,...i}=a,o=null,s=!1,l=[];r=FN(r),an.Children.forEach(r,f=>{if(BN(f)){s=!0;let m=f,p="child"in m.props?m.props.child:m.props.children;for(;uy(p)&&typeof ag=="function";)p=ag(p._payload);o=n5(m,p),l.push(o?.props?.children)}else l.push(f)}),o?o=an.cloneElement(o,void 0,l):!s&&an.Children.count(r)===1&&an.isValidElement(r)&&(o=r);let c=o?_N(o):void 0,u=qa(n,c);if(!o){if(r||r===0)throw new Error(s?o5(e):i5(e));return r}let d=PN(i,o.props??{});return o.type!==an.Fragment&&(d.ref=n?u:c),an.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}ir(dy,"createSlot");var TN=Symbol.for("radix.slottable");function a5(e){let t=ir(a=>"child"in a?a.children(a.child):a.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=TN,t}ir(a5,"createSlottable");var n5=ir((e,t)=>"child"in e.props?an.isValidElement(t)?an.cloneElement(t,void 0,e.props.children(t.props.children)):null:an.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function PN(e,t){let a={...t};for(let n in t){let r=e[n],i=t[n];/^on[A-Z]/.test(n)?r&&i?a[n]=(...s)=>{let l=i(...s);return r(...s),l}:r&&(a[n]=r):n==="style"?a[n]={...r,...i}:n==="className"?a[n]=[r,i].filter(Boolean).join(" "):n==="aria-describedby"&&(a[n]=UN(i,r))}return{...e,...a}}ir(PN,"mergeProps");function _N(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}ir(_N,"getElementRef");function BN(e){return an.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TN}ir(BN,"isSlottable");var r5=Symbol.for("react.lazy");function uy(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===r5&&"_payload"in e&&MN(e._payload)}ir(uy,"isLazyComponent");function MN(e){return typeof e=="object"&&e!==null&&"then"in e}ir(MN,"isPromiseLike");function FN(e){let t=e;for(;uy(t)&&typeof ag=="function";)t=ag(t._payload);return t}ir(FN,"useUnwrappedLazy");function UN(...e){let t=new Set;for(let a of e)if(typeof a=="string")for(let n of String(a).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}ir(UN,"concatAriaDescribedby");var i5=ir(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),o5=ir(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ag=an[" use ".trim().toString()];var zN=D(W(),1),s5=Object.defineProperty,l5=(e,t)=>s5(e,"name",{value:t,configurable:!0}),c5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Er=c5.reduce((e,t)=>{let a=dy(`Primitive.${t}`),n=jN.forwardRef((r,i)=>{let{asChild:o,...s}=r,l=o?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,zN.jsx)(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fy(e,t){e&&HN.flushSync(()=>e.dispatchEvent(t))}l5(fy,"dispatchDiscreteCustomEvent");var Bu=D(ee(),1),d5=Object.defineProperty,u5=(e,t)=>d5(e,"name",{value:t,configurable:!0}),qN=Bu[" useInsertionEffect ".trim().toString()];function us(e){let t=Bu.useRef(e);return typeof qN=="function"?qN(()=>{t.current=e}):fn(()=>{t.current=e}),Bu.useMemo(()=>((...a)=>t.current?.(...a)),[])}u5(us,"useCallbackRef");var GN=D(W(),1),f5=Object.defineProperty,Va=(e,t)=>f5(e,"name",{value:t,configurable:!0}),py="dismissableLayer.update",p5="dismissableLayer.pointerDownOutside",m5="dismissableLayer.focusOutside",VN,$N=Ot.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),WN=Ot.forwardRef(Va(function(t,a){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=Ot.useContext($N),[f,m]=Ot.useState(null),p=f?.ownerDocument??globalThis?.document,[,b]=Ot.useState({}),v=qa(a,m),g=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=h?g.indexOf(h):-1,y=f?g.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,A=y>=x,I=Ot.useRef(!1),k=KN(H=>{o?.(H),l?.(H),H.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:Ot.useCallback(H=>{if(!(H instanceof Node))return!1;let Y=[...d.branches].some(oe=>oe.contains(H));return A&&!Y},[d.branches,A])}),T=YN(H=>{if(r&&I.current)return;let Y=H.target;[...d.branches].some(q=>q.contains(Y))||(s?.(H),l?.(H),H.defaultPrevented||c?.())},p),_=f?y===g.length-1:!1,M=us(H=>{H.key==="Escape"&&(i?.(H),!H.defaultPrevented&&c&&(H.preventDefault(),c()))});return Ot.useEffect(()=>{if(_)return p.addEventListener("keydown",M,{capture:!0}),()=>p.removeEventListener("keydown",M,{capture:!0})},[p,_,M]),Ot.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(VN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),my(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=VN))}},[f,p,n,d]),Ot.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),my())},[f,d]),Ot.useEffect(()=>{let H=Va(()=>b({}),"handleUpdate");return document.addEventListener(py,H),()=>document.removeEventListener(py,H)},[]),(0,GN.jsx)(Er.div,{...u,ref:v,style:{pointerEvents:C?A?"auto":"none":void 0,...t.style},onFocusCapture:rr(t.onFocusCapture,T.onFocusCapture),onBlurCapture:rr(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:rr(t.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function gy(){let e=Ot.useContext($N),[t,a]=Ot.useState(null);return Ot.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),a}Va(gy,"useDismissableLayerSurface");var g5=Va(()=>!0,"IS_TRUE");function KN(e,t){let{ownerDocument:a=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=g5}=t,s=us(e),l=Ot.useRef(!1),c=Ot.useRef(!1),u=Ot.useRef(new Map),d=Ot.useRef(()=>{});return Ot.useEffect(()=>{function f(){c.current=!1,r.current=!1,u.current.clear()}Va(f,"resetOutsideInteraction");function m(){return Array.from(u.current.values()).some(Boolean)}Va(m,"isOutsideInteractionIntercepted");function p(x){if(!c.current)return;let y=x.target;y instanceof Node&&[...i].some(A=>A.contains(y))||u.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{c.current&&d.current()},0)}Va(p,"handleInteractionCapture");function b(x){c.current&&u.current.set(x.type,!1)}Va(b,"handleInteractionBubble");let v=Va(x=>{if(x.target&&!l.current){let C=function(){a.removeEventListener("click",d.current);let I=m();f(),I||hy(p5,s,A,{discrete:!0})};var y=C;if(Va(C,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){a.removeEventListener("click",d.current),f(),l.current=!1;return}let A={originalEvent:x};c.current=!0,r.current=n&&x.button===0,u.current.clear(),!n||x.button!==0?C():(a.removeEventListener("click",d.current),d.current=C,a.addEventListener("click",d.current,{once:!0}))}else a.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let x of g)a.addEventListener(x,p,!0),a.addEventListener(x,b);let h=window.setTimeout(()=>{a.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",v),a.removeEventListener("click",d.current);for(let x of g)a.removeEventListener(x,p,!0),a.removeEventListener(x,b)}},[a,s,n,r,i,o]),{onPointerDownCapture:Va(()=>l.current=!0,"onPointerDownCapture")}}Va(KN,"usePointerDownOutside");function YN(e,t=globalThis?.document){let a=us(e),n=Ot.useRef(!1);return Ot.useEffect(()=>{let r=Va(i=>{i.target&&!n.current&&hy(m5,a,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:Va(()=>n.current=!0,"onFocusCapture"),onBlurCapture:Va(()=>n.current=!1,"onBlurCapture")}}Va(YN,"useFocusOutside");function my(){let e=new CustomEvent(py);document.dispatchEvent(e)}Va(my,"dispatchUpdate");function hy(e,t,a,{discrete:n}){let r=a.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?fy(r,i):r.dispatchEvent(i)}Va(hy,"handleAndDispatchCustomEvent");var sa=D(ee(),1);var wy=D(W(),1),h5=Object.defineProperty,Ra=(e,t)=>h5(e,"name",{value:t,configurable:!0}),by="focusScope.autoFocusOnMount",vy="focusScope.autoFocusOnUnmount",XN={bubbles:!1,cancelable:!0},QN=sa.forwardRef(Ra(function(t,a){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:s,...l}=t,[c,u]=sa.useState(null),d=us(o),f=us(s),m=sa.useRef(null),p=qa(a,u),b=sa.useRef(i);sa.useEffect(()=>{b.current=i});let v=sa.useCallback(x=>x?c?.contains(x)?!0:!!b.current?.some(y=>y.contains(x)):!1,[c]),g=sa.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;sa.useEffect(()=>{if(r){let A=function(_){if(g.paused||!c)return;let M=_.target;v(M)?m.current=M:co(m.current,{select:!0})},I=function(_){if(g.paused||!c)return;let M=_.relatedTarget;M!==null&&(v(M)||co(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(let H of _)H.removedNodes.length>0&&co(c)};var x=A,y=I,C=k;Ra(A,"handleFocusIn"),Ra(I,"handleFocusOut"),Ra(k,"handleMutations"),document.addEventListener("focusin",A),document.addEventListener("focusout",I);let T=new MutationObserver(k);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",A),document.removeEventListener("focusout",I),T.disconnect()}}},[r,c,g.paused,v]),sa.useEffect(()=>{if(c){ZN.add(g);let x=document.activeElement;if(!c.contains(x)){let C=new CustomEvent(by,XN);c.addEventListener(by,d),c.dispatchEvent(C),C.defaultPrevented||(eE(iE(Cy(c)),{select:!0}),document.activeElement===x&&co(c))}return()=>{c.removeEventListener(by,d);let C=c.ownerDocument,A=CustomEvent;setTimeout(()=>{let I=new A(vy,XN);c.addEventListener(vy,f),c.dispatchEvent(I),I.defaultPrevented||co(x??C.body,{select:!0}),c.removeEventListener(vy,f),ZN.remove(g)},0)}}},[c,d,f,g]);let h=sa.useCallback(x=>{if(!n&&!r||g.paused)return;let y=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(y&&C){let A=x.currentTarget,[I,k]=tE(A);I&&k?!x.shiftKey&&C===k?(x.preventDefault(),n&&co(I,{select:!0})):x.shiftKey&&C===I&&(x.preventDefault(),n&&co(k,{select:!0})):C===A&&x.preventDefault()}},[n,r,g.paused]);return(0,wy.jsx)(Er.div,{tabIndex:-1,...l,ref:p,onKeyDown:h})},"FocusScope")),JN=sa.createContext(null);function ky({registry:e,children:t}){return e?(0,wy.jsx)(JN.Provider,{value:e,children:t}):t}Ra(ky,"FocusScopeBranchProvider");function Sy(){let[e,t]=sa.useState([]),a=sa.useMemo(()=>({add:Ra(n=>t(r=>r.includes(n)?r:[...r,n]),"add"),remove:Ra(n=>t(r=>r.filter(i=>i!==n)),"remove")}),[]);return{nodes:e,registry:a}}Ra(Sy,"useFocusScopeBranchRegistry");function b5(e){let t=sa.useContext(JN);sa.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}Ra(b5,"useFocusScopeBranch");function eE(e,{select:t=!1}={}){let a=document.activeElement;for(let n of e)if(co(n,{select:t}),document.activeElement!==a)return}Ra(eE,"focusFirst");function tE(e){let t=Cy(e),a=xy(t,e),n=xy(t.reverse(),e);return[a,n]}Ra(tE,"getTabbableEdges");function Cy(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ra(r=>{let i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Ra(Cy,"getTabbableCandidates");function xy(e,t){let a=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(a?!n.checkVisibility({checkVisibilityCSS:!0}):aE(n,{upTo:t})))return n}Ra(xy,"findVisible");function aE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ra(aE,"isHidden");function nE(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ra(nE,"isSelectableInput");function co(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&nE(e)&&t&&e.select()}}Ra(co,"focus");var ZN=rE();function rE(){let e=[];return{add(t){let a=e[0];t!==a&&a?.pause(),e=yy(e,t),e.unshift(t)},remove(t){e=yy(e,t),e[0]?.resume()}}}Ra(rE,"createFocusScopesStack");function yy(e,t){let a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}Ra(yy,"arrayRemove");function iE(e){return e.filter(t=>t.tagName!=="A")}Ra(iE,"removeLinks");var ng=D(ee(),1),oE=D(Zc(),1);var sE=D(W(),1),v5=Object.defineProperty,x5=(e,t)=>v5(e,"name",{value:t,configurable:!0}),lE=ng.forwardRef(x5(function(t,a){let{container:n,...r}=t,[i,o]=ng.useState(!1);fn(()=>o(!0),[]);let s=n||i&&globalThis?.document?.body;return s?oE.createPortal((0,sE.jsx)(Er.div,{...r,ref:a}),s):null},"Portal"));var nn=D(ee(),1);var cE=D(ee(),1),y5=Object.defineProperty,uo=(e,t)=>y5(e,"name",{value:t,configurable:!0});function dE(e,t){return cE.useReducer((a,n)=>t[a][n]??a,e)}uo(dE,"useStateMachine");var rg=uo(e=>{let{present:t,children:a}=e,n=uE(t),r=typeof a=="function"?a({present:n.isPresent}):nn.Children.only(a),i=fE(n.ref,pE(r));return typeof a=="function"||n.isPresent?nn.cloneElement(r,{ref:i}):null},"Presence");function uE(e){let[t,a]=nn.useState(),n=nn.useRef(null),r=nn.useRef(e),i=nn.useRef("none"),o=nn.useRef(void 0),s=e?"mounted":"unmounted",[l,c]=dE(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return nn.useEffect(()=>{l==="mounted"?(i.current=o.current??Pc(n.current),o.current=void 0):i.current="none"},[l]),fn(()=>{let u=n.current,d=r.current;if(d!==e){let m=i.current,p=Pc(u);e?(o.current=p,c("MOUNT")):p==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),fn(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,f=uo(p=>{let v=Pc(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!r.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},"handleAnimationEnd"),m=uo(p=>{p.target===t&&(i.current=Pc(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:nn.useCallback(u=>{if(u){let d=getComputedStyle(u);n.current=d,o.current=Pc(d)}else n.current=null;a(u)},[])}}uo(uE,"usePresence");function Ry(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}uo(Ry,"setRef");function fE(...e){let t=nn.useRef(e);return t.current=e,nn.useCallback(a=>{let n=t.current,r=!1,i=n.map(o=>{let s=Ry(o,a);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<i.length;o++){let s=i[o];typeof s=="function"?s():Ry(n[o],null)}}},[])}uo(fE,"useStableComposedRefs");function Pc(e){return e?.animationName||"none"}uo(Pc,"getAnimationName");function pE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}uo(pE,"getElementRef");var mE=D(ee(),1),w5=Object.defineProperty,Ay=(e,t)=>w5(e,"name",{value:t,configurable:!0}),ig=0,_c=null;function k5(e){return og(),e.children}Ay(k5,"FocusGuards");function og(){mE.useEffect(()=>{_c||(_c={start:Iy(),end:Iy()});let{start:e,end:t}=_c;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ig++,()=>{ig===1&&(_c?.start.remove(),_c?.end.remove(),_c=null),ig=Math.max(0,ig-1)}},[])}Ay(og,"useFocusGuards");function Iy(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Ay(Iy,"createFocusGuard");var Mn=function(){return Mn=Object.assign||function(t){for(var a,n=1,r=arguments.length;n<r;n++){a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},Mn.apply(this,arguments)};function sg(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a}function gE(e,t,a){if(a||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var fg=D(ee());var pn=D(ee());var il="right-scroll-bar-position",ol="width-before-scroll-bar",Dy="with-scroll-bars-hidden",Ly="--removed-body-scroll-bar-size";function lg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var hE=D(ee());function bE(e,t){var a=(0,hE.useState)(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(n){var r=a.value;r!==n&&(a.value=n,a.callback(n,r))}}}})[0];return a.callback=t,a.facade}var cg=D(ee());var S5=typeof window<"u"?cg.useLayoutEffect:cg.useEffect,vE=new WeakMap;function Ny(e,t){var a=bE(t||null,function(n){return e.forEach(function(r){return lg(r,n)})});return S5(function(){var n=vE.get(a);if(n){var r=new Set(n),i=new Set(e),o=a.current;r.forEach(function(s){i.has(s)||lg(s,null)}),i.forEach(function(s){r.has(s)||lg(s,o)})}vE.set(a,e)},[e]),a}function C5(e){return e}function R5(e,t){t===void 0&&(t=C5);var a=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(i){var o=t(i,n);return a.push(o),function(){a=a.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(n=!0;a.length;){var o=a;a=[],o.forEach(i)}a={push:function(s){return i(s)},filter:function(){return a}}},assignMedium:function(i){n=!0;var o=[];if(a.length){var s=a;a=[],s.forEach(i),o=a}var l=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),a={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),a}}}};return r}function Ey(e){e===void 0&&(e={});var t=R5(null);return t.options=Mn({async:!0,ssr:!1},e),t}var xE=D(ee()),yE=function(e){var t=e.sideCar,a=sg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return xE.createElement(n,Mn({},a))};yE.isSideCarExport=!0;function Oy(e,t){return e.useMedium(t),yE}var dg=Ey();var Ty=function(){},Mu=pn.forwardRef(function(e,t){var a=pn.useRef(null),n=pn.useState({onScrollCapture:Ty,onWheelCapture:Ty,onTouchMoveCapture:Ty}),r=n[0],i=n[1],o=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,m=e.noRelative,p=e.noIsolation,b=e.inert,v=e.allowPinchZoom,g=e.as,h=g===void 0?"div":g,x=e.gapMode,y=sg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,A=Ny([a,t]),I=Mn(Mn({},y),r);return pn.createElement(pn.Fragment,null,u&&pn.createElement(C,{sideCar:dg,removeScrollBar:c,shards:d,noRelative:m,noIsolation:p,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:a,gapMode:x}),o?pn.cloneElement(pn.Children.only(s),Mn(Mn({},I),{ref:A})):pn.createElement(h,Mn({},I,{className:l,ref:A}),s))});Mu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mu.classNames={fullWidth:ol,zeroRight:il};var Jt=D(ee());var Mc=D(ee());var SE=D(ee());var wE;var kE=function(){if(wE)return wE;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function I5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kE();return t&&e.setAttribute("nonce",t),e}function A5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function D5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Py=function(){var e=0,t=null;return{add:function(a){e==0&&(t=I5())&&(A5(t,a),D5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var _y=function(){var e=Py();return function(t,a){SE.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}};var Fu=function(){var e=_y(),t=function(a){var n=a.styles,r=a.dynamic;return e(n,r),null};return t};var L5={left:0,top:0,right:0,gap:0},By=function(e){return parseInt(e||"",10)||0},N5=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[By(a),By(n),By(r)]},My=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return L5;var t=N5(e),a=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-a+t[2]-t[0])}};var E5=Fu(),Bc="data-scroll-locked",O5=function(e,t,a,n){var r=e.left,i=e.top,o=e.right,s=e.gap;return a===void 0&&(a="margin"),`
20
20
  .`.concat(Dy,` {
21
21
  overflow: hidden `).concat(n,`;
22
22
  padding-right: `).concat(s,"px ").concat(n,`;
@@ -107,7 +107,7 @@ The Signal Collector merges them into one: keyword fast-scan + local LLM deep ju
107
107
  `))}r.truncated>0&&a.push(` ... +${r.truncated} more`),a.push(""),a.push(`Default Runtime: ${e.defaultRuntime}`),a.push(""),a.push("--- Agents ---");let i=Yu(e.agents);for(let o of i.items){let s=o.enabled?yw(o.readiness):"Disabled";a.push(` ${o.name}: ${s} (profile: ${o.runtimeProfileLabel})`)}if(i.truncated>0&&a.push(` ... +${i.truncated} more`),a.push(""),e.warnings.length>0){a.push("--- Warnings ---");let o=Yu(e.warnings);for(let s of o.items)a.push(` - ${s}`);o.truncated>0&&a.push(` ... +${o.truncated} more`),a.push("")}if(e.errors&&e.errors.length>0){a.push("--- Errors ---");let o=Yu(e.errors);for(let s of o.items)a.push(` ${s.path}: ${s.reason} \u2192 ${s.nextAction}`);o.truncated>0&&a.push(` ... +${o.truncated} more`),a.push("")}return a.push("=== End Diagnostics ==="),a.join(`
108
108
  `)}var $a=D(W(),1);function yT(){let{t:e}=X(),t=[{num:"01",nameKey:"pages.controlCenter.workflow.phase01",descKey:"pages.controlCenter.workflow.phase01Desc",isHuman:!1},{num:"02",nameKey:"pages.controlCenter.workflow.phase02",descKey:"pages.controlCenter.workflow.phase02Desc",isHuman:!1},{num:"03",nameKey:"pages.controlCenter.workflow.phase03",descKey:"pages.controlCenter.workflow.phase03Desc",isHuman:!0},{num:"04",nameKey:"pages.controlCenter.workflow.phase04",descKey:"pages.controlCenter.workflow.phase04Desc",isHuman:!1}];return(0,$a.jsxs)("div",{className:"mt-8 bg-surface border border-line-2 rounded-[8px] px-[22px] py-[18px]",children:[(0,$a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,$a.jsx)("span",{className:"text-[11px] font-mono uppercase tracking-[0.1em] text-ink-4 font-medium",children:e("pages.controlCenter.workflow.title")}),(0,$a.jsx)("span",{className:"text-[11px] font-mono uppercase tracking-[0.1em] text-ink-4",children:e("pages.controlCenter.workflow.subtitle")}),(0,$a.jsx)("span",{className:"flex-1 h-px bg-line-2","aria-hidden":"true"})]}),(0,$a.jsx)("div",{className:"grid grid-cols-[1fr_24px_1fr_24px_1fr_24px_1fr] items-stretch",children:t.map((a,n)=>(0,$a.jsxs)("div",{className:"contents",children:[(0,$a.jsxs)("div",{className:a.isHuman?"px-[10px] py-[12px] text-center flex flex-col gap-[5px] justify-center border border-dashed border-gov bg-gov/10 rounded-[4px]":"px-[10px] py-[12px] text-center flex flex-col gap-[5px] justify-center bg-paper-2 border border-line-2 rounded-[4px]",children:[(0,$a.jsx)("div",{className:"text-[10px] font-mono text-ink-4 tracking-[0.06em]",children:a.num}),(0,$a.jsx)("div",{className:a.isHuman?"text-[14px] font-semibold text-gov tracking-[-0.005em]":"text-[14px] font-semibold text-ink tracking-[-0.005em]",children:e(a.nameKey)}),(0,$a.jsx)("div",{className:a.isHuman?"text-[11.5px] text-gov-2 italic leading-[1.45] whitespace-pre-line":"text-[11.5px] text-ink-3 leading-[1.45] whitespace-pre-line",children:e(a.descKey)})]}),n<t.length-1&&(0,$a.jsx)("div",{className:"flex items-center justify-center text-ink-4 font-mono",children:(0,$a.jsx)(io,{className:"w-[18px] h-[18px]","aria-hidden":"true"})})]},a.num))}),(0,$a.jsxs)("div",{className:"mt-[14px] pt-[12px] border-t border-line-2 flex items-center gap-[10px] text-[11.5px] text-ink-4 font-mono leading-[1.5]",children:[(0,$a.jsx)(nr,{className:"w-[14px] h-[14px] text-gov shrink-0","aria-hidden":"true"}),(0,$a.jsx)("span",{children:e("pages.controlCenter.workflow.loopHint")})]})]})}var go=D(ee(),1);var Je=D(W(),1);function Dq(e,t){let a="w-2 h-2 rounded-full border-2 shrink-0";if(!t)return xe(a,"border-ink-4 bg-surface opacity-50");switch(e){case"ready":return xe(a,"border-green bg-green");case"not_ready":return xe(a,"border-amber bg-surface");case"needs_setup":return xe(a,"border-amber bg-surface");default:return xe(a,"border-ink-4 bg-surface")}}function Lq(e){switch(e){case"danger":return"border-l-danger";case"green":return"border-l-green";default:return"border-l-amber"}}function Nq(e){switch(e){case"danger":return"text-danger";case"green":return"text-green";default:return"text-ink-4"}}function wT(e){let t=e.split("`"),a=[];for(let n=0;n<t.length;n++){let r=t[n];r!==void 0&&(n%2===0?r.length>0&&a.push(r):a.push((0,Je.jsx)("code",{className:"font-mono text-[11px] text-ink-2 bg-paper-2 px-[5px] py-[1px] rounded-[2px]",children:r},`code-${n}`)))}return a}function kT({agent:e,meta:t,profiles:a,onBindingChange:n,saving:r,locale:i}){let{t:o}=X(),s=na(),l=r===e.name,[c,u]=(0,go.useState)(!1),[d,f]=(0,go.useState)(!1),[m,p]=(0,go.useState)(!1),[b,v]=(0,go.useState)(null),[g,h]=(0,go.useState)(!1),[x,y]=(0,go.useState)(!1);(0,go.useEffect)(()=>{if(!c||x||!e.enabled||e.readiness!=="unknown")return;let L=!1;return y(!0),h(!0),iL(e.name).then(re=>{L||(h(!1),re.success&&re.data&&v(re.data.readiness))}),()=>{L=!0}},[c,x,e.enabled,e.readiness,e.name]);let C=e.readiness==="unknown"&&b!==null?b:e.readiness,A=i==="zh-CN",I=A?t.displayNameZh:t.displayNameEn,k=A?t.roleZh:t.roleEn,T=A?t.detailZh:t.detailEn,_=A?t.impactZh:t.impactEn,M=A?t.techDetailZh:t.techDetailEn,H=A?t.mvpNoteZh:t.mvpNoteEn,Y=A?t.action?.linkTextZh:t.action?.linkTextEn,oe=T.split(`
109
109
 
110
- `).filter(L=>L.length>0),q=L=>{let re=L.target;re.closest("[data-agent-toggle]")||re.closest("[data-confirm-bar]")||re.closest("[data-tech-toggle]")||re.closest("[data-action-row]")||u(qe=>!qe)},R=L=>{L.stopPropagation(),e.enabled?t.isCore?(p(!0),u(!0)):n(e.name,e.runtimeProfileId,!1):n(e.name,e.runtimeProfileId,!0)},F=L=>{L.stopPropagation(),n(e.name,e.runtimeProfileId,!1),p(!1)},se=L=>{L.stopPropagation(),p(!1)},ve=L=>{L.stopPropagation(),f(re=>!re)},z=L=>{n(e.name,L.target.value,e.enabled)};return(0,Je.jsxs)("div",{"data-agent-card":e.name,className:xe("bg-surface border border-line-2 rounded-[4px] mb-[6px] overflow-hidden transition-colors hover:border-line",!t.isCore&&"border-dashed",!e.enabled&&"opacity-72"),children:[(0,Je.jsxs)("div",{className:"px-[16px] py-[12px] cursor-pointer flex items-center gap-[12px]",onClick:q,role:"button",tabIndex:0,"aria-expanded":c,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),u(re=>!re))},children:[(0,Je.jsx)("div",{className:Dq(C,e.enabled),"aria-hidden":"true"}),(0,Je.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Je.jsxs)("div",{className:xe("text-[14px] font-semibold tracking-[-0.005em] flex items-center gap-[8px]",e.enabled?"text-ink":"text-ink-3"),children:[(0,Je.jsx)("span",{children:I}),(0,Je.jsx)("span",{className:"font-mono text-[11.5px] text-ink-4 font-normal",children:e.name})]}),(0,Je.jsx)("div",{className:"text-[12.5px] text-ink-3 mt-[2px] leading-[1.5]",children:k})]}),(0,Je.jsx)("button",{type:"button","data-agent-toggle":!0,onClick:R,disabled:l,"aria-label":e.enabled?o("pages.controlCenter.agentDisabled"):o("pages.controlCenter.agentEnabled"),className:xe("rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium transition-colors disabled:opacity-50",e.enabled?"border border-gov bg-gov text-paper hover:bg-gov-2":"border border-line bg-surface text-ink hover:border-line-2"),children:l?o("pages.controlCenter.saving"):e.enabled?o("pages.controlCenter.on"):o("pages.controlCenter.off")}),(0,Je.jsx)(io,{className:xe("w-[14px] h-[14px] text-ink-4 transition-transform shrink-0",c&&"rotate-90"),"aria-hidden":"true"})]}),c&&(0,Je.jsxs)("div",{className:"px-[16px] pb-[14px] border-t border-line-2 bg-panel",children:[(0,Je.jsx)("div",{className:"pt-[14px] text-[13px] text-ink-3 leading-[1.62]",children:oe.map((L,re)=>(0,Je.jsx)("p",{className:re>0?"mt-2":void 0,children:wT(L)},re))}),H&&(0,Je.jsx)("div",{className:"mt-3 text-[12px] text-ink-4 font-mono italic",children:H}),(0,Je.jsxs)("div",{className:xe("mt-[12px] px-[12px] py-[10px] border border-line-2 border-l-[2.5px] rounded-[4px] bg-paper-2 text-[12.5px] text-ink-3 leading-[1.55]",Lq(t.impactLevel)),children:[(0,Je.jsx)("span",{className:xe("block mb-[3px] text-[10px] font-mono uppercase tracking-[0.08em] font-medium",Nq(t.impactLevel)),children:o("pages.controlCenter.impact.label")}),_]}),t.action&&Y&&(0,Je.jsx)("div",{"data-action-row":!0,className:"mt-[12px] pt-[12px] border-t border-line-2",children:(0,Je.jsxs)("button",{type:"button",onClick:L=>{L.stopPropagation(),s(t.action.to)},className:"flex items-center gap-[6px] text-[12px] text-gov hover:text-gov-2 transition-colors font-medium",children:[(0,Je.jsx)("span",{children:Y}),(0,Je.jsx)(io,{className:"w-[12px] h-[12px]","aria-hidden":"true"})]})}),Object.keys(M).length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("div",{"data-tech-toggle":!0,className:"mt-[12px] pt-[12px] border-t border-line-2 flex items-center gap-[6px] cursor-pointer text-[11px] text-ink-4 font-mono uppercase tracking-[0.04em] hover:text-ink-2 transition-colors",onClick:ve,role:"button",tabIndex:0,"aria-expanded":d,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),L.stopPropagation(),f(re=>!re))},children:[(0,Je.jsx)(io,{className:xe("w-[12px] h-[12px] transition-transform",d&&"rotate-90"),"aria-hidden":"true"}),o("pages.controlCenter.techDetail")]}),d&&(0,Je.jsx)("div",{className:"mt-2 grid grid-cols-[72px_1fr] gap-x-[14px] gap-y-[6px] text-[12px] leading-[1.55]",children:Object.entries(M).map(([L,re])=>(0,Je.jsxs)("div",{className:"contents",children:[(0,Je.jsx)("div",{className:"text-ink-4 font-mono text-[10.5px] uppercase tracking-[0.04em] pt-px",children:L}),(0,Je.jsx)("div",{className:"text-ink-3",children:wT(re)})]},L))})]}),(0,Je.jsxs)("div",{className:"mt-[12px] pt-[12px] border-t border-line-2 flex items-center gap-[10px] text-[12px] flex-wrap",children:[(0,Je.jsx)("span",{className:"text-ink-4 font-mono text-[10.5px] uppercase tracking-[0.04em]",children:o("pages.controlCenter.profileLabelShort")}),(0,Je.jsx)("select",{value:e.runtimeProfileId,onChange:z,disabled:l,className:"font-mono text-[11px] text-ink-2 bg-surface border border-line-2 rounded-[3px] px-2 py-1 cursor-pointer focus:outline-none focus:border-gov disabled:opacity-50","aria-label":o("pages.controlCenter.profileLabel"),children:a.map(L=>(0,Je.jsx)("option",{value:L.id,children:L.label},L.id))}),g&&(0,Je.jsx)("span",{className:"text-[10.5px] text-ink-4 font-mono animate-pulse",children:o("pages.controlCenter.readinessChecking")}),(0,Je.jsx)("button",{type:"button","data-manage-profiles":!0,onClick:L=>{L.stopPropagation();let re=document.getElementById("runtime-profile-manager");re&&re.scrollIntoView({behavior:"smooth",block:"start"})},className:"ml-auto text-[11px] text-ink-4 hover:text-ink-2 transition-colors px-[8px] py-[3px] border border-line-2 rounded-[3px] focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2","aria-label":o("pages.controlCenter.manageProfiles"),children:o("pages.controlCenter.manageProfiles")})]}),m&&(0,Je.jsxs)("div",{"data-confirm-bar":!0,className:"mt-[10px] px-[12px] py-[10px] border border-danger rounded-[4px] bg-danger/10 text-[12px] text-ink-2 leading-[1.55]",children:[(0,Je.jsx)("div",{children:_}),(0,Je.jsxs)("div",{className:"mt-2 flex gap-[8px]",children:[(0,Je.jsx)("button",{type:"button",onClick:F,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-transparent bg-danger text-paper font-medium hover:opacity-90 transition-opacity focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.controlCenter.impact.confirmAck")}),(0,Je.jsx)("button",{type:"button",onClick:se,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-line bg-transparent text-ink-3 hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.controlCenter.impact.confirmCancel")})]})]})]})]})}var ho=D(W(),1);function Eq(e){let t="text-[10px] font-mono px-[7px] py-[2px] rounded-[2px] tracking-[0.02em] font-medium border border-transparent";switch(e){case"must":return xe(t,"bg-danger/10 text-danger border-danger/22");case"recommend":return xe(t,"bg-amber/10 text-amber border-amber/22");case"optional":return xe(t,"bg-paper-2 text-ink-4 border-line-2");case"independent":return xe(t,"bg-green/10 text-green border-green/22");default:return t}}function ST({groupMeta:e,agents:t,profiles:a,onBindingChange:n,saving:r,locale:i}){let{t:o}=X(),s=i==="zh-CN",l=s?e.labelZh:e.labelEn,c=s?e.tagLabelZh:e.tagLabelEn,u=s?e.hintZh:e.hintEn,d=t.filter(f=>ml(f.name));return(0,ho.jsxs)("div",{className:"mb-[20px]",children:[(0,ho.jsxs)("div",{className:"px-[14px] py-[9px] bg-paper-2 border border-line-2 rounded-[4px] flex items-center gap-[10px] mb-[8px]",children:[(0,ho.jsx)("span",{className:"text-[12.5px] font-semibold text-ink-2",children:l}),(0,ho.jsx)("span",{className:Eq(e.tag),children:c}),(0,ho.jsx)("span",{className:"ml-auto text-[11px] text-ink-4 font-mono leading-[1.4] max-w-[32ch] text-right",children:u})]}),d.length===0?(0,ho.jsx)("div",{className:"py-2 px-4 text-[12.5px] text-ink-4 italic",children:"\u2014"}):d.map(f=>{let m=Bi[f.name];return(0,ho.jsx)(kT,{agent:f,meta:m,profiles:a,onBindingChange:n,saving:r,locale:i},f.name)})]})}var xs=D(ee(),1);var Ne=D(W(),1),Sw={id:"",provider:"",model:"",apiKeyEnv:"",baseUrl:""};function Oq(e){let t="w-2 h-2 rounded-full border-2 shrink-0";switch(e){case"ready":return xe(t,"border-green bg-green");case"needs_setup":case"not_ready":case"unknown":return xe(t,"border-amber bg-surface");case"disabled":return xe(t,"border-ink-4 bg-surface opacity-50");default:return xe(t,"border-ink-4 bg-surface")}}function Tq(e){let t={type:"pi-ai",provider:e.provider.trim(),model:e.model.trim(),apiKeyEnv:e.apiKeyEnv.trim()};return e.baseUrl.trim()!==""&&(t.baseUrl=e.baseUrl.trim()),t}function Pq(e){let t={};return e.provider.trim()!==""&&(t.provider=e.provider.trim()),e.model.trim()!==""&&(t.model=e.model.trim()),e.apiKeyEnv.trim()!==""&&(t.apiKeyEnv=e.apiKeyEnv.trim()),e.baseUrl.trim()!==""&&(t.baseUrl=e.baseUrl.trim()),t}function _q(e){return{id:e.id,provider:e.provider??"",model:e.model??"",apiKeyEnv:e.apiKeyEnv??"",baseUrl:""}}function CT({profiles:e,defaultRuntimeId:t,onMutated:a}){let{t:n}=X(),[r,i]=(0,xs.useState)("closed"),[o,s]=(0,xs.useState)(Sw),[l,c]=(0,xs.useState)(null),[u,d]=(0,xs.useState)(!1),[f,m]=(0,xs.useState)(null),[p,b]=(0,xs.useState)(!1),[v,g]=(0,xs.useState)(null),h=()=>{s(Sw),c(null),i("create")},x=Y=>{s(_q(Y)),c(null),i("edit")},y=()=>{i("closed"),s(Sw),c(null)},C=(Y,oe)=>{s(q=>({...q,[Y]:oe}))};function A(){return r==="create"&&o.id.trim()===""?n("pages.controlCenter.profiles.validationIdRequired"):o.provider.trim()===""?n("pages.controlCenter.profiles.validationProviderRequired"):o.model.trim()===""?n("pages.controlCenter.profiles.validationModelRequired"):o.apiKeyEnv.trim()===""?n("pages.controlCenter.profiles.validationApiKeyEnvRequired"):null}let I=async Y=>{Y.preventDefault();let oe=A();if(oe!==null){c(oe);return}if(c(null),d(!0),r==="create"){let R=await aL(o.id.trim(),Tq(o));if(d(!1),!R.success){c(R.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.createSuccess")),y(),a();return}let q=await nL(o.id,Pq(o));if(d(!1),!q.success){c(q.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.updateSuccess")),y(),a()},k=async()=>{if(f===null)return;b(!0),g(null);let Y=await rL(f);if(b(!1),!Y.success){g(Y.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.deleteSuccess")),m(null),g(null),a()},T=()=>{m(null),g(null)},_="bg-surface border border-line-2 rounded-[3px] px-[10px] py-[6px] text-[12.5px] text-ink focus:outline-none focus:border-gov disabled:opacity-50 disabled:cursor-not-allowed w-full",M="block font-mono text-[10.5px] uppercase tracking-[0.04em] text-ink-4 mb-[4px]",H="mt-[3px] text-[11px] text-ink-4 leading-[1.4]";return(0,Ne.jsxs)("div",{id:"runtime-profile-manager",className:"scroll-mt-4",children:[(0,Ne.jsxs)("div",{className:"flex items-center justify-between gap-[12px] mb-3",children:[(0,Ne.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:n("pages.controlCenter.profiles.sectionDescription")}),r==="closed"&&(0,Ne.jsx)("button",{type:"button",onClick:h,className:"shrink-0 border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.controlCenter.profiles.createButton")})]}),r!=="closed"&&(0,Ne.jsxs)("form",{onSubmit:I,className:"mb-[10px] bg-panel border border-line rounded-[6px] px-[16px] py-[14px]",children:[(0,Ne.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ne.jsx)("h4",{className:"text-[13px] font-semibold text-ink",children:r==="create"?n("pages.controlCenter.profiles.formTitleCreate"):n("pages.controlCenter.profiles.formTitleEdit",{id:o.id})}),(0,Ne.jsx)("button",{type:"button",onClick:y,className:"text-[12px] text-ink-4 hover:text-ink-2 transition-colors",children:n("pages.controlCenter.profiles.cancelButton")})]}),(0,Ne.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-[14px] gap-y-[12px]",children:[(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-id",children:n("pages.controlCenter.profiles.fieldId")}),(0,Ne.jsx)("input",{id:"rpf-id",type:"text",value:o.id,onChange:Y=>C("id",Y.target.value),disabled:r==="edit"||u,placeholder:n("pages.controlCenter.profiles.fieldIdPlaceholder"),className:_,autoComplete:"off",spellCheck:!1}),(0,Ne.jsx)("p",{className:H,children:n("pages.controlCenter.profiles.fieldIdHint")})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-provider",children:n("pages.controlCenter.profiles.fieldProvider")}),(0,Ne.jsx)("input",{id:"rpf-provider",type:"text",value:o.provider,onChange:Y=>C("provider",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldProviderPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-model",children:n("pages.controlCenter.profiles.fieldModel")}),(0,Ne.jsx)("input",{id:"rpf-model",type:"text",value:o.model,onChange:Y=>C("model",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldModelPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-apikeyenv",children:n("pages.controlCenter.profiles.fieldApiKeyEnv")}),(0,Ne.jsx)("input",{id:"rpf-apikeyenv",type:"text",value:o.apiKeyEnv,onChange:Y=>C("apiKeyEnv",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldApiKeyEnvPlaceholder"),className:xe(_,"font-mono"),autoComplete:"off",spellCheck:!1}),(0,Ne.jsx)("p",{className:H,children:n("pages.controlCenter.profiles.fieldApiKeyEnvHint")})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-baseurl",children:n("pages.controlCenter.profiles.fieldBaseUrl")}),(0,Ne.jsx)("input",{id:"rpf-baseurl",type:"text",value:o.baseUrl,onChange:Y=>C("baseUrl",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldBaseUrlPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]})]}),l!==null&&(0,Ne.jsx)("div",{className:"mt-3 px-[12px] py-[8px] border border-danger/35 rounded-[4px] bg-danger/10 text-[12px] text-danger font-mono",children:l}),(0,Ne.jsxs)("div",{className:"mt-3 flex items-center gap-[8px]",children:[(0,Ne.jsx)("button",{type:"submit",disabled:u,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n(u?r==="create"?"pages.controlCenter.profiles.creating":"pages.controlCenter.profiles.saving":"pages.controlCenter.profiles.saveButton")}),(0,Ne.jsx)("button",{type:"button",onClick:y,disabled:u,className:"border border-line bg-surface text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 hover:text-ink transition-colors disabled:opacity-50",children:n("pages.controlCenter.profiles.cancelButton")})]})]}),e.length===0?(0,Ne.jsx)("div",{className:"bg-surface border border-line-2 rounded-[4px] px-[16px] py-[14px] text-[12.5px] text-ink-4 italic",children:n("pages.controlCenter.profiles.empty")}):(0,Ne.jsxs)("div",{className:"bg-surface border border-line-2 rounded-[4px] overflow-hidden",children:[(0,Ne.jsxs)("div",{className:"grid grid-cols-[12px_1fr_84px_1fr_1fr_1fr_auto] gap-[10px] items-center px-[16px] py-[9px] bg-paper-2 border-b border-line-2 font-mono text-[10.5px] uppercase tracking-[0.04em] text-ink-4",children:[(0,Ne.jsx)("span",{}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnId")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnType")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnProvider")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnModel")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnApiKeyEnv")}),(0,Ne.jsx)("span",{className:"text-right",children:n("pages.controlCenter.profiles.columnActions")})]}),e.map(Y=>{let oe=Y.id===t,q=f===Y.id;return(0,Ne.jsxs)("div",{className:"border-b border-line-2 last:border-b-0",children:[(0,Ne.jsxs)("div",{className:"grid grid-cols-[12px_1fr_84px_1fr_1fr_1fr_auto] gap-[10px] items-center px-[16px] py-[10px] text-[12.5px]",children:[(0,Ne.jsx)("div",{className:Oq(Y.readiness),"aria-label":va("readiness",Y.readiness,n),title:va("readiness",Y.readiness,n)}),(0,Ne.jsxs)("div",{className:"min-w-0 flex items-center gap-[6px]",children:[(0,Ne.jsx)("span",{className:"font-mono text-[12px] text-ink truncate",children:Y.id}),oe&&(0,Ne.jsx)("span",{className:"shrink-0 text-[9.5px] font-mono px-[5px] py-[1px] rounded-[2px] bg-gov/10 text-gov border border-gov/22 tracking-[0.02em]",children:"default"})]}),(0,Ne.jsxs)("span",{className:"font-mono text-[11.5px] text-ink-3 flex items-center gap-[5px]",children:[Y.type,Y.type==="openclaw"&&(0,Ne.jsx)("span",{className:"text-[9.5px] font-mono px-[5px] py-[1px] rounded-[2px] bg-amber/10 text-amber border border-amber/22 tracking-[0.02em]",children:n("pages.controlCenter.profiles.retiredBadge")})]}),(0,Ne.jsx)("span",{className:"text-ink-3 truncate",children:Y.provider??"\u2014"}),(0,Ne.jsx)("span",{className:"text-ink-3 truncate",children:Y.model??"\u2014"}),(0,Ne.jsx)("span",{className:"font-mono text-[11.5px] text-ink-3 truncate",children:Y.apiKeyEnv??"\u2014"}),(0,Ne.jsxs)("div",{className:"flex items-center justify-end gap-[6px]",children:[Y.type!=="openclaw"&&(0,Ne.jsx)("button",{type:"button",onClick:()=>x(Y),disabled:r!=="closed"||p,className:"text-[11.5px] px-[10px] py-[4px] rounded-[3px] border border-line bg-surface text-ink-3 hover:border-line-2 hover:text-ink transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:n("pages.controlCenter.profiles.editButton")}),(0,Ne.jsx)("button",{type:"button",onClick:()=>{m(Y.id),g(null)},disabled:r!=="closed"||p||f!==null,className:"text-[11.5px] px-[10px] py-[4px] rounded-[3px] border border-line bg-surface text-ink-3 hover:border-danger/40 hover:text-danger transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:n("pages.controlCenter.profiles.deleteButton")})]})]}),q&&(0,Ne.jsx)("div",{className:"px-[16px] pb-[12px]",children:(0,Ne.jsxs)("div",{className:"px-[12px] py-[10px] border border-danger rounded-[4px] bg-danger/10 text-[12px] text-ink-2 leading-[1.55]",children:[(0,Ne.jsx)("div",{className:"font-medium",children:n("pages.controlCenter.profiles.deleteConfirmMessage",{id:Y.id})}),oe&&(0,Ne.jsx)("div",{className:"mt-1 text-ink-3",children:n("pages.controlCenter.profiles.sectionDescription")}),v!==null&&(0,Ne.jsx)("div",{className:"mt-2 font-mono text-[11.5px] text-danger",children:v}),(0,Ne.jsxs)("div",{className:"mt-2 flex gap-[8px]",children:[(0,Ne.jsx)("button",{type:"button",onClick:k,disabled:p,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-transparent bg-danger text-paper font-medium hover:opacity-90 transition-opacity disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n(p?"pages.controlCenter.profiles.deleting":"pages.controlCenter.profiles.deleteConfirmAck")}),(0,Ne.jsx)("button",{type:"button",onClick:T,disabled:p,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-line bg-transparent text-ink-3 hover:border-line-2 transition-colors disabled:opacity-50",children:n("pages.controlCenter.profiles.deleteConfirmCancel")})]})]})})]},Y.id)})]})]})}var Xt=D(ee(),1);var Le=D(W(),1),RT={approved:"approved",not_approved:"notApproved",not_required:"notRequired"},IT={read:"read",write:"write",execute:"execute"};function Xu(e){return`${e.projectWorkspacePath}${e.hostSessionId}`}function Bq(e){return e.split(/\r?\n/).map(t=>t.trim()).filter(Boolean)}function Cw(e){return{error:e.error,nextAction:e.nextAction,status:e.status}}function Eg(){return"mt-1 w-full rounded-[4px] border border-line bg-surface px-3 py-2 text-[13px] text-ink focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2"}function Zu(){return"rounded-[4px] border border-line px-3 py-2 text-[12.5px] font-medium text-ink transition-colors hover:border-line-2 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}function AT(){let{t:e}=X(),[t,a]=(0,Xt.useState)([]),[n,r]=(0,Xt.useState)(""),[i,o]=(0,Xt.useState)(null),[s,l]=(0,Xt.useState)(!0),[c,u]=(0,Xt.useState)(!1),[d,f]=(0,Xt.useState)(!1),[m,p]=(0,Xt.useState)(null),[b,v]=(0,Xt.useState)(""),[g,h]=(0,Xt.useState)(""),[x,y]=(0,Xt.useState)(["write","execute"]),[C,A]=(0,Xt.useState)("not_approved"),I=(0,Xt.useRef)(0),k=(0,Xt.useMemo)(()=>t.find(R=>Xu(R)===n)??null,[t,n]),T=(0,Xt.useCallback)(async()=>{l(!0),p(null);let R=await EL();if(l(!1),!R.success){p(Cw(R));return}a(R.data.sessions),r(F=>R.data.sessions.some(se=>Xu(se)===F)?F:R.data.sessions[0]?Xu(R.data.sessions[0]):"")},[]),_=(0,Xt.useCallback)(async R=>{let F=++I.current;u(!0),p(null);let se=await OL(R.projectWorkspacePath,R.hostSessionId);if(F===I.current){if(u(!1),!se.success){p(Cw(se)),o(null);return}o(se.data.declaration)}},[]);(0,Xt.useEffect)(()=>{T()},[T]),(0,Xt.useEffect)(()=>{k?_(k):(I.current+=1,u(!1),o(null))},[k,_]);let M=(0,Xt.useCallback)(async R=>{f(!0),p(null);let F=await R();if(f(!1),!F.success){let se=Cw(F);p(se),F.status===409&&k&&(await _(k),p(se));return}if(!F.data.declaration){p({error:e("pages.controlCenter.designGate.invalidMutationResponse")});return}o(F.data.declaration)},[_,k,e]),H=(0,Xt.useCallback)(async()=>{if(!k)return;let R=Bq(g);if(!b.trim()||R.length===0||x.length===0){p({error:e("pages.controlCenter.designGate.requiredFields")});return}await M(()=>TL({projectWorkspacePath:k.projectWorkspacePath,hostSessionId:k.hostSessionId,specPath:b.trim(),scope:{paths:R,actions:x},decision:C}))},[C,M,x,g,k,b,e]),Y=(0,Xt.useCallback)(R=>{i&&M(()=>PL(i.sourceRef,i.revision,R))},[i,M]),oe=(0,Xt.useCallback)(()=>{i&&M(()=>_L(i.sourceRef,i.revision))},[i,M]),q=d||c||s;return(0,Le.jsxs)("section",{className:"mt-8","aria-labelledby":"section-design-gate",children:[(0,Le.jsx)(me,{id:"section-design-gate",children:e("pages.controlCenter.designGate.title")}),(0,Le.jsx)("p",{className:"mb-4 max-w-[68ch] text-[13px] leading-relaxed text-ink-3",children:e("pages.controlCenter.designGate.description")}),m&&(0,Le.jsxs)("div",{role:"alert",className:"mb-4 rounded-[4px] border border-amber/30 border-l-2 border-l-amber bg-amber/10 p-3 text-[12.5px] text-ink-2",children:[(0,Le.jsx)("p",{children:m.error}),m.nextAction&&(0,Le.jsx)("p",{className:"mt-1 text-ink-3",children:m.nextAction}),m.status===409&&k&&(0,Le.jsx)("button",{type:"button",className:"mt-2 underline",disabled:q,onClick:()=>{_(k)},children:e("pages.controlCenter.designGate.refresh")})]}),s?(0,Le.jsx)("p",{className:"text-[13px] text-ink-3",children:e("pages.controlCenter.designGate.loadingSessions")}):t.length===0?(0,Le.jsxs)("div",{className:"rounded-[4px] border border-line bg-panel p-4 text-[13px] text-ink-3",children:[(0,Le.jsx)("p",{children:e("pages.controlCenter.designGate.noSessions")}),(0,Le.jsx)("button",{type:"button",className:`${Zu()} mt-3`,disabled:q,onClick:()=>{T()},children:e("pages.controlCenter.designGate.refresh")})]}):(0,Le.jsxs)("div",{className:"space-y-4 rounded-[4px] border border-line bg-panel p-4",children:[(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.nativeSession"),(0,Le.jsx)("select",{className:Eg(),value:n,disabled:q,onChange:R=>r(R.currentTarget.value),children:t.map(R=>(0,Le.jsxs)("option",{value:Xu(R),children:[R.projectWorkspacePath," \xB7 ",R.hostSessionId]},Xu(R)))})]}),c?(0,Le.jsx)("p",{className:"text-[13px] text-ink-3",children:e("pages.controlCenter.designGate.loadingDeclaration")}):i&&!i.revoked?(0,Le.jsxs)("div",{className:"space-y-3","aria-live":"polite",children:[(0,Le.jsxs)("div",{className:"grid gap-2 rounded-[4px] border border-line-2 bg-surface p-3 text-[12.5px]",children:[(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.decision")})," ",e(`pages.controlCenter.designGate.decisions.${RT[i.decision]}`),i.revoked?` \xB7 ${e("pages.controlCenter.designGate.revoked")}`:""]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.revision")})," ",i.revision]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.spec")})," ",(0,Le.jsx)("span",{className:"break-all font-mono",children:i.specPath})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.specDigest")})," ",(0,Le.jsx)("span",{className:"break-all font-mono",children:i.specDigest})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.scopePaths")})," ",(0,Le.jsx)("span",{className:"font-mono",children:i.scope.paths.join(", ")})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.scopeActions")})," ",i.scope.actions.map(R=>e(`pages.controlCenter.designGate.actions.${IT[R]}`)).join(", ")]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.owner")})," ",(0,Le.jsx)("span",{className:"font-mono",children:i.actor.ownerId})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.decidedAt")})," ",i.decidedAt]})]}),(0,Le.jsx)("p",{className:"border-l-2 border-amber pl-3 text-[12.5px] leading-relaxed text-ink-3",children:e("pages.controlCenter.designGate.semanticLimit")}),!i.revoked&&(0,Le.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q||i.decision==="approved",onClick:()=>Y("approved"),children:e(d?"pages.controlCenter.designGate.saving":"pages.controlCenter.designGate.approve")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q||i.decision==="not_approved",onClick:()=>Y("not_approved"),children:e("pages.controlCenter.designGate.markPending")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q,onClick:oe,children:e("pages.controlCenter.designGate.revoke")})]})]}):(0,Le.jsxs)("div",{className:"space-y-3 border-t border-line pt-4",children:[i?.revoked&&(0,Le.jsxs)("div",{className:"rounded-[4px] border border-line-2 bg-surface p-3 text-[12.5px] text-ink-3",children:[(0,Le.jsx)("p",{children:e("pages.controlCenter.designGate.revokedLatest",{revision:i.revision})}),(0,Le.jsxs)("p",{className:"mt-1 break-all font-mono",children:[i.specPath," \xB7 ",i.scope.paths.join(", ")]})]}),(0,Le.jsx)("p",{className:"text-[12.5px] text-ink-3",children:e("pages.controlCenter.designGate.noDeclaration")}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.specPath"),(0,Le.jsx)("input",{className:Eg(),value:b,onChange:R=>v(R.currentTarget.value),placeholder:e("pages.controlCenter.designGate.specPathHint"),disabled:q})]}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.scopePathsInput"),(0,Le.jsx)("textarea",{className:Eg(),rows:3,value:g,onChange:R=>h(R.currentTarget.value),placeholder:e("pages.controlCenter.designGate.scopePathsHint"),disabled:q})]}),(0,Le.jsx)("p",{className:"-mt-2 text-[12px] leading-relaxed text-ink-4",children:e("pages.controlCenter.designGate.scopePathsHelp")}),(0,Le.jsxs)("fieldset",{disabled:q,children:[(0,Le.jsx)("legend",{className:"text-[12.5px] font-medium text-ink",children:e("pages.controlCenter.designGate.scopeActionsInput")}),(0,Le.jsx)("div",{className:"mt-2 flex flex-wrap gap-4",children:["read","write","execute"].map(R=>(0,Le.jsxs)("label",{className:"flex items-center gap-2 text-[12.5px] text-ink-2",children:[(0,Le.jsx)("input",{type:"checkbox",checked:x.includes(R),onChange:F=>y(se=>F.currentTarget.checked?[...se,R]:se.filter(ve=>ve!==R))}),e(`pages.controlCenter.designGate.actions.${IT[R]}`)]},R))})]}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.initialDecision"),(0,Le.jsx)("select",{className:Eg(),value:C,onChange:R=>{let F=R.currentTarget.value;(F==="approved"||F==="not_approved"||F==="not_required")&&A(F)},disabled:q,children:["not_approved","approved","not_required"].map(R=>(0,Le.jsx)("option",{value:R,children:e(`pages.controlCenter.designGate.decisions.${RT[R]}`)},R))})]}),(0,Le.jsx)("p",{className:"text-[12px] leading-relaxed text-ink-4",children:e("pages.controlCenter.designGate.semanticLimit")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q,onClick:()=>{H()},children:e(d?"pages.controlCenter.designGate.saving":"pages.controlCenter.designGate.create")})]})]})]})}var Q=D(W(),1);function DT(e){if(typeof e!="string")return null;switch(e){case"defaults":return"defaults";case"user_config":return"user_config";default:return null}}function ys(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Mq={ready:"pages.controlCenter.configReady",needs_setup:"pages.controlCenter.configNeedsSetup",not_ready:"pages.controlCenter.configNotReady",unknown:"pages.controlCenter.configUnknown",disabled:"pages.controlCenter.configDisabled"};function Rw(e){if(typeof e!="string")return null;switch(e){case"ready":return"ready";case"not_ready":return"not_ready";case"needs_setup":return"needs_setup";case"disabled":return"disabled";case"unknown":return"unknown";default:return null}}function Fq(e){if(!ys(e)||!Object.hasOwn(e,"id")||!Object.hasOwn(e,"category")||!Object.hasOwn(e,"enabled"))return null;let t=e.id,a=e.category,n=e.enabled;return typeof t!="string"||t.length===0||typeof a!="string"||typeof n!="boolean"?null:{id:t,category:a,enabled:n}}function NT(e){if(!ys(e)||!Object.hasOwn(e,"id")||!Object.hasOwn(e,"type")||!Object.hasOwn(e,"label")||!Object.hasOwn(e,"readiness"))return null;let t=e.id,a=e.type,n=e.label,r=Rw(e.readiness);if(typeof t!="string"||t.length===0||typeof a!="string"||typeof n!="string"||r===null)return null;let i=Object.hasOwn(e,"apiKeyEnv")&&typeof e.apiKeyEnv=="string"?e.apiKeyEnv:void 0,o=Object.hasOwn(e,"provider")&&typeof e.provider=="string"?e.provider:void 0,s=Object.hasOwn(e,"model")&&typeof e.model=="string"?e.model:void 0;return{id:t,type:a,label:n,apiKeyEnv:i,provider:o,model:s,readiness:r}}function Uq(e){if(!ys(e)||!Object.hasOwn(e,"name")||!Object.hasOwn(e,"enabled")||!Object.hasOwn(e,"runtimeProfileId")||!Object.hasOwn(e,"runtimeProfileLabel")||!Object.hasOwn(e,"readiness"))return null;let t=e.name,a=e.enabled,n=e.runtimeProfileId,r=e.runtimeProfileLabel,i=Rw(e.readiness);return typeof t!="string"||t.length===0||typeof a!="boolean"||typeof n!="string"||typeof r!="string"||i===null?null:{name:t,enabled:a,runtimeProfileId:n,runtimeProfileLabel:r,readiness:i}}function ET(e){if(!ys(e)||!Object.hasOwn(e,"path")||!Object.hasOwn(e,"reason")||!Object.hasOwn(e,"nextAction"))return null;let t=e.path,a=e.reason,n=e.nextAction;return typeof t!="string"||typeof a!="string"||typeof n!="string"?null:{path:t,reason:a,nextAction:n}}function jq(e){if(!ys(e)||!Object.hasOwn(e,"version")||!Object.hasOwn(e,"source")||!Object.hasOwn(e,"features")||!Object.hasOwn(e,"runtimeProfiles")||!Object.hasOwn(e,"defaultRuntime")||!Object.hasOwn(e,"agents")||!Object.hasOwn(e,"ui")||!Object.hasOwn(e,"warnings"))return null;let t=e.version,a=e.source,n=e.features,r=e.runtimeProfiles,i=e.defaultRuntime,o=e.agents,s=e.ui,l=e.warnings;if(typeof t!="number"||typeof a!="string"||DT(a)===null||!Array.isArray(n)||!Array.isArray(r)||typeof i!="string"||!Array.isArray(o)||!ys(s)||!Array.isArray(l)||!Object.hasOwn(s,"diagnostics")||!ys(s.diagnostics))return null;let c=s.diagnostics;if(!Object.hasOwn(c,"mode")||typeof c.mode!="string")return null;let u=c.mode,d=[];for(let g of n){let h=Fq(g);if(h===null)return null;d.push(h)}let f=[];for(let g of r){let h=NT(g);if(h===null)return null;f.push(h)}let m=[];for(let g of o){let h=Uq(g);if(h===null)return null;m.push(h)}let p=[];for(let g of l){if(typeof g!="string")return null;p.push(g)}let b;if(Object.hasOwn(e,"errors")&&e.errors!==void 0){if(!Array.isArray(e.errors))return null;b=[];for(let g of e.errors){let h=ET(g);if(h===null)return null;b.push(h)}}let v=DT(a);return v===null?null:{version:t,source:v,features:d,runtimeProfiles:f,defaultRuntime:i,agents:m,ui:{diagnostics:{mode:u}},warnings:p,errors:b}}function Hq(e){if(!ys(e)||!Object.hasOwn(e,"profiles"))return null;let t=e.profiles;if(!Array.isArray(t))return null;let a=[];for(let r of t){let i=NT(r);if(i===null)return null;a.push(i)}let n;if(Object.hasOwn(e,"errors")&&e.errors!==void 0){if(!Array.isArray(e.errors))return null;n=[];for(let r of e.errors){let i=ET(r);if(i===null)return null;n.push(i)}}return{profiles:a,errors:n}}function LT(e){let t="inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase";switch(e){case"ready":return t;case"needs_setup":return t.replace("border-line","border-amber/35").replace("text-ink-3","text-amber");case"not_ready":return t.replace("border-line","border-danger/35").replace("text-ink-3","text-danger");default:return t}}function zq({readiness:e,agents:t}){let{t:a}=X(),n=t.filter(v=>v.enabled).length,r=t.length,i=t.filter(v=>v.enabled&&v.readiness!=="ready").length,o=t.filter(v=>{if(!ml(v.name))return!1;let g=Bi[v.name];return g.group==="core_trio"||g.group==="code_chain"}),s=o.filter(v=>v.enabled),l=o.filter(v=>ml(v.name)?Bi[v.name].group==="core_trio":!1),c=o.filter(v=>ml(v.name)?Bi[v.name].group==="code_chain":!1),u=l.some(v=>!v.enabled),d=c.some(v=>!v.enabled),f=s.some(v=>v.readiness==="not_ready"),m=s.some(v=>v.readiness==="needs_setup"),p,b=f||m;return u||f?p="pages.controlCenter.status.corePipelineParalyzed":d||m?p="pages.controlCenter.status.corePipelineDegraded":p="pages.controlCenter.status.corePipelineOk",(0,Q.jsxs)("div",{className:"mt-5 px-[16px] py-[11px] bg-surface border border-line-2 rounded-[4px] flex items-center gap-[16px] text-[12.5px] text-ink-3 flex-wrap",children:[(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.enabled")}),(0,Q.jsxs)("span",{className:"text-ink font-semibold",children:[(0,Q.jsx)("span",{className:"font-mono",children:n})," /"," ",(0,Q.jsx)("span",{className:"font-mono",children:r})]})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.notReady")}),(0,Q.jsx)("span",{className:"text-ink font-semibold",children:(0,Q.jsx)("span",{className:"font-mono",children:i})})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.corePipeline")}),(0,Q.jsx)("span",{className:"text-ink font-semibold",children:a(p)})]}),b&&(0,Q.jsx)("span",{className:"ml-auto px-[9px] py-[3px] rounded-[2px] text-[10.5px] font-mono tracking-[0.02em] font-medium border border-amber text-amber bg-amber/10",children:a("pages.controlCenter.status.needsConfig")})]})}function qq({currentDefault:e,profiles:t,onDefaultChange:a,saving:n}){let{t:r}=X();return(0,Q.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] px-[18px] py-[14px]",children:[(0,Q.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:r("pages.controlCenter.defaultRuntimeDescription")}),(0,Q.jsx)("select",{value:e,onChange:i=>{a(i.target.value)},disabled:n,className:"bg-surface border border-line rounded-[3px] px-3 py-[6px] text-[12.5px] text-ink focus:outline-none focus:border-gov disabled:opacity-50 min-w-[200px]","aria-label":r("pages.controlCenter.defaultRuntime"),children:t.map(i=>(0,Q.jsxs)("option",{value:i.id,children:[i.label," \u2014 ",va("readiness",i.readiness,r)]},i.id))}),n&&(0,Q.jsx)("span",{className:"ml-3 text-ink-3 text-[12px]",children:r("pages.controlCenter.saving")})]})}function Vq({config:e}){let{t}=X(),[a,n]=(0,Rn.useState)(!1),r={version:e.version,source:e.source,features:e.features,runtimeProfiles:e.runtimeProfiles,defaultRuntime:e.defaultRuntime,agents:e.agents,ui:e.ui,warnings:e.warnings,errors:e.errors},i=(0,Rn.useCallback)(()=>{let s=xT(r);navigator.clipboard.writeText(s).then(()=>{n(!0),U.success(t("pages.controlCenter.copyDiagnostics")),setTimeout(()=>n(!1),2e3)},()=>{U.error(t("pages.controlCenter.saveFailed"))})},[r,t]),o=bT(r);return(0,Q.jsxs)("details",{className:"group",children:[(0,Q.jsx)("summary",{className:"text-ink-3 text-[13px] cursor-pointer hover:text-ink-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:t("pages.controlCenter.advancedDiagnostics")}),(0,Q.jsxs)("div",{className:"mt-4 space-y-5",children:[(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.features")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2",children:e.features.length===0?(0,Q.jsx)("span",{className:"text-ink-4 text-[13px]",children:"\u2014"}):(0,Q.jsx)("div",{className:"space-y-1",children:e.features.map(s=>(0,Q.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink-2",children:va("featureId",s.id,t)}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:"text-ink-3",children:va("featureCategory",s.category,t)}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:s.enabled?"text-ink-2":"text-ink-4 line-through",children:s.enabled?t("pages.controlCenter.on"):t("pages.controlCenter.off")})]},s.id))})})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.runtimeProfiles")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2",children:e.runtimeProfiles.length===0?(0,Q.jsx)("span",{className:"text-ink-4 text-[13px]",children:"\u2014"}):(0,Q.jsx)("div",{className:"space-y-1",children:e.runtimeProfiles.map(s=>(0,Q.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink-2",children:s.label}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:"text-ink-3",children:s.type}),(0,Q.jsx)("span",{className:LT(s.readiness),children:va("readiness",s.readiness,t)})]},s.id))})})]}),e.warnings.length>0&&(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.warnings")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-amber/20 border-l-2 border-l-amber rounded-[6px] px-3 py-2",children:(0,Q.jsx)("ul",{className:"space-y-1",children:e.warnings.map((s,l)=>(0,Q.jsx)("li",{className:"text-ink-2 text-[13px]",children:s},l))})})]}),e.errors&&e.errors.length>0&&(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.configErrors")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-danger/20 border-l-2 border-l-danger rounded-[6px] px-3 py-2",children:(0,Q.jsx)("ul",{className:"space-y-2",children:e.errors.map((s,l)=>(0,Q.jsxs)("li",{className:"text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink font-medium",children:s.path}),(0,Q.jsx)("span",{className:"text-ink-4",children:" \u2014 "}),(0,Q.jsx)("span",{className:"text-ink-2",children:s.reason}),(0,Q.jsxs)("div",{className:"text-ink-3 text-[12px] mt-0.5",children:["\u2192 ",s.nextAction]})]},l))})})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.readinessLabel")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2 space-y-2",children:Object.keys(o).map(s=>{let l=Rw(s);if(l===null)return null;let c=o[l];return c.length===0?null:(0,Q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Q.jsx)("span",{className:LT(l),children:va("readiness",l,t)}),(0,Q.jsx)("span",{className:"text-ink-3 text-[13px]",children:c.map(u=>u.name).join(", ")})]},l)})})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Q.jsx)("button",{type:"button",onClick:i,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:a?"\u2713":t("pages.controlCenter.copyDiagnostics")}),(0,Q.jsx)("span",{className:"text-ink-4 text-[12px]",children:t("pages.controlCenter.redactedNote")})]})]})]})}function OT(){let{t:e,i18n:t}=X(),[a,n]=(0,Rn.useState)(null),[r,i]=(0,Rn.useState)(null),[o,s]=(0,Rn.useState)("loading"),[l,c]=(0,Rn.useState)(null),[u,d]=(0,Rn.useState)(null),[f,m]=(0,Rn.useState)(!1),p=(0,Rn.useCallback)(async()=>{s("loading"),c(null);let[y,C]=await Promise.all([Zr(),Z1()]);if(!y.success){s("error"),c(y.error);return}let A=jq(y.data);if(A===null){s("error"),c("Config summary data has unexpected shape");return}if(n(A),!C.success)i(null);else{let I=Hq(C.data);i(I)}s("loaded")},[]);(0,Rn.useEffect)(()=>{p()},[p]);let b=(0,Rn.useCallback)(async(y,C,A)=>{d(y);let I=await Q1(y,C,A);if(d(null),!I.success){U.error(e("pages.controlCenter.saveFailed"));return}await p()},[p,e]),v=(0,Rn.useCallback)(async y=>{m(!0);let C=await J1(y);if(m(!1),!C.success){U.error(e("pages.controlCenter.saveFailed"));return}await p()},[p,e]);if(o==="loading")return(0,Q.jsx)(Me,{children:(0,Q.jsx)(It,{cardCount:3,label:e("common.loading")})});if(o==="error")return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,Q.jsx)("p",{children:e("pages.controlCenter.loadError")}),l&&(0,Q.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:l})]})]});if(a===null)return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsx)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:(0,Q.jsx)("p",{children:e("pages.controlCenter.loadError")})})]});let g={version:a.version,source:a.source,features:a.features,runtimeProfiles:a.runtimeProfiles,defaultRuntime:a.defaultRuntime,agents:a.agents,ui:a.ui,warnings:a.warnings,errors:a.errors},h=kw(g),x=r?.profiles??a.runtimeProfiles;return(0,Q.jsx)(Me,{children:(0,Q.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.controlCenter.subtitle")}),(0,Q.jsx)(yT,{}),(0,Q.jsx)(zq,{readiness:h,agents:a.agents}),(0,Q.jsx)(AT,{}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-agents",children:[(0,Q.jsx)(me,{id:"section-agents",children:e("pages.controlCenter.internalAgents")}),(0,Q.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.controlCenter.internalAgentsDescription")}),(0,Q.jsx)("p",{className:h==="ready"?"text-ink-4 text-[13px] leading-relaxed mb-3":"text-amber text-[13px] leading-relaxed mb-3",children:e(Mq[h])}),(()=>{let{groups:y,unknown:C}=vT(a.agents),A=t.language.startsWith("en")?"en":"zh-CN";return(0,Q.jsxs)(Q.Fragment,{children:[hT.map(I=>(0,Q.jsx)(ST,{groupMeta:I,agents:(y[I.id]??[]).filter(k=>k.name!==Bi.signalCollector.name),profiles:x,onBindingChange:b,saving:u,locale:A},I.id)),C.length>0&&(0,Q.jsx)("div",{className:"mt-3 px-3 py-2 border border-amber/30 border-l-2 border-l-amber rounded-[4px] bg-amber/10 text-[12.5px] text-ink-3",children:e("pages.controlCenter.unknownAgentsWarning",{count:C.length,names:C.map(I=>I.name).join(", ")})})]})})()]}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-default-runtime",children:[(0,Q.jsx)(me,{id:"section-default-runtime",children:e("pages.controlCenter.defaultRuntime")}),(0,Q.jsx)(qq,{currentDefault:a.defaultRuntime,profiles:x,onDefaultChange:v,saving:f})]}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-runtime-profiles",children:[(0,Q.jsx)(me,{id:"section-runtime-profiles",children:e("pages.controlCenter.profiles.sectionTitle")}),(0,Q.jsx)(CT,{profiles:x,defaultRuntimeId:a.defaultRuntime,onMutated:p})]}),(0,Q.jsx)("section",{className:"mt-8","aria-labelledby":"section-diagnostics",children:(0,Q.jsx)(Vq,{config:a})}),(0,Q.jsx)("p",{className:"mt-10 pt-[18px] border-t border-line-2 text-ink-4 text-[12px] leading-[1.6] max-w-[60ch] font-mono",children:e("pages.controlCenter.footerNote")})]})})}var mt=D(ee(),1);var Iw={completed:!1,step:0,status:"pending"},Gq="pd_onboarding";function Aw(e){return`${Gq}_${e}`}function $q(e){if(typeof e!="object"||e===null)return!1;let t=Object.hasOwn(e,"completed")?Reflect.get(e,"completed"):void 0,a=Object.hasOwn(e,"step")?Reflect.get(e,"step"):void 0,n=Object.hasOwn(e,"status")?Reflect.get(e,"status"):void 0,r=Object.hasOwn(e,"completedAt")?Reflect.get(e,"completedAt"):void 0;return typeof t=="boolean"&&typeof a=="number"&&(n==="pending"||n==="demo"||n==="skipped"||n==="evidence_found")&&(!Object.hasOwn(e,"completedAt")||typeof r=="string")}function Og(e){try{let t=localStorage.getItem(Aw(e));if(!t)return Iw;let a=JSON.parse(t);return $q(a)?a:Iw}catch(t){return console.error("[onboarding-state] Failed to read onboarding state:",t),Iw}}function TT(e,t){try{return localStorage.setItem(Aw(e),JSON.stringify(t)),!0}catch(a){return console.error("[onboarding-state] Failed to save onboarding state:",a),!1}}function PT(e){try{return localStorage.removeItem(Aw(e)),!0}catch(t){return console.error("[onboarding-state] Failed to reset onboarding state:",t),!1}}var $=D(W(),1);function _T(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function BT(e){if(!_T(e)||!Object.hasOwn(e,"name")||!Object.hasOwn(e,"path")||!Object.hasOwn(e,"lastSync"))return null;let t=e.name,a=e.path,n=e.lastSync;if(typeof t!="string"||t.length===0||typeof a!="string"||a.length===0||n!==null&&typeof n!="string")return null;let r=null;if(Object.hasOwn(e,"config")&&e.config!==null){if(!_T(e.config))return null;let i=e.config;if(!Object.hasOwn(i,"workspaceName")||!Object.hasOwn(i,"enabled")||!Object.hasOwn(i,"syncEnabled")||typeof i.workspaceName!="string"||typeof i.enabled!="boolean"||typeof i.syncEnabled!="boolean")return null;let o=Object.hasOwn(i,"displayName")&&typeof i.displayName=="string"?i.displayName:null;r={workspaceName:i.workspaceName,enabled:i.enabled,displayName:o,syncEnabled:i.syncEnabled}}return{name:t,path:a,lastSync:n,config:r}}function Wq(e){if(!Array.isArray(e))return null;let t=[];for(let a of e){let n=BT(a);if(n===null)return null;t.push(n)}return t}function Dw(){return typeof window>"u"?void 0:window.pdCompanion}function MT(){let{t:e}=X(),{soundEnabled:t,setSoundEnabled:a}=Zm(),[n,r]=(0,mt.useState)("loading"),[i,o]=(0,mt.useState)(null),[s,l]=(0,mt.useState)(""),[c,u]=(0,mt.useState)(!1),[d,f]=(0,mt.useState)(null),[m,p]=(0,mt.useState)(""),[b,v]=(0,mt.useState)(""),[g,h]=(0,mt.useState)(!1),[x,y]=(0,mt.useState)([]),[C,A]=(0,mt.useState)(""),[I,k]=(0,mt.useState)(""),[T,_]=(0,mt.useState)("zh-CN"),[M,H]=(0,mt.useState)(null),[Y,oe]=(0,mt.useState)(null),[q,R]=(0,mt.useState)(null),F=(0,mt.useCallback)(async()=>{r("loading"),o(null);let ne=Hm();l(ne??"");let Ce=await zm();if(!Ce.success){r("error"),o(Ce.error??"Unknown error");return}let ot=Wq(Ce.data);if(ot===null){r("error"),o("Workspace data has unexpected shape");return}y(ot);let be=await oL();if(be.success&&be.data){let xa=be.data.outputLanguage;(xa==="zh-CN"||xa==="en")&&_(xa)}let dt=await Gm();dt.success&&dt.data&&f(dt.data),r("loaded")},[]);(0,mt.useEffect)(()=>{F()},[F]);let se=(0,mt.useCallback)(async()=>{H(null);let ne=await Zr();if(!ne.success||!ne.data){U.error(e("components.onboardingFlag.loadFailed"));return}let Ce=ne.data.features.find(ot=>ot.id==="new_user_onboarding");if(!Ce){U.error(e("components.onboardingFlag.loadFailed"));return}H(Ce.enabled)},[e]);(0,mt.useEffect)(()=>{se()},[se]);let ve=(0,mt.useCallback)(async()=>{oe(null);let ne=await Zr();if(!ne.success||!ne.data){U.error(e("components.fullPipelineFlag.loadFailed"));return}let Ce=ne.data.features.find(ot=>ot.id==="prompt_full_pipeline");if(!Ce){U.error(e("components.fullPipelineFlag.loadFailed"));return}oe(Ce.enabled)},[e]);(0,mt.useEffect)(()=>{ve()},[ve]);let z=(0,mt.useCallback)(async()=>{if(m.trim().length===0||b.trim().length===0){U.error(e("pages.settings.ownerIdentity.required"));return}h(!0);try{if(!(await eL(m.trim(),b.trim())).success){U.error(e("pages.settings.ownerIdentity.operationFailed"));return}let Ce=await Gm();Ce.success&&Ce.data&&f(Ce.data),p(""),v(""),U.success(e("pages.settings.ownerIdentity.registered"))}finally{h(!1)}},[m,b,e]),L=(0,mt.useCallback)(async()=>{h(!0);try{if(!(await tL()).success){U.error(e("pages.settings.ownerIdentity.operationFailed"));return}let Ce=await Gm();Ce.success&&Ce.data&&f(Ce.data),U.success(e("pages.settings.ownerIdentity.unregistered"))}finally{h(!1)}},[e]),re=(0,mt.useCallback)(async()=>{let ne=s.trim();if(ne.length!==0)try{let Ce=Dw();if(Ce!==void 0){let ot=await Ce.configureConsoleToken(ne);if(!ot.persisted){U.error(e("pages.settings.tokenSaveFailed")),ot.nextAction&&U.info(ot.nextAction);return}ot.reason==="external_console_attached"?(U.info(e("pages.settings.tokenExternalAttached")),ot.nextAction&&U.info(ot.nextAction,{duration:8e3})):ot.restartRequested?U.success(e("pages.settings.tokenSavedRestarting")):U.success(e("pages.settings.tokenSaved"))}else U.success(e("pages.settings.tokenSaved"));Iu(ne),await se()}catch{U.error(e("pages.settings.tokenSaveFailed"))}},[s,se,e]),qe=(0,mt.useCallback)(async()=>{u(!1);let ne=Dw();if(ne===void 0){so(),l(""),U.success(e("pages.settings.tokenClearedSession"));return}try{let Ce=await ne.clearConsoleToken();if(!Ce.cleared){Ce.reason==="inherited_env_token"?U.info(e("pages.settings.tokenInheritedEnv")):U.error(e("pages.settings.tokenClearFailed")),Ce.nextAction&&U.info(Ce.nextAction,{duration:8e3});return}so(),l(""),Ce.reason==="external_console_attached"?U.info(e("pages.settings.tokenClearedExternalAttached")):Ce.restartRequested?U.success(e("pages.settings.tokenClearedRestarting")):U.success(e("pages.settings.tokenCleared")),Ce.nextAction&&U.info(Ce.nextAction,{duration:8e3})}catch{U.error(e("pages.settings.tokenClearFailed"))}},[e]),Ee=(0,mt.useCallback)(async()=>{let ne=C.trim(),Ce=I.trim();if(ne.length===0||Ce.length===0)return;let ot=await D1(ne,Ce);if(!ot.success){U.error(ot.error??"Failed to add workspace");return}let be=BT(ot.data);if(be===null){U.success(e("pages.settings.workspaceAdded")),await F();return}y(dt=>[...dt,be]),A(""),k(""),U.success(e("pages.settings.workspaceAdded"))},[C,I,e,F]),G=(0,mt.useCallback)(async ne=>{let Ce=await L1(ne);if(!Ce.success){U.error(Ce.error??"Failed to remove workspace"),R(null);return}y(ot=>ot.filter(be=>be.name!==ne)),R(null),U.success(e("pages.settings.workspaceRemoved"))},[e]),ae=(0,mt.useCallback)(async ne=>{let Ce=await N1(ne);if(!Ce.success){U.error(Ce.error??"Failed to sync workspace");return}await F(),U.success(e("pages.settings.syncWorkspace"))},[F,e]),we=(0,mt.useCallback)(async ne=>{if(ne!=="zh-CN"&&ne!=="en")return;let Ce=await sL(ne);if(!Ce.success){U.error(Ce.error??e("pages.settings.languageLoadError"));return}Ce.data&&(Ce.data.outputLanguage==="zh-CN"||Ce.data.outputLanguage==="en")&&_(Ce.data.outputLanguage),U.success(e("pages.settings.languageSaved"))},[e]),ze=(0,mt.useCallback)(async()=>{if(M===null)return;let ne=!M,Ce=await Lu("new_user_onboarding",ne);if(!Ce.success||!Ce.data){U.error(e("components.onboardingFlag.toggleFailed"));return}H(Ce.data.enabled),U.success(e(ne?"components.onboardingFlag.enabled":"components.onboardingFlag.disabled"))},[M,e]),ke=(0,mt.useCallback)(async()=>{if(Y===null)return;let ne=!Y,Ce=await Lu("prompt_full_pipeline",ne);if(!Ce.success||!Ce.data){U.error(e("components.fullPipelineFlag.toggleFailed"));return}oe(Ce.data.enabled),U.success(e(ne?"components.fullPipelineFlag.enabled":"components.fullPipelineFlag.disabled"))},[Y,e]),tt=x[0]?.name??"default",Ct=(0,mt.useCallback)(()=>{if(window.confirm(e("components.onboardingReset.resetConfirm"))){if(!PT(tt)){U.error(e("components.onboardingReset.resetFailed"));return}U.success(e("components.onboardingReset.resetSuccess"))}},[tt,e]);return n==="loading"?(0,$.jsx)(Me,{children:(0,$.jsx)(It,{cardCount:3,label:e("common.loading")})}):n==="error"?(0,$.jsxs)(Me,{children:[(0,$.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.settings.eyebrow")}),(0,$.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.settings.title")}),(0,$.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,$.jsx)("p",{children:e("pages.settings.loadError")}),i&&(0,$.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:i})]})]}):(0,$.jsx)(Me,{children:(0,$.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,$.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.settings.eyebrow")}),(0,$.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.settings.title")}),(0,$.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.settings.subtitle")}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-auth",children:[(0,$.jsx)(me,{id:"section-auth",children:e("pages.settings.auth")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("label",{htmlFor:"bearer-token-input",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.bearerToken")}),(0,$.jsx)("input",{id:"bearer-token-input",type:"password",value:s,onChange:ne=>l(ne.target.value),placeholder:e("pages.settings.enterAccessToken"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"}),(0,$.jsxs)("div",{className:"flex items-center justify-between mt-3 gap-3",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("button",{onClick:re,disabled:s.trim().length===0,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.save")}),c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("button",{onClick:qe,className:"border border-amber bg-amber text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:opacity-90 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.clearTokenConfirm")}),(0,$.jsx)("button",{onClick:()=>u(!1),className:"border border-line text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-gov transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.cancel")})]}):(0,$.jsx)("button",{onClick:()=>u(!0),className:"border border-line text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-gov hover:text-ink transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.clearToken")})]}),(0,$.jsx)("span",{className:"text-ink-4 text-[12px]",children:Dw()===void 0?e("pages.settings.tokenSessionOnly"):e("pages.settings.tokenDesktopStored")})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-owner-identity",children:[(0,$.jsx)(me,{id:"section-owner-identity",children:e("pages.settings.ownerIdentity.title")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.settings.ownerIdentity.intro")}),d===null?(0,$.jsx)("div",{className:"text-ink-4 text-[12px]",children:e("pages.settings.ownerIdentity.loading")}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 text-[13px] mb-2","data-testid":"owner-identity-status",children:[(0,$.jsx)("span",{className:`inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${d.resolved.source==="none"?"bg-amber text-ink":d.resolved.source==="invalid_env"?"bg-danger text-paper":"bg-green text-ink"}`,role:"status",children:d.resolved.source==="none"?e("pages.settings.ownerIdentity.statusMissing"):d.resolved.source==="invalid_env"?e("pages.settings.ownerIdentity.statusInvalid"):e("pages.settings.ownerIdentity.statusConfigured")}),(0,$.jsxs)("span",{className:"text-ink-3 text-[12px]",children:[d.resolved.source==="env"&&e("pages.settings.ownerIdentity.sourceEnv"),d.resolved.source==="file"&&e("pages.settings.ownerIdentity.sourceFile"),d.resolved.source==="invalid_env"&&e("pages.settings.ownerIdentity.sourceInvalid"),d.resolved.source==="none"&&e("pages.settings.ownerIdentity.sourceNone")]})]}),(0,$.jsxs)("div",{className:"flex items-center gap-2 text-[13px] mb-2","data-testid":"owner-governance-readiness","data-ready":d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?"true":"false",children:[(0,$.jsx)("span",{className:`inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?"bg-green text-ink":"bg-amber text-ink"}`,role:"status",children:d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?e("pages.settings.ownerIdentity.governanceReady"):e("pages.settings.ownerIdentity.governanceNotReady")}),(d.governance.ownerIdentityConfiguration!=="configured"||d.governance.authenticationMode!=="authenticated")&&(0,$.jsx)("span",{className:"text-ink-3 text-[12px]",children:d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="no_auth"?e("pages.settings.ownerIdentity.governanceReasonTokenAuth"):e("pages.settings.ownerIdentity.governanceReasonIdentity")})]}),d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="no_auth"&&(0,$.jsx)("div",{className:"text-ink-4 text-[12px] mb-3","data-testid":"owner-governance-next-action",children:e("pages.settings.ownerIdentity.governanceNextActionTokenAuth")}),d.resolved.error!==void 0&&(0,$.jsx)("div",{className:"text-danger text-[12px] mb-3","data-testid":"owner-identity-error",children:d.resolved.error}),d.resolved.source==="invalid_env"&&(0,$.jsx)("div",{className:"text-ink-4 text-[12px] mb-3","data-testid":"owner-identity-invalid-env-hint",children:e("pages.settings.ownerIdentity.invalidEnvHint")}),d.resolved.source==="file"&&d.fileRecord!==null&&(0,$.jsxs)("div",{className:"text-ink-4 text-[12px] mb-3 font-mono",children:[e("pages.settings.ownerIdentity.ownerIdLabel"),": ",d.fileRecord.ownerId," \xB7"," ",e("pages.settings.ownerIdentity.registeredAt")," ",d.fileRecord.registeredAt.slice(0,10)]}),d.fileError!==void 0&&(0,$.jsx)("div",{className:"text-danger text-[12px] mb-3","data-testid":"owner-identity-file-error",children:d.fileError}),d.resolved.source==="env"?(0,$.jsx)("div",{className:"text-ink-4 text-[12px]",children:e("pages.settings.ownerIdentity.envHint")}):(0,$.jsxs)("div",{className:"mt-3",children:[(0,$.jsx)("label",{htmlFor:"owner-id-input",className:"block text-sm font-medium text-ink mb-1",children:e("pages.settings.ownerIdentity.ownerIdLabel")}),(0,$.jsx)("input",{id:"owner-id-input",type:"text",value:m,onChange:ne=>p(ne.target.value),disabled:g,placeholder:"owner-alice",className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov disabled:opacity-50"}),(0,$.jsx)("label",{htmlFor:"credential-id-input",className:"block text-sm font-medium text-ink mt-3 mb-1",children:e("pages.settings.ownerIdentity.credentialIdLabel")}),(0,$.jsx)("input",{id:"credential-id-input",type:"text",value:b,onChange:ne=>v(ne.target.value),disabled:g,placeholder:"cred-...",className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov disabled:opacity-50"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[(0,$.jsx)("button",{type:"button",onClick:z,disabled:g,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.ownerIdentity.register")}),d.resolved.source==="file"&&(0,$.jsx)("button",{type:"button",onClick:L,disabled:g,className:"border border-line text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-surface transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:e("pages.settings.ownerIdentity.unregister")})]})]})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-principle-language",children:[(0,$.jsx)(me,{id:"section-principle-language",children:e("pages.settings.principleLanguage")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.settings.principleLanguageDescription")}),(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsxs)("label",{htmlFor:"output-language-select",className:"text-sm font-medium text-ink",children:[e("pages.settings.principleLanguage"),":"]}),(0,$.jsxs)("select",{id:"output-language-select",value:T,onChange:ne=>we(ne.target.value),className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov",children:[(0,$.jsx)("option",{value:"zh-CN",children:e("pages.settings.languageZhCN")}),(0,$.jsx)("option",{value:"en",children:e("pages.settings.languageEn")})]})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-sound-alerts",children:[(0,$.jsx)(me,{id:"section-sound-alerts",children:e("pages.settings.notifications")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{htmlFor:"sound-alerts-toggle",className:"block text-sm font-medium text-ink",children:e("pages.settings.soundAlerts")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("pages.settings.soundAlertsDescription")})]}),(0,$.jsx)("button",{id:"sound-alerts-toggle",type:"button",role:"switch","aria-checked":t,onClick:()=>a(!t),className:xe("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",t?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",t?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-workspaces",children:[(0,$.jsx)(me,{id:"section-workspaces",children:e("pages.settings.workspace")}),x.length>0?(0,$.jsx)("div",{className:"space-y-[10px] mb-5",children:x.map(ne=>(0,$.jsx)("article",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,$.jsx)("div",{className:"font-medium text-ink text-sm",children:ne.name}),(0,$.jsx)("div",{className:"text-ink-3 text-[13px] mt-1 font-mono break-all",children:ne.path}),(0,$.jsxs)("div",{className:"text-ink-4 text-[12px] mt-1",children:[e("pages.settings.lastSync"),":"," ",ne.lastSync??"\u2014"]})]}),(0,$.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:q?.workspaceName===ne.name?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{className:"text-ink-2 text-[12px]",children:e("pages.settings.confirmDeleteDescription",{name:ne.name})}),(0,$.jsx)("button",{onClick:()=>G(ne.name),className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.confirm")}),(0,$.jsx)("button",{onClick:()=>R(null),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.cancel")})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("button",{onClick:()=>ae(ne.name),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.syncWorkspace")}),(0,$.jsx)("button",{onClick:()=>R({workspaceName:ne.name}),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.removeWorkspace")})]})})]})},ne.name))}):(0,$.jsx)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3 mb-5",children:"\u2014"}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-end gap-3",children:[(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsx)("label",{htmlFor:"add-workspace-name",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.name")}),(0,$.jsx)("input",{id:"add-workspace-name",type:"text",value:C,onChange:ne=>A(ne.target.value),placeholder:e("pages.settings.addNamePlaceholder"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsx)("label",{htmlFor:"add-workspace-path",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.path")}),(0,$.jsx)("input",{id:"add-workspace-path",type:"text",value:I,onChange:ne=>k(ne.target.value),placeholder:e("pages.settings.addPathPlaceholder"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,$.jsx)("button",{onClick:Ee,disabled:C.trim().length===0||I.trim().length===0,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.addWorkspace")})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-onboarding-flag",children:[(0,$.jsx)(me,{id:"section-onboarding-flag",children:e("components.onboardingFlag.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0",children:[(0,$.jsx)("label",{htmlFor:"onboarding-flag-toggle",className:"block text-sm font-medium text-ink",children:e("components.onboardingFlag.label")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("components.onboardingFlag.description")})]}),(0,$.jsx)("button",{id:"onboarding-flag-toggle",type:"button",role:"switch","aria-checked":M??!1,"aria-label":e("components.onboardingFlag.toggleAriaLabel"),onClick:ze,disabled:M===null,className:xe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",M?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",M?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-full-pipeline-flag",children:[(0,$.jsx)(me,{id:"section-full-pipeline-flag",children:e("components.fullPipelineFlag.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0",children:[(0,$.jsx)("label",{htmlFor:"full-pipeline-flag-toggle",className:"block text-sm font-medium text-ink",children:e("components.fullPipelineFlag.label")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("components.fullPipelineFlag.description")})]}),(0,$.jsx)("button",{id:"full-pipeline-flag-toggle",type:"button",role:"switch","aria-checked":Y??!1,"aria-label":e("components.fullPipelineFlag.toggleAriaLabel"),onClick:ke,disabled:Y===null,className:xe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",Y?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",Y?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{"aria-labelledby":"section-onboarding-reset",children:[(0,$.jsx)(me,{id:"section-onboarding-reset",children:e("components.onboardingReset.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsx)("button",{onClick:Ct,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("components.onboardingReset.resetButton")})})]})]})})}var _a=D(ee(),1);var gl=D(ee(),1);var ri=D(ee(),1);var ii=D(W(),1),Kq=Object.defineProperty,bo=(e,t)=>Kq(e,"name",{value:t,configurable:!0}),Yq="AlertDialog",[Xq,Ete]=Tu(Yq,[Wy]),vo=Wy(),FT=bo(e=>{let{__scopeAlertDialog:t,...a}=e,n=vo(t);return(0,ii.jsx)(jc,{...n,...a,modal:!0})},"AlertDialog"),Zq=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(Hu,{...i,...r,ref:a})},"AlertDialogTrigger")),UT=bo(e=>{let{__scopeAlertDialog:t,...a}=e,n=vo(t);return(0,ii.jsx)(Hc,{...n,...a})},"AlertDialogPortal"),Lw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(fs,{...i,...r,ref:a})},"AlertDialogOverlay")),Qq="AlertDialogContent",[Jq,eV]=Xq(Qq),Nw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,children:r,...i}=t,o=vo(n),s=ri.useRef(null),l=qa(a,s),c=ri.useRef(null);return(0,ii.jsx)(Jq,{scope:n,cancelRef:c,children:(0,ii.jsx)(ps,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:rr(i.onOpenAutoFocus,u=>{u.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:r})})},"AlertDialogContent")),Ew=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(ms,{...i,...r,ref:a})},"AlertDialogTitle")),Ow=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(gs,{...i,...r,ref:a})},"AlertDialogDescription")),Tw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(ll,{...i,...r,ref:a})},"AlertDialogAction")),tV="AlertDialogCancel",Pw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=eV(tV,n),o=vo(n),s=qa(a,i);return(0,ii.jsx)(ll,{...o,...r,ref:s})},"AlertDialogCancel"));var Br=D(W(),1),Tg=FT;var nV=UT,jT=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Lw,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));jT.displayName=Lw.displayName;var Qu=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsxs)(nV,{children:[(0,Br.jsx)(jT,{}),(0,Br.jsx)(Nw,{ref:a,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Qu.displayName=Nw.displayName;var Ju=({className:e,...t})=>(0,Br.jsx)("div",{className:xe("flex flex-col gap-2 text-center sm:text-left",e),...t});Ju.displayName="AlertDialogHeader";var ef=({className:e,...t})=>(0,Br.jsx)("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ef.displayName="AlertDialogFooter";var tf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Ew,{ref:a,className:xe("text-lg font-semibold",e),...t}));tf.displayName=Ew.displayName;var af=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Ow,{ref:a,className:xe("text-sm text-muted-foreground",e),...t}));af.displayName=Ow.displayName;var nf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Tw,{ref:a,className:xe(vg(),e),...t}));nf.displayName=Tw.displayName;var rf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Pw,{ref:a,className:xe(vg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));rf.displayName=Pw.displayName;var te=D(W(),1);function HT(){let{t:e,i18n:t}=X(),[a,n]=(0,_a.useState)(null),[r,i]=(0,_a.useState)(null),[o,s]=(0,_a.useState)("loading"),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(null),[f,m]=(0,_a.useState)(null),[p,b]=(0,_a.useState)(null),[v,g]=(0,_a.useState)(!1),[h,x]=(0,_a.useState)(!1),[y,C]=(0,_a.useState)(null),[A,I]=(0,_a.useState)(null),k=(0,_a.useCallback)(async()=>{s("loading"),d(null),m(null);let[q,R,F]=await Promise.all([Gx(),xL(),wL()]);if(!q.success){s("error"),d(q.error);return}let se=Cu(q.data);if(se===null){s("error"),d("Update status data has unexpected shape");return}if(n(se),!R.success)i(null),m(R.error??"Update history unavailable");else{let ve=_m(R.data);i(ve),ve===null&&m("Update history data has unexpected shape")}F.success?C(Mm(F.data)):C(null),s("loaded")},[]);(0,_a.useEffect)(()=>{k()},[k]);let T=(0,_a.useCallback)(async()=>{c(!0);let q=await Gx();if(!q.success){U.error(e("pages.update.checkFailed")),c(!1);return}let R=Cu(q.data);if(R===null){U.error(e("pages.update.checkFailed")),c(!1);return}n(R),c(!1)},[e]),_=(0,_a.useCallback)(async()=>{g(!1),x(!0),b(null);let q=await yL();if(x(!1),!q.success){b({success:!1,message:q.error??"Unknown error"}),U.error(e("pages.update.updateFailed",{message:q.error??"Unknown error"}));return}let R=q.data;if(R.state==="update_in_progress"&&R.transactionId){I({transactionId:R.transactionId,phase:null}),U.info(e("pages.update.inProgressToast"));return}R.success?(b({success:!0,message:R.message,newVersion:R.newVersion,fromVersion:a?.currentVersion,requiresRestart:R.requiresRestart,gatewayNotice:R.gatewayNotice}),U.success(e("pages.update.fullUpdateSuccess")),await k()):(b({success:!1,refusal:R.refusal,message:R.message,reason:R.reason,nextAction:R.nextAction,gatewayNotice:R.gatewayNotice}),U.error(e("pages.update.updateFailed",{message:R.message})))},[e,k,a?.currentVersion]);if((0,_a.useEffect)(()=>{if(!A)return;let q=!1,R=0,F=async()=>{if(q)return;R+=1;let ve=await kL(A.transactionId);if(q)return;let z=ve.success?Fm(ve.data):null;if(z===null||!z.exists){R>=200&&(I(null),b({success:!1,message:e("pages.update.inProgressTimeout"),reason:"transaction_unresolved"}));return}I({transactionId:A.transactionId,phase:z.lastState}),z.terminal&&(I(null),z.lastState==="confirmed"?(b({success:!0,message:e("pages.update.inProgressConfirmed",{version:z.productVersion??""}),requiresRestart:!0}),U.success(e("pages.update.fullUpdateSuccess"))):b({success:!1,message:e("pages.update.inProgressEnded",{state:z.lastState??""})}),await k())},se=setInterval(F,3e3);return F(),()=>{q=!0,clearInterval(se)}},[A?.transactionId,e,k]),o==="loading")return(0,te.jsx)(Me,{children:(0,te.jsx)(It,{cardCount:2,label:e("common.loading")})});if(o==="error")return(0,te.jsxs)(Me,{children:[(0,te.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.update.eyebrow")}),(0,te.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.update.title")}),(0,te.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,te.jsx)("p",{children:e("pages.update.loadError")}),u&&(0,te.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:u})]})]});let M=a?.state??(a?a.error?"check_failed":a.hasUpdate?"update_available":"up_to_date":"up_to_date"),H=M==="up_to_date",oe=M==="update_blocked"||M==="check_failed"?(q=>q?e(`pages.update.reason.${q}`,{defaultValue:q}):void 0)(a?.reason):void 0;return(0,te.jsxs)(Me,{children:[(0,te.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[y?.needsRecovery&&y.unfinished.length>0&&(0,te.jsxs)("div",{className:"mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2",role:"alert",children:[(0,te.jsx)("p",{className:"font-medium text-amber",children:e("pages.update.recoveryBanner")}),y.unfinished.slice(0,3).map(q=>(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.recoveryItem",{id:q.transactionId,phase:q.lastState??"\u2014"})},q.transactionId)),y.nextAction&&(0,te.jsx)("p",{className:"mt-2 text-[12px] text-ink-3",children:y.nextAction})]}),y?.needsRecovery&&y.recoveryRequired.length>0&&(0,te.jsxs)("div",{className:"mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2",role:"alert",children:[(0,te.jsx)("p",{className:"font-medium text-amber",children:e("pages.update.recoveryRequiredBanner")}),y.recoveryRequired.slice(0,3).map(q=>(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.recoveryRequiredItem",{id:q.transactionId})},q.transactionId)),y.nextAction&&(0,te.jsx)("p",{className:"mt-2 text-[12px] text-ink-3",children:y.nextAction})]}),(0,te.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.update.eyebrow")}),(0,te.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.update.title")}),(0,te.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.update.subtitle")}),(0,te.jsxs)("section",{className:"mb-8","aria-labelledby":"section-update-status",children:[(0,te.jsx)(me,{id:"section-update-status",children:e("pages.update.currentVersion")}),(0,te.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,te.jsxs)("div",{className:"space-y-4",children:[(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:e("pages.update.currentVersion")}),(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink",children:a?.currentVersion??"\u2014"})]}),a?.identityDivergence&&(0,te.jsx)("div",{className:"border border-amber/35 rounded-[4px] px-3 py-2 text-[12px] leading-relaxed text-ink-2",children:e("pages.update.identityDivergence",{active:a.identityDivergence.activeVersion,plugin:a.identityDivergence.pluginVersion})}),(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:e("pages.update.latestVersion")}),(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink",children:M==="check_failed"?"\u2014":a?.latestVersion||"\u2014"}),M==="check_failed"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.checkFailed")}),M==="update_blocked"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.blockedBadge")}),M==="up_to_date"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-green/35 text-green rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.upToDate")}),M==="update_available"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.updateAvailable")})]})]})]}),(M==="update_blocked"||M==="check_failed")&&(0,te.jsxs)("div",{className:"mt-4 pt-3 border-t border-line text-[12px] leading-relaxed",children:[oe&&(0,te.jsxs)("p",{className:"text-ink-2",children:[e("pages.update.reasonLabel"),oe]}),a?.message&&M==="update_blocked"&&(0,te.jsx)("p",{className:"mt-1 text-ink-3",children:a.message}),a?.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-ink-3 font-mono",children:a.nextAction})]}),a?.error&&(0,te.jsxs)("div",{className:"mt-4 pt-3 border-t border-line text-[12px] text-ink-4 font-mono",children:[e("pages.update.checkError"),": ",a.error]}),A&&(0,te.jsxs)("div",{className:"mt-4 p-4 rounded-[6px] border border-gov/30 bg-surface text-[13px] leading-relaxed",role:"status",children:[(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)(pa,{className:"h-4 w-4 animate-spin text-gov"}),(0,te.jsx)("span",{className:"font-medium text-ink",children:e("pages.update.inProgressPanel")})]}),(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.inProgressPhase",{phase:A.phase??"\u2026"})}),(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-4",children:A.transactionId})]}),(0,te.jsxs)("div",{className:"mt-5 pt-4 border-t border-line flex items-center gap-3 flex-wrap",children:[(0,te.jsx)("button",{type:"button",onClick:T,disabled:l||h||A!==null,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e(l?"pages.update.checking":"pages.update.checkForUpdates")}),!H&&M==="update_available"&&(0,te.jsx)("button",{type:"button",onClick:()=>g(!0),disabled:l||h||A!==null,className:"bg-gov text-white rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-gov/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:h?(0,te.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,te.jsx)(pa,{className:"h-3.5 w-3.5 animate-spin"}),e("pages.update.updating")]}):e("pages.update.applyUpdate")})]}),p&&(0,te.jsx)("div",{className:`mt-4 p-4 rounded-[6px] border animate-[pdFadeIn_400ms_ease-out] ${p.success?"bg-green/5 border-green/20":p.refusal?"bg-amber/5 border-amber/25":"bg-danger/5 border-danger/20"}`,children:(0,te.jsxs)("div",{className:"flex items-start gap-3",children:[p.success?(0,te.jsx)(as,{className:"h-6 w-6 text-green shrink-0 mt-0.5 animate-[pdFadeIn_600ms_ease-out]",style:{transform:"scale(1)",animationFillMode:"both"}}):p.refusal?(0,te.jsx)(Ar,{className:"h-6 w-6 text-amber shrink-0 mt-0.5"}):(0,te.jsx)(ns,{className:"h-6 w-6 text-danger shrink-0 mt-0.5"}),(0,te.jsxs)("div",{className:"flex-1 min-w-0",children:[p.refusal&&(0,te.jsx)("p",{className:"text-[12px] font-mono uppercase text-amber mb-1",children:e("pages.update.blockedBadge")}),p.success&&p.fromVersion&&p.newVersion&&(0,te.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink-3 line-through",children:p.fromVersion}),(0,te.jsx)($r,{className:"h-3.5 w-3.5 text-green"}),(0,te.jsx)("span",{className:"font-mono text-[13px] text-green font-medium",children:p.newVersion})]}),(0,te.jsx)("p",{className:`text-[13px] ${p.success?"text-green":p.refusal?"text-ink-2":"text-danger"}`,children:p.message}),p.success&&p.requiresRestart&&(0,te.jsx)("p",{className:"mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed",children:e("pages.update.fullUpdateRestartPrompt")}),p.gatewayNotice&&(0,te.jsx)("p",{className:"mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed font-mono",children:p.gatewayNotice}),!p.success&&p.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-[12px] text-ink-4 font-mono leading-relaxed",children:p.nextAction}),!p.success&&(0,te.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[/network|fetch|timeout|ECONNREFUSED|ENOTFOUND/i.test(p.message)&&(0,te.jsx)("p",{className:"text-[12px] text-ink-4 font-mono",children:e("pages.update.networkErrorHint")}),(0,te.jsx)("button",{type:"button",onClick:()=>g(!0),disabled:h,className:"text-[12px] text-danger underline hover:text-danger/80 disabled:opacity-50",children:e("pages.update.retry")})]})]})]})})]})]}),(0,te.jsxs)("section",{"aria-labelledby":"section-update-history",children:[(0,te.jsx)(me,{id:"section-update-history",children:e("pages.update.history")}),f?(0,te.jsxs)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3",children:[e("pages.update.loadError")," (",f,")"]}):r&&r.updates.length>0?(0,te.jsx)("div",{className:"space-y-[10px]",children:r.updates.map(q=>(0,te.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] px-5 py-4",children:[(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)("span",{className:"inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase",children:e("pages.update.version")}),(0,te.jsxs)("span",{className:"font-mono text-[13px] text-ink",children:[q.fromVersion," \u2192 ",q.toVersion==="failed"?"\u2014":q.toVersion]}),q.kind!=="failure"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase",children:e(`pages.update.historyKind.${q.kind}`)}),!q.success&&q.kind!=="refusal"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-danger/35 text-danger rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.failed")})]}),(0,te.jsx)("div",{className:"flex items-center gap-3",children:(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:ba(q.timestamp,t.language,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})})]}),(q.reason||q.nextAction)&&(0,te.jsxs)("div",{className:"mt-3 border-t border-line pt-3 text-[12px] leading-relaxed text-ink-3",children:[q.reason&&(0,te.jsx)("p",{children:q.reason}),q.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-ink-2",children:q.nextAction})]})]},q.id))}):(0,te.jsx)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3",children:e("pages.update.noHistory")})]})]}),(0,te.jsx)(Tg,{open:v,onOpenChange:g,children:(0,te.jsxs)(Qu,{children:[(0,te.jsxs)(Ju,{children:[(0,te.jsx)(tf,{children:e("pages.update.confirmFullUpdateTitle")}),(0,te.jsx)(af,{children:e("pages.update.confirmFullUpdateDesc")})]}),(0,te.jsxs)(ef,{children:[(0,te.jsx)(rf,{children:e("common.cancel")}),(0,te.jsx)(nf,{onClick:_,children:e("pages.update.applyFullUpdate")})]})]})})]})}var gt=D(ee(),1);var of=D(ee(),1);var ur=D(W(),1),zT=jc;var rV=Hc;var qT=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(fs,{ref:a,className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qT.displayName=fs.displayName;var _w=of.forwardRef(({className:e,children:t,...a},n)=>(0,ur.jsxs)(rV,{children:[(0,ur.jsx)(qT,{}),(0,ur.jsxs)(ps,{ref:n,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,ur.jsxs)(ll,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,ur.jsx)(tl,{className:"h-4 w-4"}),(0,ur.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));_w.displayName=ps.displayName;var Bw=({className:e,...t})=>(0,ur.jsx)("div",{className:xe("flex flex-col gap-1.5 text-center sm:text-left",e),...t});Bw.displayName="DialogHeader";var Mw=({className:e,...t})=>(0,ur.jsx)("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Mw.displayName="DialogFooter";var Fw=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(ms,{ref:a,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));Fw.displayName=ms.displayName;var Uw=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(gs,{ref:a,className:xe("text-sm text-muted-foreground",e),...t}));Uw.displayName=gs.displayName;var iV=["always","often","sometimes","once"],oV=["blocked","workaround","minor"],sV=["ingest","github","email","file"];function lV(e){return typeof e=="string"&&iV.includes(e)}function cV(e){return typeof e=="string"&&oV.includes(e)}function dV(e){return typeof e=="string"&&sV.includes(e)}function zw(e){if(!e)return;let t=`${e.page??""} ${e.sourceDetail??""}`.toLowerCase(),a=[["failed_tasks","failed_tasks"],["pain","pain"],["principle","principles"],["activation","activation"],["focus","focus"],["intent","intent"],["error","error"]];for(let[n,r]of a)if(t.includes(n))return r}function _t(e){return typeof e=="string"}function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jw(e){return Array.isArray(e)&&e.every(_t)}function hl(e){return fr(e)?e:{}}function qw(e){if(!fr(e)||!_t(e.id)||!_t(e.createdAt)||!_t(e.title)||e.type!=="bug"&&e.type!=="confusing"&&e.type!=="privacy_concern"&&e.type!=="feature_request"&&e.type!=="other")return null;let t=hl(e.userText);if(!_t(t.description))return null;let a=hl(e.outputs);if(!_t(a.markdown)||!_t(a.emailText)||!_t(a.githubIssueUrl))return null;let n=hl(e.privacy);if(!jw(n.includedSections)||!jw(n.excludedByDefault)||!jw(n.redactionNotes))return null;let r=hl(e.diagnosticSummary),i=r.canary,o=fr(i)?i:null,s=null;o&&typeof o.status=="string"&&(o.status==="available"||o.status==="unavailable")&&(s=o.status);let l=s?{status:s,summary:typeof o?.summary=="string"?o.summary:void 0,unavailableReason:typeof o?.unavailableReason=="string"?o.unavailableReason:void 0}:null;return{id:e.id,createdAt:e.createdAt,type:e.type,title:e.title,userText:{description:t.description,stepsToReproduce:_t(t.stepsToReproduce)?t.stepsToReproduce:void 0,expectedBehavior:_t(t.expectedBehavior)?t.expectedBehavior:void 0,actualBehavior:_t(t.actualBehavior)?t.actualBehavior:void 0,userSeverity:t.userSeverity==="low"||t.userSeverity==="medium"||t.userSeverity==="high"?t.userSeverity:void 0,goal:_t(t.goal)?t.goal:void 0,stuckAt:_t(t.stuckAt)?t.stuckAt:void 0,job:_t(t.job)?t.job:void 0,currentWorkaround:_t(t.currentWorkaround)?t.currentWorkaround:void 0,sawWhat:_t(t.sawWhat)?t.sawWhat:void 0,whereSeen:_t(t.whereSeen)?t.whereSeen:void 0,frequency:lV(t.frequency)?t.frequency:void 0,blockingLevel:cV(t.blockingLevel)?t.blockingLevel:void 0},diagnosticSummary:{versions:hl(r.versions),platform:hl(r.platform),featureFlags:hl(r.featureFlags),canary:l??{status:"unavailable",unavailableReason:"diagnostic summary unavailable"},recentEvents:Array.isArray(r.recentEvents)?r.recentEvents:[]},privacy:{includedSections:n.includedSections,excludedByDefault:n.excludedByDefault,redactionNotes:n.redactionNotes},outputs:{markdown:a.markdown,emailText:a.emailText,githubIssueUrl:a.githubIssueUrl,mailtoUrl:_t(a.mailtoUrl)?a.mailtoUrl:""},area:_t(e.area)?e.area:void 0,status:e.status==="draft"||e.status==="submitted"?e.status:void 0,submittedAt:_t(e.submittedAt)?e.submittedAt:void 0,submittedVia:dV(e.submittedVia)?e.submittedVia:void 0,trackingId:_t(e.trackingId)?e.trackingId:void 0,externalUrl:_t(e.externalUrl)?e.externalUrl:void 0}}function GT(e){return!fr(e)||!_t(e.id)||!_t(e.createdAt)||!_t(e.type)||!_t(e.title)?null:{id:e.id,createdAt:e.createdAt,type:e.type,title:e.title,status:_t(e.status)?e.status:void 0}}function Pg(e){return fr(e)?qw(e.report):null}function _g(e,t){return fr(e)&&e.success===!1&&_t(e.error)?e.error:t}var uV=["console","cli","agent"],fV=["painId","principleId","approvalId","activationId","taskId","page"];function Vw(e){let t={};for(let n of fV){let r=e.get(n);r&&(t[n]=r)}let a=e.get("source");return a&&(uV.includes(a)?t.source=a:(t.source="console",t.sourceDetail=a)),Object.keys(t).length>0?t:void 0}var pV="/api/v1/config/summary",mV="/api/v1/lifecycle/state",gV="/api/health";function Hw(e,t){if(e.status==="rejected"){let{reason:a}=e,n=a instanceof Error?a.message:String(a);return`${t} fetch failed: ${n}`}return e.value.success?"":`${t} fetch failed: ${e.value.error}`}function oi(e){return typeof e=="string"?e:void 0}function hV(e){if(!fr(e)||!Array.isArray(e.recentEvents))return[];let t=[];for(let a of e.recentEvents){if(!fr(a))continue;let n=oi(a.type),r=oi(a.at),i=oi(a.summary);if(!n||!r||!i)continue;let o={type:n,at:r,summary:i},s=oi(a.severity);s&&(o.severity=s),t.push(o)}return t.slice(-5)}function VT(e){if(!e||!Array.isArray(e.checks))return[];let t=[];for(let a of e.checks){if(!fr(a))continue;let n=oi(a.id)??oi(a.name),r=oi(a.lastCheck),i=oi(a.message);if(!n||!r||!i)continue;let o={type:n,at:r,summary:i},s=oi(a.status);s==="error"?o.severity="error":s==="warning"&&(o.severity="warn"),t.push(o)}return t.slice(-5)}function $T(e,t,a){let n=Hw(a,gV),r=a.status==="fulfilled"&&a.value.success?a.value.data:null,i=fr(r)?r:null,o,s;n?(o={unavailableReason:n},s={unavailableReason:n}):i&&fr(i.versions)?(o={...i.versions},s=fr(i.platform)?{...i.platform}:{unavailableReason:"platform not in health response"}):(o={unavailableReason:"versions not in health response"},s={unavailableReason:"platform not in health response"});let l=Hw(e,pV),c;if(l)c={unavailableReason:l};else if(e.status==="fulfilled"&&e.value.success){let{data:m}=e.value;fr(m)&&Object.hasOwn(m,"features")&&Array.isArray(m.features)?c={features:m.features,defaultRuntime:oi(m.defaultRuntime)??null}:c={unavailableReason:"features field not present in API response"}}else c={unavailableReason:"features field not present in API response"};let u;if(n)u={status:"unavailable",unavailableReason:n};else if(i&&(i.overall==="healthy"||i.overall==="degraded"||i.overall==="error")){let{overall:m}=i;m==="error"?u={status:"unavailable",unavailableReason:`system health: ${m}`}:u={status:"available",summary:`overall=${m}; generatedAt=${oi(i.generatedAt)??"unknown"}`}}else u={status:"unavailable",unavailableReason:"overall field not present in API response"};let d=Hw(t,mV),f;return d?f=VT(i):t.status==="fulfilled"&&t.value.success?f=hV(t.value.data):f=VT(i),{versions:o,platform:s,featureFlags:c,canary:u,recentEvents:f}}var j=D(W(),1),WT={type:"bug",title:"",description:"",stepsToReproduce:"",expectedBehavior:"",actualBehavior:"",frequency:void 0,blockingLevel:void 0,goal:"",stuckAt:"",job:"",currentWorkaround:"",sawWhat:"",whereSeen:"",submitting:!1},YT=["bug","confusing","privacy_concern","feature_request","other"],bV=new Set(YT),XT=["always","often","sometimes","once"],ZT=["blocked","workaround","minor"],vV=new Set(XT),xV=new Set(ZT),KT={bug:["stepsToReproduce","expectedBehavior","actualBehavior","frequency","blockingLevel"],confusing:["goal","stuckAt","blockingLevel"],feature_request:["job","currentWorkaround"],privacy_concern:["sawWhat","whereSeen"],other:[]},yV={stepsToReproduce:"pages.reportProblem.form.stepsLabel",expectedBehavior:"pages.reportProblem.form.expectedLabel",actualBehavior:"pages.reportProblem.form.actualLabel",goal:"pages.reportProblem.form.goalLabel",stuckAt:"pages.reportProblem.form.stuckAtLabel",job:"pages.reportProblem.form.jobLabel",currentWorkaround:"pages.reportProblem.form.currentWorkaroundLabel",sawWhat:"pages.reportProblem.form.sawWhatLabel",whereSeen:"pages.reportProblem.form.whereSeenLabel"},wV=["ingest","github","email","file"];function kV(e){let t=Vw(e),a=zw(t);return a==="failed_tasks"||a==="error"?"bug":"other"}function QT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function SV(e){if(!QT(e))return{ok:!1,reason:"Drafts list response is not an object"};if(!Object.hasOwn(e,"drafts"))return{ok:!1,reason:"Drafts list response missing 'drafts' field"};if(!Array.isArray(e.drafts))return{ok:!1,reason:"Drafts list 'drafts' field is not an array"};let t=[];for(let a of e.drafts){let n=GT(a);n!==null&&t.push(n)}return{ok:!0,drafts:t}}function Gw(){let{t:e}=X();return(0,j.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-gov/8 border border-gov/20 rounded-[6px] mb-6",children:[(0,j.jsx)("svg",{className:"shrink-0 w-4 h-4 text-gov",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,j.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),(0,j.jsx)("span",{className:"text-ink text-sm font-medium",children:e("pages.reportProblem.noAutoUpload")})]})}function CV({draft:e}){let{t}=X();return e===null?(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-privacy",children:[(0,j.jsx)(me,{id:"section-privacy",children:t("pages.reportProblem.privacy.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:t("pages.reportProblem.privacy.submitFirst")}),(0,j.jsx)(Gw,{})]}):(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-privacy",children:[(0,j.jsx)(me,{id:"section-privacy",children:t("pages.reportProblem.privacy.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:t("pages.reportProblem.privacy.description")}),(0,j.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-4 space-y-4",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.included")}),e.privacy.includedSections.length>0?(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.includedSections.map((a,n)=>(0,j.jsxs)("li",{className:"flex items-center gap-2 text-ink-2 text-[13px]",children:[(0,j.jsx)("span",{className:"text-green-600","aria-hidden":"true",children:"\u2713"}),a]},n))}):(0,j.jsx)("p",{className:"text-ink-4 text-[13px]",children:"\u2014"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.excluded")}),e.privacy.excludedByDefault.length>0?(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.excludedByDefault.map((a,n)=>(0,j.jsxs)("li",{className:"flex items-center gap-2 text-ink-2 text-[13px]",children:[(0,j.jsx)("span",{className:"text-red-500","aria-hidden":"true",children:"\u2717"}),a]},n))}):(0,j.jsx)("p",{className:"text-ink-4 text-[13px]",children:"\u2014"})]}),e.privacy.redactionNotes.length>0&&(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.notes")}),(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.redactionNotes.map((a,n)=>(0,j.jsxs)("li",{className:"text-ink-2 text-[13px]",children:["\u2022 ",a]},n))})]})]}),(0,j.jsx)(Gw,{})]})}function RV({draft:e}){let{t}=X(),a=e.status==="submitted";return(0,j.jsxs)("span",{className:a?"inline-flex items-center gap-1 px-2 py-[2px] rounded-[3px] text-[11px] font-medium border border-green-200 bg-green-50 text-green-700":"inline-flex items-center gap-1 px-2 py-[2px] rounded-[3px] text-[11px] font-medium border border-line bg-surface text-ink-3",children:[(0,j.jsx)("span",{className:a?"w-1.5 h-1.5 rounded-full bg-green-500":"w-1.5 h-1.5 rounded-full bg-ink-3","aria-hidden":"true"}),t(a?"pages.reportProblem.draft.sentBadge":"pages.reportProblem.draft.draftBadge")]})}function IV({draft:e,onCopyMarkdown:t,onCopyEmail:a,onOpenGithub:n,onOpenEmail:r,onDelete:i}){let{t:o}=X(),[s,l]=(0,gt.useState)(!1);return(0,j.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] p-4",children:[(0,j.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-2",children:[(0,j.jsx)("div",{className:"font-mono text-[11px] text-ink-3",children:o("pages.reportProblem.draft.savedAt",{id:e.id,at:e.createdAt})}),(0,j.jsx)(RV,{draft:e})]}),(0,j.jsx)("div",{className:"font-semibold text-ink mb-1",children:e.title}),(e.status==="submitted"||e.trackingId||e.submittedVia)&&(0,j.jsxs)("div",{className:"text-ink-3 text-[12px] mb-2 space-y-0.5",children:[e.submittedVia&&(0,j.jsxs)("div",{children:["via ",e.submittedVia,e.submittedAt?` \xB7 ${e.submittedAt}`:""]}),e.trackingId&&(0,j.jsxs)("div",{className:"font-mono",children:[o("pages.reportProblem.channel.receiptTrackingId"),": ",e.trackingId]}),e.externalUrl&&(0,j.jsx)("div",{children:(0,j.jsx)("a",{href:e.externalUrl,target:"_blank",rel:"noreferrer noopener",className:"text-gov underline hover:text-gov-2",children:o("pages.reportProblem.channel.openIssue")})})]}),(0,j.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,j.jsx)("button",{type:"button",onClick:t,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.copyMarkdown")}),(0,j.jsx)("button",{type:"button",onClick:a,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.copyEmail")}),e.outputs.githubIssueUrl&&(0,j.jsx)("button",{type:"button",onClick:n,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.openGithub")}),e.outputs.mailtoUrl&&(0,j.jsx)("button",{type:"button",onClick:r,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.openEmail")}),s?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("button",{type:"button",onClick:i,className:"border border-red-400 bg-red-600 text-white rounded-[3px] px-[12px] py-[5px] text-[12px] hover:bg-red-700 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:[o("pages.reportProblem.draft.delete"),"?"]}),(0,j.jsx)("button",{type:"button",onClick:()=>l(!1),className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors",children:"\xD7"})]}):(0,j.jsx)("button",{type:"button",onClick:()=>l(!0),className:"border border-red-200 text-red-600 rounded-[3px] px-[12px] py-[5px] text-[12px] hover:bg-red-50 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.delete")})]})]})}function AV({drafts:e,onLoad:t,onDelete:a}){let{t:n}=X();return(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-saved",children:[(0,j.jsx)(me,{id:"section-saved",children:n("pages.reportProblem.saved.title")}),e.length===0?(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed py-2",children:"\u2014"}):(0,j.jsx)("div",{className:"space-y-3",children:e.map(r=>(0,j.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] px-4 py-3 flex items-center justify-between gap-4",children:[(0,j.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,j.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,j.jsxs)("div",{className:"font-mono text-[11px] text-ink-3",children:[va("feedbackType",r.type,n)," \xB7 ",r.createdAt]}),r.status==="submitted"&&(0,j.jsx)("span",{className:"inline-flex items-center gap-1 px-1.5 py-[1px] rounded-[2px] text-[10px] font-medium border border-green-200 bg-green-50 text-green-700",children:n("pages.reportProblem.draft.sentBadge")})]}),(0,j.jsx)("div",{className:"text-ink text-sm truncate",children:r.title})]}),(0,j.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,j.jsx)("button",{type:"button",onClick:()=>t(r.id),className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.reportProblem.saved.load")}),(0,j.jsx)("button",{type:"button",onClick:()=>a(r.id),className:"border border-red-200 text-red-600 rounded-[3px] px-[10px] py-[6px] text-[12px] hover:bg-red-50 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:n("pages.reportProblem.draft.delete")})]})]},r.id))})]})}function DV({draft:e,channels:t,onSubmitIngest:a,onSubmitGithub:n,onOpenEmail:r,onExportFile:i,onMarkSent:o}){let{t:s}=X(),l=(0,gt.useMemo)(()=>{let d=new Map;for(let f of t??[])d.set(f.id,f);return d},[t]),c=e.status==="submitted",u=d=>{let f=l.get(d),m=f?.available??!1;if(d==="email")return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",disabled:!m,onClick:r,className:m?"w-full border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[8px] text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed":"w-full border border-line bg-surface text-ink-4 rounded-[3px] px-[14px] py-[8px] text-[13px] cursor-not-allowed",children:s("pages.reportProblem.channel.email")}),!m&&(f?.reason||f?.nextAction)&&(0,j.jsxs)("p",{className:"text-[11px] text-ink-3 leading-snug",children:[s("pages.reportProblem.channel.disablingReason",{reason:f?.reason??""}),f?.nextAction?` \xB7 ${f.nextAction}`:""]}),!c&&(0,j.jsx)("button",{type:"button",onClick:()=>o("email"),className:"text-[11px] text-ink-3 hover:text-gov underline underline-offset-2 text-left",children:s("pages.reportProblem.draft.markAsSent")})]},"email");if(d==="file")return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",onClick:i,className:"w-full border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[8px] text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:s("pages.reportProblem.channel.file")}),!c&&(0,j.jsx)("button",{type:"button",onClick:()=>o("file"),className:"text-[11px] text-ink-3 hover:text-gov underline underline-offset-2 text-left",children:s("pages.reportProblem.draft.markAsSent")})]},"file");let p=d==="ingest",b=s(p?"pages.reportProblem.channel.ingest":"pages.reportProblem.channel.github");return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",disabled:!m,onClick:p?a:n,className:m?"w-full border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[8px] text-[13px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2":"w-full border border-line bg-surface text-ink-4 rounded-[3px] px-[14px] py-[8px] text-[13px] cursor-not-allowed",children:b}),!m&&(f?.reason||f?.nextAction)&&(0,j.jsxs)("p",{className:"text-[11px] text-ink-3 leading-snug",children:[s("pages.reportProblem.channel.disablingReason",{reason:f?.reason??""}),f?.nextAction?` \xB7 ${f.nextAction}`:""]})]},d)};return(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-channel",children:[(0,j.jsx)(me,{id:"section-channel",children:s("pages.reportProblem.channel.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:s("pages.reportProblem.channel.description")}),(0,j.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:wV.map(u)})]})}function LV({draft:e,channel:t,open:a,busy:n,onConfirm:r,onCancel:i}){let{t:o}=X();return(0,j.jsx)(zT,{open:a,onOpenChange:s=>{!s&&!n&&i()},children:(0,j.jsxs)(_w,{className:"sm:max-w-xl max-h-[85vh] overflow-hidden flex flex-col",children:[(0,j.jsxs)(Bw,{children:[(0,j.jsx)(Fw,{children:o("pages.reportProblem.channel.confirmTitle")}),(0,j.jsx)(Uw,{children:o(t==="ingest"?"pages.reportProblem.channel.confirmDescription":"pages.reportProblem.channel.github")})]}),(0,j.jsxs)("div",{className:"flex-1 min-h-0 overflow-auto space-y-2",children:[(0,j.jsx)("div",{className:"font-mono text-[12px] text-ink-3",children:e.title}),(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3",children:o("pages.reportProblem.channel.confirmBodyLabel")}),(0,j.jsx)("pre",{className:"whitespace-pre-wrap text-ink-2 text-[13px] leading-relaxed bg-surface border border-line rounded-[3px] p-3 max-h-[320px] overflow-auto",children:e.outputs.markdown})]}),(0,j.jsxs)(Mw,{children:[(0,j.jsx)("button",{type:"button",onClick:i,disabled:n,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 disabled:opacity-50",children:o("pages.reportProblem.channel.confirmCancel")}),(0,j.jsx)("button",{type:"button",onClick:r,disabled:n,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 disabled:opacity-50 disabled:cursor-not-allowed",children:o(n?"pages.reportProblem.form.submitting":"pages.reportProblem.channel.confirmSubmit")})]})]})})}function JT(){let{t:e}=X(),[t]=Sn(),[a,n]=(0,gt.useState)(()=>({...WT,type:kV(t)})),[r,i]=(0,gt.useState)([]),[o,s]=(0,gt.useState)(null),[l,c]=(0,gt.useState)("loading"),[u,d]=(0,gt.useState)(null),[f,m]=(0,gt.useState)(!1),[p,b]=(0,gt.useState)(!1),[v,g]=(0,gt.useState)(null),[h,x]=(0,gt.useState)(null),[y,C]=(0,gt.useState)(!1),A=(0,gt.useMemo)(()=>Vw(t),[t]),I=(0,gt.useMemo)(()=>zw(A),[A]);(0,gt.useEffect)(()=>{b(KT[a.type].length>0)},[a.type]);let k=(0,gt.useCallback)(async()=>{let G=await $1();if(!G.success){d(G.error??"Failed to load drafts"),c("loaded");return}let ae=SV(G.data);if(!ae.ok){d(ae.reason),i([]),c("loaded");return}i(ae.drafts),d(null),c("loaded")},[]),T=(0,gt.useCallback)(async()=>{let G=await K1();if(!G.success||!G.data){g(null);return}g(G.data.channels)},[]);(0,gt.useEffect)(()=>{k(),T()},[k,T]);let _=(0,gt.useCallback)((G,ae)=>{n(we=>({...we,[G]:ae}))},[]),M=(0,gt.useCallback)(()=>({type:a.type,title:a.title.trim(),description:a.description.trim(),stepsToReproduce:a.stepsToReproduce.trim()||void 0,expectedBehavior:a.expectedBehavior.trim()||void 0,actualBehavior:a.actualBehavior.trim()||void 0,goal:a.goal.trim()||void 0,stuckAt:a.stuckAt.trim()||void 0,job:a.job.trim()||void 0,currentWorkaround:a.currentWorkaround.trim()||void 0,sawWhat:a.sawWhat.trim()||void 0,whereSeen:a.whereSeen.trim()||void 0,frequency:a.frequency??void 0,blockingLevel:a.blockingLevel??void 0,...I?{area:I}:{},...A?.taskId?{taskId:A.taskId}:{},...A?{context:A}:{}}),[a,I,A]),H=(0,gt.useCallback)(async G=>{if(G.preventDefault(),!a.title.trim()||!a.description.trim()){U.error(e("pages.reportProblem.errors.missingRequired"));return}n(ae=>({...ae,submitting:!0}));try{let[ae,we,ze]=await Promise.allSettled([Zr(),J("/api/v1/lifecycle/state"),J("/api/health")]),ke=$T(ae,we,ze),tt=await G1(M(),ke);if(!tt.success){U.error(_g(tt,e("pages.reportProblem.errors.createFailed"))),n(ne=>({...ne,submitting:!1}));return}let Ct=Pg(tt.data);if(Ct===null&&QT(tt.data)&&Object.hasOwn(tt.data,"report")&&(Ct=qw(tt.data.report)),Ct===null){U.error(e("pages.reportProblem.errors.createFailed")),n(ne=>({...ne,submitting:!1}));return}s(Ct),U.success(e("pages.reportProblem.toast.draftCreated")),n(ne=>({...WT,type:ne.type,frequency:void 0,blockingLevel:void 0,submitting:!1})),m(!1),await k()}catch{U.error(e("pages.reportProblem.errors.createFailed"))}finally{n(ae=>({...ae,submitting:!1}))}},[a,e,k,M]),Y=(0,gt.useCallback)(async G=>{let ae=await qx(G);if(!ae.success){U.error(e("pages.reportProblem.toast.loadFailed"));return}let we=Pg(ae.data);if(we===null){U.error(e("pages.reportProblem.toast.loadFailed"));return}s(we),n({type:we.type,title:we.title,description:we.userText.description,stepsToReproduce:we.userText.stepsToReproduce??"",expectedBehavior:we.userText.expectedBehavior??"",actualBehavior:we.userText.actualBehavior??"",frequency:we.userText.frequency,blockingLevel:we.userText.blockingLevel,goal:we.userText.goal??"",stuckAt:we.userText.stuckAt??"",job:we.userText.job??"",currentWorkaround:we.userText.currentWorkaround??"",sawWhat:we.userText.sawWhat??"",whereSeen:we.userText.whereSeen??"",submitting:!1})},[e]),oe=(0,gt.useCallback)(async G=>{try{if(!G.outputs.markdown)return;await navigator.clipboard.writeText(G.outputs.markdown),U.success(e("pages.reportProblem.toast.markdownCopied"))}catch{U.error(e("pages.reportProblem.toast.copyFailed"))}},[e]),q=(0,gt.useCallback)(async G=>{try{if(!G.outputs.emailText)return;await navigator.clipboard.writeText(G.outputs.emailText),U.success(e("pages.reportProblem.toast.emailCopied"))}catch{U.error(e("pages.reportProblem.toast.copyFailed"))}},[e]),R=(0,gt.useCallback)(G=>{G.outputs.githubIssueUrl&&window.open(G.outputs.githubIssueUrl,"_blank")},[]),F=(0,gt.useCallback)(G=>{G.outputs.mailtoUrl&&window.open(G.outputs.mailtoUrl,"_blank")},[]),se=(0,gt.useCallback)(G=>{let ae=new Blob([G.outputs.markdown],{type:"text/markdown;charset=utf-8"}),we=URL.createObjectURL(ae),ze=document.createElement("a");ze.href=we,ze.download=`PD-feedback-${G.id}.md`,document.body.appendChild(ze),ze.click(),ze.remove(),URL.revokeObjectURL(we)},[]),ve=(0,gt.useCallback)(async G=>{let ae=await qx(G);if(ae.success){let we=Pg(ae.data);we&&s(we)}},[]),z=(0,gt.useCallback)(async G=>{let ae=o;if(ae){C(!0);try{let we=await Y1(ae.id,G);if(!we.success){U.error(_g(we,e("pages.reportProblem.toast.submitFailed")));return}await ve(ae.id),await k();let ze=we.data;ze?.writeBackFailed?U.error(e("pages.reportProblem.channel.writeBackNote")):ze?.alreadySubmitted?U.info(e("pages.reportProblem.channel.alreadySubmitted")):U.success(e("pages.reportProblem.toast.submitSucceeded",{trackingId:ze?.trackingId??""}))}catch{U.error(e("pages.reportProblem.toast.submitFailed"))}finally{C(!1),x(null)}}},[o,e,ve,k]),L=(0,gt.useCallback)(async G=>{let ae=o;if(!ae)return;let we=await X1(ae.id,G);if(!we.success){U.error(_g(we,e("pages.reportProblem.toast.submitFailed")));return}U.success(e("pages.reportProblem.toast.markSentSucceeded")),await ve(ae.id),await k()},[o,e,ve,k]),re=(0,gt.useCallback)(async G=>{if(!(await W1(G)).success){U.error(e("pages.reportProblem.toast.deleteFailed"));return}U.success(e("pages.reportProblem.toast.draftDeleted")),i(we=>we.filter(ze=>ze.id!==G)),o?.id===G&&s(null)},[e,o]);if(l==="loading")return(0,j.jsx)(Me,{children:(0,j.jsx)(It,{cardCount:3,label:e("common.loading")})});if(l==="error")return(0,j.jsxs)(Me,{children:[(0,j.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.reportProblem.eyebrow")}),(0,j.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.reportProblem.title")}),(0,j.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,j.jsx)("p",{children:e("pages.reportProblem.loadError")}),u&&(0,j.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:u})]})]});let qe=KT[a.type],Ee=G=>{if(G==="frequency"){let ze=e("pages.reportProblem.form.frequencyLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-frequency",className:"block text-ink-2 text-[13px] mb-1.5",children:ze}),(0,j.jsxs)("select",{id:"feedback-frequency",value:a.frequency??"",onChange:ke=>{let tt=ke.target.value;tt===""?_("frequency",void 0):vV.has(tt)&&_("frequency",tt)},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:[(0,j.jsx)("option",{value:"",children:e("pages.reportProblem.form.frequencyNotSet")}),XT.map(ke=>(0,j.jsx)("option",{value:ke,children:e(`pages.reportProblem.form.frequency${ke.charAt(0).toUpperCase()+ke.slice(1)}`)},ke))]})]},"frequency")}if(G==="blockingLevel"){let ze=e("pages.reportProblem.form.blockingLevelLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-blocking",className:"block text-ink-2 text-[13px] mb-1.5",children:ze}),(0,j.jsxs)("select",{id:"feedback-blocking",value:a.blockingLevel??"",onChange:ke=>{let tt=ke.target.value;tt===""?_("blockingLevel",void 0):xV.has(tt)&&_("blockingLevel",tt)},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:[(0,j.jsx)("option",{value:"",children:e("pages.reportProblem.form.blockingLevelNotSet")}),ZT.map(ke=>(0,j.jsx)("option",{value:ke,children:e(`pages.reportProblem.form.blockingLevel${ke.charAt(0).toUpperCase()+ke.slice(1)}`)},ke))]})]},"blockingLevel")}let ae=a[G],we=e(yV[G]??"pages.reportProblem.form.descriptionLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:`feedback-${G}`,className:"block text-ink-2 text-[13px] mb-1.5",children:we}),(0,j.jsx)("textarea",{id:`feedback-${G}`,value:typeof ae=="string"?ae:"",onChange:ze=>_(G,ze.target.value),rows:G==="stepsToReproduce"?3:2,className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov resize-y"})]},G)};return(0,j.jsx)(Me,{children:(0,j.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,j.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.reportProblem.eyebrow")}),(0,j.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.reportProblem.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.reportProblem.subtitle")}),(0,j.jsx)(Gw,{}),(0,j.jsxs)("section",{"aria-labelledby":"section-form",children:[(0,j.jsx)(me,{id:"section-form",children:e("pages.reportProblem.form.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:e("pages.reportProblem.form.description")}),(0,j.jsxs)("form",{onSubmit:H,className:"bg-panel border border-line rounded-[6px] p-5 space-y-4",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-type",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.type")}),(0,j.jsx)("select",{id:"feedback-type",value:a.type,onChange:G=>{let ae=G.target.value;bV.has(ae)&&n(we=>({...we,type:ae,frequency:void 0,blockingLevel:void 0}))},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:YT.map(G=>(0,j.jsx)("option",{value:G,children:e(`pages.reportProblem.form.types.${G}`)},G))})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-title",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.titleLabel")}),(0,j.jsx)("input",{id:"feedback-title",type:"text",value:a.title,onChange:G=>_("title",G.target.value),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-description",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.descriptionLabel")}),(0,j.jsx)("textarea",{id:"feedback-description",value:a.description,onChange:G=>_("description",G.target.value),rows:4,className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov resize-y"})]}),qe.length>0&&(0,j.jsx)("div",{children:(0,j.jsx)("button",{type:"button",onClick:()=>b(G=>!G),className:"text-gov text-[13px] font-medium underline underline-offset-2 hover:text-gov-2 transition-colors",children:e(p?"pages.reportProblem.form.detailsHide":"pages.reportProblem.form.detailsToggle")})}),p&&(0,j.jsx)("div",{className:"space-y-4 border-t border-line pt-4",children:qe.map(Ee)}),(0,j.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,j.jsx)("button",{type:"submit",disabled:a.submitting,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:a.submitting?e("pages.reportProblem.form.submitting"):e("pages.reportProblem.form.submit")}),o&&(0,j.jsx)("button",{type:"button",onClick:()=>m(G=>!G),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e(f?"pages.reportProblem.form.hidePreview":"pages.reportProblem.form.showPreview")})]})]}),f&&o&&(0,j.jsxs)("div",{className:"mt-4 bg-panel border border-line rounded-[6px] p-4",children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-3",children:"Markdown"}),(0,j.jsx)("pre",{className:"whitespace-pre-wrap text-ink-2 text-[13px] leading-relaxed bg-surface border border-line rounded-[3px] p-3 max-h-[400px] overflow-auto",children:o.outputs.markdown})]})]}),(0,j.jsx)(CV,{draft:o}),o&&(0,j.jsx)(DV,{draft:o,channels:v,onSubmitIngest:()=>x({channel:"ingest"}),onSubmitGithub:()=>x({channel:"github"}),onOpenEmail:()=>F(o),onExportFile:()=>se(o),onMarkSent:L}),o&&(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-current-draft",children:[(0,j.jsx)(me,{id:"section-current-draft",children:e("pages.reportProblem.draft.title")}),(0,j.jsx)(IV,{draft:o,onCopyMarkdown:()=>oe(o),onCopyEmail:()=>q(o),onOpenGithub:()=>R(o),onOpenEmail:()=>F(o),onDelete:()=>re(o.id)})]}),u&&(0,j.jsxs)("div",{className:"mt-4 p-3 bg-panel border border-amber/20 rounded-[6px] text-ink-2 text-[13px]",children:[(0,j.jsx)("p",{children:e("pages.reportProblem.loadError")}),(0,j.jsx)("p",{className:"mt-1 text-ink-4 text-[12px] font-mono",children:u})]}),(0,j.jsx)(AV,{drafts:r,onLoad:Y,onDelete:re}),(0,j.jsx)("footer",{className:"mt-12 pt-6 border-t border-line text-ink-3 text-[13px]",children:e("pages.reportProblem.privacy.guarantee")}),o&&h&&(0,j.jsx)(LV,{draft:o,channel:h.channel,open:!0,busy:y,onConfirm:()=>z(h.channel),onCancel:()=>x(null)})]})})}var Ia=D(ee(),1);var V=D(W(),1),NV={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};function sf(e){return ba(e,ar.language,NV)}function $w(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function a2(e){return typeof e=="string"}function EV(e){return typeof e=="number"&&!Number.isNaN(e)}function Vc(e,t){return Object.hasOwn(e,t)&&a2(e[t])?e[t]:null}function bl(e,t){if(!Object.hasOwn(e,t))return null;let a=e[t];return a===null?null:a2(a)?a:null}function lf(e,t){return Object.hasOwn(e,t)&&EV(e[t])?e[t]:null}function OV(e){if(!$w(e))return null;let t=Vc(e,"taskId"),a=Vc(e,"taskKind"),n=Vc(e,"status"),r=lf(e,"attemptCount"),i=lf(e,"maxAttempts"),o=Vc(e,"createdAt");if(t===null||a===null||n===null||r===null||i===null||o===null)return null;let s=bl(e,"painId"),l=bl(e,"lastError"),c=bl(e,"lastAttemptAt"),u=Object.hasOwn(e,"ownerDecisionRequired")?e.ownerDecisionRequired===!0:void 0;return{taskId:t,taskKind:a,painId:s,status:n,lastError:l,attemptCount:r,maxAttempts:i,createdAt:o,lastAttemptAt:c,...u!==void 0?{ownerDecisionRequired:u}:{}}}function TV(e){if(!$w(e)||!Object.hasOwn(e,"tasks"))return null;let t=e.tasks;if(!Array.isArray(t))return null;let a=[];for(let o of t){let s=OV(o);if(s===null)return null;a.push(s)}let n=lf(e,"total");if(n===null)return null;let r=bl(e,"nextAction"),i;if(Object.hasOwn(e,"pipeline")&&$w(e.pipeline)){let o=e.pipeline,s=Vc(o,"status"),l=Vc(o,"note");(s==="healthy"||s==="backlogged"||s==="stalled"||s==="disabled"||s==="unknown")&&l!==null&&(i={status:s,pendingCount:lf(o,"pendingCount"),oldestPendingTaskKind:bl(o,"oldestPendingTaskKind"),oldestPendingAgeMinutes:lf(o,"oldestPendingAgeMinutes"),lastProgressAt:bl(o,"lastProgressAt"),note:l,nextAction:bl(o,"nextAction")??void 0})}return{tasks:a,total:n,nextAction:r??void 0,...i?{pipeline:i}:{}}}function e2(e){return e.length>12?e.slice(0,12)+"\u2026":e}function PV(e){return e==="failed"?"destructive":e==="needs_human_review"?"amber":"default"}function _V(e){return e.status==="failed"&&e.attemptCount>=e.maxAttempts}function BV(e){let t=new Map;for(let a of e){let n=t.get(a.taskKind)??[];n.push(a),t.set(a.taskKind,n)}return t}function n2(){let{t:e}=X(),t=na(),[a]=Sn(),n=a.get("taskId")??void 0,[r,i]=(0,Ia.useState)({status:"loading"}),[o,s]=(0,Ia.useState)(!1),[l,c]=(0,Ia.useState)(null),[u,d]=(0,Ia.useState)(!1),f=l!==null&&_V(l),m=e("pages.failedTasks.recoverConfirmButton");u?m=e("common.loading"):f&&(m=e("pages.failedTasks.recoverConfirmForceButton")),(0,Ia.useEffect)(()=>{let g=!1;return Zr().then(h=>{if(!g&&h.success&&h.data){let x=h.data.features.find(y=>y.id==="failed_task_recovery_console");s(x?.enabled===!0)}}).catch(()=>{}),()=>{g=!0}},[]);let p=(0,Ia.useCallback)(async()=>{i({status:"loading"});let g=await J("/api/v1/failed-tasks",void 0,TV);if(g.success){i({status:"loaded",data:g.data});return}if(g.status===403){i({status:"disabled"});return}i({status:"error",message:g.error,nextAction:g.nextAction})},[]);(0,Ia.useEffect)(()=>{p()},[p]);let b=g=>{let h=new URLSearchParams({source:"failed_tasks_page",taskId:g.taskId});g.painId&&h.set("painId",g.painId),t(`/report-problem?${h.toString()}`)},v=async()=>{if(!(!l||u)){d(!0);try{let g=await cL(l.taskId,void 0,f);if(g.success)U.success(e("pages.failedTasks.recoverSuccess")),c(null),await p();else{let h=g.nextAction?`${g.error} \u2014 ${g.nextAction}`:g.error;U.error(`${e("pages.failedTasks.recoverFailed")}: ${h}`)}}catch(g){U.error(`${e("pages.failedTasks.recoverFailed")}: ${g instanceof Error?g.message:"Network error"}`)}finally{d(!1)}}};return(0,V.jsxs)(Me,{children:[(0,V.jsxs)("div",{className:"mb-8",children:[(0,V.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-ink-3",children:e("pages.failedTasks.title")}),(0,V.jsx)(Pr,{as:"h1",className:"text-[29px] font-semibold tracking-tight text-ink mt-3 mb-2",duration:4.5,brightness:.5,disabled:r.status!=="loaded"||r.data.tasks.length===0,children:e("pages.failedTasks.title")}),(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed max-w-[712px]",children:e("pages.failedTasks.subtitle")})]}),r.status==="loading"&&(0,V.jsx)(It,{cardCount:3,label:e("common.loading")}),r.status==="disabled"&&(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsx)("div",{className:"p-5 bg-panel border border-amber/20 rounded-[var(--radius-md)] text-amber text-[13px] leading-relaxed",children:e("pages.failedTasks.disabled")}),(0,V.jsx)("div",{className:"mt-4",children:(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:p,children:e("common.refresh")})})]}),r.status==="error"&&(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsxs)("div",{className:"text-danger text-sm mb-2",children:[e("pages.failedTasks.error"),": ",r.message]}),r.nextAction&&(0,V.jsx)("div",{className:"text-ink-3 text-[13px] mb-3",children:r.nextAction}),(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:p,children:e("common.refresh")})]}),r.status==="loaded"&&(0,V.jsx)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:(0,V.jsx)(MV,{data:r.data,onCreateDraft:b,onRecover:o?g=>c(g):void 0,initialExpandedTaskId:n,t:e})}),(0,V.jsx)(Tg,{open:l!==null,onOpenChange:g=>{!g&&!u&&c(null)},children:(0,V.jsxs)(Qu,{children:[(0,V.jsxs)(Ju,{children:[(0,V.jsx)(tf,{children:e("pages.failedTasks.recoverConfirmTitle")}),(0,V.jsx)(af,{asChild:!0,children:(0,V.jsxs)("div",{className:"space-y-2 text-[13px] leading-relaxed",children:[(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmStatus"),":"]})," ",(0,V.jsx)("span",{className:"font-mono",children:l?.status??"\u2014"})]}),f&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmAttempts"),":"]})," ",(0,V.jsxs)("span",{className:"font-mono",children:[l?.attemptCount," / ",l?.maxAttempts]})]}),(0,V.jsx)("div",{className:"text-danger",children:e("pages.failedTasks.recoverExhaustedWarning",{attempt:l?.attemptCount??0,max:l?.maxAttempts??0})})]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmActionLabel"),":"]})," ",e("pages.failedTasks.recoverConfirmActionDesc")]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmImpactLabel"),":"]})," ",e(f?"pages.failedTasks.recoverConfirmForceImpactDesc":"pages.failedTasks.recoverConfirmImpactDesc")]})]})})]}),(0,V.jsxs)(ef,{children:[(0,V.jsx)(rf,{disabled:u,children:e("common.cancel")}),(0,V.jsx)(nf,{disabled:u,onClick:g=>{g.preventDefault(),v()},children:m})]})]})})]})}function t2({pipeline:e,t}){let a=e.status==="healthy"?t("pages.failedTasks.pipeline.statusHealthy"):e.status==="backlogged"?t("pages.failedTasks.pipeline.statusBacklogged"):e.status==="stalled"?t("pages.failedTasks.pipeline.statusStalled"):t("pages.failedTasks.pipeline.statusUnknown"),n=e.status==="healthy"?"default":e.status==="stalled"?"destructive":e.status==="backlogged"?"amber":"default";return(0,V.jsxs)("div",{className:"p-5 bg-panel border border-line rounded-[var(--radius-md)] mb-4",children:[(0,V.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,V.jsx)("span",{className:"text-[15px] font-semibold text-ink",children:t("pages.failedTasks.pipeline.title")}),(0,V.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full border ${n==="destructive"?"border-red-300 text-red-700 bg-red-50":n==="amber"?"border-amber-300 text-amber-700 bg-amber-50":"border-line text-ink-3 bg-canvas"}`,children:a})]}),(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed",children:e.note}),e.nextAction&&(0,V.jsxs)("p",{className:"text-ink-3 text-sm leading-relaxed mt-1",children:[t("pages.failedTasks.pipeline.nextActionPrefix"),e.nextAction]})]})}function MV({data:e,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r}){if(!(e.tasks.length>0))return(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsxs)("div",{className:"p-5 bg-panel border border-line rounded-[var(--radius-md)]",children:[(0,V.jsx)("h3",{className:"text-[17px] font-semibold text-ink mb-2",children:r("pages.failedTasks.empty")}),e.nextAction&&(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed",children:e.nextAction})]}),e.pipeline&&(0,V.jsx)(t2,{pipeline:e.pipeline,t:r})]});let o=BV(e.tasks),s=Array.from(o.keys()).sort();return(0,V.jsxs)(V.Fragment,{children:[e.pipeline&&(0,V.jsx)(t2,{pipeline:e.pipeline,t:r}),(0,V.jsx)("div",{className:"space-y-6",children:s.map(l=>{let c=o.get(l);return!c||c.length===0?null:(0,V.jsxs)(Or,{children:[(0,V.jsx)(hs,{children:(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)(la,{variant:"outline",children:r("pages.failedTasks.kind")}),(0,V.jsxs)(bs,{className:"text-[15px] font-mono",children:[l," (",c.length,")"]})]})}),(0,V.jsx)(Tr,{children:(0,V.jsx)(FV,{tasks:c,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r})})]},l)})}),(0,V.jsxs)("div",{className:"mt-8 font-mono text-[11px] text-ink-4 space-y-1",children:[(0,V.jsxs)("div",{children:[r("common.total"),": ",e.total]}),e.total>e.tasks.length&&(0,V.jsx)("div",{className:"text-amber/80 leading-relaxed",children:r("pages.failedTasks.partialResults").replace("{shown}",String(e.tasks.length)).replace("{total}",String(e.total))})]})]})}function FV({tasks:e,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r}){let i=n!==void 0?e.find(p=>p.taskId===n):void 0,[o,s]=(0,Ia.useState)(i?.taskId??null),[l,c]=(0,Ia.useState)({status:"idle"}),u=(0,Ia.useRef)(0),d=(0,Ia.useRef)(!1),f=(0,Ia.useCallback)(async p=>{let b=++u.current;c({status:"loading",taskId:p});let v=await dL(p);b===u.current&&(v.success?c({status:"loaded",taskId:p,data:v.data}):c({status:"error",taskId:p,message:v.error,nextAction:v.nextAction}))},[]);(0,Ia.useEffect)(()=>{if(i===void 0||d.current)return;d.current=!0,f(i.taskId),document.querySelector(`[data-testid=${CSS.escape(`detail-toggle-${i.taskId}`)}]`)?.scrollIntoView({block:"center"})},[i,f]);let m=(0,Ia.useCallback)(p=>{if(o===p){u.current+=1,s(null),c({status:"idle"});return}s(p),f(p)},[o,f]);return(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto_minmax(0,1fr)_auto_minmax(0,1fr)_auto_auto] gap-3 pb-2 border-b border-line font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4",children:[(0,V.jsx)("span",{"aria-hidden":"true"}),(0,V.jsx)("span",{children:r("pages.failedTasks.taskId")}),(0,V.jsx)("span",{children:r("pages.failedTasks.painId")}),(0,V.jsx)("span",{children:r("pages.failedTasks.status")}),(0,V.jsx)("span",{children:r("pages.failedTasks.lastError")}),(0,V.jsx)("span",{children:r("pages.failedTasks.attempts")}),(0,V.jsx)("span",{children:r("pages.failedTasks.lastAttempt")}),(0,V.jsx)("span",{"aria-hidden":"true"}),(0,V.jsx)("span",{"aria-hidden":"true"})]}),e.map(p=>{let b=o===p.taskId;return(0,V.jsxs)(Ia.Fragment,{children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto_minmax(0,1fr)_auto_minmax(0,1fr)_auto_auto] gap-3 py-2 items-center text-[13px] border-b border-line/50 last:border-b-0",children:[(0,V.jsx)(pe,{variant:"quiet",size:"icon",className:"h-6 w-6 shrink-0 text-[12px]",onClick:()=>m(p.taskId),"aria-label":r("pages.failedTasks.detailToggle"),"aria-expanded":b,"data-testid":`detail-toggle-${p.taskId}`,children:b?"\u25BE":"\u25B8"}),(0,V.jsx)("span",{className:"font-mono text-ink-2 truncate",title:p.taskId,children:e2(p.taskId)}),(0,V.jsx)("span",{className:"font-mono text-ink-3 truncate",title:p.painId??"",children:p.painId?e2(p.painId):r("pages.failedTasks.noPainId")}),(0,V.jsx)(la,{variant:PV(p.status),children:p.status}),(0,V.jsx)("span",{className:"text-ink-3 truncate",title:p.lastError??"",children:p.lastError??"\u2014"}),(0,V.jsx)("span",{className:"font-mono text-ink-2 text-center",children:p.attemptCount}),(0,V.jsx)("span",{className:"font-mono text-ink-3 text-[12px]",children:p.lastAttemptAt?sf(p.lastAttemptAt):"\u2014"}),p.ownerDecisionRequired===!0?(0,V.jsxs)("span",{className:"whitespace-nowrap text-[12px]",children:[(0,V.jsx)("span",{className:"text-amber",children:r("pages.failedTasks.awaitingOwnerDecision")})," ",(0,V.jsx)("a",{href:"#/focus",className:"text-gov underline underline-offset-2 hover:text-gov/80","data-testid":`go-focus-${p.taskId}`,children:r("pages.failedTasks.goGovernanceFocus")})]}):a?(0,V.jsx)(pe,{variant:"default",size:"sm",onClick:()=>a(p),className:"whitespace-nowrap",children:r("pages.failedTasks.recover")}):null,(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:()=>t(p),className:"whitespace-nowrap",children:r("pages.failedTasks.createDraft")})]}),b&&(0,V.jsx)("div",{className:"border border-line/60 rounded-[var(--radius-md)] bg-panel/60 p-4 mb-2","data-testid":`detail-panel-${p.taskId}`,children:(0,V.jsx)(UV,{state:l.status==="idle"?{status:"loading",taskId:p.taskId}:l,taskId:p.taskId,onRetry:f,t:r})})]},p.taskId)})]})}function UV({state:e,taskId:t,onRetry:a,t:n}){if(e.status==="loading")return(0,V.jsx)("div",{className:"text-ink-3 text-[13px]","data-testid":"detail-loading",children:n("common.loading")});if(e.status==="error")return(0,V.jsxs)("div",{className:"text-[13px] space-y-2","data-testid":"detail-error",children:[(0,V.jsxs)("div",{className:"text-danger",children:[n("pages.failedTasks.detailError"),": ",e.message]}),e.nextAction&&(0,V.jsx)("div",{className:"text-ink-3",children:e.nextAction}),(0,V.jsx)("div",{children:(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:()=>a(t),children:n("common.refresh")})})]});if(e.status==="idle"||e.taskId!==t)return(0,V.jsx)("div",{className:"text-ink-3 text-[13px]","data-testid":"detail-loading",children:n("common.loading")});let{data:r}=e;return(0,V.jsxs)("div",{className:"space-y-4 text-[13px]",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 font-mono text-[12px]",children:[(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.taskId")}),(0,V.jsx)("span",{className:"text-ink-2 break-all",children:r.taskId}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.kind")}),(0,V.jsx)("span",{className:"text-ink-2",children:r.taskKind}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.status")}),(0,V.jsx)("span",{className:"text-ink-2",children:r.status}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.createdAt")}),(0,V.jsx)("span",{className:"text-ink-3",children:sf(r.createdAt)}),r.updatedAt&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.updatedAt")}),(0,V.jsx)("span",{className:"text-ink-3",children:sf(r.updatedAt)})]}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.attempts")}),(0,V.jsxs)("span",{className:"text-ink-2",children:[r.attemptCount," / ",r.maxAttempts]}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.lastError")}),(0,V.jsx)("span",{className:r.lastError?"text-danger":"text-ink-3",children:r.lastError??"\u2014"})]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("div",{className:"font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4 mb-2",children:[n("pages.failedTasks.runsTitle")," (",r.runs.length,")"]}),r.runs.length===0?(0,V.jsx)("div",{className:"text-ink-3",children:n("pages.failedTasks.noRuns")}):(0,V.jsxs)("div",{className:"space-y-1",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)] gap-3 pb-1 border-b border-line/50 font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4",children:[(0,V.jsx)("span",{children:n("pages.failedTasks.runAttempt")}),(0,V.jsx)("span",{children:n("pages.failedTasks.status")}),(0,V.jsx)("span",{children:n("pages.failedTasks.runStarted")}),(0,V.jsx)("span",{children:n("pages.failedTasks.runReason")})]}),r.runs.map(i=>(0,V.jsxs)("div",{className:"grid grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)] gap-3 py-1 text-[12px] border-b border-line/30 last:border-b-0",title:`${n("pages.failedTasks.runEnded")}: ${i.endedAt?sf(i.endedAt):"\u2014"}${i.errorCategory?` \xB7 ${n("pages.failedTasks.runErrorCategory")}: ${i.errorCategory}`:""}`,children:[(0,V.jsxs)("span",{className:"font-mono text-ink-2",children:["#",i.attemptNumber]}),(0,V.jsx)("span",{className:"font-mono text-ink-3",children:i.executionStatus}),(0,V.jsx)("span",{className:"font-mono text-ink-3",children:sf(i.startedAt)}),(0,V.jsx)("span",{className:"text-ink-3 break-words",title:i.reason??void 0,children:i.reason??i.errorCategory??"\u2014"})]},i.runId))]})]})]})}var Zt=D(ee(),1);var Ba=D(ee(),1);var r2=[{key:"why",headerRegex:/^##\s+1\.\s*Why\s*$/im,label:"why",header:"## 1. Why"},{key:"desiredOutcome",headerRegex:/^##\s+2\.\s*Desired Outcome\s*$/im,label:"desiredOutcome",header:"## 2. Desired Outcome"},{key:"nonNegotiables",headerRegex:/^##\s+3\.\s*Non-negotiables\s*$/im,label:"nonNegotiables",header:"## 3. Non-negotiables"},{key:"stopEscalation",headerRegex:/^##\s+4\.\s*Stop\s*\/\s*Escalation\s*$/im,label:"stopEscalation",header:"## 4. Stop / Escalation"},{key:"currentStrategicFocus",headerRegex:/^##\s+5\.\s*Current Strategic Focus\s*$/im,label:"currentStrategicFocus",header:"## 5. Current Strategic Focus"}];function vl(e){let t={};for(let a of r2){let n=a.headerRegex.exec(e);if(n===null)continue;let r=e.slice(n.index+n[0].length),i=/^##\s+/m.exec(r);t[a.key]=r.slice(0,i!==null?i.index:r.length).trim()}return t}function Bg(e){let t=["# INTENT.md",""];for(let a of r2){let n=e[a.key],r=typeof n=="string"?n:"";t.push(a.header,"",r,"")}return t.join(`
110
+ `).filter(L=>L.length>0),q=L=>{let re=L.target;re.closest("[data-agent-toggle]")||re.closest("[data-confirm-bar]")||re.closest("[data-tech-toggle]")||re.closest("[data-action-row]")||u(qe=>!qe)},R=L=>{L.stopPropagation(),e.enabled?t.isCore?(p(!0),u(!0)):n(e.name,e.runtimeProfileId,!1):n(e.name,e.runtimeProfileId,!0)},F=L=>{L.stopPropagation(),n(e.name,e.runtimeProfileId,!1),p(!1)},se=L=>{L.stopPropagation(),p(!1)},ve=L=>{L.stopPropagation(),f(re=>!re)},z=L=>{n(e.name,L.target.value,e.enabled)};return(0,Je.jsxs)("div",{"data-agent-card":e.name,className:xe("bg-surface border border-line-2 rounded-[4px] mb-[6px] overflow-hidden transition-colors hover:border-line",!t.isCore&&"border-dashed",!e.enabled&&"opacity-72"),children:[(0,Je.jsxs)("div",{className:"px-[16px] py-[12px] cursor-pointer flex items-center gap-[12px]",onClick:q,role:"button",tabIndex:0,"aria-expanded":c,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),u(re=>!re))},children:[(0,Je.jsx)("div",{className:Dq(C,e.enabled),"aria-hidden":"true"}),(0,Je.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Je.jsxs)("div",{className:xe("text-[14px] font-semibold tracking-[-0.005em] flex items-center gap-[8px]",e.enabled?"text-ink":"text-ink-3"),children:[(0,Je.jsx)("span",{children:I}),(0,Je.jsx)("span",{className:"font-mono text-[11.5px] text-ink-4 font-normal",children:e.name})]}),(0,Je.jsx)("div",{className:"text-[12.5px] text-ink-3 mt-[2px] leading-[1.5]",children:k})]}),(0,Je.jsx)("button",{type:"button","data-agent-toggle":!0,onClick:R,disabled:l,"aria-label":e.enabled?o("pages.controlCenter.agentDisabled"):o("pages.controlCenter.agentEnabled"),className:xe("rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium transition-colors disabled:opacity-50",e.enabled?"border border-gov bg-gov text-paper hover:bg-gov-2":"border border-line bg-surface text-ink hover:border-line-2"),children:l?o("pages.controlCenter.saving"):e.enabled?o("pages.controlCenter.on"):o("pages.controlCenter.off")}),(0,Je.jsx)(io,{className:xe("w-[14px] h-[14px] text-ink-4 transition-transform shrink-0",c&&"rotate-90"),"aria-hidden":"true"})]}),c&&(0,Je.jsxs)("div",{className:"px-[16px] pb-[14px] border-t border-line-2 bg-panel",children:[(0,Je.jsx)("div",{className:"pt-[14px] text-[13px] text-ink-3 leading-[1.62]",children:oe.map((L,re)=>(0,Je.jsx)("p",{className:re>0?"mt-2":void 0,children:wT(L)},re))}),H&&(0,Je.jsx)("div",{className:"mt-3 text-[12px] text-ink-4 font-mono italic",children:H}),(0,Je.jsxs)("div",{className:xe("mt-[12px] px-[12px] py-[10px] border border-line-2 border-l-[2.5px] rounded-[4px] bg-paper-2 text-[12.5px] text-ink-3 leading-[1.55]",Lq(t.impactLevel)),children:[(0,Je.jsx)("span",{className:xe("block mb-[3px] text-[10px] font-mono uppercase tracking-[0.08em] font-medium",Nq(t.impactLevel)),children:o("pages.controlCenter.impact.label")}),_]}),t.action&&Y&&(0,Je.jsx)("div",{"data-action-row":!0,className:"mt-[12px] pt-[12px] border-t border-line-2",children:(0,Je.jsxs)("button",{type:"button",onClick:L=>{L.stopPropagation(),s(t.action.to)},className:"flex items-center gap-[6px] text-[12px] text-gov hover:text-gov-2 transition-colors font-medium",children:[(0,Je.jsx)("span",{children:Y}),(0,Je.jsx)(io,{className:"w-[12px] h-[12px]","aria-hidden":"true"})]})}),Object.keys(M).length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("div",{"data-tech-toggle":!0,className:"mt-[12px] pt-[12px] border-t border-line-2 flex items-center gap-[6px] cursor-pointer text-[11px] text-ink-4 font-mono uppercase tracking-[0.04em] hover:text-ink-2 transition-colors",onClick:ve,role:"button",tabIndex:0,"aria-expanded":d,onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),L.stopPropagation(),f(re=>!re))},children:[(0,Je.jsx)(io,{className:xe("w-[12px] h-[12px] transition-transform",d&&"rotate-90"),"aria-hidden":"true"}),o("pages.controlCenter.techDetail")]}),d&&(0,Je.jsx)("div",{className:"mt-2 grid grid-cols-[72px_1fr] gap-x-[14px] gap-y-[6px] text-[12px] leading-[1.55]",children:Object.entries(M).map(([L,re])=>(0,Je.jsxs)("div",{className:"contents",children:[(0,Je.jsx)("div",{className:"text-ink-4 font-mono text-[10.5px] uppercase tracking-[0.04em] pt-px",children:L}),(0,Je.jsx)("div",{className:"text-ink-3",children:wT(re)})]},L))})]}),(0,Je.jsxs)("div",{className:"mt-[12px] pt-[12px] border-t border-line-2 flex items-center gap-[10px] text-[12px] flex-wrap",children:[(0,Je.jsx)("span",{className:"text-ink-4 font-mono text-[10.5px] uppercase tracking-[0.04em]",children:o("pages.controlCenter.profileLabelShort")}),(0,Je.jsx)("select",{value:e.runtimeProfileId,onChange:z,disabled:l,className:"font-mono text-[11px] text-ink-2 bg-surface border border-line-2 rounded-[3px] px-2 py-1 cursor-pointer focus:outline-none focus:border-gov disabled:opacity-50","aria-label":o("pages.controlCenter.profileLabel"),children:a.map(L=>(0,Je.jsx)("option",{value:L.id,children:L.label},L.id))}),g&&(0,Je.jsx)("span",{className:"text-[10.5px] text-ink-4 font-mono animate-pulse",children:o("pages.controlCenter.readinessChecking")}),(0,Je.jsx)("button",{type:"button","data-manage-profiles":!0,onClick:L=>{L.stopPropagation();let re=document.getElementById("runtime-profile-manager");re&&re.scrollIntoView({behavior:"smooth",block:"start"})},className:"ml-auto text-[11px] text-ink-4 hover:text-ink-2 transition-colors px-[8px] py-[3px] border border-line-2 rounded-[3px] focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2","aria-label":o("pages.controlCenter.manageProfiles"),children:o("pages.controlCenter.manageProfiles")})]}),m&&(0,Je.jsxs)("div",{"data-confirm-bar":!0,className:"mt-[10px] px-[12px] py-[10px] border border-danger rounded-[4px] bg-danger/10 text-[12px] text-ink-2 leading-[1.55]",children:[(0,Je.jsx)("div",{children:_}),(0,Je.jsxs)("div",{className:"mt-2 flex gap-[8px]",children:[(0,Je.jsx)("button",{type:"button",onClick:F,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-transparent bg-danger text-paper font-medium hover:opacity-90 transition-opacity focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.controlCenter.impact.confirmAck")}),(0,Je.jsx)("button",{type:"button",onClick:se,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-line bg-transparent text-ink-3 hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.controlCenter.impact.confirmCancel")})]})]})]})]})}var ho=D(W(),1);function Eq(e){let t="text-[10px] font-mono px-[7px] py-[2px] rounded-[2px] tracking-[0.02em] font-medium border border-transparent";switch(e){case"must":return xe(t,"bg-danger/10 text-danger border-danger/22");case"recommend":return xe(t,"bg-amber/10 text-amber border-amber/22");case"optional":return xe(t,"bg-paper-2 text-ink-4 border-line-2");case"independent":return xe(t,"bg-green/10 text-green border-green/22");default:return t}}function ST({groupMeta:e,agents:t,profiles:a,onBindingChange:n,saving:r,locale:i}){let{t:o}=X(),s=i==="zh-CN",l=s?e.labelZh:e.labelEn,c=s?e.tagLabelZh:e.tagLabelEn,u=s?e.hintZh:e.hintEn,d=t.filter(f=>ml(f.name));return(0,ho.jsxs)("div",{className:"mb-[20px]",children:[(0,ho.jsxs)("div",{className:"px-[14px] py-[9px] bg-paper-2 border border-line-2 rounded-[4px] flex items-center gap-[10px] mb-[8px]",children:[(0,ho.jsx)("span",{className:"text-[12.5px] font-semibold text-ink-2",children:l}),(0,ho.jsx)("span",{className:Eq(e.tag),children:c}),(0,ho.jsx)("span",{className:"ml-auto text-[11px] text-ink-4 font-mono leading-[1.4] max-w-[32ch] text-right",children:u})]}),d.length===0?(0,ho.jsx)("div",{className:"py-2 px-4 text-[12.5px] text-ink-4 italic",children:"\u2014"}):d.map(f=>{let m=Bi[f.name];return(0,ho.jsx)(kT,{agent:f,meta:m,profiles:a,onBindingChange:n,saving:r,locale:i},f.name)})]})}var xs=D(ee(),1);var Ne=D(W(),1),Sw={id:"",provider:"",model:"",apiKeyEnv:"",baseUrl:""};function Oq(e){let t="w-2 h-2 rounded-full border-2 shrink-0";switch(e){case"ready":return xe(t,"border-green bg-green");case"needs_setup":case"not_ready":case"unknown":return xe(t,"border-amber bg-surface");case"disabled":return xe(t,"border-ink-4 bg-surface opacity-50");default:return xe(t,"border-ink-4 bg-surface")}}function Tq(e){let t={type:"pi-ai",provider:e.provider.trim(),model:e.model.trim(),apiKeyEnv:e.apiKeyEnv.trim()};return e.baseUrl.trim()!==""&&(t.baseUrl=e.baseUrl.trim()),t}function Pq(e){let t={};return e.provider.trim()!==""&&(t.provider=e.provider.trim()),e.model.trim()!==""&&(t.model=e.model.trim()),e.apiKeyEnv.trim()!==""&&(t.apiKeyEnv=e.apiKeyEnv.trim()),e.baseUrl.trim()!==""&&(t.baseUrl=e.baseUrl.trim()),t}function _q(e){return{id:e.id,provider:e.provider??"",model:e.model??"",apiKeyEnv:e.apiKeyEnv??"",baseUrl:""}}function CT({profiles:e,defaultRuntimeId:t,onMutated:a}){let{t:n}=X(),[r,i]=(0,xs.useState)("closed"),[o,s]=(0,xs.useState)(Sw),[l,c]=(0,xs.useState)(null),[u,d]=(0,xs.useState)(!1),[f,m]=(0,xs.useState)(null),[p,b]=(0,xs.useState)(!1),[v,g]=(0,xs.useState)(null),h=()=>{s(Sw),c(null),i("create")},x=Y=>{s(_q(Y)),c(null),i("edit")},y=()=>{i("closed"),s(Sw),c(null)},C=(Y,oe)=>{s(q=>({...q,[Y]:oe}))};function A(){return r==="create"&&o.id.trim()===""?n("pages.controlCenter.profiles.validationIdRequired"):o.provider.trim()===""?n("pages.controlCenter.profiles.validationProviderRequired"):o.model.trim()===""?n("pages.controlCenter.profiles.validationModelRequired"):o.apiKeyEnv.trim()===""?n("pages.controlCenter.profiles.validationApiKeyEnvRequired"):null}let I=async Y=>{Y.preventDefault();let oe=A();if(oe!==null){c(oe);return}if(c(null),d(!0),r==="create"){let R=await aL(o.id.trim(),Tq(o));if(d(!1),!R.success){c(R.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.createSuccess")),y(),a();return}let q=await nL(o.id,Pq(o));if(d(!1),!q.success){c(q.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.updateSuccess")),y(),a()},k=async()=>{if(f===null)return;b(!0),g(null);let Y=await rL(f);if(b(!1),!Y.success){g(Y.error),U.error(n("pages.controlCenter.profiles.operationFailed"));return}U.success(n("pages.controlCenter.profiles.deleteSuccess")),m(null),g(null),a()},T=()=>{m(null),g(null)},_="bg-surface border border-line-2 rounded-[3px] px-[10px] py-[6px] text-[12.5px] text-ink focus:outline-none focus:border-gov disabled:opacity-50 disabled:cursor-not-allowed w-full",M="block font-mono text-[10.5px] uppercase tracking-[0.04em] text-ink-4 mb-[4px]",H="mt-[3px] text-[11px] text-ink-4 leading-[1.4]";return(0,Ne.jsxs)("div",{id:"runtime-profile-manager",className:"scroll-mt-4",children:[(0,Ne.jsxs)("div",{className:"flex items-center justify-between gap-[12px] mb-3",children:[(0,Ne.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:n("pages.controlCenter.profiles.sectionDescription")}),r==="closed"&&(0,Ne.jsx)("button",{type:"button",onClick:h,className:"shrink-0 border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.controlCenter.profiles.createButton")})]}),r!=="closed"&&(0,Ne.jsxs)("form",{onSubmit:I,className:"mb-[10px] bg-panel border border-line rounded-[6px] px-[16px] py-[14px]",children:[(0,Ne.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ne.jsx)("h4",{className:"text-[13px] font-semibold text-ink",children:r==="create"?n("pages.controlCenter.profiles.formTitleCreate"):n("pages.controlCenter.profiles.formTitleEdit",{id:o.id})}),(0,Ne.jsx)("button",{type:"button",onClick:y,className:"text-[12px] text-ink-4 hover:text-ink-2 transition-colors",children:n("pages.controlCenter.profiles.cancelButton")})]}),(0,Ne.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-[14px] gap-y-[12px]",children:[(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-id",children:n("pages.controlCenter.profiles.fieldId")}),(0,Ne.jsx)("input",{id:"rpf-id",type:"text",value:o.id,onChange:Y=>C("id",Y.target.value),disabled:r==="edit"||u,placeholder:n("pages.controlCenter.profiles.fieldIdPlaceholder"),className:_,autoComplete:"off",spellCheck:!1}),(0,Ne.jsx)("p",{className:H,children:n("pages.controlCenter.profiles.fieldIdHint")})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-provider",children:n("pages.controlCenter.profiles.fieldProvider")}),(0,Ne.jsx)("input",{id:"rpf-provider",type:"text",value:o.provider,onChange:Y=>C("provider",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldProviderPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-model",children:n("pages.controlCenter.profiles.fieldModel")}),(0,Ne.jsx)("input",{id:"rpf-model",type:"text",value:o.model,onChange:Y=>C("model",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldModelPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-apikeyenv",children:n("pages.controlCenter.profiles.fieldApiKeyEnv")}),(0,Ne.jsx)("input",{id:"rpf-apikeyenv",type:"text",value:o.apiKeyEnv,onChange:Y=>C("apiKeyEnv",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldApiKeyEnvPlaceholder"),className:xe(_,"font-mono"),autoComplete:"off",spellCheck:!1}),(0,Ne.jsx)("p",{className:H,children:n("pages.controlCenter.profiles.fieldApiKeyEnvHint")})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("label",{className:M,htmlFor:"rpf-baseurl",children:n("pages.controlCenter.profiles.fieldBaseUrl")}),(0,Ne.jsx)("input",{id:"rpf-baseurl",type:"text",value:o.baseUrl,onChange:Y=>C("baseUrl",Y.target.value),disabled:u,placeholder:n("pages.controlCenter.profiles.fieldBaseUrlPlaceholder"),className:_,autoComplete:"off",spellCheck:!1})]})]}),l!==null&&(0,Ne.jsx)("div",{className:"mt-3 px-[12px] py-[8px] border border-danger/35 rounded-[4px] bg-danger/10 text-[12px] text-danger font-mono",children:l}),(0,Ne.jsxs)("div",{className:"mt-3 flex items-center gap-[8px]",children:[(0,Ne.jsx)("button",{type:"submit",disabled:u,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n(u?r==="create"?"pages.controlCenter.profiles.creating":"pages.controlCenter.profiles.saving":"pages.controlCenter.profiles.saveButton")}),(0,Ne.jsx)("button",{type:"button",onClick:y,disabled:u,className:"border border-line bg-surface text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 hover:text-ink transition-colors disabled:opacity-50",children:n("pages.controlCenter.profiles.cancelButton")})]})]}),e.length===0?(0,Ne.jsx)("div",{className:"bg-surface border border-line-2 rounded-[4px] px-[16px] py-[14px] text-[12.5px] text-ink-4 italic",children:n("pages.controlCenter.profiles.empty")}):(0,Ne.jsxs)("div",{className:"bg-surface border border-line-2 rounded-[4px] overflow-hidden",children:[(0,Ne.jsxs)("div",{className:"grid grid-cols-[12px_1fr_84px_1fr_1fr_1fr_auto] gap-[10px] items-center px-[16px] py-[9px] bg-paper-2 border-b border-line-2 font-mono text-[10.5px] uppercase tracking-[0.04em] text-ink-4",children:[(0,Ne.jsx)("span",{}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnId")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnType")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnProvider")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnModel")}),(0,Ne.jsx)("span",{children:n("pages.controlCenter.profiles.columnApiKeyEnv")}),(0,Ne.jsx)("span",{className:"text-right",children:n("pages.controlCenter.profiles.columnActions")})]}),e.map(Y=>{let oe=Y.id===t,q=f===Y.id;return(0,Ne.jsxs)("div",{className:"border-b border-line-2 last:border-b-0",children:[(0,Ne.jsxs)("div",{className:"grid grid-cols-[12px_1fr_84px_1fr_1fr_1fr_auto] gap-[10px] items-center px-[16px] py-[10px] text-[12.5px]",children:[(0,Ne.jsx)("div",{className:Oq(Y.readiness),"aria-label":va("readiness",Y.readiness,n),title:va("readiness",Y.readiness,n)}),(0,Ne.jsxs)("div",{className:"min-w-0 flex items-center gap-[6px]",children:[(0,Ne.jsx)("span",{className:"font-mono text-[12px] text-ink truncate",children:Y.id}),oe&&(0,Ne.jsx)("span",{className:"shrink-0 text-[9.5px] font-mono px-[5px] py-[1px] rounded-[2px] bg-gov/10 text-gov border border-gov/22 tracking-[0.02em]",children:"default"})]}),(0,Ne.jsxs)("span",{className:"font-mono text-[11.5px] text-ink-3 flex items-center gap-[5px]",children:[Y.type,Y.type==="openclaw"&&(0,Ne.jsx)("span",{className:"text-[9.5px] font-mono px-[5px] py-[1px] rounded-[2px] bg-amber/10 text-amber border border-amber/22 tracking-[0.02em]",children:n("pages.controlCenter.profiles.retiredBadge")})]}),(0,Ne.jsx)("span",{className:"text-ink-3 truncate",children:Y.provider??"\u2014"}),(0,Ne.jsx)("span",{className:"text-ink-3 truncate",children:Y.model??"\u2014"}),(0,Ne.jsx)("span",{className:"font-mono text-[11.5px] text-ink-3 truncate",children:Y.apiKeyEnv??"\u2014"}),(0,Ne.jsxs)("div",{className:"flex items-center justify-end gap-[6px]",children:[Y.type!=="openclaw"&&(0,Ne.jsx)("button",{type:"button",onClick:()=>x(Y),disabled:r!=="closed"||p,className:"text-[11.5px] px-[10px] py-[4px] rounded-[3px] border border-line bg-surface text-ink-3 hover:border-line-2 hover:text-ink transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:n("pages.controlCenter.profiles.editButton")}),(0,Ne.jsx)("button",{type:"button",onClick:()=>{m(Y.id),g(null)},disabled:r!=="closed"||p||f!==null,className:"text-[11.5px] px-[10px] py-[4px] rounded-[3px] border border-line bg-surface text-ink-3 hover:border-danger/40 hover:text-danger transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:n("pages.controlCenter.profiles.deleteButton")})]})]}),q&&(0,Ne.jsx)("div",{className:"px-[16px] pb-[12px]",children:(0,Ne.jsxs)("div",{className:"px-[12px] py-[10px] border border-danger rounded-[4px] bg-danger/10 text-[12px] text-ink-2 leading-[1.55]",children:[(0,Ne.jsx)("div",{className:"font-medium",children:n("pages.controlCenter.profiles.deleteConfirmMessage",{id:Y.id})}),oe&&(0,Ne.jsx)("div",{className:"mt-1 text-ink-3",children:n("pages.controlCenter.profiles.sectionDescription")}),v!==null&&(0,Ne.jsx)("div",{className:"mt-2 font-mono text-[11.5px] text-danger",children:v}),(0,Ne.jsxs)("div",{className:"mt-2 flex gap-[8px]",children:[(0,Ne.jsx)("button",{type:"button",onClick:k,disabled:p,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-transparent bg-danger text-paper font-medium hover:opacity-90 transition-opacity disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n(p?"pages.controlCenter.profiles.deleting":"pages.controlCenter.profiles.deleteConfirmAck")}),(0,Ne.jsx)("button",{type:"button",onClick:T,disabled:p,className:"text-[11.5px] px-[12px] py-[4px] rounded-[3px] border border-line bg-transparent text-ink-3 hover:border-line-2 transition-colors disabled:opacity-50",children:n("pages.controlCenter.profiles.deleteConfirmCancel")})]})]})})]},Y.id)})]})]})}var Xt=D(ee(),1);var Le=D(W(),1),RT={approved:"approved",not_approved:"notApproved",not_required:"notRequired"},IT={read:"read",write:"write",execute:"execute"};function Xu(e){return`${e.projectWorkspacePath}${e.hostSessionId}`}function Bq(e){return e.split(/\r?\n/).map(t=>t.trim()).filter(Boolean)}function Cw(e){return{error:e.error,nextAction:e.nextAction,status:e.status}}function Eg(){return"mt-1 w-full rounded-[4px] border border-line bg-surface px-3 py-2 text-[13px] text-ink focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2"}function Zu(){return"rounded-[4px] border border-line px-3 py-2 text-[12.5px] font-medium text-ink transition-colors hover:border-line-2 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}function AT(){let{t:e}=X(),[t,a]=(0,Xt.useState)([]),[n,r]=(0,Xt.useState)(""),[i,o]=(0,Xt.useState)(null),[s,l]=(0,Xt.useState)(!0),[c,u]=(0,Xt.useState)(!1),[d,f]=(0,Xt.useState)(!1),[m,p]=(0,Xt.useState)(null),[b,v]=(0,Xt.useState)(""),[g,h]=(0,Xt.useState)(""),[x,y]=(0,Xt.useState)(["write","execute"]),[C,A]=(0,Xt.useState)("not_approved"),I=(0,Xt.useRef)(0),k=(0,Xt.useMemo)(()=>t.find(R=>Xu(R)===n)??null,[t,n]),T=(0,Xt.useCallback)(async()=>{l(!0),p(null);let R=await EL();if(l(!1),!R.success){p(Cw(R));return}a(R.data.sessions),r(F=>R.data.sessions.some(se=>Xu(se)===F)?F:R.data.sessions[0]?Xu(R.data.sessions[0]):"")},[]),_=(0,Xt.useCallback)(async R=>{let F=++I.current;u(!0),p(null);let se=await OL(R.projectWorkspacePath,R.hostSessionId);if(F===I.current){if(u(!1),!se.success){p(Cw(se)),o(null);return}o(se.data.declaration)}},[]);(0,Xt.useEffect)(()=>{T()},[T]),(0,Xt.useEffect)(()=>{k?_(k):(I.current+=1,u(!1),o(null))},[k,_]);let M=(0,Xt.useCallback)(async R=>{f(!0),p(null);let F=await R();if(f(!1),!F.success){let se=Cw(F);p(se),F.status===409&&k&&(await _(k),p(se));return}if(!F.data.declaration){p({error:e("pages.controlCenter.designGate.invalidMutationResponse")});return}o(F.data.declaration)},[_,k,e]),H=(0,Xt.useCallback)(async()=>{if(!k)return;let R=Bq(g);if(!b.trim()||R.length===0||x.length===0){p({error:e("pages.controlCenter.designGate.requiredFields")});return}await M(()=>TL({projectWorkspacePath:k.projectWorkspacePath,hostSessionId:k.hostSessionId,specPath:b.trim(),scope:{paths:R,actions:x},decision:C}))},[C,M,x,g,k,b,e]),Y=(0,Xt.useCallback)(R=>{i&&M(()=>PL(i.sourceRef,i.revision,R))},[i,M]),oe=(0,Xt.useCallback)(()=>{i&&M(()=>_L(i.sourceRef,i.revision))},[i,M]),q=d||c||s;return(0,Le.jsxs)("section",{className:"mt-8","aria-labelledby":"section-design-gate",children:[(0,Le.jsx)(me,{id:"section-design-gate",children:e("pages.controlCenter.designGate.title")}),(0,Le.jsx)("p",{className:"mb-4 max-w-[68ch] text-[13px] leading-relaxed text-ink-3",children:e("pages.controlCenter.designGate.description")}),m&&(0,Le.jsxs)("div",{role:"alert",className:"mb-4 rounded-[4px] border border-amber/30 border-l-2 border-l-amber bg-amber/10 p-3 text-[12.5px] text-ink-2",children:[(0,Le.jsx)("p",{children:m.error}),m.nextAction&&(0,Le.jsx)("p",{className:"mt-1 text-ink-3",children:m.nextAction}),m.status===409&&k&&(0,Le.jsx)("button",{type:"button",className:"mt-2 underline",disabled:q,onClick:()=>{_(k)},children:e("pages.controlCenter.designGate.refresh")})]}),s?(0,Le.jsx)("p",{className:"text-[13px] text-ink-3",children:e("pages.controlCenter.designGate.loadingSessions")}):t.length===0?(0,Le.jsxs)("div",{className:"rounded-[4px] border border-line bg-panel p-4 text-[13px] text-ink-3",children:[(0,Le.jsx)("p",{children:e("pages.controlCenter.designGate.noSessions")}),(0,Le.jsx)("button",{type:"button",className:`${Zu()} mt-3`,disabled:q,onClick:()=>{T()},children:e("pages.controlCenter.designGate.refresh")})]}):(0,Le.jsxs)("div",{className:"space-y-4 rounded-[4px] border border-line bg-panel p-4",children:[(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.nativeSession"),(0,Le.jsx)("select",{className:Eg(),value:n,disabled:q,onChange:R=>r(R.currentTarget.value),children:t.map(R=>(0,Le.jsxs)("option",{value:Xu(R),children:[R.projectWorkspacePath," \xB7 ",R.hostSessionId]},Xu(R)))})]}),c?(0,Le.jsx)("p",{className:"text-[13px] text-ink-3",children:e("pages.controlCenter.designGate.loadingDeclaration")}):i&&!i.revoked?(0,Le.jsxs)("div",{className:"space-y-3","aria-live":"polite",children:[(0,Le.jsxs)("div",{className:"grid gap-2 rounded-[4px] border border-line-2 bg-surface p-3 text-[12.5px]",children:[(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.decision")})," ",e(`pages.controlCenter.designGate.decisions.${RT[i.decision]}`),i.revoked?` \xB7 ${e("pages.controlCenter.designGate.revoked")}`:""]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.revision")})," ",i.revision]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.spec")})," ",(0,Le.jsx)("span",{className:"break-all font-mono",children:i.specPath})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.specDigest")})," ",(0,Le.jsx)("span",{className:"break-all font-mono",children:i.specDigest})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.scopePaths")})," ",(0,Le.jsx)("span",{className:"font-mono",children:i.scope.paths.join(", ")})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.scopeActions")})," ",i.scope.actions.map(R=>e(`pages.controlCenter.designGate.actions.${IT[R]}`)).join(", ")]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.owner")})," ",(0,Le.jsx)("span",{className:"font-mono",children:i.actor.ownerId})]}),(0,Le.jsxs)("p",{children:[(0,Le.jsx)("strong",{children:e("pages.controlCenter.designGate.decidedAt")})," ",i.decidedAt]})]}),(0,Le.jsx)("p",{className:"border-l-2 border-amber pl-3 text-[12.5px] leading-relaxed text-ink-3",children:e("pages.controlCenter.designGate.semanticLimit")}),!i.revoked&&(0,Le.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q||i.decision==="approved",onClick:()=>Y("approved"),children:e(d?"pages.controlCenter.designGate.saving":"pages.controlCenter.designGate.approve")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q||i.decision==="not_approved",onClick:()=>Y("not_approved"),children:e("pages.controlCenter.designGate.markPending")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q,onClick:oe,children:e("pages.controlCenter.designGate.revoke")})]})]}):(0,Le.jsxs)("div",{className:"space-y-3 border-t border-line pt-4",children:[i?.revoked&&(0,Le.jsxs)("div",{className:"rounded-[4px] border border-line-2 bg-surface p-3 text-[12.5px] text-ink-3",children:[(0,Le.jsx)("p",{children:e("pages.controlCenter.designGate.revokedLatest",{revision:i.revision})}),(0,Le.jsxs)("p",{className:"mt-1 break-all font-mono",children:[i.specPath," \xB7 ",i.scope.paths.join(", ")]})]}),(0,Le.jsx)("p",{className:"text-[12.5px] text-ink-3",children:e("pages.controlCenter.designGate.noDeclaration")}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.specPath"),(0,Le.jsx)("input",{className:Eg(),value:b,onChange:R=>v(R.currentTarget.value),placeholder:e("pages.controlCenter.designGate.specPathHint"),disabled:q})]}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.scopePathsInput"),(0,Le.jsx)("textarea",{className:Eg(),rows:3,value:g,onChange:R=>h(R.currentTarget.value),placeholder:e("pages.controlCenter.designGate.scopePathsHint"),disabled:q})]}),(0,Le.jsx)("p",{className:"-mt-2 text-[12px] leading-relaxed text-ink-4",children:e("pages.controlCenter.designGate.scopePathsHelp")}),(0,Le.jsxs)("fieldset",{disabled:q,children:[(0,Le.jsx)("legend",{className:"text-[12.5px] font-medium text-ink",children:e("pages.controlCenter.designGate.scopeActionsInput")}),(0,Le.jsx)("div",{className:"mt-2 flex flex-wrap gap-4",children:["read","write","execute"].map(R=>(0,Le.jsxs)("label",{className:"flex items-center gap-2 text-[12.5px] text-ink-2",children:[(0,Le.jsx)("input",{type:"checkbox",checked:x.includes(R),onChange:F=>y(se=>F.currentTarget.checked?[...se,R]:se.filter(ve=>ve!==R))}),e(`pages.controlCenter.designGate.actions.${IT[R]}`)]},R))})]}),(0,Le.jsxs)("label",{className:"block text-[12.5px] font-medium text-ink",children:[e("pages.controlCenter.designGate.initialDecision"),(0,Le.jsx)("select",{className:Eg(),value:C,onChange:R=>{let F=R.currentTarget.value;(F==="approved"||F==="not_approved"||F==="not_required")&&A(F)},disabled:q,children:["not_approved","approved","not_required"].map(R=>(0,Le.jsx)("option",{value:R,children:e(`pages.controlCenter.designGate.decisions.${RT[R]}`)},R))})]}),(0,Le.jsx)("p",{className:"text-[12px] leading-relaxed text-ink-4",children:e("pages.controlCenter.designGate.semanticLimit")}),(0,Le.jsx)("button",{type:"button",className:Zu(),disabled:q,onClick:()=>{H()},children:e(d?"pages.controlCenter.designGate.saving":"pages.controlCenter.designGate.create")})]})]})]})}var Q=D(W(),1);function DT(e){if(typeof e!="string")return null;switch(e){case"defaults":return"defaults";case"user_config":return"user_config";default:return null}}function ys(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Mq={ready:"pages.controlCenter.configReady",needs_setup:"pages.controlCenter.configNeedsSetup",not_ready:"pages.controlCenter.configNotReady",unknown:"pages.controlCenter.configUnknown",disabled:"pages.controlCenter.configDisabled"};function Rw(e){if(typeof e!="string")return null;switch(e){case"ready":return"ready";case"not_ready":return"not_ready";case"needs_setup":return"needs_setup";case"disabled":return"disabled";case"unknown":return"unknown";default:return null}}function Fq(e){if(!ys(e)||!Object.hasOwn(e,"id")||!Object.hasOwn(e,"category")||!Object.hasOwn(e,"enabled"))return null;let t=e.id,a=e.category,n=e.enabled;return typeof t!="string"||t.length===0||typeof a!="string"||typeof n!="boolean"?null:{id:t,category:a,enabled:n}}function NT(e){if(!ys(e)||!Object.hasOwn(e,"id")||!Object.hasOwn(e,"type")||!Object.hasOwn(e,"label")||!Object.hasOwn(e,"readiness"))return null;let t=e.id,a=e.type,n=e.label,r=Rw(e.readiness);if(typeof t!="string"||t.length===0||typeof a!="string"||typeof n!="string"||r===null)return null;let i=Object.hasOwn(e,"apiKeyEnv")&&typeof e.apiKeyEnv=="string"?e.apiKeyEnv:void 0,o=Object.hasOwn(e,"provider")&&typeof e.provider=="string"?e.provider:void 0,s=Object.hasOwn(e,"model")&&typeof e.model=="string"?e.model:void 0;return{id:t,type:a,label:n,apiKeyEnv:i,provider:o,model:s,readiness:r}}function Uq(e){if(!ys(e)||!Object.hasOwn(e,"name")||!Object.hasOwn(e,"enabled")||!Object.hasOwn(e,"runtimeProfileId")||!Object.hasOwn(e,"runtimeProfileLabel")||!Object.hasOwn(e,"readiness"))return null;let t=e.name,a=e.enabled,n=e.runtimeProfileId,r=e.runtimeProfileLabel,i=Rw(e.readiness);return typeof t!="string"||t.length===0||typeof a!="boolean"||typeof n!="string"||typeof r!="string"||i===null?null:{name:t,enabled:a,runtimeProfileId:n,runtimeProfileLabel:r,readiness:i}}function ET(e){if(!ys(e)||!Object.hasOwn(e,"path")||!Object.hasOwn(e,"reason")||!Object.hasOwn(e,"nextAction"))return null;let t=e.path,a=e.reason,n=e.nextAction;return typeof t!="string"||typeof a!="string"||typeof n!="string"?null:{path:t,reason:a,nextAction:n}}function jq(e){if(!ys(e)||!Object.hasOwn(e,"version")||!Object.hasOwn(e,"source")||!Object.hasOwn(e,"features")||!Object.hasOwn(e,"runtimeProfiles")||!Object.hasOwn(e,"defaultRuntime")||!Object.hasOwn(e,"agents")||!Object.hasOwn(e,"ui")||!Object.hasOwn(e,"warnings"))return null;let t=e.version,a=e.source,n=e.features,r=e.runtimeProfiles,i=e.defaultRuntime,o=e.agents,s=e.ui,l=e.warnings;if(typeof t!="number"||typeof a!="string"||DT(a)===null||!Array.isArray(n)||!Array.isArray(r)||typeof i!="string"||!Array.isArray(o)||!ys(s)||!Array.isArray(l)||!Object.hasOwn(s,"diagnostics")||!ys(s.diagnostics))return null;let c=s.diagnostics;if(!Object.hasOwn(c,"mode")||typeof c.mode!="string")return null;let u=c.mode,d=[];for(let g of n){let h=Fq(g);if(h===null)return null;d.push(h)}let f=[];for(let g of r){let h=NT(g);if(h===null)return null;f.push(h)}let m=[];for(let g of o){let h=Uq(g);if(h===null)return null;m.push(h)}let p=[];for(let g of l){if(typeof g!="string")return null;p.push(g)}let b;if(Object.hasOwn(e,"errors")&&e.errors!==void 0){if(!Array.isArray(e.errors))return null;b=[];for(let g of e.errors){let h=ET(g);if(h===null)return null;b.push(h)}}let v=DT(a);return v===null?null:{version:t,source:v,features:d,runtimeProfiles:f,defaultRuntime:i,agents:m,ui:{diagnostics:{mode:u}},warnings:p,errors:b}}function Hq(e){if(!ys(e)||!Object.hasOwn(e,"profiles"))return null;let t=e.profiles;if(!Array.isArray(t))return null;let a=[];for(let r of t){let i=NT(r);if(i===null)return null;a.push(i)}let n;if(Object.hasOwn(e,"errors")&&e.errors!==void 0){if(!Array.isArray(e.errors))return null;n=[];for(let r of e.errors){let i=ET(r);if(i===null)return null;n.push(i)}}return{profiles:a,errors:n}}function LT(e){let t="inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase";switch(e){case"ready":return t;case"needs_setup":return t.replace("border-line","border-amber/35").replace("text-ink-3","text-amber");case"not_ready":return t.replace("border-line","border-danger/35").replace("text-ink-3","text-danger");default:return t}}function zq({readiness:e,agents:t}){let{t:a}=X(),n=t.filter(v=>v.enabled).length,r=t.length,i=t.filter(v=>v.enabled&&v.readiness!=="ready").length,o=t.filter(v=>{if(!ml(v.name))return!1;let g=Bi[v.name];return g.group==="core_trio"||g.group==="code_chain"}),s=o.filter(v=>v.enabled),l=o.filter(v=>ml(v.name)?Bi[v.name].group==="core_trio":!1),c=o.filter(v=>ml(v.name)?Bi[v.name].group==="code_chain":!1),u=l.some(v=>!v.enabled),d=c.some(v=>!v.enabled),f=s.some(v=>v.readiness==="not_ready"),m=s.some(v=>v.readiness==="needs_setup"),p,b=f||m;return u||f?p="pages.controlCenter.status.corePipelineParalyzed":d||m?p="pages.controlCenter.status.corePipelineDegraded":p="pages.controlCenter.status.corePipelineOk",(0,Q.jsxs)("div",{className:"mt-5 px-[16px] py-[11px] bg-surface border border-line-2 rounded-[4px] flex items-center gap-[16px] text-[12.5px] text-ink-3 flex-wrap",children:[(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.enabled")}),(0,Q.jsxs)("span",{className:"text-ink font-semibold",children:[(0,Q.jsx)("span",{className:"font-mono",children:n})," /"," ",(0,Q.jsx)("span",{className:"font-mono",children:r})]})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.notReady")}),(0,Q.jsx)("span",{className:"text-ink font-semibold",children:(0,Q.jsx)("span",{className:"font-mono",children:i})})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,Q.jsx)("span",{className:"text-ink-4 font-mono text-[11px] uppercase tracking-[0.04em]",children:a("pages.controlCenter.status.corePipeline")}),(0,Q.jsx)("span",{className:"text-ink font-semibold",children:a(p)})]}),b&&(0,Q.jsx)("span",{className:"ml-auto px-[9px] py-[3px] rounded-[2px] text-[10.5px] font-mono tracking-[0.02em] font-medium border border-amber text-amber bg-amber/10",children:a("pages.controlCenter.status.needsConfig")})]})}function qq({currentDefault:e,profiles:t,onDefaultChange:a,saving:n}){let{t:r}=X();return(0,Q.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] px-[18px] py-[14px]",children:[(0,Q.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:r("pages.controlCenter.defaultRuntimeDescription")}),(0,Q.jsx)("select",{value:e,onChange:i=>{a(i.target.value)},disabled:n,className:"bg-surface border border-line rounded-[3px] px-3 py-[6px] text-[12.5px] text-ink focus:outline-none focus:border-gov disabled:opacity-50 min-w-[200px]","aria-label":r("pages.controlCenter.defaultRuntime"),children:t.map(i=>(0,Q.jsxs)("option",{value:i.id,children:[i.label," \u2014 ",va("readiness",i.readiness,r)]},i.id))}),n&&(0,Q.jsx)("span",{className:"ml-3 text-ink-3 text-[12px]",children:r("pages.controlCenter.saving")})]})}function Vq({config:e}){let{t}=X(),[a,n]=(0,Rn.useState)(!1),r={version:e.version,source:e.source,features:e.features,runtimeProfiles:e.runtimeProfiles,defaultRuntime:e.defaultRuntime,agents:e.agents,ui:e.ui,warnings:e.warnings,errors:e.errors},i=(0,Rn.useCallback)(()=>{let s=xT(r);navigator.clipboard.writeText(s).then(()=>{n(!0),U.success(t("pages.controlCenter.copyDiagnostics")),setTimeout(()=>n(!1),2e3)},()=>{U.error(t("pages.controlCenter.saveFailed"))})},[r,t]),o=bT(r);return(0,Q.jsxs)("details",{className:"group",children:[(0,Q.jsx)("summary",{className:"text-ink-3 text-[13px] cursor-pointer hover:text-ink-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:t("pages.controlCenter.advancedDiagnostics")}),(0,Q.jsxs)("div",{className:"mt-4 space-y-5",children:[(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.features")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2",children:e.features.length===0?(0,Q.jsx)("span",{className:"text-ink-4 text-[13px]",children:"\u2014"}):(0,Q.jsx)("div",{className:"space-y-1",children:e.features.map(s=>(0,Q.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink-2",children:va("featureId",s.id,t)}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:"text-ink-3",children:va("featureCategory",s.category,t)}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:s.enabled?"text-ink-2":"text-ink-4 line-through",children:s.enabled?t("pages.controlCenter.on"):t("pages.controlCenter.off")})]},s.id))})})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.runtimeProfiles")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2",children:e.runtimeProfiles.length===0?(0,Q.jsx)("span",{className:"text-ink-4 text-[13px]",children:"\u2014"}):(0,Q.jsx)("div",{className:"space-y-1",children:e.runtimeProfiles.map(s=>(0,Q.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink-2",children:s.label}),(0,Q.jsx)("span",{className:"text-ink-4",children:"\xB7"}),(0,Q.jsx)("span",{className:"text-ink-3",children:s.type}),(0,Q.jsx)("span",{className:LT(s.readiness),children:va("readiness",s.readiness,t)})]},s.id))})})]}),e.warnings.length>0&&(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.warnings")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-amber/20 border-l-2 border-l-amber rounded-[6px] px-3 py-2",children:(0,Q.jsx)("ul",{className:"space-y-1",children:e.warnings.map((s,l)=>(0,Q.jsx)("li",{className:"text-ink-2 text-[13px]",children:s},l))})})]}),e.errors&&e.errors.length>0&&(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.configErrors")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-danger/20 border-l-2 border-l-danger rounded-[6px] px-3 py-2",children:(0,Q.jsx)("ul",{className:"space-y-2",children:e.errors.map((s,l)=>(0,Q.jsxs)("li",{className:"text-[13px]",children:[(0,Q.jsx)("span",{className:"text-ink font-medium",children:s.path}),(0,Q.jsx)("span",{className:"text-ink-4",children:" \u2014 "}),(0,Q.jsx)("span",{className:"text-ink-2",children:s.reason}),(0,Q.jsxs)("div",{className:"text-ink-3 text-[12px] mt-0.5",children:["\u2192 ",s.nextAction]})]},l))})})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2",children:t("pages.controlCenter.readinessLabel")}),(0,Q.jsx)("div",{className:"bg-surface/60 border border-line rounded-[6px] px-3 py-2 space-y-2",children:Object.keys(o).map(s=>{let l=Rw(s);if(l===null)return null;let c=o[l];return c.length===0?null:(0,Q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Q.jsx)("span",{className:LT(l),children:va("readiness",l,t)}),(0,Q.jsx)("span",{className:"text-ink-3 text-[13px]",children:c.map(u=>u.name).join(", ")})]},l)})})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Q.jsx)("button",{type:"button",onClick:i,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:a?"\u2713":t("pages.controlCenter.copyDiagnostics")}),(0,Q.jsx)("span",{className:"text-ink-4 text-[12px]",children:t("pages.controlCenter.redactedNote")})]})]})]})}function OT(){let{t:e,i18n:t}=X(),[a,n]=(0,Rn.useState)(null),[r,i]=(0,Rn.useState)(null),[o,s]=(0,Rn.useState)("loading"),[l,c]=(0,Rn.useState)(null),[u,d]=(0,Rn.useState)(null),[f,m]=(0,Rn.useState)(!1),p=(0,Rn.useCallback)(async()=>{s("loading"),c(null);let[y,C]=await Promise.all([Zr(),Z1()]);if(!y.success){s("error"),c(y.error);return}let A=jq(y.data);if(A===null){s("error"),c("Config summary data has unexpected shape");return}if(n(A),!C.success)i(null);else{let I=Hq(C.data);i(I)}s("loaded")},[]);(0,Rn.useEffect)(()=>{p()},[p]);let b=(0,Rn.useCallback)(async(y,C,A)=>{d(y);let I=await Q1(y,C,A);if(d(null),!I.success){U.error(e("pages.controlCenter.saveFailed"));return}await p()},[p,e]),v=(0,Rn.useCallback)(async y=>{m(!0);let C=await J1(y);if(m(!1),!C.success){U.error(e("pages.controlCenter.saveFailed"));return}await p()},[p,e]);if(o==="loading")return(0,Q.jsx)(Me,{children:(0,Q.jsx)(It,{cardCount:3,label:e("common.loading")})});if(o==="error")return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,Q.jsx)("p",{children:e("pages.controlCenter.loadError")}),l&&(0,Q.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:l})]})]});if(a===null)return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsx)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:(0,Q.jsx)("p",{children:e("pages.controlCenter.loadError")})})]});let g={version:a.version,source:a.source,features:a.features,runtimeProfiles:a.runtimeProfiles,defaultRuntime:a.defaultRuntime,agents:a.agents,ui:a.ui,warnings:a.warnings,errors:a.errors},h=kw(g),x=r?.profiles??a.runtimeProfiles;return(0,Q.jsx)(Me,{children:(0,Q.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,Q.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.controlCenter.eyebrow")}),(0,Q.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.controlCenter.title")}),(0,Q.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.controlCenter.subtitle")}),(0,Q.jsx)(yT,{}),(0,Q.jsx)(zq,{readiness:h,agents:a.agents}),(0,Q.jsx)(AT,{}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-agents",children:[(0,Q.jsx)(me,{id:"section-agents",children:e("pages.controlCenter.internalAgents")}),(0,Q.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.controlCenter.internalAgentsDescription")}),(0,Q.jsx)("p",{className:h==="ready"?"text-ink-4 text-[13px] leading-relaxed mb-3":"text-amber text-[13px] leading-relaxed mb-3",children:e(Mq[h])}),(()=>{let{groups:y,unknown:C}=vT(a.agents),A=t.language.startsWith("en")?"en":"zh-CN";return(0,Q.jsxs)(Q.Fragment,{children:[hT.map(I=>(0,Q.jsx)(ST,{groupMeta:I,agents:(y[I.id]??[]).filter(k=>k.name!==Bi.signalCollector.name),profiles:x,onBindingChange:b,saving:u,locale:A},I.id)),C.length>0&&(0,Q.jsx)("div",{className:"mt-3 px-3 py-2 border border-amber/30 border-l-2 border-l-amber rounded-[4px] bg-amber/10 text-[12.5px] text-ink-3",children:e("pages.controlCenter.unknownAgentsWarning",{count:C.length,names:C.map(I=>I.name).join(", ")})})]})})()]}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-default-runtime",children:[(0,Q.jsx)(me,{id:"section-default-runtime",children:e("pages.controlCenter.defaultRuntime")}),(0,Q.jsx)(qq,{currentDefault:a.defaultRuntime,profiles:x,onDefaultChange:v,saving:f})]}),(0,Q.jsxs)("section",{className:"mt-8","aria-labelledby":"section-runtime-profiles",children:[(0,Q.jsx)(me,{id:"section-runtime-profiles",children:e("pages.controlCenter.profiles.sectionTitle")}),(0,Q.jsx)(CT,{profiles:x,defaultRuntimeId:a.defaultRuntime,onMutated:p})]}),(0,Q.jsx)("section",{className:"mt-8","aria-labelledby":"section-diagnostics",children:(0,Q.jsx)(Vq,{config:a})}),(0,Q.jsx)("p",{className:"mt-10 pt-[18px] border-t border-line-2 text-ink-4 text-[12px] leading-[1.6] max-w-[60ch] font-mono",children:e("pages.controlCenter.footerNote")})]})})}var mt=D(ee(),1);var Iw={completed:!1,step:0,status:"pending"},Gq="pd_onboarding";function Aw(e){return`${Gq}_${e}`}function $q(e){if(typeof e!="object"||e===null)return!1;let t=Object.hasOwn(e,"completed")?Reflect.get(e,"completed"):void 0,a=Object.hasOwn(e,"step")?Reflect.get(e,"step"):void 0,n=Object.hasOwn(e,"status")?Reflect.get(e,"status"):void 0,r=Object.hasOwn(e,"completedAt")?Reflect.get(e,"completedAt"):void 0;return typeof t=="boolean"&&typeof a=="number"&&(n==="pending"||n==="demo"||n==="skipped"||n==="evidence_found")&&(!Object.hasOwn(e,"completedAt")||typeof r=="string")}function Og(e){try{let t=localStorage.getItem(Aw(e));if(!t)return Iw;let a=JSON.parse(t);return $q(a)?a:Iw}catch(t){return console.error("[onboarding-state] Failed to read onboarding state:",t),Iw}}function TT(e,t){try{return localStorage.setItem(Aw(e),JSON.stringify(t)),!0}catch(a){return console.error("[onboarding-state] Failed to save onboarding state:",a),!1}}function PT(e){try{return localStorage.removeItem(Aw(e)),!0}catch(t){return console.error("[onboarding-state] Failed to reset onboarding state:",t),!1}}var $=D(W(),1);function _T(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function BT(e){if(!_T(e)||!Object.hasOwn(e,"name")||!Object.hasOwn(e,"path")||!Object.hasOwn(e,"lastSync"))return null;let t=e.name,a=e.path,n=e.lastSync;if(typeof t!="string"||t.length===0||typeof a!="string"||a.length===0||n!==null&&typeof n!="string")return null;let r=null;if(Object.hasOwn(e,"config")&&e.config!==null){if(!_T(e.config))return null;let i=e.config;if(!Object.hasOwn(i,"workspaceName")||!Object.hasOwn(i,"enabled")||!Object.hasOwn(i,"syncEnabled")||typeof i.workspaceName!="string"||typeof i.enabled!="boolean"||typeof i.syncEnabled!="boolean")return null;let o=Object.hasOwn(i,"displayName")&&typeof i.displayName=="string"?i.displayName:null;r={workspaceName:i.workspaceName,enabled:i.enabled,displayName:o,syncEnabled:i.syncEnabled}}return{name:t,path:a,lastSync:n,config:r}}function Wq(e){if(!Array.isArray(e))return null;let t=[];for(let a of e){let n=BT(a);if(n===null)return null;t.push(n)}return t}function Dw(){return typeof window>"u"?void 0:window.pdCompanion}function MT(){let{t:e}=X(),{soundEnabled:t,setSoundEnabled:a}=Zm(),[n,r]=(0,mt.useState)("loading"),[i,o]=(0,mt.useState)(null),[s,l]=(0,mt.useState)(""),[c,u]=(0,mt.useState)(!1),[d,f]=(0,mt.useState)(null),[m,p]=(0,mt.useState)(""),[b,v]=(0,mt.useState)(""),[g,h]=(0,mt.useState)(!1),[x,y]=(0,mt.useState)([]),[C,A]=(0,mt.useState)(""),[I,k]=(0,mt.useState)(""),[T,_]=(0,mt.useState)("zh-CN"),[M,H]=(0,mt.useState)(null),[Y,oe]=(0,mt.useState)(null),[q,R]=(0,mt.useState)(null),F=(0,mt.useCallback)(async()=>{r("loading"),o(null);let ne=Hm();l(ne??"");let Ce=await zm();if(!Ce.success){r("error"),o(Ce.error??"Unknown error");return}let ot=Wq(Ce.data);if(ot===null){r("error"),o("Workspace data has unexpected shape");return}y(ot);let be=await oL();if(be.success&&be.data){let xa=be.data.outputLanguage;(xa==="zh-CN"||xa==="en")&&_(xa)}let dt=await Gm();dt.success&&dt.data&&f(dt.data),r("loaded")},[]);(0,mt.useEffect)(()=>{F()},[F]);let se=(0,mt.useCallback)(async()=>{H(null);let ne=await Zr();if(!ne.success||!ne.data){U.error(e("components.onboardingFlag.loadFailed"));return}let Ce=ne.data.features.find(ot=>ot.id==="new_user_onboarding");if(!Ce){U.error(e("components.onboardingFlag.loadFailed"));return}H(Ce.enabled)},[e]);(0,mt.useEffect)(()=>{se()},[se]);let ve=(0,mt.useCallback)(async()=>{oe(null);let ne=await Zr();if(!ne.success||!ne.data){U.error(e("components.fullPipelineFlag.loadFailed"));return}let Ce=ne.data.features.find(ot=>ot.id==="prompt_full_pipeline");if(!Ce){U.error(e("components.fullPipelineFlag.loadFailed"));return}oe(Ce.enabled)},[e]);(0,mt.useEffect)(()=>{ve()},[ve]);let z=(0,mt.useCallback)(async()=>{if(m.trim().length===0||b.trim().length===0){U.error(e("pages.settings.ownerIdentity.required"));return}h(!0);try{if(!(await eL(m.trim(),b.trim())).success){U.error(e("pages.settings.ownerIdentity.operationFailed"));return}let Ce=await Gm();Ce.success&&Ce.data&&f(Ce.data),p(""),v(""),U.success(e("pages.settings.ownerIdentity.registered"))}finally{h(!1)}},[m,b,e]),L=(0,mt.useCallback)(async()=>{h(!0);try{if(!(await tL()).success){U.error(e("pages.settings.ownerIdentity.operationFailed"));return}let Ce=await Gm();Ce.success&&Ce.data&&f(Ce.data),U.success(e("pages.settings.ownerIdentity.unregistered"))}finally{h(!1)}},[e]),re=(0,mt.useCallback)(async()=>{let ne=s.trim();if(ne.length!==0)try{let Ce=Dw();if(Ce!==void 0){let ot=await Ce.configureConsoleToken(ne);if(!ot.persisted){U.error(e("pages.settings.tokenSaveFailed")),ot.nextAction&&U.info(ot.nextAction);return}ot.reason==="external_console_attached"?(U.info(e("pages.settings.tokenExternalAttached")),ot.nextAction&&U.info(ot.nextAction,{duration:8e3})):ot.restartRequested?U.success(e("pages.settings.tokenSavedRestarting")):U.success(e("pages.settings.tokenSaved"))}else U.success(e("pages.settings.tokenSaved"));Iu(ne),await se()}catch{U.error(e("pages.settings.tokenSaveFailed"))}},[s,se,e]),qe=(0,mt.useCallback)(async()=>{u(!1);let ne=Dw();if(ne===void 0){so(),l(""),U.success(e("pages.settings.tokenClearedSession"));return}try{let Ce=await ne.clearConsoleToken();if(!Ce.cleared){Ce.reason==="inherited_env_token"?U.info(e("pages.settings.tokenInheritedEnv")):U.error(e("pages.settings.tokenClearFailed")),Ce.nextAction&&U.info(Ce.nextAction,{duration:8e3});return}so(),l(""),Ce.reason==="external_console_attached"?U.info(e("pages.settings.tokenClearedExternalAttached")):Ce.restartRequested?U.success(e("pages.settings.tokenClearedRestarting")):U.success(e("pages.settings.tokenCleared")),Ce.nextAction&&U.info(Ce.nextAction,{duration:8e3})}catch{U.error(e("pages.settings.tokenClearFailed"))}},[e]),Ee=(0,mt.useCallback)(async()=>{let ne=C.trim(),Ce=I.trim();if(ne.length===0||Ce.length===0)return;let ot=await D1(ne,Ce);if(!ot.success){U.error(ot.error??"Failed to add workspace");return}let be=BT(ot.data);if(be===null){U.success(e("pages.settings.workspaceAdded")),await F();return}y(dt=>[...dt,be]),A(""),k(""),U.success(e("pages.settings.workspaceAdded"))},[C,I,e,F]),G=(0,mt.useCallback)(async ne=>{let Ce=await L1(ne);if(!Ce.success){U.error(Ce.error??"Failed to remove workspace"),R(null);return}y(ot=>ot.filter(be=>be.name!==ne)),R(null),U.success(e("pages.settings.workspaceRemoved"))},[e]),ae=(0,mt.useCallback)(async ne=>{let Ce=await N1(ne);if(!Ce.success){U.error(Ce.error??"Failed to sync workspace");return}await F(),U.success(e("pages.settings.syncWorkspace"))},[F,e]),we=(0,mt.useCallback)(async ne=>{if(ne!=="zh-CN"&&ne!=="en")return;let Ce=await sL(ne);if(!Ce.success){U.error(Ce.error??e("pages.settings.languageLoadError"));return}Ce.data&&(Ce.data.outputLanguage==="zh-CN"||Ce.data.outputLanguage==="en")&&_(Ce.data.outputLanguage),U.success(e("pages.settings.languageSaved"))},[e]),ze=(0,mt.useCallback)(async()=>{if(M===null)return;let ne=!M,Ce=await Lu("new_user_onboarding",ne);if(!Ce.success||!Ce.data){U.error(e("components.onboardingFlag.toggleFailed"));return}H(Ce.data.enabled),U.success(e(ne?"components.onboardingFlag.enabled":"components.onboardingFlag.disabled"))},[M,e]),ke=(0,mt.useCallback)(async()=>{if(Y===null)return;let ne=!Y,Ce=await Lu("prompt_full_pipeline",ne);if(!Ce.success||!Ce.data){U.error(e("components.fullPipelineFlag.toggleFailed"));return}oe(Ce.data.enabled),U.success(e(ne?"components.fullPipelineFlag.enabled":"components.fullPipelineFlag.disabled"))},[Y,e]),tt=x[0]?.name??"default",Ct=(0,mt.useCallback)(()=>{if(window.confirm(e("components.onboardingReset.resetConfirm"))){if(!PT(tt)){U.error(e("components.onboardingReset.resetFailed"));return}U.success(e("components.onboardingReset.resetSuccess"))}},[tt,e]);return n==="loading"?(0,$.jsx)(Me,{children:(0,$.jsx)(It,{cardCount:3,label:e("common.loading")})}):n==="error"?(0,$.jsxs)(Me,{children:[(0,$.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.settings.eyebrow")}),(0,$.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.settings.title")}),(0,$.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,$.jsx)("p",{children:e("pages.settings.loadError")}),i&&(0,$.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:i})]})]}):(0,$.jsx)(Me,{children:(0,$.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,$.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.settings.eyebrow")}),(0,$.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.settings.title")}),(0,$.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.settings.subtitle")}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-auth",children:[(0,$.jsx)(me,{id:"section-auth",children:e("pages.settings.auth")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("label",{htmlFor:"bearer-token-input",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.bearerToken")}),(0,$.jsx)("input",{id:"bearer-token-input",type:"password",value:s,onChange:ne=>l(ne.target.value),placeholder:e("pages.settings.enterAccessToken"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"}),(0,$.jsxs)("div",{className:"flex items-center justify-between mt-3 gap-3",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("button",{onClick:re,disabled:s.trim().length===0,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.save")}),c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("button",{onClick:qe,className:"border border-amber bg-amber text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:opacity-90 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.clearTokenConfirm")}),(0,$.jsx)("button",{onClick:()=>u(!1),className:"border border-line text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-gov transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.cancel")})]}):(0,$.jsx)("button",{onClick:()=>u(!0),className:"border border-line text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:border-gov hover:text-ink transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.clearToken")})]}),(0,$.jsx)("span",{className:"text-ink-4 text-[12px]",children:Dw()===void 0?e("pages.settings.tokenSessionOnly"):e("pages.settings.tokenDesktopStored")})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-owner-identity",children:[(0,$.jsx)(me,{id:"section-owner-identity",children:e("pages.settings.ownerIdentity.title")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.settings.ownerIdentity.intro")}),d===null?(0,$.jsx)("div",{className:"text-ink-4 text-[12px]",children:e("pages.settings.ownerIdentity.loading")}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 text-[13px] mb-2","data-testid":"owner-identity-status",children:[(0,$.jsx)("span",{className:`inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${d.resolved.source==="none"?"bg-amber text-ink":d.resolved.source==="invalid_env"?"bg-danger text-paper":"bg-green text-ink"}`,role:"status",children:d.resolved.source==="none"?e("pages.settings.ownerIdentity.statusMissing"):d.resolved.source==="invalid_env"?e("pages.settings.ownerIdentity.statusInvalid"):e("pages.settings.ownerIdentity.statusConfigured")}),(0,$.jsxs)("span",{className:"text-ink-3 text-[12px]",children:[d.resolved.source==="env"&&e("pages.settings.ownerIdentity.sourceEnv"),d.resolved.source==="file"&&e("pages.settings.ownerIdentity.sourceFile"),d.resolved.source==="invalid_env"&&e("pages.settings.ownerIdentity.sourceInvalid"),d.resolved.source==="none"&&e("pages.settings.ownerIdentity.sourceNone")]})]}),(0,$.jsxs)("div",{className:"flex items-center gap-2 text-[13px] mb-2","data-testid":"owner-governance-readiness","data-ready":d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?"true":"false",children:[(0,$.jsx)("span",{className:`inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?"bg-green text-ink":"bg-amber text-ink"}`,role:"status",children:d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="authenticated"?e("pages.settings.ownerIdentity.governanceReady"):e("pages.settings.ownerIdentity.governanceNotReady")}),(d.governance.ownerIdentityConfiguration!=="configured"||d.governance.authenticationMode!=="authenticated")&&(0,$.jsx)("span",{className:"text-ink-3 text-[12px]",children:d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="no_auth"?e("pages.settings.ownerIdentity.governanceReasonTokenAuth"):e("pages.settings.ownerIdentity.governanceReasonIdentity")})]}),d.governance.ownerIdentityConfiguration==="configured"&&d.governance.authenticationMode==="no_auth"&&(0,$.jsx)("div",{className:"text-ink-4 text-[12px] mb-3","data-testid":"owner-governance-next-action",children:e("pages.settings.ownerIdentity.governanceNextActionTokenAuth")}),d.resolved.error!==void 0&&(0,$.jsx)("div",{className:"text-danger text-[12px] mb-3","data-testid":"owner-identity-error",children:d.resolved.error}),d.resolved.source==="invalid_env"&&(0,$.jsx)("div",{className:"text-ink-4 text-[12px] mb-3","data-testid":"owner-identity-invalid-env-hint",children:e("pages.settings.ownerIdentity.invalidEnvHint")}),d.resolved.source==="file"&&d.fileRecord!==null&&(0,$.jsxs)("div",{className:"text-ink-4 text-[12px] mb-3 font-mono",children:[e("pages.settings.ownerIdentity.ownerIdLabel"),": ",d.fileRecord.ownerId," \xB7"," ",e("pages.settings.ownerIdentity.registeredAt")," ",d.fileRecord.registeredAt.slice(0,10)]}),d.fileError!==void 0&&(0,$.jsx)("div",{className:"text-danger text-[12px] mb-3","data-testid":"owner-identity-file-error",children:d.fileError}),d.resolved.source==="env"?(0,$.jsx)("div",{className:"text-ink-4 text-[12px]",children:e("pages.settings.ownerIdentity.envHint")}):(0,$.jsxs)("div",{className:"mt-3",children:[(0,$.jsx)("label",{htmlFor:"owner-id-input",className:"block text-sm font-medium text-ink mb-1",children:e("pages.settings.ownerIdentity.ownerIdLabel")}),(0,$.jsx)("input",{id:"owner-id-input",type:"text",value:m,onChange:ne=>p(ne.target.value),disabled:g,placeholder:"owner-alice",className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov disabled:opacity-50"}),(0,$.jsx)("label",{htmlFor:"credential-id-input",className:"block text-sm font-medium text-ink mt-3 mb-1",children:e("pages.settings.ownerIdentity.credentialIdLabel")}),(0,$.jsx)("input",{id:"credential-id-input",type:"text",value:b,onChange:ne=>v(ne.target.value),disabled:g,placeholder:"cred-...",className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov disabled:opacity-50"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[(0,$.jsx)("button",{type:"button",onClick:z,disabled:g,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.ownerIdentity.register")}),d.resolved.source==="file"&&(0,$.jsx)("button",{type:"button",onClick:L,disabled:g,className:"border border-line text-ink-3 rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-surface transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:e("pages.settings.ownerIdentity.unregister")})]})]})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-principle-language",children:[(0,$.jsx)(me,{id:"section-principle-language",children:e("pages.settings.principleLanguage")}),(0,$.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.settings.principleLanguageDescription")}),(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsxs)("label",{htmlFor:"output-language-select",className:"text-sm font-medium text-ink",children:[e("pages.settings.principleLanguage"),":"]}),(0,$.jsxs)("select",{id:"output-language-select",value:T,onChange:ne=>we(ne.target.value),className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov",children:[(0,$.jsx)("option",{value:"zh-CN",children:e("pages.settings.languageZhCN")}),(0,$.jsx)("option",{value:"en",children:e("pages.settings.languageEn")})]})]})]})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-sound-alerts",children:[(0,$.jsx)(me,{id:"section-sound-alerts",children:e("pages.settings.notifications")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{htmlFor:"sound-alerts-toggle",className:"block text-sm font-medium text-ink",children:e("pages.settings.soundAlerts")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("pages.settings.soundAlertsDescription")})]}),(0,$.jsx)("button",{id:"sound-alerts-toggle",type:"button",role:"switch","aria-checked":t,onClick:()=>a(!t),className:xe("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",t?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",t?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-workspaces",children:[(0,$.jsx)(me,{id:"section-workspaces",children:e("pages.settings.workspace")}),x.length>0?(0,$.jsx)("div",{className:"space-y-[10px] mb-5",children:x.map(ne=>(0,$.jsx)("article",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,$.jsx)("div",{className:"font-medium text-ink text-sm",children:ne.name}),(0,$.jsx)("div",{className:"text-ink-3 text-[13px] mt-1 font-mono break-all",children:ne.path}),(0,$.jsxs)("div",{className:"text-ink-4 text-[12px] mt-1",children:[e("pages.settings.lastSync"),":"," ",ne.lastSync??"\u2014"]})]}),(0,$.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:q?.workspaceName===ne.name?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{className:"text-ink-2 text-[12px]",children:e("pages.settings.confirmDeleteDescription",{name:ne.name})}),(0,$.jsx)("button",{onClick:()=>G(ne.name),className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.confirm")}),(0,$.jsx)("button",{onClick:()=>R(null),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.cancel")})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("button",{onClick:()=>ae(ne.name),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.syncWorkspace")}),(0,$.jsx)("button",{onClick:()=>R({workspaceName:ne.name}),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.removeWorkspace")})]})})]})},ne.name))}):(0,$.jsx)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3 mb-5",children:"\u2014"}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-end gap-3",children:[(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsx)("label",{htmlFor:"add-workspace-name",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.name")}),(0,$.jsx)("input",{id:"add-workspace-name",type:"text",value:C,onChange:ne=>A(ne.target.value),placeholder:e("pages.settings.addNamePlaceholder"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsx)("label",{htmlFor:"add-workspace-path",className:"block text-sm font-medium text-ink mb-2",children:e("pages.settings.path")}),(0,$.jsx)("input",{id:"add-workspace-path",type:"text",value:I,onChange:ne=>k(ne.target.value),placeholder:e("pages.settings.addPathPlaceholder"),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,$.jsx)("button",{onClick:Ee,disabled:C.trim().length===0||I.trim().length===0,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("pages.settings.addWorkspace")})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-onboarding-flag",children:[(0,$.jsx)(me,{id:"section-onboarding-flag",children:e("components.onboardingFlag.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0",children:[(0,$.jsx)("label",{htmlFor:"onboarding-flag-toggle",className:"block text-sm font-medium text-ink",children:e("components.onboardingFlag.label")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("components.onboardingFlag.description")})]}),(0,$.jsx)("button",{id:"onboarding-flag-toggle",type:"button",role:"switch","aria-checked":M??!1,"aria-label":e("components.onboardingFlag.toggleAriaLabel"),onClick:ze,disabled:M===null,className:xe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",M?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",M?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{className:"mb-8","aria-labelledby":"section-full-pipeline-flag",children:[(0,$.jsx)(me,{id:"section-full-pipeline-flag",children:e("components.fullPipelineFlag.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsxs)("div",{className:"min-w-0",children:[(0,$.jsx)("label",{htmlFor:"full-pipeline-flag-toggle",className:"block text-sm font-medium text-ink",children:e("components.fullPipelineFlag.label")}),(0,$.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mt-1",children:e("components.fullPipelineFlag.description")})]}),(0,$.jsx)("button",{id:"full-pipeline-flag-toggle",type:"button",role:"switch","aria-checked":Y??!1,"aria-label":e("components.fullPipelineFlag.toggleAriaLabel"),onClick:ke,disabled:Y===null,className:xe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",Y?"bg-gov":"bg-line"),children:(0,$.jsx)("span",{className:xe("inline-block h-4 w-4 transform rounded-full bg-paper transition-transform",Y?"translate-x-6":"translate-x-1")})})]})})]}),(0,$.jsxs)("section",{"aria-labelledby":"section-onboarding-reset",children:[(0,$.jsx)(me,{id:"section-onboarding-reset",children:e("components.onboardingReset.title")}),(0,$.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:(0,$.jsx)("button",{onClick:Ct,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("components.onboardingReset.resetButton")})})]})]})})}var _a=D(ee(),1);var gl=D(ee(),1);var ri=D(ee(),1);var ii=D(W(),1),Kq=Object.defineProperty,bo=(e,t)=>Kq(e,"name",{value:t,configurable:!0}),Yq="AlertDialog",[Xq,Ete]=Tu(Yq,[Wy]),vo=Wy(),FT=bo(e=>{let{__scopeAlertDialog:t,...a}=e,n=vo(t);return(0,ii.jsx)(jc,{...n,...a,modal:!0})},"AlertDialog"),Zq=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(Hu,{...i,...r,ref:a})},"AlertDialogTrigger")),UT=bo(e=>{let{__scopeAlertDialog:t,...a}=e,n=vo(t);return(0,ii.jsx)(Hc,{...n,...a})},"AlertDialogPortal"),Lw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(fs,{...i,...r,ref:a})},"AlertDialogOverlay")),Qq="AlertDialogContent",[Jq,eV]=Xq(Qq),Nw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,children:r,...i}=t,o=vo(n),s=ri.useRef(null),l=qa(a,s),c=ri.useRef(null);return(0,ii.jsx)(Jq,{scope:n,cancelRef:c,children:(0,ii.jsx)(ps,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:rr(i.onOpenAutoFocus,u=>{u.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:r})})},"AlertDialogContent")),Ew=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(ms,{...i,...r,ref:a})},"AlertDialogTitle")),Ow=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(gs,{...i,...r,ref:a})},"AlertDialogDescription")),Tw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,i=vo(n);return(0,ii.jsx)(ll,{...i,...r,ref:a})},"AlertDialogAction")),tV="AlertDialogCancel",Pw=ri.forwardRef(bo(function(t,a){let{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=eV(tV,n),o=vo(n),s=qa(a,i);return(0,ii.jsx)(ll,{...o,...r,ref:s})},"AlertDialogCancel"));var Br=D(W(),1),Tg=FT;var nV=UT,jT=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Lw,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));jT.displayName=Lw.displayName;var Qu=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsxs)(nV,{children:[(0,Br.jsx)(jT,{}),(0,Br.jsx)(Nw,{ref:a,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Qu.displayName=Nw.displayName;var Ju=({className:e,...t})=>(0,Br.jsx)("div",{className:xe("flex flex-col gap-2 text-center sm:text-left",e),...t});Ju.displayName="AlertDialogHeader";var ef=({className:e,...t})=>(0,Br.jsx)("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ef.displayName="AlertDialogFooter";var tf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Ew,{ref:a,className:xe("text-lg font-semibold",e),...t}));tf.displayName=Ew.displayName;var af=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Ow,{ref:a,className:xe("text-sm text-muted-foreground",e),...t}));af.displayName=Ow.displayName;var nf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Tw,{ref:a,className:xe(vg(),e),...t}));nf.displayName=Tw.displayName;var rf=gl.forwardRef(({className:e,...t},a)=>(0,Br.jsx)(Pw,{ref:a,className:xe(vg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));rf.displayName=Pw.displayName;var te=D(W(),1);function HT(){let{t:e,i18n:t}=X(),[a,n]=(0,_a.useState)(null),[r,i]=(0,_a.useState)(null),[o,s]=(0,_a.useState)("loading"),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(null),[f,m]=(0,_a.useState)(null),[p,b]=(0,_a.useState)(null),[v,g]=(0,_a.useState)(!1),[h,x]=(0,_a.useState)(!1),[y,C]=(0,_a.useState)(null),[A,I]=(0,_a.useState)(null),k=(0,_a.useCallback)(async()=>{s("loading"),d(null),m(null);let[q,R,F]=await Promise.all([Gx(),xL(),wL()]);if(!q.success){s("error"),d(q.error);return}let se=Cu(q.data);if(se===null){s("error"),d("Update status data has unexpected shape");return}if(n(se),!R.success)i(null),m(R.error??"Update history unavailable");else{let ve=_m(R.data);i(ve),ve===null&&m("Update history data has unexpected shape")}F.success?C(Mm(F.data)):C(null),s("loaded")},[]);(0,_a.useEffect)(()=>{k()},[k]);let T=(0,_a.useCallback)(async()=>{c(!0);let q=await Gx();if(!q.success){U.error(e("pages.update.checkFailed")),c(!1);return}let R=Cu(q.data);if(R===null){U.error(e("pages.update.checkFailed")),c(!1);return}n(R),c(!1)},[e]),_=(0,_a.useCallback)(async()=>{g(!1),x(!0),b(null);let q=await yL();if(x(!1),!q.success){b({success:!1,message:q.error??"Unknown error"}),U.error(e("pages.update.updateFailed",{message:q.error??"Unknown error"}));return}let R=q.data;if(R.state==="update_in_progress"&&R.transactionId){I({transactionId:R.transactionId,phase:null}),U.info(e("pages.update.inProgressToast"));return}R.success?(b({success:!0,message:R.message,newVersion:R.newVersion,fromVersion:a?.currentVersion,requiresRestart:R.requiresRestart,gatewayNotice:R.gatewayNotice}),U.success(e("pages.update.fullUpdateSuccess")),await k()):(b({success:!1,refusal:R.refusal,message:R.message,reason:R.reason,nextAction:R.nextAction,gatewayNotice:R.gatewayNotice}),U.error(e("pages.update.updateFailed",{message:R.message})))},[e,k,a?.currentVersion]);if((0,_a.useEffect)(()=>{if(!A)return;let q=!1,R=0,F=async()=>{if(q)return;R+=1;let ve=await kL(A.transactionId);if(q)return;let z=ve.success?Fm(ve.data):null;if(z===null||!z.exists){R>=200&&(I(null),b({success:!1,message:e("pages.update.inProgressTimeout"),reason:"transaction_unresolved"}));return}I({transactionId:A.transactionId,phase:z.lastState}),z.terminal&&(I(null),z.lastState==="confirmed"?(b({success:!0,message:e("pages.update.inProgressConfirmed",{version:z.productVersion??""}),requiresRestart:!0}),U.success(e("pages.update.fullUpdateSuccess"))):b({success:!1,message:e("pages.update.inProgressEnded",{state:z.lastState??""})}),await k())},se=setInterval(F,3e3);return F(),()=>{q=!0,clearInterval(se)}},[A?.transactionId,e,k]),o==="loading")return(0,te.jsx)(Me,{children:(0,te.jsx)(It,{cardCount:2,label:e("common.loading")})});if(o==="error")return(0,te.jsxs)(Me,{children:[(0,te.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.update.eyebrow")}),(0,te.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.update.title")}),(0,te.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,te.jsx)("p",{children:e("pages.update.loadError")}),u&&(0,te.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:u})]})]});let M=a?.state??(a?a.error?"check_failed":a.hasUpdate?"update_available":"up_to_date":"up_to_date"),H=M==="up_to_date",oe=M==="update_blocked"||M==="check_failed"?(q=>q?e(`pages.update.reason.${q}`,{defaultValue:q}):void 0)(a?.reason):void 0;return(0,te.jsxs)(Me,{children:[(0,te.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[y?.needsRecovery&&y.unfinished.length>0&&(0,te.jsxs)("div",{className:"mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2",role:"alert",children:[(0,te.jsx)("p",{className:"font-medium text-amber",children:e("pages.update.recoveryBanner")}),y.unfinished.slice(0,3).map(q=>(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.recoveryItem",{id:q.transactionId,phase:q.lastState??"\u2014"})},q.transactionId)),y.nextAction&&(0,te.jsx)("p",{className:"mt-2 text-[12px] text-ink-3",children:y.nextAction})]}),y?.needsRecovery&&y.recoveryRequired.length>0&&(0,te.jsxs)("div",{className:"mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2",role:"alert",children:[(0,te.jsx)("p",{className:"font-medium text-amber",children:e("pages.update.recoveryRequiredBanner")}),y.recoveryRequired.slice(0,3).map(q=>(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.recoveryRequiredItem",{id:q.transactionId})},q.transactionId)),y.nextAction&&(0,te.jsx)("p",{className:"mt-2 text-[12px] text-ink-3",children:y.nextAction})]}),(0,te.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.update.eyebrow")}),(0,te.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.update.title")}),(0,te.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.update.subtitle")}),(0,te.jsxs)("section",{className:"mb-8","aria-labelledby":"section-update-status",children:[(0,te.jsx)(me,{id:"section-update-status",children:e("pages.update.currentVersion")}),(0,te.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,te.jsxs)("div",{className:"space-y-4",children:[(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:e("pages.update.currentVersion")}),(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink",children:a?.currentVersion??"\u2014"})]}),(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:e("pages.update.latestVersion")}),(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink",children:M==="check_failed"?"\u2014":a?.latestVersion||"\u2014"}),M==="check_failed"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.checkFailed")}),M==="update_blocked"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.blockedBadge")}),M==="up_to_date"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-green/35 text-green rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.upToDate")}),M==="update_available"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.updateAvailable")})]})]})]}),(M==="update_blocked"||M==="check_failed")&&(0,te.jsxs)("div",{className:"mt-4 pt-3 border-t border-line text-[12px] leading-relaxed",children:[oe&&(0,te.jsxs)("p",{className:"text-ink-2",children:[e("pages.update.reasonLabel"),oe]}),a?.message&&M==="update_blocked"&&(0,te.jsx)("p",{className:"mt-1 text-ink-3",children:a.message}),a?.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-ink-3 font-mono",children:a.nextAction})]}),a?.error&&(0,te.jsxs)("div",{className:"mt-4 pt-3 border-t border-line text-[12px] text-ink-4 font-mono",children:[e("pages.update.checkError"),": ",a.error]}),A&&(0,te.jsxs)("div",{className:"mt-4 p-4 rounded-[6px] border border-gov/30 bg-surface text-[13px] leading-relaxed",role:"status",children:[(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)(pa,{className:"h-4 w-4 animate-spin text-gov"}),(0,te.jsx)("span",{className:"font-medium text-ink",children:e("pages.update.inProgressPanel")})]}),(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-3",children:e("pages.update.inProgressPhase",{phase:A.phase??"\u2026"})}),(0,te.jsx)("p",{className:"mt-1 font-mono text-[12px] text-ink-4",children:A.transactionId})]}),(0,te.jsxs)("div",{className:"mt-5 pt-4 border-t border-line flex items-center gap-3 flex-wrap",children:[(0,te.jsx)("button",{type:"button",onClick:T,disabled:l||h||A!==null,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e(l?"pages.update.checking":"pages.update.checkForUpdates")}),!H&&M==="update_available"&&(0,te.jsx)("button",{type:"button",onClick:()=>g(!0),disabled:l||h||A!==null,className:"bg-gov text-white rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-gov/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:h?(0,te.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,te.jsx)(pa,{className:"h-3.5 w-3.5 animate-spin"}),e("pages.update.updating")]}):e("pages.update.applyUpdate")})]}),p&&(0,te.jsx)("div",{className:`mt-4 p-4 rounded-[6px] border animate-[pdFadeIn_400ms_ease-out] ${p.success?"bg-green/5 border-green/20":p.refusal?"bg-amber/5 border-amber/25":"bg-danger/5 border-danger/20"}`,children:(0,te.jsxs)("div",{className:"flex items-start gap-3",children:[p.success?(0,te.jsx)(as,{className:"h-6 w-6 text-green shrink-0 mt-0.5 animate-[pdFadeIn_600ms_ease-out]",style:{transform:"scale(1)",animationFillMode:"both"}}):p.refusal?(0,te.jsx)(Ar,{className:"h-6 w-6 text-amber shrink-0 mt-0.5"}):(0,te.jsx)(ns,{className:"h-6 w-6 text-danger shrink-0 mt-0.5"}),(0,te.jsxs)("div",{className:"flex-1 min-w-0",children:[p.refusal&&(0,te.jsx)("p",{className:"text-[12px] font-mono uppercase text-amber mb-1",children:e("pages.update.blockedBadge")}),p.success&&p.fromVersion&&p.newVersion&&(0,te.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,te.jsx)("span",{className:"font-mono text-[13px] text-ink-3 line-through",children:p.fromVersion}),(0,te.jsx)($r,{className:"h-3.5 w-3.5 text-green"}),(0,te.jsx)("span",{className:"font-mono text-[13px] text-green font-medium",children:p.newVersion})]}),(0,te.jsx)("p",{className:`text-[13px] ${p.success?"text-green":p.refusal?"text-ink-2":"text-danger"}`,children:p.message}),p.success&&p.requiresRestart&&(0,te.jsx)("p",{className:"mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed",children:e("pages.update.fullUpdateRestartPrompt")}),p.gatewayNotice&&(0,te.jsx)("p",{className:"mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed font-mono",children:p.gatewayNotice}),!p.success&&p.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-[12px] text-ink-4 font-mono leading-relaxed",children:p.nextAction}),!p.success&&(0,te.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[/network|fetch|timeout|ECONNREFUSED|ENOTFOUND/i.test(p.message)&&(0,te.jsx)("p",{className:"text-[12px] text-ink-4 font-mono",children:e("pages.update.networkErrorHint")}),(0,te.jsx)("button",{type:"button",onClick:()=>g(!0),disabled:h,className:"text-[12px] text-danger underline hover:text-danger/80 disabled:opacity-50",children:e("pages.update.retry")})]})]})]})})]})]}),(0,te.jsxs)("section",{"aria-labelledby":"section-update-history",children:[(0,te.jsx)(me,{id:"section-update-history",children:e("pages.update.history")}),f?(0,te.jsxs)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3",children:[e("pages.update.loadError")," (",f,")"]}):r&&r.updates.length>0?(0,te.jsx)("div",{className:"space-y-[10px]",children:r.updates.map(q=>(0,te.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] px-5 py-4",children:[(0,te.jsxs)("div",{className:"flex items-center justify-between",children:[(0,te.jsxs)("div",{className:"flex items-center gap-2",children:[(0,te.jsx)("span",{className:"inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase",children:e("pages.update.version")}),(0,te.jsxs)("span",{className:"font-mono text-[13px] text-ink",children:[q.fromVersion," \u2192 ",q.toVersion==="failed"?"\u2014":q.toVersion]}),q.kind!=="failure"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase",children:e(`pages.update.historyKind.${q.kind}`)}),!q.success&&q.kind!=="refusal"&&(0,te.jsx)("span",{className:"inline-flex items-center border border-danger/35 text-danger rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase",children:e("pages.update.failed")})]}),(0,te.jsx)("div",{className:"flex items-center gap-3",children:(0,te.jsx)("span",{className:"text-ink-3 text-[13px]",children:ba(q.timestamp,t.language,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})})]}),(q.reason||q.nextAction)&&(0,te.jsxs)("div",{className:"mt-3 border-t border-line pt-3 text-[12px] leading-relaxed text-ink-3",children:[q.reason&&(0,te.jsx)("p",{children:q.reason}),q.nextAction&&(0,te.jsx)("p",{className:"mt-1 text-ink-2",children:q.nextAction})]})]},q.id))}):(0,te.jsx)("div",{className:"text-ink-3 text-[13px] leading-relaxed py-3",children:e("pages.update.noHistory")})]})]}),(0,te.jsx)(Tg,{open:v,onOpenChange:g,children:(0,te.jsxs)(Qu,{children:[(0,te.jsxs)(Ju,{children:[(0,te.jsx)(tf,{children:e("pages.update.confirmFullUpdateTitle")}),(0,te.jsx)(af,{children:e("pages.update.confirmFullUpdateDesc")})]}),(0,te.jsxs)(ef,{children:[(0,te.jsx)(rf,{children:e("common.cancel")}),(0,te.jsx)(nf,{onClick:_,children:e("pages.update.applyFullUpdate")})]})]})})]})}var gt=D(ee(),1);var of=D(ee(),1);var ur=D(W(),1),zT=jc;var rV=Hc;var qT=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(fs,{ref:a,className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qT.displayName=fs.displayName;var _w=of.forwardRef(({className:e,children:t,...a},n)=>(0,ur.jsxs)(rV,{children:[(0,ur.jsx)(qT,{}),(0,ur.jsxs)(ps,{ref:n,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,ur.jsxs)(ll,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,ur.jsx)(tl,{className:"h-4 w-4"}),(0,ur.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));_w.displayName=ps.displayName;var Bw=({className:e,...t})=>(0,ur.jsx)("div",{className:xe("flex flex-col gap-1.5 text-center sm:text-left",e),...t});Bw.displayName="DialogHeader";var Mw=({className:e,...t})=>(0,ur.jsx)("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Mw.displayName="DialogFooter";var Fw=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(ms,{ref:a,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));Fw.displayName=ms.displayName;var Uw=of.forwardRef(({className:e,...t},a)=>(0,ur.jsx)(gs,{ref:a,className:xe("text-sm text-muted-foreground",e),...t}));Uw.displayName=gs.displayName;var iV=["always","often","sometimes","once"],oV=["blocked","workaround","minor"],sV=["ingest","github","email","file"];function lV(e){return typeof e=="string"&&iV.includes(e)}function cV(e){return typeof e=="string"&&oV.includes(e)}function dV(e){return typeof e=="string"&&sV.includes(e)}function zw(e){if(!e)return;let t=`${e.page??""} ${e.sourceDetail??""}`.toLowerCase(),a=[["failed_tasks","failed_tasks"],["pain","pain"],["principle","principles"],["activation","activation"],["focus","focus"],["intent","intent"],["error","error"]];for(let[n,r]of a)if(t.includes(n))return r}function _t(e){return typeof e=="string"}function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jw(e){return Array.isArray(e)&&e.every(_t)}function hl(e){return fr(e)?e:{}}function qw(e){if(!fr(e)||!_t(e.id)||!_t(e.createdAt)||!_t(e.title)||e.type!=="bug"&&e.type!=="confusing"&&e.type!=="privacy_concern"&&e.type!=="feature_request"&&e.type!=="other")return null;let t=hl(e.userText);if(!_t(t.description))return null;let a=hl(e.outputs);if(!_t(a.markdown)||!_t(a.emailText)||!_t(a.githubIssueUrl))return null;let n=hl(e.privacy);if(!jw(n.includedSections)||!jw(n.excludedByDefault)||!jw(n.redactionNotes))return null;let r=hl(e.diagnosticSummary),i=r.canary,o=fr(i)?i:null,s=null;o&&typeof o.status=="string"&&(o.status==="available"||o.status==="unavailable")&&(s=o.status);let l=s?{status:s,summary:typeof o?.summary=="string"?o.summary:void 0,unavailableReason:typeof o?.unavailableReason=="string"?o.unavailableReason:void 0}:null;return{id:e.id,createdAt:e.createdAt,type:e.type,title:e.title,userText:{description:t.description,stepsToReproduce:_t(t.stepsToReproduce)?t.stepsToReproduce:void 0,expectedBehavior:_t(t.expectedBehavior)?t.expectedBehavior:void 0,actualBehavior:_t(t.actualBehavior)?t.actualBehavior:void 0,userSeverity:t.userSeverity==="low"||t.userSeverity==="medium"||t.userSeverity==="high"?t.userSeverity:void 0,goal:_t(t.goal)?t.goal:void 0,stuckAt:_t(t.stuckAt)?t.stuckAt:void 0,job:_t(t.job)?t.job:void 0,currentWorkaround:_t(t.currentWorkaround)?t.currentWorkaround:void 0,sawWhat:_t(t.sawWhat)?t.sawWhat:void 0,whereSeen:_t(t.whereSeen)?t.whereSeen:void 0,frequency:lV(t.frequency)?t.frequency:void 0,blockingLevel:cV(t.blockingLevel)?t.blockingLevel:void 0},diagnosticSummary:{versions:hl(r.versions),platform:hl(r.platform),featureFlags:hl(r.featureFlags),canary:l??{status:"unavailable",unavailableReason:"diagnostic summary unavailable"},recentEvents:Array.isArray(r.recentEvents)?r.recentEvents:[]},privacy:{includedSections:n.includedSections,excludedByDefault:n.excludedByDefault,redactionNotes:n.redactionNotes},outputs:{markdown:a.markdown,emailText:a.emailText,githubIssueUrl:a.githubIssueUrl,mailtoUrl:_t(a.mailtoUrl)?a.mailtoUrl:""},area:_t(e.area)?e.area:void 0,status:e.status==="draft"||e.status==="submitted"?e.status:void 0,submittedAt:_t(e.submittedAt)?e.submittedAt:void 0,submittedVia:dV(e.submittedVia)?e.submittedVia:void 0,trackingId:_t(e.trackingId)?e.trackingId:void 0,externalUrl:_t(e.externalUrl)?e.externalUrl:void 0}}function GT(e){return!fr(e)||!_t(e.id)||!_t(e.createdAt)||!_t(e.type)||!_t(e.title)?null:{id:e.id,createdAt:e.createdAt,type:e.type,title:e.title,status:_t(e.status)?e.status:void 0}}function Pg(e){return fr(e)?qw(e.report):null}function _g(e,t){return fr(e)&&e.success===!1&&_t(e.error)?e.error:t}var uV=["console","cli","agent"],fV=["painId","principleId","approvalId","activationId","taskId","page"];function Vw(e){let t={};for(let n of fV){let r=e.get(n);r&&(t[n]=r)}let a=e.get("source");return a&&(uV.includes(a)?t.source=a:(t.source="console",t.sourceDetail=a)),Object.keys(t).length>0?t:void 0}var pV="/api/v1/config/summary",mV="/api/v1/lifecycle/state",gV="/api/health";function Hw(e,t){if(e.status==="rejected"){let{reason:a}=e,n=a instanceof Error?a.message:String(a);return`${t} fetch failed: ${n}`}return e.value.success?"":`${t} fetch failed: ${e.value.error}`}function oi(e){return typeof e=="string"?e:void 0}function hV(e){if(!fr(e)||!Array.isArray(e.recentEvents))return[];let t=[];for(let a of e.recentEvents){if(!fr(a))continue;let n=oi(a.type),r=oi(a.at),i=oi(a.summary);if(!n||!r||!i)continue;let o={type:n,at:r,summary:i},s=oi(a.severity);s&&(o.severity=s),t.push(o)}return t.slice(-5)}function VT(e){if(!e||!Array.isArray(e.checks))return[];let t=[];for(let a of e.checks){if(!fr(a))continue;let n=oi(a.id)??oi(a.name),r=oi(a.lastCheck),i=oi(a.message);if(!n||!r||!i)continue;let o={type:n,at:r,summary:i},s=oi(a.status);s==="error"?o.severity="error":s==="warning"&&(o.severity="warn"),t.push(o)}return t.slice(-5)}function $T(e,t,a){let n=Hw(a,gV),r=a.status==="fulfilled"&&a.value.success?a.value.data:null,i=fr(r)?r:null,o,s;n?(o={unavailableReason:n},s={unavailableReason:n}):i&&fr(i.versions)?(o={...i.versions},s=fr(i.platform)?{...i.platform}:{unavailableReason:"platform not in health response"}):(o={unavailableReason:"versions not in health response"},s={unavailableReason:"platform not in health response"});let l=Hw(e,pV),c;if(l)c={unavailableReason:l};else if(e.status==="fulfilled"&&e.value.success){let{data:m}=e.value;fr(m)&&Object.hasOwn(m,"features")&&Array.isArray(m.features)?c={features:m.features,defaultRuntime:oi(m.defaultRuntime)??null}:c={unavailableReason:"features field not present in API response"}}else c={unavailableReason:"features field not present in API response"};let u;if(n)u={status:"unavailable",unavailableReason:n};else if(i&&(i.overall==="healthy"||i.overall==="degraded"||i.overall==="error")){let{overall:m}=i;m==="error"?u={status:"unavailable",unavailableReason:`system health: ${m}`}:u={status:"available",summary:`overall=${m}; generatedAt=${oi(i.generatedAt)??"unknown"}`}}else u={status:"unavailable",unavailableReason:"overall field not present in API response"};let d=Hw(t,mV),f;return d?f=VT(i):t.status==="fulfilled"&&t.value.success?f=hV(t.value.data):f=VT(i),{versions:o,platform:s,featureFlags:c,canary:u,recentEvents:f}}var j=D(W(),1),WT={type:"bug",title:"",description:"",stepsToReproduce:"",expectedBehavior:"",actualBehavior:"",frequency:void 0,blockingLevel:void 0,goal:"",stuckAt:"",job:"",currentWorkaround:"",sawWhat:"",whereSeen:"",submitting:!1},YT=["bug","confusing","privacy_concern","feature_request","other"],bV=new Set(YT),XT=["always","often","sometimes","once"],ZT=["blocked","workaround","minor"],vV=new Set(XT),xV=new Set(ZT),KT={bug:["stepsToReproduce","expectedBehavior","actualBehavior","frequency","blockingLevel"],confusing:["goal","stuckAt","blockingLevel"],feature_request:["job","currentWorkaround"],privacy_concern:["sawWhat","whereSeen"],other:[]},yV={stepsToReproduce:"pages.reportProblem.form.stepsLabel",expectedBehavior:"pages.reportProblem.form.expectedLabel",actualBehavior:"pages.reportProblem.form.actualLabel",goal:"pages.reportProblem.form.goalLabel",stuckAt:"pages.reportProblem.form.stuckAtLabel",job:"pages.reportProblem.form.jobLabel",currentWorkaround:"pages.reportProblem.form.currentWorkaroundLabel",sawWhat:"pages.reportProblem.form.sawWhatLabel",whereSeen:"pages.reportProblem.form.whereSeenLabel"},wV=["ingest","github","email","file"];function kV(e){let t=Vw(e),a=zw(t);return a==="failed_tasks"||a==="error"?"bug":"other"}function QT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function SV(e){if(!QT(e))return{ok:!1,reason:"Drafts list response is not an object"};if(!Object.hasOwn(e,"drafts"))return{ok:!1,reason:"Drafts list response missing 'drafts' field"};if(!Array.isArray(e.drafts))return{ok:!1,reason:"Drafts list 'drafts' field is not an array"};let t=[];for(let a of e.drafts){let n=GT(a);n!==null&&t.push(n)}return{ok:!0,drafts:t}}function Gw(){let{t:e}=X();return(0,j.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-gov/8 border border-gov/20 rounded-[6px] mb-6",children:[(0,j.jsx)("svg",{className:"shrink-0 w-4 h-4 text-gov",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,j.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),(0,j.jsx)("span",{className:"text-ink text-sm font-medium",children:e("pages.reportProblem.noAutoUpload")})]})}function CV({draft:e}){let{t}=X();return e===null?(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-privacy",children:[(0,j.jsx)(me,{id:"section-privacy",children:t("pages.reportProblem.privacy.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:t("pages.reportProblem.privacy.submitFirst")}),(0,j.jsx)(Gw,{})]}):(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-privacy",children:[(0,j.jsx)(me,{id:"section-privacy",children:t("pages.reportProblem.privacy.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:t("pages.reportProblem.privacy.description")}),(0,j.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-4 space-y-4",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.included")}),e.privacy.includedSections.length>0?(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.includedSections.map((a,n)=>(0,j.jsxs)("li",{className:"flex items-center gap-2 text-ink-2 text-[13px]",children:[(0,j.jsx)("span",{className:"text-green-600","aria-hidden":"true",children:"\u2713"}),a]},n))}):(0,j.jsx)("p",{className:"text-ink-4 text-[13px]",children:"\u2014"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.excluded")}),e.privacy.excludedByDefault.length>0?(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.excludedByDefault.map((a,n)=>(0,j.jsxs)("li",{className:"flex items-center gap-2 text-ink-2 text-[13px]",children:[(0,j.jsx)("span",{className:"text-red-500","aria-hidden":"true",children:"\u2717"}),a]},n))}):(0,j.jsx)("p",{className:"text-ink-4 text-[13px]",children:"\u2014"})]}),e.privacy.redactionNotes.length>0&&(0,j.jsxs)("div",{children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.reportProblem.privacy.notes")}),(0,j.jsx)("ul",{className:"space-y-1",children:e.privacy.redactionNotes.map((a,n)=>(0,j.jsxs)("li",{className:"text-ink-2 text-[13px]",children:["\u2022 ",a]},n))})]})]}),(0,j.jsx)(Gw,{})]})}function RV({draft:e}){let{t}=X(),a=e.status==="submitted";return(0,j.jsxs)("span",{className:a?"inline-flex items-center gap-1 px-2 py-[2px] rounded-[3px] text-[11px] font-medium border border-green-200 bg-green-50 text-green-700":"inline-flex items-center gap-1 px-2 py-[2px] rounded-[3px] text-[11px] font-medium border border-line bg-surface text-ink-3",children:[(0,j.jsx)("span",{className:a?"w-1.5 h-1.5 rounded-full bg-green-500":"w-1.5 h-1.5 rounded-full bg-ink-3","aria-hidden":"true"}),t(a?"pages.reportProblem.draft.sentBadge":"pages.reportProblem.draft.draftBadge")]})}function IV({draft:e,onCopyMarkdown:t,onCopyEmail:a,onOpenGithub:n,onOpenEmail:r,onDelete:i}){let{t:o}=X(),[s,l]=(0,gt.useState)(!1);return(0,j.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] p-4",children:[(0,j.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-2",children:[(0,j.jsx)("div",{className:"font-mono text-[11px] text-ink-3",children:o("pages.reportProblem.draft.savedAt",{id:e.id,at:e.createdAt})}),(0,j.jsx)(RV,{draft:e})]}),(0,j.jsx)("div",{className:"font-semibold text-ink mb-1",children:e.title}),(e.status==="submitted"||e.trackingId||e.submittedVia)&&(0,j.jsxs)("div",{className:"text-ink-3 text-[12px] mb-2 space-y-0.5",children:[e.submittedVia&&(0,j.jsxs)("div",{children:["via ",e.submittedVia,e.submittedAt?` \xB7 ${e.submittedAt}`:""]}),e.trackingId&&(0,j.jsxs)("div",{className:"font-mono",children:[o("pages.reportProblem.channel.receiptTrackingId"),": ",e.trackingId]}),e.externalUrl&&(0,j.jsx)("div",{children:(0,j.jsx)("a",{href:e.externalUrl,target:"_blank",rel:"noreferrer noopener",className:"text-gov underline hover:text-gov-2",children:o("pages.reportProblem.channel.openIssue")})})]}),(0,j.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,j.jsx)("button",{type:"button",onClick:t,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.copyMarkdown")}),(0,j.jsx)("button",{type:"button",onClick:a,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.copyEmail")}),e.outputs.githubIssueUrl&&(0,j.jsx)("button",{type:"button",onClick:n,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.openGithub")}),e.outputs.mailtoUrl&&(0,j.jsx)("button",{type:"button",onClick:r,className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.openEmail")}),s?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("button",{type:"button",onClick:i,className:"border border-red-400 bg-red-600 text-white rounded-[3px] px-[12px] py-[5px] text-[12px] hover:bg-red-700 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:[o("pages.reportProblem.draft.delete"),"?"]}),(0,j.jsx)("button",{type:"button",onClick:()=>l(!1),className:"border border-line bg-surface text-ink rounded-[3px] px-[12px] py-[5px] text-[12px] hover:border-line-2 transition-colors",children:"\xD7"})]}):(0,j.jsx)("button",{type:"button",onClick:()=>l(!0),className:"border border-red-200 text-red-600 rounded-[3px] px-[12px] py-[5px] text-[12px] hover:bg-red-50 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:o("pages.reportProblem.draft.delete")})]})]})}function AV({drafts:e,onLoad:t,onDelete:a}){let{t:n}=X();return(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-saved",children:[(0,j.jsx)(me,{id:"section-saved",children:n("pages.reportProblem.saved.title")}),e.length===0?(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed py-2",children:"\u2014"}):(0,j.jsx)("div",{className:"space-y-3",children:e.map(r=>(0,j.jsxs)("article",{className:"bg-panel border border-line rounded-[6px] px-4 py-3 flex items-center justify-between gap-4",children:[(0,j.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,j.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,j.jsxs)("div",{className:"font-mono text-[11px] text-ink-3",children:[va("feedbackType",r.type,n)," \xB7 ",r.createdAt]}),r.status==="submitted"&&(0,j.jsx)("span",{className:"inline-flex items-center gap-1 px-1.5 py-[1px] rounded-[2px] text-[10px] font-medium border border-green-200 bg-green-50 text-green-700",children:n("pages.reportProblem.draft.sentBadge")})]}),(0,j.jsx)("div",{className:"text-ink text-sm truncate",children:r.title})]}),(0,j.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,j.jsx)("button",{type:"button",onClick:()=>t(r.id),className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.reportProblem.saved.load")}),(0,j.jsx)("button",{type:"button",onClick:()=>a(r.id),className:"border border-red-200 text-red-600 rounded-[3px] px-[10px] py-[6px] text-[12px] hover:bg-red-50 transition-colors focus-visible:outline-2 focus-visible:outline-red-400 focus-visible:outline-offset-2",children:n("pages.reportProblem.draft.delete")})]})]},r.id))})]})}function DV({draft:e,channels:t,onSubmitIngest:a,onSubmitGithub:n,onOpenEmail:r,onExportFile:i,onMarkSent:o}){let{t:s}=X(),l=(0,gt.useMemo)(()=>{let d=new Map;for(let f of t??[])d.set(f.id,f);return d},[t]),c=e.status==="submitted",u=d=>{let f=l.get(d),m=f?.available??!1;if(d==="email")return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",disabled:!m,onClick:r,className:m?"w-full border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[8px] text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed":"w-full border border-line bg-surface text-ink-4 rounded-[3px] px-[14px] py-[8px] text-[13px] cursor-not-allowed",children:s("pages.reportProblem.channel.email")}),!m&&(f?.reason||f?.nextAction)&&(0,j.jsxs)("p",{className:"text-[11px] text-ink-3 leading-snug",children:[s("pages.reportProblem.channel.disablingReason",{reason:f?.reason??""}),f?.nextAction?` \xB7 ${f.nextAction}`:""]}),!c&&(0,j.jsx)("button",{type:"button",onClick:()=>o("email"),className:"text-[11px] text-ink-3 hover:text-gov underline underline-offset-2 text-left",children:s("pages.reportProblem.draft.markAsSent")})]},"email");if(d==="file")return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",onClick:i,className:"w-full border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[8px] text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:s("pages.reportProblem.channel.file")}),!c&&(0,j.jsx)("button",{type:"button",onClick:()=>o("file"),className:"text-[11px] text-ink-3 hover:text-gov underline underline-offset-2 text-left",children:s("pages.reportProblem.draft.markAsSent")})]},"file");let p=d==="ingest",b=s(p?"pages.reportProblem.channel.ingest":"pages.reportProblem.channel.github");return(0,j.jsxs)("div",{className:"space-y-1",children:[(0,j.jsx)("button",{type:"button",disabled:!m,onClick:p?a:n,className:m?"w-full border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[8px] text-[13px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2":"w-full border border-line bg-surface text-ink-4 rounded-[3px] px-[14px] py-[8px] text-[13px] cursor-not-allowed",children:b}),!m&&(f?.reason||f?.nextAction)&&(0,j.jsxs)("p",{className:"text-[11px] text-ink-3 leading-snug",children:[s("pages.reportProblem.channel.disablingReason",{reason:f?.reason??""}),f?.nextAction?` \xB7 ${f.nextAction}`:""]})]},d)};return(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-channel",children:[(0,j.jsx)(me,{id:"section-channel",children:s("pages.reportProblem.channel.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:s("pages.reportProblem.channel.description")}),(0,j.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:wV.map(u)})]})}function LV({draft:e,channel:t,open:a,busy:n,onConfirm:r,onCancel:i}){let{t:o}=X();return(0,j.jsx)(zT,{open:a,onOpenChange:s=>{!s&&!n&&i()},children:(0,j.jsxs)(_w,{className:"sm:max-w-xl max-h-[85vh] overflow-hidden flex flex-col",children:[(0,j.jsxs)(Bw,{children:[(0,j.jsx)(Fw,{children:o("pages.reportProblem.channel.confirmTitle")}),(0,j.jsx)(Uw,{children:o(t==="ingest"?"pages.reportProblem.channel.confirmDescription":"pages.reportProblem.channel.github")})]}),(0,j.jsxs)("div",{className:"flex-1 min-h-0 overflow-auto space-y-2",children:[(0,j.jsx)("div",{className:"font-mono text-[12px] text-ink-3",children:e.title}),(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3",children:o("pages.reportProblem.channel.confirmBodyLabel")}),(0,j.jsx)("pre",{className:"whitespace-pre-wrap text-ink-2 text-[13px] leading-relaxed bg-surface border border-line rounded-[3px] p-3 max-h-[320px] overflow-auto",children:e.outputs.markdown})]}),(0,j.jsxs)(Mw,{children:[(0,j.jsx)("button",{type:"button",onClick:i,disabled:n,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 disabled:opacity-50",children:o("pages.reportProblem.channel.confirmCancel")}),(0,j.jsx)("button",{type:"button",onClick:r,disabled:n,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 disabled:opacity-50 disabled:cursor-not-allowed",children:o(n?"pages.reportProblem.form.submitting":"pages.reportProblem.channel.confirmSubmit")})]})]})})}function JT(){let{t:e}=X(),[t]=Sn(),[a,n]=(0,gt.useState)(()=>({...WT,type:kV(t)})),[r,i]=(0,gt.useState)([]),[o,s]=(0,gt.useState)(null),[l,c]=(0,gt.useState)("loading"),[u,d]=(0,gt.useState)(null),[f,m]=(0,gt.useState)(!1),[p,b]=(0,gt.useState)(!1),[v,g]=(0,gt.useState)(null),[h,x]=(0,gt.useState)(null),[y,C]=(0,gt.useState)(!1),A=(0,gt.useMemo)(()=>Vw(t),[t]),I=(0,gt.useMemo)(()=>zw(A),[A]);(0,gt.useEffect)(()=>{b(KT[a.type].length>0)},[a.type]);let k=(0,gt.useCallback)(async()=>{let G=await $1();if(!G.success){d(G.error??"Failed to load drafts"),c("loaded");return}let ae=SV(G.data);if(!ae.ok){d(ae.reason),i([]),c("loaded");return}i(ae.drafts),d(null),c("loaded")},[]),T=(0,gt.useCallback)(async()=>{let G=await K1();if(!G.success||!G.data){g(null);return}g(G.data.channels)},[]);(0,gt.useEffect)(()=>{k(),T()},[k,T]);let _=(0,gt.useCallback)((G,ae)=>{n(we=>({...we,[G]:ae}))},[]),M=(0,gt.useCallback)(()=>({type:a.type,title:a.title.trim(),description:a.description.trim(),stepsToReproduce:a.stepsToReproduce.trim()||void 0,expectedBehavior:a.expectedBehavior.trim()||void 0,actualBehavior:a.actualBehavior.trim()||void 0,goal:a.goal.trim()||void 0,stuckAt:a.stuckAt.trim()||void 0,job:a.job.trim()||void 0,currentWorkaround:a.currentWorkaround.trim()||void 0,sawWhat:a.sawWhat.trim()||void 0,whereSeen:a.whereSeen.trim()||void 0,frequency:a.frequency??void 0,blockingLevel:a.blockingLevel??void 0,...I?{area:I}:{},...A?.taskId?{taskId:A.taskId}:{},...A?{context:A}:{}}),[a,I,A]),H=(0,gt.useCallback)(async G=>{if(G.preventDefault(),!a.title.trim()||!a.description.trim()){U.error(e("pages.reportProblem.errors.missingRequired"));return}n(ae=>({...ae,submitting:!0}));try{let[ae,we,ze]=await Promise.allSettled([Zr(),J("/api/v1/lifecycle/state"),J("/api/health")]),ke=$T(ae,we,ze),tt=await G1(M(),ke);if(!tt.success){U.error(_g(tt,e("pages.reportProblem.errors.createFailed"))),n(ne=>({...ne,submitting:!1}));return}let Ct=Pg(tt.data);if(Ct===null&&QT(tt.data)&&Object.hasOwn(tt.data,"report")&&(Ct=qw(tt.data.report)),Ct===null){U.error(e("pages.reportProblem.errors.createFailed")),n(ne=>({...ne,submitting:!1}));return}s(Ct),U.success(e("pages.reportProblem.toast.draftCreated")),n(ne=>({...WT,type:ne.type,frequency:void 0,blockingLevel:void 0,submitting:!1})),m(!1),await k()}catch{U.error(e("pages.reportProblem.errors.createFailed"))}finally{n(ae=>({...ae,submitting:!1}))}},[a,e,k,M]),Y=(0,gt.useCallback)(async G=>{let ae=await qx(G);if(!ae.success){U.error(e("pages.reportProblem.toast.loadFailed"));return}let we=Pg(ae.data);if(we===null){U.error(e("pages.reportProblem.toast.loadFailed"));return}s(we),n({type:we.type,title:we.title,description:we.userText.description,stepsToReproduce:we.userText.stepsToReproduce??"",expectedBehavior:we.userText.expectedBehavior??"",actualBehavior:we.userText.actualBehavior??"",frequency:we.userText.frequency,blockingLevel:we.userText.blockingLevel,goal:we.userText.goal??"",stuckAt:we.userText.stuckAt??"",job:we.userText.job??"",currentWorkaround:we.userText.currentWorkaround??"",sawWhat:we.userText.sawWhat??"",whereSeen:we.userText.whereSeen??"",submitting:!1})},[e]),oe=(0,gt.useCallback)(async G=>{try{if(!G.outputs.markdown)return;await navigator.clipboard.writeText(G.outputs.markdown),U.success(e("pages.reportProblem.toast.markdownCopied"))}catch{U.error(e("pages.reportProblem.toast.copyFailed"))}},[e]),q=(0,gt.useCallback)(async G=>{try{if(!G.outputs.emailText)return;await navigator.clipboard.writeText(G.outputs.emailText),U.success(e("pages.reportProblem.toast.emailCopied"))}catch{U.error(e("pages.reportProblem.toast.copyFailed"))}},[e]),R=(0,gt.useCallback)(G=>{G.outputs.githubIssueUrl&&window.open(G.outputs.githubIssueUrl,"_blank")},[]),F=(0,gt.useCallback)(G=>{G.outputs.mailtoUrl&&window.open(G.outputs.mailtoUrl,"_blank")},[]),se=(0,gt.useCallback)(G=>{let ae=new Blob([G.outputs.markdown],{type:"text/markdown;charset=utf-8"}),we=URL.createObjectURL(ae),ze=document.createElement("a");ze.href=we,ze.download=`PD-feedback-${G.id}.md`,document.body.appendChild(ze),ze.click(),ze.remove(),URL.revokeObjectURL(we)},[]),ve=(0,gt.useCallback)(async G=>{let ae=await qx(G);if(ae.success){let we=Pg(ae.data);we&&s(we)}},[]),z=(0,gt.useCallback)(async G=>{let ae=o;if(ae){C(!0);try{let we=await Y1(ae.id,G);if(!we.success){U.error(_g(we,e("pages.reportProblem.toast.submitFailed")));return}await ve(ae.id),await k();let ze=we.data;ze?.writeBackFailed?U.error(e("pages.reportProblem.channel.writeBackNote")):ze?.alreadySubmitted?U.info(e("pages.reportProblem.channel.alreadySubmitted")):U.success(e("pages.reportProblem.toast.submitSucceeded",{trackingId:ze?.trackingId??""}))}catch{U.error(e("pages.reportProblem.toast.submitFailed"))}finally{C(!1),x(null)}}},[o,e,ve,k]),L=(0,gt.useCallback)(async G=>{let ae=o;if(!ae)return;let we=await X1(ae.id,G);if(!we.success){U.error(_g(we,e("pages.reportProblem.toast.submitFailed")));return}U.success(e("pages.reportProblem.toast.markSentSucceeded")),await ve(ae.id),await k()},[o,e,ve,k]),re=(0,gt.useCallback)(async G=>{if(!(await W1(G)).success){U.error(e("pages.reportProblem.toast.deleteFailed"));return}U.success(e("pages.reportProblem.toast.draftDeleted")),i(we=>we.filter(ze=>ze.id!==G)),o?.id===G&&s(null)},[e,o]);if(l==="loading")return(0,j.jsx)(Me,{children:(0,j.jsx)(It,{cardCount:3,label:e("common.loading")})});if(l==="error")return(0,j.jsxs)(Me,{children:[(0,j.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.reportProblem.eyebrow")}),(0,j.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.reportProblem.title")}),(0,j.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,j.jsx)("p",{children:e("pages.reportProblem.loadError")}),u&&(0,j.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:u})]})]});let qe=KT[a.type],Ee=G=>{if(G==="frequency"){let ze=e("pages.reportProblem.form.frequencyLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-frequency",className:"block text-ink-2 text-[13px] mb-1.5",children:ze}),(0,j.jsxs)("select",{id:"feedback-frequency",value:a.frequency??"",onChange:ke=>{let tt=ke.target.value;tt===""?_("frequency",void 0):vV.has(tt)&&_("frequency",tt)},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:[(0,j.jsx)("option",{value:"",children:e("pages.reportProblem.form.frequencyNotSet")}),XT.map(ke=>(0,j.jsx)("option",{value:ke,children:e(`pages.reportProblem.form.frequency${ke.charAt(0).toUpperCase()+ke.slice(1)}`)},ke))]})]},"frequency")}if(G==="blockingLevel"){let ze=e("pages.reportProblem.form.blockingLevelLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-blocking",className:"block text-ink-2 text-[13px] mb-1.5",children:ze}),(0,j.jsxs)("select",{id:"feedback-blocking",value:a.blockingLevel??"",onChange:ke=>{let tt=ke.target.value;tt===""?_("blockingLevel",void 0):xV.has(tt)&&_("blockingLevel",tt)},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:[(0,j.jsx)("option",{value:"",children:e("pages.reportProblem.form.blockingLevelNotSet")}),ZT.map(ke=>(0,j.jsx)("option",{value:ke,children:e(`pages.reportProblem.form.blockingLevel${ke.charAt(0).toUpperCase()+ke.slice(1)}`)},ke))]})]},"blockingLevel")}let ae=a[G],we=e(yV[G]??"pages.reportProblem.form.descriptionLabel");return(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:`feedback-${G}`,className:"block text-ink-2 text-[13px] mb-1.5",children:we}),(0,j.jsx)("textarea",{id:`feedback-${G}`,value:typeof ae=="string"?ae:"",onChange:ze=>_(G,ze.target.value),rows:G==="stepsToReproduce"?3:2,className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov resize-y"})]},G)};return(0,j.jsx)(Me,{children:(0,j.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,j.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.reportProblem.eyebrow")}),(0,j.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.reportProblem.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.reportProblem.subtitle")}),(0,j.jsx)(Gw,{}),(0,j.jsxs)("section",{"aria-labelledby":"section-form",children:[(0,j.jsx)(me,{id:"section-form",children:e("pages.reportProblem.form.title")}),(0,j.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:e("pages.reportProblem.form.description")}),(0,j.jsxs)("form",{onSubmit:H,className:"bg-panel border border-line rounded-[6px] p-5 space-y-4",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-type",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.type")}),(0,j.jsx)("select",{id:"feedback-type",value:a.type,onChange:G=>{let ae=G.target.value;bV.has(ae)&&n(we=>({...we,type:ae,frequency:void 0,blockingLevel:void 0}))},className:"border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov",children:YT.map(G=>(0,j.jsx)("option",{value:G,children:e(`pages.reportProblem.form.types.${G}`)},G))})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-title",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.titleLabel")}),(0,j.jsx)("input",{id:"feedback-title",type:"text",value:a.title,onChange:G=>_("title",G.target.value),className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("label",{htmlFor:"feedback-description",className:"block text-ink-2 text-[13px] mb-1.5",children:e("pages.reportProblem.form.descriptionLabel")}),(0,j.jsx)("textarea",{id:"feedback-description",value:a.description,onChange:G=>_("description",G.target.value),rows:4,className:"w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov resize-y"})]}),qe.length>0&&(0,j.jsx)("div",{children:(0,j.jsx)("button",{type:"button",onClick:()=>b(G=>!G),className:"text-gov text-[13px] font-medium underline underline-offset-2 hover:text-gov-2 transition-colors",children:e(p?"pages.reportProblem.form.detailsHide":"pages.reportProblem.form.detailsToggle")})}),p&&(0,j.jsx)("div",{className:"space-y-4 border-t border-line pt-4",children:qe.map(Ee)}),(0,j.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,j.jsx)("button",{type:"submit",disabled:a.submitting,className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:a.submitting?e("pages.reportProblem.form.submitting"):e("pages.reportProblem.form.submit")}),o&&(0,j.jsx)("button",{type:"button",onClick:()=>m(G=>!G),className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e(f?"pages.reportProblem.form.hidePreview":"pages.reportProblem.form.showPreview")})]})]}),f&&o&&(0,j.jsxs)("div",{className:"mt-4 bg-panel border border-line rounded-[6px] p-4",children:[(0,j.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-3",children:"Markdown"}),(0,j.jsx)("pre",{className:"whitespace-pre-wrap text-ink-2 text-[13px] leading-relaxed bg-surface border border-line rounded-[3px] p-3 max-h-[400px] overflow-auto",children:o.outputs.markdown})]})]}),(0,j.jsx)(CV,{draft:o}),o&&(0,j.jsx)(DV,{draft:o,channels:v,onSubmitIngest:()=>x({channel:"ingest"}),onSubmitGithub:()=>x({channel:"github"}),onOpenEmail:()=>F(o),onExportFile:()=>se(o),onMarkSent:L}),o&&(0,j.jsxs)("section",{className:"mt-8","aria-labelledby":"section-current-draft",children:[(0,j.jsx)(me,{id:"section-current-draft",children:e("pages.reportProblem.draft.title")}),(0,j.jsx)(IV,{draft:o,onCopyMarkdown:()=>oe(o),onCopyEmail:()=>q(o),onOpenGithub:()=>R(o),onOpenEmail:()=>F(o),onDelete:()=>re(o.id)})]}),u&&(0,j.jsxs)("div",{className:"mt-4 p-3 bg-panel border border-amber/20 rounded-[6px] text-ink-2 text-[13px]",children:[(0,j.jsx)("p",{children:e("pages.reportProblem.loadError")}),(0,j.jsx)("p",{className:"mt-1 text-ink-4 text-[12px] font-mono",children:u})]}),(0,j.jsx)(AV,{drafts:r,onLoad:Y,onDelete:re}),(0,j.jsx)("footer",{className:"mt-12 pt-6 border-t border-line text-ink-3 text-[13px]",children:e("pages.reportProblem.privacy.guarantee")}),o&&h&&(0,j.jsx)(LV,{draft:o,channel:h.channel,open:!0,busy:y,onConfirm:()=>z(h.channel),onCancel:()=>x(null)})]})})}var Ia=D(ee(),1);var V=D(W(),1),NV={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};function sf(e){return ba(e,ar.language,NV)}function $w(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function a2(e){return typeof e=="string"}function EV(e){return typeof e=="number"&&!Number.isNaN(e)}function Vc(e,t){return Object.hasOwn(e,t)&&a2(e[t])?e[t]:null}function bl(e,t){if(!Object.hasOwn(e,t))return null;let a=e[t];return a===null?null:a2(a)?a:null}function lf(e,t){return Object.hasOwn(e,t)&&EV(e[t])?e[t]:null}function OV(e){if(!$w(e))return null;let t=Vc(e,"taskId"),a=Vc(e,"taskKind"),n=Vc(e,"status"),r=lf(e,"attemptCount"),i=lf(e,"maxAttempts"),o=Vc(e,"createdAt");if(t===null||a===null||n===null||r===null||i===null||o===null)return null;let s=bl(e,"painId"),l=bl(e,"lastError"),c=bl(e,"lastAttemptAt"),u=Object.hasOwn(e,"ownerDecisionRequired")?e.ownerDecisionRequired===!0:void 0;return{taskId:t,taskKind:a,painId:s,status:n,lastError:l,attemptCount:r,maxAttempts:i,createdAt:o,lastAttemptAt:c,...u!==void 0?{ownerDecisionRequired:u}:{}}}function TV(e){if(!$w(e)||!Object.hasOwn(e,"tasks"))return null;let t=e.tasks;if(!Array.isArray(t))return null;let a=[];for(let o of t){let s=OV(o);if(s===null)return null;a.push(s)}let n=lf(e,"total");if(n===null)return null;let r=bl(e,"nextAction"),i;if(Object.hasOwn(e,"pipeline")&&$w(e.pipeline)){let o=e.pipeline,s=Vc(o,"status"),l=Vc(o,"note");(s==="healthy"||s==="backlogged"||s==="stalled"||s==="disabled"||s==="unknown")&&l!==null&&(i={status:s,pendingCount:lf(o,"pendingCount"),oldestPendingTaskKind:bl(o,"oldestPendingTaskKind"),oldestPendingAgeMinutes:lf(o,"oldestPendingAgeMinutes"),lastProgressAt:bl(o,"lastProgressAt"),note:l,nextAction:bl(o,"nextAction")??void 0})}return{tasks:a,total:n,nextAction:r??void 0,...i?{pipeline:i}:{}}}function e2(e){return e.length>12?e.slice(0,12)+"\u2026":e}function PV(e){return e==="failed"?"destructive":e==="needs_human_review"?"amber":"default"}function _V(e){return e.status==="failed"&&e.attemptCount>=e.maxAttempts}function BV(e){let t=new Map;for(let a of e){let n=t.get(a.taskKind)??[];n.push(a),t.set(a.taskKind,n)}return t}function n2(){let{t:e}=X(),t=na(),[a]=Sn(),n=a.get("taskId")??void 0,[r,i]=(0,Ia.useState)({status:"loading"}),[o,s]=(0,Ia.useState)(!1),[l,c]=(0,Ia.useState)(null),[u,d]=(0,Ia.useState)(!1),f=l!==null&&_V(l),m=e("pages.failedTasks.recoverConfirmButton");u?m=e("common.loading"):f&&(m=e("pages.failedTasks.recoverConfirmForceButton")),(0,Ia.useEffect)(()=>{let g=!1;return Zr().then(h=>{if(!g&&h.success&&h.data){let x=h.data.features.find(y=>y.id==="failed_task_recovery_console");s(x?.enabled===!0)}}).catch(()=>{}),()=>{g=!0}},[]);let p=(0,Ia.useCallback)(async()=>{i({status:"loading"});let g=await J("/api/v1/failed-tasks",void 0,TV);if(g.success){i({status:"loaded",data:g.data});return}if(g.status===403){i({status:"disabled"});return}i({status:"error",message:g.error,nextAction:g.nextAction})},[]);(0,Ia.useEffect)(()=>{p()},[p]);let b=g=>{let h=new URLSearchParams({source:"failed_tasks_page",taskId:g.taskId});g.painId&&h.set("painId",g.painId),t(`/report-problem?${h.toString()}`)},v=async()=>{if(!(!l||u)){d(!0);try{let g=await cL(l.taskId,void 0,f);if(g.success)U.success(e("pages.failedTasks.recoverSuccess")),c(null),await p();else{let h=g.nextAction?`${g.error} \u2014 ${g.nextAction}`:g.error;U.error(`${e("pages.failedTasks.recoverFailed")}: ${h}`)}}catch(g){U.error(`${e("pages.failedTasks.recoverFailed")}: ${g instanceof Error?g.message:"Network error"}`)}finally{d(!1)}}};return(0,V.jsxs)(Me,{children:[(0,V.jsxs)("div",{className:"mb-8",children:[(0,V.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-ink-3",children:e("pages.failedTasks.title")}),(0,V.jsx)(Pr,{as:"h1",className:"text-[29px] font-semibold tracking-tight text-ink mt-3 mb-2",duration:4.5,brightness:.5,disabled:r.status!=="loaded"||r.data.tasks.length===0,children:e("pages.failedTasks.title")}),(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed max-w-[712px]",children:e("pages.failedTasks.subtitle")})]}),r.status==="loading"&&(0,V.jsx)(It,{cardCount:3,label:e("common.loading")}),r.status==="disabled"&&(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsx)("div",{className:"p-5 bg-panel border border-amber/20 rounded-[var(--radius-md)] text-amber text-[13px] leading-relaxed",children:e("pages.failedTasks.disabled")}),(0,V.jsx)("div",{className:"mt-4",children:(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:p,children:e("common.refresh")})})]}),r.status==="error"&&(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsxs)("div",{className:"text-danger text-sm mb-2",children:[e("pages.failedTasks.error"),": ",r.message]}),r.nextAction&&(0,V.jsx)("div",{className:"text-ink-3 text-[13px] mb-3",children:r.nextAction}),(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:p,children:e("common.refresh")})]}),r.status==="loaded"&&(0,V.jsx)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:(0,V.jsx)(MV,{data:r.data,onCreateDraft:b,onRecover:o?g=>c(g):void 0,initialExpandedTaskId:n,t:e})}),(0,V.jsx)(Tg,{open:l!==null,onOpenChange:g=>{!g&&!u&&c(null)},children:(0,V.jsxs)(Qu,{children:[(0,V.jsxs)(Ju,{children:[(0,V.jsx)(tf,{children:e("pages.failedTasks.recoverConfirmTitle")}),(0,V.jsx)(af,{asChild:!0,children:(0,V.jsxs)("div",{className:"space-y-2 text-[13px] leading-relaxed",children:[(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmStatus"),":"]})," ",(0,V.jsx)("span",{className:"font-mono",children:l?.status??"\u2014"})]}),f&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmAttempts"),":"]})," ",(0,V.jsxs)("span",{className:"font-mono",children:[l?.attemptCount," / ",l?.maxAttempts]})]}),(0,V.jsx)("div",{className:"text-danger",children:e("pages.failedTasks.recoverExhaustedWarning",{attempt:l?.attemptCount??0,max:l?.maxAttempts??0})})]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmActionLabel"),":"]})," ",e("pages.failedTasks.recoverConfirmActionDesc")]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("span",{className:"font-medium",children:[e("pages.failedTasks.recoverConfirmImpactLabel"),":"]})," ",e(f?"pages.failedTasks.recoverConfirmForceImpactDesc":"pages.failedTasks.recoverConfirmImpactDesc")]})]})})]}),(0,V.jsxs)(ef,{children:[(0,V.jsx)(rf,{disabled:u,children:e("common.cancel")}),(0,V.jsx)(nf,{disabled:u,onClick:g=>{g.preventDefault(),v()},children:m})]})]})})]})}function t2({pipeline:e,t}){let a=e.status==="healthy"?t("pages.failedTasks.pipeline.statusHealthy"):e.status==="backlogged"?t("pages.failedTasks.pipeline.statusBacklogged"):e.status==="stalled"?t("pages.failedTasks.pipeline.statusStalled"):t("pages.failedTasks.pipeline.statusUnknown"),n=e.status==="healthy"?"default":e.status==="stalled"?"destructive":e.status==="backlogged"?"amber":"default";return(0,V.jsxs)("div",{className:"p-5 bg-panel border border-line rounded-[var(--radius-md)] mb-4",children:[(0,V.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,V.jsx)("span",{className:"text-[15px] font-semibold text-ink",children:t("pages.failedTasks.pipeline.title")}),(0,V.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full border ${n==="destructive"?"border-red-300 text-red-700 bg-red-50":n==="amber"?"border-amber-300 text-amber-700 bg-amber-50":"border-line text-ink-3 bg-canvas"}`,children:a})]}),(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed",children:e.note}),e.nextAction&&(0,V.jsxs)("p",{className:"text-ink-3 text-sm leading-relaxed mt-1",children:[t("pages.failedTasks.pipeline.nextActionPrefix"),e.nextAction]})]})}function MV({data:e,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r}){if(!(e.tasks.length>0))return(0,V.jsxs)("div",{className:"py-8",children:[(0,V.jsxs)("div",{className:"p-5 bg-panel border border-line rounded-[var(--radius-md)]",children:[(0,V.jsx)("h3",{className:"text-[17px] font-semibold text-ink mb-2",children:r("pages.failedTasks.empty")}),e.nextAction&&(0,V.jsx)("p",{className:"text-ink-3 text-sm leading-relaxed",children:e.nextAction})]}),e.pipeline&&(0,V.jsx)(t2,{pipeline:e.pipeline,t:r})]});let o=BV(e.tasks),s=Array.from(o.keys()).sort();return(0,V.jsxs)(V.Fragment,{children:[e.pipeline&&(0,V.jsx)(t2,{pipeline:e.pipeline,t:r}),(0,V.jsx)("div",{className:"space-y-6",children:s.map(l=>{let c=o.get(l);return!c||c.length===0?null:(0,V.jsxs)(Or,{children:[(0,V.jsx)(hs,{children:(0,V.jsxs)("div",{className:"flex items-center gap-2",children:[(0,V.jsx)(la,{variant:"outline",children:r("pages.failedTasks.kind")}),(0,V.jsxs)(bs,{className:"text-[15px] font-mono",children:[l," (",c.length,")"]})]})}),(0,V.jsx)(Tr,{children:(0,V.jsx)(FV,{tasks:c,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r})})]},l)})}),(0,V.jsxs)("div",{className:"mt-8 font-mono text-[11px] text-ink-4 space-y-1",children:[(0,V.jsxs)("div",{children:[r("common.total"),": ",e.total]}),e.total>e.tasks.length&&(0,V.jsx)("div",{className:"text-amber/80 leading-relaxed",children:r("pages.failedTasks.partialResults").replace("{shown}",String(e.tasks.length)).replace("{total}",String(e.total))})]})]})}function FV({tasks:e,onCreateDraft:t,onRecover:a,initialExpandedTaskId:n,t:r}){let i=n!==void 0?e.find(p=>p.taskId===n):void 0,[o,s]=(0,Ia.useState)(i?.taskId??null),[l,c]=(0,Ia.useState)({status:"idle"}),u=(0,Ia.useRef)(0),d=(0,Ia.useRef)(!1),f=(0,Ia.useCallback)(async p=>{let b=++u.current;c({status:"loading",taskId:p});let v=await dL(p);b===u.current&&(v.success?c({status:"loaded",taskId:p,data:v.data}):c({status:"error",taskId:p,message:v.error,nextAction:v.nextAction}))},[]);(0,Ia.useEffect)(()=>{if(i===void 0||d.current)return;d.current=!0,f(i.taskId),document.querySelector(`[data-testid=${CSS.escape(`detail-toggle-${i.taskId}`)}]`)?.scrollIntoView({block:"center"})},[i,f]);let m=(0,Ia.useCallback)(p=>{if(o===p){u.current+=1,s(null),c({status:"idle"});return}s(p),f(p)},[o,f]);return(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto_minmax(0,1fr)_auto_minmax(0,1fr)_auto_auto] gap-3 pb-2 border-b border-line font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4",children:[(0,V.jsx)("span",{"aria-hidden":"true"}),(0,V.jsx)("span",{children:r("pages.failedTasks.taskId")}),(0,V.jsx)("span",{children:r("pages.failedTasks.painId")}),(0,V.jsx)("span",{children:r("pages.failedTasks.status")}),(0,V.jsx)("span",{children:r("pages.failedTasks.lastError")}),(0,V.jsx)("span",{children:r("pages.failedTasks.attempts")}),(0,V.jsx)("span",{children:r("pages.failedTasks.lastAttempt")}),(0,V.jsx)("span",{"aria-hidden":"true"}),(0,V.jsx)("span",{"aria-hidden":"true"})]}),e.map(p=>{let b=o===p.taskId;return(0,V.jsxs)(Ia.Fragment,{children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto_minmax(0,1fr)_auto_minmax(0,1fr)_auto_auto] gap-3 py-2 items-center text-[13px] border-b border-line/50 last:border-b-0",children:[(0,V.jsx)(pe,{variant:"quiet",size:"icon",className:"h-6 w-6 shrink-0 text-[12px]",onClick:()=>m(p.taskId),"aria-label":r("pages.failedTasks.detailToggle"),"aria-expanded":b,"data-testid":`detail-toggle-${p.taskId}`,children:b?"\u25BE":"\u25B8"}),(0,V.jsx)("span",{className:"font-mono text-ink-2 truncate",title:p.taskId,children:e2(p.taskId)}),(0,V.jsx)("span",{className:"font-mono text-ink-3 truncate",title:p.painId??"",children:p.painId?e2(p.painId):r("pages.failedTasks.noPainId")}),(0,V.jsx)(la,{variant:PV(p.status),children:p.status}),(0,V.jsx)("span",{className:"text-ink-3 truncate",title:p.lastError??"",children:p.lastError??"\u2014"}),(0,V.jsx)("span",{className:"font-mono text-ink-2 text-center",children:p.attemptCount}),(0,V.jsx)("span",{className:"font-mono text-ink-3 text-[12px]",children:p.lastAttemptAt?sf(p.lastAttemptAt):"\u2014"}),p.ownerDecisionRequired===!0?(0,V.jsxs)("span",{className:"whitespace-nowrap text-[12px]",children:[(0,V.jsx)("span",{className:"text-amber",children:r("pages.failedTasks.awaitingOwnerDecision")})," ",(0,V.jsx)("a",{href:"#/focus",className:"text-gov underline underline-offset-2 hover:text-gov/80","data-testid":`go-focus-${p.taskId}`,children:r("pages.failedTasks.goGovernanceFocus")})]}):a?(0,V.jsx)(pe,{variant:"default",size:"sm",onClick:()=>a(p),className:"whitespace-nowrap",children:r("pages.failedTasks.recover")}):null,(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:()=>t(p),className:"whitespace-nowrap",children:r("pages.failedTasks.createDraft")})]}),b&&(0,V.jsx)("div",{className:"border border-line/60 rounded-[var(--radius-md)] bg-panel/60 p-4 mb-2","data-testid":`detail-panel-${p.taskId}`,children:(0,V.jsx)(UV,{state:l.status==="idle"?{status:"loading",taskId:p.taskId}:l,taskId:p.taskId,onRetry:f,t:r})})]},p.taskId)})]})}function UV({state:e,taskId:t,onRetry:a,t:n}){if(e.status==="loading")return(0,V.jsx)("div",{className:"text-ink-3 text-[13px]","data-testid":"detail-loading",children:n("common.loading")});if(e.status==="error")return(0,V.jsxs)("div",{className:"text-[13px] space-y-2","data-testid":"detail-error",children:[(0,V.jsxs)("div",{className:"text-danger",children:[n("pages.failedTasks.detailError"),": ",e.message]}),e.nextAction&&(0,V.jsx)("div",{className:"text-ink-3",children:e.nextAction}),(0,V.jsx)("div",{children:(0,V.jsx)(pe,{variant:"outline",size:"sm",onClick:()=>a(t),children:n("common.refresh")})})]});if(e.status==="idle"||e.taskId!==t)return(0,V.jsx)("div",{className:"text-ink-3 text-[13px]","data-testid":"detail-loading",children:n("common.loading")});let{data:r}=e;return(0,V.jsxs)("div",{className:"space-y-4 text-[13px]",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 font-mono text-[12px]",children:[(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.taskId")}),(0,V.jsx)("span",{className:"text-ink-2 break-all",children:r.taskId}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.kind")}),(0,V.jsx)("span",{className:"text-ink-2",children:r.taskKind}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.status")}),(0,V.jsx)("span",{className:"text-ink-2",children:r.status}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.createdAt")}),(0,V.jsx)("span",{className:"text-ink-3",children:sf(r.createdAt)}),r.updatedAt&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.updatedAt")}),(0,V.jsx)("span",{className:"text-ink-3",children:sf(r.updatedAt)})]}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.attempts")}),(0,V.jsxs)("span",{className:"text-ink-2",children:[r.attemptCount," / ",r.maxAttempts]}),(0,V.jsx)("span",{className:"text-ink-4 uppercase tracking-[0.08em] self-center",children:n("pages.failedTasks.lastError")}),(0,V.jsx)("span",{className:r.lastError?"text-danger":"text-ink-3",children:r.lastError??"\u2014"})]}),(0,V.jsxs)("div",{children:[(0,V.jsxs)("div",{className:"font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4 mb-2",children:[n("pages.failedTasks.runsTitle")," (",r.runs.length,")"]}),r.runs.length===0?(0,V.jsx)("div",{className:"text-ink-3",children:n("pages.failedTasks.noRuns")}):(0,V.jsxs)("div",{className:"space-y-1",children:[(0,V.jsxs)("div",{className:"grid grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)] gap-3 pb-1 border-b border-line/50 font-mono text-[10px] uppercase tracking-[0.08em] text-ink-4",children:[(0,V.jsx)("span",{children:n("pages.failedTasks.runAttempt")}),(0,V.jsx)("span",{children:n("pages.failedTasks.status")}),(0,V.jsx)("span",{children:n("pages.failedTasks.runStarted")}),(0,V.jsx)("span",{children:n("pages.failedTasks.runReason")})]}),r.runs.map(i=>(0,V.jsxs)("div",{className:"grid grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)] gap-3 py-1 text-[12px] border-b border-line/30 last:border-b-0",title:`${n("pages.failedTasks.runEnded")}: ${i.endedAt?sf(i.endedAt):"\u2014"}${i.errorCategory?` \xB7 ${n("pages.failedTasks.runErrorCategory")}: ${i.errorCategory}`:""}`,children:[(0,V.jsxs)("span",{className:"font-mono text-ink-2",children:["#",i.attemptNumber]}),(0,V.jsx)("span",{className:"font-mono text-ink-3",children:i.executionStatus}),(0,V.jsx)("span",{className:"font-mono text-ink-3",children:sf(i.startedAt)}),(0,V.jsx)("span",{className:"text-ink-3 break-words",title:i.reason??void 0,children:i.reason??i.errorCategory??"\u2014"})]},i.runId))]})]})]})}var Zt=D(ee(),1);var Ba=D(ee(),1);var r2=[{key:"why",headerRegex:/^##\s+1\.\s*Why\s*$/im,label:"why",header:"## 1. Why"},{key:"desiredOutcome",headerRegex:/^##\s+2\.\s*Desired Outcome\s*$/im,label:"desiredOutcome",header:"## 2. Desired Outcome"},{key:"nonNegotiables",headerRegex:/^##\s+3\.\s*Non-negotiables\s*$/im,label:"nonNegotiables",header:"## 3. Non-negotiables"},{key:"stopEscalation",headerRegex:/^##\s+4\.\s*Stop\s*\/\s*Escalation\s*$/im,label:"stopEscalation",header:"## 4. Stop / Escalation"},{key:"currentStrategicFocus",headerRegex:/^##\s+5\.\s*Current Strategic Focus\s*$/im,label:"currentStrategicFocus",header:"## 5. Current Strategic Focus"}];function vl(e){let t={};for(let a of r2){let n=a.headerRegex.exec(e);if(n===null)continue;let r=e.slice(n.index+n[0].length),i=/^##\s+/m.exec(r);t[a.key]=r.slice(0,i!==null?i.index:r.length).trim()}return t}function Bg(e){let t=["# INTENT.md",""];for(let a of r2){let n=e[a.key],r=typeof n=="string"?n:"";t.push(a.header,"",r,"")}return t.join(`
111
111
  `)}var jV=["why","desiredOutcome","nonNegotiables","stopEscalation","currentStrategicFocus"];function Ww(e,t){let a=vl(e),n=vl(t);return jV.map(r=>({section:r,changed:(a[r]??"")!==(n[r]??"")}))}var ye=D(W(),1),cf=[1,2,3,4,5],si={1:"why",2:"desiredOutcome",3:"nonNegotiables",4:"stopEscalation",5:"currentStrategicFocus"},s2="pd_intent_onboarding_dismissed";function i2(){try{return localStorage.getItem(s2)==="true"}catch{return!1}}function o2(){try{localStorage.setItem(s2,"true")}catch{}}function HV({onComplete:e,onSkip:t,onClose:a}){let{t:n}=X(),[r,i]=(0,Ba.useState)("intro"),[o,s]=(0,Ba.useState)({}),[l,c]=(0,Ba.useState)(!1),u=(0,Ba.useRef)(null);(0,Ba.useEffect)(()=>{typeof r=="number"&&u.current?.focus()},[r]);let d=(0,Ba.useMemo)(()=>Object.values(o).some(h=>typeof h=="string"&&h.trim().length>0),[o]);function f(){d?c(!0):a()}function m(){if(r==="intro"){i(1);return}if(typeof r=="number"&&r<5){i(r+1);return}r===5&&i("finish")}function p(){if(typeof r=="number"&&r>1){i(r-1);return}r===1&&i("intro")}function b(h){if(typeof r!="number")return;let x=si[r];s(y=>({...y,[x]:h}))}let v=typeof r=="number"?o[si[r]]??"":"",g=typeof r=="number"&&v.trim().length===0;return(0,ye.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/40 backdrop-blur-sm animate-[pdFadeIn_200ms_ease-out]",role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",onClick:f,children:(0,ye.jsxs)("div",{className:"bg-surface border border-line rounded-[8px] p-6 max-w-[620px] w-full mx-4 max-h-[85vh] overflow-y-auto",onClick:h=>h.stopPropagation(),children:[(0,ye.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,ye.jsxs)("div",{children:[(0,ye.jsx)("h2",{id:"onboarding-title",className:"text-[20px] font-semibold tracking-tight text-ink mb-1",children:n("pages.intent.onboarding.title")}),r==="intro"&&(0,ye.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:n("pages.intent.onboarding.subtitle")}),typeof r=="number"&&(0,ye.jsx)("p",{className:"text-ink-3 text-[12px] font-mono",children:n("pages.intent.wizard.progressLabel",{current:r})})]}),(0,ye.jsx)("button",{type:"button",onClick:f,className:"shrink-0 ml-3 text-ink-3 hover:text-ink transition-colors","aria-label":n("pages.intent.onboarding.close"),children:(0,ye.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:(0,ye.jsx)("path",{d:"M4 4L14 14M14 4L4 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),r==="intro"&&(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsx)("h3",{className:"text-[14px] font-semibold text-ink mb-1.5",children:n("pages.intent.onboarding.whatIsIt.title")}),(0,ye.jsx)("p",{className:"text-ink-2 text-[13px] leading-relaxed",children:n("pages.intent.onboarding.whatIsIt.description")})]}),(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsx)("h3",{className:"text-[14px] font-semibold text-ink mb-1.5",children:n("pages.intent.onboarding.whyYouFill.title")}),(0,ye.jsx)("p",{className:"text-ink-2 text-[13px] leading-relaxed",children:n("pages.intent.onboarding.whyYouFill.description")})]}),(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsx)("h3",{className:"text-[14px] font-semibold text-ink mb-1.5",children:n("pages.intent.onboarding.sectionGuide.title")}),(0,ye.jsx)("p",{className:"text-ink-3 text-[12px] leading-relaxed mb-2",children:n("pages.intent.onboarding.sectionGuide.description")}),(0,ye.jsx)("ul",{className:"space-y-1.5",children:cf.map(h=>{let x=si[h];return(0,ye.jsxs)("li",{className:"text-ink-2 text-[13px] leading-relaxed",children:[(0,ye.jsx)("span",{className:"font-mono text-gov",children:"\u2022"})," ",n(`pages.intent.wizard.stepLabels.${x}`)]},h)})})]})]}),typeof r=="number"&&(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsx)("h3",{className:"text-[15px] font-semibold text-ink mb-1.5",children:n(`pages.intent.wizard.stepLabels.${si[r]}`)}),(0,ye.jsx)("p",{className:"text-ink-3 text-[12px] leading-relaxed mb-3",children:n(`pages.intent.wizard.guidance.${si[r]}`)}),(0,ye.jsx)("textarea",{ref:u,value:v,onChange:h=>b(h.target.value),placeholder:n(`pages.intent.wizard.guidance.${si[r]}`),className:"w-full h-[180px] bg-surface border border-line rounded-[4px] p-3 text-[13px] text-ink leading-relaxed resize-y focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov/30",spellCheck:!1,"aria-label":n(`pages.intent.wizard.stepLabels.${si[r]}`)}),g&&(0,ye.jsx)("p",{className:"text-amber text-[12px] mt-1.5",role:"alert",children:n("pages.intent.wizard.emptyWarning")})]}),r==="finish"&&(0,ye.jsxs)("div",{className:"mb-5",children:[(0,ye.jsx)("h3",{className:"text-[15px] font-semibold text-ink mb-3",children:n("pages.intent.wizard.finish")}),(0,ye.jsx)("div",{className:"space-y-3",children:cf.map(h=>{let x=si[h],y=o[x]??"";return(0,ye.jsxs)("div",{className:"border-l-2 border-gov/40 pl-3",children:[(0,ye.jsx)("p",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-0.5",children:n(`pages.intent.wizard.stepLabels.${x}`)}),(0,ye.jsx)("p",{className:"text-ink-2 text-[13px] leading-relaxed whitespace-pre-wrap",children:y||n("pages.intent.wizard.emptyWarning")})]},h)})})]}),(0,ye.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-3 border-t border-line",children:[(0,ye.jsxs)("div",{children:[r==="intro"&&(0,ye.jsx)("button",{type:"button",onClick:t,className:"border border-line bg-surface text-ink-2 rounded-[4px] px-4 py-2 text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.intent.onboarding.skipOption")}),typeof r=="number"&&(0,ye.jsx)("button",{type:"button",onClick:p,className:"border border-line bg-surface text-ink-2 rounded-[4px] px-4 py-2 text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.intent.wizard.prev")})]}),(0,ye.jsxs)("div",{children:[r==="intro"&&(0,ye.jsx)("button",{type:"button",onClick:m,className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.intent.onboarding.startFilling")}),typeof r=="number"&&r<5&&(0,ye.jsx)("button",{type:"button",onClick:m,disabled:g,className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:n("pages.intent.wizard.next")}),r===5&&(0,ye.jsx)("button",{type:"button",onClick:m,disabled:g,className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:n("pages.intent.wizard.review")}),r==="finish"&&(0,ye.jsx)("button",{type:"button",onClick:()=>e(o),className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:n("pages.intent.wizard.complete")})]})]}),l&&(0,ye.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/40 backdrop-blur-sm",role:"alertdialog","aria-modal":"true","aria-labelledby":"discard-title",onClick:()=>c(!1),children:(0,ye.jsxs)("div",{className:"bg-surface border border-line rounded-[8px] p-5 max-w-[400px] w-full mx-4",onClick:h=>h.stopPropagation(),children:[(0,ye.jsx)("p",{id:"discard-title",className:"text-ink text-[14px] font-semibold mb-2",children:n("pages.intent.wizard.discardConfirmTitle")}),(0,ye.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-4",children:n("pages.intent.wizard.discardConfirmBody")}),(0,ye.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,ye.jsx)("button",{type:"button",onClick:()=>c(!1),className:"border border-line bg-surface text-ink-2 rounded-[4px] px-3 py-1.5 text-[12px] hover:border-line-2 transition-colors",children:n("pages.intent.wizard.discardConfirmCancel")}),(0,ye.jsx)("button",{type:"button",onClick:()=>{c(!1),a()},className:"bg-red-600 text-white rounded-[4px] px-3 py-1.5 text-[12px] hover:bg-red-700 transition-colors",children:n("pages.intent.wizard.discardConfirmConfirm")})]})]})})]})})}function l2({initialContent:e,onSaved:t,onCancel:a,lang:n}){let{t:r}=X(),[i,o]=(0,Ba.useState)(()=>{let g=vl(e);return{why:g.why??"",desiredOutcome:g.desiredOutcome??"",nonNegotiables:g.nonNegotiables??"",stopEscalation:g.stopEscalation??"",currentStrategicFocus:g.currentStrategicFocus??""}}),[s,l]=(0,Ba.useState)(!1),[c,u]=(0,Ba.useState)(!1),d=(0,Ba.useRef)(null);(0,Ba.useEffect)(()=>{d.current?.focus()},[]);let f=(0,Ba.useMemo)(()=>vl(e),[e]),m=(0,Ba.useMemo)(()=>{for(let g of cf){let h=si[g],x=i[h]??"",y=f[h]??"";if(x!==y)return!0}return!1},[i,f]);function p(g,h){o(x=>({...x,[g]:h}))}async function b(){if(!m||s)return;if(cf.every(y=>{let C=si[y];return(i[C]??"").trim().length===0})){U.error(r("pages.intent.editor.emptyContent"));return}let h=Bg(i);l(!0);let x=await Kx(h,n);if(l(!1),!x.success){x.reason==="oversized"?U.error(r("pages.intent.editor.oversized")):U.error(r("pages.intent.editor.saveFailed"));return}U.success(r("pages.intent.editor.saveSuccess")),t()}function v(){m?u(!0):a()}return(0,ye.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,ye.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,ye.jsxs)("div",{children:[(0,ye.jsx)("h3",{id:"section-editor",className:"text-[15px] font-semibold text-ink mb-0.5",children:r("pages.intent.editor.title")}),(0,ye.jsx)("p",{className:"text-ink-3 text-[12px] leading-relaxed",children:r("pages.intent.editor.description")})]})}),(0,ye.jsx)("div",{className:"space-y-4",children:cf.map((g,h)=>{let x=si[g],y=i[x]??"";return(0,ye.jsxs)("div",{children:[(0,ye.jsx)("label",{htmlFor:`intent-section-${x}`,className:"block font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-1",children:r(`pages.intent.wizard.stepLabels.${x}`)}),(0,ye.jsx)("p",{className:"text-ink-3 text-[12px] leading-relaxed mb-1.5",children:r(`pages.intent.wizard.guidance.${x}`)}),(0,ye.jsx)("textarea",{ref:h===0?d:void 0,id:`intent-section-${x}`,value:y,onChange:C=>p(x,C.target.value),className:"w-full h-[120px] bg-surface border border-line rounded-[4px] p-3 text-[13px] text-ink leading-relaxed resize-y focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov/30",spellCheck:!1,"aria-label":r(`pages.intent.wizard.stepLabels.${x}`)})]},g)})}),(0,ye.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-4",children:[(0,ye.jsx)("button",{type:"button",onClick:v,disabled:s,className:"border border-line bg-surface text-ink-2 rounded-[4px] px-4 py-2 text-[13px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:r("pages.intent.editor.cancel")}),(0,ye.jsx)("button",{type:"button",onClick:b,disabled:!m||s,className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:r(s?"pages.intent.editor.saving":"pages.intent.editor.save")})]}),c&&(0,ye.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/40 backdrop-blur-sm",role:"alertdialog","aria-modal":"true","aria-labelledby":"discard-title",onClick:()=>u(!1),children:(0,ye.jsxs)("div",{className:"bg-surface border border-line rounded-[8px] p-5 max-w-[400px] w-full mx-4",onClick:g=>g.stopPropagation(),children:[(0,ye.jsx)("p",{id:"discard-title",className:"text-ink text-[14px] mb-4",children:r("pages.intent.editor.confirmDiscard")}),(0,ye.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,ye.jsx)("button",{type:"button",onClick:()=>u(!1),className:"border border-line bg-surface text-ink-2 rounded-[4px] px-3 py-1.5 text-[12px] hover:border-line-2 transition-colors",children:r("pages.intent.editor.no")}),(0,ye.jsx)("button",{type:"button",onClick:()=>{u(!1),a()},className:"bg-red-600 text-white rounded-[4px] px-3 py-1.5 text-[12px] hover:bg-red-700 transition-colors",children:r("pages.intent.editor.yes")})]})]})})]})}function c2({onCreated:e,showOnboarding:t=!1,lang:a}){let{t:n}=X(),[r,i]=(0,Ba.useState)(!1),[o,s]=(0,Ba.useState)(t&&!i2());async function l(p){if(i(!0),!(await Wx(!1,a)).success){i(!1),U.error(n("pages.intent.notFound.createFailed"));return}let v=Bg(p),g=await Kx(v,a);if(i(!1),!g.success){g.reason==="oversized"?U.error(n("pages.intent.editor.oversized")):U.error(n("pages.intent.editor.saveFailed")),e(!0);return}U.success(n("pages.intent.notFound.createSuccess")),e(!1)}async function c(){i(!0);let p=await Wx(!1,a);return i(!1),p.success?(U.success(n("pages.intent.notFound.createSuccess")),!0):(U.error(n("pages.intent.notFound.createFailed")),!1)}function u(p){s(!1),o2(),l(p)}function d(){s(!1),o2(),c().then(p=>{p&&e(!1)})}function f(){s(!1)}function m(){t&&!i2()?s(!0):c().then(p=>{p&&e(!0)})}return(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)("button",{type:"button",onClick:m,disabled:r,className:"bg-gov text-paper rounded-[4px] px-4 py-2 text-[13px] font-medium hover:bg-gov-dark transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:n(r?"pages.intent.notFound.creating":"pages.intent.notFound.createButton")}),o&&(0,ye.jsx)(HV,{onComplete:u,onSkip:d,onClose:f})]})}function d2({onClick:e,loading:t=!1}){let{t:a}=X();return(0,ye.jsx)("button",{type:"button",onClick:e,disabled:t,"aria-busy":t,className:"border border-line bg-surface text-ink-2 rounded-[4px] px-3 py-1.5 text-[12px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:border-line",children:a(t?"common.loading":"pages.intent.editor.edit")})}var K=D(W(),1);function zV({enabled:e}){let{t}=X(),a=t(e?"pages.intent.flagStatus.enabled":"pages.intent.flagStatus.disabled");return(0,K.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-[3px] text-[11px] font-mono border ${e?"border-emerald/40 text-emerald bg-emerald/5":"border-line text-ink-3 bg-surface"}`,role:"status","aria-label":t("pages.intent.flagStatus.ariaLabel"),children:[(0,K.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${e?"bg-emerald":"bg-ink-4"}`,"aria-hidden":"true"}),a]})}function qV({filePath:e}){let{t}=X();return(0,K.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-4",children:[(0,K.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2",children:t("pages.intent.editEntry.title")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-2",children:t("pages.intent.editEntry.description")}),(0,K.jsxs)("div",{className:"flex items-center gap-2",children:[(0,K.jsx)("code",{className:"text-[12px] text-ink-2 bg-surface border border-line rounded-[3px] px-2 py-1 break-all",children:e}),(0,K.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e)},className:"shrink-0 border border-line bg-surface text-ink-2 rounded-[3px] px-2 py-1 text-[11px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2","aria-label":t("pages.intent.editEntry.copyAriaLabel"),children:t("pages.intent.editEntry.copy")})]})]})}function VV({flagEnabled:e,onAfterEnable:t}){let{t:a}=X(),[n,r]=(0,Zt.useState)(!1),[i,o]=(0,Zt.useState)(!1);return e||i?null:(0,K.jsxs)("div",{className:"bg-panel border border-amber/20 border-l-2 border-l-amber rounded-[6px] p-4 mb-5",children:[(0,K.jsx)("h2",{className:"text-ink text-[15px] font-semibold mb-2",children:a("pages.intent.flagDisabled.title")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:a("pages.intent.flagDisabled.description")}),(0,K.jsx)("button",{type:"button",disabled:n,onClick:async()=>{r(!0);try{let s=await Lu("intent_engineering",!0);if(!s.success){U.error(s.error??a("pages.intent.flagStatus.enableFailed"));return}o(!0),t?.()}finally{r(!1)}},className:"border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2","aria-label":a("pages.intent.flagStatus.enable"),children:a(n?"pages.intent.flagStatus.enabling":"pages.intent.flagStatus.enable")})]})}function GV({onCreated:e,lang:t}){let{t:a}=X();return(0,K.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5",children:[(0,K.jsx)("h2",{className:"text-ink text-[15px] font-semibold mb-2",children:a("pages.intent.notFound.title")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:a("pages.intent.notFound.description")}),(0,K.jsxs)("div",{className:"flex items-center gap-3",children:[(0,K.jsx)(c2,{onCreated:e,showOnboarding:!0,lang:t}),(0,K.jsx)("span",{className:"text-ink-4 text-[12px] font-mono",children:a("pages.intent.notFound.nextAction")})]})]})}function $V(){let{t:e}=X();return(0,K.jsxs)("div",{className:"bg-panel border border-amber/30 rounded-[6px] p-5",children:[(0,K.jsx)("h2",{className:"text-ink text-[15px] font-semibold mb-2",children:e("pages.intent.oversized.title")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.intent.oversized.description")}),(0,K.jsx)("div",{className:"font-mono text-[12px] text-ink-2 bg-surface border border-line rounded-[3px] px-3 py-2",children:e("pages.intent.oversized.nextAction")})]})}function WV({warning:e}){let{t}=X(),a=`pages.intent.warnings.${e.code}`;return(0,K.jsxs)("li",{className:"flex items-start gap-2 text-ink-2 text-[13px]",children:[(0,K.jsx)("span",{className:"text-amber shrink-0 mt-0.5","aria-hidden":"true",children:"!"}),(0,K.jsxs)("span",{children:[(0,K.jsx)("span",{className:"font-medium",children:t(a)}),e.section&&(0,K.jsxs)("span",{className:"text-ink-3 font-mono ml-2",children:["[",e.section,"]"]})]})]})}function df({label:e,content:t}){return t===void 0||t.trim()===""?null:(0,K.jsxs)("div",{children:[(0,K.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-1.5",children:e}),(0,K.jsx)("p",{className:"text-ink-2 text-[13px] leading-relaxed whitespace-pre-wrap",children:t})]})}function Kw({label:e,value:t}){return(0,K.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,K.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 w-32 shrink-0",children:e}),(0,K.jsx)("span",{className:"text-ink-2 text-[12px] font-mono break-all",children:t})]})}function KV({version:e,previousContent:t,reasonLabel:a,defaultExpanded:n=!1}){let{t:r,i18n:i}=X(),[o,s]=(0,Zt.useState)(n),l=Ww(t,e.contentSnapshot),c=ba(e.createdAt,i.language,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return(0,K.jsxs)("div",{className:"border-b border-line last:border-b-0",children:[(0,K.jsxs)("button",{type:"button",onClick:()=>s(u=>!u),className:"w-full flex items-center gap-3 py-1.5 text-[12px] font-mono text-ink-2 hover:bg-surface-2/50 transition-colors text-left","aria-expanded":o,"aria-label":r(o?"pages.intent.versionDiff.collapseHint":"pages.intent.versionDiff.expandHint"),title:e.contentHash,children:[(0,K.jsx)("span",{className:"text-ink-3 shrink-0 w-4 inline-block",children:o?"\u25BE":"\u25B8"}),(0,K.jsx)("span",{className:"text-ink-3 shrink-0",children:c}),(0,K.jsx)("span",{className:"px-1.5 py-0.5 rounded-[2px] bg-surface-2 text-ink-3 shrink-0",children:a}),(0,K.jsx)("span",{className:"text-ink-4 text-[11px] ml-auto shrink-0 hidden sm:inline",children:r(o?"pages.intent.versionDiff.collapseHint":"pages.intent.versionDiff.expandHint")})]}),o&&(0,K.jsx)("div",{className:"pb-2.5 pl-7 pr-2",children:(0,K.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:l.map(u=>{let d=`pages.intent.wizard.stepLabels.${u.section}`;return(0,K.jsxs)("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-[2px] text-[11px] font-mono border ${u.changed?"border-amber/40 text-amber bg-amber/5":"border-line text-ink-3 bg-surface"}`,children:[(0,K.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${u.changed?"bg-amber":"bg-ink-4"}`,"aria-hidden":"true"}),r(d),(0,K.jsx)("span",{className:"text-ink-4 ml-0.5",children:u.changed?r("pages.intent.versionDiff.changed"):r("pages.intent.versionDiff.unchanged")})]},u.section)})})})]})}var YV=[{action:"confirm_drift",labelKey:"pages.intent.decisions.countConfirmDrift"},{action:"revise_intent",labelKey:"pages.intent.decisions.countReviseIntent"},{action:"observe",labelKey:"pages.intent.decisions.countObserve"},{action:"dismiss",labelKey:"pages.intent.decisions.countDismiss"},{action:"promote_to_principle",labelKey:"pages.intent.decisions.countPromoteToPrinciple"},{action:"promote_to_rulehost",labelKey:"pages.intent.decisions.countPromoteToRulehost"}];function XV(){let{t:e}=X(),[t,a]=(0,Zt.useState)("loading"),[n,r]=(0,Zt.useState)(null),i=(0,Zt.useCallback)(async()=>{a("loading");let o=await LL();if(!o.success){a("error");return}r(o.data),a("loaded")},[]);return(0,Zt.useEffect)(()=>{i()},[i]),(0,K.jsxs)("section",{className:"mt-8","aria-labelledby":"section-decisions",children:[(0,K.jsx)(me,{id:"section-decisions",children:e("pages.intent.decisions.sectionTitle")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3",children:e("pages.intent.decisions.sectionSubtitle")}),t==="loading"&&(0,K.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-4 text-ink-3 text-[13px]",children:e("common.loading")}),t==="error"&&(0,K.jsx)("div",{className:"bg-panel border border-line rounded-[6px] p-4 text-ink-3 text-[13px]",children:e("pages.intent.decisions.loadError")}),t==="loaded"&&n&&(0,K.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-4",children:[(0,K.jsx)("dl",{className:"grid grid-cols-2 gap-x-6 gap-y-2 sm:grid-cols-3",children:YV.map(({action:o,labelKey:s})=>{let l=n.counts[o];return(0,K.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,K.jsx)("dt",{className:"text-ink-3 text-[12px]",children:e(s)}),(0,K.jsx)("dd",{className:"text-ink font-mono text-[13px]",children:l})]},o)})}),(0,K.jsx)("div",{className:"mt-4 pt-3 border-t border-line",children:n.lastDecisionAt===null?(0,K.jsx)("p",{className:"text-ink-4 text-[12px]",children:e("pages.intent.decisions.noDecisions")}):(0,K.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,K.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3",children:e("pages.intent.decisions.lastDecisionAtLabel")}),(0,K.jsx)("span",{className:"text-ink-2 text-[12px] font-mono break-all",children:n.lastDecisionAt})]})})]})]})}function u2(){let{t:e}=X(),[t,a]=(0,Zt.useState)(null),[n,r]=(0,Zt.useState)("loading"),[i,o]=(0,Zt.useState)(null),[s,l]=(0,Zt.useState)(!1),[c,u]=(0,Zt.useState)(""),[d,f]=(0,Zt.useState)(!1),[m,p]=(0,Zt.useState)("zh-CN"),[b,v]=(0,Zt.useState)([]),g=(0,Zt.useCallback)(k=>k==="init"?e("pages.intent.versionHistory.reasonInit"):k==="save"?e("pages.intent.versionHistory.reasonSave"):k,[e]),h=(0,Zt.useCallback)(async()=>{r("loading"),o(null);let k=await CL(m);if(!k.success){o(k.error??e("pages.intent.loadError")),r("error");return}a(k.data),r("loaded"),RL(m).then(T=>{T.success&&T.data?.versions&&v(T.data.versions)}).catch(()=>{})},[e,m]);(0,Zt.useEffect)(()=>{h()},[h]),(0,Zt.useEffect)(()=>{l(!1),u(""),v([])},[m]);let x=(0,Zt.useCallback)(async()=>{f(!0);let k=await $x(m);if(f(!1),!k.success){U.error(e("pages.intent.loadError"));return}u(k.data.content),l(!0)},[e,m]),y=(0,Zt.useCallback)(async k=>{if(await h(),!k)return;f(!0);let T=await $x(m);f(!1),T.success&&(u(T.data.content),l(!0))},[h,m]),C=(0,Zt.useCallback)(()=>{l(!1),h()},[h]),A=(0,Zt.useCallback)(()=>{l(!1)},[]);if(n==="loading")return(0,K.jsx)(Me,{children:(0,K.jsx)(It,{cardCount:3,label:e("common.loading")})});if(n==="error")return(0,K.jsxs)(Me,{children:[(0,K.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.intent.eyebrow")}),(0,K.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:e("pages.intent.title")}),(0,K.jsxs)("div",{className:"mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm",children:[(0,K.jsx)("p",{children:e("pages.intent.loadError")}),i&&(0,K.jsx)("p",{className:"mt-2 text-ink-4 text-[13px] font-mono",children:i})]}),(0,K.jsx)("div",{className:"mt-4",children:(0,K.jsx)("button",{type:"button",onClick:h,className:"border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2",children:e("common.refresh")})})]});let I=t;return(0,K.jsx)(Me,{children:(0,K.jsxs)("div",{className:"animate-[pdFadeIn_400ms_ease-out]",children:[(0,K.jsx)("div",{className:"font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3",children:e("pages.intent.eyebrow")}),(0,K.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,K.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink",children:e("pages.intent.title")}),I&&(0,K.jsx)(zV,{enabled:I.flagEnabled}),(0,K.jsxs)("select",{value:m,onChange:k=>p(k.target.value),disabled:s||d,className:"ml-auto border border-line bg-surface text-ink-2 rounded-[3px] px-2 py-1 text-[12px] font-mono focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":e("pages.intent.langSelector.ariaLabel"),title:s||d?e("pages.intent.langSelector.disabledWhileEditing"):void 0,children:[(0,K.jsx)("option",{value:"zh-CN",children:"\u4E2D\u6587"}),(0,K.jsx)("option",{value:"en",children:"English"})]})]}),(0,K.jsx)("p",{className:"text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7",children:e("pages.intent.subtitle")}),I&&!I.flagEnabled&&(0,K.jsx)(VV,{flagEnabled:I.flagEnabled,onAfterEnable:h}),I&&I.flagEnabled&&!I.found&&I.reason==="not_found"&&(0,K.jsx)(GV,{onCreated:y,lang:m}),I&&I.flagEnabled&&I.found&&I.reason==="oversized"&&(0,K.jsx)($V,{}),I&&I.flagEnabled&&I.ok&&I.sections&&(0,K.jsxs)(K.Fragment,{children:[s&&(0,K.jsx)("section",{"aria-labelledby":"section-editor",className:"mb-8",children:(0,K.jsx)(l2,{initialContent:c,onSaved:C,onCancel:A,lang:m})}),!s&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("section",{"aria-labelledby":"section-content",children:[(0,K.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,K.jsx)(me,{id:"section-content",children:e("pages.intent.title")}),(0,K.jsx)(d2,{onClick:x,loading:d})]}),(0,K.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-5 space-y-5",children:[(0,K.jsx)(df,{label:e("pages.intent.sections.why"),content:I.sections.why}),(0,K.jsx)(df,{label:e("pages.intent.sections.desiredOutcome"),content:I.sections.desiredOutcome}),(0,K.jsx)(df,{label:e("pages.intent.sections.nonNegotiables"),content:I.sections.nonNegotiables}),(0,K.jsx)(df,{label:e("pages.intent.sections.stopEscalation"),content:I.sections.stopEscalation}),(0,K.jsx)(df,{label:e("pages.intent.sections.currentStrategicFocus"),content:I.sections.currentStrategicFocus})]})]}),(0,K.jsxs)("section",{className:"mt-8","aria-labelledby":"section-warnings",children:[(0,K.jsx)(me,{id:"section-warnings",children:e("pages.intent.warnings.title")}),I.warnings.length===0?(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed",children:e("pages.intent.warnings.empty")}):(0,K.jsx)("ul",{className:"bg-panel border border-line rounded-[6px] p-4 space-y-2",children:I.warnings.map((k,T)=>(0,K.jsx)(WV,{warning:k},T))})]}),(0,K.jsxs)("section",{className:"mt-8","aria-labelledby":"section-meta",children:[(0,K.jsx)(me,{id:"section-meta",children:e("pages.intent.meta.title")}),(0,K.jsxs)("div",{className:"bg-panel border border-line rounded-[6px] p-4 space-y-2",children:[I.lastEditedAt&&(0,K.jsx)(Kw,{label:e("pages.intent.meta.lastEditedAt"),value:I.lastEditedAt}),I.contentHash&&(0,K.jsx)(Kw,{label:e("pages.intent.meta.contentHash"),value:I.contentHash}),I.path&&(0,K.jsx)(Kw,{label:e("pages.intent.meta.path"),value:I.path})]})]}),I.path&&(0,K.jsxs)("section",{className:"mt-8","aria-labelledby":"section-edit",children:[(0,K.jsx)(me,{id:"section-edit",children:e("pages.intent.editEntry.heading")}),(0,K.jsx)(qV,{filePath:I.path})]})]})]}),I&&I.flagEnabled&&!I.ok&&I.reason&&I.reason!=="not_found"&&I.reason!=="oversized"&&(0,K.jsxs)("div",{className:"bg-panel border border-red-200 rounded-[6px] p-5",children:[(0,K.jsx)("h2",{className:"text-ink text-[15px] font-semibold mb-2",children:e("pages.intent.loadError")}),(0,K.jsx)("p",{className:"text-ink-3 text-[13px] leading-relaxed mb-3 font-mono",children:I.reason}),I.nextAction&&(0,K.jsx)("p",{className:"text-ink-2 text-[13px] leading-relaxed",children:I.nextAction})]}),I&&I.flagEnabled&&(0,K.jsx)(XV,{}),b.length>0&&(0,K.jsxs)("details",{className:"border border-line rounded-[3px] mt-6",children:[(0,K.jsxs)("summary",{className:"cursor-pointer px-4 py-2 text-[13px] font-medium text-ink-2 select-none",children:[e("pages.intent.versionHistory.title")," (",b.length,")"]}),(0,K.jsx)("div",{className:"px-4 py-2 border-t border-line",children:b.map((k,T)=>{let _=b[T+1]?.contentSnapshot??"";return(0,K.jsx)(KV,{version:k,previousContent:_,reasonLabel:g(k.reason),defaultExpanded:T===0},k.id)})})]})]})})}var he=D(W(),1),ZV=[{name:"--paper",value:"#f7f3ea"},{name:"--paper-2",value:"#f2ede3"},{name:"--surface",value:"#fbf8f0"},{name:"--panel",value:"#fffdf7"},{name:"--ink",value:"#1f2933"},{name:"--ink-2",value:"#384150"},{name:"--ink-3",value:"#525966"},{name:"--ink-4",value:"#5F6774"},{name:"--line",value:"#d7d1c4"},{name:"--line-2",value:"#c7bfaf"},{name:"--gov",value:"#1e3a5f"},{name:"--gov-2",value:"#2f557f"},{name:"--amber",value:"#a66a2a"},{name:"--green",value:"#4d6b52"},{name:"--danger",value:"#8b3a3a"}];function f2(){return(0,he.jsxs)(Me,{children:[(0,he.jsx)(me,{children:"Design System Preview"}),(0,he.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink mb-2",children:"Warm Paper + Blueprint"}),(0,he.jsx)("p",{className:"text-ink-3 text-sm mb-8",children:"Visual regression anchor for CR1. All tokens and component states rendered here."}),(0,he.jsx)(me,{children:"Color Palette"}),(0,he.jsx)("div",{className:"grid grid-cols-5 gap-3 mb-8",children:ZV.map(({name:e,value:t})=>(0,he.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,he.jsx)("div",{className:"w-full h-12 rounded-[var(--radius-md)] border border-line",style:{backgroundColor:t}}),(0,he.jsx)("span",{className:"font-mono text-[10px] text-ink-3",children:e}),(0,he.jsx)("span",{className:"font-mono text-[10px] text-ink-4",children:t})]},e))}),(0,he.jsx)(me,{children:"Buttons"}),(0,he.jsxs)("div",{className:"flex flex-wrap gap-3 mb-8 items-center",children:[(0,he.jsx)(pe,{variant:"default",children:"Primary (Gov)"}),(0,he.jsx)(pe,{variant:"outline",children:"Outline"}),(0,he.jsx)(pe,{variant:"ghost",children:"Ghost"}),(0,he.jsx)(pe,{variant:"quiet",children:"Quiet"}),(0,he.jsx)(pe,{variant:"secondary",children:"Secondary"}),(0,he.jsx)(pe,{variant:"destructive",children:"Destructive"}),(0,he.jsx)(pe,{variant:"link",children:"Link"}),(0,he.jsx)(pe,{variant:"default",disabled:!0,children:"Disabled"}),(0,he.jsx)(pe,{variant:"default",size:"sm",children:"Small"}),(0,he.jsx)(pe,{variant:"default",size:"lg",children:"Large"})]}),(0,he.jsx)(me,{children:"Cards"}),(0,he.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[(0,he.jsxs)(Or,{children:[(0,he.jsxs)(hs,{children:[(0,he.jsx)(bs,{children:"Default Card"}),(0,he.jsx)(wg,{children:"With shadow, hover deepens border + shadow. No transform."})]}),(0,he.jsx)(Tr,{children:(0,he.jsxs)("p",{className:"text-sm text-ink-3",children:["Cards use ",(0,he.jsx)("code",{className:"font-mono text-[11px] bg-paper-2 px-1 rounded-[2px]",children:"--shadow-card"})," and hover with deeper shadow. No translateY or scale on hover (B.4.4)."]})}),(0,he.jsx)(tw,{children:(0,he.jsx)(pe,{variant:"default",size:"sm",children:"Action"})})]}),(0,he.jsxs)(Or,{children:[(0,he.jsxs)(hs,{children:[(0,he.jsx)(bs,{children:"Card with Badges"}),(0,he.jsx)(wg,{children:"Status labels in Blueprint style"})]}),(0,he.jsxs)(Tr,{children:[(0,he.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,he.jsx)(la,{variant:"default",children:"\u5F85\u5BA1\u67E5"}),(0,he.jsx)(la,{variant:"amber",children:"\u9700\u6CE8\u610F"}),(0,he.jsx)(la,{variant:"green",children:"\u7A33\u5B9A"}),(0,he.jsx)(la,{variant:"destructive",children:"\u98CE\u9669"}),(0,he.jsx)(la,{variant:"secondary",children:"\u5DF2\u5F52\u6863"}),(0,he.jsx)(la,{variant:"outline",children:"\u5DF2\u6682\u5B58"})]}),(0,he.jsx)("p",{className:"text-sm text-ink-3",children:"Badges: 2px border-radius, mono font, 11px, low saturation (B.4.5)."})]})]})]}),(0,he.jsx)(me,{children:"Badges / Status Labels"}),(0,he.jsxs)("div",{className:"flex flex-wrap gap-3 mb-8",children:[(0,he.jsx)(la,{variant:"default",children:"\u5F85\u5BA1\u67E5"}),(0,he.jsx)(la,{variant:"amber",children:"\u9700\u6CE8\u610F"}),(0,he.jsx)(la,{variant:"green",children:"\u7A33\u5B9A"}),(0,he.jsx)(la,{variant:"destructive",children:"\u98CE\u9669"}),(0,he.jsx)(la,{variant:"secondary",children:"\u5DF2\u5F52\u6863"}),(0,he.jsx)(la,{variant:"outline",children:"\u5DF2\u6682\u5B58"})]}),(0,he.jsx)(me,{children:"Empty State"}),(0,he.jsx)(Or,{className:"mb-8",children:(0,he.jsxs)(Tr,{className:"py-12 text-center",children:[(0,he.jsx)("p",{className:"text-ink-3 text-sm mb-2",children:"\u8FD8\u6CA1\u6709\u53EF\u5BA1\u67E5\u539F\u5219\u3002\u5F53 PD \u6355\u83B7\u5230\u884C\u4E3A\u504F\u5DEE\u4FE1\u53F7\u65F6\uFF0C\u4F1A\u5728\u8FD9\u91CC\u751F\u6210\u539F\u5219\u5019\u9009\uFF0C\u7B49\u5F85\u4F60\u5BA1\u67E5\u3002"}),(0,he.jsx)(pe,{variant:"outline",size:"sm",children:"\u4E86\u89E3\u66F4\u591A"})]})}),(0,he.jsx)(me,{children:"Error State"}),(0,he.jsx)(Or,{className:"mb-8",children:(0,he.jsxs)(Tr,{className:"py-8",children:[(0,he.jsx)("p",{className:"text-ink-3 text-sm mb-2",children:"\u65E0\u6CD5\u52A0\u8F7D\u8FD9\u6761\u539F\u5219\u7684\u8BC1\u636E\u6765\u6E90\u3002\u539F\u5219\u672C\u8EAB\u672A\u53D7\u5F71\u54CD\u3002\u4F60\u53EF\u4EE5\u7A0D\u540E\u91CD\u8BD5\uFF0C\u6216\u6682\u65F6\u4FDD\u7559\u5728\u5F85\u5BA1\u67E5\u72B6\u6001\u3002"}),(0,he.jsx)(pe,{variant:"outline",size:"sm",children:"\u91CD\u8BD5"})]})}),(0,he.jsx)(me,{children:"Typography"}),(0,he.jsxs)("div",{className:"space-y-3 mb-8",children:[(0,he.jsx)("h1",{className:"text-[29px] font-semibold tracking-tight text-ink",children:"Page Title \u2014 29px"}),(0,he.jsx)("h2",{className:"text-[17px] font-semibold tracking-tight text-ink",children:"Card Title \u2014 17px"}),(0,he.jsx)("h3",{className:"text-[13px] font-semibold text-ink-2",children:"Section Title \u2014 13px"}),(0,he.jsx)("p",{className:"text-[15px] text-ink leading-relaxed",children:"Body text \u2014 15px. The quick brown fox jumps over the lazy dog. \u6570\u5B57\u4F7F\u7528 tabular-nums: 1,234,567."}),(0,he.jsx)("p",{className:"text-[14px] text-ink-2",children:"Card body \u2014 14px"}),(0,he.jsx)("p",{className:"text-[13px] text-ink-3",children:"Auxiliary text \u2014 13px"}),(0,he.jsx)("p",{className:"font-mono text-[11px] tracking-[0.1em] uppercase text-ink-3",children:"EYEBROW / LABEL \u2014 11PX MONO"}),(0,he.jsx)("p",{className:"font-mono text-[11px] text-ink-4",children:"Metadata / timestamp \u2014 11px mono"})]}),(0,he.jsx)(me,{children:"Layout \u2014 712px Container"}),(0,he.jsx)("p",{className:"text-sm text-ink-3 mb-4",children:"This page is already inside a PageShell (712px centered). The blueprint grid is visible on the body background."}),(0,he.jsx)("div",{className:"border border-dashed border-line-2 p-4 text-center text-ink-4 text-xs font-mono",children:"\u2190 712px max-width \u2192"})]})}var ca=D(ee(),1);var In=D(W(),1),at=[{id:"evidence",labelKey:"pages.welcome.step1.circuitNodes.evidence",cx:80,cy:80},{id:"principle",labelKey:"pages.welcome.step1.circuitNodes.principle",cx:240,cy:80},{id:"ownerGate",labelKey:"pages.welcome.step1.circuitNodes.ownerGate",cx:240,cy:180},{id:"behavior",labelKey:"pages.welcome.step1.circuitNodes.behavior",cx:80,cy:180}];function p2({highlightNode:e=null,compact:t=!1}){let{t:a}=X(),n=t?240:320,r=t?28:36;return(0,In.jsx)("div",{className:"circuit-diagram",role:"img","aria-label":a("pages.welcome.step1.circuitLabel"),children:(0,In.jsxs)("svg",{width:n,height:n*.75,viewBox:"0 0 320 240",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,In.jsx)("line",{x1:at[0].cx,y1:at[0].cy,x2:at[1].cx,y2:at[1].cy,stroke:"var(--color-gov)",strokeWidth:"1.5"}),(0,In.jsx)("line",{x1:at[1].cx,y1:at[1].cy,x2:at[2].cx,y2:at[2].cy,stroke:"var(--color-gov)",strokeWidth:"1.5"}),(0,In.jsx)("line",{x1:at[2].cx,y1:at[2].cy,x2:at[3].cx,y2:at[3].cy,stroke:"var(--color-gov)",strokeWidth:"1.5"}),(0,In.jsx)("line",{x1:at[3].cx,y1:at[3].cy,x2:at[0].cx,y2:at[0].cy,stroke:"var(--color-gov)",strokeWidth:"1.5"}),(0,In.jsx)("polygon",{points:`${at[1].cx-8},${at[1].cy-4} ${at[1].cx-8},${at[1].cy+4} ${at[1].cx},${at[1].cy}`,fill:"var(--color-gov)"}),(0,In.jsx)("polygon",{points:`${at[2].cx+4},${at[2].cy-8} ${at[2].cx-4},${at[2].cy-8} ${at[2].cx},${at[2].cy}`,fill:"var(--color-gov)"}),(0,In.jsx)("polygon",{points:`${at[3].cx+8},${at[3].cy-4} ${at[3].cx+8},${at[3].cy+4} ${at[3].cx},${at[3].cy}`,fill:"var(--color-gov)"}),(0,In.jsx)("polygon",{points:`${at[0].cx-4},${at[0].cy+8} ${at[0].cx+4},${at[0].cy+8} ${at[0].cx},${at[0].cy}`,fill:"var(--color-gov)"}),at.map(i=>{let o=e===i.id,s=i.id==="ownerGate";return(0,In.jsxs)("g",{children:[(0,In.jsx)("circle",{cx:i.cx,cy:i.cy,r,fill:o?"var(--color-gov)":"var(--color-surface)",stroke:s?"var(--color-gov)":"var(--color-border)",strokeWidth:s?2.5:1.5}),(0,In.jsx)("text",{x:i.cx,y:i.cy,textAnchor:"middle",dominantBaseline:"middle",fontSize:t?9:11,fill:o?"white":"var(--color-ink)",fontFamily:"var(--font-sans)",children:a(i.labelKey)})]},i.id)})]})})}var ia=D(W(),1),QV={evidence_seed:"pages.welcome.step2.stages.evidenceSeed",principle_proposal:"pages.welcome.step2.stages.principleProposal",owner_review:"pages.welcome.step2.stages.ownerReview",activation:"pages.welcome.step2.stages.activation",follow_up_observation:"pages.welcome.step2.stages.followUpObservation",rollback_proof:"pages.welcome.step2.stages.rollbackProof"};function JV(e,t){let a=QV[e];return a?t(a):e}function m2({result:e,loading:t,error:a}){let{t:n}=X();return t?(0,ia.jsx)("div",{className:"demo-result-view demo-loading",role:"status","aria-live":"polite",children:(0,ia.jsx)("span",{className:"demo-status-text",children:n("pages.welcome.step2.demoRunning")})}):a?(0,ia.jsxs)("div",{className:"demo-result-view demo-error",role:"alert",children:[(0,ia.jsx)("span",{className:"demo-status-text",children:n("pages.welcome.step2.demoFailed")}),(0,ia.jsx)("p",{className:"demo-error-detail",children:a})]}):e?(0,ia.jsxs)("div",{className:"demo-result-view",role:"region","aria-label":n("pages.welcome.step2.demoComplete"),children:[e.simulated&&(0,ia.jsx)("div",{className:"demo-simulated-banner",role:"note",children:n("pages.welcome.step2.demoSimulatedNote")}),e.stages&&e.stages.length>0&&(0,ia.jsx)("ol",{className:"demo-stages",children:e.stages.map((r,i)=>(0,ia.jsxs)("li",{className:`demo-stage demo-stage-${r.status}`,children:[(0,ia.jsx)("span",{className:"demo-stage-name",children:JV(r.name,n)}),r.reason&&(0,ia.jsx)("span",{className:"demo-stage-detail",children:r.reason})]},i))}),(0,ia.jsxs)("div",{className:"demo-labels",children:[(0,ia.jsx)("div",{className:"demo-label-item",children:(0,ia.jsx)("span",{className:"demo-label-title",children:n("pages.welcome.step2.evidenceLabel")})}),(0,ia.jsx)("div",{className:"demo-label-item",children:(0,ia.jsx)("span",{className:"demo-label-title",children:n("pages.welcome.step2.candidateLabel")})}),(0,ia.jsx)("div",{className:"demo-label-item",children:(0,ia.jsx)("span",{className:"demo-label-title",children:n("pages.welcome.step2.ownerGateLabel")})}),(0,ia.jsx)("div",{className:"demo-label-item",children:(0,ia.jsx)("span",{className:"demo-label-title",children:n("pages.welcome.step2.activationLabel")})}),(0,ia.jsx)("div",{className:"demo-label-item",children:(0,ia.jsx)("span",{className:"demo-label-title",children:n("pages.welcome.step2.rollbackLabel")})})]})]}):null}var xo=D(W(),1);function g2({commands:e}){let{t}=X();return!e||e.length===0?(0,xo.jsx)("p",{className:"slash-commands-empty",role:"note",children:t("pages.welcome.step3.emptyListFallback")}):(0,xo.jsx)("ul",{className:"slash-commands-list",role:"list",children:e.map(a=>(0,xo.jsxs)("li",{className:"slash-command-item",children:[(0,xo.jsxs)("div",{className:"slash-command-header",children:[(0,xo.jsx)("code",{className:"slash-command-name",children:a.name}),a.alias&&(0,xo.jsx)("code",{className:"slash-command-alias",children:a.alias})]}),(0,xo.jsx)("p",{className:"slash-command-description",children:t(a.descriptionKey)})]},a.name))})}var h2=[{name:"/pd-init",alias:"/pdi",descriptionKey:"pages.welcome.step3.commandDescriptions.pdInit"},{name:"/pd-status",descriptionKey:"pages.welcome.step3.commandDescriptions.pdStatus"},{name:"/pd-pain",descriptionKey:"pages.welcome.step3.commandDescriptions.pdPain"},{name:"/pd-help",alias:"/pdh",descriptionKey:"pages.welcome.step3.commandDescriptions.pdHelp"},{name:"/pd-context",descriptionKey:"pages.welcome.step3.commandDescriptions.pdContext"},{name:"/pd-focus",descriptionKey:"pages.welcome.step3.commandDescriptions.pdFocus"}];var Pe=D(W(),1),e8=7200*1e3,t8=30*1e3;function a8(e){if(typeof e!="object"||e===null)return!1;let t=Object.hasOwn(e,"name")?Reflect.get(e,"name"):void 0,a=Object.hasOwn(e,"status")?Reflect.get(e,"status"):void 0;return typeof t!="string"?!1:a==="passed"||a==="failed"||a==="degraded"||a==="skipped"}function n8(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.simulated!="boolean"||typeof t.demo!="object"||t.demo===null)return null;let a=t.demo;if(typeof a.status!="string")return null;let n={status:a.status};if(typeof a.generatedAt=="string"&&(n.generatedAt=a.generatedAt),typeof a.narrative=="string"&&(n.narrative=a.narrative),typeof a.storyDescription=="string"&&(n.storyDescription=a.storyDescription),typeof a.simulated=="boolean"&&(n.simulated=a.simulated),Object.hasOwn(a,"stages")){if(!Array.isArray(a.stages)||!a.stages.every(a8))return null;n.stages=a.stages}return{demo:n,simulated:t.simulated}}function b2({workspaceId:e}){let{t}=X(),a=na(),[n,r]=(0,ca.useState)(1),[i,o]=(0,ca.useState)("idle"),[s,l]=(0,ca.useState)(null),[c,u]=(0,ca.useState)(null),[d,f]=(0,ca.useState)(null),[m,p]=(0,ca.useState)(!1),[b,v]=(0,ca.useState)("idle"),[g,h]=(0,ca.useState)(null),x=(0,ca.useRef)(null),y=(0,ca.useRef)(null),C=(0,ca.useRef)(0),A=(0,ca.useRef)(0);(0,ca.useEffect)(()=>{Og(e).completed&&a("/focus",{replace:!0})},[e,a]);let I=(0,ca.useCallback)(H=>{if(!TT(e,{completed:!0,step:4,status:H,completedAt:new Date().toISOString()})){f(t("pages.welcome.stateSaveError"));return}a("/focus",{replace:!0})},[e,a,t]),k=(0,ca.useCallback)(async()=>{o("loading"),u(null);try{let H=await J("/api/v1/onboarding/run-demo",{method:"POST"},n8);if(!H.success)throw new Error(H.error);l(H.data.demo),o("success")}catch(H){let Y=H instanceof Error?H.message:"Demo failed to start";u(Y),o("error")}},[]),T=(0,ca.useCallback)(()=>{I("skipped")},[I]),_=(0,ca.useCallback)(()=>{p(!1),x.current&&(clearInterval(x.current),x.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),M=(0,ca.useCallback)(()=>{p(!0),v("polling"),h(null),C.current=0,y.current=setTimeout(()=>{v("timeout"),_()},e8);let H=!1,Y=async()=>{try{let oe=await J("/api/v1/evidence-chain");if(!oe.success)throw new Error(oe.error||"Failed to fetch evidence");if(oe.data){let q=oe.data;if(typeof q=="object"&&q!==null&&Object.hasOwn(q,"records")){let R=q.records;if(Array.isArray(R)){if(C.current=0,!H){A.current=R.length,H=!0;return}R.length>A.current&&(v("evidence-found"),_())}}}}catch{C.current+=1,h(t("pages.welcome.step4.pollingError")),C.current>=3&&(v("error"),_())}};Y(),x.current=setInterval(Y,t8)},[_,t]);return(0,ca.useEffect)(()=>()=>{_()},[_]),(0,Pe.jsxs)("div",{className:"welcome-page",role:"main",children:[(0,Pe.jsxs)("header",{className:"welcome-header",children:[(0,Pe.jsx)("h1",{children:t("pages.welcome.title")}),(0,Pe.jsx)("p",{className:"welcome-subtitle",children:t("pages.welcome.subtitle")}),(0,Pe.jsx)("div",{className:"welcome-step-indicator",role:"progressbar","aria-valuetext":t("pages.welcome.stepIndicator",{current:n,total:4}),children:[1,2,3,4].map(H=>(0,Pe.jsx)("span",{className:`step-dot ${H===n?"active":""} ${H<n?"completed":""}`},H))})]}),d&&(0,Pe.jsx)("p",{className:"polling-error",role:"alert",children:d}),n===1&&(0,Pe.jsxs)("section",{className:"welcome-step welcome-step-1","aria-labelledby":"step1-title",children:[(0,Pe.jsx)("h2",{id:"step1-title",children:t("pages.welcome.step1.title")}),(0,Pe.jsx)("p",{children:t("pages.welcome.step1.description")}),(0,Pe.jsx)(p2,{}),(0,Pe.jsxs)("div",{className:"welcome-actions",children:[(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>r(2),children:t("pages.welcome.step1.startButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:T,children:t("pages.welcome.step1.skipButton")})]})]}),n===2&&(0,Pe.jsxs)("section",{className:"welcome-step welcome-step-2","aria-labelledby":"step2-title",children:[(0,Pe.jsx)("h2",{id:"step2-title",children:t("pages.welcome.step2.title")}),(0,Pe.jsx)("p",{children:t("pages.welcome.step2.description")}),(0,Pe.jsx)(m2,{result:s,loading:i==="loading",error:c}),(0,Pe.jsxs)("div",{className:"welcome-actions",children:[i==="idle"&&(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:k,children:t("pages.welcome.step2.runDemoButton")}),(i==="success"||i==="error")&&(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:()=>r(3),children:t("pages.welcome.step2.nextButton")})]})]}),n===3&&(0,Pe.jsxs)("section",{className:"welcome-step welcome-step-3","aria-labelledby":"step3-title",children:[(0,Pe.jsx)("h2",{id:"step3-title",children:t("pages.welcome.step3.title")}),(0,Pe.jsx)("p",{children:t("pages.welcome.step3.description")}),(0,Pe.jsx)("p",{className:"slash-commands-intro",children:t("pages.welcome.step3.commandsIntro")}),(0,Pe.jsx)(g2,{commands:h2}),(0,Pe.jsxs)("div",{className:"welcome-actions",children:[(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>r(4),children:t("pages.welcome.step3.nextButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:T,children:t("pages.welcome.step1.skipButton")})]})]}),n===4&&(0,Pe.jsxs)("section",{className:"welcome-step welcome-step-4","aria-labelledby":"step4-title",children:[(0,Pe.jsx)("h2",{id:"step4-title",children:t("pages.welcome.step4.title")}),(0,Pe.jsx)("p",{children:t("pages.welcome.step4.description")}),(0,Pe.jsxs)("div",{className:"example-prompt",role:"note",children:[(0,Pe.jsx)("span",{className:"prompt-label",children:t("pages.welcome.step4.examplePrompt")}),(0,Pe.jsx)("code",{className:"prompt-text",children:t("pages.welcome.step4.examplePromptText")})]}),b==="idle"&&(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("p",{className:"window-hint",children:t("pages.welcome.step4.windowHint")}),(0,Pe.jsxs)("div",{className:"welcome-actions",children:[(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>{M()},children:t("pages.welcome.step4.tryNowButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:()=>I("demo"),children:t("pages.welcome.step4.goToFocusButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:T,children:t("pages.welcome.step4.skipButton")})]})]}),b==="polling"&&(0,Pe.jsxs)("div",{className:"polling-active",role:"status","aria-live":"polite",children:[(0,Pe.jsx)("p",{children:t("pages.welcome.step4.pollingActive")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:()=>{_(),I("demo")},children:t("pages.welcome.step4.stopPollingButton")})]}),b==="evidence-found"&&(0,Pe.jsxs)("div",{className:"polling-success",role:"status",children:[(0,Pe.jsx)("p",{children:t("pages.welcome.step4.evidenceFound")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>I("evidence_found"),children:t("pages.welcome.step4.goToFocusButton")})]}),b==="timeout"&&(0,Pe.jsxs)("div",{className:"polling-timeout",role:"status",children:[(0,Pe.jsx)("p",{children:t("pages.welcome.step4.timeoutHint")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>I("demo"),children:t("pages.welcome.step4.goToFocusButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:T,children:t("pages.welcome.step4.skipButton")})]}),b==="error"&&(0,Pe.jsxs)("div",{className:"polling-error",role:"alert",children:[(0,Pe.jsx)("p",{children:g??t("pages.welcome.step4.pollingError")}),(0,Pe.jsxs)("div",{className:"welcome-actions",children:[(0,Pe.jsx)("button",{className:"pd-btn pd-btn-brand",onClick:()=>{M()},children:t("pages.welcome.step4.retryButton")}),(0,Pe.jsx)("button",{className:"pd-btn pd-btn-alt",onClick:()=>I("demo"),children:t("pages.welcome.step4.goToFocusButton")})]})]})]})]})}var Ie=D(W(),1),v2=!1;function r8(){let e=document.getElementById("main-content");e instanceof HTMLElement&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"start",behavior:"auto"}))}function i8({children:e,featureFlags:t}){let{t:a}=X();return(0,Ie.jsxs)("div",{className:"min-h-screen bg-paper text-ink",children:[(0,Ie.jsx)("button",{type:"button",onClick:r8,"data-testid":"skip-to-main",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-paper focus:text-ink focus:font-medium",children:a("common.skipToMain",{defaultValue:"\u8DF3\u5230\u6B63\u6587"})}),(0,Ie.jsx)(tO,{featureFlags:t}),(0,Ie.jsx)(eO,{featureFlags:t}),(0,Ie.jsx)("main",{id:"main-content",tabIndex:-1,"data-testid":"main-content",className:"min-h-screen overflow-y-auto pt-14 lg:pt-0 lg:ml-[256px] focus:outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-gov",children:e})]})}function o8(){let[e,t]=(0,hn.useState)(null),[a,n]=(0,hn.useState)(()=>window.location.hash.startsWith("#/splash")),[r,i]=(0,hn.useState)("default"),[o,s]=(0,hn.useState)(null),[l,c]=(0,hn.useState)(!1),u=na(),d=Qt(),f=(0,hn.useCallback)(async()=>{let p=await Au();t(p)},[]);(0,hn.useEffect)(()=>{f()},[f]),(0,hn.useEffect)(()=>{let p=()=>{document.visibilityState==="visible"&&f()};return window.addEventListener("focus",p),document.addEventListener("visibilitychange",p),()=>{window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",p)}},[f]),(0,hn.useEffect)(()=>{},[e,a,u]),(0,hn.useEffect)(()=>{e===!0&&Promise.all([zm().catch(()=>null),Zr().catch(()=>null)]).then(([p,b])=>{if(p&&p.success&&Array.isArray(p.data)&&p.data.length>0){let g=p.data[0];g&&(i(g.name),c(!0))}let v={};if(b&&b.success&&b.data){let g=b.data;for(let h of g.features)v[h.id]={enabled:h.enabled}}s(v)})},[e]),(0,hn.useEffect)(()=>{a||e!==!1||u("/login",{replace:!0})},[a,e,u]),(0,hn.useEffect)(()=>{if(e!==!0||o===null||a||!["/","/login","/splash"].includes(d.pathname))return;if(o?.new_user_onboarding?.enabled===!0&&l){let b=Og(r);u(b.completed?"/focus":"/welcome",{replace:!0})}else u("/focus",{replace:!0})},[e,o,a,r,l,d.pathname,u]);let m=(0,hn.useCallback)(()=>{t(!0)},[]);return(0,Ie.jsxs)(rm,{children:[(0,Ie.jsx)(jt,{path:"/splash",element:(0,Ie.jsx)(nO,{onComplete:()=>{n(!1)}})}),(0,Ie.jsx)(jt,{path:"/login",element:(0,Ie.jsx)(yO,{onAuthSuccess:m})}),(0,Ie.jsx)(jt,{path:"/*",element:e===null?(0,Ie.jsx)("div",{className:"min-h-screen bg-paper flex items-center justify-center",children:(0,Ie.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Ie.jsx)("div",{className:"w-8 h-8 border-2 border-gov border-t-transparent rounded-full animate-spin"}),(0,Ie.jsx)("span",{className:"text-[12px] font-mono tracking-wider text-ink-3 uppercase",children:"Verifying Session..."})]})}):e?(0,Ie.jsx)(ZL,{children:(0,Ie.jsx)(i8,{featureFlags:o??void 0,children:(0,Ie.jsx)(kg,{children:(0,Ie.jsxs)(rm,{children:[(0,Ie.jsx)(jt,{path:"/",element:(0,Ie.jsx)(Qd,{to:"/focus",replace:!0})}),(0,Ie.jsx)(jt,{path:"/welcome",element:(0,Ie.jsx)(b2,{workspaceId:r})}),(0,Ie.jsx)(jt,{path:"/focus",element:(0,Ie.jsx)(HO,{featureFlags:o??void 0})}),(0,Ie.jsx)(jt,{path:"/pain",element:(0,Ie.jsx)(XO,{})}),(0,Ie.jsx)(jt,{path:"/principles",element:(0,Ie.jsx)(QO,{})}),(0,Ie.jsx)(jt,{path:"/principles/core",element:(0,Ie.jsx)(eT,{})}),(0,Ie.jsx)(jt,{path:"/principles/:id",element:(0,Ie.jsx)(iT,{})}),(0,Ie.jsx)(jt,{path:"/activation",element:(0,Ie.jsx)(dT,{})}),(0,Ie.jsx)(jt,{path:"/debt",element:(0,Ie.jsx)(uT,{})}),(0,Ie.jsx)(jt,{path:"/examiner",element:(0,Ie.jsx)(fT,{})}),(0,Ie.jsx)(jt,{path:"/examiner/configure",element:(0,Ie.jsx)(pT,{})}),(0,Ie.jsx)(jt,{path:"/examiner/studies/:studyId",element:(0,Ie.jsx)(mT,{})}),(0,Ie.jsx)(jt,{path:"/examiner/studies/:studyId/report",element:(0,Ie.jsx)(gT,{})}),(0,Ie.jsx)(jt,{path:"/control-center",element:(0,Ie.jsx)(OT,{})}),(0,Ie.jsx)(jt,{path:"/settings",element:(0,Ie.jsx)(MT,{})}),(0,Ie.jsx)(jt,{path:"/update",element:(0,Ie.jsx)(HT,{})}),(0,Ie.jsx)(jt,{path:"/report-problem",element:(0,Ie.jsx)(JT,{})}),(0,Ie.jsx)(jt,{path:"/failed-tasks",element:(0,Ie.jsx)(n2,{})}),(0,Ie.jsx)(jt,{path:"/intent",element:(0,Ie.jsx)(u2,{})}),v2&&(0,Ie.jsx)(jt,{path:"/design-system",element:(0,Ie.jsx)(f2,{})}),!v2&&(0,Ie.jsx)(jt,{path:"/design-system",element:(0,Ie.jsx)(Qd,{to:"/focus",replace:!0})})]})})})}):(0,Ie.jsx)(Qd,{to:"/login",replace:!0})})]})}function x2(){return(0,Ie.jsx)($A,{children:(0,Ie.jsxs)(Dx,{i18n:ar,children:[(0,Ie.jsx)(fx,{children:(0,Ie.jsx)(o8,{})}),(0,Ie.jsx)(kO,{})]})})}var k2=D(W(),1),w2=document.getElementById("root");if(!w2)throw new Error("Root element not found");(0,y2.createRoot)(w2).render((0,k2.jsx)(x2,{}));
112
112
  /*! Bundled license information:
113
113