@nextclaw/ui 0.26.3 → 0.26.4
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.
- package/CHANGELOG.md +24 -0
- package/dist/.vite/manifest.json +329 -329
- package/dist/assets/{account-panel-DIdHjKG-.js → account-panel-DVi_jhkG.js} +1 -1
- package/dist/assets/{api-DkLJrSCd.js → api-BZvNpFOS.js} +1 -1
- package/dist/assets/app-presenter-provider-BcYL-VNe.js +124 -0
- package/dist/assets/{appearance-settings-page-DI8aDY2G.js → appearance-settings-page-AZNBzLmT.js} +1 -1
- package/dist/assets/{book-open-BPMkKSci.js → book-open-CmRdT3N1.js} +1 -1
- package/dist/assets/card-CdRBL1E0.js +1 -0
- package/dist/assets/{channels-list-page-CCIaTQu7.js → channels-list-page-eZN74FN3.js} +2 -2
- package/dist/assets/{circle-dashed-B48a0t6p.js → circle-dashed-HOgt3gIJ.js} +1 -1
- package/dist/assets/{client-imrVphQb.js → client-DKKbdJ6Q.js} +1 -1
- package/dist/assets/config-split-page-BA3V6b3Q.js +1 -0
- package/dist/assets/{confirm-dialog-10Qb3dpZ.js → confirm-dialog-8vqYZ0wy.js} +1 -1
- package/dist/assets/{context-menu-CRqH2SEk.js → context-menu-DHVVdHzN.js} +1 -1
- package/dist/assets/{createLucideIcon-B4xj2I2g.js → createLucideIcon-DE0sB9Nu.js} +1 -1
- package/dist/assets/{desktop-capabilities-page-CFcT2g8-.js → desktop-capabilities-page-B9-B9k1A.js} +1 -1
- package/dist/assets/{desktop-update-config-CRJd_An1.js → desktop-update-config-Cfr3IRUe.js} +1 -1
- package/dist/assets/{dialog-BgL3vKJQ.js → dialog-BUfWO8hr.js} +1 -1
- package/dist/assets/{doc-browser-context-DH4aWvkS.js → doc-browser-context-ClLgMbxd.js} +1 -1
- package/dist/assets/doc-browser-w8q1j0jL.js +1 -0
- package/dist/assets/{download-Cr337h4W.js → download-CKqS1Ksj.js} +1 -1
- package/dist/assets/{es2015-D-CRf3_Z.js → es2015-BiB05Sav.js} +1 -1
- package/dist/assets/{extensions-CsmJPz7g.js → extensions-vPD4dGqt.js} +1 -1
- package/dist/assets/{eye-DrQRSAfJ.js → eye-bKzylu3p.js} +1 -1
- package/dist/assets/{form-actions-BEeWTGUZ.js → form-actions-CCoxz33Q.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-settings-page-DQU56SrW.js → keyboard-shortcuts-settings-page-D8rosOVh.js} +1 -1
- package/dist/assets/loader-circle-Clq1Gtb1.js +1 -0
- package/dist/assets/{login-page-sgivRYG1.js → login-page-BT3GV3Sb.js} +1 -1
- package/dist/assets/login-page-DKId3By8.js +1 -0
- package/dist/assets/{main-B-oxUq-o.js → main-bEWCGDHr.js} +2 -2
- package/dist/assets/main-kqMRTwOs.css +1 -0
- package/dist/assets/mcp-marketplace-page-CZIP6j3L.js +1 -0
- package/dist/assets/{model-config-page-CDQBhmVr.js → model-config-page-D21a-BO0.js} +1 -1
- package/dist/assets/{navigation-link-D3pzNHeA.js → navigation-link-DC-Pku0Y.js} +1 -1
- package/dist/assets/panelStandalone-BRg7B1EI.css +1 -0
- package/dist/assets/{panelStandalone-CGkYeMK5.js → panelStandalone-CX8X2hjh.js} +2 -2
- package/dist/assets/{privacy-settings-page-CjoAkoDt.js → privacy-settings-page-e0LFHZJm.js} +1 -1
- package/dist/assets/{projects-C7Zxpcoi.js → projects-Rki7Fmth.js} +1 -1
- package/dist/assets/provider-models-DFQgF4hS.js +1 -0
- package/dist/assets/provider-scoped-model-input-DaONL0j_.js +1 -0
- package/dist/assets/providers-config-page-CEOhQlMe.js +1 -0
- package/dist/assets/{puzzle--RLCeYML.js → puzzle-D_TiFXOv.js} +1 -1
- package/dist/assets/{pwa-DcizGowz.js → pwa-C9ac_1dg.js} +1 -1
- package/dist/assets/{refresh-cw-syCVj_nw.js → refresh-cw-BG8VfcdA.js} +1 -1
- package/dist/assets/remote-DkSx5x4R.js +1 -0
- package/dist/assets/{rotate-cw-BlH9El3x.js → rotate-cw-DPEegUU2.js} +1 -1
- package/dist/assets/{runtime-config-page-Cco9dS73.js → runtime-config-page-DDT1dVLt.js} +1 -1
- package/dist/assets/{save-BWynuRQ2.js → save-CPlctBjT.js} +1 -1
- package/dist/assets/{search-config-page-Cc74_SAU.js → search-config-page-CDwmd6eX.js} +1 -1
- package/dist/assets/{secrets-config-page-raYDzlFC.js → secrets-config-page-1OvgmwPv.js} +1 -1
- package/dist/assets/security-config-Pv4CM-kw.js +1 -0
- package/dist/assets/{select-6Uq4chZW.js → select-Y9IEbx9x.js} +1 -1
- package/dist/assets/service-apps-panel-DPrLeF3N.js +1 -0
- package/dist/assets/{settings-2-COvVf1XX.js → settings-2-CrGx9_De.js} +1 -1
- package/dist/assets/{status-dot-DZlxa5zW.js → status-dot-Cb8ewlUr.js} +1 -1
- package/dist/assets/{tag-chip-DXHtZ8AS.js → tag-chip-D-6aPuuh.js} +1 -1
- package/dist/assets/{theme-provider-C5PCDBPB.js → theme-provider-BjF1Eowc.js} +1 -1
- package/dist/assets/{trash-2-DazgBvmJ.js → trash-2-DER2EJKK.js} +1 -1
- package/dist/assets/{use-config-DRRGF9Zb.js → use-config-BM5jC65L.js} +1 -1
- package/dist/assets/{use-desktop-capabilities-CdfOUjdE.js → use-desktop-capabilities-ezKJwKqg.js} +1 -1
- package/dist/assets/{use-viewport-layout-DdxVnCYc.js → use-viewport-layout-vmbQUNT6.js} +1 -1
- package/dist/assets/x-DSz9cGhy.js +1 -0
- package/dist/index.html +33 -33
- package/dist/panel-standalone.html +10 -10
- package/package.json +4 -4
- package/src/app/components/layout/__tests__/sidebar.layout.test.tsx +2 -2
- package/src/app/components/layout/sidebar-rail.styles.ts +3 -3
- package/src/app/styles/charcoal-theme.css +0 -3
- package/src/app/styles/design-system.css +12 -6
- package/src/app/styles/island-theme.css +2 -15
- package/src/features/app-data/components/app-data-removal-choice.tsx +1 -1
- package/src/features/channels/pages/channels-list-page.tsx +1 -1
- package/src/features/chat/components/chat-sidebar-list-mode-switch.tsx +1 -1
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +28 -16
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +8 -2
- package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +6 -4
- package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +22 -1
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +10 -14
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +38 -7
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +4 -4
- package/src/features/chat/components/layout/chat-sidebar.tsx +2 -2
- package/src/features/chat/features/conversation/components/session-queued-input-rows.tsx +1 -1
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +12 -1
- package/src/features/chat/features/message/components/chat-tool-call-stress-harness.tsx +32 -2
- package/src/features/chat/features/message/hooks/__tests__/use-chat-message-virtualizer.test.tsx +7 -5
- package/src/features/chat/features/message/hooks/use-chat-message-virtualizer.ts +7 -3
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-project-groups.test.tsx +1 -1
- package/src/features/chat/features/session/components/chat-mobile-session-row.tsx +1 -1
- package/src/features/chat/features/session/components/chat-sidebar-context-card.tsx +1 -1
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +1 -1
- package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +7 -5
- package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +45 -10
- package/src/features/chat/features/session/components/session-header/chat-session-more-actions-menu.tsx +3 -0
- package/src/features/chat/features/session/components/session-header/chat-session-switcher-groups.tsx +6 -6
- package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +5 -4
- package/src/features/chat/features/session-type/components/chat-session-type-option-item.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +0 -1
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-prompt-suggestions.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +1 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumb-browser.tsx +2 -2
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +2 -2
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +1 -1
- package/src/features/chat/features/workspace/components/child-sessions/chat-session-child-sessions.tsx +2 -2
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-spreadsheet-preview.tsx +2 -2
- package/src/features/chat/features/workspace/components/overview/chat-session-continuous-attention.tsx +3 -3
- package/src/features/chat/features/workspace/components/overview/chat-session-token-usage.tsx +1 -1
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +4 -3
- package/src/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item.tsx +2 -1
- package/src/features/chat/features/workspace/components/session-cron-job-content.tsx +3 -3
- package/src/features/chat/features/workspace/components/workspace-file-content-preview.tsx +2 -2
- package/src/features/chat/features/workspace/components/workspace-markdown-outline.tsx +1 -1
- package/src/features/cron/components/cron-config.tsx +2 -2
- package/src/features/cron/components/cron-job-detail-dialog.tsx +1 -1
- package/src/features/cron/components/cron-job-row.tsx +3 -3
- package/src/features/cron/components/cron-task-discovery.tsx +1 -1
- package/src/features/inbox/pages/inbox-page.tsx +1 -1
- package/src/features/marketplace/components/curated-shelves/marketplace-curated-shelves.tsx +2 -2
- package/src/features/marketplace/components/curated-shelves/marketplace-shelf-card.tsx +2 -2
- package/src/features/marketplace/components/marketplace-list-card.tsx +4 -4
- package/src/features/marketplace/components/marketplace-page.tsx +2 -2
- package/src/features/marketplace/components/mcp/mcp-marketplace-card.tsx +2 -2
- package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +3 -3
- package/src/features/panel-apps/components/panel-app-list-item.tsx +3 -3
- package/src/features/pwa/components/pwa-install-entry.tsx +1 -1
- package/src/features/right-panel-resources/components/__tests__/page-resource-sidebar-nav.test.tsx +9 -1
- package/src/features/right-panel-resources/components/page-resource-sidebar-nav.tsx +1 -1
- package/src/features/right-panel-resources/components/right-panel-resource-home-page.tsx +1 -1
- package/src/features/service-apps/components/service-action-row.tsx +3 -3
- package/src/features/service-apps/components/service-app-list-item.tsx +4 -4
- package/src/features/service-apps/components/service-apps-panel.tsx +1 -1
- package/src/features/settings/components/config/provider-model-list.tsx +5 -5
- package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +4 -4
- package/src/features/settings/components/config/provider-pill-selector.tsx +1 -1
- package/src/features/settings/pages/appearance-settings-page.tsx +2 -2
- package/src/features/settings/pages/providers-config-page.tsx +6 -6
- package/src/features/side-dock/components/side-dock.tsx +4 -4
- package/src/index.css +4 -0
- package/src/platforms/desktop/components/desktop-window-chrome.tsx +1 -1
- package/src/platforms/mobile/components/mobile-bottom-nav.tsx +3 -3
- package/src/shared/components/common/brand-header.tsx +1 -1
- package/src/shared/components/common/searchable-model-input.tsx +2 -2
- package/src/shared/components/config-split-page.tsx +3 -3
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +2 -2
- package/src/shared/components/path-picker/server-path-picker-locations.tsx +1 -1
- package/src/shared/components/ui/button.tsx +2 -2
- package/src/shared/components/ui/card.tsx +1 -1
- package/src/shared/components/ui/context-menu/context-menu-items.tsx +3 -3
- package/src/shared/components/ui/input.tsx +7 -3
- package/src/shared/components/ui/overlays/sheet.tsx +1 -1
- package/src/shared/components/ui/popover.tsx +1 -1
- package/src/shared/components/ui/select.tsx +2 -2
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +3 -3
- package/src/shared/components/ui/tabs.tsx +1 -1
- package/dist/assets/app-presenter-provider-Co8uKOyW.js +0 -124
- package/dist/assets/card-Bqu8zWLq.js +0 -1
- package/dist/assets/config-split-page-Bd-bGKsw.js +0 -1
- package/dist/assets/doc-browser-52t2_rSF.js +0 -1
- package/dist/assets/loader-circle-DbOQWT9C.js +0 -1
- package/dist/assets/login-page-DW1AZXqX.js +0 -1
- package/dist/assets/main-BpL6OjwM.css +0 -1
- package/dist/assets/mcp-marketplace-page-DSLRpJEB.js +0 -1
- package/dist/assets/panelStandalone-D-mhAGNa.css +0 -1
- package/dist/assets/provider-models-YW7rIeOD.js +0 -1
- package/dist/assets/provider-scoped-model-input-axJ-pTEu.js +0 -1
- package/dist/assets/providers-config-page-_QhBXQ4M.js +0 -1
- package/dist/assets/remote-BLQU7aY5.js +0 -1
- package/dist/assets/security-config-aE_jOwy-.js +0 -1
- package/dist/assets/service-apps-panel-jBWAa4qZ.js +0 -1
- package/dist/assets/x-CQIp_nJT.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes island-ink-echo-a{0%{opacity:.9;text-shadow:.08em 0 #307e6847}}@keyframes island-ink-echo-b{0%{opacity:.92;text-shadow:-.065em 0 #8a5d383d}}@keyframes island-ink-echo-c{0%{opacity:.91;text-shadow:.05em 0 #307e6833,-.035em 0 #8a5d382e}}*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:hsl(var(--gray-200))}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--font-mono);font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:hsl(var(--gray-400))}textarea::-moz-placeholder{opacity:1;color:hsl(var(--gray-400))}input::placeholder,textarea::placeholder{opacity:1;color:hsl(var(--gray-400))}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}input:focus,textarea:focus{box-shadow:none;outline:none}:root{--shadow-popover:0 12px 36px -8px #0000002e, 0 3px 10px -2px #00000014;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--control-touch-size:2.75rem;--icon-control-size:2.5rem;--icon-feedback-size:2rem;--mobile-header-height:3rem;--brand-50:94 20% 95%;--brand-100:94 20% 90%;--brand-200:94 18% 80%;--brand-300:94 16% 65%;--brand-400:94 16% 50%;--brand-500:94 13% 37%;--brand-600:94 13% 30%;--brand-700:94 15% 25%;--brand-800:94 20% 18%;--brand-900:94 25% 12%;--gray-50:45 25% 97%;--gray-100:45 14% 94%;--gray-200:45 14% 88%;--gray-300:45 10% 80%;--gray-400:45 10% 60%;--gray-500:45 10% 50%;--gray-600:45 3% 39%;--gray-700:45 5% 25%;--gray-800:45 5% 20%;--gray-900:45 5% 12%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--link-foreground:211 73% 45%;--link-foreground-hover:211 73% 38%;--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--primary-foreground:0 0% 100%;--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:var(--brand-50);--accent-foreground:var(--brand-700);--interaction-hover:hsl(var(--foreground) / .04);--interaction-selection:hsl(var(--foreground) / .07);--interaction-selection-border:hsl(var(--foreground) / .12);--sidebar-interaction-hover:hsl(var(--gray-200) / .6);--sidebar-interaction-selection:hsl(var(--gray-200) / .8);--sidebar-segment-selection:hsl(var(--gray-200) / .7);--session-interaction-hover:hsl(var(--background) / .65);--session-interaction-selection:hsl(var(--background) / .9);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--destructive:0 84% 60%;--destructive-foreground:0 0% 98%;--success:142 76% 36%;--success-foreground:0 0% 100%;--warning:38 92% 50%;--warning-foreground:0 0% 100%;--card:0 0% 100%;--card-foreground:var(--gray-800);--card-border:var(--gray-200);--popover:0 0% 100%;--popover-foreground:var(--gray-800);--border:var(--gray-200);--border-hover:var(--gray-300);--border-active:var(--brand-500);--input:0 0% 100%;--input-border:var(--gray-200);--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--space-0:0px;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;--space-20:80px;--space-24:96px;--radius-sm:6px;--radius-md:8px;--radius-lg:12px;--radius-xl:16px;--radius-2xl:20px;--radius-3xl:24px;--radius-full:9999px;--shadow-xs:0 1px 2px 0 #1e140a0a;--shadow-sm:0 1px 3px 0 #1e140a0f, 0 1px 2px -1px #1e140a0a;--shadow-md:0 4px 6px -1px #1e140a0f, 0 2px 4px -2px #1e140a0a;--shadow-lg:0 10px 15px -3px #1e140a0f, 0 4px 6px -4px #1e140a0a;--shadow-xl:0 20px 25px -5px #1e140a14, 0 8px 10px -6px #1e140a0a;--shadow-2xl:0 25px 50px -12px #1e140a26;--shadow-card:0 0 8px 0 #0000000a;--shadow-card-hover:0 0 16px 0 #0000000f;--font-sans:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;--font-mono:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--text-xs:12px;--text-sm:14px;--text-base:16px;--text-lg:18px;--text-xl:20px;--text-2xl:24px;--text-3xl:30px;--text-4xl:36px;--text-5xl:48px;--font-normal:400;--font-medium:500;--font-semibold:600;--font-bold:700;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--tracking-tight:-.025em;--tracking-normal:0;--tracking-wide:.025em;--transition-fast:.15s ease;--transition-base:.2s ease;--transition-slow:.3s ease;--z-dropdown:100;--z-sticky:200;--z-fixed:300;--z-floating-panel:9999;--z-modal-backdrop:10000;--z-modal:10050;--z-popover:10100;--z-tooltip:10150}:root[data-theme=minimal]{--brand-50:0 0% 98%;--brand-100:0 0% 96%;--brand-200:0 0% 90%;--brand-300:0 0% 80%;--brand-400:0 0% 64%;--brand-500:0 0% 9%;--brand-600:0 0% 5%;--brand-700:0 0% 0%;--brand-800:0 0% 4%;--brand-900:0 0% 2%;--gray-50:0 0% 100%;--gray-100:0 0% 98%;--gray-200:0 0% 96%;--gray-300:0 0% 90%;--gray-400:0 0% 74%;--gray-500:0 0% 45%;--gray-600:0 0% 32%;--gray-700:0 0% 20%;--gray-800:0 0% 9%;--gray-900:0 0% 4%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:0 0% 96%;--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:0 0% 100%;--card-foreground:var(--gray-800);--card-border:0 0% 90%;--popover:0 0% 100%;--popover-foreground:var(--gray-800);--border:0 0% 90%;--border-hover:0 0% 81%;--border-active:var(--brand-500);--input:0 0% 100%;--input-border:0 0% 90%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #00000008;--shadow-sm:0 1px 3px 0 #0000000d, 0 1px 2px -1px #0000000a;--shadow-md:0 4px 6px -1px #0000000d, 0 2px 4px -2px #0000000a;--shadow-lg:0 10px 15px -3px #0000000f, 0 4px 6px -4px #0000000a;--shadow-xl:0 20px 25px -5px #00000014, 0 8px 10px -6px #0000000a;--shadow-2xl:0 25px 50px -12px #00000024;--shadow-card:0 0 8px 0 #0000000a;--shadow-card-hover:0 0 16px 0 #0000000f}:root[data-theme=work]{--brand-50:0 0% 97%;--brand-100:0 0% 94%;--brand-200:0 0% 88%;--brand-300:0 0% 78%;--brand-400:0 0% 58%;--brand-500:0 0% 23%;--brand-600:0 0% 18%;--brand-700:0 0% 12%;--brand-800:0 0% 7%;--brand-900:0 0% 4%;--gray-50:0 0% 100%;--gray-100:0 0% 95%;--gray-200:0 0% 90%;--gray-300:0 0% 84%;--gray-400:0 0% 70%;--gray-500:0 0% 46%;--gray-600:0 0% 34%;--gray-700:0 0% 28%;--gray-800:0 0% 13%;--gray-900:0 0% 7%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--primary-foreground:0 0% 100%;--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:var(--gray-200);--accent-foreground:var(--gray-800);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:0 0% 100%;--card-foreground:var(--gray-800);--card-border:var(--gray-200);--popover:0 0% 100%;--popover-foreground:var(--gray-800);--border:var(--gray-200);--border-hover:var(--gray-300);--border-active:var(--gray-600);--input:0 0% 100%;--input-border:var(--gray-200);--input-focus:var(--gray-600);--ring:var(--gray-600);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #14181c08;--shadow-sm:0 1px 3px 0 #14181c0d, 0 1px 2px -1px #14181c0a;--shadow-md:0 4px 6px -1px #14181c0d, 0 2px 4px -2px #14181c0a;--shadow-lg:0 10px 15px -3px #14181c0f, 0 4px 6px -4px #14181c0a;--shadow-xl:0 20px 25px -5px #14181c14, 0 8px 10px -6px #14181c0a;--shadow-2xl:0 25px 50px -12px #14181c24;--shadow-card:0 0 8px 0 #14181c0a;--shadow-card-hover:0 0 16px 0 #14181c0f}:root[data-theme=warm]{--brand-50:36 35% 94%;--brand-100:35 32% 90%;--brand-200:34 26% 82%;--brand-300:32 20% 70%;--brand-400:30 16% 56%;--brand-500:28 15% 42%;--brand-600:27 16% 34%;--brand-700:25 18% 28%;--brand-800:24 20% 20%;--brand-900:23 24% 13%;--gray-50:40 38% 97%;--gray-100:39 30% 94%;--gray-200:36 24% 87%;--gray-300:34 18% 78%;--gray-400:32 10% 60%;--gray-500:30 9% 46%;--gray-600:28 10% 36%;--gray-700:26 14% 27%;--gray-800:24 18% 18%;--gray-900:22 24% 11%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:38 30% 91%;--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:40 48% 98%;--card-foreground:var(--gray-800);--card-border:34 22% 84%;--popover:40 48% 98%;--popover-foreground:var(--gray-800);--border:34 22% 84%;--border-hover:32 20% 73%;--border-active:var(--brand-500);--input:40 48% 98%;--input-border:34 22% 84%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #1e140a0a;--shadow-sm:0 1px 3px 0 #1e140a0f, 0 1px 2px -1px #1e140a0a;--shadow-md:0 4px 6px -1px #1e140a0f, 0 2px 4px -2px #1e140a0a;--shadow-lg:0 10px 15px -3px #1e140a0f, 0 4px 6px -4px #1e140a0a;--shadow-xl:0 20px 25px -5px #1e140a14, 0 8px 10px -6px #1e140a0a;--shadow-2xl:0 25px 50px -12px #1e140a26}:root[data-theme=cool]{--brand-50:210 48% 96%;--brand-100:211 42% 92%;--brand-200:212 36% 84%;--brand-300:212 32% 72%;--brand-400:213 30% 60%;--brand-500:214 35% 48%;--brand-600:214 36% 42%;--brand-700:215 38% 34%;--brand-800:216 40% 26%;--brand-900:218 42% 18%;--gray-50:210 32% 98%;--gray-100:210 24% 96%;--gray-200:214 18% 90%;--gray-300:216 14% 82%;--gray-400:218 11% 65%;--gray-500:220 9% 46%;--gray-600:215 14% 34%;--gray-700:217 19% 27%;--gray-800:220 26% 18%;--gray-900:224 39% 11%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:var(--brand-50);--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:210 36% 99%;--card-foreground:var(--gray-800);--card-border:214 22% 87%;--popover:210 36% 99%;--popover-foreground:var(--gray-800);--border:214 22% 87%;--border-hover:215 17% 76%;--border-active:var(--brand-500);--input:210 36% 99%;--input-border:214 22% 87%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #0f172a0a;--shadow-sm:0 1px 3px 0 #0f172a0f, 0 1px 2px -1px #0f172a0a;--shadow-md:0 4px 6px -1px #0f172a0f, 0 2px 4px -2px #0f172a0a;--shadow-lg:0 10px 15px -3px #0f172a0f, 0 4px 6px -4px #0f172a0a;--shadow-xl:0 20px 25px -5px #0f172a14, 0 8px 10px -6px #0f172a0a;--shadow-2xl:0 25px 50px -12px #0f172a24}:root[data-theme=dawn]{--brand-50:352 34% 96%;--brand-100:352 30% 92%;--brand-200:352 25% 84%;--brand-300:352 22% 72%;--brand-400:351 22% 58%;--brand-500:350 24% 46%;--brand-600:350 25% 39%;--brand-700:349 26% 32%;--brand-800:348 28% 24%;--brand-900:347 30% 16%;--gray-50:24 38% 97%;--gray-100:20 30% 94%;--gray-200:18 22% 87%;--gray-300:17 18% 78%;--gray-400:16 10% 60%;--gray-500:15 9% 46%;--gray-600:12 10% 36%;--gray-700:10 13% 27%;--gray-800:8 16% 18%;--gray-900:6 20% 11%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:352 34% 94%;--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:24 48% 98%;--card-foreground:var(--gray-800);--card-border:18 22% 84%;--popover:24 48% 98%;--popover-foreground:var(--gray-800);--border:18 22% 84%;--border-hover:16 20% 74%;--border-active:var(--brand-500);--input:24 48% 98%;--input-border:18 22% 84%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #4028240a;--shadow-sm:0 1px 3px 0 #4028240f, 0 1px 2px -1px #4028240a;--shadow-md:0 4px 6px -1px #4028240f, 0 2px 4px -2px #4028240a;--shadow-lg:0 10px 15px -3px #4028240f, 0 4px 6px -4px #4028240a;--shadow-xl:0 20px 25px -5px #40282414, 0 8px 10px -6px #4028240a;--shadow-2xl:0 25px 50px -12px #40282424}:root[data-theme=graphite]{--brand-50:220 12% 95%;--brand-100:220 10% 91%;--brand-200:220 9% 84%;--brand-300:220 8% 72%;--brand-400:220 7% 58%;--brand-500:220 9% 39%;--brand-600:220 10% 32%;--brand-700:220 12% 25%;--brand-800:220 14% 18%;--brand-900:220 18% 11%;--gray-50:48 10% 97%;--gray-100:45 8% 94%;--gray-200:42 7% 87%;--gray-300:38 6% 78%;--gray-400:34 5% 60%;--gray-500:30 4% 46%;--gray-600:28 5% 36%;--gray-700:25 7% 27%;--gray-800:220 11% 18%;--gray-900:220 18% 11%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:220 12% 92%;--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:48 13% 99%;--card-foreground:var(--gray-800);--card-border:42 7% 84%;--popover:48 13% 99%;--popover-foreground:var(--gray-800);--border:42 7% 84%;--border-hover:38 6% 74%;--border-active:var(--brand-500);--input:48 13% 99%;--input-border:42 7% 84%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #181a1f0a;--shadow-sm:0 1px 3px 0 #181a1f0f, 0 1px 2px -1px #181a1f0a;--shadow-md:0 4px 6px -1px #181a1f0f, 0 2px 4px -2px #181a1f0a;--shadow-lg:0 10px 15px -3px #181a1f0f, 0 4px 6px -4px #181a1f0a;--shadow-xl:0 20px 25px -5px #181a1f14, 0 8px 10px -6px #181a1f0a;--shadow-2xl:0 25px 50px -12px #181a1f24}:root[data-theme=night]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--brand-50:148 36% 91%;--brand-100:148 34% 84%;--brand-200:149 32% 72%;--brand-300:149 33% 60%;--brand-400:150 36% 52%;--brand-500:150 42% 46%;--brand-600:150 46% 38%;--brand-700:151 48% 30%;--brand-800:152 48% 22%;--brand-900:153 46% 15%;--gray-50:220 18% 8%;--gray-100:220 16% 11%;--gray-200:219 14% 16%;--gray-300:218 12% 24%;--gray-400:215 10% 46%;--gray-500:213 12% 62%;--gray-600:212 16% 74%;--gray-700:43 22% 82%;--gray-800:44 32% 90%;--gray-900:44 40% 96%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-400);--primary-hover:var(--brand-300);--primary-active:var(--brand-200);--primary-foreground:220 18% 8%;--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:151 32% 18%;--accent-foreground:148 34% 84%;--muted:var(--gray-100);--muted-foreground:var(--gray-500);--destructive:0 70% 52%;--destructive-foreground:0 0% 100%;--success:150 46% 44%;--success-foreground:220 18% 8%;--warning:42 82% 58%;--warning-foreground:220 18% 8%;--card:220 16% 10%;--card-foreground:var(--gray-800);--card-border:218 13% 20%;--popover:220 16% 10%;--popover-foreground:var(--gray-800);--border:218 13% 20%;--border-hover:218 12% 30%;--border-active:var(--brand-400);--input:220 16% 12%;--input-border:218 13% 24%;--input-focus:var(--brand-400);--ring:var(--brand-400);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #00000047;--shadow-sm:0 1px 3px 0 #00000057, 0 1px 2px -1px #0000004d;--shadow-md:0 8px 18px -10px #0000006b, 0 4px 8px -6px #00000057;--shadow-lg:0 16px 28px -16px #0000007a, 0 8px 14px -10px #00000061;--shadow-xl:0 24px 40px -20px #0000008f, 0 10px 18px -12px #0000006b;--shadow-2xl:0 32px 60px -24px #000000a6;--shadow-card:0 0 0 1px hsl(var(--border) / .82), 0 18px 48px -34px #000000b8;--shadow-card-hover:0 0 0 1px hsl(var(--border-hover) / .88), 0 24px 60px -36px #000000d1}:root[data-theme=probe]{--brand-50:210 16% 95%;--brand-100:210 14% 90%;--brand-200:210 12% 82%;--brand-300:210 11% 70%;--brand-400:210 12% 52%;--brand-500:210 14% 22%;--brand-600:210 16% 18%;--brand-700:210 18% 15%;--brand-800:210 20% 12%;--brand-900:210 24% 9%;--gray-50:42 83% 98%;--gray-100:41 80% 96%;--gray-200:38 48% 92%;--gray-300:38 24% 78%;--gray-400:180 2% 52%;--gray-500:213 6% 45%;--gray-600:213 6% 36%;--gray-700:213 6% 30%;--gray-800:207 28% 19%;--gray-900:210 30% 12%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:210 16% 92%;--accent-foreground:var(--brand-700);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--card:41 80% 96%;--card-foreground:var(--gray-800);--card-border:38 26% 82%;--popover:42 83% 98%;--popover-foreground:var(--gray-800);--border:38 26% 82%;--border-hover:210 14% 72%;--border-active:var(--brand-500);--input:42 83% 98%;--input-border:38 26% 82%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #22313d0a;--shadow-sm:0 1px 3px 0 #22313d0f, 0 1px 2px -1px #22313d0a;--shadow-md:0 4px 6px -1px #22313d0f, 0 2px 4px -2px #22313d0a;--shadow-lg:0 10px 15px -3px #22313d0f, 0 4px 6px -4px #22313d0a;--shadow-xl:0 20px 25px -5px #22313d14, 0 8px 10px -6px #22313d0a;--shadow-2xl:0 25px 50px -12px #22313d24}:root[data-theme-appearance=dark]{--shadow-popover:0 8px 32px -8px #0006, 0 2px 8px -2px #0000003d;--link-foreground:213 94% 68%;--link-foreground-hover:213 97% 79%}:root[data-theme=charcoal]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--brand-50:203 70% 94%;--brand-100:203 68% 86%;--brand-200:203 66% 76%;--brand-300:202 70% 65%;--brand-400:201 76% 55%;--brand-500:201 78% 48%;--brand-600:202 79% 41%;--brand-700:203 76% 34%;--brand-800:204 70% 26%;--brand-900:205 62% 18%;--gray-50:0 0% 11%;--gray-100:0 0% 13%;--gray-200:0 0% 17%;--gray-300:0 0% 24%;--gray-400:0 0% 42%;--gray-500:0 0% 60%;--gray-600:0 0% 72%;--gray-700:0 0% 80%;--gray-800:0 0% 88%;--gray-900:0 0% 96%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--primary:var(--brand-400);--primary-hover:var(--brand-300);--primary-active:var(--brand-200);--primary-foreground:var(--gray-50);--secondary:var(--gray-100);--secondary-hover:var(--gray-200);--secondary-foreground:var(--gray-800);--accent:0 0% 19%;--accent-foreground:var(--gray-900);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--destructive:0 72% 60%;--destructive-foreground:0 0% 100%;--success:145 58% 48%;--success-foreground:var(--gray-50);--warning:40 88% 60%;--warning-foreground:var(--gray-50);--card:0 0% 15%;--card-foreground:var(--gray-800);--card-border:0 0% 24%;--popover:0 0% 15%;--popover-foreground:var(--gray-800);--border:0 0% 24%;--border-hover:0 0% 32%;--border-active:var(--brand-400);--input:0 0% 16%;--input-border:0 0% 26%;--input-focus:var(--brand-400);--ring:var(--brand-400);--ring-offset:var(--gray-50);--shadow-xs:0 1px 2px 0 #00000029;--shadow-sm:0 1px 3px 0 #0003, 0 1px 2px -1px #00000029;--shadow-md:0 8px 18px -12px #00000057, 0 4px 8px -6px #00000038;--shadow-lg:0 16px 30px -18px #0006, 0 8px 14px -10px #00000047;--shadow-xl:0 24px 42px -22px #00000075, 0 10px 18px -12px #0000004d;--shadow-2xl:0 32px 60px -26px #0000008a;--shadow-card:0 0 0 1px hsl(var(--border) / .72), 0 16px 40px -32px #00000080;--shadow-card-hover:0 0 0 1px hsl(var(--border-hover) / .78), 0 22px 50px -34px #00000094}:root[data-theme=island]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--brand-50:152 38% 94%;--brand-100:153 36% 88%;--brand-200:154 34% 79%;--brand-300:155 35% 66%;--brand-400:156 39% 49%;--brand-500:157 50% 34%;--brand-600:158 53% 28%;--brand-700:159 55% 22%;--brand-800:160 52% 17%;--brand-900:162 48% 12%;--gray-50:45 48% 93%;--gray-100:44 38% 89%;--gray-200:42 32% 84%;--gray-300:40 22% 74%;--gray-400:75 8% 56%;--gray-500:104 8% 43%;--gray-600:128 10% 32%;--gray-700:142 14% 24%;--gray-800:68 16% 22%;--gray-900:160 25% 11%;--background:var(--gray-50);--background-secondary:var(--gray-100);--background-tertiary:var(--gray-200);--foreground:var(--gray-800);--foreground-secondary:var(--gray-700);--foreground-tertiary:var(--gray-500);--foreground-muted:var(--gray-400);--link-foreground:158 58% 28%;--link-foreground-hover:160 62% 20%;--primary:var(--brand-500);--primary-hover:var(--brand-600);--primary-active:var(--brand-700);--primary-foreground:45 67% 97%;--secondary:var(--gray-100);--secondary-hover:151 25% 86%;--secondary-foreground:var(--gray-800);--accent:151 28% 88%;--accent-foreground:var(--brand-800);--muted:var(--gray-100);--muted-foreground:var(--gray-500);--destructive:5 61% 47%;--destructive-foreground:45 67% 97%;--success:157 50% 34%;--success-foreground:45 67% 97%;--warning:35 74% 45%;--warning-foreground:160 25% 11%;--card:45 46% 93%;--card-foreground:var(--gray-800);--card-border:40 28% 78%;--popover:45 46% 95%;--popover-foreground:var(--gray-800);--border:40 27% 78%;--border-hover:150 18% 62%;--border-active:var(--brand-500);--input:45 44% 94%;--input-border:40 27% 78%;--input-focus:var(--brand-500);--ring:var(--brand-500);--ring-offset:var(--gray-50);--radius:.4rem;--radius-sm:3px;--radius-md:5px;--radius-lg:7px;--radius-xl:10px;--radius-2xl:14px;--radius-3xl:18px;--font-sans:"American Typewriter", "Courier New", "Noto Sans Mono", monospace;--font-mono:"American Typewriter", "Courier New", "Noto Sans Mono", monospace;--island-font-display:"American Typewriter", "Hannotate SC", "HanziPen SC", "Kaiti SC", STKaiti, KaiTi, serif;--shadow-xs:0 1px 2px #2c39240d;--shadow-sm:0 1px 3px #2c392412, 0 1px 2px -1px #2c39240f;--shadow-md:0 8px 20px -14px #23432f47, 0 3px 8px -6px #5241252e;--shadow-lg:0 16px 32px -20px #23432f52, 0 7px 14px -10px #52412533;--shadow-xl:0 24px 44px -26px #23432f5c;--shadow-2xl:0 30px 56px -30px #23432f66;--shadow-card:0 0 0 1px hsl(var(--border) / .46), 0 14px 34px -28px #2a4b346b;--shadow-card-hover:0 0 0 1px hsl(var(--border-hover) / .62), 0 18px 42px -28px #2a4b3480}:root[data-theme=island] ::selection{color:hsl(var(--gray-900));background:#8bd0b385}:root{--radius:.75rem}*{border-color:hsl(var(--border))}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}:root[data-theme=island] [data-theme-surface=workspace-panel] :is(.bg-white,body),:root[data-theme=island] [data-theme-surface=doc-browser] :is(.bg-white,body),:root[data-theme=island] :is([data-theme-surface=navigation],[data-theme-surface=header]) :is(.bg-secondary,body){background-color:#0000}body{font-family:var(--font-sans);overflow:hidden}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fixed{position:fixed}.absolute{position:absolute}.inset-0{inset:0}.left-\[50\%\]{left:50%}.right-1{right:.25rem}.top-1{top:.25rem}.top-\[50\%\]{top:50%}.z-\[var\(--z-modal\,10050\)\]{z-index:var(--z-modal,10050)}.z-\[var\(--z-modal-backdrop\,10000\)\]{z-index:var(--z-modal-backdrop,10000)}.mx-auto{margin-left:auto;margin-right:auto}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-64{max-height:16rem}.max-h-\[calc\(100dvh-1\.5rem\)\]{max-height:calc(100dvh - 1.5rem)}.min-h-0{min-height:0}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-\[5rem_minmax\(0\,1fr\)\]{grid-template-columns:5rem minmax(0,1fr)}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) + 8px)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-0{border-width:0}.border-border{border-color:hsl(var(--border))}.border-border\/75{border-color:hsl(var(--border) / .75)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-background{background-color:hsl(var(--background))}.bg-black\/40{background-color:#0006}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/60{background-color:hsl(var(--muted) / .6)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.p-3{padding:.75rem}.p-6{padding:1.5rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pr-7{padding-right:1.75rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[0\.24em\]{letter-spacing:.24em}.tracking-tight{letter-spacing:-.025em}.text-amber-600{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.text-amber-700{--tw-text-opacity:1;color:rgb(180 83 9/var(--tw-text-opacity,1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-800{color:hsl(var(--gray-800))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.underline-offset-4{text-underline-offset:4px}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-card{--tw-shadow:var(--shadow-card);--tw-shadow-colored:var(--shadow-card);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-card-hover{--tw-shadow:var(--shadow-card-hover);--tw-shadow-colored:var(--shadow-card-hover);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-card{--tw-shadow-color:hsl(var(--card));--tw-shadow:var(--tw-shadow-colored)}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-base{transition-duration:.2s}.duration-fast{transition-duration:.15s}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0), var(--tw-enter-translate-y,0), 0) scale3d(var(--tw-enter-scale,1), var(--tw-enter-scale,1), var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0), var(--tw-exit-translate-y,0), 0) scale3d(var(--tw-exit-scale,1), var(--tw-exit-scale,1), var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.duration-base{animation-duration:.2s}.duration-fast{animation-duration:.15s}.text-gray-500{color:hsl(var(--gray-500))}.shadow-card{box-shadow:var(--shadow-card)}.shadow-card-hover{box-shadow:var(--shadow-card-hover)}:is([data-theme-decoration=island-paper],[data-theme-decoration=island-palm]){display:none}:root[data-theme=island] [data-theme-surface=app-shell]{isolation:isolate;background-color:hsl(var(--background));font-variant-ligatures:none;letter-spacing:.006em;text-shadow:.022em 0 #2a554b0e,-.016em 0 #7c583c0d;background-image:none;position:relative}:root[data-theme=island] [data-theme-decoration=island-paper]{opacity:.94;pointer-events:none;z-index:0;background:url(/themes/island/island-atmosphere-7a037243.webp) top/cover no-repeat;display:block;position:absolute;inset:0}:root[data-theme=island] [data-theme-decoration=island-palm]{opacity:1;pointer-events:none;z-index:0;display:block;position:absolute;inset:0}:root[data-theme=island] [data-theme-decoration=island-palm] [data-island-palm-part]{clip-path:polygon(46% 0,100% 0,100% 61%,62% 55%);will-change:filter;background:url(/themes/island/island-atmosphere-7a037243.webp) top/cover no-repeat;position:absolute;inset:0;-webkit-mask-image:radial-gradient(at 88% 17%,#000 0 43%,#000000db 51%,#0000 72%);mask-image:radial-gradient(at 88% 17%,#000 0 43%,#000000db 51%,#0000 72%)}:root[data-theme=island] [data-theme-decoration=island-palm] [data-island-palm-part=frond-wind]{filter:url(#island-wind-filter);opacity:1}:root[data-theme=island] [data-theme-surface=navigation]{border-right:1px solid hsl(var(--border) / .56);background:0 0}:root[data-theme=island] :is([data-theme-surface=workspace],[data-theme-surface=settings-workspace]){background:0 0}:root[data-theme=island] [data-theme-surface=utility-rail]{border-color:hsl(var(--border) / .58);background:0 0}:root[data-theme=island] :is([data-theme-surface=workspace-panel],[data-theme-surface=doc-browser]){-webkit-backdrop-filter:none;backdrop-filter:none;border-color:hsl(var(--border) / .54);background-color:#0000}:root[data-theme=island] [data-theme-surface=workspace-panel] :is(.bg-white,.bg-background),:root[data-theme=island] [data-theme-surface=doc-browser] :is(.bg-white,.bg-background){background-color:#0000}:root[data-theme=island] [data-theme-surface=workspace-panel] :is(.bg-card,.bg-muted){background-color:hsl(var(--card) / .52)}:root[data-theme=island] [data-theme-surface=doc-browser] .bg-card{background-color:hsl(var(--card) / .22)}:root[data-theme=island] [data-theme-surface=doc-browser] .bg-muted{background-color:hsl(var(--card) / .28)}:root[data-theme=island] [data-theme-surface=workspace-explorer]{background-color:hsl(var(--card) / .16);border-color:hsl(var(--border) / .48)}:root[data-theme=island] [data-theme-surface=workspace-panel] :is([data-file-code-surface=true],[data-file-code-canvas=true]),:root[data-theme=island] [data-theme-surface=workspace-panel] [data-file-code-canvas=true]>.bg-card,:root[data-theme=island] [data-theme-surface=workspace-panel] [data-file-code-row=true].bg-card{background-color:#0000}:root[data-theme=island] [data-theme-surface=workspace-panel] [data-file-code-gutter=true] :is([data-file-line-number-cell=true].bg-muted,.bg-muted){background-color:hsl(var(--card) / .12)}:root[data-theme=island] [data-theme-surface=workspace-panel] [data-file-target-line=true] [data-file-code-row=true],:root[data-theme=island] [data-theme-surface=workspace-panel] [data-file-line-number-cell=true][aria-current=location]{background-color:hsl(var(--brand-200) / .28)}:root[data-theme=island] :is([data-theme-overlay=popover],[data-theme-overlay=menu],[data-theme-overlay=select],.bg-popover,[role=menu].bg-popover,[role=listbox].bg-popover){-webkit-backdrop-filter:blur(18px)saturate(.9);backdrop-filter:blur(18px)saturate(.9);background-color:hsl(var(--popover) / .9);border-color:hsl(var(--border) / .4);box-shadow:var(--shadow-popover)}:root[data-theme=island] [data-theme-overlay=tooltip]{-webkit-backdrop-filter:blur(14px)saturate(.9);backdrop-filter:blur(14px)saturate(.9);background-color:hsl(var(--popover) / .94);border-color:hsl(var(--border) / .72);box-shadow:0 10px 24px -18px #2541376b}:root[data-theme=island] :is([data-theme-overlay=dialog],[data-theme-overlay=sheet]){-webkit-backdrop-filter:blur(24px)saturate(.88);backdrop-filter:blur(24px)saturate(.88);background-color:hsl(var(--popover) / .94);border-color:hsl(var(--border) / .72);box-shadow:0 32px 80px -32px #1e392f94}:root[data-theme=island] [data-theme-overlay=modal-backdrop]{-webkit-backdrop-filter:blur(3px)saturate(.82);backdrop-filter:blur(3px)saturate(.82);background-color:#20322b3d}:root[data-theme=island] [data-theme-surface=app-shell] :is(h1,h2,h3,button,[role=tab],[aria-current=page]){font-family:var(--island-font-display);letter-spacing:.025em}:root[data-theme=island] [data-theme-surface=header]{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:#0000;background-image:none}:root[data-theme=island] :is([data-theme-surface=navigation],[data-theme-surface=header]) :is(.bg-secondary,.bg-background){background-color:#0000}:root[data-theme=island] [data-theme-control=chat-search]{background-color:#0000;border:1px solid #0000}:root[data-theme=island] [data-theme-control=chat-search]:hover{background-color:hsl(var(--background) / .22)}:root[data-theme=island] [data-theme-control=chat-search]:focus{background-color:hsl(var(--background) / .28);border-color:hsl(var(--brand-500) / .58)}:root[data-theme=island] [data-theme-control=process-icon].bg-card{color:hsl(var(--brand-700) / .82);background-color:#0000}:root[data-theme=island] [data-reasoning-scroll=true]{border-left:1px solid hsl(var(--brand-600) / .28);background-color:#0000;border-radius:0}@media (width<=760px){:root[data-theme=island] [data-theme-surface=app-shell]{background-image:none}:root[data-theme=island] [data-theme-decoration=island-palm]{inset:0}}@media (prefers-reduced-motion:reduce){:root[data-theme=island] .chat-markdown[data-stream-phase]{animation:none}:root[data-theme=island] [data-theme-decoration=island-palm] [data-island-palm-part]{display:none}}.file\:border-0::file-selector-button{border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:font-normal::placeholder{font-weight:400}.placeholder\:text-muted-foreground\/55::placeholder{color:hsl(var(--muted-foreground) / .55)}.hover\:border-primary\/25:hover{border-color:hsl(var(--primary) / .25)}.hover\:bg-\[hsl\(var\(--primary-hover\)\)\]:hover{background-color:hsl(var(--primary-hover))}.hover\:bg-\[var\(--interaction-hover\)\]:hover{background-color:var(--interaction-hover)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-card-hover:hover{--tw-shadow:var(--shadow-card-hover);--tw-shadow-colored:var(--shadow-card-hover);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow);box-shadow:var(--shadow-card-hover)}.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus-visible\:outline-none:focus-visible{outline-offset:2px;outline:2px solid #0000}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-border:focus-visible{--tw-ring-color:hsl(var(--border))}.active\:bg-\[hsl\(var\(--primary-active\)\)\]:active{background-color:hsl(var(--primary-active))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}@media not all and (width>=768px){.max-md\:max-h-\[calc\(100dvh-env\(safe-area-inset-top\,0px\)-env\(safe-area-inset-bottom\,0px\)-1\.5rem\)\]{max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 1.5rem)}.max-md\:min-h-0{min-height:0}.max-md\:min-h-\[var\(--control-touch-size\)\]{min-height:var(--control-touch-size)}.max-md\:max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-md\:text-\[13px\]{font-size:13px}.max-md\:text-base{font-size:1rem;line-height:1.5rem}}@media (width>=640px){.sm\:right-4{right:1rem}.sm\:top-4{top:1rem}.sm\:h-6{height:1.5rem}.sm\:w-6{width:1.5rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:gap-0{gap:0}.sm\:gap-3{gap:.75rem}}.\[\&\>\:last-child\]\:hidden>:last-child{display:none}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-page-
|
|
2
|
-
import{i as e}from"./chunk-DF37yw5_.js";import{t}from"./client-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-page-DKId3By8.js","assets/login-page-BT3GV3Sb.js","assets/chunk-DF37yw5_.js","assets/api-BZvNpFOS.js","assets/i18n-OGmF0Ws_.js","assets/preload-helper-ca-nBW7U.js","assets/card-CdRBL1E0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{t}from"./client-DKKbdJ6Q.js";import{Ht as n,Kn as r,Vt as i,cr as a,or as o,qn as s,yr as c}from"./api-BZvNpFOS.js";import{t as l}from"./preload-helper-ca-nBW7U.js";import{c as u,l as d,s as f,t as p,x as m}from"./theme-provider-BjF1Eowc.js";import{a as h,s as g}from"./i18n-OGmF0Ws_.js";var _=e(c(),1),v=t(),y=a(),b=(0,_.lazy)(async()=>({default:(await l(async()=>{let{LoginPage:e}=await import(`./login-page-DKId3By8.js`);return{LoginPage:e}},__vite__mapDeps([0,1,2,3,4,5,6]))).LoginPage})),x=/^\/apps\/panel\/([^/]+)\/standalone\/?$/;function S(e){let t=x.exec(e);if(!t)return null;try{return decodeURIComponent(t[1])}catch{return null}}function C({appId:e}){let t=n(),r=t.isError&&i(t.error);return t.isLoading&&!t.isError||r||t.isError?(0,y.jsx)(u,{appId:e}):t.data?.enabled&&!t.data.authenticated?(0,y.jsx)(_.Suspense,{fallback:(0,y.jsx)(w,{message:g(`loading`)}),children:(0,y.jsx)(b,{username:t.data.username})}):(0,y.jsx)(u,{appId:e})}function w({message:e}){return(0,y.jsx)(`main`,{className:`flex h-dvh items-center justify-center bg-background px-6 text-sm text-muted-foreground`,children:e})}function T({pathname:e=window.location.pathname}){let t=S(e);return t?(0,y.jsx)(o,{client:r,children:(0,y.jsxs)(m,{children:[(0,y.jsx)(C,{appId:t}),(0,y.jsx)(f,{}),(0,y.jsx)(s,{position:`top-right`,richColors:!0,offset:16})]})}):(0,y.jsx)(w,{message:g(`panelAppsMainUnavailable`)})}await h();var E=document.getElementById(`root`);E&&(0,v.createRoot)(E).render((0,y.jsx)(_.StrictMode,{children:(0,y.jsx)(p,{children:(0,y.jsx)(d,{children:(0,y.jsx)(T,{})})})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jt as e,Kt as t,Qt as n,Ut as r,cr as i,qt as a}from"./api-
|
|
1
|
+
import{Jt as e,Kt as t,Qt as n,Ut as r,cr as i,qt as a}from"./api-BZvNpFOS.js";import{a as o,i as s,n as c,r as l,t as u}from"./select-Y9IEbx9x.js";import{s as d}from"./i18n-OGmF0Ws_.js";import{t as f,u as p,v as m}from"./use-config-BM5jC65L.js";var h=i();function g(){let i=f(),g=p(),v=m(),y=i.data?.productAnalytics.enabled??!0,b=i.data?.productAnalytics.audience??`external`,x=e=>{v.mutate({data:{enabled:e}})},S=e=>{let t=e;v.mutate({data:{audience:t}})};return(0,h.jsxs)(n,{title:d(`privacyPageTitle`),description:d(`privacyPageDescription`),children:[(0,h.jsx)(e,{title:d(`productAnalyticsSectionTitle`),description:d(`productAnalyticsSectionDescription`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(t,{title:d(`productAnalyticsEnabledTitle`),description:d(`productAnalyticsEnabledDescription`),control:(0,h.jsx)(r,{"aria-label":d(`productAnalyticsEnabledTitle`),checked:y,disabled:i.isLoading||v.isPending,onCheckedChange:x})}),(0,h.jsx)(t,{title:d(`productAnalyticsAudienceTitle`),description:d(`productAnalyticsAudienceDescription`),control:(0,h.jsxs)(u,{value:b,onValueChange:S,disabled:i.isLoading||v.isPending,children:[(0,h.jsx)(s,{"aria-label":d(`productAnalyticsAudienceTitle`),className:`w-40 sm:w-48`,children:(0,h.jsx)(o,{})}),(0,h.jsxs)(c,{children:[(0,h.jsx)(l,{value:`external`,children:d(`productAnalyticsAudienceExternal`)}),(0,h.jsx)(l,{value:`internal`,children:d(`productAnalyticsAudienceInternal`)}),(0,h.jsx)(l,{value:`qa`,children:d(`productAnalyticsAudienceQa`)})]})]})})]})}),(0,h.jsx)(e,{title:d(`productAnalyticsDataTitle`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(t,{layout:`stacked`,title:d(`productAnalyticsCollectedTitle`),description:d(`productAnalyticsCollectedDescription`)}),(0,h.jsx)(t,{layout:`stacked`,title:d(`productAnalyticsExcludedTitle`),description:d(`productAnalyticsExcludedDescription`)}),(0,h.jsx)(t,{layout:`stacked`,title:d(`productAnalyticsAnonymousTitle`),description:d(`productAnalyticsAnonymousDescription`)})]})}),(0,h.jsx)(e,{title:d(`productAnalyticsStatusSectionTitle`),children:(0,h.jsxs)(a,{children:[(0,h.jsx)(t,{layout:`stacked`,title:d(`productAnalyticsStatusTitle`),description:_(g.data,g.isLoading)}),g.data?.lastError?(0,h.jsx)(t,{layout:`stacked`,title:d(`productAnalyticsLastErrorTitle`),description:g.data.lastError}):null]})})]})}function _(e,t){if(t)return d(`productAnalyticsStatusLoading`);if(!e?.lastAttemptAt)return d(`productAnalyticsStatusNever`);let n=new Date(e.lastAttemptAt).toLocaleString();if(!e.lastSuccessAt)return`${d(`productAnalyticsLastAttemptLabel`)} ${n} · ${e.pendingReceiptCount} ${d(`productAnalyticsPendingLabel`)}`;let r=new Date(e.lastSuccessAt).toLocaleString();return`${d(`productAnalyticsLastSuccessLabel`)} ${r} · ${e.pendingReceiptCount} ${d(`productAnalyticsPendingLabel`)}`}export{g as PrivacySettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DF37yw5_.js";import{Gn as t,Gt as n,Jn as r,Lt as i,Xn as a,Yn as o,Yt as s,cr as c,sr as l,yr as u}from"./api-DkLJrSCd.js";import{f as d,n as f,p}from"./navigation-link-D3pzNHeA.js";import{$ as m,Bt as h,Ft as g,H as _,Lt as v,Q as y,X as b,Y as ee,Z as x,et as te,f as ne,m as re,pt as S,tt as ie,yt as C}from"./app-presenter-provider-Co8uKOyW.js";import{t as w}from"./createLucideIcon-B4xj2I2g.js";import{t as ae}from"./use-viewport-layout-DdxVnCYc.js";import{C as T,a as E,i as D,n as O,r as k,t as A,w as j}from"./select-6Uq4chZW.js";import{m as oe}from"./context-menu-CRqH2SEk.js";import{t as se}from"./confirm-dialog-10Qb3dpZ.js";import{t as M}from"./circle-dashed-B48a0t6p.js";import{a as ce,i as le,n as ue,r as N}from"./tag-chip-DXHtZ8AS.js";import{n as P,t as F}from"./trash-2-DazgBvmJ.js";import{t as de}from"./settings-2-COvVf1XX.js";import{n as I,r as fe,s as L,t as pe}from"./i18n-OGmF0Ws_.js";import{a as me,i as he,n as ge,o as _e,r as ve,t as R}from"./dialog-BgL3vKJQ.js";import{a as ye,i as be,n as xe,t as Se}from"./card-Bqu8zWLq.js";var Ce=w(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),we=w(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Te=w(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ee=w(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),De=w(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(u(),1),B=c();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(Se,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(be,{className:`p-4 pb-3`,children:(0,B.jsx)(ye,{children:e})}),(0,B.jsx)(xe,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Oe({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:L(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:L(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:L(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:L(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function ke(e,t={}){return h({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ae(e){return a({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await i.projects.getWorkSummary(e)})}function je(e){return a({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await i.projects.listWorkStates(e)})}function Me(e,t={}){return h({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ne(e,t){return a({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.getWorkItem(e,t)})}function Pe(e,t){return a({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=l(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:o({mutationFn:async t=>await i.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:o({mutationFn:async t=>await i.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:o({mutationFn:async t=>await i.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:o({mutationFn:async t=>await i.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:o({mutationFn:async t=>await i.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:o({mutationFn:async t=>await i.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:o({mutationFn:async t=>await i.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:o({mutationFn:async t=>await i.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:o({mutationFn:async t=>await i.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let n=l();(0,z.useEffect)(()=>{if(e)return i.eventBus.on(t.projectWorkChanged,t=>{t.projectId===e&&(n.invalidateQueries({queryKey:W(e)}),n.invalidateQueries({queryKey:G(e)}),n.invalidateQueries({queryKey:K(e)}),n.invalidateQueries({queryKey:q(e)}),t.workItemId&&(n.invalidateQueries({queryKey:J(e,t.workItemId)}),n.invalidateQueries({queryKey:Y(e,t.workItemId)})))})},[e,n])}function Fe(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Ie={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Le(e){return[...e].sort((e,t)=>{let n=Ie[e.category]-Ie[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Re(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return L(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return L(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return L(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?L(`projectsTimeYesterday`):o<7?L(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):pe(e)}var ze=20;function Be({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Me(e,{limit:ze,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[fe(s),` `,L(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:L(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:I(e.createdAt),children:Re(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:L(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?L(`projectsLoading`):L(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?L(`projectsArtifactsNoMatches`):L(`projectsNoArtifacts`)})]})}var Ve={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=Ve[e];return n?t?L(n,t):L(n):e}function He({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Ae(e),i=ke(e,{limit:5}),a=Me(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,"aria-label":L(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:L(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?L(`projectsLoadFailed`):L(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:L(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:L(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:I(e.createdAt),children:` · ${Re(e.createdAt)}`}),e.exists?``:` · ${L(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsNoRecentArtifacts`)})})]})]})}function Ue({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[fe(e.length),` `,L(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`relative group/page-row rounded-xl border border-border/60 transition-colors hover:border-border hover:bg-[var(--interaction-hover)] focus-within:bg-[var(--interaction-hover)] has-[[data-context-menu-open]]:bg-[var(--interaction-hover)]`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`w-full min-w-0 rounded-xl p-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`pr-7 text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]}),(0,B.jsx)(`span`,{className:`absolute right-2 top-2`,children:(0,B.jsx)(ne,{revealOnHover:!0,page:re(`skill`,e.ref,e.name)})})]},e.ref))}):(0,B.jsx)(H,{children:L(`projectsNoSkills`)})]})}function We({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=Ne(n,i),o=Pe(n,i);Z(n);let s=je(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(x,{side:`right`,closeLabel:L(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:L(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ge,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ge({activities:e,item:t,onClose:i,onOpenArtifact:a,states:o}){let c=X(t.projectId),[l,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[h,_]=(0,z.useState)(t.stateId),[v,b]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[ae,T]=(0,z.useState)(!1),j=async(e,t)=>{try{await e(),t?.()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},oe=async()=>{try{await c.updateItem.mutateAsync({workItemId:t.id,patch:{title:l,description:d,stateId:h,attention:v,expectedVersion:t.version}}),r.success(L(`projectsWorkItemSaved`))}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemSaveFailed`))}},M=async()=>{if(x.trim())try{await c.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(te,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(ie,{children:L(`projectsWorkDetails`)}),(0,B.jsx)(ne,{page:re(`project-work`,JSON.stringify([t.projectId,t.id]),t.title)})]}),(0,B.jsxs)(y,{children:[t.id,` · `,L(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkTitle`)}),(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkDescription`)}),(0,B.jsx)(ee,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsStatus`)}),(0,B.jsxs)(A,{value:h,onValueChange:_,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:o.map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkAttention`)}),(0,B.jsxs)(A,{value:v,onValueChange:e=>b(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(k,{value:`none`,children:L(`projectsWorkAttention_none`)}),(0,B.jsx)(k,{value:`blocked`,children:L(`projectsWorkAttention_blocked`)}),(0,B.jsx)(k,{value:`awaiting-user`,children:L(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsWorkUnlinkArtifact`),onClick:()=>void j(()=>c.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(De,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:L(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(n,{value:x,onChange:e=>S(e.target.value),placeholder:L(`projectsWorkArtifactPath`)}),(0,B.jsx)(n,{value:C,onChange:e=>w(e.target.value),placeholder:L(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(s,{variant:`outline`,onClick:()=>void M(),disabled:!x.trim()||c.linkArtifact.isPending,children:[(0,B.jsx)(g,{className:`mr-2 h-4 w-4`}),L(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:L(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(m,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(s,{variant:`outline`,onClick:()=>void j(()=>c.restoreItem.mutateAsync(t.id)),children:L(`projectsRestore`)}):(0,B.jsxs)(s,{variant:`destructive`,onClick:()=>T(!0),children:[(0,B.jsx)(F,{className:`mr-2 h-4 w-4`}),L(`projectsDelete`)]}),(0,B.jsx)(s,{onClick:()=>void oe(),disabled:!l.trim()||c.updateItem.isPending,children:L(`save`)})]}),(0,B.jsx)(se,{open:ae,onOpenChange:T,title:L(`projectsDeleteWorkItem`),description:L(`projectsDeleteWorkItemDescription`),confirmLabel:L(`projectsDelete`),variant:`destructive`,onCancel:()=>T(!1),onConfirm:()=>void j(()=>c.deleteItem.mutateAsync(t.id),i)})]})}var Ke=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function qe({open:e,onOpenChange:t,projectId:i,states:a}){let o=X(i),c=Fe(a),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},v=async()=>{l.trim()&&await _(async()=>{await o.createState.mutateAsync({name:l.trim(),category:d}),u(``)})},y=async(e,t)=>{let n=c[e],r=c[e+t];!n||!r||await _(async()=>{await o.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await o.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{open:e,onOpenChange:t,children:(0,B.jsxs)(ge,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsWorkStateSettings`)}),(0,B.jsx)(ve,{children:L(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{"aria-label":L(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>o.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(A,{value:e.category,onValueChange:t=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(D,{"aria-label":L(`projectsWorkStateCategory`),children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(T,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveDown`),disabled:t===c.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(j,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsDeleteState`),disabled:c.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(F,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),L(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),placeholder:L(`projectsWorkNewState`)}),(0,B.jsxs)(A,{value:d,onValueChange:e=>f(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(s,{onClick:()=>void v(),disabled:!l.trim()||o.createState.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsAdd`)]})]})]})}),(0,B.jsx)(R,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(ge,{children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsDeleteState`)}),(0,B.jsx)(ve,{children:L(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:L(`projectsWorkStateMigration`)}),(0,B.jsxs)(A,{value:h,onValueChange:g,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{placeholder:L(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(O,{children:c.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(he,{children:[(0,B.jsx)(s,{variant:`outline`,onClick:()=>m(null),children:L(`cancel`)}),(0,B.jsx)(s,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await o.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:L(`projectsDelete`)})]})]})})]})}function Je({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(M,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(we,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(v,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function Ye({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:L(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:L(`projectsDeleted`)}):null]})]})}function Xe({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(Ye,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsNoData`)}),e?(0,B.jsx)(s,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:L(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ze({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=ke(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(oe,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(j,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Je,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Xe,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Qe({onOpenWorkItem:e,projectId:t}){let[i,a]=(0,z.useState)(`list`),[o,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1);Z(t);let p=je(t),m=X(t),h=async()=>{if(l.trim())try{let t=await m.createItem.mutateAsync({title:l.trim()});u(``),e(t.id)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)});let g=Fe(p.data??[]),_=Le(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":L(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:L(`projectsWorkNewItem`)}),(0,B.jsxs)(s,{onClick:()=>void h(),disabled:!l.trim()||m.createItem.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":L(`projectsWorkViews`),children:[(0,B.jsxs)(s,{size:`sm`,variant:i===`list`?`secondary`:`ghost`,"aria-pressed":i===`list`,onClick:()=>a(`list`),children:[(0,B.jsx)(Ee,{className:`mr-2 h-4 w-4`}),L(`projectsWorkList`)]}),(0,B.jsxs)(s,{size:`sm`,variant:i===`board`?`secondary`:`ghost`,"aria-pressed":i===`board`,onClick:()=>a(`board`),children:[(0,B.jsx)(Te,{className:`mr-2 h-4 w-4`}),L(`projectsWorkBoard`)]})]}),(0,B.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>f(!0),children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),L(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>c(e.target.checked)}),L(`projectsWorkShowDeleted`)]}),i===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,i===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(qe,{open:d,onOpenChange:f,projectId:t,states:g})]})}var $e=e=>[`project-agreement`,e],et=e=>[`project-skills`,e];function tt(e){return a({queryKey:$e(e??``),enabled:!!e,queryFn:async()=>await i.projects.getAgreement(e)})}function nt(e){return a({queryKey:et(e??``),enabled:!!e,queryFn:async()=>await i.projects.listProjectSkills(e)})}function rt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var it=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function at(){let{projectId:e,tab:t}=p(),n=d(),r=C(),{isMobile:i}=ae(),a=S(),[o,s]=(0,z.useState)(null),c=a.data?.projects??[],l=c.find(t=>t.id===e)??null,u=rt(t)?t:null,f=tt(u===`agreement`?l?.id??null:null),m=nt(u===`skills`?l?.id??null:null);if(a.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(a.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[L(`projectsLoadFailed`),`: `,a.error.message]});if(!c.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsEmpty`)});if(!l||!u)return(0,B.jsxs)(`main`,{className:`space-y-3 p-4 text-sm text-muted-foreground sm:p-6`,children:[(0,B.jsx)(`label`,{htmlFor:`project-home-selection`,className:`block font-medium text-foreground`,children:L(`projectsChoose`)}),(0,B.jsxs)(`select`,{id:`project-home-selection`,value:``,onChange:e=>n(`/projects/${encodeURIComponent(e.target.value)}/overview`),className:`min-h-11 w-full rounded-xl border border-border bg-card px-3 text-base text-foreground`,children:[(0,B.jsx)(`option`,{value:``,disabled:!0,children:L(`projectsChoose`)}),c.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:l.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:l.rootPath})]}),(0,B.jsxs)(ue,{value:u,onValueChange:e=>n(`/projects/${encodeURIComponent(l.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(le,{className:`w-max`,children:it.map(e=>(0,B.jsx)(ce,{value:e,children:L(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(N,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(He,{projectId:l.id,onOpenArtifact:(e,t)=>h(Q(l.rootPath,e),t),onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Qe,{projectId:l.id,onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:l.id,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})}),(0,B.jsx)(N,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ue,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(l.rootPath,e.path),e.name)})}),(0,B.jsx)(N,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Oe,{agreement:f.data,isLoading:f.isLoading,isError:f.isError,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})})]})]})}),(0,B.jsx)(We,{projectId:l.id,projectRoot:l.rootPath,workItemId:o,onOpenChange:e=>{e||s(null)},onOpenArtifact:h}),(0,B.jsx)(_,{layoutMode:i?`mobile`:`desktop`,sessionKey:null,projectRoot:l.rootPath})]})}export{at as ProjectsPage};
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gn as t,Gt as n,Jn as r,Lt as i,Xn as a,Yn as o,Yt as s,cr as c,sr as l,yr as u}from"./api-BZvNpFOS.js";import{f as d,n as f,p}from"./navigation-link-DC-Pku0Y.js";import{$ as m,Bt as h,Ft as g,H as _,Lt as v,Q as y,X as b,Y as ee,Z as x,et as te,f as ne,m as re,pt as S,tt as ie,yt as C}from"./app-presenter-provider-BcYL-VNe.js";import{t as w}from"./createLucideIcon-DE0sB9Nu.js";import{t as ae}from"./use-viewport-layout-vmbQUNT6.js";import{C as T,a as E,i as D,n as O,r as k,t as A,w as j}from"./select-Y9IEbx9x.js";import{m as oe}from"./context-menu-DHVVdHzN.js";import{t as se}from"./confirm-dialog-8vqYZ0wy.js";import{t as M}from"./circle-dashed-HOgt3gIJ.js";import{a as ce,i as le,n as ue,r as N}from"./tag-chip-D-6aPuuh.js";import{n as P,t as F}from"./trash-2-DER2EJKK.js";import{t as de}from"./settings-2-CrGx9_De.js";import{n as I,r as fe,s as L,t as pe}from"./i18n-OGmF0Ws_.js";import{a as me,i as he,n as ge,o as _e,r as ve,t as R}from"./dialog-BUfWO8hr.js";import{a as ye,i as be,n as xe,t as Se}from"./card-CdRBL1E0.js";var Ce=w(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),we=w(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Te=w(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ee=w(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),De=w(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(u(),1),B=c();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(Se,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(be,{className:`p-4 pb-3`,children:(0,B.jsx)(ye,{children:e})}),(0,B.jsx)(xe,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Oe({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:L(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:L(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:L(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:L(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function ke(e,t={}){return h({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ae(e){return a({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await i.projects.getWorkSummary(e)})}function je(e){return a({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await i.projects.listWorkStates(e)})}function Me(e,t={}){return h({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ne(e,t){return a({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.getWorkItem(e,t)})}function Pe(e,t){return a({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=l(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:o({mutationFn:async t=>await i.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:o({mutationFn:async t=>await i.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:o({mutationFn:async t=>await i.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:o({mutationFn:async t=>await i.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:o({mutationFn:async t=>await i.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:o({mutationFn:async t=>await i.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:o({mutationFn:async t=>await i.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:o({mutationFn:async t=>await i.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:o({mutationFn:async t=>await i.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let n=l();(0,z.useEffect)(()=>{if(e)return i.eventBus.on(t.projectWorkChanged,t=>{t.projectId===e&&(n.invalidateQueries({queryKey:W(e)}),n.invalidateQueries({queryKey:G(e)}),n.invalidateQueries({queryKey:K(e)}),n.invalidateQueries({queryKey:q(e)}),t.workItemId&&(n.invalidateQueries({queryKey:J(e,t.workItemId)}),n.invalidateQueries({queryKey:Y(e,t.workItemId)})))})},[e,n])}function Fe(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Ie={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Le(e){return[...e].sort((e,t)=>{let n=Ie[e.category]-Ie[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Re(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return L(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return L(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return L(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?L(`projectsTimeYesterday`):o<7?L(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):pe(e)}var ze=20;function Be({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Me(e,{limit:ze,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[fe(s),` `,L(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:L(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:I(e.createdAt),children:Re(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:L(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?L(`projectsLoading`):L(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?L(`projectsArtifactsNoMatches`):L(`projectsNoArtifacts`)})]})}var Ve={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=Ve[e];return n?t?L(n,t):L(n):e}function He({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Ae(e),i=ke(e,{limit:5}),a=Me(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,"aria-label":L(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:L(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?L(`projectsLoadFailed`):L(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:L(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:L(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:I(e.createdAt),children:` · ${Re(e.createdAt)}`}),e.exists?``:` · ${L(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsNoRecentArtifacts`)})})]})]})}function Ue({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[fe(e.length),` `,L(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`relative group/page-row rounded-xl border border-border/60 transition-colors hover:border-border hover:bg-[var(--interaction-hover)] focus-within:bg-[var(--interaction-hover)] has-[[data-context-menu-open]]:bg-[var(--interaction-hover)]`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`w-full min-w-0 rounded-xl p-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`pr-7 text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]}),(0,B.jsx)(`span`,{className:`absolute right-2 top-2`,children:(0,B.jsx)(ne,{revealOnHover:!0,page:re(`skill`,e.ref,e.name)})})]},e.ref))}):(0,B.jsx)(H,{children:L(`projectsNoSkills`)})]})}function We({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=Ne(n,i),o=Pe(n,i);Z(n);let s=je(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(x,{side:`right`,closeLabel:L(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:L(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ge,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ge({activities:e,item:t,onClose:i,onOpenArtifact:a,states:o}){let c=X(t.projectId),[l,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[h,_]=(0,z.useState)(t.stateId),[v,b]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[ae,T]=(0,z.useState)(!1),j=async(e,t)=>{try{await e(),t?.()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},oe=async()=>{try{await c.updateItem.mutateAsync({workItemId:t.id,patch:{title:l,description:d,stateId:h,attention:v,expectedVersion:t.version}}),r.success(L(`projectsWorkItemSaved`))}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemSaveFailed`))}},M=async()=>{if(x.trim())try{await c.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(te,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(ie,{children:L(`projectsWorkDetails`)}),(0,B.jsx)(ne,{page:re(`project-work`,JSON.stringify([t.projectId,t.id]),t.title)})]}),(0,B.jsxs)(y,{children:[t.id,` · `,L(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkTitle`)}),(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkDescription`)}),(0,B.jsx)(ee,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsStatus`)}),(0,B.jsxs)(A,{value:h,onValueChange:_,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:o.map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkAttention`)}),(0,B.jsxs)(A,{value:v,onValueChange:e=>b(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(k,{value:`none`,children:L(`projectsWorkAttention_none`)}),(0,B.jsx)(k,{value:`blocked`,children:L(`projectsWorkAttention_blocked`)}),(0,B.jsx)(k,{value:`awaiting-user`,children:L(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsWorkUnlinkArtifact`),onClick:()=>void j(()=>c.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(De,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:L(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(n,{value:x,onChange:e=>S(e.target.value),placeholder:L(`projectsWorkArtifactPath`)}),(0,B.jsx)(n,{value:C,onChange:e=>w(e.target.value),placeholder:L(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(s,{variant:`outline`,onClick:()=>void M(),disabled:!x.trim()||c.linkArtifact.isPending,children:[(0,B.jsx)(g,{className:`mr-2 h-4 w-4`}),L(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:L(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(m,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(s,{variant:`outline`,onClick:()=>void j(()=>c.restoreItem.mutateAsync(t.id)),children:L(`projectsRestore`)}):(0,B.jsxs)(s,{variant:`destructive`,onClick:()=>T(!0),children:[(0,B.jsx)(F,{className:`mr-2 h-4 w-4`}),L(`projectsDelete`)]}),(0,B.jsx)(s,{onClick:()=>void oe(),disabled:!l.trim()||c.updateItem.isPending,children:L(`save`)})]}),(0,B.jsx)(se,{open:ae,onOpenChange:T,title:L(`projectsDeleteWorkItem`),description:L(`projectsDeleteWorkItemDescription`),confirmLabel:L(`projectsDelete`),variant:`destructive`,onCancel:()=>T(!1),onConfirm:()=>void j(()=>c.deleteItem.mutateAsync(t.id),i)})]})}var Ke=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function qe({open:e,onOpenChange:t,projectId:i,states:a}){let o=X(i),c=Fe(a),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},v=async()=>{l.trim()&&await _(async()=>{await o.createState.mutateAsync({name:l.trim(),category:d}),u(``)})},y=async(e,t)=>{let n=c[e],r=c[e+t];!n||!r||await _(async()=>{await o.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await o.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{open:e,onOpenChange:t,children:(0,B.jsxs)(ge,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsWorkStateSettings`)}),(0,B.jsx)(ve,{children:L(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{"aria-label":L(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>o.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(A,{value:e.category,onValueChange:t=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(D,{"aria-label":L(`projectsWorkStateCategory`),children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(T,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveDown`),disabled:t===c.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(j,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsDeleteState`),disabled:c.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(F,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),L(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),placeholder:L(`projectsWorkNewState`)}),(0,B.jsxs)(A,{value:d,onValueChange:e=>f(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(s,{onClick:()=>void v(),disabled:!l.trim()||o.createState.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsAdd`)]})]})]})}),(0,B.jsx)(R,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(ge,{children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsDeleteState`)}),(0,B.jsx)(ve,{children:L(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:L(`projectsWorkStateMigration`)}),(0,B.jsxs)(A,{value:h,onValueChange:g,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{placeholder:L(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(O,{children:c.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(he,{children:[(0,B.jsx)(s,{variant:`outline`,onClick:()=>m(null),children:L(`cancel`)}),(0,B.jsx)(s,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await o.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:L(`projectsDelete`)})]})]})})]})}function Je({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(M,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(we,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(v,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function Ye({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:L(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:L(`projectsDeleted`)}):null]})]})}function Xe({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(Ye,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsNoData`)}),e?(0,B.jsx)(s,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:L(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ze({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=ke(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(oe,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(j,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Je,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Xe,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Qe({onOpenWorkItem:e,projectId:t}){let[i,a]=(0,z.useState)(`list`),[o,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1);Z(t);let p=je(t),m=X(t),h=async()=>{if(l.trim())try{let t=await m.createItem.mutateAsync({title:l.trim()});u(``),e(t.id)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)});let g=Fe(p.data??[]),_=Le(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":L(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:L(`projectsWorkNewItem`)}),(0,B.jsxs)(s,{onClick:()=>void h(),disabled:!l.trim()||m.createItem.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":L(`projectsWorkViews`),children:[(0,B.jsxs)(s,{size:`sm`,variant:i===`list`?`secondary`:`ghost`,"aria-pressed":i===`list`,onClick:()=>a(`list`),children:[(0,B.jsx)(Ee,{className:`mr-2 h-4 w-4`}),L(`projectsWorkList`)]}),(0,B.jsxs)(s,{size:`sm`,variant:i===`board`?`secondary`:`ghost`,"aria-pressed":i===`board`,onClick:()=>a(`board`),children:[(0,B.jsx)(Te,{className:`mr-2 h-4 w-4`}),L(`projectsWorkBoard`)]})]}),(0,B.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>f(!0),children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),L(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>c(e.target.checked)}),L(`projectsWorkShowDeleted`)]}),i===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,i===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(qe,{open:d,onOpenChange:f,projectId:t,states:g})]})}var $e=e=>[`project-agreement`,e],et=e=>[`project-skills`,e];function tt(e){return a({queryKey:$e(e??``),enabled:!!e,queryFn:async()=>await i.projects.getAgreement(e)})}function nt(e){return a({queryKey:et(e??``),enabled:!!e,queryFn:async()=>await i.projects.listProjectSkills(e)})}function rt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var it=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function at(){let{projectId:e,tab:t}=p(),n=d(),r=C(),{isMobile:i}=ae(),a=S(),[o,s]=(0,z.useState)(null),c=a.data?.projects??[],l=c.find(t=>t.id===e)??null,u=rt(t)?t:null,f=tt(u===`agreement`?l?.id??null:null),m=nt(u===`skills`?l?.id??null:null);if(a.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(a.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[L(`projectsLoadFailed`),`: `,a.error.message]});if(!c.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsEmpty`)});if(!l||!u)return(0,B.jsxs)(`main`,{className:`space-y-3 p-4 text-sm text-muted-foreground sm:p-6`,children:[(0,B.jsx)(`label`,{htmlFor:`project-home-selection`,className:`block font-medium text-foreground`,children:L(`projectsChoose`)}),(0,B.jsxs)(`select`,{id:`project-home-selection`,value:``,onChange:e=>n(`/projects/${encodeURIComponent(e.target.value)}/overview`),className:`min-h-11 w-full rounded-xl border border-border bg-card px-3 text-base text-foreground`,children:[(0,B.jsx)(`option`,{value:``,disabled:!0,children:L(`projectsChoose`)}),c.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:l.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:l.rootPath})]}),(0,B.jsxs)(ue,{value:u,onValueChange:e=>n(`/projects/${encodeURIComponent(l.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(le,{className:`w-max`,children:it.map(e=>(0,B.jsx)(ce,{value:e,children:L(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(N,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(He,{projectId:l.id,onOpenArtifact:(e,t)=>h(Q(l.rootPath,e),t),onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Qe,{projectId:l.id,onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:l.id,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})}),(0,B.jsx)(N,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ue,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(l.rootPath,e.path),e.name)})}),(0,B.jsx)(N,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Oe,{agreement:f.data,isLoading:f.isLoading,isError:f.isError,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})})]})]})}),(0,B.jsx)(We,{projectId:l.id,projectRoot:l.rootPath,workItemId:o,onOpenChange:e=>{e||s(null)},onOpenArtifact:h}),(0,B.jsx)(_,{layoutMode:i?`mobile`:`desktop`,sessionKey:null,projectRoot:l.rootPath})]})}export{at as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{_n as t,cr as n,yr as r}from"./api-BZvNpFOS.js";import{c as i,l as a,o,r as s,s as c,u as l}from"./context-menu-DHVVdHzN.js";var u=e(r(),1),d=n(),f=`2rem`;function p(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${f})))`}var m=p(`24rem`),h=a,g=l,_=o,v=u.forwardRef(({className:e,variant:n=`default`,sideOffset:r=8,align:a=`start`,collisionPadding:o=12,style:l,...u},f)=>(0,d.jsx)(i,{children:(0,d.jsx)(c,{ref:f,"data-theme-overlay":n===`menu`?`menu`:`popover`,sideOffset:r,align:a,collisionPadding:o,className:t(`z-[var(--z-popover,10100)] w-72 overflow-x-hidden overflow-y-auto rounded-xl border border-border/40 bg-popover p-4 text-popover-foreground shadow-floating animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e,n===`menu`&&`w-max min-w-52 max-w-[min(18rem,calc(100vw-16px))] overflow-y-auto rounded-xl border border-border/40 bg-popover p-1 text-popover-foreground shadow-floating outline-none`),style:{maxHeight:m,...l},...u,onEscapeKeyDown:e=>{s(e)||u.onEscapeKeyDown?.(e)}})}));v.displayName=c.displayName;var y=[`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`],b=new Set(y);function x(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function S(e,t){let n=e.trim(),r=t.trim();if(!n||!r)return n;let i=`${r}/`;return n.startsWith(i)?n.slice(i.length):n}function C(e,t){let n=e.trim();if(!n)return``;for(let e of t)n=S(n,e);return n.trim()}function w(e,t){let n=t.trim(),r=e.trim();return n?r?`${r}/${n}`:n:``}function T(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return t&&b.has(t)?t:null}function E(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=T(n);!e||t.includes(e)||t.push(e)}return t}function D(e){return e.includes(`off`)?[...e]:[`off`,...e]}function O(e,t){if(!e)return{};let n={};for(let[r,i]of Object.entries(e)){let e=C(r,t);if(!e)continue;let a={},o=E(i?.thinking?.supported);if(o.length>0){let e=T(i?.thinking?.default);a.thinking=e&&o.includes(e)?{supported:o,default:e}:{supported:o}}i?.vision===!0&&(a.vision=!0),(a.thinking||a.vision===!0)&&(n[e]=a)}return n}function k(e){return Object.fromEntries(Object.entries(e).filter(e=>!!e[1].thinking).map(([e,t])=>[e,t.thinking]))}function A(e,t,n){let r=C(t,n);return r?e[r]??null:null}function j(e,t){let n=e.trim();if(!n)return null;let r=null;for(let e of t)for(let t of e.aliases){let i=t.trim();i&&(n===i||n.startsWith(`${i}/`))&&(!r||i.length>r.score)&&(r={name:e.name,score:i.length})}if(r)return r.name;for(let e of t){let t=C(n,e.aliases);if(t&&x(e.models??[]).some(e=>e===t))return e.name}return null}function M(e){return e?e.enabled!==!1&&(e.apiKeyRequired===!1||e.apiKeySet===!0):!1}function N(e){let{providersView:t,templatesView:n,config:r,onlyConfigured:i=!1}=e,a=new Map((n?.providerTemplates??[]).map(e=>[e.providerType,e])),o=Object.values(t?.providers??r?.providers??{}).map(e=>{let{providerId:t}=e,n=e.providerType?a.get(e.providerType):void 0,r=t.trim(),i=x([t,n?.modelPrefix||``,n?.providerType||``]),o=x((e?.models??[]).map(e=>C(e,i))),s={...O(n?.modelConfig,i),...O(e?.modelConfig,i)},c=k(s),l=e?.displayName?.trim(),u=M(e);return{name:t,displayName:l||n?.displayName||t,prefix:r,aliases:i,models:o,modelConfig:s,modelThinking:c,configured:u}});return i?o.filter(e=>e.configured&&e.models.length>0):o}export{p as _,M as a,E as c,D as d,C as f,g,v as h,j as i,T as l,_ as m,N as n,O as o,h as p,w as r,x as s,y as t,A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,_n as n,cr as r,yr as i}from"./api-BZvNpFOS.js";import{t as a}from"./createLucideIcon-DE0sB9Nu.js";import{T as o,a as s,i as c,n as l,r as u,t as d}from"./select-Y9IEbx9x.js";import{s as f}from"./i18n-OGmF0Ws_.js";import{_ as p,f as m,h,i as g,m as _,p as v,r as y}from"./provider-models-DFQgF4hS.js";var b=a(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(i(),1),S=r(),C=p(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:r,onChange:i,options:a,disabled:s=!1,placeholder:c,className:l,inputClassName:u,emptyText:d,createText:f,toggleLabel:p,maxItems:m=1/0,onEnter:g}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{s&&y&&T(!1)},[s,y]);let D=(0,x.useMemo)(()=>w(a),[a]),O=r.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(m)?t.slice(0,Math.max(1,m)):t},[D,O,m]),A=r.trim().length>0&&D.some(e=>e===r.trim()),j=()=>T(!1);return(0,S.jsxs)(v,{open:y&&!s,onOpenChange:e=>T(!s&&e),children:[(0,S.jsx)(_,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:n(`relative`,l),children:[(0,S.jsx)(t,{id:e,value:r,disabled:s,onFocus:()=>{s||T(!0)},onChange:e=>{i(e.target.value),!y&&!s&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(g&&(e.preventDefault(),g()),j())},placeholder:c,className:n(`pr-10`,u)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:s,className:n(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,s?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":p,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(h,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&r.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{i(r.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--interaction-hover)]`,children:[(0,S.jsx)(o,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:f.replace(`{value}`,r.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{i(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--interaction-hover)]`,children:[(0,S.jsx)(o,{className:n(`h-4 w-4`,e===r.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&r.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:d})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:n,onChange:r,providerCatalog:i,disabled:a=!1,providerPlaceholder:o,modelPlaceholder:p,className:h}){let[_,v]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=i.length>0,O=p??E,k=(0,x.useMemo)(()=>new Map(i.map(e=>[e.name,e])),[i]),A=k.get(_),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=n.trim();if(!w){v(``),C(e);return}if(!e){C(``),v(e=>k.has(e)?e:``);return}let t=g(e,i)??``,r=k.get(t)?.aliases??[];v(t),C(t?m(e,r):e)},[w,i,k,n]),w?(0,S.jsxs)(`div`,{className:h,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(d,{value:_,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(v(e),C(t),!t){r(``);return}r(y(k.get(e)?.prefix??e,t))},disabled:a,children:[(0,S.jsx)(c,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(s,{placeholder:o??f(`providersSelectPlaceholder`)})}),(0,S.jsx)(l,{children:i.map(e=>(0,S.jsx)(u,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),r(t);return}let t=m(e,j);C(t),r(t?y(A.prefix,t):``)},options:M,disabled:a||!_,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:f(`modelPickerNoOptions`),createText:f(`modelPickerUseCustom`),toggleLabel:f(`modelPickerToggleOptions`)},_)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:f(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:h,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:f(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:f(`providersEmptyDescription`)})]}),(0,S.jsx)(t,{id:e,value:n,disabled:a,onChange:e=>r(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:f(`modelInputCustomHint`)})]})}export{O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,Jn as n,Qt as r,Ut as i,Wt as a,Yt as o,_n as s,cr as c,gn as l,sr as u,yr as d}from"./api-BZvNpFOS.js";import{t as f}from"./createLucideIcon-DE0sB9Nu.js";import{a as p,i as m,t as h}from"./use-viewport-layout-vmbQUNT6.js";import{a as g,i as _,n as v,r as y,t as b,w as x}from"./select-Y9IEbx9x.js";import{m as S}from"./context-menu-DHVVdHzN.js";import{i as C,n as w,r as T,t as E}from"./confirm-dialog-8vqYZ0wy.js";import{t as D}from"./eye-bKzylu3p.js";import{t as O}from"./loader-circle-Clq1Gtb1.js";import{n as k,t as A}from"./trash-2-DER2EJKK.js";import{t as j}from"./refresh-cw-BG8VfcdA.js";import{t as M}from"./settings-2-CrGx9_De.js";import{t as N}from"./x-DSz9cGhy.js";import{l as P,s as F}from"./i18n-OGmF0Ws_.js";import{a as I,c as L,g as R,h as z,l as B,o as V,p as H,t as ee}from"./provider-models-DFQgF4hS.js";import{n as U,t as W}from"./status-dot-Cb8ewlUr.js";import{t as te}from"./host-capabilities-DuIFVsvM.js";import{a as ne,c as G,d as K,f as q,h as re,i as ie,l as ae,m as oe,o as se,p as ce,r as le,y as ue}from"./use-config-BM5jC65L.js";import{t as de}from"./form-actions-CCoxz33Q.js";import{t as J}from"./config-hints-DbmiyTKg.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,s as ye}from"./config-split-page-BA3V6b3Q.js";var be=f(`CircleDotDashed`,[[`path`,{d:`M10.1 2.18a9.93 9.93 0 0 1 3.8 0`,key:`1qdqn0`}],[`path`,{d:`M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7`,key:`1bq7p6`}],[`path`,{d:`M21.82 10.1a9.93 9.93 0 0 1 0 3.8`,key:`1rlaqf`}],[`path`,{d:`M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69`,key:`1xk03u`}],[`path`,{d:`M13.9 21.82a9.94 9.94 0 0 1-3.8 0`,key:`l7re25`}],[`path`,{d:`M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7`,key:`1v18p6`}],[`path`,{d:`M2.18 13.9a9.93 9.93 0 0 1 0-3.8`,key:`xdo6bj`}],[`path`,{d:`M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69`,key:`1jjmaz`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xe=f(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Y=e(d(),1),Se={providerId:``,providerType:null,isBuiltInType:!1,isCustom:!0,enabled:!0,displayName:``,apiKeySet:!1,apiKeyMasked:void 0,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelConfig:{}};function X(e){if(!e)return null;let t=Object.entries(e).map(([e,t])=>[e.trim(),t]).filter(([e])=>e.length>0);return t.length===0?null:Object.fromEntries(t)}function Ce(e,t){let n=X(e),r=X(t);if(n===null&&r===null)return!0;if(!n||!r)return!1;let i=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)),a=Object.entries(r).sort(([e],[t])=>e.localeCompare(t));return i.length===a.length?i.every(([e,t],n)=>e===a[n][0]&&t===a[n][1]):!1}function Z(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function we(e,t){let n=e.trim();if(!n||!t.trim())return n;let r=`${t.trim()}/`;return n.startsWith(r)?n.slice(r.length):n}function Q(e,t){let n=e.trim();if(!n)return``;for(let e of t){let t=e.trim();t&&(n=we(n,t))}return n.trim()}function Te(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function Ee(e,t){return Z(t)}function De(e,t){return Z(e).map(e=>{let n=e.trim();return!n||n.startsWith(`${t}/`)?n:`${t}/${n}`})}function Oe(e,t){let n=new Set(t.map(e=>e.trim()).filter(Boolean)),r={};for(let[t,i]of Object.entries(e)){if(!n.has(t))continue;let e={},a=L(i.thinking?.supported);if(a.length>0){let t=B(i.thinking?.default);e.thinking=t&&a.includes(t)?{supported:a,default:t}:{supported:a}}i.vision===!0&&(e.vision=!0),(e.thinking||e.vision===!0)&&(r[t]=e)}return r}function ke(e,t,n){return{...V(e,n),...V(t,n)}}function Ae(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i];if(a!==r[i])return!1;let o=e[a],s=t[a];if(!o||!s||!Te([...o.thinking?.supported??[]].sort(),[...s.thinking?.supported??[]].sort())||(o.thinking?.default??null)!==(s.thinking?.default??null)||(o.vision??!1)!==(s.vision??!1))return!1}return!0}function je(e){return e.providerName?e.apiKey.trim().length>0||e.apiBase.trim()!==e.currentApiBase.trim()||!Ce(e.extraHeaders,e.currentHeaders)||e.supportsWireApi&&e.wireApi!==e.currentWireApi||!Te(e.models,e.currentEditableModels)||!Ae(e.modelConfig,e.currentModelConfig)||e.providerDisplayName.trim()!==e.effectiveDisplayName:!1}function Me(e){let t={},n=e.apiKey.trim(),r=e.apiBase.trim(),i=X(e.extraHeaders),a=e.providerDisplayName.trim();return a!==e.effectiveDisplayName&&(t.displayName=a.length>0?a:null),n.length>0&&(t.apiKey=n),r!==e.currentApiBase.trim()&&(t.apiBase=r.length>0&&r!==e.defaultApiBase?r:null),Ce(i,e.currentHeaders)||(t.extraHeaders=i),e.supportsWireApi&&e.wireApi!==e.currentWireApi&&(t.wireApi=e.wireApi),Te(e.models,e.currentEditableModels)||(t.models=De(e.models,e.providerName??``)),Ae(e.modelConfig,e.currentModelConfig)||(t.modelConfig=Oe(e.modelConfig,e.models)),t}function Ne(e){let t=Q(e.models.find(e=>e.trim().length>0)??``,e.providerModelAliases),n={...Pe(e),model:t||null};return e.supportsWireApi&&(n.wireApi=e.wireApi),n}function Pe(e){let t={apiBase:e.apiBase.trim(),extraHeaders:X(e.extraHeaders)};return e.apiKey.trim().length>0&&(t.apiKey=e.apiKey.trim()),t}function Fe(e){return F(e===`off`?`chatThinkingLevelOff`:e===`minimal`?`chatThinkingLevelMinimal`:e===`low`?`chatThinkingLevelLow`:e===`medium`?`chatThinkingLevelMedium`:e===`high`?`chatThinkingLevelHigh`:e===`adaptive`?`chatThinkingLevelAdaptive`:`chatThinkingLevelXhigh`)}function Ie(e){let{providerName:t,methods:n,defaultMethodId:r,language:i}=e;if(n.length===0)return``;let a=new Map;for(let e of n){let t=e.id.trim();t&&a.set(t.toLowerCase(),t)}let o=(...e)=>{for(let t of e){let e=a.get(t.toLowerCase());if(e)return e}},s=r?.trim();if(t===`minimax-portal`){if(i===`zh`)return o(`cn`,`china-mainland`)??o(s??``)??n[0]?.id??``;if(i===`en`)return o(`global`,`intl`,`international`)??o(s??``)??n[0]?.id??``}if(s){let e=o(s);if(e)return e}return i===`zh`?o(`cn`)??n[0]?.id??``:i===`en`?o(`global`)??n[0]?.id??``:n[0]?.id??``}function Le(e){let{required:t,hasDefault:n,optionCount:r}=e;return t&&n&&r>1&&r<=3}function Re(e,t,n){let r=Q(t,n);return r?e.includes(r)?{models:e,draft:``}:{models:[...e,r],draft:``}:{models:e,draft:t}}function ze(e,t,n){let r=[...e],i=new Set(e);for(let e of t){let t=Q(e,n);t&&!i.has(t)&&(i.add(t),r.push(t))}return{models:r,addedCount:r.length-e.length}}function Be(e,t,n){return ze(e,t,n).models.slice(e.length)}function Ve(e,t,n){let r={...t};return delete r[n],{models:e.filter(e=>e!==n),modelConfig:r}}function He(e,t,n){let r=e[t],i=r?.thinking?.supported??[],a=i.includes(n)?i.filter(e=>e!==n):ee.filter(e=>e===n||i.includes(e)),o=r?.thinking?.default&&a.includes(r.thinking.default)?r.thinking.default:void 0,s={...r,thinking:a.length>0?o?{supported:a,default:o}:{supported:a}:void 0},c={...e};return s.thinking||s.vision===!0?c[t]=s:delete c[t],c}function Ue(e,t,n){let r=e[t],i=r?.thinking;return!i||i.supported.length===0||n&&!i.supported.includes(n)?e:{...e,[t]:{...r,thinking:n?{supported:i.supported,default:n}:{supported:i.supported}}}}function We(e,t,n){let r={...e[t],vision:n?!0:void 0},i={...e};return r.thinking||r.vision===!0?i[t]=r:delete i[t],i}function Ge(e){let{providerName:t,providerSpec:n,language:r}=e,i=n?.auth,a=i?.methods??[];return{providerAuth:i,providerAuthMethodOptions:a.map(e=>({value:e.id,label:e.label?.[r]||e.label?.en||e.id})),providerAuthMethods:a,preferredAuthMethodId:Ie({providerName:n?.providerType??t,methods:a,defaultMethodId:i?.defaultMethodId,language:r}),shouldUseAuthMethodPills:Le({required:i?.kind===`device_code`,hasDefault:!!i?.defaultMethodId?.trim(),optionCount:a.length})}}function Ke(e,t){let n=!!e?.supportsWireApi||t,r=(e?.wireApiOptions||[`auto`,`chat`,`responses`]).map(e=>({value:e,label:F(e===`chat`?`wireApiChat`:e===`responses`?`wireApiResponses`:`wireApiAuto`)}));return{shouldUseWireApiPills:Le({required:n,hasDefault:typeof e?.defaultWireApi==`string`&&e.defaultWireApi.length>0,optionCount:r.length}),supportsWireApi:n,wireApiSelectOptions:r}}function qe(e){let{providerName:t,providersView:n,templatesView:r,schema:i,language:a}=e,o=t?n?.providers[t]:null,s=r?.providerTemplates.find(e=>e.providerType===o?.providerType),c=o??Se,l=i?.uiHints,u=!!o?.isCustom,d=t?J(`providers.${t}.apiKey`,l):void 0,f=t?J(`providers.${t}.apiBase`,l):void 0,p=t?J(`providers.${t}.extraHeaders`,l):void 0,m=t?J(`providers.${t}.wireApi`,l):void 0,h=s?.displayName||o?.displayName||t||``,g=(c.displayName||``).trim()||h,_=c.enabled!==!1,v=u||s?.supportsModelDiscovery===!0,y=Z([s?.modelPrefix||s?.providerType||``,t||``]),b=s?.defaultApiBase||``,x=c.apiBase||b,S=X(c.extraHeaders||null),C=c.wireApi||s?.defaultWireApi||`auto`,w=Ee(Z((s?.defaultModels??[]).map(e=>Q(e,y))),Z((c.models??[]).map(e=>Q(e,y)))),T=Oe(ke(s?.modelConfig,c.modelConfig,y),w),E=s?.apiBaseHelp?.[a]||s?.apiBaseHelp?.en||f?.help||F(`providerApiBaseHelp`),D=Ge({providerName:t,providerSpec:s,language:a}),O=Ke(s,u);return{apiBaseHelpText:E,apiBaseHint:f,apiKeyHint:d,currentApiBase:x,currentEditableModels:w,currentEnabled:_,currentHeaders:S,currentModelConfig:T,currentWireApi:C,defaultApiBase:b,defaultDisplayName:h,effectiveDisplayName:g,extraHeadersHint:p,...D,providerConfig:o,providerModelAliases:y,resolvedProviderConfig:c,supportsModelDiscovery:v,wireApiHint:m,...O}}function Je(e){let{providerName:t,providerAuth:r,resolvedAuthMethodId:i}=e,a=u(),o=oe(),s=ae(),c=G(),[l,d]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(``),g=(0,Y.useRef)(null),_=(0,Y.useCallback)(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),v=(0,Y.useCallback)((e,r)=>{_(),g.current=window.setTimeout(()=>{(async()=>{if(t)try{let i=await s.mutateAsync({provider:t,data:{sessionId:e}});if(i.status===`pending`){h(F(`providerAuthWaitingBrowser`)),v(e,i.nextPollMs??r);return}if(i.status===`authorized`){p(null),_(),h(F(`providerAuthCompleted`)),n.success(F(`providerAuthCompleted`)),a.invalidateQueries({queryKey:[`config`]}),a.invalidateQueries({queryKey:[`providers`]});return}p(null),_(),h(i.message||`Authorization ${i.status}.`),n.error(i.message||`Authorization ${i.status}.`)}catch(e){p(null),_();let t=e instanceof Error?e.message:String(e);h(t),n.error(`Authorization failed: ${t}`)}})()},Math.max(1e3,r))},[_,s,t,a]),y=(0,Y.useCallback)(async()=>{if(!(!t||r?.kind!==`device_code`))try{d(t),h(``);let e=await o.mutateAsync({provider:t,data:i?{methodId:i}:{}});if(!e.sessionId||!e.verificationUri)throw Error(F(`providerAuthStartFailed`));p(e.sessionId),h(`${F(`providerAuthOpenPrompt`)}${e.userCode}${F(`providerAuthOpenPromptSuffix`)}`),await te.openExternalUrl(e.verificationUri),v(e.sessionId,e.intervalMs)}catch(e){let t=e instanceof Error?e.message:String(e);p(null),_(),h(t),n.error(`${F(`providerAuthStartFailed`)}: ${t}`)}},[_,r?.kind,t,i,v,o]),b=(0,Y.useCallback)(async()=>{if(!(!t||r?.kind!==`device_code`))try{d(t),_(),p(null);let e=await c.mutateAsync({provider:t});h(`${F(`providerAuthImportStatusPrefix`)}${e.expiresAt?` (expires: ${e.expiresAt})`:``}`),n.success(F(`providerAuthImportSuccess`)),a.invalidateQueries({queryKey:[`config`]}),a.invalidateQueries({queryKey:[`providers`]})}catch(e){let t=e instanceof Error?e.message:String(e);h(t),n.error(`${F(`providerAuthImportFailed`)}: ${t}`)}},[_,c,r?.kind,t,a]);return(0,Y.useEffect)(()=>{_()},[_,t]),(0,Y.useEffect)(()=>()=>_(),[_]),{authSessionId:l===t?f:null,authStatusMessage:l===t?m:``,importAuthFromCli:b,importPending:c.isPending,startAuth:y,startPending:o.isPending}}function Ye(e){let{providerName:t,apiKey:r,apiKeyRequired:i,apiKeySet:a,apiBase:o,extraHeaders:s,supportsWireApi:c,wireApi:u,models:d,providerModelAliases:f}=e,p=re(),m=se(),h=(0,Y.useMemo)(()=>JSON.stringify({providerName:t,apiKey:r,apiBase:o,extraHeaders:s}),[o,r,s,t]),[g,_]=(0,Y.useState)(null),v=(0,Y.useCallback)(async()=>{if(t)try{let e=await p.mutateAsync({provider:t,data:Ne({apiKey:r,apiBase:o,extraHeaders:s,supportsWireApi:c,wireApi:u,models:d,providerModelAliases:f})});if(e.success){n.success(`${F(`providerTestConnectionSuccess`)} (${e.latencyMs}ms)`);return}let i=[`provider=${e.provider}`,`latency=${e.latencyMs}ms`];e.model&&i.push(`model=${e.model}`),n.error(`${F(`providerTestConnectionFailed`)}: ${e.message} | ${i.join(` | `)}`)}catch(e){let t=e instanceof Error?e.message:String(e);n.error(`${F(`providerTestConnectionFailed`)}: ${t}`)}},[o,r,s,d,f,t,c,p,u]);return{discoverModels:(0,Y.useCallback)(async()=>{if(!t)return null;if(i&&!r.trim()&&!a)return n.error(F(`providerModelsApiKeyRequired`)),null;try{let e=await m.mutateAsync({provider:t,data:Pe({apiKey:r,apiBase:o,extraHeaders:s})});return _({key:h,models:e.models}),n.success(F(`providerModelsFetchSuccess`)),e.models}catch(e){if(e instanceof l&&(e.details?.upstreamStatus===401||e.details?.upstreamStatus===403))return n.error(F(`providerModelsAuthorizationFailed`)),null;let t=e instanceof Error?e.message:String(e);return n.error(`${F(`providerModelsFetchFailed`)}: ${t}`),null}},[o,r,i,a,m,h,s,t]),fetchedModels:g?.key===h?g.models:[],isDiscoveringModels:m.isPending,isTestPending:p.isPending,testConnection:v}}var $=c();function Xe({value:e,onChange:n,className:r}){let i=e?Object.entries(e):[],a=(e,t,r)=>{let a=[...i];a[e]=[t,r],n(Object.fromEntries(a))},c=()=>{n({...e,"":``})},l=e=>{let t=i.filter((t,n)=>n!==e);n(Object.fromEntries(t))};return(0,$.jsxs)(`div`,{className:s(`space-y-2`,r),children:[i.map(([e,n],r)=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(t,{type:`text`,value:e,onChange:e=>a(r,e.target.value,n),placeholder:F(`headerName`),className:`flex-1`}),(0,$.jsx)(t,{type:`text`,value:n,onChange:t=>a(r,e,t.target.value),placeholder:F(`headerValue`),className:`flex-1`}),(0,$.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>l(r),children:(0,$.jsx)(A,{className:`h-4 w-4 text-red-500`})})]},r)),(0,$.jsxs)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:[(0,$.jsx)(k,{className:`h-4 w-4 mr-2`}),F(`add`)]})]})}function Ze(e){let{value:t,onChange:n,options:r}=e;return(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let r=e.value===t;return(0,$.jsx)(`button`,{type:`button`,onClick:()=>n(e.value),"aria-pressed":r,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${r?`border-[var(--interaction-selection-border)] bg-[var(--interaction-selection)] text-foreground`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-[var(--interaction-hover)] hover:text-foreground`}`,children:e.label},e.value)})})}function Qe(e){let{showAdvanced:t,onShowAdvancedChange:n,supportsWireApi:r,wireApiLabel:i,wireApi:o,onWireApiChange:s,shouldUseWireApiPills:c,wireApiSelectOptions:l,extraHeadersLabel:u,extraHeaders:d,onExtraHeadersChange:f}=e;return(0,$.jsxs)(`div`,{className:`border-t border-border/70 pt-4`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center justify-between text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(M,{className:`h-3.5 w-3.5`}),F(`providerAdvancedSettings`)]}),(0,$.jsx)(x,{className:`h-4 w-4 transition-transform ${t?`rotate-180`:``}`})]}),t?(0,$.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[r?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`wireApi`,className:`text-sm font-medium text-foreground`,children:i}),c?(0,$.jsx)(Ze,{value:o,onChange:e=>s(e),options:l}):(0,$.jsxs)(b,{value:o,onValueChange:e=>s(e),children:[(0,$.jsx)(_,{className:`rounded-xl`,children:(0,$.jsx)(g,{})}),(0,$.jsx)(v,{children:l.map(e=>(0,$.jsx)(y,{value:e.value,children:e.label},e.value))})]})]}):null,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:u}),(0,$.jsx)(Xe,{value:d,onChange:f}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerExtraHeadersHelpShort`)})]})]}):null]})}function $e({isSet:e,className:n,value:r,onChange:i,placeholder:a,...c}){let[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=typeof r==`string`&&r.length>0;return(0,$.jsxs)(`div`,{className:`relative`,children:[e&&!p&&!d?(0,$.jsx)(`div`,{onClick:()=>f(!0),className:s(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12`,n),children:`••••••••••••`}):(0,$.jsx)(t,{type:l?`text`:`password`,className:s(`pr-12`,n),value:r,onChange:i,onBlur:()=>{p||f(!1)},placeholder:a,autoFocus:d,...c}),(0,$.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex gap-1`,children:(e||p)&&(0,$.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>u(!l),children:l?(0,$.jsx)(xe,{className:`h-4 w-4`}):(0,$.jsx)(D,{className:`h-4 w-4`})})})]})}function et(e){let{apiKey:t,apiKeyRequired:n,apiKeySet:r,apiKeyPlaceholder:i,providerAuth:s,providerAuthNote:c,providerAuthMethodOptions:l,providerAuthMethodsCount:u,selectedAuthMethodHint:d,shouldUseAuthMethodPills:f,resolvedAuthMethodId:p,onAuthMethodChange:m,onStartProviderAuth:h,onImportProviderAuthFromCli:x,startPending:S,importPending:C,authSessionId:w,authStatusMessage:T,onApiKeyChange:E}=e,D=n?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`apiKey`,className:`text-sm font-medium text-foreground`,children:F(`apiKey`)}),(0,$.jsx)($e,{id:`apiKey`,value:t,isSet:r,onChange:e=>E(e.target.value),placeholder:i,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`leaveBlankToKeepUnchanged`)})]}):null;return s?.kind===`device_code`?(0,$.jsxs)($.Fragment,{children:[D,(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/45 p-3`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:s.displayName||F(`providerAuthSectionTitle`)}),c?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null,u>1?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{className:`text-xs font-medium text-foreground`,children:F(`providerAuthMethodLabel`)}),f?(0,$.jsx)(Ze,{value:p,onChange:m,options:l}):(0,$.jsxs)(b,{value:p,onValueChange:m,children:[(0,$.jsx)(_,{className:`h-8 rounded-lg`,children:(0,$.jsx)(g,{placeholder:F(`providerAuthMethodPlaceholder`)})}),(0,$.jsx)(v,{children:l.map(e=>(0,$.jsx)(y,{value:e.value,children:e.label},e.value))})]}),d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d}):null]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:h,disabled:S||!!w,children:F(S?`providerAuthStarting`:w?`providerAuthAuthorizing`:`providerAuthAuthorizeInBrowser`)}),s.supportsCliImport?(0,$.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:x,disabled:C,children:F(C?`providerAuthImporting`:`providerAuthImportFromCli`)}):null,w?(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[F(`providerAuthSessionLabel`),`: `,w.slice(0,8),`…`]}):null]}),T?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}):null]})]}):D}function tt(e){let{providerName:t,models:n,aliases:r,fetchedModels:i=[],onModelsChange:a}=e,o=K({pollWhileRefreshing:!0,refreshOnMount:!0}),s=t?o.data?.providers[t]:void 0,c=i.length>0?`fetched`:`background`,l=(0,Y.useMemo)(()=>Be(n,c===`fetched`?i:s?.models??[],r),[r,s?.models,i,n,c]);return{addSuggestedModels:(0,Y.useCallback)(e=>{let t=ze(n,e,r);t.addedCount>0&&a(t.models)},[r,n,a]),hasSuggestionError:!!(s?.lastError&&!s.fetchedAt),isCheckingSuggestions:!!(t&&(o.isLoading||o.data?.refreshing&&!s)),suggestedModels:l,suggestionSource:c}}function nt(e){let{models:t,modelConfig:n,onModelsChange:r,onRemoveModel:o,onToggleModelThinkingLevel:s,onSetModelThinkingDefault:c,onSetModelVision:l,thinkingLevels:u,formatThinkingLevelLabel:d}=e,[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(()=>new Set),x=(0,Y.useMemo)(()=>t.filter(e=>m.has(e)),[t,m]),S=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},C=()=>{p(!1),h(new Set)};return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex min-h-7 flex-wrap items-center justify-end gap-2`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:F(`providerModelsSuggestionsSelected`).replace(`{count}`,String(x.length))}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-primary hover:text-primary/80`,onClick:()=>h(x.length===t.length?new Set:new Set(t)),children:F(x.length===t.length?`providerModelsClearSelection`:`providerModelsSelectAll`)}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:C,children:F(`cancel`)}),(0,$.jsxs)(`button`,{type:`button`,disabled:x.length===0,className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{x.length!==0&&(r(t.filter(e=>!m.has(e))),C())},children:[(0,$.jsx)(A,{className:`h-3 w-3`}),F(`providerModelsRemoveSelected`)]})]}):(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:()=>p(!0),children:[(0,$.jsx)(A,{className:`h-3 w-3`}),F(`providerModelsBulkRemove`)]})}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>{if(f)return(0,$.jsxs)(`label`,{className:`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5 hover:bg-[var(--interaction-hover)]`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:m.has(e),onChange:()=>S(e),"aria-label":F(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e})]},e);let t=n[e],r=t?.thinking,p=r?.supported??[],h=r?.default??null,x=t?.vision===!0;return(0,$.jsxs)(`div`,{className:`group inline-flex max-w-full items-center gap-1 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e}),(0,$.jsxs)(H,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-[var(--interaction-hover)] hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":F(`providerModelThinkingTitle`),title:F(`providerModelThinkingTitle`),children:(0,$.jsx)(M,{className:`h-3 w-3`})})}),(0,$.jsxs)(z,{className:`w-80 space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:F(`providerModelVisionTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelVisionHint`)})]}),(0,$.jsx)(i,{checked:x,onCheckedChange:t=>l(e,t)})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:F(`providerModelThinkingTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelThinkingHint`)})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(t=>(0,$.jsx)(`button`,{type:`button`,onClick:()=>s(e,t),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${p.includes(t)?`border-[var(--interaction-selection-border)] bg-[var(--interaction-selection)] text-foreground`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-[var(--interaction-hover)] hover:text-foreground`}`,children:d(t)},t))}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(a,{className:`text-xs font-medium text-foreground`,children:F(`providerModelThinkingDefault`)}),(0,$.jsxs)(b,{value:h??`__none__`,onValueChange:t=>c(e,t===`__none__`?null:t),disabled:p.length===0,children:[(0,$.jsx)(_,{className:`h-8 rounded-lg text-xs`,children:(0,$.jsx)(g,{})}),(0,$.jsxs)(v,{children:[(0,$.jsx)(y,{value:`__none__`,children:F(`providerModelThinkingDefaultNone`)}),p.map(e=>(0,$.jsx)(y,{value:e,children:d(e)},e))]})]}),p.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelThinkingNoSupported`)}):null]})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-[var(--interaction-hover)] hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":F(`remove`),children:(0,$.jsx)(N,{className:`h-3 w-3`})})]},e)})}),f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelsRemoveSaveHint`)}):null]})}var rt=20,it=50,at=50;function ot(e){let{expanded:n,fetchedTotal:r,models:i,source:a,onExpandedChange:o,onAddModels:s}=e,[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(()=>new Set),f=(0,Y.useMemo)(()=>{let e=c.trim().toLowerCase();return e?i.filter(t=>t.toLowerCase().includes(e)):i},[i,c]),p=f.slice(0,at),h=(0,Y.useMemo)(()=>i.filter(e=>u.has(e)),[i,u]),g=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},_=e=>{e.length!==0&&(s(e),l(``),d(new Set))},v=a===`fetched`?`providerModelsFetchedSuggestionsSummary`:`providerModelsSuggestionsSummary`;return a===`fetched`&&i.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,role:`status`,children:[(0,$.jsx)(w,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{children:F(`providerModelsFetchedAllConfigured`).replace(`{count}`,String(r))})]}):(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 p-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":n,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:()=>o(!n),children:[(0,$.jsx)(w,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:F(v).replace(`{count}`,String(i.length))}),(0,$.jsx)(S,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${n?`rotate-90`:``}`})]}),i.length<=it?(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-[var(--interaction-hover)]`,onClick:()=>_(i),children:F(`providerModelsSuggestionsAddAll`)}):null]}),n?(0,$.jsxs)(`div`,{className:`px-1 pb-1`,children:[i.length>rt?(0,$.jsxs)(`div`,{className:`relative px-2 pb-1 pt-1.5`,children:[(0,$.jsx)(m,{className:`pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(t,{value:c,onChange:e=>l(e.target.value),placeholder:F(`providerModelsSuggestionsSearchPlaceholder`),className:`h-8 rounded-lg pl-8 text-xs`})]}):null,(0,$.jsxs)(`div`,{className:`custom-scrollbar max-h-44 overflow-y-auto overscroll-contain`,children:[p.map(e=>(0,$.jsxs)(`label`,{className:`grid min-w-0 cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-[var(--interaction-hover)]`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:u.has(e),onChange:()=>g(e),"aria-label":F(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`block min-w-0 truncate text-xs text-foreground`,title:e,children:e})]},e)),f.length===0?(0,$.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:F(`providerModelsSuggestionsSearchEmpty`)}):null]}),f.length>p.length?(0,$.jsx)(`p`,{className:`px-2 pt-1 text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsShowing`).replace(`{visible}`,String(p.length)).replace(`{count}`,String(f.length))}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pt-1.5`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsSelected`).replace(`{count}`,String(h.length))}),(0,$.jsx)(`button`,{type:`button`,disabled:h.length===0,className:`shrink-0 rounded-md bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary transition-colors hover:bg-[var(--interaction-hover)] disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>_(h),children:F(`providerModelsSuggestionsAddSelected`)})]}),(0,$.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsSaveHint`)})]}):null]})}function st({hasFetchedCatalog:e,hasSuggestionError:t,supportsModelDiscovery:n}){return!n||!t||e?null:(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[(0,$.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),F(`providerModelsSuggestionsFailed`)]})}function ct(e){let{providerName:n,providerModelAliases:r,models:i,modelConfig:s,modelDraft:c,showModelInput:l,onModelDraftChange:u,onShowModelInputChange:d,onAddModel:f,onModelsChange:p,supportsModelDiscovery:m,onDiscoverModels:h,isDiscoveringModels:g,fetchedModels:_,onRemoveModel:v,onToggleModelThinkingLevel:y,onSetModelThinkingDefault:b,onSetModelVision:x,thinkingLevels:S,formatThinkingLevelLabel:C}=e,[w,T]=(0,Y.useState)(!1),E=(0,Y.useRef)(null),{addSuggestedModels:D,hasSuggestionError:A,isCheckingSuggestions:M,suggestedModels:P,suggestionSource:I}=tt({providerName:n,models:i,aliases:r,fetchedModels:_,onModelsChange:p}),L=async()=>{await h()&&(T(!0),window.requestAnimationFrame(()=>{let e=E.current;e?.scrollIntoView?.({behavior:`smooth`,block:`center`}),e?.focus({preventScroll:!0})}))},R=_.length>0;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:F(`providerModelsTitle`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m?(0,$.jsxs)(`button`,{type:`button`,onClick:L,disabled:g,className:`flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary/80 disabled:cursor-wait disabled:opacity-60`,children:[(0,$.jsx)(j,{className:`h-3 w-3 ${g?`animate-spin`:``}`}),F(g?`providerModelsFetching`:`providerModelsFetch`)]}):null,l?null:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80`,children:[(0,$.jsx)(k,{className:`h-3 w-3`}),F(`providerAddModel`)]})]})]}),l?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(t,{value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(d(!1),u(``))},placeholder:F(`providerModelInputPlaceholder`),className:`flex-1 rounded-xl`,autoFocus:!0}),(0,$.jsx)(o,{type:`button`,size:`sm`,onClick:f,disabled:c.trim().length===0,children:F(`add`)}),(0,$.jsx)(o,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{d(!1),u(``)},children:(0,$.jsx)(N,{className:`h-4 w-4`})})]}):null,(0,$.jsx)(st,{hasFetchedCatalog:R,hasSuggestionError:A,supportsModelDiscovery:m}),m&&M&&!R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(O,{className:`h-3.5 w-3.5 animate-spin`}),F(`providerModelsSuggestionsChecking`)]}):m&&(P.length>0||R)?(0,$.jsx)(`div`,{ref:E,tabIndex:-1,"aria-live":`polite`,className:`scroll-m-4 outline-none`,children:(0,$.jsx)(ot,{expanded:w,fetchedTotal:_.length,models:P,source:I,onExpandedChange:T,onAddModels:D})}):null,i.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 px-4 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:F(`providerModelsEmptyShort`)}),l?null:(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-sm font-medium text-primary hover:text-primary/80`,children:F(`providerAddFirstModel`)})]}):(0,$.jsx)(nt,{models:i,modelConfig:s,onModelsChange:p,onRemoveModel:v,onToggleModelThinkingLevel:y,onSetModelThinkingDefault:b,onSetModelVision:x,thinkingLevels:S,formatThinkingLevelLabel:C})]})}function lt({apiKeyRequired:e=!0,apiKeySet:t,className:n,enabled:r}){if(!r)return(0,$.jsx)(W,{status:`inactive`,label:F(`disabled`),className:n});let i=!e||t;return(0,$.jsx)(W,{status:i?`ready`:`setup`,label:F(i?`statusReady`:`statusSetup`),className:n})}function ut(e){let{context:n,language:r,providerTitle:i,providerDisplayName:s,apiKey:c,apiBase:l,extraHeaders:u,wireApi:d,models:f,modelConfig:p,modelDraft:m,showAdvanced:h,showModelInput:g,resolvedAuthMethodId:_,authSessionId:v,authStatusMessage:y,hasChanges:b,isDeletePending:x,isUpdatePending:S,connectivity:C,startPending:w,importPending:T,onProviderDisplayNameChange:E,onApiKeyChange:D,onApiBaseChange:O,onAuthMethodChange:k,onStartProviderAuth:j,onImportProviderAuthFromCli:M,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:I,onModelsChange:L,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,onShowAdvancedChange:H,onWireApiChange:U,onExtraHeadersChange:W,onDeleteProvider:te,onSubmit:ne,onTestConnection:G}=e,K=n.providerAuthMethods.find(e=>e.id===_);return(0,$.jsxs)(ge,{children:[(0,$.jsx)(pe,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground`,children:i}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:te,disabled:x,className:`text-muted-foreground/70 transition-colors hover:text-red-500`,title:F(`providerDelete`),children:(0,$.jsx)(A,{className:`h-4 w-4`})}),(0,$.jsx)(lt,{enabled:n.currentEnabled,apiKeyRequired:n.resolvedProviderConfig.apiKeyRequired,apiKeySet:n.resolvedProviderConfig.apiKeySet})]})]})}),(0,$.jsxs)(`form`,{onSubmit:ne,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(_e,{className:`space-y-4 px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`providerDisplayName`,className:`text-sm font-medium text-foreground`,children:F(`providerDisplayName`)}),(0,$.jsx)(t,{id:`providerDisplayName`,type:`text`,value:s,onChange:e=>E(e.target.value),placeholder:n.defaultDisplayName||F(`providerDisplayNamePlaceholder`),className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerDisplayNameHelpShort`)})]}),(0,$.jsx)(et,{apiKey:c,apiKeyRequired:n.resolvedProviderConfig.apiKeyRequired!==!1,apiKeySet:n.resolvedProviderConfig.apiKeySet,apiKeyPlaceholder:n.apiKeyHint?.placeholder??F(`enterApiKey`),providerAuth:n.providerAuth,providerAuthNote:n.providerAuth?.note?.[r]||n.providerAuth?.note?.en||n.providerAuth?.displayName||``,providerAuthMethodOptions:n.providerAuthMethodOptions,providerAuthMethodsCount:n.providerAuthMethods.length,selectedAuthMethodHint:K?.hint?.[r]||K?.hint?.en||``,shouldUseAuthMethodPills:n.shouldUseAuthMethodPills,resolvedAuthMethodId:_,onAuthMethodChange:k,onStartProviderAuth:j,onImportProviderAuthFromCli:M,startPending:w,importPending:T,authSessionId:v,authStatusMessage:y,onApiKeyChange:D}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`apiBase`,className:`text-sm font-medium text-foreground`,children:F(`apiBase`)}),(0,$.jsx)(t,{id:`apiBase`,type:`text`,value:l,onChange:e=>O(e.target.value),placeholder:n.defaultApiBase||n.apiBaseHint?.placeholder||`https://api.example.com`,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.apiBaseHelpText})]}),(0,$.jsx)(ct,{providerName:n.providerConfig?.providerId??``,providerModelAliases:n.providerModelAliases,models:f,modelConfig:p,modelDraft:m,showModelInput:g,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:I,onModelsChange:L,supportsModelDiscovery:n.supportsModelDiscovery,onDiscoverModels:C.discoverModels,isDiscoveringModels:C.isDiscoveringModels,fetchedModels:C.fetchedModels,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,thinkingLevels:ee,formatThinkingLevelLabel:Fe},n.providerConfig?.providerId),(0,$.jsx)(Qe,{showAdvanced:h,onShowAdvancedChange:H,supportsWireApi:n.supportsWireApi,wireApiLabel:F(`wireApi`),wireApi:d,onWireApiChange:U,shouldUseWireApiPills:n.shouldUseWireApiPills,wireApiSelectOptions:n.wireApiSelectOptions,extraHeadersLabel:F(`extraHeaders`),extraHeaders:u,onExtraHeadersChange:W})]}),(0,$.jsx)(ye,{children:(0,$.jsxs)(de,{align:`between`,children:[(0,$.jsxs)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:G,disabled:C.isTestPending,children:[(0,$.jsx)(be,{className:`mr-1.5 h-3.5 w-3.5`}),C.isTestPending?F(`providerTestingConnection`):F(`providerTestConnection`)]}),(0,$.jsx)(o,{type:`submit`,size:`sm`,disabled:S||!b,children:F(S?`saving`:b?`save`:`unchanged`)})]})})]})]})}function dt({providerName:e,onProviderDeleted:t}){let{data:n}=ce(),{data:r}=q(),{data:i}=le(),a=P(),o=(0,Y.useMemo)(()=>qe({providerName:e,providersView:n,templatesView:r,schema:i,language:a}),[a,e,n,i,r]);if(!e||!o.providerConfig)return(0,$.jsx)(ve,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:F(`providersSelectTitle`)}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:F(`providersSelectDescription`)})]})});let s=JSON.stringify({providerConfig:o.providerConfig,currentApiBase:o.currentApiBase,currentEditableModels:o.currentEditableModels,currentModelConfig:o.currentModelConfig,currentWireApi:o.currentWireApi,effectiveDisplayName:o.effectiveDisplayName,preferredAuthMethodId:o.preferredAuthMethodId});return(0,$.jsx)(ft,{providerName:e,onProviderDeleted:t,context:o,language:a},s)}function ft({providerName:e,onProviderDeleted:t,context:n,language:r}){let i=ue(),a=ne(),{currentApiBase:o,currentEditableModels:s,currentHeaders:c,currentModelConfig:l,currentWireApi:u,defaultApiBase:d,effectiveDisplayName:f,providerAuth:p,providerAuthMethods:m,providerModelAliases:h,resolvedProviderConfig:g,preferredAuthMethodId:_,supportsWireApi:v}=n,[y,b]=(0,Y.useState)(``),[x,S]=(0,Y.useState)(o),[C,w]=(0,Y.useState)(g.extraHeaders||null),[T,E]=(0,Y.useState)(u),[D,O]=(0,Y.useState)(s),[k,A]=(0,Y.useState)(l),[j,M]=(0,Y.useState)(``),[N,P]=(0,Y.useState)(f),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(_),H=Ye({providerName:e,apiKey:y,apiKeyRequired:g.apiKeyRequired!==!1,apiKeySet:g.apiKeySet,apiBase:x,extraHeaders:C,supportsWireApi:v,wireApi:T,models:D,providerModelAliases:h}),ee=N.trim()||f||e||F(`providersSelectPlaceholder`),U=(0,Y.useMemo)(()=>{if(!m.length)return``;let e=B.trim();return e&&m.some(t=>t.id===e)?e:_||m[0]?.id||``},[B,_,m]),{authSessionId:W,authStatusMessage:te,importAuthFromCli:G,importPending:K,startAuth:q,startPending:re}=Je({providerName:e,providerAuth:p,resolvedAuthMethodId:U}),ie=(0,Y.useMemo)(()=>je({providerName:e,apiKey:y,apiBase:x,currentApiBase:o,extraHeaders:C,currentHeaders:c,supportsWireApi:v,wireApi:T,currentWireApi:u,models:D,currentEditableModels:s,modelConfig:k,currentModelConfig:l,providerDisplayName:N,effectiveDisplayName:f}),[e,y,x,o,C,c,v,T,u,D,s,k,l,N,f]),ae=e=>{O(e),A(t=>Oe(t,e))};return(0,$.jsx)(ut,{context:n,language:r,providerTitle:ee,providerDisplayName:N,apiKey:y,apiBase:x,extraHeaders:C,wireApi:T,models:D,modelConfig:k,modelDraft:j,showAdvanced:I,showModelInput:R,resolvedAuthMethodId:U,authSessionId:W,authStatusMessage:te,hasChanges:ie,isDeletePending:a.isPending,isUpdatePending:i.isPending,connectivity:H,startPending:re,importPending:K,onProviderDisplayNameChange:P,onApiKeyChange:b,onApiBaseChange:S,onAuthMethodChange:V,onStartProviderAuth:q,onImportProviderAuthFromCli:G,onModelDraftChange:M,onShowModelInputChange:z,onAddModel:()=>{let e=Re(D,j,h);ae(e.models),M(e.draft)},onModelsChange:ae,onRemoveModel:e=>{let t=Ve(D,k,e);O(t.models),A(t.modelConfig)},onToggleModelThinkingLevel:(e,t)=>{A(n=>He(n,e,t))},onSetModelThinkingDefault:(e,t)=>{A(n=>Ue(n,e,t))},onSetModelVision:(e,t)=>{A(n=>We(n,e,t))},onShowAdvancedChange:L,onWireApiChange:E,onExtraHeadersChange:w,onDeleteProvider:async()=>{if(e&&window.confirm(F(`providerDeleteConfirm`)))try{await a.mutateAsync({provider:e}),t?.(e)}catch{}},onSubmit:t=>{t.preventDefault(),e&&i.mutate({provider:e,data:Me({providerName:e,apiKey:y,apiBase:x,currentApiBase:o,defaultApiBase:d,extraHeaders:C,currentHeaders:c,supportsWireApi:v,wireApi:T,currentWireApi:u,models:D,currentEditableModels:s,modelConfig:k,currentModelConfig:l,providerDisplayName:N,effectiveDisplayName:f})})},onTestConnection:H.testConnection})}function pt(e){if(!e)return null;try{let t=new URL(e);return`${t.host}${t.pathname&&t.pathname!==`/`?t.pathname:``}`}catch{return e.replace(/^https?:\/\//,``)}}function mt(e,t=[]){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({provider:e,index:t})).sort((e,t)=>{let r=n.get(e.provider.providerId),i=n.get(t.provider.providerId);if(r!==void 0||i!==void 0)return(r??2**53-1)-(i??2**53-1);let a=e.provider.providerType===`nextclaw`?1:0,o=t.provider.providerType===`nextclaw`?1:0;return a===o?e.index-t.index:a-o}).map(({provider:e})=>e)}function ht(e){let t=e.findIndex(e=>e.providerType===`zhipu`),n=e.findIndex(e=>e.providerType===`dashscope-coding-plan`);return e.map((e,t)=>({template:e,index:t})).sort((e,r)=>{let i=({template:e,index:r})=>e.providerType===`nextclaw`?2**53-1:e.providerType===`deepseek`&&n>=0?n-.5:e.providerType===`mimo`&&t>=0?t+.5:r;return i(e)-i(r)}).map(({template:e})=>e)}function gt(){let{isMobile:e}=h(),{data:n}=ce(),{data:a}=q(),c=ie(),l=ne(),u=ue(),[d,f]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)([]),[S,C]=(0,Y.useState)(``),w=(0,Y.useMemo)(()=>mt(Object.values(n?.providers??{}),b),[n?.providers,b]),D=(0,Y.useMemo)(()=>a?.providerTemplates??[],[a?.providerTemplates]),O=(0,Y.useMemo)(()=>ht(D),[D]),j=(0,Y.useMemo)(()=>new Map(D.map(e=>[e.providerType,e])),[D]),M=(0,Y.useMemo)(()=>{let e=S.trim().toLowerCase();return w.filter(t=>{if(!e)return!0;let n=t.providerType?j.get(t.providerType):null;return(t.displayName?.trim()||n?.displayName||t.providerId).toLowerCase().includes(e)||t.providerId.toLowerCase().includes(e)})},[w,S,j]),N=(0,Y.useMemo)(()=>d&&M.some(e=>e.providerId===d)?d:e?null:M[0]?.providerId??null,[M,e,d]);return!n||!a?(0,$.jsx)(r,{title:F(`providersPageTitle`),description:F(`providersPageDescription`),layout:`split`,children:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:F(`providersLoading`)})}):(0,$.jsxs)(r,{title:F(`providersPageTitle`),description:F(`providersPageDescription`),layout:`split`,children:[(0,$.jsxs)(fe,{className:`md:min-h-0`,compactView:d?`detail`:`list`,onMobileBack:()=>f(null),mobileListLabel:F(`providersPageTitle`),children:[(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{className:`space-y-3 px-4 pb-3 pt-4`,children:(0,$.jsxs)(H,{open:v,onOpenChange:y,children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsxs)(o,{type:`button`,variant:`outline`,className:`w-full justify-center`,disabled:c.isPending,children:[(0,$.jsx)(k,{className:`mr-2 h-4 w-4`}),c.isPending?F(`saving`):F(`providerAdd`)]})}),(0,$.jsxs)(z,{className:`w-[42rem] max-w-[calc(100vw-2rem)] p-3`,align:`start`,children:[(0,$.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold text-muted-foreground`,children:F(`providerTemplatePickerTitle`)}),(0,$.jsxs)(`div`,{className:`grid max-h-[24rem] grid-cols-2 gap-2 overflow-y-auto sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-left transition-colors hover:border-border hover:bg-[var(--interaction-hover)]`,onClick:async()=>{try{let e=await c.mutateAsync({data:{providerType:null}});C(``),f(e.providerId),x(t=>[e.providerId,...t.filter(t=>t!==e.providerId)]),y(!1)}catch{}},children:[(0,$.jsx)(U,{name:`custom`,className:`h-8 w-8 rounded-lg border border-border/60 bg-muted/50`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:F(`providerAddCustom`)})]}),O.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-border/55 bg-muted/15 px-3 py-2 text-left transition-colors hover:border-border/80 hover:bg-[var(--interaction-hover)]`,onClick:async()=>{try{let t=await c.mutateAsync({data:{providerType:e.providerType}});C(``),f(t.providerId),x(e=>[t.providerId,...e.filter(e=>e!==t.providerId)]),y(!1)}catch{}},children:[(0,$.jsx)(U,{name:e.providerType,src:e.logo?`/logos/${e.logo}`:null,className:`h-8 w-8 rounded-lg border border-border/55 bg-background`,imgClassName:`h-4 w-4 object-contain`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:e.displayName||e.providerType})]},e.providerType))]})]})]})}),(0,$.jsx)(`div`,{className:`border-b border-border/70 px-4 py-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(m,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,$.jsx)(t,{value:S,onChange:e=>C(e.target.value),placeholder:F(`providersFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,$.jsxs)(_e,{className:`space-y-2 p-3`,children:[M.map(e=>{let t=e.providerType?j.get(e.providerType):null,n=e.enabled!==!1,r=I(e),a=e.displayName?.trim()||t?.displayName||e.providerId,o=pt(e.apiBase||t?.defaultApiBase||``)||F(`providersDefaultDescription`);return(0,$.jsx)(`div`,{onClick:()=>f(e.providerId),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e.providerId))},role:`button`,tabIndex:0,className:s(`group w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,N===e.providerId?`bg-[var(--interaction-selection)] text-foreground`:`bg-transparent text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:(0,$.jsxs)(`div`,{className:`relative min-h-10`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 pr-20`,children:[(0,$.jsx)(U,{name:e.providerType??e.providerId,src:t?.logo?`/logos/${t.logo}`:null,className:`h-10 w-10 rounded-lg bg-background/80`,imgClassName:`h-5 w-5 object-contain`,fallback:(0,$.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.providerId[0]})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:a}),(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground/65`,children:e.providerId}),(0,$.jsxs)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:[o,` · `,e.models?.length??0]})]})]}),(0,$.jsxs)(`div`,{className:`absolute right-0 top-0 flex items-center gap-1.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(i,{checked:n,disabled:u.isPending,title:F(n?`disabled`:`enabled`),className:`h-[18px] w-8`,thumbClassName:`h-4 w-4 data-[state=checked]:translate-x-4`,onCheckedChange:t=>{u.mutateAsync({provider:e.providerId,data:{enabled:t},silentSuccess:!0})}})}),(0,$.jsxs)(H,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground/70 hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:e=>e.stopPropagation(),title:F(`more`),children:(0,$.jsx)(T,{className:`h-4 w-4`})})}),(0,$.jsx)(z,{className:`w-40 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm text-red-600 hover:bg-destructive/10`,onClick:()=>_(e.providerId),children:[(0,$.jsx)(A,{className:`h-4 w-4`}),F(`providerDelete`)]})})]})]}),(0,$.jsx)(W,{status:n?r?`ready`:`setup`:`inactive`,label:F(n?r?`statusReady`:`statusSetup`:`disabled`),className:`absolute bottom-0 right-0 justify-end`})]})},e.providerId)}),M.length===0?(0,$.jsx)(me,{icon:p,title:F(`providersNoMatch`)}):null]})]}),(0,$.jsx)(dt,{providerName:N??void 0,onProviderDeleted:e=>{x(t=>t.filter(t=>t!==e)),e===N&&f(null)}})]}),(0,$.jsx)(E,{open:!!g,onOpenChange:e=>{e||_(null)},title:F(`providerDelete`),description:g??void 0,confirmLabel:F(`delete`),variant:`destructive`,onCancel:()=>_(null),onConfirm:()=>{g&&l.mutateAsync({provider:g}).then(()=>{x(e=>e.filter(e=>e!==g)),g===N&&f(null),_(null)})}})]})}export{gt as ProvidersConfigPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DE0sB9Nu.js";var t=e(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),n=e(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),r=e(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]);export{n,t as r,r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e,Jt as t,Yt as n,_n as r,cr as i,pn as a,qt as o}from"./api-DkLJrSCd.js";import{t as s}from"./createLucideIcon-B4xj2I2g.js";import{a as c,o as l}from"./theme-provider-C5PCDBPB.js";import{t as u}from"./download-Cr337h4W.js";import{t as d}from"./x-CQIp_nJT.js";import{s as f}from"./i18n-OGmF0Ws_.js";var p=s(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=a(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let t=this.resolveInstallability();if(t.installability!==`available`)return`unavailable`;if(t.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(v(),this.refreshState(),e.success(f(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),e.success(f(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=i();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return f(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return f(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),r=S(e=>e.installMethod),i=S(e=>e.blockedReason);return(0,w.jsx)(t,{title:f(`pwaInstallTitle`),description:f(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(o,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,r,i)}),e===`available`&&r===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f(`pwaInstallPromptHint`)})]}):null,e===`available`&&r===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:f(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),r=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||r?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:f(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:f(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":f(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(d,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(n,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:f(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=c(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(l(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
|
|
1
|
+
import{Jn as e,Jt as t,Yt as n,_n as r,cr as i,pn as a,qt as o}from"./api-BZvNpFOS.js";import{t as s}from"./createLucideIcon-DE0sB9Nu.js";import{a as c,o as l}from"./theme-provider-BjF1Eowc.js";import{t as u}from"./download-CKqS1Ksj.js";import{t as d}from"./x-DSz9cGhy.js";import{s as f}from"./i18n-OGmF0Ws_.js";var p=s(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=a(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let t=this.resolveInstallability();if(t.installability!==`available`)return`unavailable`;if(t.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(v(),this.refreshState(),e.success(f(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),e.success(f(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=i();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return f(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return f(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),r=S(e=>e.installMethod),i=S(e=>e.blockedReason);return(0,w.jsx)(t,{title:f(`pwaInstallTitle`),description:f(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(o,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,r,i)}),e===`available`&&r===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f(`pwaInstallPromptHint`)})]}):null,e===`available`&&r===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:f(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),r=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||r?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:f(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:f(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":f(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-[var(--interaction-hover)] hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(d,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(n,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:f(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=c(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(l(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DE0sB9Nu.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./app-presenter-provider-BcYL-VNe.js";export{e as RemoteAccessPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DE0sB9Nu.js";var t=e(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|