@mduan/paseo-cli 0.11.0-fork.29 → 0.11.0-fork.30

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.
Files changed (20) hide show
  1. package/node_modules/@getpaseo/client/package.json +3 -3
  2. package/node_modules/@getpaseo/highlight/package.json +1 -1
  3. package/node_modules/@getpaseo/plugin/package.json +3 -3
  4. package/node_modules/@getpaseo/protocol/package.json +1 -1
  5. package/node_modules/@getpaseo/relay/package.json +1 -1
  6. package/node_modules/@getpaseo/server/dist/server/builtin-plugins/package.json +1 -1
  7. package/node_modules/@getpaseo/server/dist/server/server/session/checkout/checkout-session.js +2 -0
  8. package/node_modules/@getpaseo/server/dist/server/server/workspace-git-service.d.ts +2 -7
  9. package/node_modules/@getpaseo/server/dist/server/server/workspace-git-service.js +1 -1
  10. package/node_modules/@getpaseo/server/dist/server/terminal/terminal-worker-process.js +5 -0
  11. package/node_modules/@getpaseo/server/dist/server/terminal/terminal-worker-protocol.d.ts +5 -0
  12. package/node_modules/@getpaseo/server/dist/server/terminal/worker-terminal-manager.js +5 -0
  13. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-d39694fb6a6ea78512fa776f4db8d1a5.js → index-d073261c6c171ec5910a051220471a65.js} +8 -8
  14. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-d39694fb6a6ea78512fa776f4db8d1a5.js.br → index-d073261c6c171ec5910a051220471a65.js.br} +0 -0
  15. package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-d39694fb6a6ea78512fa776f4db8d1a5.js.gz → index-d073261c6c171ec5910a051220471a65.js.gz} +0 -0
  16. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html +1 -1
  17. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.br +0 -0
  18. package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.gz +0 -0
  19. package/node_modules/@getpaseo/server/package.json +6 -6
  20. package/package.json +7 -7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/client",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo client SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -44,7 +44,7 @@
44
44
  "vitest": "^4.1.6"
45
45
  },
46
46
  "dependencies": {
47
- "@getpaseo/protocol": "0.11.0-fork.29",
48
- "@getpaseo/relay": "0.11.0-fork.29"
47
+ "@getpaseo/protocol": "0.11.0-fork.30",
48
+ "@getpaseo/relay": "0.11.0-fork.30"
49
49
  }
50
50
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/highlight",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/plugin",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo plugin SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -66,8 +66,8 @@
66
66
  "test": "vitest run"
67
67
  },
68
68
  "devDependencies": {
69
- "@getpaseo/client": "0.11.0-fork.29",
70
- "@getpaseo/protocol": "0.11.0-fork.29",
69
+ "@getpaseo/client": "0.11.0-fork.30",
70
+ "@getpaseo/protocol": "0.11.0-fork.30",
71
71
  "@types/node": "^20.9.0",
72
72
  "@types/react": "~19.2.0",
73
73
  "react": "19.1.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/protocol",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo shared protocol schemas and wire types",
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/relay",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo relay for bridging daemon and client connections",
5
5
  "files": [
6
6
  "dist",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/builtin-plugins",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -361,6 +361,8 @@ export class CheckoutSession {
361
361
  force: true,
362
362
  includeForge: true,
363
363
  reason: "manual-refresh",
364
+ // The active refresh may have started before the user's filesystem change.
365
+ queueIfBusy: true,
364
366
  });
365
367
  this.checkoutDiffManager.scheduleRefreshForCwd(resolvedCwd);
366
368
  this.host.emit({
@@ -153,14 +153,9 @@ export interface WorkspaceGitStashEntry {
153
153
  export type WorkspaceGitBranchValidationResult = BranchCheckoutResolution;
154
154
  export type WorkspaceGitBranchSuggestion = BranchSuggestion;
155
155
  export type WorkspaceGitWorktreeInfo = PaseoWorktreeInfo;
156
- export type WorkspaceGitSnapshotOptions = {
157
- force?: false;
158
- includeForge?: boolean;
159
- reason?: string;
160
- } | {
161
- force: true;
156
+ export type WorkspaceGitSnapshotOptions = WorkspaceGitReadOptions & {
162
157
  includeForge?: boolean;
163
- reason: string;
158
+ queueIfBusy?: boolean;
164
159
  };
165
160
  interface WorkspaceGitServiceDependencies {
166
161
  subscribe: SubscribeToFileChanges;
@@ -2172,7 +2172,7 @@ export class WorkspaceGitServiceImpl {
2172
2172
  includeForge: options?.includeForge ?? true,
2173
2173
  reason: options?.reason ?? defaultReason,
2174
2174
  notify,
2175
- queueIfBusy: false,
2175
+ queueIfBusy: options?.queueIfBusy ?? false,
2176
2176
  movedRemoteRefs: new Set(),
2177
2177
  };
2178
2178
  }
@@ -220,6 +220,11 @@ async function handleRequest(message) {
220
220
  sendToParent({ type: "response", requestId: message.requestId, ok: true });
221
221
  return;
222
222
  }
223
+ case "setTitle": {
224
+ manager.setTerminalTitle(message.terminalId, message.title);
225
+ sendToParent({ type: "response", requestId: message.requestId, ok: true });
226
+ return;
227
+ }
223
228
  case "setActivity": {
224
229
  await manager.setTerminalActivity(message.terminalId, message.state);
225
230
  sendToParent({ type: "response", requestId: message.requestId, ok: true });
@@ -38,6 +38,11 @@ export type TerminalWorkerRequest = {
38
38
  requestId: string;
39
39
  cwd: string;
40
40
  env: Record<string, string>;
41
+ } | {
42
+ type: "setTitle";
43
+ requestId: string;
44
+ terminalId: string;
45
+ title: string;
41
46
  } | {
42
47
  type: "setActivity";
43
48
  requestId: string;
@@ -266,6 +266,11 @@ export function createWorkerTerminalManager(managerOptions = {}) {
266
266
  return;
267
267
  }
268
268
  record.info = { ...record.info, title: manualTitle };
269
+ sendBestEffortRequest({
270
+ type: "setTitle",
271
+ terminalId: record.info.id,
272
+ title: manualTitle,
273
+ });
269
274
  for (const listener of Array.from(record.titleChangeListeners)) {
270
275
  listener(manualTitle);
271
276
  }
@@ -15169,7 +15169,7 @@ __d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s
15169
15169
  __d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s,c,n)<=0},3524,[2992]);
15170
15170
  __d(function(g,r,i,a,m,e,d){'use strict';const t=r(d[0]);m.exports=(n,c,s)=>{try{c=new t(c,s)}catch(t){return!1}return c.test(n)}},3525,[3516]);
15171
15171
  __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAppVersion=function(){const e=u(t.default?.version);if(e)return e;const o=u(n.default.expoConfig?.version);if(o)return o;const f=u(n.default.manifest?.version);if(f)return f;return null};var n=e(r(d[0])),t=e(r(d[1]));function u(e){if("string"!=typeof e)return null;const n=e.trim();return 0===n.length?null:n}},3526,[702,3527]);
15172
- __d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.29",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project=browser","test:e2e:diff-performance":"cross-env PASEO_DIFF_PERF_E2E=1 playwright test --project=browser e2e/browser/diff-performance.spec.ts","test:e2e:stream-smoothness":"cross-env PASEO_AGENT_STREAM_PERF_E2E=1 playwright test --project=browser e2e/browser/agent-stream-smoothness.spec.ts","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:relay-deployment":"npm --prefix ../.. run build:server && npm --prefix ../.. run build:daemon-web-ui && cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=relay-deployment e2e/browser/relay-deployment-reconnect.real.spec.ts","test:e2e:ui":"playwright test --ui",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","profile:composer-typing":"node ./scripts/profile-composer-typing.mjs","profile:explorer-toggle":"node ./scripts/profile-explorer-toggle.mjs","profile:side-pane":"playwright test --config playwright.profile.config.ts side-pane-performance.spec.ts","profile:workspace-switching":"node ./scripts/profile-workspace-switching.mjs","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","build:mermaid-runtime":"node ./src/components/markdown/fence/mermaid/build-runtime.mjs"},dependencies:{"@codemirror/commands":"6.10.4","@codemirror/language":"6.12.4","@codemirror/search":"6.7.1","@codemirror/state":"6.7.1","@codemirror/view":"6.43.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@floating-ui/react-native":"^0.10.7","@getpaseo/client":"*","@getpaseo/expo-two-way-audio":"*","@getpaseo/highlight":"*","@getpaseo/plugin":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@marijn/find-cluster-break":"^1.0.2","@mattermost/react-native-paste-input":"2.0.1","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@replit/codemirror-vim":"6.3.0","@shopify/react-native-skia":"2.2.12","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"^0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-splash-screen":"~31.0.10","expo-sqlite":"~16.0.10","expo-system-ui":"~6.0.7","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0",mermaid:"^11.16.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-freeze":"1.0.4","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"1.21.12","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3",turndown:"^7.2.4","turndown-plugin-gfm":"^1.0.2","use-sync-external-store":"^1.6.0",yaml:"^2.8.4",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/markdown-it":"^14.1.2","@types/node":"~22.19.0","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/turndown":"^5.0.6","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3","eas-cli":"^16.24.1",esbuild:"0.28.1",eslint:"^9.25.0","eslint-config-expo":"~10.0.0","expo-gradle-jvmargs":"^1.1.2","fake-indexeddb":"^6.2.5",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"},reanimated:{staticFeatureFlags:{FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS:!1}}}},3527,[]);
15172
+ __d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.30",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --clean --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project=browser","test:e2e:diff-performance":"cross-env PASEO_DIFF_PERF_E2E=1 playwright test --project=browser e2e/browser/diff-performance.spec.ts","test:e2e:stream-smoothness":"cross-env PASEO_AGENT_STREAM_PERF_E2E=1 playwright test --project=browser e2e/browser/agent-stream-smoothness.spec.ts","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:relay-deployment":"npm --prefix ../.. run build:server && npm --prefix ../.. run build:daemon-web-ui && cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=relay-deployment e2e/browser/relay-deployment-reconnect.real.spec.ts","test:e2e:ui":"playwright test --ui",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","profile:composer-typing":"node ./scripts/profile-composer-typing.mjs","profile:explorer-toggle":"node ./scripts/profile-explorer-toggle.mjs","profile:side-pane":"playwright test --config playwright.profile.config.ts side-pane-performance.spec.ts","profile:workspace-switching":"node ./scripts/profile-workspace-switching.mjs","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","build:mermaid-runtime":"node ./src/components/markdown/fence/mermaid/build-runtime.mjs"},dependencies:{"@codemirror/commands":"6.10.4","@codemirror/language":"6.12.4","@codemirror/search":"6.7.1","@codemirror/state":"6.7.1","@codemirror/view":"6.43.6","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@floating-ui/react-native":"^0.10.7","@getpaseo/client":"*","@getpaseo/expo-two-way-audio":"*","@getpaseo/highlight":"*","@getpaseo/plugin":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@marijn/find-cluster-break":"^1.0.2","@mattermost/react-native-paste-input":"2.0.1","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@replit/codemirror-vim":"6.3.0","@shopify/react-native-skia":"2.2.12","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"^0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-splash-screen":"~31.0.10","expo-sqlite":"~16.0.10","expo-system-ui":"~6.0.7","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0",mermaid:"^11.16.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-freeze":"1.0.4","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"1.21.12","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3",turndown:"^7.2.4","turndown-plugin-gfm":"^1.0.2","use-sync-external-store":"^1.6.0",yaml:"^2.8.4",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/markdown-it":"^14.1.2","@types/node":"~22.19.0","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/turndown":"^5.0.6","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3","eas-cli":"^16.24.1",esbuild:"0.28.1",eslint:"^9.25.0","eslint-config-expo":"~10.0.0","expo-gradle-jvmargs":"^1.1.2","fake-indexeddb":"^6.2.5",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"},reanimated:{staticFeatureFlags:{FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS:!1}}}},3527,[]);
15173
15173
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPluginClientRuntime=function(p){const I=(0,l.createPluginClientStateSource)(p.serverId),P=(0,o.createPluginCapabilities)(p,(0,s.createPluginNavigation)({serverId:p.serverId,workspaceId:null}));return Object.assign({},P,{hosts:(0,n.createPluginHosts)((0,t.getHostRuntimeStore)(),p.lifetime.signal),addComposerPill:t=>u.pluginButtonStore.addComposerPill(p,t),addHeaderButton:t=>u.pluginButtonStore.addHeaderButton(p,t),openPanel(t,n){c({installation:p,state:I,panelId:t,options:n})}})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]),u=r(d[5]);function c(t){const{installation:n,state:l,panelId:u,options:c}=t,p=c.workspaceId.trim(),I=c.agentId?.trim(),P=(0,s.createPluginNavigation)({serverId:n.serverId,workspaceId:p}),v=I?(0,o.createPluginAgentActionContext)({plugin:n,navigation:P,state:l,workspaceId:p,agentId:I}):(0,o.createPluginWorkspaceActionContext)({plugin:n,navigation:P,state:l,workspaceId:p});if(!v)throw new Error("Plugin panel context is unavailable");v.openPanel(u,{location:c.location})}},3528,[3529,3652,3653,3664,3669,3680]);
15174
15174
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["password"];function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.isHostRuntimeConnected=te,_e.isHostRuntimeDirectoryLoading=ne,Object.defineProperty(_e,"HostRuntimeController",{enumerable:!0,get:function(){return ye}}),_e.readInitialDaemonConnectionHint=be,_e.hasConfiguredLocalDaemonOverride=function(){return null!==we()},Object.defineProperty(_e,"HostRuntimeStore",{enumerable:!0,get:function(){return De}}),_e.getHostRuntimeStore=Pe,_e.getHostRuntimeConnectionStatusSince=function(e){return Pe().getConnectionStatusSince(e)},_e.useHostRuntimeSnapshot=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e),u=()=>o.getSnapshot(e),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeClient=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.client??null,u=()=>o.getSnapshot(e)?.client??null,t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeIsConnected=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>te(o.getSnapshot(e)),u=()=>te(o.getSnapshot(e)),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeConnectionStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.connectionStatus??"connecting",u=()=>o.getSnapshot(e)?.connectionStatus??"connecting",t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeConnectionStatuses=function(e){const t=(0,s.c)(7);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c;t[1]!==e?(c=()=>e.map(e=>o.getSnapshot(e)?.connectionStatus??"connecting").join("\n"),t[1]=e,t[2]=c):c=t[2];const h=c;let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=e=>o.subscribeAll(e),t[3]=u):u=t[3];const p=(0,l.useSyncExternalStore)(u,h,h);let y;if(t[4]!==e||t[5]!==p){const n=p.split("\n");y=new Map(e.map((e,t)=>[e,n[t]])),t[4]=e,t[5]=p,t[6]=y}else y=t[6];return y},_e.useHostRuntimeLastError=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.lastError??null,u=()=>o.getSnapshot(e)?.lastError??null,t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeAgentDirectoryStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>o.getSnapshot(e)?.agentDirectoryStatus??"idle",u=()=>o.getSnapshot(e)?.agentDirectoryStatus??"idle",t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHostRuntimeIsDirectoryLoading=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Pe(),t[0]=n):n=t[0];const o=n;let c,h,u;t[1]!==e?(c=t=>o.subscribe(e,t),h=()=>ne(o.getSnapshot(e)),u=()=>ne(o.getSnapshot(e)),t[1]=e,t[2]=c,t[3]=h,t[4]=u):(c=t[2],h=t[3],u=t[4]);return(0,l.useSyncExternalStore)(c,h,u)},_e.useHosts=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.getHosts(),h=()=>n.getHosts(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostRegistryStatus=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.getHostRegistryStatus(),h=()=>n.getHostRegistryStatus(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostRegistryLoaded=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostList(e),c=()=>n.isHostRegistryLoaded(),h=()=>n.isHostRegistryLoaded(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);return(0,l.useSyncExternalStore)(o,c,h)},_e.useHostConfirmation=function(){const e=(0,s.c)(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o,c,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>n.subscribeHostConfirmation(e),c=()=>n.getPendingHostConfirmation(),h=()=>n.getPendingHostConfirmation(),e[1]=o,e[2]=c,e[3]=h):(o=e[1],c=e[2],h=e[3]);const u=(0,l.useSyncExternalStore)(o,c,h);let p,y;e[4]!==u?(p=e=>{u&&n.answerHostConfirmation(u.id,e)},e[4]=u,e[5]=p):p=e[5];e[6]!==u||e[7]!==p?(y={pending:u,answer:p},e[6]=u,e[7]=p,e[8]=y):y=e[8];return y},_e.useHostMutations=function(){const e=(0,s.c)(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Pe(),e[0]=t):t=e[0];const n=t;let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={upsertDirectConnection:e=>n.upsertDirectConnection(e),probeAndUpsertDirectConnection:e=>n.probeAndUpsertDirectConnection(e),probeAndUpsertRemoteSshConnection:e=>n.probeAndUpsertRemoteSshConnection(e),beginLinkPairing:()=>n.beginLinkPairing(),renameHost:(e,t)=>n.renameHost(e,t),setHostColor:(e,t)=>n.setHostColor(e,t),setHostBadgeDisplay:(e,t)=>n.setHostBadgeDisplay(e,t),removeHost:e=>n.removeHost(e),removeConnection:(e,t)=>n.removeConnection(e,t)},e[1]=o):o=e[1];return o};var n=t(r(d[0])),s=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),h=t(r(d[5])),u=t(r(d[6])),p=r(d[7]),y=r(d[8]),S=r(d[9]),f=r(d[10]),C=r(d[11]),v=r(d[12]),b=r(d[13]),w=r(d[14]),I=r(d[15]),A=r(d[16]),H=r(d[17]),R=r(d[18]),D=r(d[19]),E=r(d[20]),L=r(d[21]),P=r(d[22]),O=r(d[23]),_=r(d[24]),M=r(d[25]),k=r(d[26]),T=r(d[27]),B=r(d[28]),F=r(d[29]),j=r(d[30]),q=r(d[31]),x=r(d[32]),U=r(d[33]),V=r(d[34]),W=r(d[35]),N=r(d[36]),$=r(d[37]),G=r(d[38]),z=r(d[39]),K=r(d[40]),Q=r(d[41]),J=r(d[42]),X=r(d[43]),Y=r(d[44]),Z=r(d[45]);function ee(e,t,n){e[t]=n}function te(e){return"online"===e?.connectionStatus}function ne(e){return!e||("initial_loading"===e.agentDirectoryStatus||"revalidating"===e.agentDirectoryStatus||!e.hasEverLoadedAgentDirectory&&("connecting"===e.connectionStatus||"online"===e.connectionStatus))}function se(e){return e instanceof Error?e.message:String(e)}function ie(e){let t=0;for(let n=0;n<e.length;n+=1)t=31*t+e.charCodeAt(n)|0;return`h_${Math.abs(t).toString(16)}`}function oe(e){return"directSocket"===e.type?{type:"directSocket",endpoint:e.path,display:"socket"}:"directPipe"===e.type?{type:"directPipe",endpoint:e.path,display:"pipe"}:"remoteSsh"===e.type?{type:"remoteSsh",endpoint:e.host,display:e.host}:"directTcp"===e.type?{type:"directTcp",endpoint:e.endpoint,display:e.endpoint}:{type:"relay",endpoint:e.relayEndpoint,display:"relay"}}function re(e){return"connecting"===e.tag||"online"===e.tag||"offline"===e.tag||"error"===e.tag?{id:e.activeConnectionId,connection:e.activeConnection}:{id:null,connection:null}}function ce(e,t,n){const s=n.state.status;return"connected"===s?{tag:"online",activeConnectionId:e,activeConnection:t,lastOnlineAt:(new Date).toISOString()}:"connecting"===s||"idle"===s?{tag:"connecting",activeConnectionId:e,activeConnection:t}:"disposed"===s?{tag:"offline",activeConnectionId:e,activeConnection:t}:null}function ae(e,t,n){const s=ce(e,t,n);if(s)return s;const o=("disconnected"===n.state.status?n.state.reason??null:null)??n.lastError??null;return o&&"client_closed"!==o?{tag:"error",activeConnectionId:e,activeConnection:t,message:o}:{tag:"offline",activeConnectionId:e,activeConnection:t}}function le(e){const{state:t,event:n}=e;if("select_connection"===n.type)return{tag:"connecting",activeConnectionId:n.connectionId,activeConnection:n.connection};if("connect_failed"===n.type){const e=re(t);return{tag:"error",activeConnectionId:e.id,activeConnection:e.connection,message:n.message}}if("no_connections"===n.type||"stopped"===n.type)return{tag:"offline",activeConnectionId:null,activeConnection:null};const s=re(t);return s.id&&s.connection?ae(s.id,s.connection,n):"booting"===t.tag?t:{tag:"offline",activeConnectionId:null,activeConnection:null}}function he(e,t){return"booting"===e.tag?{activeConnectionId:null,activeConnection:null,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"connecting"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"online"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"online",lastError:null,lastOnlineAt:e.lastOnlineAt,connectionEpoch:t}:"offline"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"offline",lastError:null,lastOnlineAt:null,connectionEpoch:t}:{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"error",lastError:e.message,lastOnlineAt:null,connectionEpoch:t}}function de(e){return e.connections.map(e=>({connectionId:e.id,connection:e}))}function ue(e,t){return t?e.connections.find(e=>e.id===t)??null:null}function pe(e,t,n,s){if(t)return 1e4;if(n)return 12e4;const o=s-e;return o<1e4?2e3:o<3e4?5e3:o<6e4?1e4:3e4}function ge(){const e="function"==typeof(0,P.getDesktopHost)()?.browser?.executeAutomationCommand?{[_.CLIENT_CAPS.browserHost]:{supportedCommands:[...M.BROWSER_AUTOMATION_COMMAND_NAMES],hostKind:"desktop app"}}:void 0,t=Object.assign({},e);return{createClient:({host:e,connection:n,clientId:s,runtimeGeneration:l})=>{const h=(0,L.createDesktopDaemonTransportFactory)(),u={webSocketFactory:(0,Z.createAppWebSocketFactory)()},y=Object.assign({suppressSendErrors:!0,clientId:s,clientType:"mobile",appVersion:(0,C.resolveAppVersion)()??void 0,deviceLabel:o.getAppDeviceLabel,deviceKind:(0,o.getAppDeviceKind)(),connectionTransport:"remoteSsh"===n.type?c.ConnectionTransport.SshTunnel:void 0,runtimeGeneration:l,capabilities:t,trace:X.nativePerformanceTrace,providerSnapshots:"wire"},e.password?{password:e.password}:{},{localCredential:()=>(0,O.readDesktopManagedLocalCredential)(n)});if("directSocket"===n.type||"directPipe"===n.type)return new p.DaemonClient(Object.assign({},y,h?{transportFactory:h}:{},{url:(0,L.buildDesktopDaemonTransportUrl)({transportType:"directSocket"===n.type?"socket":"pipe",transportPath:n.path})}));if("remoteSsh"===n.type){if(!h)throw new Error("Remote SSH is only available in the desktop app.");return new p.DaemonClient(Object.assign({},y,{transportFactory:h,url:(0,L.buildDesktopDaemonTransportUrl)(Object.assign({transportType:"ssh",host:n.host},void 0!==n.sshPort?{sshPort:n.sshPort}:{},void 0!==n.daemonPort?{daemonPort:n.daemonPort}:{}))}))}return"directTcp"===n.type?new p.DaemonClient(Object.assign({},y,u,{url:(0,f.buildDaemonWebSocketUrl)(n.endpoint,{useTls:n.useTls??!1})})):new p.DaemonClient(Object.assign({},y,u,{url:(0,f.buildRelayWebSocketUrl)({endpoint:n.relayEndpoint,useTls:n.useTls??(0,f.shouldUseTlsForDefaultHostedRelay)(n.relayEndpoint),serverId:e.serverId}),e2ee:{enabled:!0,daemonPublicKeyB64:n.daemonPublicKeyB64}}))},connectToDaemon:({host:e,connection:n,timeoutMs:s})=>(0,A.connectToDaemon)(n,Object.assign({},e.serverId?{serverId:e.serverId}:{},e.password?{password:e.password}:{},{localCredential:()=>(0,O.readDesktopManagedLocalCredential)(n)},void 0!==s?{timeoutMs:s}:{},{capabilities:t,trace:X.nativePerformanceTrace})),getClientId:()=>(0,H.getOrCreateClientId)(),mountClientHandlers:({client:t,host:n})=>{const s=(0,j.mountServerDataPushRouter)({client:t,queryClient:F.queryClient,serverId:n.serverId});if(!e)return s;const o=(0,q.mountBrowserAutomationDaemonClientHandler)(t,{serverId:n.serverId});return()=>{o(),s()}}}}class ye{connectionEpoch=0;listeners=new Set;activeClient=null;unsubscribeClientStatus=null;unsubscribeClientHandlers=null;probeIntervalHandle=null;started=!1;connectionFirstSeenAt=new Map;connectionLastProbedAt=new Map;switchCandidateConnectionId=null;switchCandidateHitCount=0;clientIdPromise=null;clientIdHash=null;switchRequestVersion=0;probeRequestVersion=0;probeCycleInFlight=null;authRejectedConnectionIds=new Set;constructor(e){this.host=e.host,this.deps=e.deps??ge(),this.onReconcileServerId=e.onReconcileServerId??null,this.connectionMachineState={tag:"booting"},this.snapshot=Object.assign({serverId:this.host.serverId},he(this.connectionMachineState,this.connectionEpoch),{client:null,agentDirectoryStatus:"idle",agentDirectoryError:null,hasEverLoadedAgentDirectory:!1,probeByConnectionId:new Map,clientGeneration:0})}getSnapshot(){return this.snapshot}getClient(){return this.snapshot.client}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async start(e){this.started||(this.started=!0,this.trackConnectionFirstSeen(),e?.initialConnection&&(await this.switchToConnection({connectionId:e.initialConnection.connectionId,existingClient:e.initialConnection.existingClient}),!this.started)||(await this.runProbeCycleNow(),this.started&&!1!==e?.autoProbe&&(this.probeIntervalHandle=setInterval(()=>{this.runProbeCycleNow()},2e3))))}async stop(){if(this.switchRequestVersion+=1,this.probeRequestVersion+=1,this.started=!1,this.probeIntervalHandle&&(clearInterval(this.probeIntervalHandle),this.probeIntervalHandle=null),this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}this.applyConnectionEvent({type:"stopped"}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null}))}async updateHost(e){const t=this.host.password!==e.password;t&&(this.probeRequestVersion+=1,this.authRejectedConnectionIds.clear(),this.updateSnapshot({authFailureReason:null}));const n=this.snapshot.activeConnectionId,s=ue(this.host,n);this.host=e,this.trackConnectionFirstSeen();const o=ue(this.host,n);n&&s&&o&&(!(0,u.default)(s,o)||t)&&(this.connectionLastProbedAt.delete(n),await this.switchToConnection({connectionId:n})),t&&this.connectionLastProbedAt.clear(),t&&await this.probeCycleInFlight,await this.runProbeCycleNow()}ensureConnected(e){this.activeClient?.ensureConnected(e)}markAgentDirectorySyncLoading(){const e=this.snapshot.hasEverLoadedAgentDirectory?"revalidating":"initial_loading";this.updateSnapshot({agentDirectoryStatus:e,agentDirectoryError:null})}markAgentDirectorySyncReady(){this.updateSnapshot({agentDirectoryStatus:"ready",agentDirectoryError:null,hasEverLoadedAgentDirectory:!0})}markAgentDirectorySyncError(e){const t=this.snapshot.hasEverLoadedAgentDirectory;this.updateSnapshot({agentDirectoryStatus:t?"error_after_ready":"error_before_first_success",agentDirectoryError:e,hasEverLoadedAgentDirectory:t})}markAgentDirectorySyncIdle(){this.updateSnapshot({agentDirectoryStatus:this.snapshot.hasEverLoadedAgentDirectory?"ready":"idle",agentDirectoryError:null})}markStartupError(e){this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch)))}async activateConnection(e){await this.switchToConnection(e)}async runProbeCycleNow(){if(this.probeCycleInFlight)return this.probeCycleInFlight;const e=this.runProbeCycle().finally(()=>{this.probeCycleInFlight===e&&(this.probeCycleInFlight=null)});return this.probeCycleInFlight=e,e}async runProbeCycle(){const e=++this.probeRequestVersion;if(0===this.host.connections.length){if(!this.isCurrentProbeRequest(e))return;return this.applyConnectionEvent({type:"no_connections"}),void this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{probeByConnectionId:new Map}))}const t=performance.now(),n="online"===this.snapshot.connectionStatus,s=this.snapshot.activeConnectionId,o=n&&null!==s,c=this.host.connections.filter(e=>{if(this.authRejectedConnectionIds.has(e.id))return!1;const c=this.connectionLastProbedAt.get(e.id);if(null==c)return!0;const l=pe(this.connectionFirstSeenAt.get(e.id)??t,n&&e.id===s,o,t);return t-c>=l});if(0===c.length)return;const l=new Map(this.snapshot.probeByConnectionId);for(const e of c){this.connectionLastProbedAt.set(e.id,performance.now());const t=l.get(e.id);n&&e.id===s&&"available"===t?.status||l.set(e.id,{status:"pending",latencyMs:null})}this.updateSnapshot({probeByConnectionId:new Map(l)});let h=c.length,u=null,y=null;const S=()=>{this.isCurrentProbeRequest(e)&&this.updateSnapshot({probeByConnectionId:new Map(l)})},f=async(t,n)=>{for(;!this.snapshot.activeConnectionId;){if(!y)return y=this.switchToConnection({connectionId:t,expectedProbeVersion:e,existingClient:n}).finally(()=>{y=null}),await y,this.snapshot.activeConnectionId===t;await y}return!1},C=async()=>{if(h>0||!this.isCurrentProbeRequest(e))return;const t=this.snapshot.activeConnectionId,n=t?l.get(t):null;if(!t||!ue(this.host,t)){const t=(0,E.selectBestConnection)({candidates:de(this.host),probeByConnectionId:l});if(t)await this.switchToConnection({connectionId:t,expectedProbeVersion:e});else if(u){const e=new p.DaemonAuthenticationError(u).message;this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{authFailureReason:u}))}return}if(this.isConnectionUnavailable(t,n)){const n=(0,E.selectBestConnection)({candidates:de(this.host),probeByConnectionId:l});return n&&n!==t&&await this.switchToConnection({connectionId:n,expectedProbeVersion:e}),this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0)}if(!n||"available"!==n.status)return;const s=Array.from(l.entries()).filter(e=>"available"===e[1].status).map(([e,t])=>({connectionId:e,latencyMs:t.latencyMs})).sort((e,t)=>e.latencyMs-t.latencyMs)[0]??null;if(!s||s.connectionId===t)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);if(n.latencyMs-s.latencyMs<40)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);this.switchCandidateConnectionId===s.connectionId?this.switchCandidateHitCount+=1:(this.switchCandidateConnectionId=s.connectionId,this.switchCandidateHitCount=1),this.switchCandidateHitCount>=3&&(this.switchCandidateConnectionId=null,this.switchCandidateHitCount=0,await this.switchToConnection({connectionId:s.connectionId,expectedProbeVersion:e}))};await new Promise(t=>{for(const n of c)(async()=>{let s=null,o=!1;try{const t=this.snapshot.activeConnectionId===n.id?this.snapshot.client:null;if(t)s=t;else{const{client:e,serverId:t}=await this.deps.connectToDaemon({host:this.host,connection:n});if(t!==this.host.serverId){if(!Ae(this.host.serverId)||!this.onReconcileServerId)throw await e.close().catch(()=>{}),new Error(`Connection resolved to ${t}, expected ${this.host.serverId}.`);this.onReconcileServerId(this.host.serverId,t)}s=e,o=!0}if(!this.isCurrentProbeRequest(e))return;const c=await f(n.id,s);if(o=o&&!c,t){const s=t.getLastLivenessRttMs();if(!this.isCurrentProbeRequest(e))return;return void(null!==s&&(l.set(n.id,{status:"available",latencyMs:s}),S()))}const h=await s.measureLatency({timeoutMs:5e3});if(!this.isCurrentProbeRequest(e))return;l.set(n.id,{status:"available",latencyMs:h}),S()}catch(t){if(this.isCurrentProbeRequest(e)){const e=(0,A.getConnectionAuthFailureReason)(t);e&&(this.authRejectedConnectionIds.add(n.id),u=e),l.set(n.id,{status:"unavailable",latencyMs:null}),S()}}finally{s&&o&&await s.close().catch(()=>{}),h-=1,C().finally(()=>{0===h&&t()})}})()})}isConnectionUnavailable(e,t){return"unavailable"===t?.status||this.authRejectedConnectionIds.has(e)}updateSnapshot(e){const t=Object.assign({},e);let n=this.host.serverId!==this.snapshot.serverId;for(const s of Object.keys(e)){const o=e[s];(0,u.default)(this.snapshot[s],o)?ee(t,s,this.snapshot[s]):n=!0}if(n){this.snapshot=Object.assign({},this.snapshot,t,{serverId:this.host.serverId});for(const e of this.listeners)e()}}applyConnectionEvent(e){const t=this.connectionMachineState,n=le({state:t,event:e});"online"!==t.tag&&"online"===n.tag&&(this.connectionEpoch+=1),this.connectionMachineState=n,this.logConnectionTransition({from:t.tag,to:n.tag,event:e})}logConnectionTransition(e){}trackConnectionFirstSeen(){const e=performance.now(),t=new Set(this.host.connections.map(e=>e.id));for(const e of this.connectionFirstSeenAt.keys())t.has(e)||(this.connectionFirstSeenAt.delete(e),this.connectionLastProbedAt.delete(e));for(const t of this.host.connections)this.connectionFirstSeenAt.has(t.id)||this.connectionFirstSeenAt.set(t.id,e)}isCurrentSwitchRequest(e){return e===this.switchRequestVersion}isCurrentProbeRequest(e){return e===this.probeRequestVersion}canProceedForProbe(e){return void 0===e||this.isCurrentProbeRequest(e)}async abortSwitchWithClient(e){e&&await e.close().catch(()=>{})}isSwitchStillValid(e,t){return this.isCurrentSwitchRequest(e)&&this.canProceedForProbe(t)}async resolveClientIdForSwitch(e){try{return await this.resolveClientId()}catch(t){if(await this.abortSwitchWithClient(e.existingClient),!this.isCurrentSwitchRequest(e.requestVersion))return null;const n=se(t);return this.applyConnectionEvent({type:"connect_failed",message:`Failed to resolve client id: ${n}`}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch))),null}}async disposePreviousActiveClient(){if(this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}}buildAgentDirectoryStatusPatch(){if(this.snapshot.hasEverLoadedAgentDirectory)return{};const e=this.connectionMachineState.tag;return"connecting"===e||"online"===e?{agentDirectoryStatus:"initial_loading",agentDirectoryError:null}:"error"===e?{agentDirectoryStatus:"error_before_first_success",agentDirectoryError:this.connectionMachineState.message}:{agentDirectoryStatus:"idle",agentDirectoryError:null}}async switchToConnection(e){const{connectionId:t,expectedProbeVersion:n,existingClient:s}=e;if(!this.canProceedForProbe(n))return void await this.abortSwitchWithClient(s);const o=ue(this.host,t);if(!o)return void await this.abortSwitchWithClient(s);const c=++this.switchRequestVersion,l=await this.resolveClientIdForSwitch({existingClient:s,requestVersion:c});if(null===l)return;if(!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);if(await this.disposePreviousActiveClient(),!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);const h=this.snapshot.clientGeneration+1,u=s??this.deps.createClient({host:this.host,connection:o,clientId:l,runtimeGeneration:h});if(u.setReconnectEnabled(!0),!this.isSwitchStillValid(c,n))return void await u.close().catch(()=>{});this.activeClient=u,this.applyConnectionEvent({type:"select_connection",connectionId:o.id,connection:oe(o)}),this.snapshot=Object.assign({},this.snapshot,{clientGeneration:h}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null}));const y=async e=>{if(!this.isCurrentSwitchRequest(c)||this.activeClient!==u)return;const t=(0,A.getConnectionAuthFailureReason)(e);if(t&&this.authRejectedConnectionIds.add(o.id),this.unsubscribeClientStatus?.(),this.unsubscribeClientStatus=null,this.unsubscribeClientHandlers?.(),this.unsubscribeClientHandlers=null,u.setReconnectEnabled(!1),this.applyConnectionEvent({type:"connect_failed",message:se(e)}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),{client:null,authFailureReason:t})),t){const e=new Map(this.snapshot.probeByConnectionId);e.set(o.id,{status:"unavailable",latencyMs:null}),this.updateSnapshot({probeByConnectionId:e});for(const e of this.host.connections)this.authRejectedConnectionIds.has(e.id)||this.connectionLastProbedAt.delete(e.id)}try{await u.close()}catch{}t&&this.host.connections.some(e=>!this.authRejectedConnectionIds.has(e.id))&&this.runProbeCycleNow()};try{if(s||await u.connect(),!this.isCurrentSwitchRequest(c)||this.activeClient!==u)return;this.unsubscribeClientHandlers=this.deps.mountClientHandlers?.({client:u,host:this.host,connection:o})??null,this.unsubscribeClientStatus=u.subscribeConnectionStatus(e=>{this.isCurrentSwitchRequest(c)&&this.activeClient===u&&(u.authFailureReason?y(new p.DaemonAuthenticationError(u.authFailureReason)):(this.applyConnectionEvent({type:"client_state",state:e,lastError:u.lastError}),this.updateSnapshot(Object.assign({},he(this.connectionMachineState,this.connectionEpoch),this.buildAgentDirectoryStatusPatch(),{client:u,authFailureReason:null}))))})}catch(e){await y(e)}}adoptReconciledServerId(e){this.host=Object.assign({},this.host,{serverId:e}),this.snapshot=Object.assign({},this.snapshot,{serverId:e});for(const e of this.listeners)e()}resolveClientId(){return this.clientIdPromise||(this.clientIdPromise=this.deps.getClientId().then(e=>(this.clientIdHash=ie(e),e))),this.clientIdPromise}}const Se="@paseo:daemon-registry",fe="localhost:6767",Ce=2500,ve="__PASEO_INITIAL_DAEMON_CONNECTION__",me=R.z.object({listen:R.z.string().trim().min(1),useTls:R.z.boolean().optional().default(!1)});function be(e){if(!(e?.isWebRuntime??I.isWeb)||"undefined"==typeof globalThis)return null;const t=me.safeParse(Reflect.get(globalThis,ve));return t.success?t.data:null}function we(){return null}function Ie(e){if(e.trim().startsWith("relay://")||e.includes("#connect="))return(0,f.parseRelayConnectionUri)(e);const t="#offer=",n=e.indexOf(t);if(-1===n)throw new Error("Missing #offer= fragment");const s=e.slice(n+7).trim();if(!s)throw new Error("Offer payload is empty");const o=(0,f.decodeOfferFragmentPayload)(s);return{offer:v.ConnectionOfferSchema.parse(o)}}function Ae(e){return e.startsWith("local:")}function He(e){return new Promise(t=>setTimeout(t,e))}function Re(e,t,n){const s=e.get(t);void 0!==s&&(e.delete(t),e.set(n,s))}class De{controllers=new Map;serverListeners=new Map;globalListeners=new Set;hostListListeners=new Set;version=0;hostListVersion=0;hostRegistryLoaded=!1;hosts=[];hostAppearanceMutationTail=Promise.resolve();hostRegistryStatus="loading";lastConnectionStatusByServer=new Map;connectionStatusStartedAtByServer=new Map;queuedAgentDrainInFlight=new Set;directorySyncByServer=new Map;nextCancellationRequestId=0;timelineReplicaByServer=new Map;configuredOverrideBootstrapInFlight=null;bootPromise=null;registryLoad=null;hostConfirmations=new b.HostConfirmations;constructor(e){this.deps=e?.deps??ge(),this.storage=e?.storage??h.default,this.replicaCache=new z.ReplicaCache(e?.replicaRowStore??(0,K.createReplicaRowStore)()),this.revokePushNotifications=e?.revokePushNotifications??Y.revokePushNotifications}getHosts(){return this.hosts}getHostRegistryStatus(){return this.hostRegistryStatus}subscribeHostList(e){return this.hostListListeners.add(e),()=>{this.hostListListeners.delete(e)}}getHostListVersion(){return this.hostListVersion}isHostRegistryLoaded(){return this.hostRegistryLoaded}boot(){return this.bootPromise||(this.bootPromise=this.runBoot()),this.bootPromise}async runBoot(){await this.loadRegistry();let e=null;try{e=await(0,D.readValidatedString)(this.storage,"@paseo:e2e",R.z.string().min(1))}catch{return}if(e)return;if((0,w.shouldUseDesktopDaemon)())return;const t=this.deps.readInitialConnectionHint?this.deps.readInitialConnectionHint():be();if(t){if(await this.bootstrapInitialConnectionHint(t))return}await this.bootstrapDefaultLocalhost()}loadRegistry(){return this.registryLoad||(this.registryLoad=this.loadFromStorage().then(()=>this.markHostRegistryLoaded())),this.registryLoad}async loadFromStorage(){let e=!1,t=[];try{const n=await(0,D.readValidatedJson)(this.storage,Se,y.StoredHostRegistrySchema);if(n){const s=[];for(const t of n){const n=(0,y.normalizeStoredHostProfile)(t);if(!n){await this.storage.removeItem(Se),s.length=0;break}t.connections.some(e=>"directTcp"===e.type&&e.password)&&(e=!0),s.push(n)}t=s.filter(e=>!Ae(e.serverId)),t.length!==s.length&&(e=!0)}this.hosts=t,this.replicaCache.setHosts(t.map(e=>e.serverId)),J.projectIconCache.setHosts(t.map(e=>e.serverId)),await J.projectIconCache.restore(),this.syncHosts(t);for(const e of t)this.directorySyncByServer.get(e.serverId)?.restoreCachedDirectory().catch(()=>{})}catch(e){console.error("[HostRuntime] Failed to load host registry from storage",e)}finally{this.hostRegistryStatus="ready",this.emitHostList(),e&&this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}}markHostRegistryLoaded(){this.hostRegistryLoaded||(this.hostRegistryLoaded=!0,this.emitHostList())}async bootstrapDefaultLocalhost(){const e=(0,y.connectionFromListen)(fe);if(e&&!(0,y.registryHasConnection)(this.hosts,e))try{await this.probeAndUpsertConnection({connection:e,timeoutMs:Ce})}catch(e){console.warn("[HostRuntime] bootstrap probe failed",{endpoint:fe,error:e})}}bootstrapConfiguredOverride(e){const t=(0,y.connectionFromListen)(e);if(!t)return;if((0,y.registryHasConnection)(this.hosts,t))return;if(this.configuredOverrideBootstrapInFlight)return;const n=this.runConfiguredOverrideBootstrap(e,t).finally(()=>{this.configuredOverrideBootstrapInFlight===n&&(this.configuredOverrideBootstrapInFlight=null)});this.configuredOverrideBootstrapInFlight=n}async runConfiguredOverrideBootstrap(e,t){let n=0;for(;!(0,y.registryHasConnection)(this.hosts,t);){n+=1;try{return void await this.probeAndUpsertConnection({connection:t,timeoutMs:Ce})}catch(t){1!==n&&n%10!=0||console.warn("[HostRuntime] configured bootstrap probe failed",{endpoint:e,attempt:n,error:t}),await He(1e3)}}}async bootstrapInitialConnectionHint(e){const t=(0,y.connectionFromListen)(e.listen);if(!t)return!1;const n="directTcp"===t.type?Object.assign({},t,{useTls:e.useTls??t.useTls??!1}):t;if((0,y.registryHasConnection)(this.hosts,n))return!0;try{return await this.probeAndUpsertConnection({connection:n,timeoutMs:Ce}),!0}catch(t){return console.warn("[HostRuntime] initial connection hint probe failed",{listen:e.listen,useTls:e.useTls,error:t}),!1}}reconcileServerId(e,t){if(e===t)return;const n=this.controllers.get(e);if(!n)return;if(this.controllers.has(t))return;Re(this.controllers,e,t),Re(this.lastConnectionStatusByServer,e,t),Re(this.connectionStatusStartedAtByServer,e,t),this.replicaCache.reconcileServerId(e,t),J.projectIconCache.reconcileServerId(e,t),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e);const s=new G.DirectorySync(t,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(t,e),markAgentLoading:()=>n.markAgentDirectorySyncLoading(),markAgentReady:()=>n.markAgentDirectorySyncReady(),markAgentError:e=>n.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(t,s),this.timelineReplicaByServer.set(t,(0,Q.createTimelineReplica)({serverId:t,storage:this.replicaCache,prepareAgent:e=>s.prepareAgentRoute(e)})),n.adoptReconciledServerId(t);const o=n.getSnapshot();this.clearHostReplica(e),this.syncSessionReplica(t,o),s.connectionChanged({client:o.client,status:"online"===o.connectionStatus?"online":"offline",source:{clientGeneration:o.clientGeneration,connectionEpoch:o.connectionEpoch}});const c=this.serverListeners.get(e);if(c){this.serverListeners.delete(e);const n=this.serverListeners.get(t)??new Set;for(const e of c)n.add(e);this.serverListeners.set(t,n)}this.hosts=this.hosts.map(n=>n.serverId===e?Object.assign({},n,{serverId:t,updatedAt:(new Date).toISOString()}):n),this.emitHostList(),this.emit(t),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}async upsertDirectConnection(e){const t=(0,f.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.upsertHostConnection({serverId:e.serverId,label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1},existingClient:e.existingClient})}async probeAndUpsertConnection(e){if("relay"===e.connection.type)throw new Error("Cannot probe a relay connection without a server id.");const t=Object.assign({serverId:""},e.password?{password:e.password}:{},{label:e.label??e.connection.id,appearance:(0,S.defaultHostAppearance)(),lifecycle:{},connections:[e.connection],preferredConnectionId:e.connection.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:n,serverId:s,hostname:o}=await this.deps.connectToDaemon(Object.assign({host:t,connection:e.connection},void 0!==e.timeoutMs?{timeoutMs:e.timeoutMs}:{}));return{profile:await this.upsertHostConnection({serverId:s,label:e.label??o??void 0,password:e.password,connection:e.connection,existingClient:n}),serverId:s,hostname:o}}async probeAndUpsertDirectConnection(e){const t=(0,f.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.probeAndUpsertConnection({label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1}})}async probeAndUpsertRemoteSshConnection(e){return this.probeAndUpsertConnection({label:e.label,connection:(0,y.createRemoteSshHostConnection)(e)})}async upsertRelayConnection(e){const t=(0,f.normalizeHostPort)(e.relayEndpoint),n=e.useTls??!1,s=e.daemonPublicKeyB64.trim();if(!s)throw new Error("daemonPublicKeyB64 is required");const o=void 0!==e.useTls,c=await this.upsertHostConnection({serverId:e.serverId,label:e.label,connection:Object.assign({id:n?`relay:wss:${t}`:`relay:${t}`,type:"relay",relayEndpoint:t},o?{useTls:n}:{},{daemonPublicKeyB64:s})});return e.password?(await this.setHostPassword(c.serverId,e.password),this.hosts.find(e=>e.serverId===c.serverId)??c):c}async confirmLink(e){return await this.loadRegistry(),this.hostConfirmations.confirmLink(e,this.hosts)}getPendingHostConfirmation(){return this.hostConfirmations.getPending()}subscribeHostConfirmation(e){return this.hostConfirmations.subscribe(e)}answerHostConfirmation(e,t){this.hostConfirmations.answer(e,t)}beginLinkPairing(){let e=null;return{submit:async(t,n)=>{const{offer:s,password:o}=Ie(t);if(!e||(l=s,(c=e).serverId!==l.serverId||!(0,u.default)((0,y.relayConnectionFromOffer)(c),(0,y.relayConnectionFromOffer)(l)))){if(!await this.confirmLink(s))return{status:"cancelled"};e=s}var c,l;const h=await this.probeAndUpsertOffer(s,n??o);return Object.assign({status:"connected"},h)}}}async importConnectionLink(e,t){if("openProject"===t){const{offer:t,password:n}=Ie(e);if(!await this.confirmLink(t))return{status:"cancelled"};return{status:"connected",serverId:(await this.upsertConnectionFromOffer(t,void 0,n)).serverId}}const n=this.beginLinkPairing();try{const t=await n.submit(e);return"cancelled"===t.status?t:{status:"connected",serverId:t.serverId}}catch(t){if(!(0,A.getConnectionAuthFailureReason)(t))throw t;return{status:"password_required",link:e,pairing:n}}}async upsertConnectionFromOffer(e,t,n){const s=(0,y.relayConnectionFromOffer)(e);return this.upsertRelayConnection({serverId:e.serverId,relayEndpoint:s.relayEndpoint,useTls:s.useTls,daemonPublicKeyB64:s.daemonPublicKeyB64,label:t,password:n})}async probeAndUpsertOffer(e,t){const n=(0,y.relayConnectionFromOffer)(e),s=Object.assign({serverId:e.serverId},t?{password:t}:{},{label:e.serverId,appearance:(0,S.defaultHostAppearance)(),lifecycle:{},connections:[n],preferredConnectionId:n.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:o,hostname:c}=await this.deps.connectToDaemon({host:s,connection:n});await o.close().catch(()=>{});return{profile:await this.upsertConnectionFromOffer(e,c??void 0,t),serverId:e.serverId,hostname:c}}async upsertConnectionFromListen(e){const t=e.listenAddress.trim(),n=e.serverId.trim(),s=(0,y.connectionFromListen)(t);if(!s)throw new Error(`Unsupported listen address: ${e.listenAddress}`);if(!n)throw new Error("Desktop daemon did not return a server id.");return this.upsertHostConnection({serverId:n,label:e.hostname??void 0,connection:s})}async updateHost(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);this.setHostsAndSync(s),await this.persistHosts()}async renameHost(e,t){await this.updateHost(e,e=>Object.assign({},e,{label:t}))}async setHostPassword(t,s){await this.updateHost(t,t=>{const o=(0,n.default)(t,e);return s?Object.assign({},o,{password:s}):o})}async setHostColor(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{color:t})}))}async setHostBadgeDisplay(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{badgeDisplay:t})}))}updateHostAppearance(e,t){const n=this.hostAppearanceMutationTail.then(()=>this.applyHostAppearance(e,t));return this.hostAppearanceMutationTail=n.catch(()=>{}),n}async applyHostAppearance(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);await this.persistHosts(s),this.setHostsAndSync(s)}async removeHost(e){await this.revokePushNotifications({client:this.getClient(e),serverId:e});const t=this.hosts.filter(t=>t.serverId!==e);this.setHostsAndSync(t),await this.persistHosts()}async removeConnection(e,t){const n=this.hosts.find(t=>t.serverId===e);if(1===n?.connections.length&&n.connections[0]?.id===t)return void await this.removeHost(e);const s=(new Date).toISOString(),o=this.hosts.map(n=>{if(n.serverId!==e)return n;const o=n.connections.filter(e=>e.id!==t);if(0===o.length)return null;const c=n.preferredConnectionId===t?o[0]?.id??null:n.preferredConnectionId;return Object.assign({},n,{connections:o,preferredConnectionId:c,updatedAt:s})}).filter(e=>null!==e);this.setHostsAndSync(o),await this.persistHosts()}async upsertHostConnection(e){const t=(new Date).toISOString(),n=(0,y.upsertHostConnectionInProfiles)({profiles:this.hosts,serverId:e.serverId,label:e.label,connection:e.connection,password:e.password,now:t});this.setHostsAndSync(n,{initialConnectionByServerId:e.existingClient?new Map([[e.serverId,{connectionId:e.connection.id,existingClient:e.existingClient}]]):void 0}),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e));const s=n.find(t=>t.serverId===e.serverId);if(!s)throw new Error(`Host ${e.serverId} was not inserted`);return s}setHostsAndSync(e,t){this.hosts=e,this.syncHosts(e,t),this.emitHostList()}async persistHosts(e=this.hosts){await this.storage.setItem(Se,JSON.stringify(e))}emitHostList(){this.hostListVersion+=1;for(const e of this.hostListListeners)e()}syncHosts(e,t){this.replicaCache.setHosts(e.map(e=>e.serverId)),J.projectIconCache.setHosts(e.map(e=>e.serverId));const n=new Set(e.map(e=>e.serverId));for(const[e,t]of this.controllers)n.has(e)||(this.controllers.delete(e),this.lastConnectionStatusByServer.delete(e),this.connectionStatusStartedAtByServer.delete(e),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e),this.clearHostReplica(e),t.stop(),this.emit(e));for(const n of e){const e=t?.initialConnectionByServerId?.get(n.serverId),s=this.controllers.get(n.serverId);if(s){s.updateHost(n),e&&s.activateConnection(e).catch(()=>{e.existingClient.close().catch(()=>{})});continue}const o=new ye({host:n,deps:this.deps,onReconcileServerId:(e,t)=>this.reconcileServerId(e,t)});this.controllers.set(n.serverId,o),k.useSessionStore.getState().initializeSession(n.serverId,null);const c=new G.DirectorySync(n.serverId,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(n.serverId,e),markAgentLoading:()=>o.markAgentDirectorySyncLoading(),markAgentReady:()=>o.markAgentDirectorySyncReady(),markAgentError:e=>o.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(n.serverId,c),this.timelineReplicaByServer.set(n.serverId,(0,Q.createTimelineReplica)({serverId:n.serverId,storage:this.replicaCache,prepareAgent:e=>c.prepareAgentRoute(e)}));const l=o.getSnapshot();this.lastConnectionStatusByServer.set(n.serverId,l.connectionStatus),this.connectionStatusStartedAtByServer.set(n.serverId,Date.now()),o.subscribe(()=>{const e=o.getSnapshot();this.syncSessionReplica(e.serverId,e),this.syncDirectoryConnection(e.serverId),this.emit(e.serverId)}),o.start(e?{initialConnection:e}:{}).catch(e=>{const t=e instanceof Error?e.message:String(e);o.markStartupError(t)}),this.emit(n.serverId)}}syncSessionReplica(e,t){if(!t.client)return;const n=k.useSessionStore.getState();n.initializeSession(e,t.client,t.clientGeneration),n.updateSessionClient(e,t.client,t.clientGeneration);const s=t.client.getLastServerInfoMessage();s&&n.updateSessionServerInfo(e,(0,k.toDaemonServerInfo)(s))}clearHostReplica(e){k.useSessionStore.getState().clearSession(e),T.useWorkspaceSetupStore.getState().clearServer(e)}syncDirectoryConnection(e){const t=this.controllers.get(e);if(!t)return this.lastConnectionStatusByServer.delete(e),void this.connectionStatusStartedAtByServer.delete(e);const n=t.getSnapshot(),s=this.directorySyncByServer.get(e);s?.connectionChanged({client:n.client,status:"online"===n.connectionStatus?"online":"offline",source:{clientGeneration:n.clientGeneration,connectionEpoch:n.connectionEpoch}});const o=this.lastConnectionStatusByServer.get(e),c=o!==n.connectionStatus,l="online"!==n.connectionStatus&&"idle"!==n.connectionStatus;!c||void 0!==o&&"online"!==o&&"idle"!==o&&l||this.connectionStatusStartedAtByServer.set(e,Date.now()),this.lastConnectionStatusByServer.set(e,n.connectionStatus);"online"===n.connectionStatus&&"online"!==o&&(k.useSessionStore.getState().bumpHistorySyncGeneration(e),(0,B.invalidateCheckoutGitQueriesForServer)(F.queryClient,e),(0,j.invalidateServerDataQueriesAfterReconnect)({queryClient:F.queryClient,serverId:e}),F.queryClient.invalidateQueries({queryKey:x.schedulesQueryBaseKey}))}drainQueuedAgentMessage(e,t){const n=`${e}:${t}`;if(this.queuedAgentDrainInFlight.has(n))return;const s=k.useSessionStore.getState().sessions[e],o=s?.queuedMessages.get(t),c=s?.client;if(!c||!o?.length||!0===s.initializingAgents.get(t))return;if((0,W.getActiveMessageSubmissions)(s.messageSubmissions.get(t)).length>0)return;this.queuedAgentDrainInFlight.add(n);const l=o[0];(0,U.sendQueuedComposerMessageNow)({agentId:t,messageId:l.id,queue:{read:t=>k.useSessionStore.getState().sessions[e]?.queuedMessages.get(t)??[],write:t=>k.useSessionStore.getState().setQueuedMessages(e,t)},submitMessage:async({text:n,attachments:s})=>{const o=!0===k.useSessionStore.getState().sessions[e]?.serverInfo?.features?.forgeSearch;await(0,U.dispatchComposerAgentMessage)({client:c,agentId:t,text:n,attachments:s,attachmentSubmitFormat:(0,N.resolveComposerAttachmentSubmitFormat)({supportsForgeAttachments:o}),encodeImages:$.encodeImages,submission:(0,V.createMessageSubmissionWriter)(e)})}}).then(n=>("failed"===n.status&&console.error("[HostRuntime] failed to drain queued agent message",{serverId:e,agentId:t,error:n.errorMessage}),n)).finally(()=>{this.queuedAgentDrainInFlight.delete(n)})}applyAgentTurnLiveness(e,t,n){this.directorySyncByServer.get(e)?.applyAgentTurnLiveness(t,n)}beginAgentCancellation(e,t){const n=++this.nextCancellationRequestId;return this.applyAgentTurnLiveness(e,t,{type:"cancellation_started",requestId:n}),n}settleAgentCancellation(e,t,n){this.applyAgentTurnLiveness(e,t,{type:"cancellation_settled",requestId:n})}acceptAgentSnapshot(e,t){return this.requireDirectory(e).acceptAgent(t)}archiveAgentSnapshot(e,t,n){this.requireDirectory(e).archiveAgent(t,n)}restoreAgentSnapshot(e,t,n){const s=this.requireDirectory(e);n?s.acceptAgent(n):s.removeAgent(t)}acceptWorkspaceSnapshots(e,t){this.requireDirectory(e).acceptWorkspaces(t)}acceptProjectSnapshot(e,t){this.requireDirectory(e).acceptProject(t)}removeWorkspaceSnapshot(e,t){this.requireDirectory(e).removeWorkspace(t)}requireDirectory(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);return t}getSnapshot(e){return this.controllers.get(e)?.getSnapshot()??null}getConnectionStatusSince(e){return this.connectionStatusStartedAtByServer.get(e)??null}getVersion(){return this.version}getClient(e){return this.controllers.get(e)?.getClient()??null}subscribe(e,t){const n=this.serverListeners.get(e)??new Set;return n.add(t),this.serverListeners.set(e,n),()=>{const n=this.serverListeners.get(e);n&&(n.delete(t),0===n.size&&this.serverListeners.delete(e))}}subscribeAll(e){return this.globalListeners.add(e),()=>{this.globalListeners.delete(e)}}getEarliestOnlineHostServerId(){let e=null,t=null;for(const n of this.hosts){const s=this.getSnapshot(n.serverId);te(s)&&s?.lastOnlineAt&&((!t||s.lastOnlineAt<t)&&(t=s.lastOnlineAt,e=n.serverId))}return e}ensureConnectedAll(e){for(const t of this.controllers.values())t.ensureConnected(e)}setAppVisible(e){e?this.ensureConnectedAll({verify:!0}):this.replicaCache.flush()}runProbeCycleNow(e){return e?this.controllers.get(e)?.runProbeCycleNow()??Promise.resolve():Promise.all(Array.from(this.controllers.values(),e=>e.runProbeCycleNow())).then(()=>{})}async refreshAgentDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);return t.refreshAgents(e)}async refreshWorkspaceDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);await t.refreshWorkspaces({subscribe:e.subscribe})}async refreshDirectories(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);await t.refreshDemand()}acquireDirectoryDemand(e){const t=this.directorySyncByServer.get(e);if(!t)return()=>{};const n={};return t.setDemand(n,!0),()=>t.setDemand(n,!1)}async prepareAgentRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareAgentRoute(t)}async prepareWorkspaceRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareWorkspaceRoute(t)}async prepareAgentTimeline(e,t){const n=this.timelineReplicaByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepare(t)}async fetchAgentTimeline(e,t,n){const s=this.directorySyncByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);const o=k.useSessionStore.getState().sessions[e]?.viewedTimelineSync,c=await s.fetchTimeline(t,n);return o&&k.useSessionStore.getState().sessions[e]?.viewedTimelineSync===o&&(o.flushStreamAgent(t),o.applyTimelineResponse(c)),c}createViewedTimelineOwner(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);const s=this.timelineReplicaByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);return(0,Q.createViewedTimelineOwner)({serverId:e,replica:s,replaceDemandedAgentIds:e=>n.setAgentRouteDemand(e),drainQueuedAgentMessage:t=>this.drainQueuedAgentMessage(e,t),ports:t})}emit(e){this.version+=1;const t=this.serverListeners.get(e);if(t){for(const e of t)e();for(const e of this.globalListeners)e()}else for(const e of this.globalListeners)e()}}let Ee=null;const Le="__paseoHostRuntimeStore";function Pe(){if(Ee)return Ee;const e=Reflect.get(globalThis,Le);return e instanceof De?(Ee=e,e):(Ee=new De,Reflect.set(globalThis,Le,Ee),Ee)}},3529,[36,454,3530,2982,37,885,3531,3482,3532,3535,3537,3526,3538,3539,3540,881,3542,3543,2898,3018,3546,3544,882,3547,2994,3007,3459,3548,3555,849,3557,3567,3585,3587,3600,3467,3591,3601,3607,3637,3641,3642,3646,3648,3650,3651]);
15175
15175
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getAppDeviceKind=function(){return(0,n.getIsElectron)()?o.DeviceKind.Desktop:n.isWeb?o.DeviceKind.Browser:o.DeviceKind.Mobile},_e.getAppDeviceLabel=async function(){if((0,n.getIsElectron)()){const e=await((0,s.getDesktopHost)()?.invoke?.("desktop_get_computer_name").catch(()=>{}));return"string"==typeof e?`Paseo Desktop \xb7 ${e}`:"Paseo Desktop"}if(n.isWeb){let e="Web";return/Safari\//.test(navigator.userAgent)&&(e="Safari"),/Chrome\//.test(navigator.userAgent)&&(e="Chrome"),/Firefox\//.test(navigator.userAgent)&&(e="Firefox"),/Edg\//.test(navigator.userAgent)&&(e="Edge"),`Browser \xb7 ${e}`}return"Android"};var e,t=r(d[0]),o=((e=t)&&e.__esModule,r(d[1])),n=r(d[2]),s=r(d[3])},3530,[26,2982,881,882]);
@@ -15199,7 +15199,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15199
15199
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildWorkspaceTabPersistenceKey=function(t){const n=t.serverId.trim(),s=t.workspaceId.trim();if(!n||!s)return null;return`${n}:${s}`}},3554,[]);
15200
15200
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"COMMIT_FILE_DIFF_STALE_TIME",{enumerable:!0,get:function(){return n}}),e.checkoutStatusQueryKey=u,e.checkoutDiffQueryKey=function(t,n,u,c,o,s){return["checkoutDiff",t,n,u,c??"",!0===o,!0===s?.includeUncommitted]},e.checkoutPrStatusQueryKey=function(t,n){return["checkoutPrStatus",t,n]},e.checkoutCommitsQueryKey=c,e.checkoutCommitFileDiffQueryKey=function(t,n,u,c){return["checkoutCommitFileDiff",t,n,u,c]},e.invalidateCheckoutGitQueriesForClient=async function(n,s){await Promise.all([n.invalidateQueries({queryKey:u(s.serverId,s.cwd)}),n.invalidateQueries({predicate:o("checkoutDiff",s)}),n.invalidateQueries({predicate:o("checkoutPrStatus",s)}),n.invalidateQueries({queryKey:c(s.serverId,s.cwd)}),n.invalidateQueries({predicate:o(t.prPaneTimelineQueryKind,s)}),n.invalidateQueries({predicate:o(t.prPanePipelineQueryKind,s)})])},e.invalidateCheckoutGitQueriesForServer=async function(n,u){const c=["checkoutStatus","checkoutPrStatus","checkoutCommits",t.prPaneTimelineQueryKind,t.prPanePipelineQueryKind];await Promise.all(c.map(t=>n.invalidateQueries({predicate:o(t,{serverId:u})})))},e.invalidatePrPaneTimelineForCheckout=async function(n,u){await Promise.all([n.invalidateQueries({predicate:o(t.prPaneTimelineQueryKind,u)}),n.invalidateQueries({predicate:o(t.prPanePipelineQueryKind,u)})])};var t=r(d[0]);const n=3e5;function u(t,n){return["checkoutStatus",t,n]}function c(t,n){return["checkoutCommits",t,n]}function o(t,n){return u=>{const c=u.queryKey;return s(c)&&c[0]===t&&c[1]===n.serverId&&(void 0===n.cwd||c[2]===n.cwd)}}function s(t){return t.length>=3&&"string"==typeof t[0]&&"string"==typeof t[1]&&"string"==typeof t[2]}},3555,[3556]);
15201
15201
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"prPaneTimelineQueryKind",{enumerable:!0,get:function(){return n}}),e.prPaneTimelineQueryKey=function({serverId:t,cwd:u,prNumber:p}){return[n,t,u,p]},Object.defineProperty(e,"prPanePipelineQueryKind",{enumerable:!0,get:function(){return t}}),e.prPanePipelineQueryKey=function({serverId:n,cwd:u,pipelineId:p,changeRequestNumber:c}){return[t,n,u,p,c]};const n="prPaneTimeline";const t="prPanePipeline"},3556,[]);
15202
- __d(function(g,r,i,a,m,_e,d){"use strict";const e=["subscriptionId"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.checkoutDiffPushRoute=function(e){return{serverData:{domain:"checkoutDiff",enabled:e.enabled,serverId:e.serverId,subscriptionId:e.subscriptionId,cwd:e.cwd,compare:e.compare}}},_e.workspaceTerminalsPushRoute=function(e){return{serverData:Object.assign({domain:"workspaceTerminals",enabled:e.enabled,serverId:e.serverId,cwd:e.cwd},e.workspaceId?{workspaceId:e.workspaceId}:{})}},_e.invalidateServerDataQueriesAfterReconnect=function(e){for(const t of y)t.invalidate(e)},_e.applyProvidersSnapshotUpdate=I,_e.mountServerDataPushRouter=function(e){const t=new Map,s=new Map;let n=!1;function o(o={checkoutDiff:t,workspaceTerminals:s}){if(n)return;const c=new Map,u=new Map;for(const t of e.queryClient.getQueryCache().getAll()){const s=C(t,e.serverId,{checkoutDiff:o.checkoutDiff,workspaceTerminals:o.workspaceTerminals});s&&("checkoutDiff"!==s.domain?u.set(M(s),s):c.set(s.subscriptionId,s))}h({active:t,client:e.client,desired:c,serverId:e.serverId,queryClient:e.queryClient}),b({active:s,client:e.client,desired:u,apply:(n,o)=>k({activeCheckoutDiffSubscriptions:t,activeTerminalSubscriptions:s,queryClient:e.queryClient,serverId:e.serverId,route:n,message:{type:"terminals_changed",payload:o}})})}const c=e.queryClient.getQueryCache().subscribe(n=>{_(n,e.serverId,{checkoutDiff:t,workspaceTerminals:s})&&o()}),u=e.client.observeEvents(["providers_snapshot_update","status.daemon_config_changed"]);return u.subscribe({snapshot:()=>{},update:t=>{"providers_snapshot_update"===t.type&&I({client:e.client,queryClient:e.queryClient,serverId:e.serverId,message:t}).catch(()=>{}),"status"===t.type&&q({queryClient:e.queryClient,serverId:e.serverId,message:t})}}),o(),()=>{n=!0,c(),u.release().catch(console.error);for(const e of t.values())e.subscription.release().catch(console.error);t.clear();for(const e of s.values())e.subscription.release().catch(console.error);s.clear()}};var t,s=r(d[0]),n=(t=s)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),u=r(d[3]),l=r(d[4]),f=r(d[5]),p=r(d[6]),v=r(d[7]);const y=[{domain:"providersSnapshot",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,v.providersSnapshotQueryRoot)(t)})}},{domain:"daemonConfig",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,f.daemonConfigQueryKey)(t)})}},{domain:"daemonPairingOffer",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,p.daemonPairingOfferQueryKey)(t)})}},{domain:"checkoutDiff",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({predicate:e=>A(e.queryKey,"checkoutDiff",t)})}},{domain:"workspaceTerminals",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({predicate:e=>A(e.queryKey,"terminals",t)})}}];async function I(e){const t=Object.assign({},e.message.payload,{requestId:"providers_snapshot_update"}),s=(0,v.normalizeProvidersSnapshotCwd)(t.cwd),n=(0,v.providersSnapshotQueryKey)(e.serverId,s),o=e.queryClient.getQueryData(n);let u=t;e.queryClient.cancelQueries({queryKey:n,exact:!0}),await e.queryClient.fetchQuery({queryKey:n,staleTime:0,structuralSharing:!1,retry:!1,queryFn:({signal:t})=>{const n=u;return u=void 0,(0,v.fetchProvidersSnapshot)(Object.assign({},e,{cwd:s,snapshot:n,signal:t}))}}),t.snapshotHash&&o?.snapshotHash===t.snapshotHash||e.queryClient.invalidateQueries({queryKey:(0,c.agentCommandsQueryRoot)(e.serverId),exact:!1})}function h(t){for(const[e,s]of t.active){const n=t.desired.get(e);n&&j(s,n)||(t.active.delete(e),s.subscription.release().catch(console.error))}for(const[s,o]of t.desired){if(t.active.has(s))continue;const c=t.client.observeCheckoutDiff(o.cwd,o.compare),u=Object.assign({},o,{subscription:c});t.active.set(s,u);const f=o=>{if(t.active.get(s)!==u)return;const{subscriptionId:c}=o,f=(0,n.default)(o,e);w({activeCheckoutDiffSubscriptions:t.active,queryClient:t.queryClient,serverId:t.serverId,subscriptionId:s,payload:Object.assign({},f,{files:(0,l.orderCheckoutDiffFiles)(o.files),requestId:o.requestId??`subscription:${c}`})})};c.subscribe({snapshot:f,update:e=>{"checkout_diff_update"===e.type&&f(e.payload)},error:e=>{t.active.get(s)===u&&t.active.delete(s),console.error("[server-data] observeCheckoutDiff failed",{serverId:t.serverId,cwd:o.cwd,error:e})}})}}function b(e){for(const[t,s]of e.active){const n=e.desired.get(t);n&&R(s,n)||(e.active.delete(t),s.subscription.release().catch(console.error))}for(const[t,s]of e.desired){if(e.active.has(t))continue;const n=e.client.observeTerminals($(s)),o=Object.assign({},s,{subscription:n});e.active.set(t,o);const c=n=>{e.active.get(t)===o&&e.apply(s,n)};n.subscribe({snapshot:c,update:e=>{"terminals_changed"===e.type&&c(e.payload)},error:n=>{e.active.get(t)===o&&e.active.delete(t),console.error("[server-data] observeTerminals failed",{cwd:s.cwd,error:n})}})}}function q(e){const t=e.message.payload;H(t)&&(e.queryClient.setQueryData((0,f.daemonConfigQueryKey)(e.serverId),t.config),e.queryClient.invalidateQueries({queryKey:(0,p.daemonPairingOfferQueryKey)(e.serverId)}))}function w(e){for(const t of e.queryClient.getQueryCache().getAll()){const s=S(t)??Q({active:e.activeCheckoutDiffSubscriptions,queryKey:t.queryKey,serverId:e.serverId});s&&"checkoutDiff"===s.domain&&s.serverId===e.serverId&&s.subscriptionId===e.subscriptionId&&(t.setOptions(Object.assign({},t.options,{structuralSharing:u.shareCheckoutDiff})),e.queryClient.setQueryData(t.queryKey,e.payload))}}function k(e){for(const t of e.queryClient.getQueryCache().getAll()){const s=C(t,e.serverId,{checkoutDiff:e.activeCheckoutDiffSubscriptions,workspaceTerminals:e.activeTerminalSubscriptions});if(!s||"workspaceTerminals"!==s.domain||!R(s,e.route))continue;const n=e.message.payload.terminals.filter(e=>e.workspaceId===s.workspaceId);e.queryClient.setQueryData(t.queryKey,t=>({cwd:e.message.payload.cwd,terminals:n,requestId:t?.requestId??`terminals-changed-${Date.now()}`}))}}function C(e,t,s){if(0===e.getObserversCount())return null;const n=S(e);return n?n.enabled&&n.serverId===t?n:null:D({active:s,queryKey:e.queryKey,serverId:t})}function D(e){return K({active:e.active.workspaceTerminals,queryKey:e.queryKey,serverId:e.serverId})??Q({active:e.active.checkoutDiff,queryKey:e.queryKey,serverId:e.serverId})}function K(e){if(!A(e.queryKey,"terminals",e.serverId))return null;const t=e.queryKey[2],s=e.queryKey[3];return"string"!=typeof t||null!=s&&"string"!=typeof s?null:e.active.get(`${t}\0${s??""}`)??null}function Q(e){if(!A(e.queryKey,"checkoutDiff",e.serverId))return null;for(const t of e.active.values())if(P(e.queryKey,t))return t;return null}function _(e,t,s){if("added"!==(n=e.type)&&"removed"!==n&&"observerAdded"!==n&&"observerRemoved"!==n&&"observerOptionsUpdated"!==n)return!1;var n;const o=S(e.query);return o?.serverId===t||null!==D({active:s,queryKey:e.query.queryKey,serverId:t})}function S(e){const t=e.meta;return U(t)&&U(t.serverData)?O(t.serverData):null}function O(e){const t=e.domain,s=e.enabled,n=e.serverId,o=e.cwd;if("boolean"!=typeof s||"string"!=typeof n||"string"!=typeof o)return null;if("checkoutDiff"===t){const c=e.subscriptionId,u=T(e.compare);return"string"==typeof c&&u?{domain:t,enabled:s,serverId:n,subscriptionId:c,cwd:o,compare:u}:null}if("workspaceTerminals"===t){const c=e.workspaceId;return void 0!==c&&"string"!=typeof c?null:Object.assign({domain:t,enabled:s,serverId:n,cwd:o},c?{workspaceId:c}:{})}return null}function T(e){const t=o.CheckoutDiffCompareSchema.safeParse(e);return t.success?t.data:null}function j(e,t){return e?.serverId===t.serverId&&e.subscriptionId===t.subscriptionId&&e.cwd===t.cwd&&e.compare.mode===t.compare.mode&&e.compare.baseRef===t.compare.baseRef&&e.compare.ignoreWhitespace===t.compare.ignoreWhitespace&&e.compare.includeUncommitted===t.compare.includeUncommitted}function P(e,t){return"checkoutDiff"===e[0]&&e[1]===t.serverId&&e[2]===t.cwd&&e[3]===t.compare.mode&&e[4]===(t.compare.baseRef??"")&&e[5]===(!0===t.compare.ignoreWhitespace)&&!0===e[6]==(!0===t.compare.includeUncommitted)}function R(e,t){return e.serverId===t.serverId&&e.cwd===t.cwd&&e.workspaceId===t.workspaceId}function M(e){return`${e.cwd}\0${e.workspaceId??""}`}function $(e){return Object.assign({cwd:e.cwd},e.workspaceId?{workspaceId:e.workspaceId}:{})}function A(e,t,s){return e.length>=2&&e[0]===t&&e[1]===s}function U(e){return"object"==typeof e&&null!==e}function H(e){return"daemon_config_changed"===e.status&&U(e.config)}},3557,[36,2977,3558,3559,3560,3562,3563,3564]);
15202
+ __d(function(g,r,i,a,m,_e,d){"use strict";const e=["subscriptionId"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.checkoutDiffPushRoute=function(e){return{serverData:{domain:"checkoutDiff",enabled:e.enabled,serverId:e.serverId,subscriptionId:e.subscriptionId,cwd:e.cwd,compare:e.compare}}},_e.workspaceTerminalsPushRoute=function(e){return{serverData:Object.assign({domain:"workspaceTerminals",enabled:e.enabled,serverId:e.serverId,cwd:e.cwd},e.workspaceId?{workspaceId:e.workspaceId}:{})}},_e.invalidateServerDataQueriesAfterReconnect=function(e){for(const t of y)t.invalidate(e)},_e.applyProvidersSnapshotUpdate=I,_e.mountServerDataPushRouter=function(e){const t=new Map,s=new Map;let n=!1;function o(o={checkoutDiff:t,workspaceTerminals:s}){if(n)return;const c=new Map,u=new Map;for(const t of e.queryClient.getQueryCache().getAll()){const s=C(t,e.serverId,{checkoutDiff:o.checkoutDiff,workspaceTerminals:o.workspaceTerminals});s&&("checkoutDiff"!==s.domain?u.set(M(s),s):c.set(s.subscriptionId,s))}h({active:t,client:e.client,desired:c,serverId:e.serverId,queryClient:e.queryClient}),b({active:s,client:e.client,desired:u,apply:(n,o)=>k({activeCheckoutDiffSubscriptions:t,activeTerminalSubscriptions:s,queryClient:e.queryClient,serverId:e.serverId,route:n,message:{type:"terminals_changed",payload:o}})})}const c=e.queryClient.getQueryCache().subscribe(n=>{_(n,e.serverId,{checkoutDiff:t,workspaceTerminals:s})&&o()}),u=e.client.observeEvents(["providers_snapshot_update","status.daemon_config_changed"]);return u.subscribe({snapshot:()=>{},update:t=>{"providers_snapshot_update"===t.type&&I({client:e.client,queryClient:e.queryClient,serverId:e.serverId,message:t}).catch(()=>{}),"status"===t.type&&q({queryClient:e.queryClient,serverId:e.serverId,message:t})}}),o(),()=>{n=!0,c(),u.release().catch(console.error);for(const e of t.values())e.subscription.release().catch(console.error);t.clear();for(const e of s.values())e.subscription.release().catch(console.error);s.clear()}};var t,s=r(d[0]),n=(t=s)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),u=r(d[3]),l=r(d[4]),f=r(d[5]),p=r(d[6]),v=r(d[7]);const y=[{domain:"providersSnapshot",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,v.providersSnapshotQueryRoot)(t)})}},{domain:"daemonConfig",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,f.daemonConfigQueryKey)(t)})}},{domain:"daemonPairingOffer",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({queryKey:(0,p.daemonPairingOfferQueryKey)(t)})}},{domain:"checkoutDiff",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({predicate:e=>A(e.queryKey,"checkoutDiff",t)})}},{domain:"workspaceTerminals",invalidate:({queryClient:e,serverId:t})=>{e.invalidateQueries({predicate:e=>A(e.queryKey,"terminals",t)})}}];async function I(e){const t=Object.assign({},e.message.payload,{requestId:"providers_snapshot_update"}),s=(0,v.normalizeProvidersSnapshotCwd)(t.cwd),n=(0,v.providersSnapshotQueryKey)(e.serverId,s),o=e.queryClient.getQueryData(n);let u=t;e.queryClient.cancelQueries({queryKey:n,exact:!0}),await e.queryClient.fetchQuery({queryKey:n,staleTime:0,structuralSharing:!1,retry:!1,queryFn:({signal:t})=>{const n=u;return u=void 0,(0,v.fetchProvidersSnapshot)(Object.assign({},e,{cwd:s,snapshot:n,signal:t}))}}),t.snapshotHash&&o?.snapshotHash===t.snapshotHash||e.queryClient.invalidateQueries({queryKey:(0,c.agentCommandsQueryRoot)(e.serverId),exact:!1})}function h(t){for(const[e,s]of t.active){const n=t.desired.get(e);n&&j(s,n)||(t.active.delete(e),s.subscription.release().catch(console.error))}for(const[s,o]of t.desired){if(t.active.has(s))continue;const c=t.client.observeCheckoutDiff(o.cwd,o.compare),u=Object.assign({},o,{subscription:c});t.active.set(s,u);const f=o=>{if(t.active.get(s)!==u)return;const{subscriptionId:c}=o,f=(0,n.default)(o,e);w({activeCheckoutDiffSubscriptions:t.active,queryClient:t.queryClient,serverId:t.serverId,subscriptionId:s,payload:Object.assign({},f,{files:(0,l.orderCheckoutDiffFiles)(o.files),requestId:o.requestId??`subscription:${c}`})})};c.subscribe({snapshot:f,update:e=>{"checkout_diff_update"===e.type&&f(e.payload)},error:e=>{t.active.get(s)===u&&t.active.delete(s),console.error("[server-data] observeCheckoutDiff failed",{serverId:t.serverId,cwd:o.cwd,error:e})}})}}function b(e){for(const[t,s]of e.active){const n=e.desired.get(t);n&&R(s,n)||(e.active.delete(t),s.subscription.release().catch(console.error))}for(const[t,s]of e.desired){if(e.active.has(t))continue;const n=e.client.observeTerminals($(s)),o=Object.assign({},s,{subscription:n});e.active.set(t,o);const c=n=>{e.active.get(t)===o&&e.apply(s,n)};n.subscribe({snapshot:c,update:e=>{"terminals_changed"===e.type&&c(e.payload)},error:n=>{e.active.get(t)===o&&e.active.delete(t),console.error("[server-data] observeTerminals failed",{cwd:s.cwd,error:n})}})}}function q(e){const t=e.message.payload;H(t)&&(e.queryClient.setQueryData((0,f.daemonConfigQueryKey)(e.serverId),t.config),e.queryClient.invalidateQueries({queryKey:(0,p.daemonPairingOfferQueryKey)(e.serverId)}))}function w(e){for(const t of e.queryClient.getQueryCache().getAll()){const s=S(t)??Q({active:e.activeCheckoutDiffSubscriptions,queryKey:t.queryKey,serverId:e.serverId});s&&"checkoutDiff"===s.domain&&s.serverId===e.serverId&&s.subscriptionId===e.subscriptionId&&(t.setOptions(Object.assign({},t.options,{structuralSharing:u.shareCheckoutDiff})),e.queryClient.setQueryData(t.queryKey,e.payload))}}function k(e){for(const t of e.queryClient.getQueryCache().getAll()){const s=C(t,e.serverId,{checkoutDiff:e.activeCheckoutDiffSubscriptions,workspaceTerminals:e.activeTerminalSubscriptions});if(!s||"workspaceTerminals"!==s.domain||!R(s,e.route))continue;const n=e.message.payload.terminals.filter(e=>e.workspaceId===s.workspaceId);e.queryClient.setQueryData(t.queryKey,t=>({cwd:e.message.payload.cwd,terminals:n,requestId:t?.requestId??`terminals-changed-${Date.now()}`}))}}function C(e,t,s){if(0===e.getObserversCount())return null;for(const s of e.observers){const e=S({meta:s.options.meta});if(e?.enabled&&e.serverId===t)return e}const n=S(e);return n?n.enabled&&n.serverId===t?n:null:D({active:s,queryKey:e.queryKey,serverId:t})}function D(e){return K({active:e.active.workspaceTerminals,queryKey:e.queryKey,serverId:e.serverId})??Q({active:e.active.checkoutDiff,queryKey:e.queryKey,serverId:e.serverId})}function K(e){if(!A(e.queryKey,"terminals",e.serverId))return null;const t=e.queryKey[2],s=e.queryKey[3];return"string"!=typeof t||null!=s&&"string"!=typeof s?null:e.active.get(`${t}\0${s??""}`)??null}function Q(e){if(!A(e.queryKey,"checkoutDiff",e.serverId))return null;for(const t of e.active.values())if(P(e.queryKey,t))return t;return null}function _(e,t,s){if("added"!==(n=e.type)&&"removed"!==n&&"observerAdded"!==n&&"observerRemoved"!==n&&"observerOptionsUpdated"!==n)return!1;var n;const o=S(e.query);return o?.serverId===t||null!==D({active:s,queryKey:e.query.queryKey,serverId:t})}function S(e){const t=e.meta;return U(t)&&U(t.serverData)?O(t.serverData):null}function O(e){const t=e.domain,s=e.enabled,n=e.serverId,o=e.cwd;if("boolean"!=typeof s||"string"!=typeof n||"string"!=typeof o)return null;if("checkoutDiff"===t){const c=e.subscriptionId,u=T(e.compare);return"string"==typeof c&&u?{domain:t,enabled:s,serverId:n,subscriptionId:c,cwd:o,compare:u}:null}if("workspaceTerminals"===t){const c=e.workspaceId;return void 0!==c&&"string"!=typeof c?null:Object.assign({domain:t,enabled:s,serverId:n,cwd:o},c?{workspaceId:c}:{})}return null}function T(e){const t=o.CheckoutDiffCompareSchema.safeParse(e);return t.success?t.data:null}function j(e,t){return e?.serverId===t.serverId&&e.subscriptionId===t.subscriptionId&&e.cwd===t.cwd&&e.compare.mode===t.compare.mode&&e.compare.baseRef===t.compare.baseRef&&e.compare.ignoreWhitespace===t.compare.ignoreWhitespace&&e.compare.includeUncommitted===t.compare.includeUncommitted}function P(e,t){return"checkoutDiff"===e[0]&&e[1]===t.serverId&&e[2]===t.cwd&&e[3]===t.compare.mode&&e[4]===(t.compare.baseRef??"")&&e[5]===(!0===t.compare.ignoreWhitespace)&&!0===e[6]==(!0===t.compare.includeUncommitted)}function R(e,t){return e.serverId===t.serverId&&e.cwd===t.cwd&&e.workspaceId===t.workspaceId}function M(e){return`${e.cwd}\0${e.workspaceId??""}`}function $(e){return Object.assign({cwd:e.cwd},e.workspaceId?{workspaceId:e.workspaceId}:{})}function A(e,t,s){return e.length>=2&&e[0]===t&&e[1]===s}function U(e){return"object"==typeof e&&null!==e}function H(e){return"daemon_config_changed"===e.status&&U(e.config)}},3557,[36,2977,3558,3559,3560,3562,3563,3564]);
15203
15203
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AGENT_COMMANDS_QUERY_ROOT",{enumerable:!0,get:function(){return t}}),e.normalizeAgentCommandsCwd=o,e.agentCommandsQueryRoot=u,e.sessionAgentCommandsQueryKey=s,e.draftAgentCommandsQueryKey=c,e.resetDraftAgentCommandsForCheckout=function(n,t){return n.resetQueries({queryKey:f(t)})},e.agentCommandsQueryKey=function(n){if(n.draftConfig)return c({serverId:n.serverId,draftConfig:n.draftConfig});return s({serverId:n.serverId,agentId:n.agentId})};var n=r(d[0]);const t="agentCommands";function o(t){return(0,n.normalizeWorkspacePath)(t)??""}function u(n){return[t,n]}function s(n){return[...u(n.serverId),"session",n.agentId]}function f(n){return[...u(n.serverId),"draft","cwd",o(n.cwd)]}function c(n){const{draftConfig:t}=n;return[...f({serverId:n.serverId,cwd:t.cwd}),"provider",t.provider,"mode",t.modeId??null,"model",t.model??null,"thinking",t.thinkingOptionId??null,"features",t.featureValues??null]}},3558,[3468]);
15204
15204
  __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.retainDiffFiles=n,e.shareCheckoutDiff=function(o,s){const l=s,f=o;if(!f||f===l)return l;const u=n(f.files,l.files),a=(0,t.replaceEqualDeep)(f.error,l.error);return u===f.files&&a===f.error&&f.cwd===l.cwd&&f.requestId===l.requestId&&f.historyStatus===l.historyStatus&&f.diffTooLarge===l.diffTooLarge?f:Object.assign({},l,{files:u,error:a})},e.shareCommitFileDiff=function(t,n){const s=n,l=t;return l&&(l.file===s.file||l.file&&s.file&&o(l.file,s.file))?l:s};var t=r(d[0]);function n(t,n){if(t===n)return t;const s=new Map(t.map(t=>[t.path,t]));let l=t.length===n.length;const f=n.map((n,f)=>{const u=s.get(n.path),a=u&&o(u,n)?u:n;return l&&=a===t[f],a});return l?t:f}function o(t,n){if(t===n)return!0;if(t.path!==n.path||t.oldPath!==n.oldPath||t.status!==n.status||t.isNew!==n.isNew||t.isDeleted!==n.isDeleted||t.additions!==n.additions||t.deletions!==n.deletions||t.targetRef!==n.targetRef||t.lineCount!==n.lineCount||t.hunks.length!==n.hunks.length)return!1;for(let o=0;o<t.hunks.length;o++){const l=t.hunks[o],f=n.hunks[o];if(l!==f){if(l.oldStart!==f.oldStart||l.oldCount!==f.oldCount||l.newStart!==f.newStart||l.newCount!==f.newCount||l.lines.length!==f.lines.length)return!1;if(!s(l.lines,f.lines))return!1}}return!0}function s(t,n){for(let o=0;o<t.length;o++){const s=t[o],l=n[o];if(s!==l){if(s.type!==l.type||s.content!==l.content)return!1;if(s.tokens!==l.tokens){if(!s.tokens||!l.tokens||s.tokens.length!==l.tokens.length)return!1;for(let t=0;t<s.tokens.length;t++){const n=s.tokens[t],o=l.tokens[t];if(n.text!==o.text||n.style!==o.style)return!1}}}}return!0}},3559,[800]);
15205
15205
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.orderCheckoutDiffFiles=function(t){if(t.length<2)return t;return(0,f.flattenDiffTree)((0,f.buildDiffTree)(t),new Set).flatMap(f=>"file"===f.kind?[f.file]:[])};var f=r(d[0])},3560,[3561]);
@@ -15343,7 +15343,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15343
15343
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["value","onValueChange","disabled"],t=["value","options","onValueChange","disabled"],l=["initialValue","onChangeText","placeholder","disabled","secureTextEntry","ref"],n=["actionLabel","onPress","disabled"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SettingsGroup",{enumerable:!0,get:function(){return V.SettingsGroup}}),Object.defineProperty(_e,"SettingsSection",{enumerable:!0,get:function(){return _.SettingsSection}}),Object.defineProperty(_e,"SettingsCollapsibleRow",{enumerable:!0,get:function(){return I.SettingsCollapsibleRow}}),_e.SettingsCard=function(e){const t=(0,h.c)(5),{children:l,testID:n}=e;let s,c;t[0]!==l?(s=x.Children.toArray(l).map(R),t[0]=l,t[1]=s):s=t[1];t[2]!==s||t[3]!==n?(c=(0,C.jsx)(u.View,{style:T.settingsStyles.card,testID:n,children:s}),t[2]=s,t[3]=n,t[4]=c):c=t[4];return c},_e.SettingsRow=D,_e.SettingsSwitch=function(t){const l=(0,h.c)(13);let n,s,c,u,b,x;if(l[0]!==t){var p=t;({value:u,onValueChange:s,disabled:n}=p),c=(0,o.default)(p,e),l[0]=t,l[1]=n,l[2]=s,l[3]=c,l[4]=u}else n=l[1],s=l[2],c=l[3],u=l[4];l[5]!==n||l[6]!==s||l[7]!==c.label||l[8]!==u?(b=(0,C.jsx)(f.Switch,{value:u,onValueChange:s,disabled:n,accessibilityLabel:c.label}),l[5]=n,l[6]=s,l[7]=c.label,l[8]=u,l[9]=b):b=l[9];l[10]!==c||l[11]!==b?(x=(0,C.jsx)(D,Object.assign({},c,{children:b})),l[10]=c,l[11]=b,l[12]=x):x=l[12];return x},_e.SettingsSelect=function(e){const l=(0,h.c)(28);let n,s,c,u,b,x;if(l[0]!==e){var p=e;({value:b,options:c,onValueChange:s,disabled:n}=p),u=(0,o.default)(p,t),l[0]=e,l[1]=n,l[2]=s,l[3]=c,l[4]=u,l[5]=b}else n=l[1],s=l[2],c=l[3],u=l[4],b=l[5];l[6]!==c||l[7]!==b?(x=c.find(e=>e.value===b)?.label??b,l[6]=c,l[7]=b,l[8]=x):x=l[8];const f=x,y=`${u.label}: ${f}`;let S,v,T,V,_;l[9]!==n||l[10]!==f||l[11]!==y?(S=(0,C.jsx)(w.DropdownTrigger,{disabled:n,accessibilityRole:"button",accessibilityLabel:y,children:f}),l[9]=n,l[10]=f,l[11]=y,l[12]=S):S=l[12];if(l[13]!==s||l[14]!==c||l[15]!==b){let e;l[17]!==s||l[18]!==b?(e=e=>(0,C.jsx)(O,{option:e,selected:e.value===b,onValueChange:s},e.value),l[17]=s,l[18]=b,l[19]=e):e=l[19],v=c.map(e),l[13]=s,l[14]=c,l[15]=b,l[16]=v}else v=l[16];l[20]!==v?(T=(0,C.jsx)(j.DropdownMenuContent,{side:"bottom",align:"end",width:220,children:v}),l[20]=v,l[21]=T):T=l[21];l[22]!==S||l[23]!==T?(V=(0,C.jsxs)(j.DropdownMenu,{children:[S,T]}),l[22]=S,l[23]=T,l[24]=V):V=l[24];l[25]!==u||l[26]!==V?(_=(0,C.jsx)(D,Object.assign({},u,{children:V})),l[25]=u,l[26]=V,l[27]=_):_=l[27];return _},_e.SettingsInput=function(e){const t=(0,h.c)(21);let n,s,c,u,b,p,f;if(t[0]!==e){var y=e;({initialValue:s,onChangeText:c,placeholder:u,disabled:n,secureTextEntry:f,ref:b}=y),p=(0,o.default)(y,l),t[0]=e,t[1]=n,t[2]=s,t[3]=c,t[4]=u,t[5]=b,t[6]=p,t[7]=f}else n=t[1],s=t[2],c=t[3],u=t[4],b=t[5],p=t[6],f=t[7];const j=(0,v.useIsCompactFormFactor)(),w=(0,x.useRef)(null);let T,V;t[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>({focus:()=>w.current?.focus(),blur:()=>w.current?.blur(),getText:()=>w.current?.getText()??"",replaceText:e=>w.current?.replaceText(e)}),V=[],t[8]=T,t[9]=V):(T=t[8],V=t[9]);(0,x.useImperativeHandle)(b,T,V);const _=!n,I=j?"md":"sm";let R,O;t[10]!==s||t[11]!==c||t[12]!==u||t[13]!==p.label||t[14]!==f||t[15]!==_||t[16]!==I?(R=(0,C.jsx)(S.FormTextInput,{ref:w,initialValue:s,onChangeText:c,placeholder:u,editable:_,secureTextEntry:f,accessibilityLabel:p.label,size:I,style:L.input}),t[10]=s,t[11]=c,t[12]=u,t[13]=p.label,t[14]=f,t[15]=_,t[16]=I,t[17]=R):R=t[17];t[18]!==p||t[19]!==R?(O=(0,C.jsx)(D,Object.assign({},p,{children:R})),t[18]=p,t[19]=R,t[20]=O):O=t[20];return O},_e.SettingsAction=function(e){const t=(0,h.c)(12);let l,s,c,u,b,x;if(t[0]!==e){var p=e;({actionLabel:l,onPress:c,disabled:s}=p),u=(0,o.default)(p,n),t[0]=e,t[1]=l,t[2]=s,t[3]=c,t[4]=u}else l=t[1],s=t[2],c=t[3],u=t[4];t[5]!==l||t[6]!==s||t[7]!==c?(b=(0,C.jsx)(y.Button,{variant:"outline",size:"sm",onPress:c,disabled:s,children:l}),t[5]=l,t[6]=s,t[7]=c,t[8]=b):b=t[8];t[9]!==u||t[10]!==b?(x=(0,C.jsx)(D,Object.assign({},u,{children:b})),t[9]=u,t[10]=b,t[11]=x):x=t[11];return x};var s,c=r(d[0]),o=(s=c)&&s.__esModule?s:{default:s},u=r(d[1]),b=r(d[2]),h=r(d[3]),x=r(d[4]);r(d[5]),r(d[6]);var p=r(d[7]),f=r(d[8]),y=r(d[9]),S=r(d[10]),j=r(d[11]),w=r(d[12]),v=r(d[13]),T=r(d[14]),C=r(d[15]),V=r(d[16]),_=r(d[17]),I=r(d[18]);function R(e,t){return(0,C.jsx)(u.View,{style:t?T.settingsStyles.rowBorder:void 0,children:e},(0,x.isValidElement)(e)?e.key:t)}function D(e){const t=(0,h.c)(20),{label:l,labelAccessory:n,hint:s,error:c,children:o,testID:x}=e,p=(0,v.useIsCompactFormFactor)()&&L.compactRow;let f;t[0]!==p?(f=[T.settingsStyles.row,p],t[0]=p,t[1]=f):f=t[1];const y=f;let S,j,w,V,_,I;return t[2]!==l||t[3]!==n?(S=n?(0,C.jsxs)(u.View,{style:L.labelRow,children:[(0,C.jsx)(b.Text,{style:[T.settingsStyles.rowTitle,L.accessoryLabel],children:l}),n]}):(0,C.jsx)(b.Text,{style:T.settingsStyles.rowTitle,children:l}),t[2]=l,t[3]=n,t[4]=S):S=t[4],t[5]!==s?(j="string"==typeof s?(0,C.jsx)(b.Text,{style:T.settingsStyles.rowHint,children:s}):s,t[5]=s,t[6]=j):j=t[6],t[7]!==c?(w=c?(0,C.jsx)(b.Text,{accessibilityRole:"alert",style:T.settingsStyles.rowError,children:c}):null,t[7]=c,t[8]=w):w=t[8],t[9]!==S||t[10]!==j||t[11]!==w?(V=(0,C.jsxs)(u.View,{style:L.label,children:[S,j,w]}),t[9]=S,t[10]=j,t[11]=w,t[12]=V):V=t[12],t[13]!==o?(_=o?(0,C.jsx)(u.View,{style:L.control,children:o}):null,t[13]=o,t[14]=_):_=t[14],t[15]!==y||t[16]!==V||t[17]!==_||t[18]!==x?(I=(0,C.jsxs)(u.View,{style:y,testID:x,children:[V,_]}),t[15]=y,t[16]=V,t[17]=_,t[18]=x,t[19]=I):I=t[19],I}function O(e){const t=(0,h.c)(7),{option:l,selected:n,onValueChange:s}=e;let c;t[0]!==s||t[1]!==l.value?(c=()=>s(l.value),t[0]=s,t[1]=l.value,t[2]=c):c=t[2];const o=c;let u;return t[3]!==l.label||t[4]!==o||t[5]!==n?(u=(0,C.jsx)(j.DropdownMenuItem,{selected:n,onSelect:o,children:l.label}),t[3]=l.label,t[4]=o,t[5]=n,t[6]=u):u=t[6],u}const L=p.StyleSheet.create(e=>({compactRow:{flexWrap:"wrap",gap:e.spacing[3],uni__dependencies:[0]},label:{flexGrow:1,flexShrink:1,flexBasis:160,marginRight:e.spacing[3],uni__dependencies:[0]},labelRow:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},accessoryLabel:{flexShrink:1,minWidth:0},control:{flexShrink:1,maxWidth:"100%"},input:{minWidth:180}}))},3688,[36,896,897,454,37,235,147,57,3689,3022,3690,3702,3721,1217,3722,280,3723,3725,3726]);
15344
15344
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Switch=function(e){const l=(0,o.c)(21),{value:s,onValueChange:n,disabled:c,accessibilityLabel:u,testID:_,style:w}=e,C=void 0!==c&&c;let k;l[0]!==C||l[1]!==n||l[2]!==s?(k=t=>{t.stopPropagation(),C||n?.(!s)},l[0]=C,l[1]=n,l[2]=s,l[3]=k):k=l[3];const p=k;let O;l[4]!==C||l[5]!==s?(O={checked:s,disabled:C},l[4]=C,l[5]=s,l[6]=O):O=l[6];const y=O,v=C?b.disabled:null;let G;l[7]!==w||l[8]!==v?(G=[b.switchControl,v,w],l[7]=w,l[8]=v,l[9]=G):G=l[9];const T=G;let I,S;l[10]!==s?(I=(0,h.jsx)(f,{value:s}),l[10]=s,l[11]=I):I=l[11];l[12]!==u||l[13]!==y||l[14]!==C||l[15]!==p||l[16]!==T||l[17]!==I||l[18]!==_||l[19]!==s?(S=(0,h.jsx)(t.Pressable,{onPress:p,disabled:C,hitSlop:8,accessibilityRole:"switch",accessibilityState:y,accessibilityLabel:u,"aria-checked":s,testID:_,style:T,children:I}),l[12]=u,l[13]=y,l[14]=C,l[15]=p,l[16]=T,l[17]=I,l[18]=_,l[19]=s,l[20]=S):S=l[20];return S};var t=r(d[0]),o=r(d[1]);r(d[2]),r(d[3]);var e,l=r(d[4]),s=(e=l)&&e.__esModule?e:{default:e},n=r(d[5]),c=r(d[6]),h=r(d[7]);const u={duration:180,easing:l.Easing.inOut(l.Easing.ease)},_={code:"function switchTsx1(){const{withTiming,value,TIMING}=this.__closure;return withTiming(value?1:0,TIMING);}"},w={code:"function switchTsx2(){const{interpolateColor,progress,trackOffColor,trackOnColor}=this.__closure;return{backgroundColor:interpolateColor(progress.value,[0,1],[trackOffColor,trackOnColor])};}"},C={code:"function switchTsx3(){const{interpolateColor,progress,thumbOffColor,thumbOnColor,switchGeometry}=this.__closure;return{backgroundColor:interpolateColor(progress.value,[0,1],[thumbOffColor,thumbOnColor]),transform:[{translateX:progress.value*switchGeometry.thumbTravel}]};}"};const f=(0,n.withUnistyles)(function(t){const e=(0,o.c)(9),{value:n,trackOffColor:f,trackOnColor:k,thumbOffColor:p,thumbOnColor:O}=t,y=(0,l.useDerivedValue)((function({_worklet_2397555475930_init_data:t,withTiming:o,value:e,TIMING:l}){const s=()=>o(e?1:0,l);return s.__closure={withTiming:o,value:e,TIMING:l},s.__workletHash=2397555475930,s.__initData=t,s})({_worklet_2397555475930_init_data:_,withTiming:l.withTiming,value:n,TIMING:u})),v=(0,l.useAnimatedStyle)((function({_worklet_784334226390_init_data:t,interpolateColor:o,progress:e,trackOffColor:l,trackOnColor:s}){const n=()=>({backgroundColor:o(e.value,[0,1],[l,s])});return n.__closure={interpolateColor:o,progress:e,trackOffColor:l,trackOnColor:s},n.__workletHash=784334226390,n.__initData=t,n})({_worklet_784334226390_init_data:w,interpolateColor:l.interpolateColor,progress:y,trackOffColor:f,trackOnColor:k})),G=(0,l.useAnimatedStyle)((function({_worklet_9906552789735_init_data:t,interpolateColor:o,progress:e,thumbOffColor:l,thumbOnColor:s,switchGeometry:n}){const c=()=>({backgroundColor:o(e.value,[0,1],[l,s]),transform:[{translateX:e.value*n.thumbTravel}]});return c.__closure={interpolateColor:o,progress:e,thumbOffColor:l,thumbOnColor:s,switchGeometry:n},c.__workletHash=9906552789735,c.__initData=t,c})({_worklet_9906552789735_init_data:C,interpolateColor:l.interpolateColor,progress:y,thumbOffColor:p,thumbOnColor:O,switchGeometry:c.switchGeometry}));let T;e[0]!==v?(T=[b.switchTrack,v],e[0]=v,e[1]=T):T=e[1];const I=T;let S;e[2]!==G?(S=[b.switchThumb,b.thumb,G],e[2]=G,e[3]=S):S=e[3];const j=S;let x,M;return e[4]!==j?(x=(0,h.jsx)(s.default.View,{style:j}),e[4]=j,e[5]=x):x=e[5],e[6]!==x||e[7]!==I?(M=(0,h.jsx)(s.default.View,{style:I,children:x}),e[6]=x,e[7]=I,e[8]=M):M=e[8],M},t=>({trackOffColor:t.colors.surface3,trackOnColor:t.colors.accent,thumbOffColor:t.colors.palette.white,thumbOnColor:t.colors.accentForeground}));const b=n.StyleSheet.create(t=>{const o=(0,c.createControlGeometry)(t);return{switchControl:Object.assign({},o.switchControl),switchTrack:{width:c.switchGeometry.trackWidth,height:c.switchGeometry.trackHeight,borderRadius:c.switchGeometry.trackHeight/2,padding:(c.switchGeometry.trackHeight-c.switchGeometry.thumbSize)/2,justifyContent:"center"},switchThumb:{width:c.switchGeometry.thumbSize,height:c.switchGeometry.thumbSize,borderRadius:c.switchGeometry.thumbSize/2},thumb:{shadowColor:"rgba(0, 0, 0, 0.25)",shadowOffset:{width:0,height:1},shadowRadius:2,shadowOpacity:1,elevation:2},disabled:{opacity:t.opacity[50],uni__dependencies:[0]}}})},3689,[898,454,37,426,899,57,3025,280]);
15345
15345
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["color","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","includeFontPadding","letterSpacing","lineHeight","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowOffset","textShadowRadius","textTransform","writingDirection"],t=["size","style","chromeStyle","onFocus","onBlur","editable"];function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Field=function(e){const t=(0,u.c)(16),{label:n,children:o,trailing:s,hint:f,error:h,testID:S}=e,x=S?`${S}-hint`:void 0,y=S?`${S}-error`:void 0;let b;e:{if(h){let e;t[0]!==h||t[1]!==y?(e=(0,p.jsx)(c.Text,{numberOfLines:1,style:j.errorText,testID:y,children:h}),t[0]=h,t[1]=y,t[2]=e):e=t[2],b=e;break e}if(f){let e;t[3]!==f||t[4]!==x?(e=(0,p.jsx)(c.Text,{style:j.hintText,testID:x,children:f}),t[3]=f,t[4]=x,t[5]=e):e=t[5],b=e;break e}b=null}const v=b;let D,_,w;t[6]!==n?(D=(0,p.jsx)(c.Text,{style:j.label,children:n}),t[6]=n,t[7]=D):D=t[7];t[8]!==D||t[9]!==s?(_=(0,p.jsxs)(l.View,{style:j.header,children:[D,s]}),t[8]=D,t[9]=s,t[10]=_):_=t[10];t[11]!==o||t[12]!==v||t[13]!==_||t[14]!==S?(w=(0,p.jsxs)(l.View,{style:j.container,testID:S,children:[_,o,v]}),t[11]=o,t[12]=v,t[13]=_,t[14]=S,t[15]=w):w=t[15];return w},Object.defineProperty(_e,"FormTextInput",{enumerable:!0,get:function(){return _}});var o=n(r(d[0])),l=r(d[1]),c=r(d[2]),s=r(d[3]),u=r(d[4]),f=r(d[5]);r(d[6]);var h=n(r(d[7]));r(d[8]),r(d[9]);var S=r(d[10]),x=r(d[11]),y=r(d[12]),p=r(d[13]);function b(t){const n=h.default.flatten(t);if(!n)return{};const{color:l,fontFamily:c,fontSize:s,fontStyle:u,fontVariant:f,fontWeight:S,includeFontPadding:x,letterSpacing:y,lineHeight:p,textAlign:b,textAlignVertical:D,textDecorationColor:_,textDecorationLine:j,textDecorationStyle:w,textShadowColor:O,textShadowOffset:z,textShadowRadius:T,textTransform:C,writingDirection:M}=n,A={color:l,fontFamily:c,fontSize:s,fontStyle:u,fontVariant:f,fontWeight:S,includeFontPadding:x,letterSpacing:y,lineHeight:p,textAlign:b,textAlignVertical:D,textDecorationColor:_,textDecorationLine:j,textDecorationStyle:w,textShadowColor:O,textShadowOffset:z,textShadowRadius:T,textTransform:C,writingDirection:M};return{chromeStyle:v((0,o.default)(n,e)),inputStyle:v(A)}}function v(e){const t={};for(const[n,o]of Object.entries(e))n.startsWith("unistyles_")||void 0===o||(t[n]=o);return t}function D(e,t){"function"!=typeof e?e&&(e.current=t):e(t)}const _=(0,f.forwardRef)(function(e,n){const l=(0,u.c)(36);let c,h,S,v,_,j,O;if(l[0]!==e){var z=e;({size:O,style:j,chromeStyle:c,onFocus:v,onBlur:S,editable:h}=z),_=(0,o.default)(z,t),l[0]=e,l[1]=c,l[2]=h,l[3]=S,l[4]=v,l[5]=_,l[6]=j,l[7]=O}else c=l[1],h=l[2],S=l[3],v=l[4],_=l[5],j=l[6],O=l[7];const T=void 0===O?"md":O,[C,M]=(0,f.useState)(!1),A=!1===h,F="sm"===T?w.chromeSm:w.chromeMd,H="sm"===T?w.inputSm:w.inputMd;let V;l[8]!==j?(V=b(j),l[8]=j,l[9]=V):V=l[9];const W=V;let I;l[10]!==n?(I=e=>{D(n,e)},l[10]=n,l[11]=I):I=l[11];const R=I;let P;l[12]!==v?(P=e=>{M(!0),v?.(e)},l[12]=v,l[13]=P):P=l[13];const k=P;let L;l[14]!==S?(L=e=>{M(!1),S?.(e)},l[14]=S,l[15]=L):L=l[15];const B=L;let $;l[16]!==H||l[17]!==W.inputStyle?($=[w.input,H,W.inputStyle],l[16]=H,l[17]=W.inputStyle,l[18]=$):$=l[18];const G=$;let q;l[19]!==c||l[20]!==F||l[21]!==C||l[22]!==A||l[23]!==W.chromeStyle?(q=e=>{const{hovered:t}=e,n=void 0!==t&&t;return[w.chrome,F,(0,y.resolveControlInteractionStyles)({controlRest:w.controlRest,controlHover:w.controlHover,controlActive:w.controlActive,controlDisabled:w.controlDisabled},{hovered:n,focused:C,disabled:A}),W.chromeStyle,c]},l[19]=c,l[20]=F,l[21]=C,l[22]=A,l[23]=W.chromeStyle,l[24]=q):q=l[24];const E=q;let J,K;return l[25]!==h||l[26]!==B||l[27]!==k||l[28]!==G||l[29]!==_||l[30]!==R?(J=(0,p.jsx)(x.AdaptiveTextInput,Object.assign({ref:R,editable:h},_,{onBlur:B,onFocus:k,style:G})),l[25]=h,l[26]=B,l[27]=k,l[28]=G,l[29]=_,l[30]=R,l[31]=J):J=l[31],l[32]!==E||l[33]!==A||l[34]!==J?(K=(0,p.jsx)(s.Pressable,{disabled:A,style:E,children:J}),l[32]=E,l[33]=A,l[34]=J,l[35]=K):K=l[35],K}),j=S.StyleSheet.create(e=>({container:{gap:e.spacing[2],uni__dependencies:[0]},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing[2],uni__dependencies:[0]},label:{flexShrink:1,minWidth:0,color:e.colors.foregroundMuted,fontSize:e.fontSize.base,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},hintText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,lineHeight:Math.round(1.4*e.fontSize.sm),uni__dependencies:[0]},errorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.sm,lineHeight:Math.round(1.4*e.fontSize.sm),uni__dependencies:[0]}})),w=S.StyleSheet.create(e=>{const t=(0,y.createControlGeometry)(e);return{chrome:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},chromeSm:Object.assign({},t.fieldControlSm),chromeMd:Object.assign({},t.fieldControlMd),controlRest:Object.assign({},t.controlRest),controlHover:Object.assign({},t.controlHover),controlActive:Object.assign({},t.controlActive),controlDisabled:Object.assign({},t.controlDisabled),input:{flex:1,minWidth:0,color:e.colors.foreground,paddingHorizontal:0,paddingVertical:0,outlineColor:"transparent",outlineWidth:0,uni__dependencies:[0]},inputSm:Object.assign({},t.fieldTextSm),inputMd:Object.assign({},t.fieldTextMd)}})},3690,[36,896,897,898,454,37,426,60,235,147,57,3691,3025,280]);
15346
- __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AdaptiveTextInput",{enumerable:!0,get:function(){return H.AdaptiveTextInput}}),Object.defineProperty(_e,"SHEET_HORIZONTAL_PADDING_SCALE",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SHEET_HEADER_CLOSE_PADDING_SCALE",{enumerable:!0,get:function(){return T}}),_e.SheetHeaderView=K,_e.InlineHeaderView=function(e){const l=(0,s.c)(17),{header:c}=e,{theme:h}=(0,b.useUnistyles)(),{t:p}=(0,u.useTranslation)(),S=c.back,y=S?.onPress,f=Boolean(y||c.leading||c.actions);if(!f&&!c.search)return null;let x,C,w;l[0]!==S?.accessibilityLabel||l[1]!==S?.label||l[2]!==y||l[3]!==f||l[4]!==c.actions||l[5]!==c.leading||l[6]!==c.title||l[7]!==p||l[8]!==h?(x=f?(0,V.jsxs)(t.View,{style:A.inlineHeaderRow,children:[y?(0,V.jsx)(o.Pressable,{onPress:y,hitSlop:8,style:A.headerBackButton,accessibilityRole:"button",accessibilityLabel:S?.accessibilityLabel??S?.label??p("common.actions.back"),testID:"sheet-header-back",children:e=>{const{pressed:t}=e;return(0,V.jsx)(_.ArrowLeft,{size:16,color:t?h.colors.foreground:h.colors.foregroundMuted})}}):null,c.leading?(0,V.jsx)(t.View,{style:A.headerLeadingSlot,children:c.leading}):null,(0,V.jsx)(n.Text,{style:A.inlineTitle,numberOfLines:1,children:c.title}),c.actions?(0,V.jsx)(t.View,{style:A.headerActions,children:c.actions}):null]}):null,l[0]=S?.accessibilityLabel,l[1]=S?.label,l[2]=y,l[3]=f,l[4]=c.actions,l[5]=c.leading,l[6]=c.title,l[7]=p,l[8]=h,l[9]=x):x=l[9];l[10]!==c.search||l[11]!==p||l[12]!==h?(C=c.search?(0,V.jsxs)(t.View,{style:A.inlineSearchRow,children:[(0,V.jsx)(_.Search,{size:h.iconSize.sm,color:h.colors.foregroundMuted}),(0,V.jsx)(H.AdaptiveTextInput,{style:[A.searchInput,D.isWeb&&{outlineStyle:"none"}],placeholder:c.search.placeholder??p("common.actions.search"),resetKey:c.search.resetKey,onChangeText:c.search.onChange,onFocus:c.search.onFocus,onBlur:c.search.onBlur,autoCapitalize:"none",autoCorrect:!1,autoFocus:c.search.autoFocus,testID:c.search.testID})]}):null,l[10]=c.search,l[11]=p,l[12]=h,l[13]=C):C=l[13];l[14]!==x||l[15]!==C?(w=(0,V.jsxs)(t.View,{children:[x,C]}),l[14]=x,l[15]=C,l[16]=w):w=l[16];return w},_e.AdaptiveModalSheet=function(e){const n=(0,s.c)(125),{header:y,visible:f,onClose:x,onDismiss:_,children:H,footer:P,footerContainerStyle:T,snapPoints:W,testID:M,desktopMaxWidth:F,desktopHeight:G,scrollable:U,presentation:Y,contentStyle:N,bodyStyle:X,sizeContentToCurrentSnapPoint:Z,contextBridge:$}=e,q=void 0===U||U,J=void 0===Z||Z,Q=void 0===$?null:$,{theme:ee}=(0,b.useUnistyles)(),{t:te}=(0,u.useTranslation)(),ne=(0,p.useIsCompactFormFactor)(),oe=(0,k.useSafeAreaInsets)(),ie=(0,B.useKeyboardVisibility)(f);let se;n[0]!==W?(se=W??["65%","90%"],n[0]=W,n[1]=se):se=n[1];const ae=se,re=Boolean(P);let le;n[2]!==oe.bottom||n[3]!==ie||n[4]!==ne||n[5]!==re?(le=(0,w.getCompactSheetSafeAreaPadding)({isCompact:ne,isKeyboardVisible:ie,hasFooter:re,safeAreaBottom:oe.bottom}),n[2]=oe.bottom,n[3]=ie,n[4]=ne,n[5]=re,n[6]=le):le=n[6];const ce=le,de=ce.contentPaddingBottom??0;let ue;n[7]!==de?(ue={paddingBottom:de},n[7]=de,n[8]=ue):ue=n[8];const he=ue,ge=ce.footerPaddingBottom??0;let be;n[9]!==ge?(be={paddingBottom:ge},n[9]=ge,n[10]=be):be=n[10];const pe=be;let me;n[11]!==P||n[12]!==pe||n[13]!==T?(me=P?(0,V.jsx)(t.View,{style:pe,children:(0,V.jsx)(t.View,{style:[A.footer,T],children:P})}):null,n[11]=P,n[12]=pe,n[13]=T,n[14]=me):me=n[14];const Se=me;let ye;n[15]!==ee.colors.palette.zinc[600]?(ye={backgroundColor:ee.colors.palette.zinc[600]},n[15]=ee.colors.palette.zinc[600],n[16]=ye):ye=n[16];const fe=ye;let xe,Ce;n[17]!==f?(xe=()=>{!D.isWeb&&f&&h.default.dismiss()},Ce=[f],n[17]=f,n[18]=xe,n[19]=Ce):(xe=n[18],Ce=n[19]);(0,l.useEffect)(xe,Ce);const we=ne||!D.isWeb;let je;n[20]!==x||n[21]!==we||n[22]!==f?(je={visible:f,isEnabled:we,onClose:x},n[20]=x,n[21]=we,n[22]=f,n[23]=je):je=n[23];const{sheetRef:De,handleSheetChange:Be,handleSheetDismiss:ke}=(0,C.useIsolatedBottomSheetVisibility)(je),[He,Ve]=(0,l.useState)(f),[Pe,Te]=(0,l.useState)(!1),ve=(0,S.useGlobalWebOverlayLayer)("modal",D.isWeb&&!ne&&He);let Ie;n[24]!==ke||n[25]!==_?(Ie=()=>{ke(),_?.()},n[24]=ke,n[25]=_,n[26]=Ie):Ie=n[26];const Re=Ie;let Ae,Le,ze;n[27]!==G?(Ae=null!=G&&{height:G},n[27]=G,n[28]=Ae):Ae=n[28];n[29]!==F?(Le=null!=F&&{maxWidth:F},n[29]=F,n[30]=Le):Le=n[30];n[31]!==Ae||n[32]!==Le?(ze=[A.desktopCard,Ae,Le],n[31]=Ae,n[32]=Le,n[33]=ze):ze=n[33];const Oe=ze;let We,Ee;n[34]!==Pe||n[35]!==ve?(We=D.isWeb&&{zIndex:ve,opacity:Pe?0:1,transitionDuration:`${L}ms`,transitionProperty:"opacity",transitionTimingFunction:"ease"},n[34]=Pe,n[35]=ve,n[36]=We):We=n[36];n[37]!==We?(Ee=[A.desktopOverlay,We],n[37]=We,n[38]=Ee):Ee=n[38];const Ke=Ee;let Me;n[39]!==x?(Me=e=>"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),x(),!0),n[39]=x,n[40]=Me):Me=n[40];const Fe=Me,Ge=D.isWeb&&!ne&&f;let Ue;n[41]!==Fe||n[42]!==ve||n[43]!==Ge?(Ue={active:Ge,layer:ve,onKeyDown:Fe},n[41]=Fe,n[42]=ve,n[43]=Ge,n[44]=Ue):Ue=n[44];const Ye=(0,S.useWebOverlayRegistration)(Ue);let Ne,Xe;n[45]!==ne||n[46]!==_||n[47]!==He||n[48]!==f?(Ne=()=>{if(!D.isWeb||ne)return;if(f)return Ve(!0),void Te(!1);if(!He)return;Te(!0);const e=window.setTimeout(()=>{Ve(!1),Te(!1),_?.()},L);return()=>window.clearTimeout(e)},Xe=[f,ne,_,He],n[45]=ne,n[46]=_,n[47]=He,n[48]=f,n[49]=Ne,n[50]=Xe):(Ne=n[49],Xe=n[50]);if((0,l.useEffect)(Ne,Xe),ne){let e,o,s,l,c;n[51]!==y||n[52]!==x||n[53]!==M?(e=(0,V.jsx)(K,{header:y,onClose:x,testID:M}),n[51]=y,n[52]=x,n[53]=M,n[54]=e):e=n[54],n[55]!==X?(o=[A.compactStaticContent,X],n[55]=X,n[56]=o):o=n[56],n[57]!==he||n[58]!==H||n[59]!==N||n[60]!==q?(s=q?(0,V.jsx)(j.ScrollView,{style:A.bottomSheetVisibleScroll,contentContainerStyle:v,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!1,children:(0,V.jsx)(t.View,{style:[A.contentGrow,he],children:(0,V.jsx)(O,{style:[A.contentGrow,N],children:H})})}):(0,V.jsx)(t.View,{style:[A.compactStaticContent,he],children:(0,V.jsx)(O,{style:[A.compactStaticContent,N],children:H})}),n[57]=he,n[58]=H,n[59]=N,n[60]=q,n[61]=s):s=n[61],n[62]!==o||n[63]!==s?(l=(0,V.jsx)(t.View,{style:o,children:s}),n[62]=o,n[63]=s,n[64]=l):l=n[64],n[65]!==Se||n[66]!==e||n[67]!==l?(c=(0,V.jsxs)(V.Fragment,{children:[e,l,Se]}),n[65]=Se,n[66]=e,n[67]=l,n[68]=c):c=n[68];const u=c;let h,b;return n[69]!==u||n[70]!==J?(h=J?(0,V.jsx)(E,{children:u}):u,n[69]=u,n[70]=J,n[71]=h):h=n[71],n[72]!==Q||n[73]!==Re||n[74]!==fe||n[75]!==Be||n[76]!==Y||n[77]!==ae||n[78]!==De||n[79]!==h?(b=(0,V.jsx)(C.IsolatedBottomSheetModal,{ref:De,contextBridge:Q,snapPoints:ae,index:0,enableDynamicSizing:!1,onChange:Be,onDismiss:Re,backdropOpacity:.45,enablePanDownToClose:!0,backgroundComponent:z,handleIndicatorStyle:fe,keyboardBehavior:"extend",keyboardBlurBehavior:"restore",accessible:!1,presentation:Y,children:h}),n[72]=Q,n[73]=Re,n[74]=fe,n[75]=Be,n[76]=Y,n[77]=ae,n[78]=De,n[79]=h,n[80]=b):b=n[80],b}const Ze=null==G?A.desktopStaticContent:A.compactStaticContent;let $e;n[81]!==y||n[82]!==x?($e=(0,V.jsx)(K,{header:y,onClose:x}),n[81]=y,n[82]=x,n[83]=$e):$e=n[83];const qe=q?A.desktopScrollContainer:Ze;let Je,Qe,et,tt;n[84]!==X||n[85]!==qe?(Je=[qe,X],n[84]=X,n[85]=qe,n[86]=Je):Je=n[86];n[87]!==H||n[88]!==N||n[89]!==Ze||n[90]!==q?(Qe=q?(0,V.jsx)(j.ScrollView,{style:A.desktopScroll,contentContainerStyle:v,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!0,children:(0,V.jsx)(O,{style:[A.contentGrow,N],children:H})}):(0,V.jsx)(O,{style:[Ze,N],children:H}),n[87]=H,n[88]=N,n[89]=Ze,n[90]=q,n[91]=Qe):Qe=n[91];n[92]!==Je||n[93]!==Qe?(et=(0,V.jsx)(t.View,{style:Je,children:Qe}),n[92]=Je,n[93]=Qe,n[94]=et):et=n[94];n[95]!==Se||n[96]!==ve||n[97]!==$e||n[98]!==et?(tt=(0,V.jsxs)(S.OverlayLayerProvider,{layer:ve,children:[$e,et,Se]}),n[95]=Se,n[96]=ve,n[97]=$e,n[98]=et,n[99]=tt):tt=n[99];const nt=tt;let ot,it,st,at;n[100]!==te?(ot=te("common.actions.dismiss"),n[100]=te,n[101]=ot):ot=n[101];n[102]!==x||n[103]!==ot?(it=(0,V.jsx)(o.Pressable,{accessibilityLabel:ot,style:I,onPress:x}),n[102]=x,n[103]=ot,n[104]=it):it=n[104];n[105]!==nt||n[106]!==Oe||n[107]!==Ye?(st=(0,V.jsx)(t.View,{ref:Ye,style:Oe,role:"dialog","aria-modal":!0,tabIndex:-1,children:nt}),n[105]=nt,n[106]=Oe,n[107]=Ye,n[108]=st):st=n[108];n[109]!==Ke||n[110]!==it||n[111]!==st||n[112]!==M?(at=(0,V.jsxs)(t.View,{style:Ke,testID:M,children:[it,st]}),n[109]=Ke,n[110]=it,n[111]=st,n[112]=M,n[113]=at):at=n[113];const rt=at;if(D.isWeb&&"undefined"!=typeof document){if(!He)return null;let e;return n[114]!==rt?(e=(0,c.createPortal)(rt,(0,S.getOverlayRoot)()),n[114]=rt,n[115]=e):e=n[115],e}let lt,ct;n[116]!==rt?(lt=(0,V.jsx)(t.View,{style:A.nativeDialogSurface,children:rt}),n[116]=rt,n[117]=lt):lt=n[117];n[118]!==Q||n[119]!==Re||n[120]!==Be||n[121]!==Y||n[122]!==De||n[123]!==lt?(ct=(0,V.jsx)(C.IsolatedBottomSheetModal,{ref:De,contextBridge:Q,snapPoints:R,index:0,enableDynamicSizing:!1,onChange:Be,onDismiss:Re,handleComponent:null,backgroundStyle:A.nativeDialogBackground,enablePanDownToClose:!1,enableHandlePanningGesture:!1,enableContentPanningGesture:!1,keyboardBehavior:"extend",keyboardBlurBehavior:"restore",accessible:!1,presentation:Y,children:lt}),n[118]=Q,n[119]=Re,n[120]=Be,n[121]=Y,n[122]=De,n[123]=lt,n[124]=ct):ct=n[124];return ct};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=e(r(d[7]));r(d[8]),r(d[9]),r(d[10]);var b=r(d[11]),p=r(d[12]),S=r(d[13]),y=r(d[14]),f=r(d[15]),x=e(f),_=r(d[16]),C=r(d[17]),w=r(d[18]),j=r(d[19]),D=r(d[20]),B=r(d[21]),k=r(d[22]),H=r(d[23]),V=r(d[24]);const P=6,T=2,v={flexGrow:1},I=Object.assign({},b.StyleSheet.absoluteFillObject),R=["100%"],A=b.StyleSheet.create(e=>({nativeDialogSurface:{flex:1},nativeDialogBackground:{backgroundColor:"transparent"},desktopOverlay:Object.assign({},b.StyleSheet.absoluteFillObject,{backgroundColor:"rgba(0,0,0,0.55)",justifyContent:"center",alignItems:"center",padding:e.spacing[6],pointerEvents:"auto",uni__dependencies:[0]}),desktopCard:{overflow:"hidden",width:"100%",maxWidth:520,maxHeight:"85%",flexShrink:1,minHeight:0,backgroundColor:e.colors.surface1,borderRadius:e.borderRadius.xl,borderWidth:1,borderColor:e.colors.surface2,uni__dependencies:[0]},headerContainer:{borderBottomWidth:1,borderBottomColor:e.colors.surface2,uni__dependencies:[0]},headerRow:{paddingHorizontal:e.spacing[P],paddingVertical:e.spacing[4],flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},headerBackButton:{borderRadius:e.borderRadius.lg,uni__dependencies:[0]},headerLeadingSlot:{alignItems:"center",justifyContent:"center"},headerTitleGroup:{flex:1,gap:e.spacing[1],minWidth:0,uni__dependencies:[0]},title:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},headerActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},closeButton:{padding:e.spacing[T],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},searchRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[P],paddingBottom:e.spacing[3],uni__dependencies:[0]},inlineHeaderRow:{paddingHorizontal:e.spacing[3],paddingTop:e.spacing[2],paddingBottom:0,flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},inlineSearchRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[3],paddingVertical:e.spacing[2],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},inlineTitle:{flex:1,fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foreground,uni__dependencies:[0]},searchInput:{flex:1,paddingVertical:e.spacing[2],color:e.colors.foreground,fontSize:e.fontSize.base,uni__dependencies:[0]},desktopScrollContainer:{flexGrow:1,flexShrink:1,minHeight:0,position:"relative"},desktopScroll:{flexShrink:1,minHeight:0},sheetContent:{padding:e.spacing[P],gap:e.spacing[4],uni__dependencies:[0]},contentGrow:{flexGrow:1},compactStaticContent:{flex:1,minHeight:0},bottomSheetVisibleContent:{minHeight:0,overflow:"hidden"},bottomSheetVisibleScroll:{flex:1,minHeight:0},desktopStaticContent:{flexShrink:1,minHeight:0},footer:{paddingHorizontal:e.spacing[P],paddingVertical:e.spacing[3],borderTopWidth:1,borderTopColor:e.colors.surface2,flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing[2],uni__dependencies:[0]}})),L=160;function z(e){const t=(0,s.c)(9),{style:n}=e,{theme:o}=(0,b.useUnistyles)(),l=o.borderRadius["2xl"],c=o.borderRadius["2xl"];let u,h;t[0]!==l||t[1]!==c||t[2]!==o.colors.surface0?(u={backgroundColor:o.colors.surface0,borderTopLeftRadius:l,borderTopRightRadius:c},t[0]=l,t[1]=c,t[2]=o.colors.surface0,t[3]=u):u=t[3],t[4]!==n||t[5]!==u?(h=[n,u],t[4]=n,t[5]=u,t[6]=h):h=t[6];const p=h;let S;return t[7]!==p?(S=(0,V.jsx)(x.default.View,{pointerEvents:"none",style:p}),t[7]=p,t[8]=S):S=t[8],S}function O(e){const n=(0,s.c)(5),{style:o,children:l}=e;let c,u;return n[0]!==o?(c=[A.sheetContent,o],n[0]=o,n[1]=c):c=n[1],n[2]!==l||n[3]!==c?(u=(0,V.jsx)(t.View,{style:c,children:l}),n[2]=l,n[3]=c,n[4]=u):u=n[4],u}const W={code:"function adaptiveModalSheetTsx1(){const{animatedLayoutState,animatedDetentsState,animatedPosition,animatedKeyboardState,getBottomSheetVisibleContentHeight,KEYBOARD_STATUS}=this.__closure;var _animatedDetentsState;const{containerHeight:containerHeight,handleHeight:handleHeight}=animatedLayoutState.get();if(containerHeight<0||handleHeight<0){return{height:0};}const initialDetentPosition=(_animatedDetentsState=animatedDetentsState.get().detents)===null||_animatedDetentsState===void 0?void 0:_animatedDetentsState[0];const contentPosition=initialDetentPosition==null?animatedPosition.get():Math.min(animatedPosition.get(),initialDetentPosition);const keyboardState=animatedKeyboardState.get();return{height:getBottomSheetVisibleContentHeight({containerHeight:containerHeight,contentPosition:contentPosition,handleHeight:handleHeight,keyboardHeight:keyboardState.heightWithinContainer,isKeyboardVisible:keyboardState.status===KEYBOARD_STATUS.SHOWN})};}"};function E(e){const t=(0,s.c)(5),{children:n}=e,{animatedDetentsState:o,animatedKeyboardState:l,animatedLayoutState:c,animatedPosition:u}=(0,y.useBottomSheetInternal)(),h=(0,f.useAnimatedStyle)((function({_worklet_3908604100894_init_data:e,animatedLayoutState:t,animatedDetentsState:n,animatedPosition:o,animatedKeyboardState:s,getBottomSheetVisibleContentHeight:l,KEYBOARD_STATUS:c}){const u=function(){const{containerHeight:e,handleHeight:u}=t.get();if(e<0||u<0)return{height:0};const h=n.get().detents?.[0],b=null==h?o.get():Math.min(o.get(),h),p=s.get();return{height:l({containerHeight:e,contentPosition:b,handleHeight:u,keyboardHeight:p.heightWithinContainer,isKeyboardVisible:p.status===c.SHOWN})}};return u.__closure={animatedLayoutState:t,animatedDetentsState:n,animatedPosition:o,animatedKeyboardState:s,getBottomSheetVisibleContentHeight:l,KEYBOARD_STATUS:c},u.__workletHash=3908604100894,u.__initData=e,u})({_worklet_3908604100894_init_data:W,animatedLayoutState:c,animatedDetentsState:o,animatedPosition:u,animatedKeyboardState:l,getBottomSheetVisibleContentHeight:w.getBottomSheetVisibleContentHeight,KEYBOARD_STATUS:y.KEYBOARD_STATUS}),[o,l,c,u]);let b,p;return t[0]!==h?(b=[A.bottomSheetVisibleContent,h],t[0]=h,t[1]=b):b=t[1],t[2]!==n||t[3]!==b?(p=(0,V.jsx)(x.default.View,{style:b,children:n}),t[2]=n,t[3]=b,t[4]=p):p=t[4],p}function K(e){const l=(0,s.c)(43),{header:c,onClose:h,showCloseButton:p,testID:S}=e,y=void 0===p||p,{theme:f}=(0,b.useUnistyles)(),{t:x}=(0,u.useTranslation)();let C;l[0]!==f.colors.foreground?(C=[A.title,{color:f.colors.foreground}],l[0]=f.colors.foreground,l[1]=C):C=l[1];const w=C,j=c.back,B=j?.onPress,k=c.search;let P;l[2]!==k?(P=e=>{k?.onChange(e)},l[2]=k,l[3]=P):P=l[3];const T=P;let v,I,R,L,z,O,W,E,K;return l[4]!==j?.accessibilityLabel||l[5]!==j?.label||l[6]!==B||l[7]!==x||l[8]!==f.colors.foreground||l[9]!==f.colors.foregroundMuted?(v=B?(0,V.jsx)(o.Pressable,{onPress:B,hitSlop:8,style:A.headerBackButton,accessibilityRole:"button",accessibilityLabel:j?.accessibilityLabel??j?.label??x("common.actions.back"),testID:"sheet-header-back",children:e=>{const{pressed:t}=e;return(0,V.jsx)(_.ArrowLeft,{size:18,color:t?f.colors.foreground:f.colors.foregroundMuted})}}):null,l[4]=j?.accessibilityLabel,l[5]=j?.label,l[6]=B,l[7]=x,l[8]=f.colors.foreground,l[9]=f.colors.foregroundMuted,l[10]=v):v=l[10],l[11]!==c.leading?(I=c.leading?(0,V.jsx)(t.View,{style:A.headerLeadingSlot,children:c.leading}):null,l[11]=c.leading,l[12]=I):I=l[12],l[13]!==c.title||l[14]!==w?(R=(0,V.jsx)(n.Text,{style:w,numberOfLines:1,children:c.title}),l[13]=c.title,l[14]=w,l[15]=R):R=l[15],l[16]!==c.subtitle||l[17]!==R?(L=(0,V.jsxs)(t.View,{style:A.headerTitleGroup,children:[R,c.subtitle]}),l[16]=c.subtitle,l[17]=R,l[18]=L):L=l[18],l[19]!==c.actions?(z=c.actions?(0,V.jsx)(t.View,{style:A.headerActions,children:c.actions}):null,l[19]=c.actions,l[20]=z):z=l[20],l[21]!==h||l[22]!==y||l[23]!==x||l[24]!==f.colors.foreground||l[25]!==f.colors.foregroundMuted?(O=y?(0,V.jsx)(o.Pressable,{accessibilityRole:"button",accessibilityLabel:x("common.actions.close"),style:A.closeButton,onPress:h,children:e=>{const{pressed:t}=e;return(0,V.jsx)(_.X,{size:16,color:t?f.colors.foreground:f.colors.foregroundMuted})}}):null,l[21]=h,l[22]=y,l[23]=x,l[24]=f.colors.foreground,l[25]=f.colors.foregroundMuted,l[26]=O):O=l[26],l[27]!==v||l[28]!==I||l[29]!==L||l[30]!==z||l[31]!==O?(W=(0,V.jsxs)(t.View,{style:A.headerRow,children:[v,I,L,z,O]}),l[27]=v,l[28]=I,l[29]=L,l[30]=z,l[31]=O,l[32]=W):W=l[32],l[33]!==T||l[34]!==k||l[35]!==x||l[36]!==f.colors.foregroundMuted||l[37]!==f.iconSize?(E=k?(0,V.jsxs)(t.View,{style:A.searchRow,children:[(0,V.jsx)(_.Search,{size:f.iconSize.md,color:f.colors.foregroundMuted}),(0,V.jsx)(H.AdaptiveTextInput,{style:[A.searchInput,D.isWeb&&{outlineStyle:"none"}],placeholder:k.placeholder??x("common.actions.search"),resetKey:k.resetKey,onChangeText:T,onFocus:k.onFocus,onBlur:k.onBlur,autoCapitalize:"none",autoCorrect:!1,autoFocus:k.autoFocus,testID:k.testID})]}):null,l[33]=T,l[34]=k,l[35]=x,l[36]=f.colors.foregroundMuted,l[37]=f.iconSize,l[38]=E):E=l[38],l[39]!==W||l[40]!==E||l[41]!==S?(K=(0,V.jsxs)(t.View,{style:A.headerContainer,testID:S,children:[W,E]}),l[39]=W,l[40]=E,l[41]=S,l[42]=K):K=l[42],K}},3691,[896,897,898,454,37,388,854,402,426,235,147,57,1217,2882,3034,899,1218,3692,3697,3027,881,3698,627,3699,280]);
15346
+ __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AdaptiveTextInput",{enumerable:!0,get:function(){return V.AdaptiveTextInput}}),Object.defineProperty(_e,"SHEET_HORIZONTAL_PADDING_SCALE",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SHEET_HEADER_CLOSE_PADDING_SCALE",{enumerable:!0,get:function(){return T}}),_e.BottomSheetVisibleContent=E,_e.SheetHeaderView=K,_e.InlineHeaderView=function(e){const l=(0,s.c)(17),{header:c}=e,{theme:h}=(0,b.useUnistyles)(),{t:p}=(0,u.useTranslation)(),S=c.back,y=S?.onPress,f=Boolean(y||c.leading||c.actions);if(!f&&!c.search)return null;let x,_,w;l[0]!==S?.accessibilityLabel||l[1]!==S?.label||l[2]!==y||l[3]!==f||l[4]!==c.actions||l[5]!==c.leading||l[6]!==c.title||l[7]!==p||l[8]!==h?(x=f?(0,H.jsxs)(t.View,{style:A.inlineHeaderRow,children:[y?(0,H.jsx)(o.Pressable,{onPress:y,hitSlop:8,style:A.headerBackButton,accessibilityRole:"button",accessibilityLabel:S?.accessibilityLabel??S?.label??p("common.actions.back"),testID:"sheet-header-back",children:e=>{const{pressed:t}=e;return(0,H.jsx)(C.ArrowLeft,{size:16,color:t?h.colors.foreground:h.colors.foregroundMuted})}}):null,c.leading?(0,H.jsx)(t.View,{style:A.headerLeadingSlot,children:c.leading}):null,(0,H.jsx)(n.Text,{style:A.inlineTitle,numberOfLines:1,children:c.title}),c.actions?(0,H.jsx)(t.View,{style:A.headerActions,children:c.actions}):null]}):null,l[0]=S?.accessibilityLabel,l[1]=S?.label,l[2]=y,l[3]=f,l[4]=c.actions,l[5]=c.leading,l[6]=c.title,l[7]=p,l[8]=h,l[9]=x):x=l[9];l[10]!==c.search||l[11]!==p||l[12]!==h?(_=c.search?(0,H.jsxs)(t.View,{style:A.inlineSearchRow,children:[(0,H.jsx)(C.Search,{size:h.iconSize.sm,color:h.colors.foregroundMuted}),(0,H.jsx)(V.AdaptiveTextInput,{style:[A.searchInput,D.isWeb&&{outlineStyle:"none"}],placeholder:c.search.placeholder??p("common.actions.search"),resetKey:c.search.resetKey,onChangeText:c.search.onChange,onFocus:c.search.onFocus,onBlur:c.search.onBlur,autoCapitalize:"none",autoCorrect:!1,autoFocus:c.search.autoFocus,testID:c.search.testID})]}):null,l[10]=c.search,l[11]=p,l[12]=h,l[13]=_):_=l[13];l[14]!==x||l[15]!==_?(w=(0,H.jsxs)(t.View,{children:[x,_]}),l[14]=x,l[15]=_,l[16]=w):w=l[16];return w},_e.AdaptiveModalSheet=function(e){const n=(0,s.c)(125),{header:y,visible:f,onClose:x,onDismiss:C,children:V,footer:P,footerContainerStyle:T,snapPoints:W,testID:M,desktopMaxWidth:F,desktopHeight:G,scrollable:U,presentation:Y,contentStyle:N,bodyStyle:X,sizeContentToCurrentSnapPoint:Z,contextBridge:$}=e,q=void 0===U||U,J=void 0===Z||Z,Q=void 0===$?null:$,{theme:ee}=(0,b.useUnistyles)(),{t:te}=(0,u.useTranslation)(),ne=(0,p.useIsCompactFormFactor)(),oe=(0,k.useSafeAreaInsets)(),ie=(0,B.useKeyboardVisibility)(f);let se;n[0]!==W?(se=W??["65%","90%"],n[0]=W,n[1]=se):se=n[1];const ae=se,re=Boolean(P);let le;n[2]!==oe.bottom||n[3]!==ie||n[4]!==ne||n[5]!==re?(le=(0,w.getCompactSheetSafeAreaPadding)({isCompact:ne,isKeyboardVisible:ie,hasFooter:re,safeAreaBottom:oe.bottom}),n[2]=oe.bottom,n[3]=ie,n[4]=ne,n[5]=re,n[6]=le):le=n[6];const ce=le,de=ce.contentPaddingBottom??0;let ue;n[7]!==de?(ue={paddingBottom:de},n[7]=de,n[8]=ue):ue=n[8];const he=ue,ge=ce.footerPaddingBottom??0;let be;n[9]!==ge?(be={paddingBottom:ge},n[9]=ge,n[10]=be):be=n[10];const pe=be;let me;n[11]!==P||n[12]!==pe||n[13]!==T?(me=P?(0,H.jsx)(t.View,{style:pe,children:(0,H.jsx)(t.View,{style:[A.footer,T],children:P})}):null,n[11]=P,n[12]=pe,n[13]=T,n[14]=me):me=n[14];const Se=me;let ye;n[15]!==ee.colors.palette.zinc[600]?(ye={backgroundColor:ee.colors.palette.zinc[600]},n[15]=ee.colors.palette.zinc[600],n[16]=ye):ye=n[16];const fe=ye;let xe,Ce;n[17]!==f?(xe=()=>{!D.isWeb&&f&&h.default.dismiss()},Ce=[f],n[17]=f,n[18]=xe,n[19]=Ce):(xe=n[18],Ce=n[19]);(0,l.useEffect)(xe,Ce);const we=ne||!D.isWeb;let je;n[20]!==x||n[21]!==we||n[22]!==f?(je={visible:f,isEnabled:we,onClose:x},n[20]=x,n[21]=we,n[22]=f,n[23]=je):je=n[23];const{sheetRef:De,handleSheetChange:Be,handleSheetDismiss:ke}=(0,_.useIsolatedBottomSheetVisibility)(je),[Ve,He]=(0,l.useState)(f),[Pe,Te]=(0,l.useState)(!1),ve=(0,S.useGlobalWebOverlayLayer)("modal",D.isWeb&&!ne&&Ve);let Ie;n[24]!==ke||n[25]!==C?(Ie=()=>{ke(),C?.()},n[24]=ke,n[25]=C,n[26]=Ie):Ie=n[26];const Re=Ie;let Ae,Le,ze;n[27]!==G?(Ae=null!=G&&{height:G},n[27]=G,n[28]=Ae):Ae=n[28];n[29]!==F?(Le=null!=F&&{maxWidth:F},n[29]=F,n[30]=Le):Le=n[30];n[31]!==Ae||n[32]!==Le?(ze=[A.desktopCard,Ae,Le],n[31]=Ae,n[32]=Le,n[33]=ze):ze=n[33];const Oe=ze;let We,Ee;n[34]!==Pe||n[35]!==ve?(We=D.isWeb&&{zIndex:ve,opacity:Pe?0:1,transitionDuration:`${L}ms`,transitionProperty:"opacity",transitionTimingFunction:"ease"},n[34]=Pe,n[35]=ve,n[36]=We):We=n[36];n[37]!==We?(Ee=[A.desktopOverlay,We],n[37]=We,n[38]=Ee):Ee=n[38];const Ke=Ee;let Me;n[39]!==x?(Me=e=>"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),x(),!0),n[39]=x,n[40]=Me):Me=n[40];const Fe=Me,Ge=D.isWeb&&!ne&&f;let Ue;n[41]!==Fe||n[42]!==ve||n[43]!==Ge?(Ue={active:Ge,layer:ve,onKeyDown:Fe},n[41]=Fe,n[42]=ve,n[43]=Ge,n[44]=Ue):Ue=n[44];const Ye=(0,S.useWebOverlayRegistration)(Ue);let Ne,Xe;n[45]!==ne||n[46]!==C||n[47]!==Ve||n[48]!==f?(Ne=()=>{if(!D.isWeb||ne)return;if(f)return He(!0),void Te(!1);if(!Ve)return;Te(!0);const e=window.setTimeout(()=>{He(!1),Te(!1),C?.()},L);return()=>window.clearTimeout(e)},Xe=[f,ne,C,Ve],n[45]=ne,n[46]=C,n[47]=Ve,n[48]=f,n[49]=Ne,n[50]=Xe):(Ne=n[49],Xe=n[50]);if((0,l.useEffect)(Ne,Xe),ne){let e,o,s,l,c;n[51]!==y||n[52]!==x||n[53]!==M?(e=(0,H.jsx)(K,{header:y,onClose:x,testID:M}),n[51]=y,n[52]=x,n[53]=M,n[54]=e):e=n[54],n[55]!==X?(o=[A.compactStaticContent,X],n[55]=X,n[56]=o):o=n[56],n[57]!==he||n[58]!==V||n[59]!==N||n[60]!==q?(s=q?(0,H.jsx)(j.ScrollView,{style:A.bottomSheetVisibleScroll,contentContainerStyle:v,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!1,children:(0,H.jsx)(t.View,{style:[A.contentGrow,he],children:(0,H.jsx)(O,{style:[A.contentGrow,N],children:V})})}):(0,H.jsx)(t.View,{style:[A.compactStaticContent,he],children:(0,H.jsx)(O,{style:[A.compactStaticContent,N],children:V})}),n[57]=he,n[58]=V,n[59]=N,n[60]=q,n[61]=s):s=n[61],n[62]!==o||n[63]!==s?(l=(0,H.jsx)(t.View,{style:o,children:s}),n[62]=o,n[63]=s,n[64]=l):l=n[64],n[65]!==Se||n[66]!==e||n[67]!==l?(c=(0,H.jsxs)(H.Fragment,{children:[e,l,Se]}),n[65]=Se,n[66]=e,n[67]=l,n[68]=c):c=n[68];const u=c;let h,b;return n[69]!==u||n[70]!==J?(h=J?(0,H.jsx)(E,{children:u}):u,n[69]=u,n[70]=J,n[71]=h):h=n[71],n[72]!==Q||n[73]!==Re||n[74]!==fe||n[75]!==Be||n[76]!==Y||n[77]!==ae||n[78]!==De||n[79]!==h?(b=(0,H.jsx)(_.IsolatedBottomSheetModal,{ref:De,contextBridge:Q,snapPoints:ae,index:0,enableDynamicSizing:!1,onChange:Be,onDismiss:Re,backdropOpacity:.45,enablePanDownToClose:!0,backgroundComponent:z,handleIndicatorStyle:fe,keyboardBehavior:"extend",keyboardBlurBehavior:"restore",accessible:!1,presentation:Y,children:h}),n[72]=Q,n[73]=Re,n[74]=fe,n[75]=Be,n[76]=Y,n[77]=ae,n[78]=De,n[79]=h,n[80]=b):b=n[80],b}const Ze=null==G?A.desktopStaticContent:A.compactStaticContent;let $e;n[81]!==y||n[82]!==x?($e=(0,H.jsx)(K,{header:y,onClose:x}),n[81]=y,n[82]=x,n[83]=$e):$e=n[83];const qe=q?A.desktopScrollContainer:Ze;let Je,Qe,et,tt;n[84]!==X||n[85]!==qe?(Je=[qe,X],n[84]=X,n[85]=qe,n[86]=Je):Je=n[86];n[87]!==V||n[88]!==N||n[89]!==Ze||n[90]!==q?(Qe=q?(0,H.jsx)(j.ScrollView,{style:A.desktopScroll,contentContainerStyle:v,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!0,children:(0,H.jsx)(O,{style:[A.contentGrow,N],children:V})}):(0,H.jsx)(O,{style:[Ze,N],children:V}),n[87]=V,n[88]=N,n[89]=Ze,n[90]=q,n[91]=Qe):Qe=n[91];n[92]!==Je||n[93]!==Qe?(et=(0,H.jsx)(t.View,{style:Je,children:Qe}),n[92]=Je,n[93]=Qe,n[94]=et):et=n[94];n[95]!==Se||n[96]!==ve||n[97]!==$e||n[98]!==et?(tt=(0,H.jsxs)(S.OverlayLayerProvider,{layer:ve,children:[$e,et,Se]}),n[95]=Se,n[96]=ve,n[97]=$e,n[98]=et,n[99]=tt):tt=n[99];const nt=tt;let ot,it,st,at;n[100]!==te?(ot=te("common.actions.dismiss"),n[100]=te,n[101]=ot):ot=n[101];n[102]!==x||n[103]!==ot?(it=(0,H.jsx)(o.Pressable,{accessibilityLabel:ot,style:I,onPress:x}),n[102]=x,n[103]=ot,n[104]=it):it=n[104];n[105]!==nt||n[106]!==Oe||n[107]!==Ye?(st=(0,H.jsx)(t.View,{ref:Ye,style:Oe,role:"dialog","aria-modal":!0,tabIndex:-1,children:nt}),n[105]=nt,n[106]=Oe,n[107]=Ye,n[108]=st):st=n[108];n[109]!==Ke||n[110]!==it||n[111]!==st||n[112]!==M?(at=(0,H.jsxs)(t.View,{style:Ke,testID:M,children:[it,st]}),n[109]=Ke,n[110]=it,n[111]=st,n[112]=M,n[113]=at):at=n[113];const rt=at;if(D.isWeb&&"undefined"!=typeof document){if(!Ve)return null;let e;return n[114]!==rt?(e=(0,c.createPortal)(rt,(0,S.getOverlayRoot)()),n[114]=rt,n[115]=e):e=n[115],e}let lt,ct;n[116]!==rt?(lt=(0,H.jsx)(t.View,{style:A.nativeDialogSurface,children:rt}),n[116]=rt,n[117]=lt):lt=n[117];n[118]!==Q||n[119]!==Re||n[120]!==Be||n[121]!==Y||n[122]!==De||n[123]!==lt?(ct=(0,H.jsx)(_.IsolatedBottomSheetModal,{ref:De,contextBridge:Q,snapPoints:R,index:0,enableDynamicSizing:!1,onChange:Be,onDismiss:Re,handleComponent:null,backgroundStyle:A.nativeDialogBackground,enablePanDownToClose:!1,enableHandlePanningGesture:!1,enableContentPanningGesture:!1,keyboardBehavior:"extend",keyboardBlurBehavior:"restore",accessible:!1,presentation:Y,children:lt}),n[118]=Q,n[119]=Re,n[120]=Be,n[121]=Y,n[122]=De,n[123]=lt,n[124]=ct):ct=n[124];return ct};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=e(r(d[7]));r(d[8]),r(d[9]),r(d[10]);var b=r(d[11]),p=r(d[12]),S=r(d[13]),y=r(d[14]),f=r(d[15]),x=e(f),C=r(d[16]),_=r(d[17]),w=r(d[18]),j=r(d[19]),D=r(d[20]),B=r(d[21]),k=r(d[22]),V=r(d[23]),H=r(d[24]);const P=6,T=2,v={flexGrow:1},I=Object.assign({},b.StyleSheet.absoluteFillObject),R=["100%"],A=b.StyleSheet.create(e=>({nativeDialogSurface:{flex:1},nativeDialogBackground:{backgroundColor:"transparent"},desktopOverlay:Object.assign({},b.StyleSheet.absoluteFillObject,{backgroundColor:"rgba(0,0,0,0.55)",justifyContent:"center",alignItems:"center",padding:e.spacing[6],pointerEvents:"auto",uni__dependencies:[0]}),desktopCard:{overflow:"hidden",width:"100%",maxWidth:520,maxHeight:"85%",flexShrink:1,minHeight:0,backgroundColor:e.colors.surface1,borderRadius:e.borderRadius.xl,borderWidth:1,borderColor:e.colors.surface2,uni__dependencies:[0]},headerContainer:{borderBottomWidth:1,borderBottomColor:e.colors.surface2,uni__dependencies:[0]},headerRow:{paddingHorizontal:e.spacing[P],paddingVertical:e.spacing[4],flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},headerBackButton:{borderRadius:e.borderRadius.lg,uni__dependencies:[0]},headerLeadingSlot:{alignItems:"center",justifyContent:"center"},headerTitleGroup:{flex:1,gap:e.spacing[1],minWidth:0,uni__dependencies:[0]},title:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},headerActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},closeButton:{padding:e.spacing[T],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},searchRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[P],paddingBottom:e.spacing[3],uni__dependencies:[0]},inlineHeaderRow:{paddingHorizontal:e.spacing[3],paddingTop:e.spacing[2],paddingBottom:0,flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},inlineSearchRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[3],paddingVertical:e.spacing[2],borderBottomWidth:1,borderBottomColor:e.colors.border,uni__dependencies:[0]},inlineTitle:{flex:1,fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foreground,uni__dependencies:[0]},searchInput:{flex:1,paddingVertical:e.spacing[2],color:e.colors.foreground,fontSize:e.fontSize.base,uni__dependencies:[0]},desktopScrollContainer:{flexGrow:1,flexShrink:1,minHeight:0,position:"relative"},desktopScroll:{flexShrink:1,minHeight:0},sheetContent:{padding:e.spacing[P],gap:e.spacing[4],uni__dependencies:[0]},contentGrow:{flexGrow:1},compactStaticContent:{flex:1,minHeight:0},bottomSheetVisibleContent:{minHeight:0,overflow:"hidden"},bottomSheetVisibleScroll:{flex:1,minHeight:0},desktopStaticContent:{flexShrink:1,minHeight:0},footer:{paddingHorizontal:e.spacing[P],paddingVertical:e.spacing[3],borderTopWidth:1,borderTopColor:e.colors.surface2,flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing[2],uni__dependencies:[0]}})),L=160;function z(e){const t=(0,s.c)(9),{style:n}=e,{theme:o}=(0,b.useUnistyles)(),l=o.borderRadius["2xl"],c=o.borderRadius["2xl"];let u,h;t[0]!==l||t[1]!==c||t[2]!==o.colors.surface0?(u={backgroundColor:o.colors.surface0,borderTopLeftRadius:l,borderTopRightRadius:c},t[0]=l,t[1]=c,t[2]=o.colors.surface0,t[3]=u):u=t[3],t[4]!==n||t[5]!==u?(h=[n,u],t[4]=n,t[5]=u,t[6]=h):h=t[6];const p=h;let S;return t[7]!==p?(S=(0,H.jsx)(x.default.View,{pointerEvents:"none",style:p}),t[7]=p,t[8]=S):S=t[8],S}function O(e){const n=(0,s.c)(5),{style:o,children:l}=e;let c,u;return n[0]!==o?(c=[A.sheetContent,o],n[0]=o,n[1]=c):c=n[1],n[2]!==l||n[3]!==c?(u=(0,H.jsx)(t.View,{style:c,children:l}),n[2]=l,n[3]=c,n[4]=u):u=n[4],u}const W={code:"function adaptiveModalSheetTsx1(){const{animatedLayoutState,animatedDetentsState,animatedPosition,animatedKeyboardState,getBottomSheetVisibleContentHeight,KEYBOARD_STATUS}=this.__closure;var _animatedDetentsState;const{containerHeight:containerHeight,handleHeight:handleHeight}=animatedLayoutState.get();if(containerHeight<0||handleHeight<0){return{height:0};}const initialDetentPosition=(_animatedDetentsState=animatedDetentsState.get().detents)===null||_animatedDetentsState===void 0?void 0:_animatedDetentsState[0];const contentPosition=initialDetentPosition==null?animatedPosition.get():Math.min(animatedPosition.get(),initialDetentPosition);const keyboardState=animatedKeyboardState.get();return{height:getBottomSheetVisibleContentHeight({containerHeight:containerHeight,contentPosition:contentPosition,handleHeight:handleHeight,keyboardHeight:keyboardState.heightWithinContainer,isKeyboardVisible:keyboardState.status===KEYBOARD_STATUS.SHOWN})};}"};function E(e){const t=(0,s.c)(5),{children:n}=e,{animatedDetentsState:o,animatedKeyboardState:l,animatedLayoutState:c,animatedPosition:u}=(0,y.useBottomSheetInternal)(),h=(0,f.useAnimatedStyle)((function({_worklet_3908604100894_init_data:e,animatedLayoutState:t,animatedDetentsState:n,animatedPosition:o,animatedKeyboardState:s,getBottomSheetVisibleContentHeight:l,KEYBOARD_STATUS:c}){const u=function(){const{containerHeight:e,handleHeight:u}=t.get();if(e<0||u<0)return{height:0};const h=n.get().detents?.[0],b=null==h?o.get():Math.min(o.get(),h),p=s.get();return{height:l({containerHeight:e,contentPosition:b,handleHeight:u,keyboardHeight:p.heightWithinContainer,isKeyboardVisible:p.status===c.SHOWN})}};return u.__closure={animatedLayoutState:t,animatedDetentsState:n,animatedPosition:o,animatedKeyboardState:s,getBottomSheetVisibleContentHeight:l,KEYBOARD_STATUS:c},u.__workletHash=3908604100894,u.__initData=e,u})({_worklet_3908604100894_init_data:W,animatedLayoutState:c,animatedDetentsState:o,animatedPosition:u,animatedKeyboardState:l,getBottomSheetVisibleContentHeight:w.getBottomSheetVisibleContentHeight,KEYBOARD_STATUS:y.KEYBOARD_STATUS}),[o,l,c,u]);let b,p;return t[0]!==h?(b=[A.bottomSheetVisibleContent,h],t[0]=h,t[1]=b):b=t[1],t[2]!==n||t[3]!==b?(p=(0,H.jsx)(x.default.View,{style:b,children:n}),t[2]=n,t[3]=b,t[4]=p):p=t[4],p}function K(e){const l=(0,s.c)(43),{header:c,onClose:h,showCloseButton:p,testID:S}=e,y=void 0===p||p,{theme:f}=(0,b.useUnistyles)(),{t:x}=(0,u.useTranslation)();let _;l[0]!==f.colors.foreground?(_=[A.title,{color:f.colors.foreground}],l[0]=f.colors.foreground,l[1]=_):_=l[1];const w=_,j=c.back,B=j?.onPress,k=c.search;let P;l[2]!==k?(P=e=>{k?.onChange(e)},l[2]=k,l[3]=P):P=l[3];const T=P;let v,I,R,L,z,O,W,E,K;return l[4]!==j?.accessibilityLabel||l[5]!==j?.label||l[6]!==B||l[7]!==x||l[8]!==f.colors.foreground||l[9]!==f.colors.foregroundMuted?(v=B?(0,H.jsx)(o.Pressable,{onPress:B,hitSlop:8,style:A.headerBackButton,accessibilityRole:"button",accessibilityLabel:j?.accessibilityLabel??j?.label??x("common.actions.back"),testID:"sheet-header-back",children:e=>{const{pressed:t}=e;return(0,H.jsx)(C.ArrowLeft,{size:18,color:t?f.colors.foreground:f.colors.foregroundMuted})}}):null,l[4]=j?.accessibilityLabel,l[5]=j?.label,l[6]=B,l[7]=x,l[8]=f.colors.foreground,l[9]=f.colors.foregroundMuted,l[10]=v):v=l[10],l[11]!==c.leading?(I=c.leading?(0,H.jsx)(t.View,{style:A.headerLeadingSlot,children:c.leading}):null,l[11]=c.leading,l[12]=I):I=l[12],l[13]!==c.title||l[14]!==w?(R=(0,H.jsx)(n.Text,{style:w,numberOfLines:1,children:c.title}),l[13]=c.title,l[14]=w,l[15]=R):R=l[15],l[16]!==c.subtitle||l[17]!==R?(L=(0,H.jsxs)(t.View,{style:A.headerTitleGroup,children:[R,c.subtitle]}),l[16]=c.subtitle,l[17]=R,l[18]=L):L=l[18],l[19]!==c.actions?(z=c.actions?(0,H.jsx)(t.View,{style:A.headerActions,children:c.actions}):null,l[19]=c.actions,l[20]=z):z=l[20],l[21]!==h||l[22]!==y||l[23]!==x||l[24]!==f.colors.foreground||l[25]!==f.colors.foregroundMuted?(O=y?(0,H.jsx)(o.Pressable,{accessibilityRole:"button",accessibilityLabel:x("common.actions.close"),style:A.closeButton,onPress:h,children:e=>{const{pressed:t}=e;return(0,H.jsx)(C.X,{size:16,color:t?f.colors.foreground:f.colors.foregroundMuted})}}):null,l[21]=h,l[22]=y,l[23]=x,l[24]=f.colors.foreground,l[25]=f.colors.foregroundMuted,l[26]=O):O=l[26],l[27]!==v||l[28]!==I||l[29]!==L||l[30]!==z||l[31]!==O?(W=(0,H.jsxs)(t.View,{style:A.headerRow,children:[v,I,L,z,O]}),l[27]=v,l[28]=I,l[29]=L,l[30]=z,l[31]=O,l[32]=W):W=l[32],l[33]!==T||l[34]!==k||l[35]!==x||l[36]!==f.colors.foregroundMuted||l[37]!==f.iconSize?(E=k?(0,H.jsxs)(t.View,{style:A.searchRow,children:[(0,H.jsx)(C.Search,{size:f.iconSize.md,color:f.colors.foregroundMuted}),(0,H.jsx)(V.AdaptiveTextInput,{style:[A.searchInput,D.isWeb&&{outlineStyle:"none"}],placeholder:k.placeholder??x("common.actions.search"),resetKey:k.resetKey,onChangeText:T,onFocus:k.onFocus,onBlur:k.onBlur,autoCapitalize:"none",autoCorrect:!1,autoFocus:k.autoFocus,testID:k.testID})]}):null,l[33]=T,l[34]=k,l[35]=x,l[36]=f.colors.foregroundMuted,l[37]=f.iconSize,l[38]=E):E=l[38],l[39]!==W||l[40]!==E||l[41]!==S?(K=(0,H.jsxs)(t.View,{style:A.headerContainer,testID:S,children:[W,E]}),l[39]=W,l[40]=E,l[41]=S,l[42]=K):K=l[42],K}},3691,[896,897,898,454,37,388,854,402,426,235,147,57,1217,2882,3034,899,1218,3692,3697,3027,881,3698,627,3699,280]);
15347
15347
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","presentation","contextBridge","backdropOpacity"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"IsolatedBottomSheetModal",{enumerable:!0,get:function(){return C}}),_e.useIsolatedBottomSheetVisibility=function({visible:e,isEnabled:t,onClose:n}){const s=(0,l.useRef)(n);s.current=n;const o=(0,l.useMemo)(()=>(0,h.createBottomSheetVisibilityTracker)({onClose:()=>s.current(),backPress:u.systemBackPress}),[]),c=(0,l.useCallback)(e=>{o.attachController(e)},[o]),p=(0,l.useCallback)(e=>o.handleSheetIndexChange(e),[o]),b=(0,l.useCallback)(()=>o.handleSheetDismiss(),[o]);return(0,l.useEffect)(()=>{o.syncDesired({visible:e,isEnabled:t})},[t,o,e]),{sheetRef:c,handleSheetChange:p,handleSheetDismiss:b}};var t,n=r(d[0]),s=(t=n)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),l=r(d[3]),u=r(d[4]),h=r(d[5]),p=r(d[6]),b=r(d[7]),f=r(d[8]);const C=(0,l.forwardRef)(function(t,n){const u=(0,o.c)(20),h=(0,l.useRef)(null);let C,S,k,v,x,y,B;if(u[0]===Symbol.for("react.memo_cache_sentinel")?(C=()=>({present:(...e)=>{const t=e;return h.current?.present(...t)},dismiss:(...e)=>{const t=e;return h.current?.dismiss(...t)},snapToIndex:(...e)=>{const t=e;return h.current?.snapToIndex(...t)},snapToPosition:(...e)=>{const t=e;return h.current?.snapToPosition(...t)},expand:(...e)=>{const t=e;return h.current?.expand(...t)},collapse:(...e)=>{const t=e;return h.current?.collapse(...t)},close:(...e)=>{const t=e;return h.current?.close(...t)},forceClose:(...e)=>{const t=e;return h.current?.forceClose(...t)}}),S=[],u[0]=C,u[1]=S):(C=u[0],S=u[1]),(0,l.useImperativeHandle)(n,C,S),u[2]!==t){var _=t;({children:x,presentation:B,contextBridge:y,backdropOpacity:k}=_),v=(0,s.default)(_,e),u[2]=t,u[3]=k,u[4]=v,u[5]=x,u[6]=y,u[7]=B}else k=u[3],v=u[4],x=u[5],y=u[6],B=u[7];const j=void 0===B?"push":B;let O;u[8]!==k?(O=e=>(0,f.jsx)(b.SheetBackdrop,Object.assign({},e,{opacity:k})),u[8]=k,u[9]=O):O=u[9];const I=void 0===k?void 0:O;let P,M,T;u[10]!==x||u[11]!==y?(P=y?y(x):x,u[10]=x,u[11]=y,u[12]=P):P=u[12],u[13]!==P?(M=(0,f.jsx)(p.BottomSheetScope,{children:P}),u[13]=P,u[14]=M):M=u[14],u[15]!==v||u[16]!==j||u[17]!==I||u[18]!==M?(T=(0,f.jsx)(c.BottomSheetModal,Object.assign({},v,{ref:h,enableDismissOnClose:!0,stackBehavior:j,backdropComponent:I,children:M})),u[15]=v,u[16]=j,u[17]=I,u[18]=M,u[19]=T):T=u[19];return T})},3692,[36,454,3034,37,3693,3694,3695,3696,280]);
15348
15348
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"systemBackPress",{enumerable:!0,get:function(){return s}});var e,t=r(d[0]);(e=t)&&e.__esModule;r(d[1]);const s={subscribe:e=>()=>{}}},3693,[399,26]);
15349
15349
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createBottomSheetVisibilityTracker=function(s){let n,t=null,l=!1,o="closed",c=!1,u=null;function f(s){o=s,p()}function p(){const n="presented"===o&&null!==t;if(n!==(null!==u))return n?void(u=s.backPress?.subscribe(()=>(h(),!0))??null):(u?.(),void(u=null))}function b(){t&&"closed"===o&&(c=!1,f("presenting"),t.present())}function h(){t&&"closed"!==o&&"dismissing"!==o&&(f("dismissing"),t.dismiss())}return{attachController(s){t=s,p(),s&&l&&!1!==n&&b()},syncDesired(s){if(l=s.visible,n=s.isEnabled,!1!==n){if(!l)return"dismissing"===o?(f("closed"),void(c=!1)):void h();b()}},handleSheetIndexChange(s){-1===s?"presenting"!==o&&"presented"!==o||f("dismissing"):"presenting"!==o&&"dismissing"!==o||f("presented")},handleSheetDismiss(){if(l)return f("dismissing"),void(c||(c=!0,s.onClose()));f("closed"),c=!1}}}},3694,[]);
@@ -16029,7 +16029,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
16029
16029
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAgentProfileFormCatalog=function(o){const n=(0,t.c)(5);let u;n[0]===Symbol.for("react.memo_cache_sentinel")?(u={cwd:null},n[0]=u):u=n[0];const{entries:c}=(0,l.useProvidersSnapshot)(o.serverId,u);let f,v;n[1]!==c||n[2]!==o.model?(f=()=>{c&&o.model.applyProviderCatalog(c)},v=[c,o.model],n[1]=c,n[2]=o.model,n[3]=f,n[4]=v):(f=n[3],v=n[4]);(0,s.useEffect)(f,v)},e.useAgentProfileFormFeatures=function(l){const f=(0,t.c)(21),{t:v}=(0,o.useTranslation)(),y=(0,u.useHostRuntimeClient)(l.serverId),p=(0,u.useHostRuntimeIsConnected)(l.serverId),F=l.state.featureRequest,w=l.state.featureRequestKey;let h;f[0]!==l.serverId||f[1]!==w?(h=["agentProfileFeatures",l.serverId,w],f[0]=l.serverId,f[1]=w,f[2]=h):h=f[2];const I=Boolean(y&&p&&F);let P,E;f[3]!==y||f[4]!==F||f[5]!==v?(P=async()=>{if(!y||!F)throw new Error(v("workspace.terminal.hostDisconnected"));const t=await y.listProviderFeatures(Object.assign({},F,{cwd:c}));if(t.error)throw new Error(t.error);return t.features??[]},f[3]=y,f[4]=F,f[5]=v,f[6]=P):P=f[6];f[7]!==h||f[8]!==I||f[9]!==P?(E={queryKey:h,dataShape:"value",staleTimeMs:3e5,enabled:I,retry:!1,queryFn:P},f[7]=h,f[8]=I,f[9]=P,f[10]=E):E=f[10];const _=(0,n.useFetchQuery)(E),{data:b,isError:q}=_,{model:C}=l;let R,S,j,A;f[11]!==b||f[12]!==C||f[13]!==w?(R=()=>{w&&b&&C.applyFeatures(w,b)},S=[b,C,w],f[11]=b,f[12]=C,f[13]=w,f[14]=R,f[15]=S):(R=f[14],S=f[15]);(0,s.useEffect)(R,S),f[16]!==q||f[17]!==C||f[18]!==w?(j=()=>{w&&q&&C.applyFeaturesUnavailable(w)},A=[q,C,w],f[16]=q,f[17]=C,f[18]=w,f[19]=j,f[20]=A):(j=f[19],A=f[20]);(0,s.useEffect)(j,A)};var t=r(d[0]),s=r(d[1]),o=r(d[2]),n=r(d[3]),l=r(d[4]),u=r(d[5]);const c="~"},4374,[454,37,854,3741,3835,3529]);
16030
16030
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAgentProfileFormModel=function(u){const s=(0,t.c)(5);let c;s[0]!==u?(c=()=>(0,o.openAgentProfileForm)(u),s[0]=u,s[1]=c):c=s[1];const[l]=(0,n.useState)(c);let f,S;s[2]!==l?(f=()=>()=>{l.close()},S=[l],s[2]=l,s[3]=f,s[4]=S):(f=s[3],S=s[4]);return(0,n.useEffect)(f,S),l},e.useAgentProfileFormState=function(t){return(0,n.useSyncExternalStore)(t.subscribe,t.getState,t.getState)};var t=r(d[0]),n=r(d[1]),o=r(d[2])},4375,[454,37,4376]);
16031
16031
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildFeatureRequestKey=D,e.openAgentProfileForm=function(o){let p=[],h="idle",V=null,M=[],S=new Set,w=!1;function q(o){const R=s(p,o.provider),S=u(p,o.provider),w=v(o,{entry:l(p,o.provider),models:R,modes:S}),q=c(p,w.provider,w.modelId),T=y(w),K=D(T),A=null!==K&&K===V,B=A?(0,t.applyFeatureValues)(M,w.featureValues):[],L=F(K,A),P=Object.assign({},w,{providerOptions:I(p),modelOptions:O(R),modeOptions:b(S),thinkingOptions:($=q,$.map(t=>f({id:t.id,label:(0,n.formatThinkingOptionLabel)(t),description:t.description,testID:`agent-profile-thinking-option-${t.id}`}))),features:B,providerDisplay:k(w.providerDisplay,w.provider,l(p,w.provider)?.label??null),modelDisplay:k(w.modelDisplay,w.modelId,R.find(n=>n.id===w.modelId)?.label??null),modeDisplay:k(w.modeDisplay,w.modeId,(()=>{const t=S.find(n=>n.id===w.modeId);return t?(0,n.formatAgentModeLabel)(t):null})()),thinkingDisplay:k(w.thinkingDisplay,w.thinkingOptionId,(()=>{const t=q.find(n=>n.id===w.thinkingOptionId);return t?(0,n.formatThinkingOptionLabel)(t):null})()),catalogResolution:h,featureResolution:L,featureRequest:T,featureRequestKey:K});var $;const _=Boolean(P.provider),E={showModelField:_&&(R.length>0||Boolean(P.modelId)),showModeField:_&&(S.length>0||Boolean(P.modeId)),showThinkingField:_&&(q.length>0||Boolean(P.thinkingOptionId)),showFeaturesField:_&&B.length>0},N=P.name.trim().length>0&&P.provider.length>0&&!P.isSubmitting,C=Object.assign({},P,{disclosure:E,canSubmit:N});return Object.assign({},C,{submitValue:N?j(C):null})}let T=q(R(o));function K(n){if(!w){T=q(n(T));for(const n of S)n()}}return{getState:()=>T,subscribe:n=>(S.add(n),()=>{S.delete(n)}),close:()=>{w=!0,S=new Set},applyProviderCatalog:n=>{p=[...n],h="complete",K(n=>n)},applyFeatures:(n,o)=>{n===T.featureRequestKey&&(V=n,M=[...o],K(n=>Object.assign({},n,{featureValues:(0,t.pruneFeatureValues)(n.featureValues,M)})))},applyFeaturesUnavailable:n=>{n===T.featureRequestKey&&(V=n,M=[],K(n=>n))},setName:n=>K(t=>Object.assign({},t,{name:n})),setAppearance:n=>K(t=>Object.assign({},t,{icon:n.icon,color:n.color})),setNotes:n=>K(t=>Object.assign({},t,{notes:n})),setProvider:(n,t)=>K(o=>o.provider===n?o:Object.assign({},o,{provider:n,providerDisplay:t,modelId:"",modelDisplay:null,modeId:"",modeDisplay:null,thinkingOptionId:"",thinkingDisplay:null,featureValues:{}})),setModel:(n,t)=>K(o=>{if(o.modelId===n)return o;const l=c(p,o.provider,n),s=o.thinkingOptionId.length>0&&l.some(n=>n.id===o.thinkingOptionId);return Object.assign({},o,{modelId:n,modelDisplay:t,thinkingOptionId:s?o.thinkingOptionId:"",thinkingDisplay:s?o.thinkingDisplay:null})}),setMode:(n,t)=>K(o=>Object.assign({},o,{modeId:n,modeDisplay:t})),setThinking:(n,t)=>K(o=>Object.assign({},o,{thinkingOptionId:n,thinkingDisplay:t})),setFeatureValue:(n,t)=>K(o=>Object.assign({},o,{featureValues:Object.assign({},o.featureValues,{[n]:t})})),setSubmitting:n=>K(t=>Object.assign({},t,{isSubmitting:n})),setSubmitError:n=>K(t=>Object.assign({},t,{submitError:n}))}};var n=r(d[0]),t=r(d[1]),o=r(d[2]);function l(n,t){return t?n.find(n=>n.provider===t)??null:null}function s(n,t){return(0,o.filterSelectableModels)(l(n,t)?.models??null)??[]}function u(n,t){return l(n,t)?.modes??[]}function p(n,t){const o=t.trim();return o?n.find(n=>n.id===o)??null:n.find(n=>n.isDefault)??n[0]??null}function c(n,t,o){return p(s(n,t),o)?.thinkingOptions??[]}function f(n){return Object.assign({id:n.id,value:n.id,label:n.label},n.description?{description:n.description}:{},{testID:n.testID})}function I(n){return n.filter(n=>n.enabled).map(n=>f({id:n.provider,label:n.label??n.provider,description:n.description,testID:`agent-profile-provider-option-${n.provider}`}))}function O(n){return n.map(n=>f({id:n.id,label:n.label,description:n.description??n.id,testID:`agent-profile-model-option-${n.id}`}))}function b(t){return t.map(t=>f({id:t.id,label:(0,n.formatAgentModeLabel)(t),description:t.description,testID:`agent-profile-mode-option-${t.id}`}))}function h(n){const t=n?.thinkingOptions??[];return n?.defaultThinkingOptionId??t.find(n=>n.isDefault)?.id??t[0]?.id??""}function v(n,t){const o=n.modelId||(l=t.models,l.find(n=>n.isDefault)?.id??l[0]?.id??"");var l;const s=n.modeId||(u=t.entry,c=t.modes,u?.defaultModeId??c[0]?.id??"");var u,c;const f=n.thinkingOptionId||h(p(t.models,o));return o===n.modelId&&s===n.modeId&&f===n.thinkingOptionId?n:Object.assign({},n,{modelId:o,modeId:s,thinkingOptionId:f})}function k(n,t,o){return t?o?{label:o}:n??{label:t}:null}function y(n){return n.provider?Object.assign({provider:n.provider},n.modelId?{model:n.modelId}:{},n.modeId?{modeId:n.modeId}:{},n.thinkingOptionId?{thinkingOptionId:n.thinkingOptionId}:{}):null}function D(n){return n?[n.provider,n.model??"",n.modeId??"",n.thinkingOptionId??""].join("|"):null}function j(n){const t=n.name.trim(),o=n.notes.trim();return t&&n.provider?Object.assign({name:t},n.icon?{icon:n.icon}:{},n.color?{color:n.color}:{},{provider:n.provider},n.modelId?{model:n.modelId}:{},n.modeId?{modeId:n.modeId}:{},n.thinkingOptionId?{thinkingOptionId:n.thinkingOptionId}:{},Object.keys(n.featureValues).length>0?{featureValues:n.featureValues}:{},o?{notes:o}:{}):null}function F(n,t){return null===n?"idle":t?"complete":"pending"}const V={name:"",provider:""};function M(n){return n?{label:n}:null}function R(n){const t=n.profile??V,o="create"===n.mode?n.seed:void 0,l=o?.name??t.name,s=o?.provider??t.provider,u=o?.modelId??t.model??"";return{mode:n.mode,name:l,icon:t.icon??"",color:t.color??"",notes:t.notes??"",provider:s,modelId:u,modeId:t.modeId??"",thinkingOptionId:t.thinkingOptionId??"",featureValues:Object.assign({},t.featureValues),providerOptions:[],modelOptions:[],modeOptions:[],thinkingOptions:[],features:[],providerDisplay:M(s),modelDisplay:M(u),modeDisplay:M(t.modeId),thinkingDisplay:M(t.thinkingOptionId),catalogResolution:"idle",featureResolution:"idle",featureRequest:null,featureRequestKey:null,disclosure:{showModelField:!1,showModeField:!1,showThinkingField:!1,showFeaturesField:!1},isSubmitting:!1,submitError:null,canSubmit:!1,submitValue:null}}},4376,[4240,4377,4242]);
16032
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pruneFeatureValues=function(t,s){const u=new Set(s.map(t=>t.id));let o=!1;const n={};for(const[s,l]of Object.entries(t))u.has(s)?n[s]=l:o=!0;return o?n:t},e.applyFeatureValues=function(t,s){if(0===Object.keys(s).length)return t;return t.map(t=>Object.prototype.hasOwnProperty.call(s,t.id)?Object.assign({},t,{value:s[t.id]}):t)},e.resolveFeatureValues=function(t){const s={};for(const u of t.features)Object.prototype.hasOwnProperty.call(t.localFeatureValues,u.id)?s[u.id]=t.localFeatureValues[u.id]:Object.prototype.hasOwnProperty.call(t.persistedFeatureValues,u.id)&&(s[u.id]=t.persistedFeatureValues[u.id]);return s}},4377,[]);
16032
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pruneFeatureValues=function(t,s){const u=new Set(s.map(t=>t.id));let l=!1;const n={};for(const[s,o]of Object.entries(t))u.has(s)?n[s]=o:l=!0;return l?n:t},e.applyFeatureValues=function(t,s){if(0===Object.keys(s).length)return t;return t.map(t=>Object.prototype.hasOwnProperty.call(s,t.id)?Object.assign({},t,{value:s[t.id]}):t)},e.resolveFeatureValues=function(t){if(!t.features)return Object.assign({},t.persistedFeatureValues,t.localFeatureValues);const s={};for(const u of t.features)Object.prototype.hasOwnProperty.call(t.localFeatureValues,u.id)?s[u.id]=t.localFeatureValues[u.id]:Object.prototype.hasOwnProperty.call(t.persistedFeatureValues,u.id)&&(s[u.id]=t.persistedFeatureValues[u.id]);return s}},4377,[]);
16033
16033
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.generateAgentProfileId=function(){return`agent_profile_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`}},4378,[]);
16034
16034
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAgentProfiles=function(f){const l=(0,s.c)(10),{config:u,patchConfig:c}=(0,o.useDaemonConfig)(f);let p;l[0]!==f?(p=s=>(0,n.supportsAgentProfiles)(s.sessions[f??""]?.serverInfo?.features),l[0]=f,l[1]=p):p=l[1];const P=(0,t.useSessionStore)(p);let v;l[2]!==c?(v=async s=>{await c({agentProfiles:s})},l[2]=c,l[3]=v):v=l[3];const _=v;let S,y;l[4]!==u?(S=u?u.agentProfiles??[]:null,l[4]=u,l[5]=S):S=l[5];l[6]!==P||l[7]!==_||l[8]!==S?(y={profiles:S,isSupported:P,saveProfiles:_},l[6]=P,l[7]=_,l[8]=S,l[9]=y):y=l[9];return y};var s=r(d[0]);r(d[1]);var o=r(d[2]),t=r(d[3]),n=r(d[4])},4379,[454,37,4380,3459,4381]);
16035
16035
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDaemonConfig=function(f){const l=(0,n.c)(17),{t:y}=(0,o.useTranslation)(),C=(0,t.useQueryClient)(),h=(0,c.useHostRuntimeClient)(f??""),p=(0,c.useHostRuntimeIsConnected)(f??"");let _;l[0]!==f?(_=(0,u.daemonConfigQueryKey)(f),l[0]=f,l[1]=_):_=l[1];const w=_,D=Boolean(f&&h&&p);let v,L;l[2]!==h||l[3]!==y?(v=async()=>{if(!h)throw new Error(y("workspace.terminal.hostDisconnected"));return(await h.getDaemonConfig()).config},l[2]=h,l[3]=y,l[4]=v):v=l[4];l[5]!==w||l[6]!==D||l[7]!==v?(L={queryKey:w,enabled:D,pushEvent:"status:daemon_config_changed",queryFn:v},l[5]=w,l[6]=D,l[7]=v,l[8]=L):L=l[8];const Q=(0,s.useReplicaQuery)(L);let R;l[9]!==h||l[10]!==C||l[11]!==w?(R=async n=>{if(!h)return;const t=await h.patchDaemonConfig(n);return C.setQueryData(w,t.config),t.config},l[9]=h,l[10]=C,l[11]=w,l[12]=R):R=l[12];const b=R,q=Q.data??null;let E;l[13]!==Q.isLoading||l[14]!==b||l[15]!==q?(E={config:q,isLoading:Q.isLoading,patchConfig:b},l[13]=Q.isLoading,l[14]=b,l[15]=q,l[16]=E):E=l[16];return E};var n=r(d[0]);r(d[1]);var t=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]),c=r(d[6])},4380,[454,37,800,854,3741,3562,3529]);
@@ -16146,7 +16146,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
16146
16146
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"COMPOSER_PILL_CLEARANCE",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"COMPOSER_PILL_MIN_HEIGHT",{enumerable:!0,get:function(){return t}}),e.resolveComposerPillClearance=l,e.resolveComposerTrackTailClearance=function(o){const c=l(o);return(o?n.SPACING[6]:20)+t+c},e.resolveComposerTrackControlClearance=function(o){const n=l(o);return n+t+n},Object.defineProperty(e,"composerPillStyles",{enumerable:!0,get:function(){return s}});var o=r(d[0]),n=r(d[1]);const c={compact:n.SPACING[2],wide:10},t=32;function l(o){return o?c.compact:c.wide}const s=o.StyleSheet.create(o=>({body:{flexDirection:"row",alignItems:"center",gap:o.spacing[2],minHeight:t,paddingHorizontal:o.spacing[3],paddingVertical:o.spacing[1],borderRadius:o.borderRadius["2xl"],borderWidth:o.borderWidth[1],borderColor:o.colors.borderAccent,backgroundColor:o.colors.surface1,uni__dependencies:[0]},bodyActive:{backgroundColor:o.colors.surface2,uni__dependencies:[0]},label:{fontSize:o.fontSize.sm,color:o.colors.foregroundMuted,uni__dependencies:[0]},labelActive:{color:o.colors.foreground,uni__dependencies:[0]}}))},4491,[57,306]);
16147
16147
  __d(function(g,r,_i,a,m,e,d){"use strict";function t(t,n){const o=t[n];return"string"==typeof o?o:void 0}function n(t){return 0===t.options.length||t.allowOther}function o(t,o,i,s,l={}){const u=i[o];if(u&&u.size>0)return!0;if(!n(t))return!1;if(l[o]?.length)return!0;const c=s[o]?.trim();return!!(c&&c.length>0)||t.allowEmpty}function i(t,n,i,s={}){return t?.every((t,l)=>o(t,l,n,i,s))??!1}Object.defineProperty(e,'__esModule',{value:!0}),e.parseQuestionFormQuestions=function(n){if("object"!=typeof n||null===n||!("questions"in n)||!Array.isArray(n.questions))return null;const o=n.questions,i=[];for(const n of o){if("object"!=typeof n||null===n)return null;const o=n;if("string"!=typeof o.question||"string"!=typeof o.header)return null;if(!Array.isArray(o.options))return null;const s=[];for(const t of o.options){if("object"!=typeof t||null===t)return null;const n=t;if("string"!=typeof n.label)return null;s.push({label:n.label,description:"string"==typeof n.description?n.description:void 0})}i.push({question:o.question,header:o.header,options:s,multiSelect:!0===o.multiSelect,allowOther:!0===o.allowOther||!0===o.isOther,allowEmpty:!0===o.allowEmpty,placeholder:t(o,"placeholder"),dismissLabel:t(o,"dismissLabel")})}return i.length>0?i:null},e.questionShowsTextInput=n,e.isQuestionAnswered=o,e.areQuestionsAnswered=i,e.buildQuestionFormAnswers=function(t,o,i){const s={};for(let l=0;l<t.length;l++){const u=t[l],c=o[l],f=i[l]?.trim(),p=c?Array.from(c).map(t=>u.options[t].label):[];if(n(u)){if(f&&f.length>0){s[u.header]=u.multiSelect?[...p,f].join(", "):f;continue}if(u.allowEmpty&&0===u.options.length){s[u.header]="";continue}}p.length>0&&(s[u.header]=p.join(", "))}return s},e.shouldSubmitEmptyOnDismiss=function(t){return t.length>0&&t.every(t=>t.allowEmpty&&0===t.options.length)},e.resolveDismissLabel=function(t,n="Dismiss"){return t.find(t=>t.dismissLabel)?.dismissLabel??n},e.resolveQuestionFormState=function({questions:t,selections:s,otherTexts:l,attachments:u,activeQuestionIndex:c}){const f=t?Math.min(c,t.length-1):0,p=t?.[f],h=!!p&&o(p,f,s,l,u),y=i(t,s,l,u),w=!t||f===t.length-1;return{resolvedActiveQuestionIndex:f,activeQuestion:p,activeQuestionAnswered:h,allAnswered:y,isLastQuestion:w,primaryAnswered:w?y:h,showTextInput:!!p&&n(p)}}},4492,[]);
16148
16148
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OverviewToolCallGroupView",{enumerable:!0,get:function(){return T}});var o=r(d[0]),n=r(d[1]),t=r(d[2]);r(d[3]);var l=r(d[4]),s=r(d[5]),u=r(d[6]),c=r(d[7]),C=r(d[8]),p=r(d[9]),h=r(d[10]);function f(o,n){return 2===o.length?`${o[0]} ${n} ${o[1]}`:o.length>2?`${o.slice(0,-1).join(", ")}, ${n} ${o.at(-1)}`:o[0]??""}function F(o){const n=o[0];return n?`${n.toLocaleUpperCase()}${o.slice(1)}`:o}function x(o){const t=(0,n.c)(27),{t:s}=(0,l.useTranslation)();let u;if(t[0]!==o.commandCount||t[1]!==o.editedFileCount||t[2]!==o.otherToolCount||t[3]!==o.paseoCallCount||t[4]!==o.readFileCount||t[5]!==o.searchCount||t[6]!==s){const n=[];let l,c,C,p,h,F,x;t[8]!==o.editedFileCount?(l=[o.editedFileCount,"toolCallGroup.editedFiles"],t[8]=o.editedFileCount,t[9]=l):l=t[9],t[10]!==o.commandCount?(c=[o.commandCount,"toolCallGroup.commands"],t[10]=o.commandCount,t[11]=c):c=t[11],t[12]!==o.readFileCount?(C=[o.readFileCount,"toolCallGroup.readFiles"],t[12]=o.readFileCount,t[13]=C):C=t[13],t[14]!==o.searchCount?(p=[o.searchCount,"toolCallGroup.searches"],t[14]=o.searchCount,t[15]=p):p=t[15],t[16]!==o.otherToolCount?(h=[o.otherToolCount,"toolCallGroup.otherTools"],t[16]=o.otherToolCount,t[17]=h):h=t[17],t[18]!==o.paseoCallCount?(F=[o.paseoCallCount,"toolCallGroup.paseoCalls"],t[18]=o.paseoCallCount,t[19]=F):F=t[19],t[20]!==l||t[21]!==c||t[22]!==C||t[23]!==p||t[24]!==h||t[25]!==F?(x=[l,c,C,p,h,F],t[20]=l,t[21]=c,t[22]=C,t[23]=p,t[24]=h,t[25]=F,t[26]=x):x=t[26];const T=x;for(const[o,t]of T)o>0&&n.push(s(`${t}.${1===o?"one":"other"}`,{count:o}));u=f(n,s("toolCallGroup.and")),t[0]=o.commandCount,t[1]=o.editedFileCount,t[2]=o.otherToolCount,t[3]=o.paseoCallCount,t[4]=o.readFileCount,t[5]=o.searchCount,t[6]=s,t[7]=u}else u=t[7];return u}const T=(0,t.memo)(function(l){const u=(0,n.c)(30),{group:f,expanded:T,onExpandedChange:$,children:G}=l,L=(0,t.useRef)(null),S=(0,C.useIsCompactFormFactor)(),j=x(f.summary);let v;u[0]!==j?(v=F(j),u[0]=j,u[1]=v):v=u[1];const y=v;let E;u[2]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{L.current?.scrollToEnd({animated:!1})},u[2]=E):E=u[2];const _=E;let w;u[3]!==T||u[4]!==f.run.id||u[5]!==$?(w=()=>{$(f.run.id,!T)},u[3]=T,u[4]=f.run.id,u[5]=$,u[6]=w):w=u[6];const I=w;let O;u[7]!==f.run.id||u[8]!==$?(O=()=>{$(f.run.id,!1)},u[7]=f.run.id,u[8]=$,u[9]=O):O=u[9];const D=O;let V;u[10]!==G?(V=()=>(0,h.jsx)(o.ScrollView,{ref:L,style:b.scroll,contentContainerStyle:b.content,nestedScrollEnabled:!0,showsVerticalScrollIndicator:!0,onContentSizeChange:_,children:G}),u[10]=G,u[11]=V):V=u[11];const W=V;if(S){let o,n,t;return u[12]!==y||u[13]!==f.isLoading||u[14]!==I?(o=(0,h.jsx)(c.ExpandableBadge,{testID:"tool-call-group",label:y,icon:s.Wrench,isLoading:f.isLoading,isExpanded:!1,onToggle:I}),u[12]=y,u[13]=f.isLoading,u[14]=I,u[15]=o):o=u[15],u[16]!==y||u[17]!==G||u[18]!==D||u[19]!==T?(n=(0,h.jsx)(p.OverviewToolCallGroupSheet,{visible:T,summary:y,onClose:D,children:G}),u[16]=y,u[17]=G,u[18]=D,u[19]=T,u[20]=n):n=u[20],u[21]!==o||u[22]!==n?(t=(0,h.jsxs)(h.Fragment,{children:[o,n]}),u[21]=o,u[22]=n,u[23]=t):t=u[23],t}let z;return u[24]!==y||u[25]!==T||u[26]!==f.isLoading||u[27]!==W||u[28]!==I?(z=(0,h.jsx)(c.ExpandableBadge,{testID:"tool-call-group",label:y,icon:s.Wrench,isLoading:f.isLoading,isExpanded:T,onToggle:I,renderDetails:W,borderlessWhenExpanded:!0}),u[24]=y,u[25]=T,u[26]=f.isLoading,u[27]=W,u[28]=I,u[29]=z):z=u[29],z}),b=u.StyleSheet.create(o=>({scroll:{maxHeight:400},content:{paddingTop:o.spacing[1],paddingHorizontal:13,uni__dependencies:[0]}}))},4493,[1144,454,37,183,854,1218,57,4267,1217,4494,280]);
16149
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OverviewToolCallGroupSheet=function(u){const h=(0,s.c)(32),{visible:D,summary:T,children:B,onClose:V}=u,{t:v}=(0,f.useTranslation)(),z=(0,l.useRef)(null),P=(0,b.useToolCallSheetContextBridge)();let I;h[0]!==V||h[1]!==D?(I={visible:D,onClose:V},h[0]=V,h[1]=D,h[2]=I):I=h[2];const{sheetRef:W,handleSheetChange:L,handleSheetDismiss:O}=(0,p.useIsolatedBottomSheetVisibility)(I);let k;h[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{z.current?.scrollToEnd({animated:!1})},h[3]=k):k=h[3];const H=k;let M,R,A,E,F,U,q,G,X,J,K;h[4]!==D?(M=()=>{if(!D)return;const n=requestAnimationFrame(H);return()=>cancelAnimationFrame(n)},h[4]=D,h[5]=M):M=h[5];h[6]!==B||h[7]!==D?(R=[B,H,D],h[6]=B,h[7]=D,h[8]=R):R=h[8];(0,l.useEffect)(M,R),h[9]===Symbol.for("react.memo_cache_sentinel")?(A=(0,y.jsx)(x,{size:20,uniProps:C}),h[9]=A):A=h[9];h[10]!==T?(E=(0,y.jsxs)(n.View,{style:w.headerLeft,children:[A,(0,y.jsx)(o.Text,{style:w.headerTitle,numberOfLines:2,testID:"tool-call-group-sheet-summary",children:T})]}),h[10]=T,h[11]=E):E=h[11];h[12]!==v?(F=v("common.actions.close"),h[12]=v,h[13]=F):F=h[13];h[14]===Symbol.for("react.memo_cache_sentinel")?(U=(0,y.jsx)(S,{size:20,uniProps:j}),h[14]=U):U=h[14];h[15]!==V||h[16]!==F?(q=(0,y.jsx)(t.Pressable,{onPress:V,style:w.closeButton,accessibilityRole:"button",accessibilityLabel:F,testID:"tool-call-group-sheet-close",children:U}),h[15]=V,h[16]=F,h[17]=q):q=h[17];h[18]!==E||h[19]!==q?(G=(0,y.jsxs)(n.View,{style:w.header,children:[E,q]}),h[18]=E,h[19]=q,h[20]=G):G=h[20];h[21]!==B?(X=(0,y.jsx)(c.BottomSheetScrollView,{ref:z,style:w.content,children:(0,y.jsx)(n.View,{style:w.contentContainer,children:B})}),h[21]=B,h[22]=X):X=h[22];h[23]!==G||h[24]!==X?(J=(0,y.jsxs)(n.View,{style:w.container,testID:"tool-call-group-sheet",children:[G,X]}),h[23]=G,h[24]=X,h[25]=J):J=h[25];h[26]!==P||h[27]!==L||h[28]!==O||h[29]!==W||h[30]!==J?(K=(0,y.jsx)(b.ToolCallSheetModal,{ref:W,contextBridge:P,snapPoints:_,index:0,enableDynamicSizing:!1,onChange:L,onDismiss:O,backdropOpacity:.5,enablePanDownToClose:!0,children:J}),h[26]=P,h[27]=L,h[28]=O,h[29]=W,h[30]=J,h[31]=K):K=h[31];return K};var n=r(d[0]),o=r(d[1]),t=r(d[2]),s=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),h=r(d[10]),f=r(d[11]),p=r(d[12]),b=r(d[13]),y=r(d[14]);const _=["60%","95%"],x=(0,h.withUnistyles)(u.Wrench),S=(0,h.withUnistyles)(u.X),C=n=>({color:n.colors.foreground}),j=n=>({color:n.colors.foregroundMuted});const w=h.StyleSheet.create(n=>({container:{flex:1,backgroundColor:n.colors.surface2,uni__dependencies:[0]},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderBottomWidth:n.borderWidth[1],borderBottomColor:n.colors.border,uni__dependencies:[0]},headerLeft:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],flex:1,uni__dependencies:[0]},headerTitle:{fontSize:n.fontSize.base,fontWeight:n.fontWeight.medium,color:n.colors.foreground,flex:1,uni__dependencies:[0]},closeButton:{padding:n.spacing[2],uni__dependencies:[0]},content:{flex:1,minHeight:0,backgroundColor:n.colors.surface2,uni__dependencies:[0]},contentContainer:{paddingHorizontal:13,paddingVertical:8}}))},4494,[896,897,898,454,37,426,235,147,3034,1218,57,854,3692,4301,280]);
16149
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OverviewToolCallGroupSheet=function(h){const u=(0,s.c)(32),{visible:T,summary:V,children:z,onClose:v}=h,{t:P}=(0,f.useTranslation)(),I=(0,l.useRef)(null),W=(0,b.useToolCallSheetContextBridge)();let L;u[0]!==v||u[1]!==T?(L={visible:T,onClose:v},u[0]=v,u[1]=T,u[2]=L):L=u[2];const{sheetRef:O,handleSheetChange:H,handleSheetDismiss:M}=(0,p.useIsolatedBottomSheetVisibility)(L);let R;u[3]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{I.current?.scrollToEnd({animated:!1})},u[3]=R):R=u[3];const k=R;let A,E,F,U,q,G,X,J,K,N,Q;u[4]!==T?(A=()=>{if(!T)return;const n=requestAnimationFrame(k);return()=>cancelAnimationFrame(n)},u[4]=T,u[5]=A):A=u[5];u[6]!==z||u[7]!==T?(E=[z,k,T],u[6]=z,u[7]=T,u[8]=E):E=u[8];(0,l.useEffect)(A,E),u[9]===Symbol.for("react.memo_cache_sentinel")?(F=(0,x.jsx)(C,{size:20,uniProps:w}),u[9]=F):F=u[9];u[10]!==V?(U=(0,x.jsxs)(n.View,{style:D.headerLeft,children:[F,(0,x.jsx)(t.Text,{style:D.headerTitle,numberOfLines:2,testID:"tool-call-group-sheet-summary",children:V})]}),u[10]=V,u[11]=U):U=u[11];u[12]!==P?(q=P("common.actions.close"),u[12]=P,u[13]=q):q=u[13];u[14]===Symbol.for("react.memo_cache_sentinel")?(G=(0,x.jsx)(j,{size:20,uniProps:B}),u[14]=G):G=u[14];u[15]!==v||u[16]!==q?(X=(0,x.jsx)(o.Pressable,{onPress:v,style:D.closeButton,accessibilityRole:"button",accessibilityLabel:q,testID:"tool-call-group-sheet-close",children:G}),u[15]=v,u[16]=q,u[17]=X):X=u[17];u[18]!==U||u[19]!==X?(J=(0,x.jsxs)(n.View,{style:D.header,children:[U,X]}),u[18]=U,u[19]=X,u[20]=J):J=u[20];u[21]!==z?(K=(0,x.jsx)(c.BottomSheetScrollView,{ref:I,style:S,onContentSizeChange:k,children:(0,x.jsx)(n.View,{style:D.contentContainer,children:z})}),u[21]=z,u[22]=K):K=u[22];u[23]!==J||u[24]!==K?(N=(0,x.jsx)(y.BottomSheetVisibleContent,{children:(0,x.jsxs)(n.View,{style:D.container,testID:"tool-call-group-sheet",children:[J,K]})}),u[23]=J,u[24]=K,u[25]=N):N=u[25];u[26]!==W||u[27]!==H||u[28]!==M||u[29]!==O||u[30]!==N?(Q=(0,x.jsx)(b.ToolCallSheetModal,{ref:O,contextBridge:W,snapPoints:_,index:0,enableDynamicSizing:!1,onChange:H,onDismiss:M,backdropOpacity:.5,enablePanDownToClose:!0,children:N}),u[26]=W,u[27]=H,u[28]=M,u[29]=O,u[30]=N,u[31]=Q):Q=u[31];return Q};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),h=r(d[9]),u=r(d[10]),f=r(d[11]),p=r(d[12]),b=r(d[13]),y=r(d[14]),x=r(d[15]);const _=["60%","95%"],S={flex:1,minHeight:0},C=(0,u.withUnistyles)(h.Wrench),j=(0,u.withUnistyles)(h.X),w=n=>({color:n.colors.foreground}),B=n=>({color:n.colors.foregroundMuted});const D=u.StyleSheet.create(n=>({container:{flex:1,backgroundColor:n.colors.surface2,uni__dependencies:[0]},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderBottomWidth:n.borderWidth[1],borderBottomColor:n.colors.border,uni__dependencies:[0]},headerLeft:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],flex:1,uni__dependencies:[0]},headerTitle:{fontSize:n.fontSize.base,fontWeight:n.fontWeight.medium,color:n.colors.foreground,flex:1,uni__dependencies:[0]},closeButton:{padding:n.spacing[2],uni__dependencies:[0]},contentContainer:{paddingHorizontal:13,paddingVertical:8}}))},4494,[896,897,898,454,37,426,235,147,3034,1218,57,854,3692,4301,3691,280]);
16150
16150
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildAgentStreamRenderModel=function(t){const n=(0,l.resolveStreamRenderStrategy)({platform:"web"===t.platform?"web":"native",isMobileBreakpoint:t.isMobileBreakpoint}),o=`${t.platform}:${t.isMobileBreakpoint}`,u=t.historyStart?t.tail.slice(t.historyStart):t.tail,M=f({cache:h,source:u,cacheKey:o,order:t=>(0,s.orderTailForStreamRenderStrategy)({strategy:n,streamItems:t})}),p=f({cache:y,source:t.head,cacheKey:o,order:t=>(0,s.orderHeadForStreamRenderStrategy)({strategy:n,streamHead:t})}),b=S({orderedTail:M,platform:t.platform,isMobileBreakpoint:t.isMobileBreakpoint}),T=v({isTurnActive:t.isTurnActive,activeTurnStartedAt:t.activeTurnStartedAt,tail:u,head:t.head});return{history:b.history,segments:Object.assign({},b.segments,{liveHead:p}),turnTiming:T,boundary:{hasVirtualizedHistory:b.segments.historyVirtualized.length>0,hasMountedHistory:b.segments.historyMounted.length>0,hasLiveHead:p.length>0},auxiliary:c}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]);const u=[],c={pendingPermissions:null,turnFooter:null},h=new WeakMap,y=new WeakMap,M=new WeakMap,p=new WeakMap;function f(t){const{cache:n,source:o,cacheKey:s,order:l}=t;let u=n.get(o);u||(u=new Map,n.set(o,u));const c=u.get(s);if(c)return c;const h=l(o);return u.set(s,h),h}function S(t){const{orderedTail:s,platform:l,isMobileBreakpoint:c}=t,h="web"===l&&!c&&s.length>(0,o.getWebPartialVirtualizationThreshold)(),y=`${l}:${c}:${(0,n.getMountedRecentStreamItems)()}:${h}`;let p=M.get(s);p||(p=new Map,M.set(s,p));const f=p.get(y);if(f)return f;if(!h){const t={history:s,segments:{historyVirtualized:u,historyMounted:s,liveHead:u}};return p.set(y,t),t}const S=(0,n.findMountedWindowStart)({items:s,minMountedCount:(0,n.getMountedRecentStreamItems)()}),v={history:s,segments:{historyVirtualized:s.slice(0,S),historyMounted:s.slice(S),liveHead:u}};return p.set(y,v),v}function v(n){let o=p.get(n.tail);o||(o=new WeakMap,p.set(n.tail,o));let s=o.get(n.head);s||(s=new Map,o.set(n.head,s));const l=`${n.isTurnActive}:${n.activeTurnStartedAt?.getTime()??"none"}`,u=s.get(l);if(u)return u;const c=(0,t.deriveStreamTurnTiming)(n);return s.set(l,c),c}},4495,[4496,4498,4499,4500,4501]);
16151
16151
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deriveStreamTurnTiming=function(n){const s=new Map;let u=null,l=null,o=[],c=null;const f=()=>{if(!l||0===o.length)return;const t={completedAt:l,durationMs:u?Math.max(0,l.getTime()-u.getTime()):null};for(const n of o)s.set(n,t)},T=n=>{(0,t.startsNewTurn)(n,c)&&(f(),u="user_message"===n.kind?n.timestamp:null,l=null,o=[]),"user_message"===n.kind&&"fork_marker"===c?.kind&&(u=n.timestamp),l=n.timestamp,"assistant_message"===n.kind&&o.push(n.id),c=n};for(const t of n.tail)T(t);for(const t of n.head)T(t);const _=n.isTurnActive?n.activeTurnStartedAt:null;n.isTurnActive||f();return{byAssistantId:s,runningStartedAt:_}};var t=r(d[0])},4496,[4497]);
16152
16152
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"continuesTurn",{enumerable:!0,get:function(){return n.continuesTurn}}),e.continuesResponse=function(t,o){return!(!t||!o)&&((0,n.continuesTurn)(t,o)||!u(o))},e.isTurnBoundary=t,e.startsNewTurn=function(n,u){return null===u||t(u,n)},e.belongsToTurn=function(n,u){return null!==u&&n.turnId===u};var n=r(d[0]);function u(n){return"user_message"===n.kind||"fork_marker"===n.kind}function t(u,t){return null!==u&&null!==t&&!(0,n.continuesTurn)(u,t)}},4497,[4256]);
@@ -16161,7 +16161,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
16161
16161
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IDLE_SCROLL_KEYBOARD_DISMISS_GESTURE",{enumerable:!0,get:function(){return n}}),e.beginDrag=function(s){const t=p(s),n=s.nativeEvent.contentOffset.y;return{phase:"dragging",samples:{startTs:t,startY:n,sampleTs:t,sampleY:n,previousSampleTs:0,previousSampleY:0}}},e.recordScroll=function(s,n){if("idle"===s.phase)return s;const l=p(n);if(l-s.samples.sampleTs<t)return s;const{samples:o}=s;return{phase:"dragging",samples:{startTs:o.startTs,startY:o.startY,sampleTs:l,sampleY:n.nativeEvent.contentOffset.y,previousSampleTs:o.sampleTs,previousSampleY:o.sampleY}}},e.releaseDrag=function(l,o){if("idle"===l.phase)return{gesture:l,shouldDismiss:!1};const u=p(o),c=o.nativeEvent.contentOffset.y,{samples:f}=l;let v=f.startTs,T=f.startY;u-f.sampleTs>=t?(v=f.sampleTs,T=f.sampleY):f.previousSampleTs>0&&(v=f.previousSampleTs,T=f.previousSampleY);const S=u-v;return{gesture:n,shouldDismiss:(S>0?(c-T)/S:0)>s}};const s=1.5,t=30,n=Object.freeze({phase:"idle"});function p(s){const t=s.nativeEvent.timestamp;return"number"==typeof t&&t>0?t:s.timeStamp}},4506,[]);
16162
16162
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_START_THRESHOLD_PX",{enumerable:!0,get:function(){return t}}),e.createHistoryStartPaginationState=function(){return{status:"dormant"}},e.isHistoryStartLoadingOperation=function(t){return"loading"===t.status||"settling"===t.status},e.rearmHistoryStartPagination=function(t){return"dormant"===t.status||"latched"===t.status?{status:"ready"}:t},e.abandonHistoryStartPaginationRequest=function(t,s){if("loading"!==t.status||t.requestObserved||t.requestedProgressKey!==s)return t;return{status:"latched"}},e.evaluateHistoryStartPagination=function(s,o){if("dormant"===s.status)return{state:s,shouldLoad:!1};if("loading"===s.status)return null!==o.progressKey&&o.progressKey!==s.requestedProgressKey?{state:{status:"settling",loadedProgressKey:o.progressKey},shouldLoad:!1}:o.isLoadingOlderHistory&&!s.requestObserved?{state:Object.assign({},s,{requestObserved:!0}),shouldLoad:!1}:o.isLoadingOlderHistory||o.hasOlderHistory?s.requestObserved&&!o.isLoadingOlderHistory&&o.progressKey===s.requestedProgressKey?{state:{status:"latched"},shouldLoad:!1}:{state:s,shouldLoad:!1}:{state:{status:"latched"},shouldLoad:!1};if("settling"===s.status)return{state:s,shouldLoad:!1};if(!(o.distanceFromHistoryStart<=t))return"ready"===s.status?{state:s,shouldLoad:!1}:{state:{status:"ready"},shouldLoad:!1};if("latched"===s.status||!o.isReady||!o.hasOlderHistory||o.isLoadingOlderHistory||null===o.progressKey)return{state:s,shouldLoad:!1};return{state:{status:"loading",requestedProgressKey:o.progressKey,requestObserved:!1},shouldLoad:!0}},e.settleHistoryStartPagination=function(s,o){if("settling"!==s.status)return{state:s,shouldLoad:!1};const u=o.distanceFromHistoryStart<=t;if(!u||!o.isReady||!o.hasOlderHistory||o.isLoadingOlderHistory||null===o.progressKey)return{state:u?{status:"latched"}:{status:"ready"},shouldLoad:!1};return{state:{status:"loading",requestedProgressKey:o.progressKey,requestObserved:!1},shouldLoad:!0}};const t=96},4507,[]);
16163
16163
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createHistoryStartSettleScheduler=function(l){let t=null,n=0;const u=()=>(l.onFrame?.(),l.isSettling()?l.isLoading()||n>0?(l.isLoading()||(n-=1),void(t=l.requestFrame(u))):(t=null,void l.onSettle()):(t=null,void(n=0)));return{schedule(){null===t&&(n=l.settleFrames,t=l.requestFrame(u))},cancel(){null!==t&&l.cancelFrame(t),t=null,n=0}}}},4508,[]);
16164
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createWebStreamStrategy=function(t){return(0,y.createStreamStrategy)({render:n=>(0,E.jsx)(_,Object.assign({},n,{isMobileBreakpoint:t.isMobileBreakpoint}),n.agentId),orderTailReverse:!1,orderHeadReverse:!1,assistantTurnTraversalStep:-1,edgeSlot:"footer",historyLiveBoundaryEdge:"last",liveHeadHistoryBoundaryEdge:"first",frameChildOrder:"content-then-footer",flatListInverted:!1,overlayScrollbarInverted:!1,maintainVisibleContentPosition:void 0,bottomAnchorTransportBehavior:{verificationDelayFrames:0,verificationRetryMode:"rescroll"},disableParentScrollOnInlineDetailsExpansion:!1,anchorBottomOnContentSizeChange:!0,animateManualScrollToBottom:!1,useVirtualizedList:!1,isNearBottom:t=>Math.max(0,t.contentHeight-(t.offsetY+t.viewportHeight))<=t.threshold,getBottomOffset:t=>Math.max(0,t.contentHeight-t.viewportHeight)})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),u=r(d[5]),c=r(d[6]),h=r(d[7]),f=r(d[8]),v=r(d[9]),y=r(d[10]),w=r(d[11]),p=r(d[12]),S=r(d[13]),H=r(d[14]),b=r(d[15]),E=r(d[16]);const R=200,L=1,M=64,C=1,x=2,z=16,I=100,A=48,k=8,F=(0,o.withUnistyles)(l.LoadingSpinner),T=t=>({color:t.colors.foregroundMuted});function V(t,n){for(const o of t.querySelectorAll("[data-history-row-id]"))if(o.dataset.historyRowId===n)return o;return null}const B={display:"flex",alignItems:"center",justifyContent:"center",height:32,flexShrink:0},O={display:"flex",flexDirection:"column",width:"100%"};function P(t,n=M){const o=Number.isFinite(n)?Math.max(0,n):M,{scrollTop:s,clientHeight:l,scrollHeight:u}=t;if(![s,l,u].every(Number.isFinite))return!0;return u-l-s<=o}function W(t){return t.clientHeight>0&&t.scrollHeight>0}function j(t){if(!(t instanceof Element))return!1;const n=t.closest("input, textarea, [contenteditable]");if(!n)return!1;const o=n.tagName.toLowerCase();return"input"===o||"textarea"===o||"false"!==n.getAttribute("contenteditable")?.toLowerCase()}function Y(t,n){let o=t instanceof Element?t:null;for(;o&&o!==n;){if(o instanceof HTMLElement){const t=window.getComputedStyle(o).overflowY;if(("auto"===t||"scroll"===t)&&o.scrollHeight>o.clientHeight&&o.scrollTop>0)return!0}o=o.parentElement}return!1}function q(t,n){if(t.target!==n)return!1;if(n.scrollHeight<=n.clientHeight)return!1;const o=Math.max(n.offsetWidth-n.clientWidth,c.WEB_SCROLLBAR_SIZE_PX),s=n.getBoundingClientRect();return"rtl"===window.getComputedStyle(n).direction?t.clientX<=s.left+o:t.clientX>=s.right-o}function K(t,n="auto"){t.scrollTo({top:t.scrollHeight,behavior:n})}function U(t,n){if(!t)return n(!0),!0;const o=P(t);return n(o),o}function D(t){return t.scrollHeight-t.clientHeight-t.scrollTop}function N(t){return D(t)<-2}function _(o){const{segments:l,historyRowRevision:c,liveHeadRowRevision:y,boundary:D,renderers:_,listEmptyComponent:X,viewportRef:J,routeBottomAnchorRequest:Z,isAuthoritativeHistoryReady:$,onNearBottomChange:G,onReadingPositionChange:Q,onNearHistoryStart:ee,isLoadingOlderHistory:te,hasOlderHistory:re,olderHistoryProgressKey:ne,scrollEnabled:ie,contentMaxWidth:oe,isMobileBreakpoint:se}=o,le=(0,v.useRevisedHistoryRows)(l.historyVirtualized,c),ae=(0,v.useRevisedHistoryRows)(l.historyMounted,c),ue=(0,t.useMemo)(()=>Object.assign({},l,{historyVirtualized:le,historyMounted:ae}),[ae,le,l]),ce=(0,s.useRetainedPanelActive)(),de=(0,t.useRef)(ce),he=(0,t.useRef)(null),fe=(0,t.useRef)(null),ve=(0,t.useCallback)(t=>{he.current=t},[]),me=(0,t.useCallback)(t=>{fe.current=t},[]),[ge,ye]=(0,t.useState)(!0),we=(0,t.useRef)(ge),pe=t=>(we.current=t,ye(t),t),Se=(0,t.useRef)(0),He=(0,t.useRef)(null),be=(0,t.useRef)(0),Ee=(0,t.useRef)(null),Re=(0,t.useRef)(null),Le=(0,t.useRef)(null),Me=(0,t.useRef)(new Map),Ce=(0,t.useRef)(!1),[xe,ze]=(0,t.useState)(w.createHistoryStartPaginationState),Ie=(0,t.useRef)(xe),Ae=(0,t.useRef)(null),ke=(0,t.useRef)(!1),Fe=(0,t.useRef)(null),Te=(0,t.useRef)(null),Ve=(0,t.useRef)(null),Be=(0,t.useRef)(!1),Oe=(0,t.useRef)(!1),Pe=(0,t.useRef)(!1),We=ue.historyVirtualized.length>0,{renderHistoryVirtualizedRow:je,renderHistoryMountedRow:Ye,renderLiveHeadRow:qe,renderLiveAuxiliary:Ke}=_;de.current=ce,we.current=ge;const Ue=null!==Z,De=Z?.requestKey??o.agentId,Ne=!Ue||$,_e=(0,S.useChatFindSelectedMessageId)(),Xe=(0,t.useMemo)(()=>{if(!_e)return null;const t=ue.historyVirtualized.flatMap((t,n)=>(0,H.getStreamItemMessageId)(t)===_e?[n]:[]);return t.length>0?t:null},[_e,ue.historyVirtualized]),Je=(0,t.useCallback)(t=>{const o=(0,n.defaultRangeExtractor)(t);return Xe?[...new Set([...o,...Xe])].sort((t,n)=>t-n):o},[Xe]),Ze=(0,t.useMemo)(()=>{const t=new Map,n=fe.current;if(!n)return t;const o=new Set(ue.historyVirtualized.map(t=>t.id)),s=n.querySelectorAll("[data-history-row-id]:not([data-index])");for(const n of s){const s=n.dataset.historyRowId;s&&o.has(s)&&t.set(s,n.getBoundingClientRect().height)}return t},[ue.historyVirtualized]),$e=(0,n.useVirtualizer)({count:ue.historyVirtualized.length,enabled:We,getScrollElement:()=>he.current,initialOffset:()=>he.current?.scrollTop??0,getItemKey:t=>ue.historyVirtualized[t]?.id??t,estimateSize:t=>{const n=ue.historyVirtualized[t];return n?Ze.get(n.id)??(0,f.estimateStreamItemHeight)(n,oe):120},measureElement:n.measureElement,rangeExtractor:Je,scrollMargin:A,useAnimationFrameWithResizeObserver:!0,overscan:8});(0,t.useEffect)(()=>($e.shouldAdjustScrollPositionOnItemSizeChange=(t,n,o)=>{const s=o.scrollRect?.height??0,l=o.scrollOffset??0,u=o.getTotalSize()-(l+s);return(0,f.shouldAdjustScrollForVirtualRowResize)({isHistoryStartPrependActive:ke.current,rowStart:t.start,scrollOffset:l,remainingDistanceFromBottom:u,bottomThreshold:M})},()=>{$e.shouldAdjustScrollPositionOnItemSizeChange=void 0}),[$e]);const Ge=$e.getVirtualItems(),Qe=$e.getTotalSize(),et=(0,u.useStableEvent)(()=>{const t=he.current;if(!de.current||!t||!W(t))return null;const n=!we.current||P(t);return{distanceFromHistoryStart:t.scrollTop,hasOlderHistory:re,isLoadingOlderHistory:te,isReady:Ce.current&&n,progressKey:ne}}),tt=(0,u.useStableEvent)(t=>{const n=Ie.current;if(Ie.current=t.state,t.state!==n&&ze(t.state),(0,w.isHistoryStartLoadingOperation)(t.state)||(Ae.current=null,ke.current=!1),!t.shouldLoad||null===ne)return;const o=he.current,s=fe.current,l=ue.historyMounted.at(-1)??ue.historyVirtualized.at(-1),u=s&&l?V(s,l.id):null;Ae.current=o&&l&&u?{progressKey:ne,rowId:l.id,viewportOffset:u.getBoundingClientRect().top-o.getBoundingClientRect().top}:null,ke.current=!1;const c=ne;(async()=>{!0!==await ee()&&tt({state:(0,w.abandonHistoryStartPaginationRequest)(Ie.current,c),shouldLoad:!1})})()}),rt=(0,u.useStableEvent)(()=>{const t=et();if(!t)return;const n=(0,w.evaluateHistoryStartPagination)(Ie.current,t);tt(n)}),nt=(0,u.useStableEvent)(()=>{const t=(0,w.rearmHistoryStartPagination)(Ie.current);t!==Ie.current&&(Ie.current=t,ze(t),rt())}),it=(0,u.useStableEvent)(()=>{const t=he.current,n=fe.current,o=Ae.current;if(!(t&&n&&o&&ke.current))return;const s=V(n,o.rowId);if(!s)return;const l=s.getBoundingClientRect().top-t.getBoundingClientRect().top;t.scrollTop+=l-o.viewportOffset,Se.current=t.scrollTop}),ot=(0,u.useStableEvent)(()=>{let t=Fe.current;t||(t=(0,p.createHistoryStartSettleScheduler)({settleFrames:x,requestFrame:t=>window.requestAnimationFrame(t),cancelFrame:t=>window.cancelAnimationFrame(t),isSettling:()=>"settling"===Ie.current.status,isLoading:()=>{const t=et();return!t||t.isLoadingOlderHistory||Me.current.size>0},onFrame:it,onSettle:()=>{const t=et();if(!t)return;ke.current=!1;const n=(0,w.settleHistoryStartPagination)(Ie.current,t);Ae.current=null,tt(n)}}),Fe.current=t),t.schedule()});(0,t.useLayoutEffect)(()=>{if(!de.current)return;const t=Ae.current;t&&t.progressKey!==ne&&(ke.current=!0,rt(),it(),ot())},[it,rt,ne,ot,ue.historyMounted,ue.historyVirtualized,Qe]);const st=(0,t.useCallback)(t=>{if(!t)return void $e.measureElement(null);const n=Me.current,o=n.get(t);void 0!==o&&window.cancelAnimationFrame(o);const s=window.requestAnimationFrame(()=>{n.delete(t),de.current&&t.isConnected&&$e.measureElement(t)});n.set(t,s)},[$e]);(0,t.useEffect)(()=>{const t=Me.current;return()=>{for(const n of t.values())window.cancelAnimationFrame(n);t.clear()}},[]);const lt=(0,t.useCallback)(()=>{const t=Re.current;null!==t&&(Re.current=null,window.cancelAnimationFrame(t));const n=Le.current;null!==n&&(Le.current=null,window.clearTimeout(n))},[]),at=(0,t.useCallback)(()=>{const t=He.current,n="autoscroll"===t?.kind?t.evidenceExpiryFrame:null;null!=n&&window.cancelAnimationFrame(n),He.current=null},[]),ut=(0,t.useCallback)(()=>{be.current=0},[]),ct=(0,t.useCallback)(()=>{be.current=window.performance.now()+I},[]);(0,t.useLayoutEffect)(()=>{if(!ce){lt(),Fe.current?.cancel();for(const t of Me.current.values())window.cancelAnimationFrame(t);Me.current.clear(),at(),ut(),Ee.current=null}},[lt,at,ut,ce]);const dt=(0,t.useCallback)((t="auto")=>{const n=he.current;de.current&&n&&W(n)&&(N(n)||(K(n,t),Se.current=n.scrollTop,U(n,G),rt()))},[rt,G]),ht=(0,t.useCallback)(()=>{if(!de.current)return;const t=he.current;t&&N(t)||null===Re.current&&(Re.current=window.requestAnimationFrame(()=>{Re.current=null,de.current&&we.current&&dt("auto")}))},[dt]),ft=(0,t.useCallback)(()=>{lt(),dt("auto"),ht()},[lt,ht,dt]),vt=(0,u.useStableEvent)(()=>{if(!de.current)return;if(!Q)return;const t=he.current,n=fe.current;if(!t||!n)return void Q(null);const o=t.getBoundingClientRect().top+k;let s=null;for(const t of n.querySelectorAll("[data-history-row-id]")){const n=t.dataset.historyRowId;if(n&&(s=n,t.getBoundingClientRect().bottom>o))break}Q(s)}),mt=(0,t.useCallback)(()=>{if(!de.current)return;const t=he.current;t?(U(t,G),vt()):G(!0)},[G,vt]),{isJumpSettling:gt,scrollToMessage:yt}=(0,b.useScrollToMessage)({active:ce,scrollContainerRef:he,rowVirtualizer:$e,historyVirtualized:ue.historyVirtualized,cancelPendingStickToBottom:lt,setFollowOutput:pe,onNearBottomChange:G}),wt=(0,u.useStableEvent)(()=>{lt(),we.current&&pe(!1),nt()}),pt=(0,t.useCallback)(()=>{const t=he.current;if(!de.current||!t||!W(t))return;const n=t.scrollTop,o=P(t,C);const s=n<Se.current-L,l=n>Se.current+L,u=He.current,c="scrollbar"===u?.kind||"autoscroll"===u?.kind&&u.hasUpwardEvidence||window.performance.now()<be.current;!we.current&&o&&l&&!gt()?pe(!0):we.current&&s&&c&&wt(),Se.current=n,mt(),rt()},[rt,gt,wt,mt]);(0,t.useEffect)(()=>{const t=(0,w.createHistoryStartPaginationState)();Ie.current=t,ze(t),Ae.current=null,ke.current=!1;const n=window.requestAnimationFrame(()=>{Ce.current=!0,rt()});return()=>{window.cancelAnimationFrame(n),Ce.current=!1,Fe.current?.cancel(),Fe.current=null}},[rt,o.agentId]),(0,t.useLayoutEffect)(()=>{if(!de.current||!Ne)return;if(Ue&&!we.current)return;pe(!0),ft();const t=window.setTimeout(()=>{if(!we.current)return;const t=he.current;t&&(P(t)||ht())},R);return()=>{window.clearTimeout(t)}},[De,ft,Ue,Ne,ht]),(0,t.useLayoutEffect)(()=>{const t={scrollContainer:he.current,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,activationKey:De,isActivationReady:Ne,renderLiveAuxiliary:Ke,historyMounted:ue.historyMounted,historyVirtualized:ue.historyVirtualized,liveHead:ue.liveHead,virtualTotalSize:Qe},n=Boolean(ce&&!Be.current&&Te.current&&(o=Te.current,s=t,o.scrollContainer===s.scrollContainer&&o.viewportWidth===s.viewportWidth&&o.viewportHeight===s.viewportHeight&&o.activationKey===s.activationKey&&o.isActivationReady===s.isActivationReady&&o.renderLiveAuxiliary===s.renderLiveAuxiliary&&o.historyMounted===s.historyMounted&&o.historyVirtualized===s.historyVirtualized&&o.liveHead===s.liveHead&&o.virtualTotalSize===s.virtualTotalSize));var o,s;Oe.current=n,Pe.current=n,Be.current=ce,ce&&(Te.current=t,we.current&&!n&&(lt(),dt("auto")))},[De,lt,ce,Ne,Ke,dt,ue.historyMounted,ue.historyVirtualized,ue.liveHead,Qe]),(0,t.useEffect)(()=>{if(!ce)return;const t=Oe.current;Oe.current=!1,t||mt(),rt(),"settling"===Ie.current.status&&ot()},[rt,re,ce,te,ne,ot,ue.historyMounted.length,ue.historyVirtualized.length,ue.liveHead.length,mt,Qe]),(0,t.useLayoutEffect)(()=>{if(!ce)return;const t=he.current,n=fe.current;if(!t||"undefined"==typeof ResizeObserver)return;Pe.current||(mt(),rt());const o=new ResizeObserver(()=>{const n={clientWidth:(o=t).clientWidth,clientHeight:o.clientHeight,scrollWidth:o.scrollWidth,scrollHeight:o.scrollHeight};var o,s,l;if(Pe.current){Pe.current=!1,vt();const t=Ve.current;if(Ve.current=n,t&&(l=n,(s=t).clientWidth===l.clientWidth&&s.clientHeight===l.clientHeight&&s.scrollWidth===l.scrollWidth&&s.scrollHeight===l.scrollHeight))return}else Ve.current=n;ke.current&&it(),"settling"===Ie.current.status&&ot(),mt(),rt(),we.current&&ht()});return o.observe(t),n&&o.observe(n),()=>{o.disconnect()}},[it,rt,ce,vt,ot,ht,mt]),(0,t.useLayoutEffect)(()=>{if(!ce)return;const t=he.current;if(!t)return;const n=()=>{ct(),t.scrollTop<=L&&nt()},o=o=>{!o.ctrlKey&&o.deltaY<0&&!Y(o.target,t)&&n()},s=o=>{var s;!j((s=o).target)&&("ArrowUp"===s.key||"PageUp"===s.key||"Home"===s.key||" "===s.key&&s.shiftKey)&&(Y(o.target,t)||n())},l=n=>{at(),"mouse"!==n.pointerType||!n.isPrimary||0!==n.button&&1!==n.button||j(n.target)||(0!==n.button?He.current={kind:"autoscroll",pointerId:n.pointerId,lastClientY:n.clientY,hasUpwardEvidence:!1,evidenceExpiryFrame:null}:q(n,t)&&(He.current={kind:"scrollbar",pointerId:n.pointerId}))},u=t=>{const n=He.current;n&&"autoscroll"===n.kind&&n.pointerId===t.pointerId&&(t.clientY<n.lastClientY-L&&(n.hasUpwardEvidence=!0,null!==n.evidenceExpiryFrame&&window.cancelAnimationFrame(n.evidenceExpiryFrame),n.evidenceExpiryFrame=window.requestAnimationFrame(()=>{He.current===n&&(He.current=null)})),n.lastClientY=t.clientY)},c=t=>{const n=He.current;n?.pointerId===t.pointerId&&"scrollbar"===n.kind&&at()},h=t=>{He.current?.pointerId===t.pointerId&&at()},f=t=>{const n=t.touches[0];n&&(Ee.current=n.clientY)},v=o=>{const s=o.touches[0];if(!s)return;const l=Ee.current;null!==l&&s.clientY>l+1&&!Y(o.target,t)&&n(),Ee.current=s.clientY},y=()=>{Ee.current=null};return t.addEventListener("scroll",pt,{passive:!0}),t.addEventListener("wheel",o,{passive:!0}),t.addEventListener("keydown",s,{passive:!0}),t.addEventListener("pointerdown",l,{passive:!0}),window.addEventListener("pointermove",u,{passive:!0}),window.addEventListener("pointerup",c,{passive:!0}),window.addEventListener("pointercancel",h,{passive:!0}),window.addEventListener("blur",at),t.addEventListener("touchstart",f,{passive:!0}),t.addEventListener("touchmove",v,{passive:!0}),t.addEventListener("touchend",y,{passive:!0}),t.addEventListener("touchcancel",y,{passive:!0}),()=>{t.removeEventListener("scroll",pt),t.removeEventListener("wheel",o),t.removeEventListener("keydown",s),t.removeEventListener("pointerdown",l),window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",h),window.removeEventListener("blur",at),t.removeEventListener("touchstart",f),t.removeEventListener("touchmove",v),t.removeEventListener("touchend",y),t.removeEventListener("touchcancel",y),ut()}},[at,ut,pt,ce,ct,nt]),(0,t.useEffect)(()=>{const t={scrollToBottom:()=>{pe(!0),lt(),ft()},prepareForViewportChange:()=>{we.current&&ht()},detachFromBottom:()=>{pe(!1),lt()},scrollToMessage:yt};return J.current=t,()=>{J.current===t&&(J.current=null),lt()}},[lt,ft,ht,yt,J]);const St=(0,t.useMemo)(()=>({display:"flex",flexDirection:"column",minHeight:"100%",paddingTop:z,paddingBottom:16,paddingLeft:se?8:16,paddingRight:se?8:16,boxSizing:"border-box"}),[se]),Ht=(0,t.useMemo)(()=>({width:"100%",height:"100%",overflowX:"hidden",overflowY:ie?"auto":"hidden",overscrollBehaviorY:"contain",scrollbarWidth:ie&&!se?"none":void 0}),[se,ie]),bt=(0,t.useMemo)(()=>({position:"relative",flex:1,minWidth:0,minHeight:0}),[]),Et=(0,t.useMemo)(()=>({position:"relative",width:"100%",height:Qe}),[Qe]),Rt=(0,t.useCallback)(t=>({position:"absolute",top:0,left:0,display:"flex",flexDirection:"column",width:"100%",transform:`translateY(${t-A}px)`}),[]),Lt=(0,t.useMemo)(()=>ue.historyMounted.map((t,n)=>(0,E.jsx)("div",{"data-history-row-id":t.id,"data-message-id":(0,H.getStreamItemMessageId)(t),style:O,children:Ye(t,n,ue.historyMounted)},t.id)),[Ye,ue.historyMounted]),Mt=(0,t.useMemo)(()=>ue.liveHead.map((t,n)=>(0,E.jsx)("div",{"data-history-row-id":t.id,"data-message-id":(0,H.getStreamItemMessageId)(t),style:O,children:qe(t,n,ue.liveHead)},t.id)),[y,qe,ue.liveHead]),Ct=(0,t.useMemo)(()=>[...Lt,...Mt],[Mt,Lt]),xt=(0,t.useMemo)(()=>Ke(),[Ke]),zt=(0,t.useMemo)(()=>{const t=(0,w.isHistoryStartLoadingOperation)(xe);return(0,E.jsx)("div",{style:B,"data-testid":"older-history-slot",children:t?(0,E.jsx)("div",{"data-testid":"load-older-history-spinner",children:(0,E.jsx)(F,{size:"small",uniProps:T})}):null})},[xe]),It=!(D.hasMountedHistory||D.hasVirtualizedHistory||D.hasLiveHead||xt);return(0,E.jsxs)("div",{style:bt,children:[(0,E.jsx)("div",{ref:ve,"data-testid":"agent-chat-scroll","data-outside-titlebar":!0,"data-overlay-scrollbar":ie&&!se?"true":void 0,id:"agent-chat-scroll-"+(We?"web-dom-virtualized":"web-dom-scroll"),style:Ht,children:(0,E.jsxs)("div",{ref:me,style:St,children:[zt,We?(0,E.jsx)("div",{style:Et,children:Ge.map(t=>{const n=ue.historyVirtualized[t.index];return n?(0,E.jsx)("div",{"data-index":t.index,"data-history-row-id":n.id,"data-message-id":(0,H.getStreamItemMessageId)(n),ref:st,style:Rt(t.start),children:je(n,t.index,ue.historyVirtualized)},t.key):null})}):null,Ct,xt,It?X:null]})}),ie&&!se?(0,E.jsx)(h.DomOverlayScrollbar,{scrollContainerRef:he,onUserScrollUp:wt}):null]})}},4509,[37,4510,57,3709,3023,3912,4513,4514,4499,4503,4500,4507,4508,4247,4258,4517,280]);
16164
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createWebStreamStrategy=function(t){return(0,y.createStreamStrategy)({render:n=>(0,E.jsx)(_,Object.assign({},n,{isMobileBreakpoint:t.isMobileBreakpoint}),n.agentId),orderTailReverse:!1,orderHeadReverse:!1,assistantTurnTraversalStep:-1,edgeSlot:"footer",historyLiveBoundaryEdge:"last",liveHeadHistoryBoundaryEdge:"first",frameChildOrder:"content-then-footer",flatListInverted:!1,overlayScrollbarInverted:!1,maintainVisibleContentPosition:void 0,bottomAnchorTransportBehavior:{verificationDelayFrames:0,verificationRetryMode:"rescroll"},disableParentScrollOnInlineDetailsExpansion:!1,anchorBottomOnContentSizeChange:!0,animateManualScrollToBottom:!1,useVirtualizedList:!1,isNearBottom:t=>Math.max(0,t.contentHeight-(t.offsetY+t.viewportHeight))<=t.threshold,getBottomOffset:t=>Math.max(0,t.contentHeight-t.viewportHeight)})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),u=r(d[5]),c=r(d[6]),h=r(d[7]),f=r(d[8]),v=r(d[9]),y=r(d[10]),w=r(d[11]),p=r(d[12]),S=r(d[13]),H=r(d[14]),b=r(d[15]),E=r(d[16]);const R=200,L=1,M=64,C=1,x=2,z=16,I=100,A=48,k=8,F=(0,o.withUnistyles)(l.LoadingSpinner),T=t=>({color:t.colors.foregroundMuted});function V(t,n){for(const o of t.querySelectorAll("[data-history-row-id]"))if(o.dataset.historyRowId===n)return o;return null}const B={display:"flex",alignItems:"center",justifyContent:"center",height:32,flexShrink:0},O={display:"flex",flexDirection:"column",width:"100%"};function P(t,n=M){const o=Number.isFinite(n)?Math.max(0,n):M,{scrollTop:s,clientHeight:l,scrollHeight:u}=t;if(![s,l,u].every(Number.isFinite))return!0;return u-l-s<=o}function W(t){return t.clientHeight>0&&t.scrollHeight>0}function j(t){if(!(t instanceof Element))return!1;const n=t.closest("input, textarea, [contenteditable]");if(!n)return!1;const o=n.tagName.toLowerCase();return"input"===o||"textarea"===o||"false"!==n.getAttribute("contenteditable")?.toLowerCase()}function Y(t,n){let o=t instanceof Element?t:null;for(;o&&o!==n;){if(o instanceof HTMLElement){const t=window.getComputedStyle(o).overflowY;if(("auto"===t||"scroll"===t)&&o.scrollHeight>o.clientHeight&&o.scrollTop>0)return!0}o=o.parentElement}return!1}function q(t,n){if(t.target!==n)return!1;if(n.scrollHeight<=n.clientHeight)return!1;const o=Math.max(n.offsetWidth-n.clientWidth,c.WEB_SCROLLBAR_SIZE_PX),s=n.getBoundingClientRect();return"rtl"===window.getComputedStyle(n).direction?t.clientX<=s.left+o:t.clientX>=s.right-o}function K(t,n="auto"){t.scrollTo({top:t.scrollHeight,behavior:n})}function U(t,n){if(!t)return n(!0),!0;const o=P(t);return n(o),o}function D(t){return t.scrollHeight-t.clientHeight-t.scrollTop}function N(t){return D(t)<-2}function _(o){const{segments:l,historyRowRevision:c,liveHeadRowRevision:y,boundary:D,renderers:_,listEmptyComponent:X,viewportRef:J,routeBottomAnchorRequest:Z,isAuthoritativeHistoryReady:$,onNearBottomChange:G,onReadingPositionChange:Q,onNearHistoryStart:ee,isLoadingOlderHistory:te,hasOlderHistory:re,olderHistoryProgressKey:ne,scrollEnabled:ie,contentMaxWidth:oe,isMobileBreakpoint:se}=o,le=(0,v.useRevisedHistoryRows)(l.historyVirtualized,c),ae=(0,v.useRevisedHistoryRows)(l.historyMounted,c),ue=(0,t.useMemo)(()=>Object.assign({},l,{historyVirtualized:le,historyMounted:ae}),[ae,le,l]),ce=(0,s.useRetainedPanelActive)(),de=(0,t.useRef)(ce),he=(0,t.useRef)(null),fe=(0,t.useRef)(null),ve=(0,t.useCallback)(t=>{he.current=t},[]),me=(0,t.useCallback)(t=>{fe.current=t},[]),[ge,ye]=(0,t.useState)(!0),we=(0,t.useRef)(ge),pe=t=>(we.current=t,ye(t),t),Se=(0,t.useRef)(0),He=(0,t.useRef)(null),be=(0,t.useRef)(0),Ee=(0,t.useRef)(null),Re=(0,t.useRef)(null),Le=(0,t.useRef)(null),Me=(0,t.useRef)(new Map),Ce=(0,t.useRef)(!1),[xe,ze]=(0,t.useState)(w.createHistoryStartPaginationState),Ie=(0,t.useRef)(xe),Ae=(0,t.useRef)(null),ke=(0,t.useRef)(!1),Fe=(0,t.useRef)(null),Te=(0,t.useRef)(null),Ve=(0,t.useRef)(null),Be=(0,t.useRef)(!1),Oe=(0,t.useRef)(!1),Pe=(0,t.useRef)(!1),We=ue.historyVirtualized.length>0,{renderHistoryVirtualizedRow:je,renderHistoryMountedRow:Ye,renderLiveHeadRow:qe,renderLiveAuxiliary:Ke}=_;de.current=ce,we.current=ge;const Ue=null!==Z,De=Z?.requestKey??o.agentId,Ne=!Ue||$,_e=(0,S.useChatFindSelectedMessageId)(),Xe=(0,t.useMemo)(()=>{if(!_e)return null;const t=ue.historyVirtualized.flatMap((t,n)=>(0,H.getStreamItemMessageId)(t)===_e?[n]:[]);return t.length>0?t:null},[_e,ue.historyVirtualized]),Je=(0,t.useCallback)(t=>{const o=(0,n.defaultRangeExtractor)(t);return Xe?[...new Set([...o,...Xe])].sort((t,n)=>t-n):o},[Xe]),Ze=(0,t.useMemo)(()=>{const t=new Map,n=fe.current;if(!n)return t;const o=new Set(ue.historyVirtualized.map(t=>t.id)),s=n.querySelectorAll("[data-history-row-id]:not([data-index])");for(const n of s){const s=n.dataset.historyRowId;s&&o.has(s)&&t.set(s,n.getBoundingClientRect().height)}return t},[ue.historyVirtualized]),$e=(0,n.useVirtualizer)({count:ue.historyVirtualized.length,enabled:We,getScrollElement:()=>he.current,initialOffset:()=>he.current?.scrollTop??0,getItemKey:t=>ue.historyVirtualized[t]?.id??t,estimateSize:t=>{const n=ue.historyVirtualized[t];return n?Ze.get(n.id)??(0,f.estimateStreamItemHeight)(n,oe):120},measureElement:n.measureElement,rangeExtractor:Je,scrollMargin:A,useAnimationFrameWithResizeObserver:!0,overscan:8});(0,t.useEffect)(()=>($e.shouldAdjustScrollPositionOnItemSizeChange=(t,n,o)=>{const s=o.scrollRect?.height??0,l=o.scrollOffset??0,u=o.getTotalSize()-(l+s);return(0,f.shouldAdjustScrollForVirtualRowResize)({isHistoryStartPrependActive:ke.current,rowStart:t.start,scrollOffset:l,remainingDistanceFromBottom:u,bottomThreshold:M})},()=>{$e.shouldAdjustScrollPositionOnItemSizeChange=void 0}),[$e]);const Ge=$e.getVirtualItems(),Qe=$e.getTotalSize(),et=(0,u.useStableEvent)(()=>{const t=he.current;if(!de.current||!t||!W(t))return null;const n=!we.current||P(t),o=Ce.current&&n&&!gt();return{distanceFromHistoryStart:t.scrollTop,hasOlderHistory:re,isLoadingOlderHistory:te,isReady:o,progressKey:ne}}),tt=(0,u.useStableEvent)(t=>{const n=Ie.current;if(Ie.current=t.state,t.state!==n&&ze(t.state),(0,w.isHistoryStartLoadingOperation)(t.state)||(Ae.current=null,ke.current=!1),!t.shouldLoad||null===ne)return;const o=he.current,s=fe.current,l=ue.historyMounted.at(-1)??ue.historyVirtualized.at(-1),u=s&&l?V(s,l.id):null;Ae.current=o&&l&&u?{progressKey:ne,rowId:l.id,viewportOffset:u.getBoundingClientRect().top-o.getBoundingClientRect().top}:null,ke.current=!1;const c=ne;(async()=>{!0!==await ee()&&tt({state:(0,w.abandonHistoryStartPaginationRequest)(Ie.current,c),shouldLoad:!1})})()}),rt=(0,u.useStableEvent)(()=>{const t=et();if(!t)return;const n=(0,w.evaluateHistoryStartPagination)(Ie.current,t);tt(n)}),nt=(0,u.useStableEvent)(()=>{const t=(0,w.rearmHistoryStartPagination)(Ie.current);t!==Ie.current&&(Ie.current=t,ze(t),rt())}),it=(0,u.useStableEvent)(()=>{const t=he.current,n=fe.current,o=Ae.current;if(!(t&&n&&o&&ke.current))return;const s=V(n,o.rowId);if(!s)return;const l=s.getBoundingClientRect().top-t.getBoundingClientRect().top;t.scrollTop+=l-o.viewportOffset,Se.current=t.scrollTop}),ot=(0,u.useStableEvent)(()=>{let t=Fe.current;t||(t=(0,p.createHistoryStartSettleScheduler)({settleFrames:x,requestFrame:t=>window.requestAnimationFrame(t),cancelFrame:t=>window.cancelAnimationFrame(t),isSettling:()=>"settling"===Ie.current.status,isLoading:()=>{const t=et();return!t||t.isLoadingOlderHistory||Me.current.size>0},onFrame:it,onSettle:()=>{const t=et();if(!t)return;ke.current=!1;const n=(0,w.settleHistoryStartPagination)(Ie.current,t);Ae.current=null,tt(n)}}),Fe.current=t),t.schedule()});(0,t.useLayoutEffect)(()=>{if(!de.current)return;const t=Ae.current;t&&t.progressKey!==ne&&(ke.current=!0,rt(),it(),ot())},[it,rt,ne,ot,ue.historyMounted,ue.historyVirtualized,Qe]);const st=(0,t.useCallback)(t=>{if(!t)return void $e.measureElement(null);const n=Me.current,o=n.get(t);void 0!==o&&window.cancelAnimationFrame(o);const s=window.requestAnimationFrame(()=>{n.delete(t),de.current&&t.isConnected&&$e.measureElement(t)});n.set(t,s)},[$e]);(0,t.useEffect)(()=>{const t=Me.current;return()=>{for(const n of t.values())window.cancelAnimationFrame(n);t.clear()}},[]);const lt=(0,t.useCallback)(()=>{const t=Re.current;null!==t&&(Re.current=null,window.cancelAnimationFrame(t));const n=Le.current;null!==n&&(Le.current=null,window.clearTimeout(n))},[]),at=(0,t.useCallback)(()=>{const t=He.current,n="autoscroll"===t?.kind?t.evidenceExpiryFrame:null;null!=n&&window.cancelAnimationFrame(n),He.current=null},[]),ut=(0,t.useCallback)(()=>{be.current=0},[]),ct=(0,t.useCallback)(()=>{be.current=window.performance.now()+I},[]);(0,t.useLayoutEffect)(()=>{if(!ce){lt(),Fe.current?.cancel();for(const t of Me.current.values())window.cancelAnimationFrame(t);Me.current.clear(),at(),ut(),Ee.current=null}},[lt,at,ut,ce]);const dt=(0,t.useCallback)((t="auto")=>{const n=he.current;de.current&&n&&W(n)&&(N(n)||(K(n,t),Se.current=n.scrollTop,U(n,G),rt()))},[rt,G]),ht=(0,t.useCallback)(()=>{if(!de.current)return;const t=he.current;t&&N(t)||null===Re.current&&(Re.current=window.requestAnimationFrame(()=>{Re.current=null,de.current&&we.current&&dt("auto")}))},[dt]),ft=(0,t.useCallback)(()=>{lt(),dt("auto"),ht()},[lt,ht,dt]),vt=(0,u.useStableEvent)(()=>{if(!de.current)return;if(!Q)return;const t=he.current,n=fe.current;if(!t||!n)return void Q(null);const o=t.getBoundingClientRect().top+k;let s=null;for(const t of n.querySelectorAll("[data-history-row-id]")){const n=t.dataset.historyRowId;if(n&&(s=n,t.getBoundingClientRect().bottom>o))break}Q(s)}),mt=(0,t.useCallback)(()=>{if(!de.current)return;const t=he.current;t?(U(t,G),vt()):G(!0)},[G,vt]),{isJumpSettling:gt,scrollToMessage:yt}=(0,b.useScrollToMessage)({active:ce,scrollContainerRef:he,rowVirtualizer:$e,historyVirtualized:ue.historyVirtualized,cancelPendingStickToBottom:lt,setFollowOutput:pe,onNearBottomChange:G}),wt=(0,u.useStableEvent)(()=>{lt(),we.current&&pe(!1),nt()}),pt=(0,t.useCallback)(()=>{const t=he.current;if(!de.current||!t||!W(t))return;const n=t.scrollTop,o=P(t,C);const s=n<Se.current-L,l=n>Se.current+L,u=He.current,c="scrollbar"===u?.kind||"autoscroll"===u?.kind&&u.hasUpwardEvidence||window.performance.now()<be.current;!we.current&&o&&l&&!gt()?pe(!0):we.current&&s&&c&&wt(),Se.current=n,mt(),rt()},[rt,gt,wt,mt]);(0,t.useEffect)(()=>{const t=(0,w.createHistoryStartPaginationState)();Ie.current=t,ze(t),Ae.current=null,ke.current=!1;const n=window.requestAnimationFrame(()=>{Ce.current=!0,rt()});return()=>{window.cancelAnimationFrame(n),Ce.current=!1,Fe.current?.cancel(),Fe.current=null}},[rt,o.agentId]),(0,t.useLayoutEffect)(()=>{if(!de.current||!Ne)return;if(Ue&&!we.current)return;pe(!0),ft();const t=window.setTimeout(()=>{if(!we.current)return;const t=he.current;t&&(P(t)||ht())},R);return()=>{window.clearTimeout(t)}},[De,ft,Ue,Ne,ht]),(0,t.useLayoutEffect)(()=>{const t={scrollContainer:he.current,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,activationKey:De,isActivationReady:Ne,renderLiveAuxiliary:Ke,historyMounted:ue.historyMounted,historyVirtualized:ue.historyVirtualized,liveHead:ue.liveHead,virtualTotalSize:Qe},n=Boolean(ce&&!Be.current&&Te.current&&(o=Te.current,s=t,o.scrollContainer===s.scrollContainer&&o.viewportWidth===s.viewportWidth&&o.viewportHeight===s.viewportHeight&&o.activationKey===s.activationKey&&o.isActivationReady===s.isActivationReady&&o.renderLiveAuxiliary===s.renderLiveAuxiliary&&o.historyMounted===s.historyMounted&&o.historyVirtualized===s.historyVirtualized&&o.liveHead===s.liveHead&&o.virtualTotalSize===s.virtualTotalSize));var o,s;Oe.current=n,Pe.current=n,Be.current=ce,ce&&(Te.current=t,we.current&&!n&&(lt(),dt("auto")))},[De,lt,ce,Ne,Ke,dt,ue.historyMounted,ue.historyVirtualized,ue.liveHead,Qe]),(0,t.useEffect)(()=>{if(!ce)return;const t=Oe.current;Oe.current=!1,t||mt(),rt(),"settling"===Ie.current.status&&ot()},[rt,re,ce,te,ne,ot,ue.historyMounted.length,ue.historyVirtualized.length,ue.liveHead.length,mt,Qe]),(0,t.useLayoutEffect)(()=>{if(!ce)return;const t=he.current,n=fe.current;if(!t||"undefined"==typeof ResizeObserver)return;Pe.current||(mt(),rt());const o=new ResizeObserver(()=>{const n={clientWidth:(o=t).clientWidth,clientHeight:o.clientHeight,scrollWidth:o.scrollWidth,scrollHeight:o.scrollHeight};var o,s,l;if(Pe.current){Pe.current=!1,vt();const t=Ve.current;if(Ve.current=n,t&&(l=n,(s=t).clientWidth===l.clientWidth&&s.clientHeight===l.clientHeight&&s.scrollWidth===l.scrollWidth&&s.scrollHeight===l.scrollHeight))return}else Ve.current=n;ke.current&&it(),"settling"===Ie.current.status&&ot(),mt(),rt(),we.current&&ht()});return o.observe(t),n&&o.observe(n),()=>{o.disconnect()}},[it,rt,ce,vt,ot,ht,mt]),(0,t.useLayoutEffect)(()=>{if(!ce)return;const t=he.current;if(!t)return;const n=()=>{ct(),t.scrollTop<=L&&nt()},o=o=>{!o.ctrlKey&&o.deltaY<0&&!Y(o.target,t)&&n()},s=o=>{var s;!j((s=o).target)&&("ArrowUp"===s.key||"PageUp"===s.key||"Home"===s.key||" "===s.key&&s.shiftKey)&&(Y(o.target,t)||n())},l=n=>{at(),"mouse"!==n.pointerType||!n.isPrimary||0!==n.button&&1!==n.button||j(n.target)||(0!==n.button?He.current={kind:"autoscroll",pointerId:n.pointerId,lastClientY:n.clientY,hasUpwardEvidence:!1,evidenceExpiryFrame:null}:q(n,t)&&(He.current={kind:"scrollbar",pointerId:n.pointerId}))},u=t=>{const n=He.current;n&&"autoscroll"===n.kind&&n.pointerId===t.pointerId&&(t.clientY<n.lastClientY-L&&(n.hasUpwardEvidence=!0,null!==n.evidenceExpiryFrame&&window.cancelAnimationFrame(n.evidenceExpiryFrame),n.evidenceExpiryFrame=window.requestAnimationFrame(()=>{He.current===n&&(He.current=null)})),n.lastClientY=t.clientY)},c=t=>{const n=He.current;n?.pointerId===t.pointerId&&"scrollbar"===n.kind&&at()},h=t=>{He.current?.pointerId===t.pointerId&&at()},f=t=>{const n=t.touches[0];n&&(Ee.current=n.clientY)},v=o=>{const s=o.touches[0];if(!s)return;const l=Ee.current;null!==l&&s.clientY>l+1&&!Y(o.target,t)&&n(),Ee.current=s.clientY},y=()=>{Ee.current=null};return t.addEventListener("scroll",pt,{passive:!0}),t.addEventListener("wheel",o,{passive:!0}),t.addEventListener("keydown",s,{passive:!0}),t.addEventListener("pointerdown",l,{passive:!0}),window.addEventListener("pointermove",u,{passive:!0}),window.addEventListener("pointerup",c,{passive:!0}),window.addEventListener("pointercancel",h,{passive:!0}),window.addEventListener("blur",at),t.addEventListener("touchstart",f,{passive:!0}),t.addEventListener("touchmove",v,{passive:!0}),t.addEventListener("touchend",y,{passive:!0}),t.addEventListener("touchcancel",y,{passive:!0}),()=>{t.removeEventListener("scroll",pt),t.removeEventListener("wheel",o),t.removeEventListener("keydown",s),t.removeEventListener("pointerdown",l),window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",h),window.removeEventListener("blur",at),t.removeEventListener("touchstart",f),t.removeEventListener("touchmove",v),t.removeEventListener("touchend",y),t.removeEventListener("touchcancel",y),ut()}},[at,ut,pt,ce,ct,nt]),(0,t.useEffect)(()=>{const t={scrollToBottom:()=>{pe(!0),lt(),ft()},prepareForViewportChange:()=>{we.current&&ht()},detachFromBottom:()=>{pe(!1),lt()},scrollToMessage:yt};return J.current=t,()=>{J.current===t&&(J.current=null),lt()}},[lt,ft,ht,yt,J]);const St=(0,t.useMemo)(()=>({display:"flex",flexDirection:"column",minHeight:"100%",paddingTop:z,paddingBottom:16,paddingLeft:se?8:16,paddingRight:se?8:16,boxSizing:"border-box"}),[se]),Ht=(0,t.useMemo)(()=>({width:"100%",height:"100%",overflowX:"hidden",overflowY:ie?"auto":"hidden",overscrollBehaviorY:"contain",scrollbarWidth:ie&&!se?"none":void 0}),[se,ie]),bt=(0,t.useMemo)(()=>({position:"relative",flex:1,minWidth:0,minHeight:0}),[]),Et=(0,t.useMemo)(()=>({position:"relative",width:"100%",height:Qe}),[Qe]),Rt=(0,t.useCallback)(t=>({position:"absolute",top:0,left:0,display:"flex",flexDirection:"column",width:"100%",transform:`translateY(${t-A}px)`}),[]),Lt=(0,t.useMemo)(()=>ue.historyMounted.map((t,n)=>(0,E.jsx)("div",{"data-history-row-id":t.id,"data-message-id":(0,H.getStreamItemMessageId)(t),style:O,children:Ye(t,n,ue.historyMounted)},t.id)),[Ye,ue.historyMounted]),Mt=(0,t.useMemo)(()=>ue.liveHead.map((t,n)=>(0,E.jsx)("div",{"data-history-row-id":t.id,"data-message-id":(0,H.getStreamItemMessageId)(t),style:O,children:qe(t,n,ue.liveHead)},t.id)),[y,qe,ue.liveHead]),Ct=(0,t.useMemo)(()=>[...Lt,...Mt],[Mt,Lt]),xt=(0,t.useMemo)(()=>Ke(),[Ke]),zt=(0,t.useMemo)(()=>{const t=(0,w.isHistoryStartLoadingOperation)(xe);return(0,E.jsx)("div",{style:B,"data-testid":"older-history-slot",children:t?(0,E.jsx)("div",{"data-testid":"load-older-history-spinner",children:(0,E.jsx)(F,{size:"small",uniProps:T})}):null})},[xe]),It=!(D.hasMountedHistory||D.hasVirtualizedHistory||D.hasLiveHead||xt);return(0,E.jsxs)("div",{style:bt,children:[(0,E.jsx)("div",{ref:ve,"data-testid":"agent-chat-scroll","data-outside-titlebar":!0,"data-overlay-scrollbar":ie&&!se?"true":void 0,id:"agent-chat-scroll-"+(We?"web-dom-virtualized":"web-dom-scroll"),style:Ht,children:(0,E.jsxs)("div",{ref:me,style:St,children:[zt,We?(0,E.jsx)("div",{style:Et,children:Ge.map(t=>{const n=ue.historyVirtualized[t.index];return n?(0,E.jsx)("div",{"data-index":t.index,"data-history-row-id":n.id,"data-message-id":(0,H.getStreamItemMessageId)(n),ref:st,style:Rt(t.start),children:je(n,t.index,ue.historyVirtualized)},t.key):null})}):null,Ct,xt,It?X:null]})}),ie&&!se?(0,E.jsx)(h.DomOverlayScrollbar,{scrollContainerRef:he,onUserScrollUp:wt}):null]})}},4509,[37,4510,57,3709,3023,3912,4513,4514,4499,4503,4500,4507,4508,4247,4258,4517,280]);
16165
16165
  __d(function(g,r,i,a,m,_e,_d){"use strict";const e=["useFlushSync"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useVirtualizer",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"useWindowVirtualizer",{enumerable:!0,get:function(){return b}});var t,n=r(_d[0]),o=(t=n)&&t.__esModule?t:{default:t},u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),c=r(_d[2]),l=r(_d[3]);Object.keys(l).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return l[e]}})});const s="undefined"!=typeof document?u.useLayoutEffect:u.useEffect;function f(t){let{useFlushSync:n=!0}=t,f=(0,o.default)(t,e);const d=u.useReducer(()=>({}),{})[1],b=Object.assign({},f,{onChange:(e,t)=>{var o;n&&t?(0,c.flushSync)(d):d(),null==(o=f.onChange)||o.call(f,e,t)}}),[O]=u.useState(()=>new l.Virtualizer(b));return O.setOptions(b),s(()=>O._didMount(),[]),s(()=>O._willUpdate()),O}function d(e){return f(Object.assign({observeElementRect:l.observeElementRect,observeElementOffset:l.observeElementOffset,scrollToFn:l.elementScroll},e))}function b(e){return f(Object.assign({getScrollElement:()=>"undefined"!=typeof document?window:null,observeElementRect:l.observeWindowRect,observeElementOffset:l.observeWindowOffset,scrollToFn:l.windowScroll,initialOffset:()=>"undefined"!=typeof document?window.scrollY:0},e))}},4510,[36,37,388,4511]);
16166
16166
  __d(function(g,r,_i,_a2,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Virtualizer",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"approxEqual",{enumerable:!0,get:function(){return t.approxEqual}}),Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return t.debounce}}),Object.defineProperty(e,"defaultKeyExtractor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"defaultRangeExtractor",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"elementScroll",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"measureElement",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"memo",{enumerable:!0,get:function(){return t.memo}}),Object.defineProperty(e,"notUndefined",{enumerable:!0,get:function(){return t.notUndefined}}),Object.defineProperty(e,"observeElementOffset",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"observeElementRect",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"observeWindowOffset",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"observeWindowRect",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"windowScroll",{enumerable:!0,get:function(){return f}});var t=r(_d[0]);const s=t=>{const{offsetWidth:s,offsetHeight:n}=t;return{width:s,height:n}},n=t=>t,i=t=>{const s=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),i=[];for(let t=s;t<=n;t++)i.push(t);return i},o=(t,n)=>{const i=t.scrollElement;if(!i)return;const o=t.targetWindow;if(!o)return;const l=t=>{const{width:s,height:i}=t;n({width:Math.round(s),height:Math.round(i)})};if(l(s(i)),!o.ResizeObserver)return()=>{};const a=new o.ResizeObserver(n=>{const o=()=>{const t=n[0];if(null==t?void 0:t.borderBoxSize){const s=t.borderBoxSize[0];if(s)return void l({width:s.inlineSize,height:s.blockSize})}l(s(i))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(i,{box:"border-box"}),()=>{a.unobserve(i)}},l={passive:!0},a=(t,s)=>{const n=t.scrollElement;if(!n)return;const i=()=>{s({width:n.innerWidth,height:n.innerHeight})};return i(),n.addEventListener("resize",i,l),()=>{n.removeEventListener("resize",i)}},h="undefined"==typeof window||"onscrollend"in window,c=(s,n)=>{const i=s.scrollElement;if(!i)return;const o=s.targetWindow;if(!o)return;let a=0;const c=s.options.useScrollendEvent&&h?()=>{}:(0,t.debounce)(o,()=>{n(a,!1)},s.options.isScrollingResetDelay),u=t=>()=>{const{horizontal:o,isRtl:l}=s.options;a=o?i.scrollLeft*(l?-1:1):i.scrollTop,c(),n(a,t)},d=u(!0),f=u(!1);i.addEventListener("scroll",d,l);const m=s.options.useScrollendEvent&&h;return m&&i.addEventListener("scrollend",f,l),()=>{i.removeEventListener("scroll",d),m&&i.removeEventListener("scrollend",f)}},u=(s,n)=>{const i=s.scrollElement;if(!i)return;const o=s.targetWindow;if(!o)return;let a=0;const c=s.options.useScrollendEvent&&h?()=>{}:(0,t.debounce)(o,()=>{n(a,!1)},s.options.isScrollingResetDelay),u=t=>()=>{a=i[s.options.horizontal?"scrollX":"scrollY"],c(),n(a,t)},d=u(!0),f=u(!1);i.addEventListener("scroll",d,l);const m=s.options.useScrollendEvent&&h;return m&&i.addEventListener("scrollend",f,l),()=>{i.removeEventListener("scroll",d),m&&i.removeEventListener("scrollend",f)}},d=(t,s,n)=>{if(null==s?void 0:s.borderBoxSize){const t=s.borderBoxSize[0];if(t){return Math.round(t[n.options.horizontal?"inlineSize":"blockSize"])}}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},f=(t,{adjustments:s=0,behavior:n},i)=>{var o,l;const a=t+s;null==(l=null==(o=i.scrollElement)?void 0:o.scrollTo)||l.call(o,{[i.options.horizontal?"left":"top"]:a,behavior:n})},m=(t,{adjustments:s=0,behavior:n},i)=>{var o,l;const a=t+s;null==(l=null==(o=i.scrollElement)?void 0:o.scrollTo)||l.call(o,{[i.options.horizontal?"left":"top"]:a,behavior:n})};class p{constructor(s){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,s,n;return(null==(n=null==(s=null==(t=this.targetWindow)?void 0:t.performance)?void 0:s.now)?void 0:n.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(this.targetWindow&&this.targetWindow.ResizeObserver?t=new this.targetWindow.ResizeObserver(t=>{t.forEach(t=>{const s=()=>{this._measureElement(t.target,t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}):null);return{disconnect:()=>{var n;null==(n=s())||n.disconnect(),t=null},observe:t=>{var n;return null==(n=s())?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return null==(n=s())?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([s,n])=>{void 0===n&&delete t[s]}),this.options=Object.assign({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:n,rangeExtractor:i,onChange:()=>{},measureElement:d,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1},t)},this.notify=t=>{var s,n;null==(n=(s=this.options).onChange)||n.call(s,this,t)},this.maybeNotify=(0,t.memo)(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s)return void this.maybeNotify();this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(t=this.scrollElement)?void 0:t.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=s,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,s)=>{const n=new Map,i=new Map;for(let o=s-1;o>=0;o--){const s=t[o];if(n.has(s.lane))continue;const l=i.get(s.lane);if(null==l||s.end>l.end?i.set(s.lane,s):s.end<l.end&&n.set(s.lane,!0),n.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((t,s)=>t.end===s.end?t.index-s.index:t.end-s.end)[0]:void 0},this.getMeasurementOptions=(0,t.memo)(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,s,n,i,o,l)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:o,lanes:l}),{key:!1}),this.getMeasurements=(0,t.memo)(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:o,lanes:l},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const s of this.laneAssignments.keys())s>=t&&this.laneAssignments.delete(s);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(t=>{this.itemSizeCache.set(t.key,t.size)}));const h=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const c=this.measurementsCache.slice(0,h),u=new Array(l).fill(void 0);for(let t=0;t<h;t++){const s=c[t];s&&(u[s.lane]=t)}for(let o=h;o<t;o++){const t=i(o),l=this.laneAssignments.get(o);let h,d;if(void 0!==l&&this.options.lanes>1){h=l;const t=u[h],i=void 0!==t?c[t]:void 0;d=i?i.end+this.options.gap:s+n}else{const t=1===this.options.lanes?c[o-1]:this.getFurthestMeasurement(c,o);d=t?t.end+this.options.gap:s+n,h=t?t.lane:o%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(o,h)}const f=a.get(t),m="number"==typeof f?f:this.options.estimateSize(o),p=d+m;c[o]={index:o,start:d,size:m,end:p,key:t,lane:h},u[h]=o}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=(0,t.memo)(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,n,i)=>this.range=t.length>0&&s>0?v({measurements:t,outerSize:s,scrollOffset:n,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=(0,t.memo)(()=>{let t=null,s=null;const n=this.calculateRange();return n&&(t=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,n,i,o)=>null===i||null===o?[]:t({startIndex:i,endIndex:o,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,n=t.getAttribute(s);return n?parseInt(n,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const n=this.scrollState.index??(null==(s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:s.index);if(void 0!==n&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,n-s),o=Math.min(this.options.count-1,n+s);return t>=i&&t<=o}return!0},this._measureElement=(t,s)=>{if(!t.isConnected)return void this.observer.unobserve(t);const n=this.indexFromElement(t),i=this.measurementsCache[n];if(!i)return;const o=i.key,l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,s,this))},this.resizeItem=(t,s)=>{var n;const i=this.measurementsCache[t];if(!i)return;const o=s-(this.itemSizeCache.get(i.key)??i.size);0!==o&&("smooth"!==(null==(n=this.scrollState)?void 0:n.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(i,o,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,s)),this.notify(!1))},this.measureElement=t=>{t?this._measureElement(t,void 0):this.elementsCache.forEach((t,s)=>{t.isConnected||(this.observer.unobserve(t),this.elementsCache.delete(s))})},this.getVirtualItems=(0,t.memo)(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const n=[];for(let i=0,o=t.length;i<o;i++){const o=s[t[i]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=s=>{const n=this.getMeasurements();if(0!==n.length)return(0,t.notUndefined)(n[b(0,n.length-1,s=>(0,t.notUndefined)(n[s]).start,s)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,s,n=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();"auto"===s&&(s=t>=o+i?"end":"start"),"center"===s?t+=(n-i)/2:"end"===s&&(t-=i);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if("auto"===s)if(o.end>=i+n-this.options.scrollPaddingEnd)s="end";else{if(!(o.start<=i+this.options.scrollPaddingStart))return[i,s];s="start"}if("end"===s&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const l="end"===s?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,s,o.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:n="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),o=this.now();this.scrollState={index:null,align:s,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[o,l]=i,a=this.now();this.scrollState={index:t,align:l,behavior:n,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const n=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let n;if(0===s.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(t=s[s.length-1])?void 0:t.end)??0;else{const t=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&t.some(t=>null===t);){const n=s[i];null===t[n.lane]&&(t[n.lane]=n.end),i--}n=Math.max(...t.filter(t=>null!==t))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:s,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(s)}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const s=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=s?s[0]:this.scrollState.lastTargetOffset,i=n!==this.scrollState.lastTargetOffset;if(!i&&(0,t.approxEqual)(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return void(this.scrollState=null)}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const b=(t,s,n,i)=>{for(;t<=s;){const o=(t+s)/2|0,l=n(o);if(l<i)t=o+1;else{if(!(l>i))return o;s=o-1}}return t>0?t-1:0};function v({measurements:t,outerSize:s,scrollOffset:n,lanes:i}){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};let l=b(0,o,s=>t[s].start,n),a=l;if(1===i)for(;a<o&&t[a].end<n+s;)a++;else if(i>1){const h=Array(i).fill(0);for(;a<o&&h.some(t=>t<n+s);){const s=t[a];h[s.lane]=s.end,a++}const c=Array(i).fill(n+s);for(;l>=0&&c.some(t=>t>=n);){const s=t[l];c[s.lane]=s.start,l--}l=Math.max(0,l-l%i),a=Math.min(o,a+(i-1-a%i))}return{startIndex:l,endIndex:a}}},4511,[4512]);
16167
16167
  __d(function(g,r,i,_a2,m,e,d){"use strict";function n(n,t,o){let u,l=o.initialDeps??[],a=!0;function c(){var c,f,s;let b;o.key&&(null==(c=o.debug)?void 0:c.call(o))&&(b=Date.now());const h=n();if(!(h.length!==l.length||h.some((n,t)=>l[t]!==n)))return u;let p;if(l=h,o.key&&(null==(f=o.debug)?void 0:f.call(o))&&(p=Date.now()),u=t(...h),o.key&&(null==(s=o.debug)?void 0:s.call(o))){const n=Math.round(100*(Date.now()-b))/100,t=Math.round(100*(Date.now()-p))/100,u=t/16,l=(n,t)=>{for(n=String(n);n.length<t;)n=" "+n;return n};console.info(`%c\u23f1 ${l(t,5)} /${l(n,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*u,120))}deg 100% 31%);`,null==o?void 0:o.key)}return!(null==o?void 0:o.onChange)||a&&o.skipInitialOnChange||o.onChange(u),a=!1,u}return c.updateDeps=n=>{l=n},c}function t(n,t){if(void 0===n)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return n}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"approxEqual",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"memo",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"notUndefined",{enumerable:!0,get:function(){return t}});const o=(n,t)=>Math.abs(n-t)<1.01,u=(n,t,o)=>{let u;return function(...l){n.clearTimeout(u),u=n.setTimeout(()=>t.apply(this,l),o)}}},4512,[]);
@@ -16209,7 +16209,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
16209
16209
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAgentFormState=function(_){const h=(0,o.c)(121),{serverId:R,initialValues:D,workingDir:F,isVisible:y,isCreateFlow:b}=_,k=void 0===y||y,T=void 0===b||b,{preferences:A,isLoading:L,updatePreferences:U}=(0,f.useFormPreferences)();let w;h[0]!==A?(w=new c.OptimisticFormPreferences(A),h[0]=A,h[1]=w):w=h[1];const N=(0,t.useRef)(w);let V,C,B;h[2]!==A?(V=()=>{N.current.reconcile(A)},C=[A],h[2]=A,h[3]=V,h[4]=C):(V=h[3],C=h[4]);(0,t.useEffect)(V,C),h[5]!==U?(B=async o=>{const t=N.current.begin(o);try{const n=await U(o);return N.current.commit(t,n),n}catch(o){const n=o;throw N.current.reject(t),n}},h[5]=U,h[6]=B):B=h[6];const j=B;let G;h[7]===Symbol.for("react.memo_cache_sentinel")?(G={form:{provider:null,modeId:"",model:"",thinkingOptionId:""},userModified:u.INITIAL_USER_MODIFIED,resolution:u.INITIAL_AGENT_FORM_RESOLUTION},h[7]=G):G=h[7];const[z,H]=(0,t.useReducer)(u.resolveAgentForm,G),{form:K,userModified:Y,resolution:q}=z;let x;h[8]!==F?(x={cwd:F},h[8]=F,h[9]=x):x=h[9];const{entries:J,isLoading:Q,isRefreshing:W,error:X,refresh:Z,refetchIfStale:$}=(0,v.useProvidersSnapshot)(R,x);let ee;h[10]!==J?(ee=J??[],h[10]=J,h[11]=ee):ee=h[11];const re=ee;let oe;h[12]!==J?(oe=(0,n.buildProviderDefinitions)(J),h[12]=J,h[13]=oe):oe=h[13];const ie=oe;let te;h[14]!==ie?(te=(0,u.buildProviderDefinitionMap)(ie),h[14]=ie,h[15]=te):te=h[15];const de=te;let ne;h[16]!==J||h[17]!==ie?(ne=(0,u.buildProviderDefinitionMapForStatuses)({snapshotEntries:J,providerDefinitions:ie,statuses:u.RESOLVABLE_PROVIDER_STATUSES}),h[16]=J,h[17]=ie,h[18]=ne):ne=h[18];const se=ne;let le;h[19]!==J||h[20]!==ie?(le=(0,u.buildProviderDefinitionMapForStatuses)({snapshotEntries:J,providerDefinitions:ie,statuses:u.SELECTABLE_PROVIDER_STATUSES}),h[19]=J,h[20]=ie,h[21]=le):le=h[21];const ce=le;let pe;h[22]!==J?(pe=M(J),h[22]=J,h[23]=pe):pe=h[23];const ve=pe;let ae;h[24]!==J?(ae=P(J),h[24]=J,h[25]=ae):ae=h[25];const fe=ae;let me;h[26]!==J?(me=(0,s.buildSelectableProviderSelectorProviders)(J),h[26]=J,h[27]=me):me=h[27];const ue=me;let Ie;h[28]!==K.provider||h[29]!==J?(Ie=K.provider?(J??[]).find(o=>o.provider===K.provider)??null:null,h[28]=K.provider,h[29]=J,h[30]=Ie):Ie=h[30];const Me=Ie,Pe=Me?.models??null;let ge;h[31]!==Pe?(ge=(0,l.filterSelectableModels)(Pe),h[31]=Pe,h[32]=ge):ge=h[32];const Se=ge,Ee="loading"===Me?.status;let Oe;h[33]!==K.provider||h[34]!==de||h[35]!==Me?(Oe=I({selectedEntry:Me,provider:K.provider,providerDefinitionMap:de}),h[33]=K.provider,h[34]=de,h[35]=Me,h[36]=Oe):Oe=h[36];const _e=ie,he=de,Re=ce,De=ve,Fe=ue,ye=Se,be=Oe,ke="pending"===q.status||Q||Ee,Te=ke;let Ae,Le,Ue;h[37]!==D||h[38]!==T||h[39]!==L||h[40]!==k||h[41]!==A||h[42]!==R||h[43]!==J||h[44]!==fe||h[45]!==se?(Ae=()=>{H({type:"INPUTS_CHANGED",serverId:R,isVisible:k,isCreateFlow:T,isPreferencesLoading:L,hasSnapshot:void 0!==J,initialValues:D,preferences:A,providerModelsByProvider:fe,allowedProviderMap:se})},Le=[R,k,T,L,J,D,A,fe,se],h[37]=D,h[38]=T,h[39]=L,h[40]=k,h[41]=A,h[42]=R,h[43]=J,h[44]=fe,h[45]=se,h[46]=Ae,h[47]=Le):(Ae=h[46],Le=h[47]);(0,t.useEffect)(Ae,Le),h[48]!==De||h[49]!==Re||h[50]!==j?(Ue=(o,t)=>{if(!Re.has(o))return;const n=Re.get(o),s=De.get(o)??null,l=N.current.current().providerPreferences?.[o],c=(0,u.normalizeSelectedModelId)(t)||(0,u.resolveDefaultModelId)(s);H({type:"SET_PROVIDER_AND_MODEL_FROM_USER",provider:o,modelId:t,providerDef:n,providerModels:s,providerPrefs:l}),j(t=>(0,u.mergeSelectedComposerPreferences)({preferences:t,provider:o,updates:{model:c||void 0}}))},h[48]=De,h[49]=Re,h[50]=j,h[51]=Ue):Ue=h[51];const we=Ue;let Ne;h[52]===Symbol.for("react.memo_cache_sentinel")?(Ne=()=>{H({type:"CLEAR_PROVIDER_SELECTION_FROM_USER"})},h[52]=Ne):Ne=h[52];const Ve=Ne;let Ce;h[53]!==De||h[54]!==K||h[55]!==he||h[56]!==q||h[57]!==Re||h[58]!==j||h[59]!==Y?(Ce=o=>{const t=o.provider;if(!Re.has(t))return;const n=K.provider,s=Re.get(t),l=De.get(t)??null,c=N.current.current().providerPreferences?.[t],v={type:"APPLY_PROFILE_FROM_USER",provider:t,modelId:o.modelId,modeId:o.modeId,thinkingOptionId:o.thinkingOptionId,providerDef:s,providerModels:l,providerPrefs:c},f=(0,u.resolveAgentForm)({form:K,userModified:Y,resolution:q},v),I=n?he.get(n)?.modes.map(O)??[]:[];H(v),j(s=>{const{model:l,modeId:c,thinkingOptionId:v}=f.form;return(0,p.applyAgentProfilePreferences)({preferences:s,previousProvider:n,previousProviderModeIds:I,provider:t,modelId:l,modeId:c,thinkingOptionId:v,featureValues:o.featureValues})}).catch(E)},h[53]=De,h[54]=K,h[55]=he,h[56]=q,h[57]=Re,h[58]=j,h[59]=Y,h[60]=Ce):Ce=h[60];const Be=Ce;let je;h[61]!==K.provider||h[62]!==j?(je=o=>{H({type:"SET_MODE_FROM_USER",modeId:o});const t=K.provider;t&&j(n=>(0,u.mergeSelectedComposerPreferences)({preferences:n,provider:t,updates:{mode:o||void 0}}))},h[61]=K.provider,h[62]=j,h[63]=je):je=h[63];const Ge=je;let ze;h[64]!==ye||h[65]!==K.provider||h[66]!==j?(ze=o=>{const t=K.provider,n=t?N.current.current().providerPreferences?.[t]:void 0;if(H({type:"SET_MODEL_FROM_USER",modelId:o,availableModels:ye,providerPrefs:n}),t){const n=(0,u.normalizeSelectedModelId)(o)||(0,u.resolveDefaultModelId)(ye);j(o=>(0,u.mergeSelectedComposerPreferences)({preferences:o,provider:t,updates:{model:n||void 0}}))}},h[64]=ye,h[65]=K.provider,h[66]=j,h[67]=ze):ze=h[67];const He=ze;let Ke;h[68]!==K||h[69]!==j?(Ke=o=>{H({type:"SET_THINKING_OPTION_FROM_USER",thinkingOptionId:o});const{provider:t,model:n}=K;t&&n&&j(s=>(0,u.mergeSelectedComposerPreferences)({preferences:s,provider:t,updates:{thinkingByModel:{[n]:o}}}))},h[68]=K,h[69]=j,h[70]=Ke):Ke=h[70];const Ye=Ke;let qe;h[71]!==Z?(qe=o=>{Z(o?[o]:void 0)},h[71]=Z,h[72]=qe):qe=h[72];const xe=qe;let Je;h[73]!==K.provider||h[74]!==$?(Je=()=>{$(K.provider)},h[73]=K.provider,h[74]=$,h[75]=Je):Je=h[75];const Qe=Je;let We;h[76]!==ye||h[77]!==K||h[78]!==j?(We=async()=>{K.provider&&await S({provider:K.provider,formState:K,availableModels:ye,updatePreferences:j})},h[76]=ye,h[77]=K,h[78]=j,h[79]=We):We=h[79];const Xe=We;let Ze;h[80]!==K.provider||h[81]!==he?(Ze=K.provider?he.get(K.provider):void 0,h[80]=K.provider,h[81]=he,h[82]=Ze):Ze=h[82];const $e=Ze;let er;h[83]!==ye||h[84]!==K.model?(er=(0,u.resolveEffectiveModel)(ye,K.model),h[83]=ye,h[84]=K.model,h[85]=er):er=h[85];const rr=er,or=rr?.thinkingOptions;let ir;h[86]!==or?(ir=or??[],h[86]=or,h[87]=ir):ir=h[87];const tr=ir,dr=ke,nr=X;let sr;h[88]!==F?(sr=F.trim(),h[88]=F,h[89]=sr):sr=h[89];const lr=!sr;let cr,pr;h[90]!==ye?(cr=ye??[],h[90]=ye,h[91]=cr):cr=h[91];h[92]!==$e||h[93]!==re||h[94]!==De||h[95]!==Be||h[96]!==tr||h[97]!==K.modeId||h[98]!==K.model||h[99]!==K.provider||h[100]!==K.thinkingOptionId||h[101]!==Te||h[102]!==dr||h[103]!==be||h[104]!==nr||h[105]!==Fe||h[106]!==Xe||h[107]!==he||h[108]!==_e||h[109]!==Qe||h[110]!==xe||h[111]!==R||h[112]!==Ge||h[113]!==He||h[114]!==we||h[115]!==Ye||h[116]!==W||h[117]!==cr||h[118]!==F||h[119]!==lr?(pr={selectedServerId:R,selectedProvider:K.provider,selectedMode:K.modeId,setModeFromUser:Ge,selectedModel:K.model,setModelFromUser:He,selectedThinkingOptionId:K.thinkingOptionId,setThinkingOptionFromUser:Ye,workingDir:F,providerDefinitions:_e,providerDefinitionMap:he,agentDefinition:$e,allProviderEntries:re,modeOptions:be,availableModels:cr,allProviderModels:De,modelSelectorProviders:Fe,isAllModelsLoading:Te,isProviderModelsRefreshing:W,availableThinkingOptions:tr,isModelLoading:dr,modelError:nr,refreshProviderModels:xe,refetchProviderModelsIfStale:Qe,setProviderAndModelFromUser:we,applyProfileFromUser:Be,clearProviderSelectionFromUser:Ve,workingDirIsEmpty:lr,persistFormPreferences:Xe},h[92]=$e,h[93]=re,h[94]=De,h[95]=Be,h[96]=tr,h[97]=K.modeId,h[98]=K.model,h[99]=K.provider,h[100]=K.thinkingOptionId,h[101]=Te,h[102]=dr,h[103]=be,h[104]=nr,h[105]=Fe,h[106]=Xe,h[107]=he,h[108]=_e,h[109]=Qe,h[110]=xe,h[111]=R,h[112]=Ge,h[113]=He,h[114]=we,h[115]=Ye,h[116]=W,h[117]=cr,h[118]=F,h[119]=lr,h[120]=pr):pr=h[120];return pr};var o=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]),p=r(d[6]),v=r(d[7]),f=r(d[8]),u=r(d[9]);function I(o){const{selectedEntry:t,provider:n,providerDefinitionMap:s}=o;return t?.modes?t.modes:n?s.get(n)?.modes??[]:[]}function M(o){const t=new Map;for(const n of o??[])t.set(n.provider,(0,l.filterSelectableModels)(n.models??[])??[]);return t}function P(o){const t=new Map;for(const n of o??[])t.set(n.provider,"ready"===n.status?(0,l.filterSelectableModels)(n.models??null):null);return t}async function S(o){const{provider:t,formState:n,availableModels:s,updatePreferences:l}=o,c=(0,u.resolveEffectiveModel)(s,n.model),p=c?.id??n.model;await l(o=>(0,f.mergeProviderPreferences)({preferences:o,provider:t,updates:Object.assign({model:p||void 0,mode:n.modeId||void 0},p&&n.thinkingOptionId?{thinkingByModel:{[p]:n.thinkingOptionId}}:{})}))}function E(o){console.warn("[useAgentFormState] persist profile preference failed",o)}function O(o){return o.id}},4554,[454,37,4395,4392,4242,4555,4383,3835,4384,4556]);
16210
16210
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OptimisticFormPreferences",{enumerable:!0,get:function(){return t}});class t{pending=new Map;nextId=0;constructor(t){this.committed=t}current(){let t=this.committed;for(const n of this.pending.values())t="function"==typeof n?n(t):Object.assign({},t,n);return t}begin(t){const n=this.nextId++;return this.pending.set(n,t),n}commit(t,n){this.pending.delete(t),this.committed=n}reject(t){this.pending.delete(t)}reconcile(t){0===this.pending.size&&(this.committed=t)}}},4555,[]);
16211
16211
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"INITIAL_USER_MODIFIED",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"PENDING_AGENT_FORM_RESOLUTION",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"INITIAL_AGENT_FORM_RESOLUTION",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"RESOLVABLE_PROVIDER_STATUSES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SELECTABLE_PROVIDER_STATUSES",{enumerable:!0,get:function(){return f}}),e.normalizeSelectedModelId=p,e.resolveDefaultModel=c,e.resolveDefaultModelId=v,e.resolveEffectiveModel=O,e.resolveThinkingOptionId=b,e.mergeSelectedComposerPreferences=function(n){return(0,o.mergeProviderPreferences)({preferences:n.preferences,provider:n.provider,updates:n.updates})},e.hasFormStateChanged=E,e.buildProviderDefinitionMap=S,e.buildProviderDefinitionMapForStatuses=function(o){if(!o.snapshotEntries?.length)return S(o.providerDefinitions);const n=new Set(o.snapshotEntries.filter(n=>o.statuses.has(n.status)&&n.enabled).map(o=>o.provider));return S(o.providerDefinitions.filter(o=>n.has(o.id)))},e.resolveFormState=D,e.resolveFormStateFromProviderModels=j,e.resolveAgentForm=C;var o=r(d[0]),n=r(d[1]);const t={provider:!1,modeId:!1,model:!1,thinkingOptionId:!1},s={status:"pending"},l=s,u=new Set(["ready","loading"]),f=new Set(["ready"]);function p(o){return"string"==typeof o?o.trim():""}function c(o){return o&&0!==o.length?o.find(o=>o.isDefault)??o[0]??null:null}function v(o){return c(o)?.id??""}function I(o,t){const s=p(t);return s&&o?(0,n.findModelByReference)(o,s)?.id??"":s}function O(o,t){return o&&0!==o.length&&p(t)?(0,n.findModelByReference)(o,t)??null:null}function M(o){const t=(0,n.findModelByReference)(o.availableModels,o.modelId),s=t?[t.id,...t.aliases??[]]:[o.modelId];for(const n of s){const t=o.providerPrefs?.thinkingByModel?.[n]?.trim();if(t)return t}return""}function b(o){const n=O(o.availableModels,o.modelId),t=n?.thinkingOptions??[];if(0===t.length)return"";const s=o.requestedThinkingOptionId.trim();return s&&t.some(o=>o.id===s)?s:n?.defaultThinkingOptionId??t[0]?.id??""}const P=p;function h(o){const n=P(o.initialModeId);if(n)return n;const t=P(o.preferredModeId);if(t)return t;const s=o.providerDef?.defaultModeId,l=o.providerDef?.modes??[];return s&&(0===l.length||l.some(o=>o.id===s))?s:l[0]?.id??""}function E(o,n){return o.provider!==n.provider||o.modeId!==n.modeId||o.model!==n.model||o.thinkingOptionId!==n.thinkingOptionId}function S(o){return new Map(o.map(o=>[o.id,o]))}function _(o){const{currentProvider:n,userModified:t,initialValues:s,preferences:l}=o;return t?n:s?.provider??l?.provider??n}function R(o){const{provider:n,userModified:t,currentModeId:s,initialValues:l,providerDef:u,providerPrefs:f}=o;return t?s:n?h({initialModeId:l?.modeId,preferredModeId:f?.mode,providerDef:u}):""}function T(o){const{provider:t,userModified:s,currentModel:l,initialValues:u,providerPrefs:f,availableModels:c}=o;if(s)return l;if(!t)return"";const O=p(u?.model),M=p(f?.model);return"default"===(O||M)&&c?.length?(0,n.findModelByReference)(c,"default")?.id||v(c):O?c&&I(c,O)||O:M?c&&I(c,M)||M:""}function k(o){const{provider:n,userModified:t,currentThinkingOptionId:s,modelId:l,initialValues:u,providerPrefs:f,availableModels:p}=o;if(!n)return"";if(t)return s;const c="string"==typeof u?.thinkingOptionId?u.thinkingOptionId.trim():"",v=M({availableModels:p,providerPrefs:f,modelId:l});return c.length>0?c:v.length>0?v:""}function D(o,n,t,s,l,u){const f=Object.assign({},l);f.provider=_({currentProvider:f.provider,userModified:s.provider,initialValues:o,preferences:n});const p=f.provider?u.get(f.provider):void 0,c=f.provider?n?.providerPreferences?.[f.provider]:void 0;return f.modeId=R({provider:f.provider,userModified:s.modeId,currentModeId:f.modeId,initialValues:o,providerDef:p,providerPrefs:c}),f.model=T({provider:f.provider,userModified:s.model,currentModel:f.model,initialValues:o,providerPrefs:c,availableModels:t}),f.thinkingOptionId=k({provider:f.provider,userModified:s.thinkingOptionId,currentThinkingOptionId:f.thinkingOptionId,modelId:f.model,initialValues:o,providerPrefs:c,availableModels:t}),f.provider&&t&&(f.thinkingOptionId=b({availableModels:t,modelId:f.model,requestedThinkingOptionId:f.thinkingOptionId})),f}function j(o,n,t,s,l,u){const f=D(o,n,null,s,l,u);return D(o,n,f.provider?t.get(f.provider)??null:null,s,l,u)}function L(o){const{providerDef:n,providerPrefs:t}=o;return h({preferredModeId:t?.mode,providerDef:n})}function y(o){const n=P(o.currentModeId);return o.currentProvider===o.provider&&n?n:L({providerDef:o.providerDef,providerPrefs:o.providerPrefs})}function N(o){const{providerModels:n,providerPrefs:t,modelId:s}=o;return b({availableModels:n,modelId:s,requestedThinkingOptionId:M({availableModels:n,providerPrefs:t,modelId:s})})}function V(o){const n=o.isSameProvider&&I(o.availableModels,o.currentModelId)===o.modelId?o.currentThinkingOptionId:M({availableModels:o.availableModels,providerPrefs:o.providerPrefs,modelId:o.modelId});return b({availableModels:o.availableModels,modelId:o.modelId,requestedThinkingOptionId:n})}function U(o,n){if("completed"===o.resolution.status)return o;const t=j(n.initialValues,n.preferences,n.providerModelsByProvider,o.userModified,o.form,n.allowedProviderMap),s=Object.assign({},o,{resolution:{status:"completed"}});return E(o.form,t)?Object.assign({},s,{form:t}):s}function F(o,n){const t=n.modelId||n.providerPrefs?.model||"",s=I(n.providerModels,t)||v(n.providerModels),l=new Set(n.providerDef?.modes.map(o=>o.id)??[]),u=n.modeId||n.providerPrefs?.mode||"",f=n.providerDef?.defaultModeId??"";let p="";l.has(u)?p=u:l.has(f)&&(p=f);const c=n.thinkingOptionId||N({providerModels:n.providerModels,providerPrefs:n.providerPrefs,modelId:s});return Object.assign({},o,{form:Object.assign({},o.form,{provider:n.provider,model:s,modeId:p,thinkingOptionId:c}),userModified:Object.assign({},o.userModified,{provider:!0,model:!0,modeId:!0,thinkingOptionId:!0})})}function A(o={},n={}){return o.provider===n.provider&&o.model===n.model&&o.modeId===n.modeId&&o.thinkingOptionId===n.thinkingOptionId}function w(o,n){const t=n.isVisible&&n.isCreateFlow,s=o.inputs,l=n.initialValues;let u=o;return(s?.active!==t||s.serverId!==n.serverId||!A(s.initialValues,l))&&(u=Object.assign({},C(o,{type:n.isVisible?"REQUEST_RESOLUTION":"RESET"}),{inputs:{serverId:n.serverId,initialValues:l,active:t}})),t&&!n.isPreferencesLoading&&n.serverId&&n.hasSnapshot?U(u,Object.assign({},n,{type:"COMPLETE_RESOLUTION"})):u}function C(o,n){switch(n.type){case"INPUTS_CHANGED":return w(o,n);case"REQUEST_RESOLUTION":return Object.assign({},o,{userModified:t,resolution:s});case"COMPLETE_RESOLUTION":return U(o,n);case"SET_PROVIDER_AND_MODEL_FROM_USER":{const t=I(n.providerModels,n.modelId)||v(n.providerModels),s=V({availableModels:n.providerModels,modelId:t,providerPrefs:n.providerPrefs,currentModelId:o.form.model,currentThinkingOptionId:o.form.thinkingOptionId,isSameProvider:o.form.provider===n.provider}),l=y({currentProvider:o.form.provider,currentModeId:o.form.modeId,provider:n.provider,providerDef:n.providerDef,providerPrefs:n.providerPrefs});return Object.assign({},o,{form:Object.assign({},o.form,{provider:n.provider,model:t,modeId:l,thinkingOptionId:s}),userModified:Object.assign({},o.userModified,{provider:!0,model:!0})})}case"APPLY_PROFILE_FROM_USER":return F(o,n);case"SET_MODE_FROM_USER":return Object.assign({},o,{form:Object.assign({},o.form,{modeId:n.modeId}),userModified:Object.assign({},o.userModified,{modeId:!0})});case"SET_MODEL_FROM_USER":{const t=I(n.availableModels,n.modelId)||v(n.availableModels),s=V({availableModels:n.availableModels,modelId:t,providerPrefs:n.providerPrefs,currentModelId:o.form.model,currentThinkingOptionId:o.form.thinkingOptionId,isSameProvider:!0});return Object.assign({},o,{form:Object.assign({},o.form,{model:t,thinkingOptionId:s}),userModified:Object.assign({},o.userModified,{model:!0})})}case"CLEAR_PROVIDER_SELECTION_FROM_USER":return Object.assign({},o,{form:Object.assign({},o.form,{provider:null,model:"",modeId:"",thinkingOptionId:""}),userModified:Object.assign({},o.userModified,{provider:!0,model:!0,modeId:!0,thinkingOptionId:!0})});case"SET_THINKING_OPTION_FROM_USER":return Object.assign({},o,{form:Object.assign({},o.form,{thinkingOptionId:n.thinkingOptionId}),userModified:Object.assign({},o.userModified,{thinkingOptionId:!0})});case"RESET":return Object.assign({},o,{userModified:t,resolution:l});default:throw new Error("unreachable")}}},4556,[4384,4242]);
16212
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDraftAgentFeatures=function(p){const v=(0,t.c)(62),{t:F}=(0,u.useTranslation)(),{serverId:V,provider:y,cwd:P,modeId:w,modelId:b,thinkingOptionId:h,initialFeatureValues:I}=p;let O;v[0]!==I?(O=()=>I??{},v[0]=I,v[1]=O):O=v[1];const[_,j]=(0,s.useState)(O),k=(0,o.useHostRuntimeClient)(V??""),E=(0,o.useHostRuntimeIsConnected)(V??""),{preferences:L,updatePreferences:D}=(0,l.useFormPreferences)();let R;v[2]!==P?(R=P?.trim()||"",v[2]=P,v[3]=R):R=v[3];const q=R,A=y??null,C=(0,s.useRef)(A);let H;v[4]!==L.providerPreferences||v[5]!==y?(H=y?L.providerPreferences?.[y]?.featureValues??{}:{},v[4]=L.providerPreferences,v[5]=y,v[6]=H):H=v[6];const S=H;let T;e:{if(!A||!q){T=null;break e}let t,s,n,u;v[7]!==w?(t=w?{modeId:w}:{},v[7]=w,v[8]=t):t=v[8],v[9]!==b?(s=b?{model:b}:{},v[9]=b,v[10]=s):s=v[10],v[11]!==h?(n=h?{thinkingOptionId:h}:{},v[11]=h,v[12]=n):n=v[12],v[13]!==q||v[14]!==A||v[15]!==t||v[16]!==s||v[17]!==n?(u=Object.assign({provider:A,cwd:q},t,s,n),v[13]=q,v[14]=A,v[15]=t,v[16]=s,v[17]=n,v[18]=u):u=v[18],T=u}const B=T,K=V??null,M=q||null,Q=w??null,x=b??null,z=h??null;let G;v[19]!==A||v[20]!==K||v[21]!==M||v[22]!==Q||v[23]!==x||v[24]!==z?(G=["providerFeatures",K,A,M,Q,x,z],v[19]=A,v[20]=K,v[21]=M,v[22]=Q,v[23]=x,v[24]=z,v[25]=G):G=v[25];const J=Boolean(V&&k&&E&&B);let N,U;v[26]!==k||v[27]!==B||v[28]!==F?(N=async()=>{if(!k||!B)throw new Error(F("workspace.terminal.hostDisconnected"));const t=await k.listProviderFeatures(B);if(t.error)throw new Error(t.error);return t.features??[]},v[26]=k,v[27]=B,v[28]=F,v[29]=N):N=v[29];v[30]!==J||v[31]!==N||v[32]!==G?(U={queryKey:G,enabled:J,staleTime:3e5,queryFn:N},v[30]=J,v[31]=N,v[32]=G,v[33]=U):U=v[33];const W=(0,n.useQuery)(U),X=W.data;let Y;v[34]!==X?(Y=X??[],v[34]=X,v[35]=Y):Y=v[35];const Z=Y;let $;v[36]!==Z||v[37]!==_||v[38]!==S?($=(0,c.resolveFeatureValues)({features:Z,persistedFeatureValues:S,localFeatureValues:_}),v[36]=Z,v[37]=_,v[38]=S,v[39]=$):$=v[39];const ee=$;let re;v[40]!==Z||v[41]!==ee?(re=(0,c.applyFeatureValues)(Z,ee),v[40]=Z,v[41]=ee,v[42]=re):re=v[42];const te=re;let se,ne,ue,oe,ae;v[43]!==A?(se=()=>{const t=C.current;C.current=A,null!==t&&t!==A&&j({})},ne=[A],v[43]=A,v[44]=se,v[45]=ne):(se=v[44],ne=v[45]);(0,s.useEffect)(se,ne),v[46]!==Z||v[47]!==X||v[48]!==_?(ue=()=>{if(void 0===X)return;const t=(0,c.pruneFeatureValues)(_,Z);t!==_&&j(t)},oe=[Z,X,_],v[46]=Z,v[47]=X,v[48]=_,v[49]=ue,v[50]=oe):(ue=v[49],oe=v[50]);(0,s.useEffect)(ue,oe),v[51]!==ee?(ae=Object.keys(ee).length>0?ee:void 0,v[51]=ee,v[52]=ae):ae=v[52];const le=ae;let ie;v[53]!==y||v[54]!==D?(ie=(t,s)=>{j(n=>Object.is(n[t],s)?n:Object.assign({},n,{[t]:s})),y&&D(n=>(0,l.mergeProviderPreferences)({preferences:n,provider:y,updates:{featureValues:{[t]:s}}})).catch(f)},v[53]=y,v[54]=D,v[55]=ie):ie=v[55];const ce=ie;let de;v[56]===Symbol.for("react.memo_cache_sentinel")?(de=t=>{j(t)},v[56]=de):de=v[56];const fe=de;let pe;v[57]!==le||v[58]!==te||v[59]!==W.isLoading||v[60]!==ce?(pe={features:te,featureValues:le,isLoading:W.isLoading,setFeatureValue:ce,applyProfileFeatureValues:fe},v[57]=le,v[58]=te,v[59]=W.isLoading,v[60]=ce,v[61]=pe):pe=v[61];return pe};var t=r(d[0]),s=r(d[1]),n=r(d[2]),u=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]);function f(t){console.warn("[useDraftAgentFeatures] persist feature preference failed",t)}},4557,[454,37,800,854,3529,4384,4377]);
16212
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDraftAgentFeatures=function(p){const v=(0,t.c)(62),{t:F}=(0,u.useTranslation)(),{serverId:V,provider:y,cwd:P,modeId:w,modelId:b,thinkingOptionId:h,initialFeatureValues:I}=p;let O;v[0]!==I?(O=()=>I??{},v[0]=I,v[1]=O):O=v[1];const[_,j]=(0,s.useState)(O),k=(0,o.useHostRuntimeClient)(V??""),E=(0,o.useHostRuntimeIsConnected)(V??""),{preferences:L,updatePreferences:D}=(0,l.useFormPreferences)();let R;v[2]!==P?(R=P?.trim()||"",v[2]=P,v[3]=R):R=v[3];const q=R,A=y??null,C=(0,s.useRef)(A);let H;v[4]!==L.providerPreferences||v[5]!==y?(H=y?L.providerPreferences?.[y]?.featureValues??{}:{},v[4]=L.providerPreferences,v[5]=y,v[6]=H):H=v[6];const S=H;let T;e:{if(!A||!q){T=null;break e}let t,s,n,u;v[7]!==w?(t=w?{modeId:w}:{},v[7]=w,v[8]=t):t=v[8],v[9]!==b?(s=b?{model:b}:{},v[9]=b,v[10]=s):s=v[10],v[11]!==h?(n=h?{thinkingOptionId:h}:{},v[11]=h,v[12]=n):n=v[12],v[13]!==q||v[14]!==A||v[15]!==t||v[16]!==s||v[17]!==n?(u=Object.assign({provider:A,cwd:q},t,s,n),v[13]=q,v[14]=A,v[15]=t,v[16]=s,v[17]=n,v[18]=u):u=v[18],T=u}const B=T,K=V??null,M=q||null,Q=w??null,x=b??null,z=h??null;let G;v[19]!==A||v[20]!==K||v[21]!==M||v[22]!==Q||v[23]!==x||v[24]!==z?(G=["providerFeatures",K,A,M,Q,x,z],v[19]=A,v[20]=K,v[21]=M,v[22]=Q,v[23]=x,v[24]=z,v[25]=G):G=v[25];const J=Boolean(V&&k&&E&&B);let N,U;v[26]!==k||v[27]!==B||v[28]!==F?(N=async()=>{if(!k||!B)throw new Error(F("workspace.terminal.hostDisconnected"));const t=await k.listProviderFeatures(B);if(t.error)throw new Error(t.error);return t.features??[]},v[26]=k,v[27]=B,v[28]=F,v[29]=N):N=v[29];v[30]!==J||v[31]!==N||v[32]!==G?(U={queryKey:G,enabled:J,staleTime:3e5,queryFn:N},v[30]=J,v[31]=N,v[32]=G,v[33]=U):U=v[33];const W=(0,n.useQuery)(U),X=W.data;let Y;v[34]!==X?(Y=X??[],v[34]=X,v[35]=Y):Y=v[35];const Z=Y;let $;v[36]!==X||v[37]!==_||v[38]!==S?($=(0,c.resolveFeatureValues)({features:X,persistedFeatureValues:S,localFeatureValues:_}),v[36]=X,v[37]=_,v[38]=S,v[39]=$):$=v[39];const ee=$;let re;v[40]!==Z||v[41]!==ee?(re=(0,c.applyFeatureValues)(Z,ee),v[40]=Z,v[41]=ee,v[42]=re):re=v[42];const te=re;let se,ne,ue,oe,ae;v[43]!==A?(se=()=>{const t=C.current;C.current=A,null!==t&&t!==A&&j({})},ne=[A],v[43]=A,v[44]=se,v[45]=ne):(se=v[44],ne=v[45]);(0,s.useEffect)(se,ne),v[46]!==Z||v[47]!==X||v[48]!==_?(ue=()=>{if(void 0===X)return;const t=(0,c.pruneFeatureValues)(_,Z);t!==_&&j(t)},oe=[Z,X,_],v[46]=Z,v[47]=X,v[48]=_,v[49]=ue,v[50]=oe):(ue=v[49],oe=v[50]);(0,s.useEffect)(ue,oe),v[51]!==ee?(ae=Object.keys(ee).length>0?ee:void 0,v[51]=ee,v[52]=ae):ae=v[52];const le=ae;let ie;v[53]!==y||v[54]!==D?(ie=(t,s)=>{j(n=>Object.is(n[t],s)?n:Object.assign({},n,{[t]:s})),y&&D(n=>(0,l.mergeProviderPreferences)({preferences:n,provider:y,updates:{featureValues:{[t]:s}}})).catch(f)},v[53]=y,v[54]=D,v[55]=ie):ie=v[55];const ce=ie;let de;v[56]===Symbol.for("react.memo_cache_sentinel")?(de=t=>{j(t)},v[56]=de):de=v[56];const fe=de;let pe;v[57]!==le||v[58]!==te||v[59]!==W.isLoading||v[60]!==ce?(pe={features:te,featureValues:le,isLoading:W.isLoading,setFeatureValue:ce,applyProfileFeatureValues:fe},v[57]=le,v[58]=te,v[59]=W.isLoading,v[60]=ce,v[61]=pe):pe=v[61];return pe};var t=r(d[0]),s=r(d[1]),n=r(d[2]),u=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]);function f(t){console.warn("[useDraftAgentFeatures] persist feature preference failed",t)}},4557,[454,37,800,854,3529,4384,4377]);
16213
16213
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deriveAgentScreenViewState=h,e.useAgentScreenStateMachine=function({routeKey:n,input:s}){const o=(0,t.useRef)(n),u=(0,t.useRef)({hasRenderedReady:!1,lastReadyAgent:null,hadInitialSyncFailure:!1});o.current!==n&&(o.current=n,u.current={hasRenderedReady:!1,lastReadyAgent:null,hadInitialSyncFailure:!1});const y=h({input:s,memory:u.current});return u.current=y.memory,y.state};var t=r(d[0]);function n(t){return"optimistic-create"===t.continuity.kind}function s(t){return!t.isArchived&&!n(t)&&!t.hasHydratedHistoryBefore&&(t.needsAuthoritativeSync||t.isHistorySyncing)}function o(t){return"optimistic-create"===t.continuity.kind&&(!t.agent||"idle"===t.agent.status)}function u(t){const{input:n,useOptimisticCreateFlowAgent:s}=t,o="optimistic-create"===n.continuity.kind?n.continuity.agent:null;return n.agent&&s&&o?Object.assign({},n.agent,{status:o.status}):n.agent??o}function y(t){return t.useOptimisticCreateFlowAgent?"optimistic":t.hasAgent?"authoritative":t.hasOptimisticCreateContinuity?"optimistic":"stale"}function c(t){return t.hasOptimisticCreateContinuity?"silent":t.hasHydratedHistoryBefore?"status":t.isVisibilityCatchUpPending?"overlay":t.hadInitialSyncFailure?"silent":"overlay"}function l(t){const{input:s,hadInitialSyncFailure:o}=t;return s.isArchived?{status:"idle"}:s.isConnected?"error"===s.missingAgentState.kind||"error"===s.visibilityCatchUpStatus||"retrying"===s.visibilityCatchUpStatus?{status:"sync_error",isRetrying:"retrying"===s.visibilityCatchUpStatus}:"pending"===s.visibilityCatchUpStatus||s.needsAuthoritativeSync||s.isHistorySyncing?{status:"catching_up",ui:c({hasOptimisticCreateContinuity:n(s),isVisibilityCatchUpPending:"pending"===s.visibilityCatchUpStatus,hasHydratedHistoryBefore:s.hasHydratedHistoryBefore,hadInitialSyncFailure:o})}:{status:"idle"}:{status:"reconnecting"}}function h({input:t,memory:c}){const h={hasRenderedReady:c.hasRenderedReady,lastReadyAgent:c.lastReadyAgent,hadInitialSyncFailure:c.hadInitialSyncFailure};var p;(p={input:t,nextMemory:h}).input.hasHydratedHistoryBefore&&(p.nextMemory.hadInitialSyncFailure=!1),"error"!==p.input.missingAgentState.kind||p.input.hasHydratedHistoryBefore||(p.nextMemory.hadInitialSyncFailure=!0),"error"===p.input.visibilityCatchUpStatus&&p.input.visibilityCatchUpError&&!p.input.hasHydratedHistoryBefore&&(p.nextMemory.hadInitialSyncFailure=!0);const S=o(t),f=u({input:t,useOptimisticCreateFlowAgent:S}),A=s(t);if("not_found"===t.missingAgentState.kind)return{state:{tag:"not_found",message:t.missingAgentState.message},memory:h};if("error"===t.missingAgentState.kind&&!h.hasRenderedReady)return{state:{tag:"error",message:t.missingAgentState.message},memory:h};if("error"===t.visibilityCatchUpStatus&&t.visibilityCatchUpError&&!t.hasHydratedHistoryBefore&&!h.hasRenderedReady)return{state:{tag:"error",message:t.visibilityCatchUpError},memory:h};if(f&&A)return{state:{tag:"boot",reason:"loading",source:"none"},memory:h};f&&(h.hasRenderedReady=!0,h.lastReadyAgent=f);const C=f??(h.hasRenderedReady?h.lastReadyAgent:null);if(!C)return{state:{tag:"boot",reason:"resolving"===t.missingAgentState.kind?"resolving":"loading",source:"none"},memory:h};return{state:{tag:"ready",agent:C,source:y({useOptimisticCreateFlowAgent:S,hasAgent:Boolean(t.agent),hasOptimisticCreateContinuity:n(t)}),sync:l({input:t,hadInitialSyncFailure:h.hadInitialSyncFailure}),isArchiving:t.isArchivingCurrentAgent},memory:h}}},4558,[37]);
16214
16214
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.reconcileMissingAgentStateWithPresentAgent=function(n){if("resolving"===n.kind||"not_found"===n.kind)return{kind:"idle"};return n},e.clearHistorySyncErrorAfterSuccessfulSync=function(n){if("error"===n.kind)return{kind:"idle"};return n}},4559,[]);
16215
16215
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TimelineSyncStatus=function(s){const c=(0,t.c)(11),{sync:v,toast:_,onDismiss:y}=s,{t:j}=(0,n.useTranslation)();let D,M;c[0]!==v?(D=null,"reconnecting"===v?.status?D="reconnecting":"catching_up"===v?.status&&"status"===v.ui&&(D="updating"),c[0]=v,c[1]=D):D=c[1];c[2]!==D||c[3]!==j?(M=D?j(`agentPanel.states.${D}`):null,c[2]=D,c[3]=j,c[4]=M):M=c[4];const P=M;let S;c[5]!==P||c[6]!==D?(S=D&&P?{id:"reconnecting"===D?1:2,content:P,nativeMessage:P,icon:(0,l.jsx)(p,{size:18,uniProps:u}),variant:"default",durationMs:null,testID:`agent-${D}-toast`}:null,c[5]=P,c[6]=D,c[7]=S):S=c[7];const T=S,h=_??T,w=_?y:f;let x;c[8]!==h||c[9]!==w?(x=(0,l.jsx)(o.ToastViewport,{toast:h,onDismiss:w,placement:"panel"}),c[8]=h,c[9]=w,c[10]=x):x=c[10];return x};var t=r(d[0]);r(d[1]);var n=r(d[2]),s=r(d[3]),o=r(d[4]),c=r(d[5]),l=r(d[6]);const u=t=>({color:t.colors.foreground}),p=(0,s.withUnistyles)(c.LoadingSpinner),f=()=>{}},4560,[454,37,854,57,895,3023,280]);
@@ -16644,7 +16644,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
16644
16644
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getProjectRemoveReadiness=o,e.getCurrentProjectRemoveReadiness=function(n){const c=t.useSessionStore.getState();return o({project:n,supportsProjectRemove:t=>(0,s.selectHostFeature)(c,t,"projectRemove")})},e.removeProjectFromHosts=async function(t){const s=[],o=[];for(const n of t.targets){const c=t.getClient(n.serverId);c?s.push({serverId:n.serverId,projectId:n.projectId,client:c}):o.push(n.serverId)}if(o.length>0)return{kind:"host_disconnected",serverIds:o};const n=await Promise.allSettled(s.map(async({client:t,projectId:s})=>{await t.removeProject(s)})),c=[];for(const[t,o]of n.entries())if("rejected"===o.status){const o=s[t];o&&c.push(o.serverId)}if(c.length>0)return{kind:"failed",serverIds:c};return{kind:"removed",serverIds:s.map(t=>t.serverId)}};var t=r(d[0]),s=r(d[1]);function o(t){const s=[],o=[];for(const n of t.project.hosts)t.supportsProjectRemove(n.serverId)?o.push({serverId:n.serverId,projectId:n.projectId}):s.push(n.serverId);return s.length>0?{kind:"needs_host_update",serverIds:s}:{kind:"ready",targets:o}}},4885,[3459,3455]);
16645
16645
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useHostBadges=function(n){const u=(0,s.c)(5),{enabled:c}=n,v=(0,t.useHosts)(),H=(0,o.useLocalDaemonServerId)(),S="resolved"!==(0,o.useLocalDaemonServerIdState)().status;let _;u[0]!==c||u[1]!==v||u[2]!==H||u[3]!==S?(_=(0,l.selectHostBadges)({hosts:v,localServerId:H,localHostResolutionPending:S,enabled:c}),u[0]=c,u[1]=v,u[2]=H,u[3]=S,u[4]=_):_=u[4];return _};var s=r(d[0]);r(d[1]);var t=r(d[2]),o=r(d[3]),l=r(d[4])},4886,[454,37,3529,3842,3535]);
16646
16646
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DesktopWindowControls=function(){const t=(0,o.c)(26),{t:n}=(0,c.useTranslation)(),{visible:s,mode:l,isMaximized:h}=(0,k.useCustomDesktopWindowControls)(),u=b,y=S,p=W;if(!s||!l)return null;let w;t[0]!==l?(w=(0,x.getDesktopWindowControlsPresentation)(l),t[0]=l,t[1]=w):w=t[1];const C=w;let z,P,D;t[2]!==C.controlHeight?(z=[v.controls,{height:C.controlHeight}],t[2]=C.controlHeight,t[3]=z):z=t[3];t[4]!==n?(P=n("desktop.windowControls.minimize"),t[4]=n,t[5]=P):P=t[5];t[6]!==C||t[7]!==P?(D=(0,f.jsx)(j,{kind:"minimize",label:P,onPress:u,presentation:C}),t[6]=C,t[7]=P,t[8]=D):D=t[8];const H=h?"restore":"maximize",_=h?"desktop.windowControls.restore":"desktop.windowControls.maximize";let L,M,B,I,R;t[9]!==n||t[10]!==_?(L=n(_),t[9]=n,t[10]=_,t[11]=L):L=t[11];t[12]!==C||t[13]!==H||t[14]!==L?(M=(0,f.jsx)(j,{kind:H,label:L,onPress:y,presentation:C}),t[12]=C,t[13]=H,t[14]=L,t[15]=M):M=t[15];t[16]!==n?(B=n("desktop.windowControls.close"),t[16]=n,t[17]=B):B=t[17];t[18]!==C||t[19]!==B?(I=(0,f.jsx)(j,{kind:"close",label:B,onPress:p,presentation:C}),t[18]=C,t[19]=B,t[20]=I):I=t[20];t[21]!==z||t[22]!==D||t[23]!==M||t[24]!==I?(R=(0,f.jsxs)(e.View,{style:z,testID:"desktop-window-controls",children:[D,M,I]}),t[21]=z,t[22]=D,t[23]=M,t[24]=I,t[25]=R):R=t[25];return R};var e=r(d[0]),t=r(d[1]),o=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var n,s=r(d[6]),l=(n=s)&&n.__esModule?n:{default:n},c=r(d[7]),h=r(d[8]),u=r(d[9]),x=r(d[10]),k=r(d[11]),f=r(d[12]);const y=(0,h.withUnistyles)(function(e){const t=(0,o.c)(30),{kind:n,color:c,size:h,strokeWidth:u}=e;if("minimize"===n){let e,o;return t[0]!==c||t[1]!==u?(e=(0,f.jsx)(s.Line,{x1:3,y1:8,x2:13,y2:8,stroke:c,strokeWidth:u}),t[0]=c,t[1]=u,t[2]=e):e=t[2],t[3]!==h||t[4]!==e?(o=(0,f.jsx)(l.default,{width:h,height:h,viewBox:"0 0 16 16",style:v.glyph,children:e}),t[3]=h,t[4]=e,t[5]=o):o=t[5],o}if("restore"===n){let e,o,n,x;return t[6]!==c||t[7]!==u?(e=(0,f.jsx)(s.Rect,{x:5.5,y:3.5,width:7,height:7,fill:"none",stroke:c,strokeWidth:u}),o=(0,f.jsx)(s.Line,{x1:3.5,y1:5.5,x2:3.5,y2:12.5,stroke:c,strokeWidth:u}),n=(0,f.jsx)(s.Line,{x1:3,y1:12.5,x2:10.5,y2:12.5,stroke:c,strokeWidth:u}),t[6]=c,t[7]=u,t[8]=e,t[9]=o,t[10]=n):(e=t[8],o=t[9],n=t[10]),t[11]!==h||t[12]!==e||t[13]!==o||t[14]!==n?(x=(0,f.jsxs)(l.default,{width:h,height:h,viewBox:"0 0 16 16",style:v.glyph,children:[e,o,n]}),t[11]=h,t[12]=e,t[13]=o,t[14]=n,t[15]=x):x=t[15],x}if("close"===n){let e,o,n;return t[16]!==c||t[17]!==u?(e=(0,f.jsx)(s.Line,{x1:4,y1:4,x2:12,y2:12,stroke:c,strokeWidth:u}),o=(0,f.jsx)(s.Line,{x1:12,y1:4,x2:4,y2:12,stroke:c,strokeWidth:u}),t[16]=c,t[17]=u,t[18]=e,t[19]=o):(e=t[18],o=t[19]),t[20]!==h||t[21]!==e||t[22]!==o?(n=(0,f.jsxs)(l.default,{width:h,height:h,viewBox:"0 0 16 16",style:v.glyph,children:[e,o]}),t[20]=h,t[21]=e,t[22]=o,t[23]=n):n=t[23],n}let x,k;return t[24]!==c||t[25]!==u?(x=(0,f.jsx)(s.Rect,{x:3.5,y:3.5,width:9,height:9,fill:"none",stroke:c,strokeWidth:u}),t[24]=c,t[25]=u,t[26]=x):x=t[26],t[27]!==h||t[28]!==x?(k=(0,f.jsx)(l.default,{width:h,height:h,viewBox:"0 0 16 16",style:v.glyph,children:x}),t[27]=h,t[28]=x,t[29]=k):k=t[29],k}),p=e=>({color:e.colors.foregroundMuted}),w=()=>({color:"#ffffff"});function j(n){const s=(0,o.c)(12),{kind:l,label:c,onPress:h,presentation:u}=n;let x;s[0]!==l||s[1]!==u.glyphSize||s[2]!==u.glyphStrokeWidth||s[3]!==u.hoverShape?(x=t=>{const{hovered:o,pressed:n}=t,s=o||n,c="close"===l&&s;return(0,f.jsx)(e.View,{style:[v.controlSurface,"circle"===u.hoverShape?v.circularControlSurface:v.fullControlSurface,s?v.controlHovered:null,c?v.closeHovered:null],children:(0,f.jsx)(y,{kind:l,size:u.glyphSize,strokeWidth:u.glyphStrokeWidth,uniProps:c?w:p})})},s[0]=l,s[1]=u.glyphSize,s[2]=u.glyphStrokeWidth,s[3]=u.hoverShape,s[4]=x):x=s[4];const k=x;let j;s[5]!==u.controlWidth?(j=[v.control,{width:u.controlWidth}],s[5]=u.controlWidth,s[6]=j):j=s[6];const W=j;let S;return s[7]!==W||s[8]!==k||s[9]!==c||s[10]!==h?(S=(0,f.jsx)(t.Pressable,{accessibilityRole:"button",accessibilityLabel:c,onPress:h,style:W,children:k}),s[7]=W,s[8]=k,s[9]=c,s[10]=h,s[11]=S):S=s[11],S}function W(){(0,u.closeDesktopWindow)()}function S(){(0,u.toggleDesktopMaximize)()}function b(){(0,u.minimizeDesktopWindow)()}const v=h.StyleSheet.create(e=>({controls:{position:"absolute",top:0,right:0,zIndex:3e3,flexDirection:"row"},control:{height:"100%",alignItems:"center",justifyContent:"center"},controlSurface:{alignItems:"center",justifyContent:"center"},fullControlSurface:{width:"100%",height:"100%"},circularControlSurface:{width:24,height:24,borderRadius:12},glyph:{flexShrink:0},controlHovered:{backgroundColor:e.colors.interactionHighlight,uni__dependencies:[0]},closeHovered:{backgroundColor:"rgba(232, 17, 35, 0.9)"}}))},4887,[896,898,454,37,426,147,1222,854,57,4052,4053,4051,280]);
16647
- __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DesktopSidebarSurface=function({overlay:e,active:o,onDismiss:y,children:E}){const b=(0,t.useRef)(null),[h]=(0,t.useState)(()=>document.createElement("div")),[L,x]=(0,t.useState)(0),S=(0,t.useRef)(void 0),_=(0,t.useCallback)(()=>(x(e=>e+1),()=>x(e=>e-1)),[]),D=(0,c.usePanelStore)(e=>e.sidebarWidth),{width:P}=(0,s.default)(),W=(0,u.resolveDesktopSidebarWidth)({requestedWidth:D,viewportWidth:P});return(0,t.useLayoutEffect)(()=>{const t=e?(0,l.getOverlayRoot)():b.current;if(t)return h.style.display="flex",h.style.position=e?"absolute":"relative",h.style.inset=e?"0 auto 0 0":"",h.style.zIndex="0",t.appendChild(h),()=>h.remove()},[h,e]),(0,t.useLayoutEffect)(()=>{const t=o?W:u.SIDEBAR_EDGE_WIDTH;h.style.width=e?`${t}px`:"",h.style.pointerEvents=e&&o?"auto":"none",h.style.setProperty("-webkit-app-region",e?"no-drag":"")},[o,h,e,W]),(0,t.useLayoutEffect)(()=>{if(e)return h.addEventListener("mouseleave",t),document.addEventListener("pointerover",t),document.addEventListener("pointermove",t),S.current&&t(S.current),()=>{h.removeEventListener("mouseleave",t),document.removeEventListener("pointerover",t),document.removeEventListener("pointermove",t)};function t(e){if(S.current=e,e.buttons||L)return;const t=document.elementFromPoint(e.clientX,e.clientY);t instanceof Node&&(h.contains(t)||(0,l.isTargetInWebOverlay)(t))||y()}},[h,L,y,e]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{ref:b,style:p}),(0,n.createPortal)((0,f.jsx)(v.SidebarHoverContext.Provider,{value:_,children:E}),h)]})};var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),s=(e=o)&&e.__esModule?e:{default:e},u=r(d[3]),l=r(d[4]),c=r(d[5]),v=r(d[6]),f=r(d[7]);const p={display:"flex"}},4888,[37,388,451,4119,2882,3798,3715,280]);
16647
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DesktopSidebarSurface=function({overlay:e,active:n,onDismiss:y,children:E}){const L=(0,t.useRef)(null),[b]=(0,t.useState)(()=>document.createElement("div")),[h,S]=(0,t.useState)(0),x=(0,t.useRef)(void 0),_=(0,t.useCallback)(()=>(S(e=>e+1),()=>S(e=>e-1)),[]),D=(0,c.usePanelStore)(e=>e.sidebarWidth),{width:P}=(0,s.default)(),W=(0,l.resolveDesktopSidebarWidth)({requestedWidth:D,viewportWidth:P});return(0,t.useLayoutEffect)(()=>{const t=e?(0,u.getOverlayRoot)():L.current;if(!t)return;const o=Array.from(b.querySelectorAll("*")).map(e=>({element:e,top:e.scrollTop,left:e.scrollLeft})),s=n?W:l.SIDEBAR_EDGE_WIDTH;b.style.display="flex",b.style.position=e?"absolute":"relative",b.style.inset=e?"0 auto 0 0":"",b.style.zIndex="0",b.style.width=e?`${s}px`:"",b.style.pointerEvents=e&&n?"auto":"none",b.style.setProperty("-webkit-app-region",e?"no-drag":""),b.parentElement!==t&&t.appendChild(b);for(const{element:e,top:t,left:n}of o)e.scrollTop=t,e.scrollLeft=n},[n,b,e,W]),(0,t.useLayoutEffect)(()=>()=>b.remove(),[b]),(0,t.useLayoutEffect)(()=>{if(e)return b.addEventListener("mouseleave",t),document.addEventListener("pointerover",t),document.addEventListener("pointermove",t),x.current&&t(x.current),()=>{b.removeEventListener("mouseleave",t),document.removeEventListener("pointerover",t),document.removeEventListener("pointermove",t)};function t(e){if(x.current=e,e.buttons||h)return;const t=document.elementFromPoint(e.clientX,e.clientY);t instanceof Node&&(b.contains(t)||(0,u.isTargetInWebOverlay)(t))||y()}},[b,h,y,e]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{ref:L,style:p}),(0,o.createPortal)((0,f.jsx)(v.SidebarHoverContext.Provider,{value:_,children:E}),b)]})};var e,t=r(d[0]),o=r(d[1]),n=r(d[2]),s=(e=n)&&e.__esModule?e:{default:e},l=r(d[3]),u=r(d[4]),c=r(d[5]),v=r(d[6]),f=r(d[7]);const p={display:"flex"}},4888,[37,388,451,4119,2882,3798,3715,280]);
16648
16648
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.WorkspacePinShortcutHandler=function(){return(0,n.useGlobalWorkspacePinAction)(),null};var n=r(d[0])},4889,[4890]);
16649
16649
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useGlobalWorkspacePinAction=function(){const b=(0,n.c)(8),v=(0,c.useActiveWorkspaceSelection)(),w=v?.serverId??null,A=v?.workspaceId??null,I=(0,l.useWorkspaceFields)(w,A,k),f=(0,t.useHostFeature)(w,"workspacePinning"),y=(0,o.useSidebarWorkspacePinController)();let P;b[0]!==f||b[1]!==I||b[2]!==w||b[3]!==y?(P=()=>{if(!w||!I||!f)return!1;const n=(0,u.buildWorkspaceTabPersistenceKey)({serverId:w,workspaceId:I.id});return!!n&&(y({serverId:w,workspaceId:I.id,workspaceKey:n,pinnedAt:I.pinnedAt}),!0)},b[0]=f,b[1]=I,b[2]=w,b[3]=y,b[4]=P):P=b[4];const W=P,_=null!==w&&null!==I&&f;let K;b[5]!==W||b[6]!==_?(K={handlerId:"workspace-pin-global",actions:p,enabled:_,priority:0,handle:W},b[5]=W,b[6]=_,b[7]=K):K=b[7];(0,s.useKeyboardActionHandler)(K)};var n=r(d[0]);r(d[1]);var s=r(d[2]),o=r(d[3]),t=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]);const p=["workspace.pin"];function k(n){return{id:n.id,pinnedAt:n.pinnedAt??null}}},4890,[454,37,4397,4861,3455,3671,3801,3554]);
16650
16650
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.WorkspaceRenameHost=function(){const _=(0,n.c)(19),b=(0,o.useActiveWorkspaceSelection)(),k=b?.serverId??null,y=b?.workspaceId??null,h=(0,s.useWorkspaceFields)(k,y,p),[v,w]=(0,t.useState)(!1),I=(0,t.useRef)(null);let S;_[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{null!==I.current&&(cancelAnimationFrame(I.current),I.current=null)},_[0]=S):S=_[0];const A=S;let W,F,R;_[1]===Symbol.for("react.memo_cache_sentinel")?(W=()=>A,F=[A],_[1]=W,_[2]=F):(W=_[1],F=_[2]);(0,t.useEffect)(W,F),_[3]!==h?(R=()=>!!h&&(A(),I.current=requestAnimationFrame(()=>{I.current=null,w(!0)}),!0),_[3]=h,_[4]=R):R=_[4];const j=R;let E;_[5]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{A(),w(!1)},_[5]=E):E=_[5];const H=E;let M,q;_[6]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{A(),w(!1)},_[6]=M):M=_[6];_[7]!==y||_[8]!==k?(q=[A,k,y],_[7]=y,_[8]=k,_[9]=q):q=_[9];(0,t.useEffect)(M,q);const x=null!==k&&null!==h;let C,D;_[10]!==j||_[11]!==x?(C={handlerId:"workspace-rename-global",actions:f,enabled:x,priority:0,handle:j},_[10]=j,_[11]=x,_[12]=C):C=_[12];(0,c.useKeyboardActionHandler)(C),_[13]!==h||_[14]!==k?(D=k&&h?{serverId:k,workspaceId:h.id,name:h.name,title:h.title}:null,_[13]=h,_[14]=k,_[15]=D):D=_[15];const K=D;if(!K)return null;let O;_[16]!==v||_[17]!==K?(O=(0,u.jsx)(l.WorkspaceRenameModal,{visible:v,workspace:K,onClose:H,testID:"workspace-rename-modal-global"}),_[16]=v,_[17]=K,_[18]=O):O=_[18];return O};var n=r(d[0]),t=r(d[1]),l=r(d[2]),c=r(d[3]),o=r(d[4]),s=r(d[5]),u=r(d[6]);const f=["workspace.rename"];function p(n){return{id:n.id,name:n.name,title:n.title??null}}},4891,[454,37,4836,4397,3671,3801,280]);
@@ -92,6 +92,6 @@
92
92
  <body>
93
93
  <noscript>You need to enable JavaScript to run this app.</noscript>
94
94
  <div id="root"></div>
95
- <script src="/_expo/static/js/web/index-d39694fb6a6ea78512fa776f4db8d1a5.js" defer></script>
95
+ <script src="/_expo/static/js/web/index-d073261c6c171ec5910a051220471a65.js" defer></script>
96
96
  </body>
97
97
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/server",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo backend server",
5
5
  "files": [
6
6
  "dist/server",
@@ -125,10 +125,10 @@
125
125
  "lightningcss": "1.30.1"
126
126
  },
127
127
  "dependencies": {
128
- "@getpaseo/client": "0.11.0-fork.29",
129
- "@getpaseo/highlight": "0.11.0-fork.29",
130
- "@getpaseo/plugin": "0.11.0-fork.29",
131
- "@getpaseo/protocol": "0.11.0-fork.29",
132
- "@getpaseo/relay": "0.11.0-fork.29"
128
+ "@getpaseo/client": "0.11.0-fork.30",
129
+ "@getpaseo/highlight": "0.11.0-fork.30",
130
+ "@getpaseo/plugin": "0.11.0-fork.30",
131
+ "@getpaseo/protocol": "0.11.0-fork.30",
132
+ "@getpaseo/relay": "0.11.0-fork.30"
133
133
  }
134
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mduan/paseo-cli",
3
- "version": "0.11.0-fork.29",
3
+ "version": "0.11.0-fork.30",
4
4
  "description": "Paseo CLI - control your AI coding agents from the command line (mduan fork)",
5
5
  "bin": {
6
6
  "paseo": "bin/paseo"
@@ -21,12 +21,12 @@
21
21
  "@clack/prompts": "^1.0.0",
22
22
  "@codemirror/language": "6.12.4",
23
23
  "@codemirror/legacy-modes": "^6.5.3",
24
- "@getpaseo/client": "0.11.0-fork.29",
25
- "@getpaseo/highlight": "0.11.0-fork.29",
26
- "@getpaseo/plugin": "0.11.0-fork.29",
27
- "@getpaseo/protocol": "0.11.0-fork.29",
28
- "@getpaseo/relay": "0.11.0-fork.29",
29
- "@getpaseo/server": "0.11.0-fork.29",
24
+ "@getpaseo/client": "0.11.0-fork.30",
25
+ "@getpaseo/highlight": "0.11.0-fork.30",
26
+ "@getpaseo/plugin": "0.11.0-fork.30",
27
+ "@getpaseo/protocol": "0.11.0-fork.30",
28
+ "@getpaseo/relay": "0.11.0-fork.30",
29
+ "@getpaseo/server": "0.11.0-fork.30",
30
30
  "@isaacs/ttlcache": "^2.1.4",
31
31
  "@lezer/common": "^1.5.0",
32
32
  "@lezer/cpp": "^1.1.5",