@taskforcehq/taskforce 0.3.328 → 0.3.330
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/dist/Taskforce.module.css +523 -79
- package/dist/TaskforceCore.js +237 -230
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +1 -1
- package/dist/cli.js +34 -0
- package/dist/cliCloudTargetGuard.d.ts +5 -0
- package/dist/cliCloudTargetGuard.js +11 -0
- package/dist/components/features/AiProfilesModule.js +3 -5
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +24 -8
- package/dist/components/features/TaskSettings.d.ts +12 -1
- package/dist/components/features/TaskSettings.js +217 -54
- package/dist/components/features/TaskforceAgentsModule.d.ts +1 -2
- package/dist/components/features/TaskforceAgentsModule.js +586 -116
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +1 -1
- package/dist/components/features/agentConnections/AgentConnectionControl.d.ts +15 -0
- package/dist/components/features/agentConnections/AgentConnectionControl.js +125 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.d.ts +18 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.js +393 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.d.ts +65 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.js +129 -0
- package/dist/components/features/planning/PlanningModule.js +2 -5
- package/dist/components/features/planning/PlanningTaskOrderList.d.ts +1 -1
- package/dist/components/features/planning/PlanningTaskOrderList.js +17 -6
- package/dist/components/features/planning/planningTaskArrangement.d.ts +1 -0
- package/dist/components/features/planning/planningTaskArrangement.js +5 -5
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.js +15 -24
- package/dist/components/features/taskforceAgentEditorModel.d.ts +2 -1
- package/dist/components/features/taskforceAgentEditorModel.js +5 -1
- package/dist/components/features/workflowManager/workflowManagerApi.d.ts +1 -1
- package/dist/components/features/workflowManager/workflowManagerApi.js +3 -0
- package/dist/components/task/TaskCard.d.ts +5 -0
- package/dist/components/task/TaskCard.js +65 -10
- package/dist/components/task/TaskImageReviews.js +14 -5
- package/dist/components/task/TaskKanban.d.ts +6 -1
- package/dist/components/task/TaskKanban.js +152 -6
- package/dist/components/task/TaskList.d.ts +5 -0
- package/dist/components/task/TaskList.js +3 -3
- package/dist/components/task/TaskWorkflowAssignmentField.js +68 -10
- package/dist/components/ui/PasswordInput.d.ts +6 -0
- package/dist/components/ui/PasswordInput.js +11 -0
- package/dist/components/ui/TopNoticeLayer.js +1 -1
- package/dist/components/views/AppShellHeader.js +32 -11
- package/dist/components/views/PlanComparisonPage.js +12 -0
- package/dist/components/views/StandaloneLayout.js +32 -55
- package/dist/components/views/WidgetView.js +3 -3
- package/dist/components/views/panels/PlanningDrawer.js +5 -12
- package/dist/components/views/standalone/modals/AccountSettingsModal.js +26 -17
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +4 -3
- package/dist/components/views/standalone/modals/SyncStatusModal.js +33 -38
- package/dist/config/envSchema.js +60 -1
- package/dist/config/localServiceRuntimeContract.d.ts +13 -0
- package/dist/config/localServiceRuntimeContract.js +135 -0
- package/dist/core/AiProfileService.js +46 -8
- package/dist/core/DeletedTaskLifecycleService.d.ts +1 -0
- package/dist/core/DeletedTaskLifecycleService.js +37 -6
- package/dist/core/McpTokenService.d.ts +23 -1
- package/dist/core/McpTokenService.js +93 -10
- package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +3 -2
- package/dist/core/TaskAttachmentLinksDurableMutationService.js +33 -9
- package/dist/core/TaskChecklistCommandService.d.ts +27 -0
- package/dist/core/TaskChecklistCommandService.js +83 -5
- package/dist/core/TaskLifecycleCommandService.d.ts +3 -1
- package/dist/core/TaskLifecycleCommandService.js +6 -2
- package/dist/core/Taskforce.d.ts +94 -2
- package/dist/core/Taskforce.js +760 -36
- package/dist/core/types.d.ts +14 -0
- package/dist/documentReviews/commandService.d.ts +2 -1
- package/dist/documentReviews/commandService.js +6 -3
- package/dist/hooks/sync/orchestratorShared.d.ts +1 -0
- package/dist/hooks/sync/orchestratorShared.js +2 -0
- package/dist/hooks/sync/useDurableLocalOutboxDrain.d.ts +1 -1
- package/dist/hooks/sync/useDurableTaskCreateMutation.js +1 -1
- package/dist/hooks/sync/useDurableTaskMetadataMutation.d.ts +1 -0
- package/dist/hooks/sync/useDurableTaskMetadataMutation.js +1 -0
- package/dist/hooks/sync/useDurableTaskStatusMutation.d.ts +1 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.d.ts +3 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.js +85 -9
- package/dist/hooks/sync/useSyncStatusControls.d.ts +4 -1
- package/dist/hooks/sync/useSyncStatusControls.js +47 -11
- package/dist/hooks/tasks/taskHttpMutation.js +1 -0
- package/dist/hooks/tasks/useCloudTaskSearch.d.ts +12 -0
- package/dist/hooks/tasks/useCloudTaskSearch.js +71 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.d.ts +16 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.js +197 -0
- package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +16 -3
- package/dist/hooks/tasks/useTaskEditorNavigation.js +72 -13
- package/dist/hooks/tasks/useTaskFormActions.d.ts +6 -0
- package/dist/hooks/tasks/useTaskFormActions.js +65 -12
- package/dist/hooks/ui/useSettingsModel.d.ts +24 -2
- package/dist/hooks/ui/useSettingsModel.js +13 -2
- package/dist/hooks/ui/useSettingsPersistence.d.ts +12 -1
- package/dist/hooks/ui/useSettingsPersistence.js +74 -47
- package/dist/hooks/useFilterSort.d.ts +7 -3
- package/dist/hooks/useFilterSort.js +15 -5
- package/dist/hooks/useSyncOrchestrator.d.ts +3 -0
- package/dist/hooks/useSyncOrchestrator.js +111 -2
- package/dist/hooks/useTaskData.d.ts +40 -1
- package/dist/hooks/useTaskData.js +240 -9
- package/dist/hooks/useTaskMutations.d.ts +12 -2
- package/dist/hooks/useTaskMutations.js +266 -52
- package/dist/hooks/useTaskforce.d.ts +39 -9
- package/dist/hooks/useTaskforce.js +359 -40
- package/dist/hooks/useUiNotice.d.ts +4 -0
- package/dist/hooks/useUiNotice.js +4 -0
- package/dist/mcp/adminWorkspaceRegistrar.js +3 -3
- package/dist/mcp/clientRegistry.d.ts +2 -2
- package/dist/mcp/clientRegistry.js +1 -1
- package/dist/mcp/documentAssetRegistrar.js +53 -41
- package/dist/mcp/documentHelpers.d.ts +1 -0
- package/dist/mcp/documentHelpers.js +7 -3
- package/dist/mcp/durableTaskMutationRouter.d.ts +4 -1
- package/dist/mcp/durableTaskMutationRouter.js +10 -0
- package/dist/mcp/durableTaskRelationshipMutationRouter.js +4 -0
- package/dist/mcp/httpProtocolRouting.d.ts +10 -0
- package/dist/mcp/httpProtocolRouting.js +19 -0
- package/dist/mcp/localCliHealth.d.ts +2 -2
- package/dist/mcp/localCliHealth.js +2 -2
- package/dist/mcp/localServiceProxy.d.ts +1 -0
- package/dist/mcp/localServiceProxy.js +530 -68
- package/dist/mcp/planningAttachmentCommandAdapter.d.ts +3 -1
- package/dist/mcp/planningAttachmentCommandAdapter.js +20 -2
- package/dist/mcp/runtime.d.ts +54 -79
- package/dist/mcp/runtime.js +556 -139
- package/dist/mcp/taskPlanningRegistrar.js +64 -42
- package/dist/mcp/toolCallCompatibility.js +38 -1
- package/dist/mcp/toolCatalog.d.ts +1 -0
- package/dist/mcp/toolProfiles.d.ts +2 -0
- package/dist/mcp/toolProfiles.js +10 -0
- package/dist/mcp/toolRegistry.d.ts +1 -0
- package/dist/mcp/toolRegistry.js +1 -0
- package/dist/mcp/workflowExecutionRegistrar.js +4 -4
- package/dist/migrations/taskSchemaMigrations.d.ts +5 -0
- package/dist/migrations/taskSchemaMigrations.js +427 -0
- package/dist/runtime/appGateDefinitions.d.ts +30 -6
- package/dist/runtime/appGateDefinitions.js +6 -6
- package/dist/runtime/appGates.d.ts +13 -13
- package/dist/runtime/appGates.js +36 -13
- package/dist/runtime/nodeAppGates.d.ts +8 -0
- package/dist/runtime/nodeAppGates.js +27 -0
- package/dist/server/cloudCollectionRead.d.ts +1 -1
- package/dist/server/cloudCollectionRead.js +2 -2
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +123 -14
- package/dist/server/localDatabaseIdentity.js +4 -1
- package/dist/server/localServiceLease.d.ts +3 -0
- package/dist/server/localServiceLease.js +11 -2
- package/dist/server/localServiceSessions.d.ts +14 -17
- package/dist/server/localServiceSessions.js +308 -94
- package/dist/server/localWorkspaceSyncServerRuntime.js +12 -7
- package/dist/server/rateLimit.d.ts +1 -0
- package/dist/server/rateLimit.js +4 -0
- package/dist/server/realtimeSyncWs.js +36 -12
- package/dist/server/routes/admin.d.ts +4 -0
- package/dist/server/routes/admin.js +113 -3
- package/dist/server/routes/agentRoles.js +3 -2
- package/dist/server/routes/agentSkills.js +3 -2
- package/dist/server/routes/agents.d.ts +7 -0
- package/dist/server/routes/agents.js +394 -39
- package/dist/server/routes/annotatedAttachments.js +3 -2
- package/dist/server/routes/auth.js +3 -1
- package/dist/server/routes/billing.js +5 -1
- package/dist/server/routes/durableTaskHttpRouters.d.ts +11 -2
- package/dist/server/routes/executorPhaseAApprovals.d.ts +19 -0
- package/dist/server/routes/executorPhaseAApprovals.js +140 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.d.ts +11 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.js +24 -0
- package/dist/server/routes/githubReviewEvidence.d.ts +19 -0
- package/dist/server/routes/githubReviewEvidence.js +116 -0
- package/dist/server/routes/localService.d.ts +15 -4
- package/dist/server/routes/localService.js +138 -40
- package/dist/server/routes/modelConnections.d.ts +24 -0
- package/dist/server/routes/modelConnections.js +205 -0
- package/dist/server/routes/primitives.d.ts +2 -0
- package/dist/server/routes/shared.d.ts +19 -0
- package/dist/server/routes/shared.js +95 -19
- package/dist/server/routes/sync.js +1 -0
- package/dist/server/routes/syncAuxRoutes.js +9 -2
- package/dist/server/routes/syncPullApplyRoutes.js +23 -4
- package/dist/server/routes/syncPushRoutes.d.ts +1 -0
- package/dist/server/routes/syncPushRoutes.js +1 -0
- package/dist/server/routes/syncV3FeedRoutes.js +27 -16
- package/dist/server/routes/syncV3LocalCaptureRoutes.js +28 -2
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +1 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +26 -0
- package/dist/server/routes/syncV3OperationRoutes.js +45 -9
- package/dist/server/routes/tasks.js +124 -13
- package/dist/server/routes/workflows.js +9 -1
- package/dist/server/routes/workspaces.js +43 -1
- package/dist/server/routes.js +59 -0
- package/dist/server/workspaceDeletionAdmission.d.ts +23 -0
- package/dist/server/workspaceDeletionAdmission.js +50 -0
- package/dist/service/localServiceCli.js +16 -0
- package/dist/service/localServiceClientLifecycle.js +36 -10
- package/dist/services/codexAppServerModelGateway.d.ts +161 -0
- package/dist/services/codexAppServerModelGateway.js +663 -0
- package/dist/services/codexDeviceCodeLoginManager.d.ts +39 -0
- package/dist/services/codexDeviceCodeLoginManager.js +265 -0
- package/dist/services/codexModelProviderConnectionLifecycle.d.ts +8 -0
- package/dist/services/codexModelProviderConnectionLifecycle.js +73 -0
- package/dist/services/executorPhaseAApprovalRuntime.d.ts +14 -0
- package/dist/services/executorPhaseAApprovalRuntime.js +24 -0
- package/dist/services/executorPhaseAApprovalService.d.ts +40 -0
- package/dist/services/executorPhaseAApprovalService.js +609 -0
- package/dist/services/executorPhaseADriftEvaluator.d.ts +78 -0
- package/dist/services/executorPhaseADriftEvaluator.js +93 -0
- package/dist/services/executorPhaseAIssuerCore.d.ts +126 -0
- package/dist/services/executorPhaseAIssuerCore.js +295 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.d.ts +34 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.js +158 -0
- package/dist/services/githubReviewEvidenceRuntime.d.ts +14 -0
- package/dist/services/githubReviewEvidenceRuntime.js +30 -0
- package/dist/services/githubReviewEvidenceService.d.ts +93 -0
- package/dist/services/githubReviewEvidenceService.js +336 -0
- package/dist/services/modelGateway.d.ts +7 -0
- package/dist/services/modelProviderConnectionService.d.ts +71 -0
- package/dist/services/modelProviderConnectionService.js +279 -0
- package/dist/services/modelProviderCredentialHome.d.ts +32 -0
- package/dist/services/modelProviderCredentialHome.js +271 -0
- package/dist/services/ownerScopedModelConnectionGateway.d.ts +12 -0
- package/dist/services/ownerScopedModelConnectionGateway.js +30 -0
- package/dist/services/taskforceAgentConnectionBindingService.d.ts +66 -0
- package/dist/services/taskforceAgentConnectionBindingService.js +185 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +8 -2
- package/dist/services/taskforceAgentMcpBridge.js +30 -27
- package/dist/shared/adminEdgeProxy.d.ts +5 -0
- package/dist/shared/adminEdgeProxy.js +94 -0
- package/dist/shared/adminProxySessionCookies.d.ts +16 -0
- package/dist/shared/adminProxySessionCookies.js +86 -0
- package/dist/shared/aiProfileColors.d.ts +31 -1
- package/dist/shared/aiProfileColors.js +14 -6
- package/dist/shared/executorPhaseAApprovalGoldenVector.json +269 -0
- package/dist/shared/executorPhaseAApprovalReceipt.d.ts +112 -0
- package/dist/shared/executorPhaseAApprovalReceipt.js +58 -0
- package/dist/shared/executorPhaseAApprovalTrustPolicy.json +10 -0
- package/dist/shared/executorPhaseADriftContracts.d.ts +37 -0
- package/dist/shared/executorPhaseADriftContracts.js +63 -0
- package/dist/shared/executorPhaseAIssuerContracts.d.ts +75 -0
- package/dist/shared/executorPhaseAIssuerContracts.js +90 -0
- package/dist/shared/executorPhaseARunAuthorization.d.ts +120 -0
- package/dist/shared/executorPhaseARunAuthorization.js +232 -0
- package/dist/shared/executorPhaseASchemaValidation.d.ts +7 -0
- package/dist/shared/executorPhaseASchemaValidation.js +53 -0
- package/dist/shared/executorPhaseASchemas/approval-receipt.schema.json +106 -0
- package/dist/shared/executorPhaseASchemas/drift-attestation.schema.json +54 -0
- package/dist/shared/executorPhaseASchemas/drift-request.schema.json +47 -0
- package/dist/shared/executorPhaseASchemas/foundation-manifest.schema.json +29 -0
- package/dist/shared/executorPhaseASchemas/issuer-audit-record.schema.json +24 -0
- package/dist/shared/executorPhaseASchemas/issuer-proof.schema.json +43 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-request.schema.json +18 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-response.schema.json +39 -0
- package/dist/shared/executorPhaseASchemas/logical-envelope.schema.json +149 -0
- package/dist/shared/executorPhaseASchemas/preflight-report.schema.json +216 -0
- package/dist/shared/executorPhaseASchemas/run-capability.schema.json +111 -0
- package/dist/shared/executorPhaseASchemas/sender-proof.schema.json +37 -0
- package/dist/shared/executorPhaseASchemas/workload-grant.schema.json +68 -0
- package/dist/shared/executorPhaseASchemas/workload-jwt-claims.schema.json +67 -0
- package/dist/shared/executorPhaseATiming.d.ts +1 -0
- package/dist/shared/executorPhaseATiming.js +1 -0
- package/dist/shared/planningIdentity.js +1 -1
- package/dist/shared/productLogoKeys.d.ts +2 -0
- package/dist/shared/productLogoKeys.js +18 -0
- package/dist/shared/taskforceAgentDefinition.d.ts +0 -1
- package/dist/shared/taskforceAgentDefinition.js +6 -3
- package/dist/shared/taskforceAgentModels.d.ts +1 -0
- package/dist/shared/taskforceAgentModels.js +36 -3
- package/dist/shared/userFeatureGrants.d.ts +4 -0
- package/dist/shared/userFeatureGrants.js +7 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.d.ts +37 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.js +81 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.d.ts +103 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.js +492 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.d.ts +26 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.js +89 -0
- package/dist/storage/modelProviderConnectionStore.d.ts +99 -0
- package/dist/storage/modelProviderConnectionStore.js +446 -0
- package/dist/storage/postgresAdapter.d.ts +24 -3
- package/dist/storage/postgresAdapter.js +117 -14
- package/dist/storage/postgresWorker.js +22 -5
- package/dist/storage/postgresWorkerProtocol.d.ts +30 -0
- package/dist/storage/postgresWorkerProtocol.js +30 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.d.ts +31 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.js +84 -0
- package/dist/sync/cloudSyncApi.d.ts +4 -1
- package/dist/sync/cloudSyncApi.js +7 -2
- package/dist/sync/contentSyncState.d.ts +1 -1
- package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +1 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +67 -30
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.d.ts +10 -0
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.js +29 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +6 -2
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.d.ts +15 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.js +99 -2
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.d.ts +1 -0
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.js +33 -4
- package/dist/sync/engine/workspaceSyncContentLifecycleAdapter.d.ts +2 -1
- package/dist/sync/engine/workspaceSyncContentVersionStore.d.ts +38 -0
- package/dist/sync/engine/workspaceSyncContentVersionStore.js +50 -1
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +20 -2
- package/dist/sync/engine/workspaceSyncEngineLifecyclePolicy.js +6 -6
- package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +4 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.js +11 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.d.ts +14 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.js +84 -0
- package/dist/sync/engine/workspaceSyncEngineRecovery.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +11 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +2 -1
- package/dist/sync/engine/workspaceSyncEngineRuntime.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +31 -4
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +3 -1
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +134 -43
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.js +6 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +1 -1
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +11 -4
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +29 -0
- package/dist/sync/syncApplyHandlers.d.ts +2 -0
- package/dist/sync/syncApplyHandlers.js +10 -1
- package/dist/sync/syncService.d.ts +17 -0
- package/dist/sync/syncService.js +87 -19
- package/dist/sync/taskforceAgentSyncAuthorization.d.ts +16 -0
- package/dist/sync/taskforceAgentSyncAuthorization.js +20 -0
- package/dist/sync/v3/combinedFeedCapability.js +8 -0
- package/dist/sync/v3/durableInitiativeMutationRouter.js +18 -10
- package/dist/sync/v3/durableOperationReplay.d.ts +14 -0
- package/dist/sync/v3/durableOperationReplay.js +18 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +2 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +14 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +4 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +62 -15
- package/dist/sync/v3/durableTaskCommentMutationRouter.js +3 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +1 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +30 -8
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +5 -3
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +37 -2
- package/dist/sync/v3/durableTaxonomyMutationRouter.js +5 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +11 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +39 -10
- package/dist/sync/v3/durableWorkstreamMutationRouter.js +18 -10
- package/dist/sync/v3/durableWorkstreamTaskOrderMutationRouter.js +16 -5
- package/dist/sync/v3/localOutboxDispatchRuntime.js +2 -2
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +47 -7
- package/dist/sync/v3/localTaskChecklistOutboxHandler.js +16 -2
- package/dist/sync/v3/localTaskChecklistOutboxService.d.ts +4 -0
- package/dist/sync/v3/localTaskChecklistOutboxService.js +14 -1
- package/dist/sync/v3/localTaskCreateOutboxService.js +15 -6
- package/dist/sync/v3/localTaskMetadataClient.d.ts +1 -0
- package/dist/sync/v3/localTaskMetadataClient.js +1 -0
- package/dist/sync/v3/localTaskMetadataOutboxHandler.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskMetadataOutboxService.js +7 -0
- package/dist/sync/v3/localTaskRestoreOutboxService.js +14 -6
- package/dist/sync/v3/localTaskStatusClient.d.ts +1 -0
- package/dist/sync/v3/localTaskStatusClient.js +6 -1
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +10 -0
- package/dist/sync/v3/localTaskStatusOutboxService.js +272 -24
- package/dist/sync/v3/syncDurabilityStore.d.ts +41 -0
- package/dist/sync/v3/syncDurabilityStore.js +199 -13
- package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +6 -4
- package/dist/sync/v3/taskAttachmentLinksMutationService.js +19 -10
- package/dist/sync/v3/taskChecklistMutationService.d.ts +15 -2
- package/dist/sync/v3/taskChecklistMutationService.js +48 -1
- package/dist/sync/v3/taskCreateMutationService.d.ts +2 -2
- package/dist/sync/v3/taskCreateMutationService.js +7 -4
- package/dist/sync/v3/taskMetadataMutationService.d.ts +3 -0
- package/dist/sync/v3/taskMetadataMutationService.js +4 -0
- package/dist/sync/v3/taskRestoreMutationService.d.ts +2 -2
- package/dist/sync/v3/taskRestoreMutationService.js +7 -4
- package/dist/sync/v3/taskStatusMutationService.d.ts +31 -1
- package/dist/sync/v3/taskStatusMutationService.js +123 -3
- package/dist/sync/v3/workflowAssignmentSync.d.ts +6 -0
- package/dist/sync/v3/workflowAssignmentSync.js +30 -0
- package/dist/sync/v3/workspaceSyncJournalReader.js +1 -1
- package/dist/sync/v3/workspaceSyncOperationRetentionService.d.ts +16 -0
- package/dist/sync/v3/workspaceSyncOperationRetentionService.js +83 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +13 -3
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.d.ts +11 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.js +27 -10
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.js +52 -10
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +18 -3
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +8 -3
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +51 -10
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +14 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +49 -25
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +13 -4
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +124 -57
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +20 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +106 -30
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +4 -1
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +34 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +12 -0
- package/dist/sync/v3/workspaceSyncV3FeedProfile.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.js +23 -10
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.js +64 -13
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.d.ts +9 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.js +26 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +15 -5
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +50 -14
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.js +11 -3
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +5 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +55 -9
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.d.ts +17 -0
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.js +64 -0
- package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.js +9 -2
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.js +37 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.d.ts +6 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.js +9 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverCoverage.js +33 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.js +8 -0
- package/dist/sync/workspacePullFeed.js +2 -1
- package/dist/sync/workspaceRepair.d.ts +8 -2
- package/dist/sync/workspaceRepair.js +222 -6
- package/dist/sync/workspaceSyncModel.d.ts +21 -0
- package/dist/sync/workspaceSyncModel.js +35 -7
- package/dist/sync/workspaceSyncState.d.ts +1 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.d.ts +6 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.js +5 -0
- package/dist/types.d.ts +47 -1
- package/dist/types.js +6 -0
- package/dist/ui/assets/AiIdentityRosterCard-OcSz1PkK.js +1 -0
- package/dist/ui/assets/AiProfilesModule-ByhYW5Xi.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BTM6nIg_.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-TzYu7pkG.css +1 -0
- package/dist/ui/assets/{AssetTraySortControl-Kf1pelSy.js → AssetTraySortControl-DabEG8L4.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-B8boOs6Q.js → ContextAttachmentManager-Coa8yVGM.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-DXH4XUsB.js → DocumentWorkspace-BB0qhdix.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BtSTq0ON.js → EntityActivityTimeline-CZ8x4UJE.js} +1 -1
- package/dist/ui/assets/PlanningModule-pRPjR7v5.js +1 -0
- package/dist/ui/assets/PlansPage-D86pZSSl.js +1 -0
- package/dist/ui/assets/TaskContextUpload-BVIkU9yT.js +1 -0
- package/dist/ui/assets/TaskSettings-Cv1mNhv_.js +12 -0
- package/dist/ui/assets/TaskforceAgentsModule-b-8R25cJ.css +1 -0
- package/dist/ui/assets/TaskforceAgentsModule-gmH-PD2q.js +24 -0
- package/dist/ui/assets/{WorkflowManagerModule-DWFspC-o.js → WorkflowManagerModule-DbfnHJ-f.js} +1 -1
- package/dist/ui/assets/index-BZ-hdZSk.css +1 -0
- package/dist/ui/assets/index-CTsDBaef.js +7 -0
- package/dist/ui/assets/{vendor-icons-BkFLXavV.js → vendor-icons-Bsq-mcEn.js} +1 -1
- package/dist/ui/branding/logos/letterhead_dark.png +0 -0
- package/dist/ui/branding/logos/letterhead_light.png +0 -0
- package/dist/ui/branding/logos/signature_dark.png +0 -0
- package/dist/ui/branding/logos/signature_light.png +0 -0
- package/dist/ui/index.html +3 -3
- package/dist/utils/aiProfileDefaultLogo.js +16 -48
- package/dist/utils/httpSetCookie.d.ts +1 -0
- package/dist/utils/httpSetCookie.js +4 -1
- package/dist/utils/localRuntimeUrl.d.ts +1 -0
- package/dist/utils/localRuntimeUrl.js +14 -0
- package/dist/utils/productLogoRegistry.d.ts +2 -0
- package/dist/utils/productLogoRegistry.js +36 -0
- package/dist/utils/syncStatusPresentation.d.ts +4 -0
- package/dist/utils/syncStatusPresentation.js +17 -0
- package/dist/utils/taskActivity.d.ts +3 -2
- package/dist/utils/taskActivity.js +19 -2
- package/dist/utils/taskEditorReconciliation.d.ts +40 -0
- package/dist/utils/taskEditorReconciliation.js +217 -0
- package/dist/utils/taskEvents.d.ts +2 -0
- package/dist/utils/taskNormalization.d.ts +1 -0
- package/dist/utils/taskNormalization.js +39 -0
- package/dist/utils/taskSearch.js +2 -2
- package/dist/utils/uiNotice.d.ts +4 -0
- package/dist/utils/workspaceSyncPresentation.d.ts +1 -1
- package/dist/utils/workspaceSyncPresentation.js +23 -17
- package/package.json +36 -6
- package/dist/ui/assets/AiIdentityRosterCard-MZs7lVED.js +0 -1
- package/dist/ui/assets/AiProfilesModule-C3i0LOxe.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-DVZk5Tln.js +0 -3
- package/dist/ui/assets/PlanningModule-BPVyEa-f.js +0 -1
- package/dist/ui/assets/PlansPage-ChqgxALc.js +0 -1
- package/dist/ui/assets/TaskContextUpload-CB3ol0sN.js +0 -1
- package/dist/ui/assets/TaskSettings-g4ECKNOz.js +0 -12
- package/dist/ui/assets/TaskforceAgentsModule-BazdUwxZ.js +0 -21
- package/dist/ui/assets/TaskforceAgentsModule-D6IC0S7Q.css +0 -1
- package/dist/ui/assets/index-BUplSsv_.js +0 -7
- package/dist/ui/assets/index-gz2EXuoK.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as a,j as t}from"./vendor-react-CKJs5o3c.js";import{am as Pe,an as We,ao as De,ap as Fe,aq as ke,ar as le,T as He,as as me,at as ne,au as Y,av as U,aw as q,ax as Be,ay as Me,az as Ue,aA as Ge,aB as Ve,aC as Ke,aD as Ce,aE as Ee,aF as ce,aG as Se,aH as qe,aI as Qe,aJ as Je,aK as Xe,aL as Ye}from"./index-BUplSsv_.js";import{w as re,Z as we,R as oe,aj as Ze,ak as et,S as tt,X as xe,al as it,ah as nt,t as ae,ai as be,V as se,q as at,Y as st,a7 as rt}from"./vendor-icons-BkFLXavV.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const ot="_module_3zich_1",lt="_columns_3zich_15",ct="_column_3zich_15",dt="_columnHeader_3zich_36",ut="_columnHeadingGroup_3zich_49",ht="_paneHeading_3zich_56",vt="_responsiveBack_3zich_60",pt="_sectionLabel_3zich_64",ft="_sectionHeadingRow_3zich_68",yt="_headerActions_3zich_81",gt="_portfolioControls_3zich_87",kt="_searchRow_3zich_95",mt="_searchShell_3zich_101",wt="_clearSearch_3zich_139",xt="_controlActive_3zich_160",bt="_filterPanel_3zich_166",jt="_filterField_3zich_177",_t="_filterLabel_3zich_184",Ct="_filterDropdown_3zich_190",Et="_sortTrigger_3zich_204",St="_scrollRegion_3zich_217",It="_selectedEntityContext_3zich_227",Nt="_selectedEntityContextArchived_3zich_237",At="_selectedEntityReferenceRow_3zich_242",Rt="_selectedEntityReferenceIdentity_3zich_257",Ot="_selectedEntityReferenceActions_3zich_264",zt="_workspaceEditor_3zich_278",Tt="_workspaceEditorField_3zich_294",Lt="_workspaceEditorActions_3zich_337",$t="_selectedEntityDescription_3zich_348",Pt="_selectedEntityDescriptionMarkdown_3zich_355",Wt="_selectedEntityOwnerField_3zich_361",Dt="_selectedEntityOwnerDropdown_3zich_373",Ft="_selectedEntityDetailsSection_3zich_377",Ht="_activityTimelineList_3zich_382",Bt="_activityTimelineEmpty_3zich_389",Mt="_visuallyHidden_3zich_393",Ut="_entityCard_3zich_405",Gt="_entityCardTopRow_3zich_426",Vt="_entityCardBody_3zich_433",Kt="_entityCardContentButton_3zich_437",qt="_entityCardSelected_3zich_447",Qt="_entityCardArchived_3zich_455",Jt="_relationshipPickerRow_3zich_460",Xt="_relationshipRecovery_3zich_466",Yt="_empty_3zich_488",Zt="_centerState_3zich_495",ei="_inlineError_3zich_509",ti="_spinner_3zich_524",ii="_columnPortfolio_3zich_543",ni="_columnActive_3zich_544",ai="_columnWorkstreams_3zich_545",si="_columnTasks_3zich_550",ri="_workspaceEditorIdentity_3zich_592",n={module:ot,columns:lt,column:ct,columnHeader:dt,columnHeadingGroup:ut,paneHeading:ht,responsiveBack:vt,sectionLabel:pt,sectionHeadingRow:ft,headerActions:yt,portfolioControls:gt,searchRow:kt,searchShell:mt,clearSearch:wt,controlActive:xt,filterPanel:bt,filterField:jt,filterLabel:_t,filterDropdown:Ct,sortTrigger:Et,scrollRegion:St,selectedEntityContext:It,selectedEntityContextArchived:Nt,selectedEntityReferenceRow:At,selectedEntityReferenceIdentity:Rt,selectedEntityReferenceActions:Ot,workspaceEditor:zt,workspaceEditorField:Tt,workspaceEditorActions:Lt,selectedEntityDescription:$t,selectedEntityDescriptionMarkdown:Pt,selectedEntityOwnerField:Wt,selectedEntityOwnerDropdown:Dt,selectedEntityDetailsSection:Ft,activityTimelineList:Ht,activityTimelineEmpty:Bt,visuallyHidden:Mt,entityCard:Ut,entityCardTopRow:Gt,entityCardBody:Vt,entityCardContentButton:Kt,entityCardSelected:qt,entityCardArchived:Qt,relationshipPickerRow:Jt,relationshipRecovery:Xt,empty:Yt,centerState:Zt,inlineError:ei,spinner:ti,columnPortfolio:ii,columnActive:ni,columnWorkstreams:ai,columnTasks:si,workspaceEditorIdentity:ri};function Z({entityType:e,mode:l,initialTitle:j="",initialDescription:m="",ownerOptions:p,fixedInitiativeId:f,formId:S,showActions:I=!0,onSavingChange:_,onCancel:A,onSave:T}){const w=e==="initiative"?"Initiative":"Workstream",H=a.useId(),$=a.useId(),P=a.useId(),y=a.useRef(null),[G,B]=a.useState(j),[C,g]=a.useState(m),[M,W]=a.useState(""),[k,L]=a.useState(null),[E,R]=a.useState(null),[c,b]=a.useState(null),[D,F]=a.useState(null),[x,N]=a.useState(!1);a.useEffect(()=>{y.current?.focus()},[]);const O=async u=>{if(u.preventDefault(),x)return;const h=G.trim();if(!h){b(`${w} title is required.`),y.current?.focus();return}b(null),F(null),N(!0),_?.(!0);try{await T({title:h,description:C.trim()||null,...l==="create"?{ownerId:M.trim()||null}:{},...e==="workstream"&&l==="create"?{initiativeId:f||null}:{},...l==="create"&&(k||E)?{icon:k,color:E}:{}})}catch(z){F(z instanceof Error?z.message:`Failed to save ${w.toLowerCase()}.`)}finally{N(!1),_?.(!1)}};return t.jsxs("form",{id:S,className:n.workspaceEditor,onSubmit:u=>{O(u)},onKeyDown:u=>{u.key!=="Escape"||x||(u.preventDefault(),A())},noValidate:!0,children:[l==="create"?t.jsxs("div",{className:n.workspaceEditorIdentity,children:[t.jsx(Ce,{entityType:e,entityId:"create-preview",icon:k,color:E||"blue",size:"detail",onChange:u=>{Object.prototype.hasOwnProperty.call(u,"icon")&&L(u.icon??null),Object.prototype.hasOwnProperty.call(u,"color")&&R(u.color??null)}}),t.jsx("span",{children:"Choose an icon and color"})]}):null,t.jsxs("div",{className:n.workspaceEditorField,children:[t.jsxs("label",{htmlFor:H,children:[w," title"]}),t.jsx("input",{ref:y,id:H,value:G,disabled:x,required:!0,"aria-invalid":c?"true":void 0,"aria-describedby":c?$:void 0,onChange:u=>{B(u.target.value),c&&b(null)},placeholder:e==="initiative"?"Enter initiative title":"Enter workstream title"}),c?t.jsx("p",{id:$,className:"tf-text-error",children:c}):null]}),t.jsxs("div",{className:n.workspaceEditorField,children:[t.jsxs("label",{htmlFor:P,children:[w," description"]}),t.jsx("textarea",{id:P,value:C,disabled:x,rows:5,onChange:u=>g(u.target.value),placeholder:e==="initiative"?"Describe the broader outcome this initiative is meant to achieve.":"Describe the lane of work this workstream will coordinate."})]}),l==="create"&&p?t.jsxs("div",{className:n.workspaceEditorField,children:[t.jsxs("span",{children:[w," owner"]}),t.jsx(le,{value:M,options:p,onChange:W,disabled:x,ariaLabel:`${w} owner`,className:`${Ee.control} ${n.selectedEntityOwnerDropdown}`})]}):null,D?t.jsx("p",{className:"tf-text-error",role:"alert",children:D}):null,I?t.jsxs("div",{className:n.workspaceEditorActions,children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:A,disabled:x,children:"Cancel"}),t.jsxs("button",{type:"submit",className:"tf-button-primary tf-button-compact",disabled:x,children:[x?t.jsx(re,{size:14,className:n.spinner,"aria-hidden":"true"}):null,l==="create"?`Create ${w}`:"Save"]})]}):null]})}function oi({initiative:e,ownerOption:l,ownerOptions:j,workstreamCount:m,selected:p,onSelect:f,onChangeOwner:S,onChangeIdentity:I}){return t.jsxs("div",{className:`${n.entityCard} ${e.isArchived?n.entityCardArchived:""} ${p?n.entityCardSelected:""}`.trim(),children:[t.jsx(ce,{label:q(e),entityType:"initiative",entityName:e.title,interactive:!1}),t.jsx("div",{className:n.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:n.entityCardContentButton,onClick:f,onKeyDown:_=>{_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),f())},"aria-pressed":p,children:t.jsx(Se,{item:e,entityType:"initiative",workstreamCount:m,ownerOption:l,ownerOptions:j,onChangeOwner:S,onChangeIdentity:I})})})]})}function je({workstream:e,ownerOption:l,ownerOptions:j,selected:m,onSelect:p,onChangeOwner:f,onChangeIdentity:S,referenceAction:I,feedback:_}){const A=U(e);return t.jsxs("div",{className:`${n.entityCard} ${e.isArchived?n.entityCardArchived:""} ${m?n.entityCardSelected:""}`.trim(),children:[t.jsxs("div",{className:n.entityCardTopRow,children:[I,t.jsx(ce,{label:A||"Reference pending",entityType:"workstream",entityName:e.title,interactive:!1,pending:!A})]}),_,t.jsx("div",{className:n.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:n.entityCardContentButton,onClick:p,onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),p())},"aria-pressed":m,children:t.jsx(Se,{item:e,entityType:"workstream",ownerOption:l,ownerOptions:j,onChangeOwner:f,onChangeIdentity:S})})})]})}function _e({item:e,entityType:l,ownerOptions:j,onChangeOwner:m,onChangeIdentity:p,workspaceId:f,currentActorId:S,taskReferences:I,hydrationState:_,onRetryHydration:A,onAddContextFile:T,onRemoveContextFile:w,onUpdateContextCaption:H,onUpdate:$,onArchive:P,onUnarchive:y,referenceAction:G,relationshipActions:B,relationshipContent:C}){const g=l==="initiative"?"Initiative":"Workstream",M=l==="initiative"?q(e):U(e),[W,k]=a.useState(String(e.ownerId||"")),[L,E]=a.useState(!1),[R,c]=a.useState(!1),[b,D]=a.useState(!1),[F,x]=a.useState(!1),[N,O]=a.useState(!1),u=a.useId(),h=qe({entityType:l,isArchived:e.isArchived,taskCount:e.taskCount,completedTaskCount:e.completedTaskCount,archiveReady:e.archiveReady,activeWorkstreamCount:e.archiveActiveWorkstreamCount}),z=h.mode==="archived"?`Unarchive ${g.toLowerCase()}`:h.mode==="blocked"?`Archive unavailable — active ${h.remainingKind==="task"?"tasks":"workstreams"} remain`:h.mode==="checking"?"Archive availability is still loading":`Archive ${g.toLowerCase()}`;a.useEffect(()=>{k(String(e.ownerId||"")),E(!1)},[e.id,e.ownerId]),a.useEffect(()=>{c(!1),D(!1),x(!1),O(!1)},[e.id]);const J=async d=>{if(!m||e.isArchived||L||d===W)return;const s=W;k(d),E(!0);try{await m(d)}catch{k(s)}finally{E(!1)}},Q=async()=>{if(N)return;if(h.mode==="ready"){x(!0);return}const d=h.mode==="archived"?y:P;if(!(!d||h.mode==="blocked"||h.mode==="checking")){O(!0);try{await d()}finally{O(!1)}}},r=async()=>{if(!(!P||N)){O(!0);try{await P()!==!1&&x(!1)}finally{O(!1)}}};return t.jsxs("section",{className:`${n.selectedEntityContext} ${e.isArchived?n.selectedEntityContextArchived:""}`.trim(),"aria-label":`Selected ${g.toLowerCase()}`,"aria-busy":_?.status==="loading",children:[t.jsxs("div",{className:n.selectedEntityReferenceRow,children:[t.jsxs("div",{className:n.selectedEntityReferenceIdentity,children:[t.jsx(Ce,{entityType:l,entityId:e.id,icon:e.icon,color:e.color,size:"detail",disabled:!!e.isArchived,onChange:p?d=>p(l,e.id,d):void 0}),G,t.jsx(ce,{label:M||"Reference pending",entityType:l,entityName:e.title,interactive:!1,pending:!M})]}),t.jsxs("div",{className:n.selectedEntityReferenceActions,children:[t.jsx("span",{children:g}),B,!R&&(P||y)?t.jsx("button",{type:"button",className:"tf-control-icon",disabled:N||h.mode==="blocked"||h.mode==="checking"||(h.mode==="archived"?!y:!P),onClick:()=>{Q()},"aria-label":z,title:z,"aria-expanded":h.mode==="ready"?F:void 0,children:h.mode==="archived"?t.jsx(oe,{size:14,"aria-hidden":"true"}):t.jsx(st,{size:14,"aria-hidden":"true"})}):null,!R&&!e.isArchived&&$?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>c(!0),"aria-label":`Edit ${g.toLowerCase()}`,title:`Edit ${g.toLowerCase()}`,children:t.jsx(rt,{size:14,"aria-hidden":"true"})}):null,R?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>c(!1),disabled:b,children:"Cancel"}),t.jsx("button",{type:"submit",form:u,className:"tf-button-primary tf-button-compact",disabled:b,children:"Save"})]}):null]})]}),F&&h.mode==="ready"?t.jsx(Qe,{entityType:l,title:e.title,activeTaskCount:e.archiveActiveTaskCount,activeWorkstreamCount:e.archiveActiveWorkstreamCount,busy:N,onCancel:()=>x(!1),onConfirm:()=>{r()}}):null,C,R&&$?t.jsx(Z,{entityType:l,mode:"edit",formId:u,showActions:!1,onSavingChange:D,initialTitle:e.title,initialDescription:e.description||"",onCancel:()=>c(!1),onSave:async d=>{await $(d),c(!1)}},`${l}:${e.id}`):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"tf-heading-card",children:e.title}),t.jsx(Je,{description:e.description,label:g,taskReferences:I,className:`${n.selectedEntityDescription} tf-scrollbar`.trim(),markdownClassName:n.selectedEntityDescriptionMarkdown})]}),t.jsxs("div",{className:n.selectedEntityOwnerField,children:[t.jsx("span",{children:"Owner"}),t.jsx(le,{value:W,options:j,onChange:d=>{J(d)},disabled:!m||!!e.isArchived||L,ariaLabel:`${g} owner`,className:`${Ee.control} ${n.selectedEntityOwnerDropdown}`})]}),t.jsx("div",{className:n.selectedEntityDetailsSection,children:t.jsx(Xe,{entityType:l,entityId:e.id,referenceLabel:l==="initiative"?q(e):U(e),workspaceId:f,attachments:e.attachments,readOnly:!!e.isArchived,defaultExpanded:!1,onAddAttachment:!e.isArchived&&T?d=>T(l,e.id,d):void 0,onRemoveAttachment:!e.isArchived&&w?d=>w(l,e.id,d):void 0,onUpdateAttachmentCaption:!e.isArchived&&H?(d,s)=>H(l,e.id,d,s):void 0})}),t.jsx("div",{className:n.selectedEntityDetailsSection,children:t.jsx(Ye,{entityType:l,item:e,assigneeOptions:j,currentActorId:S,taskReferences:I,defaultExpanded:!1,listClassName:n.activityTimelineList,emptyClassName:n.activityTimelineEmpty,hydrationState:_,onRetryHydration:A})})]})}function pi({model:e}){const[l,j]=a.useState(null),[m,p]=a.useState(null),[f,S]=a.useState("portfolio"),[I,_]=a.useState(""),[A,T]=a.useState("all"),[w,H]=a.useState("default"),[$,P]=a.useState(!1),[y,G]=a.useState(!1),B=e.taskArrangeMode||"execution",[C,g]=a.useState(null),[M,W]=a.useState(!1),[k,L]=a.useState(null),[E,R]=a.useState(null),[c,b]=a.useState(!1),D=a.useRef(null),F=a.useRef(null),x=a.useRef(null),N=a.useRef(null),O=a.useRef(null),u=a.useMemo(()=>new Map(e.assigneeOptions.filter(i=>!String(i.archivedAt||"").trim()).map(i=>[String(i.value),i])),[e.assigneeOptions]),h=a.useMemo(()=>{const i=String(e.currentOwnerId||"").trim(),o=i?Pe(e.assigneeOptions,i).find(v=>v.value===i):void 0;return[{value:"all",label:"All owners",icon:"Users",color:"var(--text-secondary)",kind:"unassigned"},...i?[{...o,value:"mine",label:"Owned by me",icon:o?.icon||"User",color:o?.color||"var(--text-secondary)",kind:o?.kind||"member"}]:[],{value:"unassigned",label:"Unassigned",icon:De,color:We,kind:"unassigned"}]},[e.assigneeOptions,e.currentOwnerId]),z=a.useMemo(()=>Fe({initiatives:e.initiatives,standaloneWorkstreams:e.standaloneWorkstreams,showArchivedPlanning:y,searchQuery:I,ownerFilter:A,currentOwnerId:String(e.currentOwnerId||""),sort:w}),[e.currentOwnerId,e.initiatives,e.standaloneWorkstreams,A,I,y,w]),J=a.useMemo(()=>z.initiatives.map(({initiative:i})=>i),[z.initiatives]),Q=z.standaloneWorkstreams,r=a.useMemo(()=>e.initiatives.find(i=>i.id===l)??null,[e.initiatives,l]),d=a.useMemo(()=>[...e.initiatives.flatMap(i=>i.allWorkstreams??i.workstreams),...e.standaloneWorkstreams],[e.initiatives,e.standaloneWorkstreams]),s=a.useMemo(()=>d.find(i=>i.id===m)??null,[d,m]),ee=r?(r.allWorkstreams??r.workstreams).filter(i=>y||!i.isArchived):s&&!s.initiativeId?[s]:[],te=a.useMemo(()=>ke((s?.tasks??[]).filter(i=>y||!i.isArchived),B),[s?.tasks,y,B]),de=a.useMemo(()=>new Set((r?.allWorkstreams??r?.workstreams??[]).map(i=>i.id)),[r]),ue=a.useMemo(()=>new Set((s?.tasks??[]).map(i=>i.id)),[s]),Ie=a.useMemo(()=>e.linkOptions.workstreams.filter(i=>!de.has(i.id)),[de,e.linkOptions.workstreams]),Ne=a.useMemo(()=>e.linkOptions.tasks.filter(i=>!ue.has(i.id)),[ue,e.linkOptions.tasks]),V=s?"workstream":r?"initiative":null,K=s?.id||r?.id||null,he=V&&K?e.hydrationStateByEntity?.[`${V}:${K}`]:void 0,ve=a.useMemo(()=>e.initiatives.some(o=>o.isArchived)?!0:[...e.initiatives.flatMap(o=>o.allWorkstreams??o.workstreams),...e.standaloneWorkstreams].some(o=>o.isArchived||(o.tasks??[]).some(v=>v.isArchived)),[e.initiatives,e.standaloneWorkstreams]);a.useEffect(()=>{const i=O.current;if(i){if(i.entityType==="initiative"){if(!e.initiatives.some(o=>o.id===i.entityId))return;O.current=null,j(i.entityId),p(null),N.current="workstreams",S("workstreams");return}d.some(o=>o.id===i.entityId)&&(O.current=null,j(i.initiativeId||null),p(i.entityId),N.current="tasks",S("tasks"))}},[d,e.initiatives]),a.useEffect(()=>{l&&!r&&(j(null),p(null),S("portfolio"))},[r,l]),a.useEffect(()=>{m&&!s&&(p(null),S(r?"workstreams":"portfolio"))},[r,s,m]),a.useEffect(()=>{!e.hydrateEntity||!V||!K||e.hydrateEntity(V,K)},[e.hydrateEntity,K,V]),a.useEffect(()=>{W(!1),L(null),R(null),b(!1)},[K,V]),a.useLayoutEffect(()=>{if(N.current!==f)return;(f==="portfolio"?D.current:f==="workstreams"?F.current:x.current)?.focus({preventScroll:!0}),N.current=null},[f]);const X=i=>{if(i===f){(i==="portfolio"?D.current:i==="workstreams"?F.current:x.current)?.focus({preventScroll:!0});return}N.current=i,S(i)},Ae=i=>{j(i),p(null),X("workstreams")},pe=i=>{i.initiativeId||j(null),p(i.id),X("tasks")},Re=()=>{X(r?"workstreams":"portfolio")},Oe=z.hasCriteria||w!=="default",ze=()=>{_(""),T("all"),H("default")},ie=async i=>{if(!C||!e.createEntity)return;const o=await e.createEntity(C.entityType,i);O.current={entityType:C.entityType,entityId:o.id,initiativeId:C.initiativeId},g(null)},fe=async(i,o)=>{if(c)return;const v=i==="workstream"?e.attachWorkstreamToInitiative:e.attachTaskToWorkstream,ge=i==="workstream"?r?.id:s?.id;if(!(!v||!ge)){b(!0);try{await v(ge,o.referenceLabel)}finally{b(!1)}}},Te=async i=>{if(!(!s||!e.assignWorkstreamToInitiative||c)){b(!0);try{await e.assignWorkstreamToInitiative(s.id,i.referenceLabel)!==!1&&(j(i.id),W(!1))}finally{b(!1)}}},Le=async()=>{if(!(!k||c)){b(!0);try{if(k.entityType==="workstream"){if(!e.assignWorkstreamToInitiative)return;const i=r?q(r):null;if(await e.assignWorkstreamToInitiative(k.id,null)===!1)return;R({pane:k.id===s?.id?"tasks":"workstreams",message:`${k.referenceLabel} removed from its initiative.`,onUndo:async()=>{if(!i)return;await e.assignWorkstreamToInitiative?.(k.id,i)!==!1&&R(null)}})}else{if(!e.assignTaskToWorkstream||!s)return;const i=s.id;if(await e.assignTaskToWorkstream(k.id,null)===!1)return;R({pane:"tasks",message:`${k.referenceLabel} removed from this workstream.`,onUndo:async()=>{await e.assignTaskToWorkstream?.(k.id,i)!==!1&&R(null)}})}L(null)}finally{b(!1)}}},$e=async()=>{if(!(!E||c)){b(!0);try{await E.onUndo()}finally{b(!1)}}},ye=E?t.jsxs("div",{className:n.relationshipRecovery,role:"status",children:[t.jsx("span",{children:E.message}),t.jsx("button",{type:"button",className:"tf-button-ghost tf-button-compact",disabled:c,onClick:()=>{$e()},children:c?"Restoring…":"Undo"})]}):null;return e.loadState.status==="loading"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:n.centerState,"aria-busy":"true","aria-label":"Loading planning workspace",children:[t.jsx(re,{size:22,className:n.spinner}),t.jsx("span",{children:"Loading planning…"})]}):e.loadState.status==="error"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:n.centerState,role:"alert",children:[t.jsx(we,{size:22}),t.jsx("strong",{children:"Planning could not be loaded."}),t.jsx("span",{children:e.loadState.error}),t.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,disabled:e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx(re,{size:15,className:n.spinner}):t.jsx(oe,{size:15}),"Retry"]})]}):t.jsxs("main",{className:n.module,"aria-label":"Planning workspace","aria-busy":e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx("span",{className:n.visuallyHidden,role:"status","aria-live":"polite",children:"Refreshing planning"}):null,(e.loadState.status==="partial"||e.loadState.status==="error")&&t.jsxs("div",{className:n.inlineError,role:"alert",children:[t.jsx(we,{size:16}),t.jsx("span",{children:e.loadState.error||"Some planning information could not be loaded."}),t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,children:"Retry"})]}),t.jsxs("div",{className:n.columns,"data-active-pane":f,children:[t.jsxs("section",{className:`${n.column} ${n.columnPortfolio} ${f==="portfolio"?n.columnActive:""}`.trim(),"aria-labelledby":"planning-portfolio-heading",children:[t.jsxs("div",{className:n.columnHeader,children:[t.jsx("h2",{ref:D,id:"planning-portfolio-heading",className:`tf-heading-section ${n.paneHeading}`,tabIndex:-1,children:"Portfolio"}),t.jsxs("div",{className:n.headerActions,children:[t.jsx("span",{children:J.length+Q.length}),t.jsx("button",{type:"button",className:`tf-control-icon ${y?n.controlActive:""}`.trim(),onClick:()=>G(i=>!i),disabled:!ve,"aria-label":y?"Hide archived planning items":"Show archived planning items","aria-pressed":y,title:ve?y?"Hide archived planning items":"Show archived planning items":"No archived planning items",children:y?t.jsx(Ze,{size:15,"aria-hidden":"true"}):t.jsx(et,{size:15,"aria-hidden":"true"})})]})]}),t.jsxs("div",{className:n.portfolioControls,children:[t.jsxs("div",{className:n.searchRow,children:[t.jsxs("div",{className:n.searchShell,children:[t.jsx(tt,{size:14,"aria-hidden":"true"}),t.jsx("input",{type:"search",value:I,onChange:i=>_(i.target.value),placeholder:"Search initiatives and workstreams","aria-label":"Search planning"}),I?t.jsx("button",{type:"button",className:n.clearSearch,onClick:()=>_(""),"aria-label":"Clear planning search",title:"Clear search",children:t.jsx(xe,{size:13,"aria-hidden":"true"})}):null]}),t.jsx("button",{type:"button",className:`tf-control-icon ${$||A!=="all"||w!=="default"?n.controlActive:""}`.trim(),"aria-label":"Filter and sort planning",title:"Filter and sort planning","aria-expanded":$,"aria-controls":"planning-workspace-navigator-options",onClick:()=>P(i=>!i),children:t.jsx(it,{size:15,"aria-hidden":"true"})})]}),$?t.jsxs("div",{id:"planning-workspace-navigator-options",className:n.filterPanel,children:[t.jsxs("div",{className:n.filterField,children:[t.jsx("span",{className:n.filterLabel,children:"Owner"}),t.jsx(le,{value:A,options:e.assigneeOptions,leadingOptions:h,includeUnassigned:!1,onChange:T,disabled:!1,ariaLabel:"Filter planning by owner",className:n.filterDropdown})]}),t.jsxs("div",{className:n.filterField,children:[t.jsx("span",{className:n.filterLabel,children:"Sort"}),t.jsx(He,{value:w,options:me,onChange:i=>H(String(i)),ariaLabel:"Sort planning",className:n.filterDropdown,portalPanel:!0,panelAlign:"start",triggerContent:t.jsxs("span",{className:n.sortTrigger,children:[t.jsx(nt,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:me.find(i=>i.value===w)?.label})]}),renderOptionContent:i=>i.label})]}),t.jsx("button",{type:"button",className:"tf-control-icon",onClick:ze,disabled:!Oe,"aria-label":"Reset planning filters and sort",title:"Reset planning filters and sort",children:t.jsx(oe,{size:14,"aria-hidden":"true"})})]}):null]}),t.jsxs("div",{className:n.scrollRegion,children:[t.jsxs("div",{className:n.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${n.sectionLabel}`,children:"Initiatives"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>g({entityType:"initiative"}),"aria-label":"Create initiative",title:"Create initiative",children:t.jsx(ae,{size:15,"aria-hidden":"true"})}):null]}),C?.entityType==="initiative"?t.jsx(Z,{entityType:"initiative",mode:"create",ownerOptions:e.assigneeOptions,onCancel:()=>g(null),onSave:ie}):null,z.initiatives.map(({initiative:i,workstreams:o})=>t.jsx(oi,{initiative:i,workstreamCount:o.length,ownerOption:i.ownerId?u.get(i.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:l===i.id,onSelect:()=>Ae(i.id),onChangeOwner:e.changeOwner?v=>e.changeOwner?.("initiative",i.id,v==="unassigned"?"":v):void 0,onChangeIdentity:e.changeIdentity?v=>e.changeIdentity?.("initiative",i.id,v):void 0},i.id)),t.jsxs("div",{className:n.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${n.sectionLabel}`,children:"Standalone workstreams"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>g({entityType:"workstream",initiativeId:null}),"aria-label":"Create standalone workstream",title:"Create standalone workstream",children:t.jsx(ae,{size:15,"aria-hidden":"true"})}):null]}),C?.entityType==="workstream"&&!C.initiativeId?t.jsx(Z,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:null,onCancel:()=>g(null),onSave:ie}):null,Q.map(i=>t.jsx(je,{workstream:i,ownerOption:i.ownerId?u.get(i.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:m===i.id,onSelect:()=>pe(i),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",i.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",i.id,o):void 0},i.id)),J.length===0&&Q.length===0&&t.jsx("p",{className:`tf-text-helper ${n.empty}`,children:z.hasCriteria?"No planning matches.":"No planning items yet."})]})]}),t.jsxs("section",{className:`${n.column} ${n.columnWorkstreams} ${f==="workstreams"?n.columnActive:""}`.trim(),"aria-labelledby":"planning-workstreams-heading",children:[t.jsxs("div",{className:n.columnHeader,children:[t.jsxs("div",{className:n.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${n.responsiveBack}`.trim(),onClick:()=>X("portfolio"),"aria-label":"Back to Portfolio",title:"Back to Portfolio",children:t.jsx(be,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:F,id:"planning-workstreams-heading",className:`tf-heading-section ${n.paneHeading}`,tabIndex:-1,children:["Workstreams (",ee.length,")"]})]}),t.jsx("div",{className:n.headerActions,children:r&&e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>g({entityType:"workstream",initiativeId:r.id}),"aria-label":`Create workstream in ${r.title}`,title:"Create workstream",children:t.jsx(ae,{size:15,"aria-hidden":"true"})}):null})]}),t.jsxs("div",{className:n.scrollRegion,children:[r?t.jsxs(t.Fragment,{children:[t.jsx(_e,{item:r,entityType:"initiative",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?i=>e.changeOwner?.("initiative",r.id,i):void 0,onChangeIdentity:e.changeIdentity,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:s?void 0:he,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("initiative",r.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?i=>e.updateEntity("initiative",r.id,i):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("initiative",r.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("initiative",r.id):void 0}),t.jsx(ne,{options:Ie,entityLabel:"workstream",onSelect:i=>fe("workstream",i),disabled:!e.attachWorkstreamToInitiative||c})]}):null,C?.entityType==="workstream"&&C.initiativeId===r?.id?t.jsx(Z,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:r.id,onCancel:()=>g(null),onSave:ie}):null,ee.map(i=>t.jsx(je,{workstream:i,ownerOption:i.ownerId?u.get(i.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:m===i.id,onSelect:()=>pe(i),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",i.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",i.id,o):void 0,referenceAction:r?t.jsx(Y,{disabled:!e.assignWorkstreamToInitiative||c,onClick:()=>L({entityType:"workstream",id:i.id,referenceLabel:U(i),title:i.title,parentLabel:r?`${q(r)} ${r.title}`.trim():"its initiative"}),title:`Unlink ${U(i)||i.title} from initiative`,ariaLabel:`Unlink ${U(i)||i.title} from initiative`,children:t.jsx(se,{size:14,"aria-hidden":"true"})}):void 0},i.id)),r&&E?.pane==="workstreams"?ye:null,ee.length===0&&t.jsx("p",{className:`tf-text-helper ${n.empty}`,children:"Select an initiative or standalone workstream."})]})]}),t.jsxs("section",{className:`${n.column} ${n.columnTasks} ${f==="tasks"?n.columnActive:""}`.trim(),"aria-labelledby":"planning-tasks-heading",children:[t.jsx("div",{className:n.columnHeader,children:t.jsxs("div",{className:n.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${n.responsiveBack}`.trim(),onClick:Re,"aria-label":r?"Back to Workstreams":"Back to Portfolio",title:r?"Back to Workstreams":"Back to Portfolio",children:t.jsx(be,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:x,id:"planning-tasks-heading",className:`tf-heading-section ${n.paneHeading}`,tabIndex:-1,children:["Tasks (",te.length,")"]})]})}),t.jsxs("div",{className:n.scrollRegion,children:[s?t.jsxs(t.Fragment,{children:[t.jsx(_e,{item:s,entityType:"workstream",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?i=>e.changeOwner?.("workstream",s.id,i):void 0,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:he,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("workstream",s.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?i=>e.updateEntity("workstream",s.id,i):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("workstream",s.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("workstream",s.id):void 0,referenceAction:s.initiativeId?t.jsx(Y,{disabled:!e.assignWorkstreamToInitiative||c,onClick:()=>{L({entityType:"workstream",id:s.id,referenceLabel:U(s),title:s.title,parentLabel:r?`${q(r)} ${r.title}`.trim():"its initiative"})},title:"Unlink workstream from initiative",ariaLabel:"Unlink workstream from initiative",children:t.jsx(se,{size:14,"aria-hidden":"true"})}):t.jsx(Y,{disabled:!e.assignWorkstreamToInitiative||c,onClick:()=>W(i=>!i),title:"Link initiative",ariaLabel:"Link initiative",ariaExpanded:M,children:t.jsx(at,{size:14,"aria-hidden":"true"})}),relationshipContent:t.jsx(t.Fragment,{children:!s.initiativeId&&M?t.jsxs("div",{className:n.relationshipPickerRow,children:[t.jsx(ne,{options:e.linkOptions.initiatives,entityLabel:"initiative",onSelect:Te,disabled:c}),t.jsx("button",{type:"button",className:"tf-control-icon tf-control-icon-compact",disabled:c,onClick:()=>W(!1),title:"Cancel initiative link","aria-label":"Cancel initiative link",children:t.jsx(xe,{size:14,"aria-hidden":"true"})})]}):null})}),t.jsx(ne,{options:Ne,entityLabel:"task",onSelect:i=>fe("task",i),disabled:!e.attachTaskToWorkstream||c}),e.setTaskArrangeMode?t.jsx(Be,{value:B,onChange:e.setTaskArrangeMode}):null]}):null,t.jsx(Me,{tasks:te,mode:B,onReorder:s&&e.reorderWorkstreamTasks?i=>e.reorderWorkstreamTasks?.(s.id,Ve(ke(s.tasks??[],"execution"),i)):void 0,children:i=>{const o=Ue(i);return t.jsx(Ge,{task:i,assigneeOption:i.assignee?u.get(i.assignee):void 0,assigneeOptions:e.assigneeOptions,showStatusLabel:e.showTaskCardStatusLabel,onOpen:()=>e.openTask(i.id),onAssigneeChange:e.setTaskAssignee?v=>e.setTaskAssignee?.(i.id,v):void 0,onStatusChange:e.setTaskStatus?v=>e.setTaskStatus?.(i.id,v):void 0,referenceInteractive:!1,referenceAction:t.jsx(Y,{disabled:!e.assignTaskToWorkstream||c,onClick:v=>{v.stopPropagation(),L({entityType:"task",id:i.id,referenceLabel:o||i.id,title:i.title,parentLabel:s?`${U(s)} ${s.title}`.trim():"its workstream"})},title:`Unlink ${o||i.title} from workstream`,ariaLabel:`Unlink ${o||i.title} from workstream`,children:t.jsx(se,{size:14,"aria-hidden":"true"})})},i.id)}}),s&&E?.pane==="tasks"?ye:null,!s&&t.jsx("p",{className:`tf-text-helper ${n.empty}`,children:"Select a workstream."}),s&&te.length===0&&t.jsx("p",{className:`tf-text-helper ${n.empty}`,children:"No tasks are linked to this workstream."})]})]})]}),t.jsx(Ke,{item:k,busy:c,theme:e.theme,onCancel:()=>L(null),onConfirm:()=>{Le()}})]})}export{pi as PlanningModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,j as e}from"./vendor-react-CKJs5o3c.js";import{aM as ye,t as Oe,aN as Ve,aO as ke,aP as ge,aQ as he,aR as Ke,aS as He}from"./index-BUplSsv_.js";import{bn as qe,w as ze,K as Ye}from"./vendor-icons-BkFLXavV.js";import{u as We,a as Ge}from"./vendor-router-AqJMU8Lz.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";const Qe="_plansWrapper_ojftl_1",Je="_contentFrame_ojftl_24",Xe="_shellOwnsScroll_ojftl_32",Ze="_withChrome_ojftl_38",et="_siteVariant_ojftl_42",tt="_title_ojftl_56",nt="_subtitle_ojftl_71",rt="_header_ojftl_78",at="_planCard_ojftl_93",it="_grid_ojftl_106",st="_pricingNotes_ojftl_114",ot="_planName_ojftl_123",ct="_featureText_ojftl_130",lt="_currentBadge_ojftl_134",ut="_navAction_ojftl_138",dt="_backBtn_ojftl_139",mt="_priceRows_ojftl_150",pt="_foundingBeta_ojftl_154",ft="_cloudCapacityNote_ojftl_176",gt="_headerBar_ojftl_258",ht="_headerActions_ojftl_267",yt="_debugMeta_ojftl_318",_t="_planNoticeCard_ojftl_381",Ct="_planDescription_ojftl_392",bt="_teamComingSoonCard_ojftl_397",St="_clickablePlanCard_ojftl_416",jt="_activePlanCard_ojftl_431",wt="_callToAction_ojftl_495",vt="_primaryCta_ojftl_507",xt="_secondaryCta_ojftl_518",Nt="_currentCta_ojftl_530",kt="_featuresList_ojftl_544",Pt="_priceRow_ojftl_150",It="_regularPriceLine_ojftl_568",At="_campaignPriceLine_ojftl_569",Tt="_priceRowWithCampaign_ojftl_576",Rt="_priceRowAmount_ojftl_580",Lt="_regularPriceDiscounted_ojftl_586",Et="_priceRowInterval_ojftl_592",Bt="_campaignPriceLabel_ojftl_601",$t="_campaignPriceAmount_ojftl_606",Mt="_campaignPriceInterval_ojftl_612",Ut="_ctaRow_ojftl_617",Dt="_featureItem_ojftl_623",Ft="_featureIcon_ojftl_629",Ot="_featureLimitAccent_ojftl_643",Vt="_featureLimitUnit_ojftl_654",Kt="_featureTextBlock_ojftl_660",Ht="_featureDescription_ojftl_666",qt="_emptyState_ojftl_672",zt="_marketingEmptyState_ojftl_681",Yt="_emptyBadge_ojftl_715",Wt="_emptyHighlights_ojftl_730",Gt="_loader_ojftl_752",Qt="_spinner_ojftl_762",Jt="_statusBanner_ojftl_815",Xt="_successBanner_ojftl_823",Zt="_infoBanner_ojftl_829",en="_errorBanner_ojftl_835",r={plansWrapper:Qe,contentFrame:Je,shellOwnsScroll:Xe,withChrome:Ze,siteVariant:et,title:tt,subtitle:nt,header:rt,planCard:at,grid:it,pricingNotes:st,planName:ot,featureText:ct,currentBadge:lt,navAction:ut,backBtn:dt,priceRows:mt,foundingBeta:pt,cloudCapacityNote:ft,headerBar:gt,headerActions:ht,debugMeta:yt,planNoticeCard:_t,planDescription:Ct,teamComingSoonCard:bt,clickablePlanCard:St,activePlanCard:jt,callToAction:wt,primaryCta:vt,secondaryCta:xt,currentCta:Nt,featuresList:kt,priceRow:Pt,regularPriceLine:It,campaignPriceLine:At,priceRowWithCampaign:Tt,priceRowAmount:Rt,regularPriceDiscounted:Lt,priceRowInterval:Et,campaignPriceLabel:Bt,campaignPriceAmount:$t,campaignPriceInterval:Mt,ctaRow:Ut,featureItem:Dt,featureIcon:Ft,featureLimitAccent:Ot,featureLimitUnit:Vt,featureTextBlock:Kt,featureDescription:Ht,emptyState:qt,marketingEmptyState:zt,emptyBadge:Yt,emptyHighlights:Wt,loader:Gt,spinner:Qt,statusBanner:Jt,successBanner:Xt,infoBanner:Zt,errorBanner:en};function tn(){const t=globalThis.__DEBUG_MODE__;return typeof t=="boolean"?t:!1}function nn(t){const a=String(t?.environment||"").trim(),c=String(t?.runtimeMode||"").trim();return!a&&!c?null:a&&c?`${a} (${c})`:a||c||null}const rn=new Set(["a","b","br","em","i","li","ol","p","strong","u","ul"]);function an(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function sn(t){const a=String(t||"").trim();if(!a)return"";if(typeof document>"u")return an(a);const c=document.createElement("template");c.innerHTML=a;const p=document.createElement("div"),l=C=>{if(C.nodeType===Node.TEXT_NODE)return document.createTextNode(C.textContent||"");if(C.nodeType!==Node.ELEMENT_NODE)return null;const E=C,P=E.tagName.toLowerCase();if(P==="script"||P==="style")return null;const $=Array.from(E.childNodes).map(l).filter(h=>!!h);if(!rn.has(P)){const h=document.createDocumentFragment();for(const W of $)h.appendChild(W);return h}const v=document.createElement(P);if(P==="a"){const h=String(E.getAttribute("href")||"").trim();/^(https?:|mailto:|\/|#)/i.test(h)&&(v.setAttribute("href",h),v.setAttribute("rel","noopener noreferrer"))}for(const h of $)v.appendChild(h);return v};for(const C of Array.from(c.content.childNodes)){const E=l(C);E&&p.appendChild(E)}return p.innerHTML}function on(t,a){if(t==null||!a)return"Contact Sales";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:0}).format(t/100)}catch{return`${a.toUpperCase()} ${t/100}`}}function cn(){return"$0"}function V(t){return t?t.pricingType==="free"?!0:t.unitAmount!=null&&t.currency!=null:!1}function Te(t){return t?t.pricingType==="free"?cn():on(t.unitAmount,t.currency):"Unavailable"}function Re(t,a){return V(a)?{price:a,pricingAudience:"campaign"}:{price:t,pricingAudience:"public"}}function ln(t,a,c,p){const l=V(t)||V(c),C=V(a)||V(p);if(!l&&!C)return null;const E=(P,$,v)=>{if(!V(P)&&!V($))return null;const h=V($),W=v==="year"?"year":"month";return e.jsxs("div",{className:`${r.priceRow} ${h?r.priceRowWithCampaign:""}`,children:[V(P)?e.jsxs("div",{className:r.regularPriceLine,children:[e.jsx("span",{className:`${r.priceRowAmount} ${h?r.regularPriceDiscounted:""}`,children:Te(P)}),e.jsxs("span",{className:r.priceRowInterval,children:["/ ",W]})]}):null,h?e.jsxs("div",{className:r.campaignPriceLine,children:[e.jsx("span",{className:r.campaignPriceLabel,children:"Founding Offer:"}),e.jsx("span",{className:r.campaignPriceAmount,children:Te($)}),e.jsxs("span",{className:r.campaignPriceInterval,children:["/ ",W]})]}):null]},v)};return e.jsxs("div",{className:r.priceRows,children:[E(t,c,"month"),E(a,p,"year")]})}function Le(t){const a=[t.pricing.month,t.pricing.year].filter(Boolean);if(a.some(p=>p.pricingType==="free"))return 0;const c=a.map(p=>p.pricingType==="stripe"&&typeof p.unitAmount=="number"?p.unitAmount:null).filter(p=>p!=null);return c.length>0?Math.min(...c):Number.POSITIVE_INFINITY}function un(t){return String(t||"").replace(/[_\-.]+/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function Pe(t,a){const c=t?.[a],p=Number(c);return Number.isFinite(p)?Math.max(1,Math.floor(p)):null}function we(t,a){return a!==1?t:t.replace(/\b([A-Za-z]+)ies\b$/,"$1y").replace(/\b([A-Za-z]+[^s\s])s\b$/,"$1")}function dn(t){return t<=1e3?{value:String(t),unit:"MB"}:{value:String(Math.round(t/1e3)),unit:"GB"}}function mn(t,a){const c=String(t.publicLabel||t.label||"").trim()||un(t.featureKey),p=t.config&&typeof t.config=="object"?t.config:{};if(t.featureKey==="context.uploads"){const l=Pe(p,"storageLimitMb");if(l!==null){const C=dn(l);return{limitValue:C.value,limitUnit:C.unit,baseLabel:we(c,l)}}}if(t.featureKey==="workspace.workspaces"){const l=Pe(p,"maxWorkspaces");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)}}if(t.featureKey==="collaboration.ai_profiles"){const l=Pe(p,"maxAiProfiles");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)}}if(t.featureKey==="collaboration.team_management"){const l=Number(a);if(Number.isFinite(l)&&l>0){const C=Math.floor(l);return{limitValue:String(C),limitUnit:null,baseLabel:we(c,C)}}}return{limitValue:null,limitUnit:null,baseLabel:c}}function pn({heading:t,subtitle:a,variant:c="app",theme:p="dark",chrome:l,footer:C,isAuthenticated:E,authSessionResolved:P=!0,currentPlanId:$,currentPlanVersionId:v,currentEntitlementState:h,markCurrentPlan:W,canManageCurrentPlan:G=!0,pricingEndpoint:I,statusBanner:H,onBack:A,backLabel:T,backDisabled:M=!1,topActions:se,shellOwnsScroll:_e=!1,showPageBackButton:X=!0,showHeaderBarWithChrome:re=!1,preferPricingPageTitle:Ce=!0,currentPlanCardActionMode:be="manage",fallbackPricingSource:g=null,onSelectPlan:q}){const[Z,Q]=s.useState([]),[oe,F]=s.useState(null),[x,R]=s.useState({pageTitle:null,pageDescription:null}),[ce,z]=s.useState(!0),[le,ue]=s.useState(null),[Se,ee]=s.useState(0);s.useEffect(()=>{let i=!0;return(async()=>{const D=String(I||"/api/taskforce/public/pricing").trim()||"/api/taskforce/public/pricing";i&&(z(!0),ue(null));try{const w=await fetch(D,{method:"GET",credentials:"include"}),u=await w.json().catch(()=>({}));if(w.ok){i&&(Q(Array.isArray(u?.plans)?u.plans:[]),F(u?.pricingSource&&typeof u.pricingSource=="object"?u.pricingSource:null),R({pageTitle:typeof u?.pageTitle=="string"&&u.pageTitle.trim()||null,pageDescription:typeof u?.pageDescription=="string"&&u.pageDescription.trim()||null}));return}throw new Error(String(u?.error||`Failed to load pricing (${w.status})`))}catch(w){if(i){const u=w instanceof Error?w.message:"Failed to load pricing";ue(u||"Failed to load pricing"),F(null),R({pageTitle:null,pageDescription:null})}}finally{i&&z(!1)}})(),()=>{i=!1}},[I,Se]);const J=s.useMemo(()=>[...Z].sort((i,U)=>{const D=Le(i),w=Le(U);if(D!==w)return D-w;const u=i.defaultVersion?.versionNumber||0,O=U.defaultVersion?.versionNumber||0;return u!==O?u-O:String(i.displayName||i.planId).localeCompare(String(U.displayName||U.planId))}),[Z]),de=s.useMemo(()=>nn(oe||g),[g,oe]),ve=String((Ce?x.pageTitle:null)||t).trim()||t,me=String(x.pageDescription||a||"").trim(),j=s.useMemo(()=>sn(me),[me]),te=P,pe=`${r.plansWrapper} ${_e?r.shellOwnsScroll:"tf-scrollbar"} ${c==="site"?r.siteVariant:""} ${l?r.withChrome:""}`.trim(),B=i=>_e?e.jsxs(e.Fragment,{children:[l,i,C]}):e.jsxs("div",{className:Oe.standaloneWrapper,"data-theme":p,children:[l,i,C]});return B(ce?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.loader,children:[e.jsx(ze,{size:48,className:r.spinner}),e.jsx("p",{children:"Loading plans..."})]})})})}):le?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.emptyState,children:[e.jsx("h2",{children:"Connecting to plan pricing..."}),e.jsx("p",{children:le}),e.jsx("button",{className:r.backBtn,onClick:()=>ee(i=>i+1),children:"Retry"})]})})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsxs("div",{className:r.contentFrame,children:[e.jsxs("div",{className:r.header,children:[(!l||re)&&(X||se)&&e.jsxs("div",{className:r.headerBar,children:[e.jsx("div",{children:X?e.jsx("button",{className:r.backBtn,onClick:A,disabled:M,children:T}):null}),e.jsx("div",{className:r.headerActions,children:se})]}),e.jsx("h1",{className:r.title,children:ve}),j&&e.jsx("div",{className:r.subtitle,dangerouslySetInnerHTML:{__html:j}}),tn()&&de?e.jsxs("p",{className:r.debugMeta,children:["Pricing source: ",de]}):null,H&&e.jsx("div",{className:`${r.statusBanner} ${H.type==="success"?r.successBanner:H.type==="info"?r.infoBanner:r.errorBanner}`,children:H.message})]}),e.jsxs("section",{className:r.foundingBeta,"aria-labelledby":"founding-beta-heading",children:[e.jsx("h2",{id:"founding-beta-heading",children:"Founding beta"}),e.jsx("p",{children:"Taskforce is in founding beta. You may run into rough edges while we improve cloud workspaces and agent workflows. Early members get access while the product is still forming, plus a direct role in shaping what comes next."})]}),J.length===0?e.jsxs("div",{className:`${r.emptyState} ${r.marketingEmptyState}`,children:[e.jsx("span",{className:r.emptyBadge,children:"Coming Soon"}),e.jsx("h2",{children:"Paid plans are getting their final polish."}),e.jsx("p",{children:"Taskforce pricing is on the way with flexible options for solo operators, teams, and larger rollouts. Check back soon for launch tiers, feature bundles, and early access details."}),e.jsxs("div",{className:r.emptyHighlights,"aria-label":"Upcoming pricing highlights",children:[e.jsx("span",{children:"Launch-ready tiers"}),e.jsx("span",{children:"Team billing controls"}),e.jsx("span",{children:"Feature-based packaging"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:r.grid,children:J.map(i=>{const U=i.pricing.month,D=i.pricing.year,w=i.campaignPricing?.month||null,u=i.campaignPricing?.year||null,O=Re(U,w),K=Re(D,u),Y=V(O.price),ae=V(K.price),ie=Y&&ae,N=String(i.defaultVersion?.planVersionId||"").trim(),xe=ye(h),fe=W??xe,Ne=!!(N&&v&&v===N)||!!(!v&&($&&$===i.planId)),ne=fe&&Ne&&h!=="canceled",n=Y?"month":ae?"year":null,o=n==="year"?K:O,_=be==="manage",f=be==="indicator",y=te&&!!N&&(ne?_&&G:!!n),m=()=>{if(N){if(ne){if(!_||!G)return;q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0});return}n&&q({planId:i.planId,planVersionId:N,interval:n,pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!1})}};return e.jsxs("div",{className:`${r.planCard} ${ne?r.activePlanCard:""} ${y?r.clickablePlanCard:""}`,"data-testid":`plan-card-${i.planId}`,role:y?"button":void 0,tabIndex:y?0:void 0,onClick:y?m:void 0,onKeyDown:y?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),m())}:void 0,children:[ne&&e.jsx("span",{className:r.currentBadge,children:"Current Plan"}),e.jsx("h3",{className:r.planName,children:i.displayName}),ln(U,D,w,u),String(i.description||"").trim()&&e.jsx("p",{className:r.planDescription,children:String(i.description||"").trim()}),e.jsx("div",{className:r.featuresList,children:Array.isArray(i.features)&&i.features.length>0?i.features.map((d,S)=>e.jsxs("div",{className:r.featureItem,children:[e.jsx(qe,{className:r.featureIcon}),e.jsxs("div",{className:r.featureTextBlock,children:[(()=>{const{limitValue:k,limitUnit:b,baseLabel:L}=mn(d,i.defaultVersion?.seatLimit);return e.jsxs("span",{className:r.featureText,children:[k&&e.jsxs("span",{className:r.featureLimitAccent,children:[e.jsx("span",{children:k}),b?e.jsx("span",{className:r.featureLimitUnit,children:b}):null]}),e.jsx("span",{children:k?` ${L}`:L})]})})(),d.publicDescriptionVisible!==!1&&String(d.publicDescription||d.description||"").trim()&&e.jsx("span",{className:r.featureDescription,children:String(d.publicDescription||d.description||"").trim()})]})]},`${d.featureKey}-${S}`)):e.jsx("span",{className:r.featureText,children:"No additional features included"})}),ne?_?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-manage-${i.planId}`,onClick:d=>{d.stopPropagation(),G&&q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0})},disabled:!N||!G||!te,children:E&&G?"Manage Plan":"Current Plan"}):f?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-current-${i.planId}`,disabled:!0,children:"Current Plan"}):null:e.jsxs("div",{className:r.ctaRow,children:[Y?e.jsx("button",{className:`${r.callToAction} ${r.secondaryCta}`,"data-testid":`plan-select-${i.planId}-month`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"month",pricingType:O.price?.pricingType||"stripe",pricingAudience:O.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Monthly":"Get Started"}):null,ae?e.jsx("button",{className:`${r.callToAction} ${r.primaryCta}`,"data-testid":`plan-select-${i.planId}-year`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"year",pricingType:K.price?.pricingType||"stripe",pricingAudience:K.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Yearly":"Get Started"}):null]})]},i.planId)})}),e.jsxs("div",{className:r.pricingNotes,children:[e.jsx("p",{children:"Prices are listed in USD. Taxes may apply."}),e.jsx("p",{children:"Local install is free on every plan. Cloud limits apply only to hosted workspaces."})]}),e.jsxs("section",{className:`${r.foundingBeta} ${r.cloudCapacityNote}`,"aria-labelledby":"cloud-capacity-heading",children:[e.jsx("h2",{id:"cloud-capacity-heading",children:"Need more cloud capacity?"}),e.jsx("p",{children:"Pro users can request expanded limits for cloud workspaces, AI agents, and storage."}),e.jsxs("p",{children:["Contact ",e.jsx("a",{href:"mailto:support@taskforcehq.ai",children:"support@taskforcehq.ai"})," to discuss capacity needs."]})]}),e.jsxs("div",{className:`${r.planCard} ${r.planNoticeCard} ${r.teamComingSoonCard}`,children:[e.jsx("h2",{className:r.planName,children:"Team workspaces are coming soon."}),e.jsx("p",{className:r.planDescription,children:"Shared workspaces, collaborators, team agent rosters, admin controls, and larger cloud limits are in development."})]})]})]})})}))}const fn=1600,Ee=[0,500,1e3,2e3],gn=5e3,hn=45e3,yn="Choose a plan to continue.";function _n(t,a){if(t===401)return!0;const c=String(a||"").trim().toUpperCase();return c==="CHECKOUT_SESSION_INCOMPLETE"||c==="CHECKOUT_PLAN_VERSION_UNRESOLVED"}function Cn(t){return t==="year"?"year":"month"}function bn(t){return t==="campaign"?"campaign":"public"}function Ie(t){const a=String(t||"").trim().toLowerCase();return a==="year"?"year":a==="month"?"month":null}function Be(t){const a=String(t||"").trim();return a?a.replace(/\/+$/,""):""}function Ae(t={}){const a=new URLSearchParams;a.set("screen","plans");for(const[c,p]of Object.entries(t)){const l=String(p||"").trim();l&&a.set(c,l)}return`/?${a.toString()}`}function An({isAuthenticated:t,authUserId:a,runtimeMode:c,authSessionResolved:p,currentTheme:l="dark",projectName:C,currentWorkspaceId:E,apiBaseUrl:P,connectedEnvironmentSource:$,resolveCloudAuthUrl:v,embedded:h=!1,shellOwnsScroll:W=!1,onAccountProfileSummaryChange:G,onContinueToTaskforce:I,continueBusy:H=!1}){const A=We(),T=Ge(),[M,se]=s.useState(null),[_e,X]=s.useState(!1),[re,Ce]=s.useState(!1),[be,g]=s.useState(null),q=s.useRef(!1),Z=s.useRef(null),Q=s.useRef(null),oe=s.useRef(I),F=s.useMemo(()=>new URLSearchParams(T.search),[T.search]),x=String(F.get("checkout")||"").trim().toLowerCase(),R=String(F.get("gate")||"").trim().toLowerCase(),ce=String(F.get("planId")||"").trim(),z=String(F.get("planVersionId")||"").trim(),le=Cn(F.get("interval")),ue=bn(F.get("pricingAudience")),Se=Ie(F.get("interval")),ee=String(F.get("session_id")||"").trim(),J=s.useMemo(()=>Be(P),[P]),de=s.useMemo(()=>Be($),[$]),ve=s.useMemo(()=>({environment:Ve(de||J),runtimeMode:c==="cloud"?"cloud":"local"}),[J,de,c]),me=s.useCallback(n=>{const o=String(n||"").trim();return J?`${J}${o.startsWith("/")?o:`/${o}`}`:o},[J]),j=s.useCallback(n=>v?v(n):me(n),[me,v]),te=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("screen"),n.delete("gate"),n.delete("checkout"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval"),n.delete("pricingAudience");const o=n.toString();A(`/${o?`?${o}`:""}${T.hash||""}`)},[T.hash,T.search,A]),pe=s.useMemo(()=>j("/api/taskforce/public/pricing"),[j]),B=s.useMemo(()=>ke(M,R),[M,R]),i=s.useMemo(()=>B.allowReturnToApp,[B.allowReturnToApp]),U=s.useMemo(()=>{const n=String(B.message||"").trim();return!n||n===yn?null:n},[B.message]),D=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("checkout"),n.delete("session_id"),n.delete("gate"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval");const o=n.toString();A(`${T.pathname}${o?`?${o}`:""}${T.hash||""}`,{replace:!0})},[T.hash,T.pathname,T.search,A]),w=s.useCallback(()=>{Q.current!=null&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{D(),Q.current=null},fn)},[D]);s.useEffect(()=>{oe.current=I},[I]);const u=s.useCallback(async n=>{const o=j(ge);if(!t)return se(null),he(o,{identityKey:a}),null;try{const _=await Ke(o,{identityKey:a,force:n?.force===!0});return se(_),G?.(_),_}catch{return null}},[a,j,t,G]),O=s.useCallback((n,o,_)=>{const f=String(o||"").trim();if(_?.preferFallback&&f)return f;const y=ke(n,R).message;return y||f||"Unable to confirm checkout completion."},[R]),K=s.useCallback((n,o)=>!ke(n,o).allowReturnToApp,[]),Y=s.useCallback(async(n,o,_="public",f)=>{if(!n){g({type:"error",message:"Selected plan is missing a default plan version."});return}X(!0),g(null);try{const y=await fetch(j("/api/taskforce/billing/checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({planVersionId:n,interval:o,pricingAudience:_})}),m=await y.json().catch(()=>({}));if(!y.ok){g({type:"error",message:String(m?.error||"Unable to start checkout for selected plan.")});return}const d=String(m?.checkoutState||"").trim().toLowerCase();if(d==="free"){g({type:"success",message:"Plan selected. Your access is ready."}),he(j(ge),{identityKey:a});const b=await u({force:!0}),L=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(L)&&await I?.();return}if(d==="updated"){g({type:"success",message:String(m?.message||"Your subscription was updated successfully.")}),he(j(ge),{identityKey:a});const b=await u({force:!0}),L=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(L)&&await I?.();return}if(d==="already_current_plan"){g({type:"success",message:String(m?.message||"You are already on this plan.")}),he(j(ge),{identityKey:a}),await u();return}const S=String(m?.returnBaseUrl||"").trim();if(c==="local"&&S)try{const b=window.location.origin,L=new URL(S,b).origin;if(L!==b){g({type:"error",message:`Checkout return is misconfigured for this runtime. Expected ${b} but got ${L}.`});return}}catch{g({type:"error",message:"Checkout return URL is invalid for this runtime."});return}const k=String(m?.url||"").trim();if(!k){g({type:"error",message:"Checkout did not return a redirect URL."});return}window.location.assign(k)}catch{g({type:"error",message:"Unable to start checkout for selected plan."})}finally{X(!1)}},[a,j,u,I,c]),ae=s.useCallback(async(n,o)=>{if(!n)return{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1};const _=async()=>{he(j(ge),{identityKey:a});const f=await u({force:!0}),y=String(f?.entitlementState||"").trim().toLowerCase();if(!ye(y))return!1;const m=ce,d=z,S=Se,k=String(f?.planId||"").trim(),b=String(f?.planVersionId||"").trim(),L=Ie(f?.billingInterval??null),je=o?.preConfirmationSummary??null,$e=String(je?.entitlementState||"").trim().toLowerCase(),Me=ye($e),Ue=String(je?.planId||"").trim(),De=String(je?.planVersionId||"").trim(),Fe=Ie(je?.billingInterval??null);return m&&k&&k!==m||d&&b&&b!==d||S&&L&&L!==S||Me&&!(!!m&&k===m&&Ue!==k)&&!(!!d&&b===d&&De!==b)&&!(!!S&&L===S&&Fe!==L)?!1:(o?.autoContinueOnActivation===!0&&await oe.current?.(),!0)};try{const f=await fetch(j("/api/taskforce/billing/checkout-session/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})}),y=await f.json().catch(()=>({}));if(!f.ok){const m=String(y?.code||"").trim(),d=_n(f.status,m);return d&&await _()?{confirmed:!0}:{confirmed:!1,errorMessage:String(y?.error||"Unable to confirm checkout completion."),retryable:d}}return await _()?{confirmed:!0}:{confirmed:!0}}catch{return{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}}},[a,j,u,Se,ce,z]),ie=s.useCallback(async()=>{if(!t){A(`/login?mode=login&next=${encodeURIComponent(Ae())}`);return}X(!0),g({type:"info",message:"Opening billing portal..."});try{const n=await fetch(j("/api/taskforce/billing/portal-session"),{method:"POST",credentials:"include"}),o=await n.json().catch(()=>({}));if(!n.ok){g({type:"error",message:String(o?.error||"Failed to open billing portal.")});return}const _=String(o?.url||"").trim();if(!_){g({type:"error",message:"Portal session did not return a redirect URL."});return}window.location.assign(_)}catch{g({type:"error",message:"Failed to open billing portal."})}finally{X(!1)}},[j,t,A]),N=s.useCallback(async()=>{if(!(!I||re||H)){Ce(!0);try{await I()}finally{Ce(!1)}}},[re,H,I]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{i&&R==="missing_entitlement"&&D()},[D,R,i]),s.useEffect(()=>()=>{Q.current!=null&&window.clearTimeout(Q.current)},[]),s.useEffect(()=>{x!=="success"&&(Z.current=null)},[x]),s.useEffect(()=>{let n=!1;const o=new Set,_=async f=>{f<=0||await new Promise(y=>{const m=window.setTimeout(()=>{o.delete(m),y()},f);o.add(m)})};if(x==="success"){if(q.current=!0,g({type:"success",message:"Checkout completed successfully. Finalizing your plan..."}),!t&&!p)return()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};if(!t)return g({type:"error",message:"Sign in to finish activating your plan."}),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};const y=ee||"__missing_session__";return Z.current===y?()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()}:((async()=>{const m=Date.now(),d=await u({force:!0});if(n)return;let S=ee?{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}:{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},k=0;for(;;){const b=k<Ee.length?Ee[k]:gn;if(k+=1,await _(b),n||(S=ee?await ae(ee,{autoContinueOnActivation:K(d,R),preConfirmationSummary:d}):{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},n))return;if(S.confirmed){Z.current=y,g({type:"success",message:"Checkout completed successfully."}),w();return}if(!S.retryable||Date.now()-m>=hn)break}if(!n&&!S.confirmed){const b=await u({force:!0});if(n)return;S.retryable||(Z.current=y),g({type:"error",message:O(b,S.errorMessage,{preferFallback:!S.retryable})}),S.retryable||w();return}})(),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()})}if(x==="cancel"){(async()=>{const f=await u({force:!0});g({type:"error",message:O(f,"Checkout was canceled. No charge was made.")}),w()})();return}if((x==="start"||x==="free")&&t&&z&&!q.current){q.current=!0,(async()=>{const f=await u({force:!0});await Y(z,le,ue,{autoContinueOnActivation:K(f,R)})})();return}},[p,x,ae,R,t,u,le,z,ue,ee,O,w,K,Y]),s.useEffect(()=>{if(!(x==="success"||x==="cancel"||x==="start"||x==="free")){if(U){g({type:B.statusTone,message:U});return}g(n=>!n||n.type!=="error"?n:n.message===B.message?null:n)}},[x,U,B.message,B.statusTone]);const xe=s.useCallback(async n=>{if(!t){const _=n.pricingType==="free"?"free":"start",f=Ae({checkout:_,planId:n.planId,planVersionId:n.planVersionId,interval:n.interval,pricingAudience:n.pricingAudience});A(`/login?mode=register&planId=${encodeURIComponent(n.planId)}&planVersionId=${encodeURIComponent(n.planVersionId)}&interval=${encodeURIComponent(n.interval)}&pricingAudience=${encodeURIComponent(n.pricingAudience)}&next=${encodeURIComponent(f)}`);return}if(n.isCurrentPlan){if(!M?.stripeCustomerId){g({type:"success",message:"Your current plan does not use Stripe billing."});return}await ie();return}const o=K(M,R);if(n.pricingType==="free"){await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o});return}await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o})},[M,R,t,A,ie,K,Y]),fe=s.useCallback(()=>{if(i&&I){N();return}if(h){te();return}if(window.history.length>1){A(-1);return}A("/")},[te,h,N,i,A,I]),Ne=h?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{className:r.navAction,onClick:fe,disabled:H||re||t&&!i,children:i?"Take Me to Taskforce":"Back"}),t&&M?.stripeCustomerId&&e.jsx("button",{className:r.navAction,onClick:()=>{ie()},disabled:_e,children:"Manage billing"}),!t&&e.jsxs("button",{className:r.navAction,onClick:()=>A(`/login?mode=login&next=${encodeURIComponent(Ae())}`),children:[e.jsx(Ye,{size:16,style:{marginRight:"8px",verticalAlign:"text-bottom"}}),"Sign In"]})]}),ne=h?null:e.jsx(He,{projectName:C,currentWorkspaceId:E,runtimeMode:c==="cloud"?"cloud":"local",theme:l,onBrandClick:fe,actions:Ne});return e.jsx(pn,{chrome:ne,heading:"Subscription Plans",subtitle:"Manage your subscription and explore available features. Your current plan is highlighted below.",variant:"site",theme:l,isAuthenticated:t,authSessionResolved:p,currentPlanId:String(M?.planId||ce||"").trim()||null,currentPlanVersionId:String(M?.planVersionId||z||"").trim()||null,currentEntitlementState:String(M?.entitlementState||"").trim()||null,markCurrentPlan:B.markCurrentPlan,canManageCurrentPlan:!!M?.stripeCustomerId,pricingEndpoint:pe,statusBanner:be,onBack:fe,backLabel:i?"Take Me to Taskforce":h?"Back to Board":"Back to App",backDisabled:H||re||t&&!i,topActions:null,shellOwnsScroll:W,showPageBackButton:!1,showHeaderBarWithChrome:!1,currentPlanCardActionMode:"manage",fallbackPricingSource:ve,onSelectPlan:xe})}export{An as PlansPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,j as e}from"./vendor-react-CKJs5o3c.js";import{ContextAttachmentManager as _}from"./ContextAttachmentManager-B8boOs6Q.js";import{f as g,aY as x}from"./index-BUplSsv_.js";import{w as f,$ as y,aZ as j}from"./vendor-icons-BkFLXavV.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const C="_group_1y2qv_1",I="_list_1y2qv_9",k="_review_1y2qv_15",w="_icon_1y2qv_43",b="_openIcon_1y2qv_43",N="_copy_1y2qv_44",A="_kindLabel_1y2qv_45",L="_title_1y2qv_53",q="_loading_1y2qv_54",a={group:C,list:I,review:k,icon:w,openIcon:b,copy:N,kindLabel:A,title:L,loading:q};function R(o){return String(o.title||"").trim()||o.image?.displayName||"Image review"}function S({taskId:o,taskReferenceLabel:c,workspaceId:l,apiBaseUrl:r}){const[i,d]=p.useState(null);return p.useEffect(()=>{let s=!0;d(null);const t=new URLSearchParams({workspaceId:l,taskId:o});return g(`/api/taskforce/annotated-attachments/sessions?${t.toString()}`,{credentials:"include"},r).then(async n=>n.ok?n.json():{sessions:[]}).then(n=>{s&&d(Array.isArray(n?.sessions)?n.sessions:[])}).catch(()=>{s&&d([])}),()=>{s=!1}},[r,o,l]),i!==null&&i.length===0?null:e.jsx("section",{className:a.group,"aria-label":"Image reviews",children:i===null?e.jsxs("div",{className:a.loading,"aria-live":"polite",children:[e.jsx(f,{size:14})," Loading image reviews"]}):e.jsx("div",{className:a.list,children:i.map(s=>{const t=s.image,n=s.annotations.length,m=!!(t?.assetId&&t.apiUrl);return e.jsxs("button",{type:"button",className:a.review,disabled:!m,onClick:()=>{t&&x({assetId:t.assetId,path:t.apiUrl,displayName:t.displayName,referenceLabel:t.referenceLabel||void 0},{taskId:o,taskReferenceLabel:c,sessionId:s.id})},children:[e.jsx("span",{className:a.icon,children:e.jsx(y,{size:14})}),e.jsxs("span",{className:a.copy,children:[e.jsx("span",{className:a.kindLabel,children:"Image review session"}),e.jsx("span",{className:`${a.title} tf-heading-card`,children:R(s)}),e.jsxs("span",{className:"tf-text-meta",children:[n," ",n===1?"marker":"markers"]})]}),e.jsx(j,{className:a.openIcon,size:14,"aria-hidden":"true"})]},s.id)})})})}function O(o){const{taskId:c,taskReferenceLabel:l,workspaceId:r,apiBaseUrl:i,showImageReviews:d=!1,contextFiles:s,onAddContextFile:t,onRemoveContextFile:n,onUpdateContextCaption:m,cardCoverAssetId:u,onSetCardCover:h,cardCoverDisabled:v}=o;return e.jsx(_,{ownerType:"task",ownerId:c,ownerReferenceLabel:l,workspaceId:r,apiBaseUrl:i,attachments:s,onAddAttachment:t,onRemoveAttachment:n,onUpdateAttachmentCaption:m,cardCoverAssetId:u,onSetCardCover:h,cardCoverDisabled:v,supplementalContent:d&&c&&r?e.jsx(S,{taskId:c,taskReferenceLabel:l,workspaceId:r,apiBaseUrl:i}):null})}export{O as TaskContextUpload};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e,R as Ms}from"./vendor-react-CKJs5o3c.js";import{g as fn,t as s,T as Ds,P as Qe,A as Es,I as xe,r as Q,D as jn,a as Ta,b as Cn,l as Ra,c as kn,M as Nn,n as Tn,d as wa}from"./index-BUplSsv_.js";import{r as Xe,t as ms,X as Bs,v as Ga,A as za,I as kt,aD as St,_ as wn,w as _e,a0 as Sn,aE as Sa,Z,l as $n,aF as $a,aG as _a,aH as $t,k as Oa,aI as _n,u as ne,x as Le,aJ as Ln,aK as In,a5 as Mn,d as Fa,a as Nt,aL as Pn,au as Tt,af as Ye,ab as Bn,a4 as An,ay as La,aM as Dn,aN as En,aO as Rn}from"./vendor-icons-BkFLXavV.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";function Gn(n){return n==="general"?{}:{TASKFORCE_MCP_CLIENT_ID:n}}function zn(...n){const o=n.map(g=>String(g||"").trim().toLowerCase()).join("|");let d=2166136261,u=3339675911;for(let g=0;g<o.length;g+=1){const C=o.charCodeAt(g);d=Math.imul(d^C,16777619),u=Math.imul(u^C,2246822519)}return`mcp-${(d>>>0).toString(16).padStart(8,"0")}${(u>>>0).toString(16).padStart(8,"0")}`}const wt=fn();function _t(n,o){return String(n||"").toLowerCase().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^[-_]+|[-_]+$/g,"")||o.toLowerCase()}function On(n,o){const u=_t(n||o||"workspace","workspace").slice(0,25)||"workspace";return _t(`taskforce-${u}`,"taskforce-workspace")}function Fn(n){return{Authorization:`Bearer ${n.tokenValue}`,...n.clientId==="general"?{}:{"X-Taskforce-MCP-Client-ID":n.clientId}}}function he(n,o){return`${n} Use the generated config exactly as shown. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function ge(n){return`${n} Use the generated config exactly as shown. No connection token is required for local stdio MCP. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function As(n){return JSON.stringify(n)}function Ia(n){return`[${n.map(o=>As(o)).join(", ")}]`}function Ma(n){return!n||Object.keys(n).length===0?[]:[`env = { ${Object.entries(n).map(([o,d])=>`${o} = ${As(d)}`).join(", ")} }`]}function Pa(n){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(n)?n:`'${n.replace(/'/g,`'"'"'`)}'`}function Hn(n){const{clientId:o,endpoint:d,tokenValue:u,serverId:g}=n,C=Fn(n);C.Authorization;const T=Object.entries(C).filter(([S])=>S!=="Authorization").map(([S,M])=>` --header "${S}: ${M}"`).join("");switch(o){case"general":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{url:d,headers:C},instructionLabel:"General MCP Configuration Instructions",instructionText:he("Add this server to your MCP client using its standard remote HTTP configuration format.")};case"cursor":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{url:d,headers:C},instructionLabel:"Cursor Configuration Instructions",instructionText:he("Open Cursor settings, find MCP servers, and paste this config.")};case"cline":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{url:d,type:"streamableHttp",headers:C},instructionLabel:"Cline Configuration Instructions",instructionText:he("Open Cline MCP Servers, add a remote server, or paste this into the Cline MCP config with Streamable HTTP selected.")};case"vscode":return{clientId:o,kind:"json",rootKey:"servers",serverConfig:{type:"http",url:d,headers:C},instructionLabel:"VS Code Configuration Instructions",instructionText:he("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{url:d,headers:C},instructionLabel:"Kiro Configuration Instructions",instructionText:he("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:d,headers:C},instructionLabel:"Windsurf Configuration Instructions",instructionText:he("Open Windsurf MCP settings, add a server, and paste this config.")};case"antigravity":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:d,headers:C},instructionLabel:"Antigravity Configuration Instructions",instructionText:he("Open Antigravity MCP settings, view the raw config, and paste this Antigravity-specific configuration.")};case"openclaw":return{clientId:o,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"streamable-http",url:d,headers:C},instructionLabel:"OpenClaw Configuration Instructions",instructionText:he("Open ~/.openclaw/openclaw.json and add this server under mcp.servers.")};case"codex":return{clientId:o,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${d}"`,`http_headers = { ${Object.entries(C).map(([S,M])=>`${S} = "${M}"`).join(", ")} }`].join(`
|
|
2
|
-
`),instructionLabel:"Codex Configuration Instructions",instructionText:he("Open ~/.codex/config.toml and add this Codex MCP entry.")};case"grok":return{clientId:o,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${d}"`,`headers = { ${Object.entries(C).map(([S,M])=>`${S} = "${M}"`).join(", ")} }`].join(`
|
|
3
|
-
`),instructionLabel:"Grok CLI Configuration Instructions",instructionText:he("Open ~/.grok/config.toml (or .grok/config.toml in your project for project-scoped config) and add this Grok CLI MCP entry.")};case"claude-code":return{clientId:o,kind:"text",renderedText:`claude mcp add --transport http ${g} ${d} --header "Authorization: Bearer ${u}"${T}`,instructionLabel:"Claude Code Configuration Instructions",instructionText:he("Run this Claude Code command in your terminal to add the remote Taskforce MCP server.")};case"gemini-cli":return{clientId:o,kind:"text",renderedText:`gemini mcp add ${g} ${d} --transport http --header "Authorization: Bearer ${u}"${T}`,instructionLabel:"Gemini CLI Configuration Instructions",instructionText:he("Run this Gemini CLI command in your terminal to add the remote Taskforce MCP server. Add --scope user if you want it available across all projects.")};case"claude-chat":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"Claude Chat Configuration Instructions",instructionText:"Open Claude Settings > Connectors, paste this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"grok-chat":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"Grok Configuration Instructions",instructionText:"Go to grok.com/connectors, create a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"gemini-chat":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"Gemini Spark Configuration Instructions",instructionText:"Open Gemini Settings & help > Connected Apps, add a custom app for Spark with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"mistral-chat":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"Mistral Vibe Configuration Instructions",instructionText:"Open Mistral Vibe (formerly Le Chat) > Intelligence > Connectors, add a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"perplexity-chat":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"Perplexity Configuration Instructions",instructionText:"Open Perplexity Settings > Connectors, add a custom remote connector with this MCP server URL, choose OAuth, and complete the Taskforce authorization flow for one workspace."};case"chatgpt-desktop":return{clientId:o,kind:"text",renderedText:d,instructionLabel:"ChatGPT Desktop Configuration Instructions",instructionText:"Open ChatGPT Apps & Connectors / developer mode, paste this MCP server URL, and complete the Taskforce OAuth authorize flow when ChatGPT opens it."};default:{const S=o;throw new Error(`Unsupported MCP client: ${S}`)}}}function Un(n){const{clientId:o,serverId:d,serverConfig:u}=n,g={command:u.command,args:u.args,...u.env&&Object.keys(u.env).length>0?{env:u.env}:{}},C=Object.entries(u.env||{}).map(([S,M])=>` --env ${Pa(`${S}=${M}`)}`).join(""),T=[u.command,...u.args].map(S=>Pa(S)).join(" ");switch(o){case"general":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"General MCP Configuration Instructions",instructionText:ge("Add this server to your MCP client using its standard local stdio configuration format.")};case"cursor":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cursor Configuration Instructions",instructionText:ge("Open Cursor settings, find MCP servers, and paste this local stdio config.")};case"cline":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cline Configuration Instructions",instructionText:ge("Open Cline MCP Servers and paste this local stdio server config.")};case"vscode":return{clientId:o,kind:"json",rootKey:"servers",serverConfig:{type:"stdio",...g},instructionLabel:"VS Code Configuration Instructions",instructionText:ge("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Kiro Configuration Instructions",instructionText:ge("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Windsurf Configuration Instructions",instructionText:ge("Open Windsurf MCP settings and paste this local stdio config.")};case"antigravity":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Antigravity Configuration Instructions",instructionText:ge("Open Antigravity MCP settings, view the raw config, and paste this local stdio configuration.")};case"openclaw":return{clientId:o,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"stdio",...g},instructionLabel:"OpenClaw Configuration Instructions",instructionText:ge("Open ~/.openclaw/openclaw.json and add this local stdio server under mcp.servers.")};case"codex":return{clientId:o,kind:"text",renderedText:[`[mcp_servers.${d}]`,`command = ${As(u.command)}`,`args = ${Ia(u.args)}`,...Ma(u.env)].join(`
|
|
4
|
-
`),instructionLabel:"Codex Configuration Instructions",instructionText:ge("Open ~/.codex/config.toml and add this local MCP entry.")};case"grok":return{clientId:o,kind:"text",renderedText:[`[mcp_servers.${d}]`,`command = ${As(u.command)}`,`args = ${Ia(u.args)}`,...Ma(u.env)].join(`
|
|
5
|
-
`),instructionLabel:"Grok CLI Configuration Instructions",instructionText:ge("Open ~/.grok/config.toml (or .grok/config.toml in your project for project-scoped config) and add this local Grok CLI MCP entry.")};case"claude-code":return{clientId:o,kind:"text",renderedText:`claude mcp add ${d}${C} -- ${T}`,instructionLabel:"Claude Code Configuration Instructions",instructionText:ge("Run this Claude Code command in your terminal to add the local Taskforce MCP server.")};case"gemini-cli":return{clientId:o,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Gemini CLI Configuration Instructions",instructionText:ge("Open ~/.gemini/settings.json and add this local MCP server under mcpServers.")};case"claude-chat":case"grok-chat":case"gemini-chat":case"mistral-chat":case"perplexity-chat":case"chatgpt-desktop":throw new Error(`Unsupported local MCP client: ${o}`);default:{const S=o;throw new Error(`Unsupported local MCP client: ${S}`)}}}const Wn="_categoryManagerContainer_1ibti_1",Vn="_pathInputGroupStretch_1ibti_9",Kn="_emptyStateItalic_1ibti_13",qn="_emptyStateBox_1ibti_28",Jn="_emptyStateBare_1ibti_44",Yn="_emptyStateIcon_1ibti_49",Zn="_taxonomyGrid_1ibti_55",Qn="_checkboxRow_1ibti_61",Xn="_checkboxLabel_1ibti_67",ei="_checkboxSmall_1ibti_75",si="_flexGap8_1ibti_80",ti="_optionOrderButtons_1ibti_85",ai="_addTaxonomyBtnSmall_1ibti_92",D={categoryManagerContainer:Wn,pathInputGroupStretch:Vn,emptyStateItalic:Kn,emptyStateBox:qn,emptyStateBare:Jn,emptyStateIcon:Yn,taxonomyGrid:Zn,checkboxRow:Qn,checkboxLabel:Xn,checkboxSmall:ei,flexGap8:si,optionOrderButtons:ti,addTaxonomyBtnSmall:ai},ni="_taxonomyDrillDown_1oekr_1",ii="_drillDownList_1oekr_7",oi="_librarySection_1oekr_13",li="_libraryLauncher_1oekr_18",ri="_libraryLauncherInfo_1oekr_40",ci="_libraryLauncherIcon_1oekr_47",di="_libraryLauncherText_1oekr_60",pi="_libraryLauncherLabel_1oekr_67",ui="_libraryLauncherSubtext_1oekr_73",mi="_libraryLauncherMeta_1oekr_79",hi="_drillDownSection_1oekr_89",gi="_drillDownSectionHeader_1oekr_95",xi="_drillDownSectionTitle_1oekr_102",bi="_drillDownItem_1oekr_111",yi="_drillDownItemAction_1oekr_126",vi="_drillDownItemDimmed_1oekr_145",fi="_drillDownItemInfo_1oekr_153",ji="_drillDownItemText_1oekr_159",Ci="_drillDownItemLabel_1oekr_165",ki="_drillDownItemSubtext_1oekr_170",Ni="_systemIcon_1oekr_175",Ti="_chevron_1oekr_179",wi="_orderButtons_1oekr_184",Si="_createOverlay_1oekr_195",$i="_createDialog_1oekr_209",_i="_createDialogTitle_1oekr_218",Li="_inputGroup_1oekr_224",Ii="_dialogActions_1oekr_228",Mi="_createSubmit_1oekr_234",Pi="_createCancel_1oekr_238",Bi="_taxonomyDetailView_1oekr_242",Ai="_detailHeader_1oekr_249",Di="_taxonomyBreadcrumbs_1oekr_257",Ei="_breadcrumbPrev_1oekr_263",Ri="_breadcrumbIcon_1oekr_284",Gi="_breadcrumbDivider_1oekr_288",zi="_breadcrumbActive_1oekr_293",Oi="_detailContent_1oekr_301",y={taxonomyDrillDown:ni,drillDownList:ii,librarySection:oi,libraryLauncher:li,libraryLauncherInfo:ri,libraryLauncherIcon:ci,libraryLauncherText:di,libraryLauncherLabel:pi,libraryLauncherSubtext:ui,libraryLauncherMeta:mi,drillDownSection:hi,drillDownSectionHeader:gi,drillDownSectionTitle:xi,drillDownItem:bi,drillDownItemAction:yi,drillDownItemDimmed:vi,drillDownItemInfo:fi,drillDownItemText:ji,drillDownItemLabel:Ci,drillDownItemSubtext:ki,systemIcon:Ni,chevron:Ti,orderButtons:wi,createOverlay:Si,createDialog:$i,createDialogTitle:_i,inputGroup:Li,dialogActions:Ii,createSubmit:Mi,createCancel:Pi,taxonomyDetailView:Bi,detailHeader:Ai,taxonomyBreadcrumbs:Di,breadcrumbPrev:Ei,breadcrumbIcon:Ri,breadcrumbDivider:Gi,breadcrumbActive:zi,detailContent:Oi};function Fi(n){const o=[{id:"categories",label:n.displayLabels?.category||"Categories",kind:"system",summary:`${n.categories.length} configured`},{id:"types",label:n.displayLabels?.type||"Task Types",kind:"system",summary:`${n.types.length} active`},{id:"priorities",label:n.displayLabels?.priority||"Priority Levels",kind:"system",summary:`${n.priorities.length} levels`},{id:"complexities",label:"Complexity",kind:"attribute",summary:n.manualComplexityEnabled?"Enabled":"Disabled (default)"}],d=n.taxonomies.map(u=>({id:u.id,label:u.label,kind:"custom",summary:`${u.options.length} options${u.status==="retired"?" · Retired":""}`,taxonomy:u}));return[...o,...d]}function Hi({taxonomy:n,onUpdateTaxonomy:o,onRemoveTaxonomy:d,onRestoreTaxonomy:u}){const[g,C]=i.useState(""),[T,S]=i.useState(!1),[M,G]=i.useState(""),[O,j]=i.useState(n.label),[$,P]=i.useState((n.aliases||[]).join(", ")),[W,B]=i.useState(""),[x,w]=i.useState(null),N=a=>{const c=a.split(",").map(L=>L.trim()).filter(Boolean);return c.length>0?Array.from(new Set(c)):void 0};i.useEffect(()=>{j(n.label),P((n.aliases||[]).join(", "));const a=n.options.find(c=>String(c.value)===String(g));w(a||null),B((a?.aliases||[]).join(", "))},[n,g]);const k=a=>{o({...n,...a})},E=()=>{if(!M.trim())return;const a=M.toLowerCase().trim().replace(/\s+/g,"-");if(n.options.some(L=>L.value===a)){alert("Option value already exists");return}const c={value:a,label:M.trim(),color:Qe[n.options.length%Qe.length],status:"active"};k({options:[...n.options,c]}),G(""),S(!1),C(a)},m=(a,c)=>{k({options:n.options.map(L=>String(L.value)===String(a)?{...L,...c}:L)})},U=a=>{m(a,{status:"retired"})},h=a=>{m(a,{status:"active"})},_=(a,c)=>{const L=n.options.findIndex(F=>String(F.value)===String(a));if(L<0)return;const f=L+c;if(f<0||f>=n.options.length)return;const R=[...n.options],[p]=R.splice(L,1);R.splice(f,0,p),k({options:R})};return e.jsxs("div",{className:D.categoryManagerContainer,children:[e.jsxs("div",{className:`${s.categoryConfigPanel} ${s.configPanel} ${s.marginBottom24}`,children:[e.jsxs("div",{className:`${s.flexBetween} ${s.marginBottom16}`,children:[e.jsx("div",{className:s.flex1,children:e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock} ${s.marginBottom8}`,children:"Taxonomy Settings"})}),!n.isSystem&&(n.status==="retired"?e.jsx("button",{type:"button",className:s.saveSettingsBtn,onClick:()=>u?.(n.id),children:"Restore Taxonomy"}):d&&e.jsxs("button",{type:"button",className:`${s.destructiveBtn} ${s.deleteBtnSmall}`,onClick:()=>{confirm(`Retire taxonomy "${n.label}"? Existing task data will be preserved as legacy values.`)&&d(n.id)},children:[e.jsx(Xe,{size:14,className:s.trashIcon})," Retire Taxonomy"]}))]}),n.status==="retired"&&e.jsx("p",{className:s.settingsHint,style:{marginTop:"-4px",marginBottom:"16px"},children:"This taxonomy is retired. Existing tasks keep their values, but it is hidden from normal new-task entry unless a task already uses it."}),e.jsxs("div",{className:D.taxonomyGrid,children:[e.jsxs("div",{className:s.settingGroup,style:{margin:0},children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Display Label"}),e.jsx("input",{className:s.input,value:O,onChange:a=>j(a.target.value),onBlur:()=>k({label:O}),disabled:n.isSystem,placeholder:"Enter taxonomy name"})]}),e.jsxs("div",{className:s.settingGroup,style:{margin:0},children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Description"}),e.jsx("textarea",{className:s.textarea,value:n.description||"",onChange:a=>k({description:a.target.value}),placeholder:"Optional guidance for when and how to use this taxonomy...",rows:3,style:{minHeight:"88px"}})]}),e.jsxs("div",{className:s.settingGroup,style:{margin:0},children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Aliases"}),e.jsx("input",{className:s.input,value:$,onChange:a=>P(a.target.value),onBlur:()=>k({aliases:N($)}),placeholder:"Optional aliases, comma-separated"})]}),e.jsxs("div",{className:s.settingGroup,style:{margin:0},children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Widget Type"}),e.jsxs("select",{className:s.select,value:n.widgetType,onChange:a=>{const c=a.target.value;k({widgetType:c,multiSelect:c==="level"?!1:n.multiSelect})},children:[e.jsx("option",{value:"select",children:"Dropdown (Select Box)"}),e.jsx("option",{value:"level",children:"Level Selector (Segmented)"})]})]})]}),e.jsxs("div",{className:D.checkboxRow,children:[e.jsxs("label",{className:D.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:n.isRequired,onChange:a=>k({isRequired:a.target.checked}),className:D.checkboxSmall}),"Mark as Required"]}),e.jsxs("label",{className:`${D.checkboxLabel} ${n.widgetType==="level"?s.opacity50:""}`,children:[e.jsx("input",{type:"checkbox",checked:n.multiSelect,onChange:a=>k({multiSelect:a.target.checked}),disabled:n.widgetType==="level",className:D.checkboxSmall}),"Allow Multi-select"]})]}),e.jsxs("div",{className:D.checkboxRow,children:[e.jsxs("label",{className:D.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:n.formEnabled!==!1,onChange:a=>k({formEnabled:a.target.checked}),className:D.checkboxSmall}),"Show in Task Form"]}),e.jsxs("label",{className:D.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:n.filterEnabled!==!1,onChange:a=>k({filterEnabled:a.target.checked}),className:D.checkboxSmall}),"Show in Filters"]}),e.jsxs("label",{className:D.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:n.sortEnabled===!0,onChange:a=>k({sortEnabled:a.target.checked}),className:D.checkboxSmall}),"Show in Sorts"]})]})]}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin24}`}),e.jsxs("div",{className:`${s.configPanel} ${s.flex1} ${s.flexCol}`,children:[e.jsxs("div",{className:`${s.headerFlex}`,style:{marginBottom:x&&!T||T?"16px":"0"},children:[e.jsx("div",{style:{flex:1},children:e.jsx(Ds,{value:g,options:[{value:"",label:"Select an option to configure...",icon:"HelpCircle",color:"var(--text-secondary)"},...n.options.map(a=>({value:a.value,label:a.status==="retired"?`${a.label} (Retired)`:a.label,icon:a.icon,color:a.color}))],onChange:a=>{C(a),S(!1)},disabled:T})}),T?e.jsx("button",{type:"button",onClick:()=>S(!1),title:"Cancel",className:`${s.browseBtn} ${s.cancelBtnRed}`,children:e.jsx(Bs,{size:18})}):e.jsx("button",{type:"button",className:s.browseBtn,onClick:()=>S(!0),title:"Add Option",children:e.jsx(ms,{size:18})})]}),T&&e.jsx("div",{className:`${s.configItem} ${s.marginBottom16}`,children:e.jsxs("div",{className:D.flexGap8,children:[e.jsx("input",{type:"text",className:s.input,placeholder:"New option label...",value:M,onChange:a=>G(a.target.value),onKeyDown:a=>{a.key==="Enter"&&E()},autoFocus:!0}),e.jsx("button",{type:"button",className:s.saveSettingsBtn,onClick:E,disabled:!M.trim(),children:"Add Option"})]})}),x&&!T&&e.jsxs("div",{className:s.flex1,children:[e.jsx("div",{className:`${s.configDivider} ${s.marginBottom20}`}),e.jsxs("div",{className:`${s.flexBetweenCenter} ${s.marginBottom20}`,children:[e.jsxs("div",{className:`${s.flexColGap4} ${s.flex1}`,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Option Label"}),e.jsxs("div",{className:s.gridConfig,children:[e.jsx("input",{className:s.input,value:x.label,onChange:a=>m(x.value,{label:a.target.value}),placeholder:"Option Label"}),x.status==="retired"?e.jsx("button",{type:"button",className:s.saveSettingsBtn,onClick:()=>h(x.value),title:"Restore Option",children:"Restore"}):e.jsxs("button",{type:"button",className:`${s.destructiveBtn} ${s.deleteBtnMedium}`,onClick:()=>U(x.value),title:"Retire Option",children:[e.jsx(Xe,{size:14,className:s.trashIcon})," Retire"]})]})]}),e.jsxs("div",{className:D.optionOrderButtons,children:[e.jsx("button",{type:"button",className:s.browseBtn,title:"Move option up",onClick:()=>_(x.value,-1),disabled:n.options[0]?.value===x.value,children:e.jsx(Ga,{size:16})}),e.jsx("button",{type:"button",className:s.browseBtn,title:"Move option down",onClick:()=>_(x.value,1),disabled:n.options[n.options.length-1]?.value===x.value,children:e.jsx(za,{size:16})})]})]}),e.jsx("p",{className:s.settingsHint,style:{marginBottom:"20px"},children:"Retired options stay visible for existing tasks and filters, but they should not be used for new work."}),e.jsxs("div",{className:s.settingGroup,style:{marginBottom:"20px"},children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Aliases"}),e.jsx("input",{className:s.input,value:W,onChange:a=>B(a.target.value),onBlur:()=>m(x.value,{aliases:N(W)}),placeholder:"Optional aliases, comma-separated"})]}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin}`}),e.jsxs("div",{className:s.configSection,children:[e.jsx("label",{className:`${s.label} ${s.inputLabelBlock}`,children:"Visual Style"}),e.jsxs("div",{className:s.categorySubConfig,children:[e.jsx("div",{className:s.colorPickerGrid,children:Qe.map(a=>{const c=Q(a)||"#000000",L=x.color===a,f=x.icon&&kt[x.icon]?kt[x.icon]:St;return e.jsx("button",{type:"button",className:`${s.colorSwatch} ${L?s.colorSwatchActive:""}`,style:{borderColor:L?c:void 0,"--swatch-color":c,"--swatch-border-color":`${c}80`},onClick:()=>m(x.value,{color:a}),title:a,children:e.jsx(f,{size:14,style:{color:c}})},a)})}),e.jsx("div",{className:s.iconGrid,children:Es.map(a=>{const c=kt[a]||xe[a]||St;return e.jsx("button",{type:"button",className:`${s.iconPickerBtn} ${x.icon===a?s.iconPickerBtnActive:""}`,style:x.icon===a?{borderColor:Q(x.color),color:Q(x.color),background:`${Q(x.color)}15`}:{},onClick:()=>m(x.value,{icon:a}),title:a,children:e.jsx(c,{size:16})},a)})})]})]})]}),!x&&!T&&e.jsxs("div",{className:`${D.emptyStateBox} ${D.emptyStateBare}`,children:[e.jsx(wn,{size:24,className:D.emptyStateIcon}),"Select an option above to configure its appearance"]})]})]})}function Ui(n){const{displayLabel:o,categories:d,pathValidation:u,onUpdateDisplayLabel:g,onUpdateCategory:C,onRemoveCategory:T,onSaveCategory:S,onAddPath:M,onRemovePath:G,onUpdateCategoryIcon:O,onUpdateCategoryColor:j,onBrowseFolders:$}=n,[P,W]=i.useState(""),[B,x]=i.useState(!1),[w,N]=i.useState(""),[k,E]=i.useState(""),[m,U]=i.useState(o||""),[h,_]=i.useState("");i.useEffect(()=>{U(o||"")},[o]),i.useEffect(()=>{const p=d.find(F=>F.value===P);p&&E(p.label)},[P,d]);const a=()=>{if(!w.trim())return;S(w);const p=w.trim().toLowerCase().replace(/\s+/g,"-");N(""),x(!1),setTimeout(()=>W(p),100)},c=p=>{k&&k!==p.label&&C({...p,label:k},p.label)},L=p=>{const F=[];if(p.path&&F.push(p.path),p.paths&&p.paths.length>0)for(const J of p.paths)F.includes(J)||F.push(J);return F},f=d.find(p=>p.value===P),R=f?.value===jn;return e.jsxs("div",{className:`${s.configPanel} ${s.flex1}`,children:[e.jsxs("div",{className:`${s.headerFlex}`,style:{marginBottom:f&&!B||B?"20px":"0"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{id:"category-config-label",className:s.label,style:{display:"none"},children:"Select Category"}),e.jsx(Ds,{value:P,options:[{value:"",label:"Select a category to configure...",icon:"HelpCircle",color:"var(--text-secondary)"},...d.map(p=>({value:p.value,label:`${p.label}${p.disabled?" (Legacy)":""}`,icon:p.icon,color:p.color}))],onChange:p=>{W(String(p)),x(!1)},disabled:B,ariaLabelledBy:"category-config-label"})]}),B?e.jsx("button",{type:"button",className:`${s.browseBtn} ${s.cancelBtnRed}`,onClick:()=>x(!1),title:"Cancel creation",children:e.jsx(Bs,{size:18})}):e.jsx("button",{type:"button",className:s.browseBtn,onClick:()=>x(!0),title:"Create new category",children:e.jsx(ms,{size:18})})]}),B&&e.jsxs("div",{className:`${s.configItem} ${s.marginBottom16}`,children:[e.jsx("div",{className:`${s.labelRow} ${s.marginBottom8}`,children:e.jsx("label",{className:s.settingsLabel,children:"New Category Name"})}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsx("input",{type:"text",className:s.input,placeholder:"Enter category name",value:w,onChange:p=>N(p.target.value),onKeyDown:p=>{p.key==="Enter"&&a()},autoFocus:!0}),e.jsx("button",{type:"button",className:s.saveSettingsBtn,onClick:a,disabled:!w.trim(),children:"Create"})]})]}),f&&!B&&e.jsxs("div",{className:s.flex1,style:{overflowY:"auto",marginRight:"-8px",paddingRight:"8px"},children:[e.jsx("div",{className:`${s.configDivider} ${s.marginBottom20}`}),e.jsxs("div",{className:`${s.configSection} ${s.marginBottom20}`,children:[e.jsxs("div",{className:s.flexBetween,children:[e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock}`,children:"General"}),!R&&e.jsxs("button",{type:"button",onClick:()=>{confirm(`Retire category "${f.label}"? Existing tasks will be reassigned to ${Ta}.`)&&(T(f.value),W(""))},title:"Retire Category",className:`${s.destructiveBtn} ${s.deleteBtnSmall}`,children:[e.jsx(Xe,{size:14,className:s.trashIcon})," Retire"]})]}),R&&e.jsxs("p",{className:s.settingsHint,style:{marginBottom:"12px"},children:[Ta," is the protected fallback category and cannot be retired."]}),e.jsxs("div",{className:s.gridConfig,children:[e.jsxs("div",{className:s.flexColGap4,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Display Label"}),e.jsx("input",{className:s.input,value:m,onChange:p=>U(p.target.value),onBlur:()=>g?.(m.trim())})]}),e.jsxs("div",{className:s.flexColGap4,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Label"}),e.jsx("input",{className:s.input,value:k,onChange:p=>E(p.target.value),onBlur:()=>c(f),onKeyDown:p=>{p.key==="Enter"&&(c(f),p.target.blur())}})]}),e.jsxs("div",{className:s.flexColGap4Center,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Available for New Tasks"}),e.jsx("input",{type:"checkbox",checked:!f.disabled,onChange:()=>C({...f,disabled:!f.disabled}),className:s.checkboxInput})]})]}),e.jsx("p",{className:s.settingsHint,style:{marginTop:"12px"},children:"Turn this off to keep the category on existing tasks while removing it from new task selection by default."})]}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin}`}),e.jsxs("div",{className:`${s.configSection} ${s.marginBottom20}`,children:[e.jsx("label",{className:s.subLabel,style:{fontSize:"14px",fontWeight:600,display:"block",marginBottom:"8px"},children:"Context Paths"}),e.jsx("p",{className:s.settingsHint,style:{marginBottom:"12px"},children:"Files in these paths will be included as context for tasks in this category."}),L(f).length>0&&e.jsx("div",{className:`${s.pathList} ${s.pathListMargin}`,children:L(f).map((p,F)=>{const J=u[p],re=J?.exists,es=J?.isFile;return e.jsxs("div",{className:`${s.pathChip} ${re===!1?s.pathInvalid:re?s.pathValid:""}`,children:[re===void 0?e.jsx(_e,{size:12,className:s.spinner}):re?es?e.jsx(Sn,{size:12,className:s.pathValidIcon}):e.jsx(Sa,{size:12,className:s.pathValidIcon}):e.jsx(Z,{size:12,className:s.pathInvalidIcon}),e.jsx("span",{className:s.pathText,title:p,children:p}),e.jsx("button",{type:"button",className:s.removePathBtn,onClick:()=>G(f.value,p),title:"Remove path",children:e.jsx(Bs,{size:10})})]},F)})}),e.jsxs("div",{className:`${s.pathInputGroup} ${D.pathInputGroupStretch}`,children:[e.jsx("input",{type:"text",className:s.input,value:h,onChange:p=>_(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),h.trim()&&(M(f.value,h.trim()),_("")))},placeholder:"Add path (e.g. path/to/folder)"}),e.jsx("button",{type:"button",className:s.browseBtn,onClick:()=>{h.trim()&&(M(f.value,h.trim()),_(""))},disabled:!h.trim(),title:"Add path",children:e.jsx(ms,{size:18})}),e.jsx("button",{type:"button",className:s.browseBtn,onClick:()=>$(f.value),title:"Browse folders",children:e.jsx(Sa,{size:16})})]})]}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin}`}),e.jsxs("div",{className:s.configSection,children:[e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock} ${s.subLabelBlock12}`,children:"Visual Style"}),e.jsxs("div",{className:s.categorySubConfig,children:[e.jsx("div",{className:s.colorPickerGrid,children:Qe.map(p=>{const F=Q(p)||"#000000",J=f.color===p,re=f.icon&&xe[f.icon]?xe[f.icon]:$n;return e.jsx("button",{type:"button",className:`${s.colorSwatch} ${J?s.colorSwatchActive:""}`,style:{borderColor:J?F:void 0,"--swatch-color":F,"--swatch-border-color":`${F}80`},onClick:()=>j(f.value,p),title:p,children:e.jsx(re,{size:14,style:{color:F}})},p)})}),e.jsx("div",{className:s.iconGrid,children:Es.map(p=>{const F=xe[p];return e.jsx("button",{type:"button",className:`${s.iconPickerBtn} ${f.icon===p?s.iconPickerBtnActive:""}`,style:f.icon===p?{borderColor:Q(f.color),color:Q(f.color),background:`${Q(f.color)}15`}:{},onClick:()=>O(f.value,p),title:p,children:e.jsx(F,{size:16})},p)})})]})]})]}),!f&&!B&&e.jsx("div",{className:`${D.emptyStateItalic} ${D.emptyStateBare}`,children:"Select a category above to configure settings"})]})}function Wi(n){const{types:o,onSaveType:d,onRemoveType:u,onUpdateType:g,displayLabel:C,onUpdateDisplayLabel:T}=n,[S,M]=i.useState(""),[G,O]=i.useState(!1),[j,$]=i.useState(""),[P,W]=i.useState(""),[B,x]=i.useState(C||"");i.useEffect(()=>{const m=o.find(U=>U.value===S);m&&W(m.label)},[S,o]),i.useEffect(()=>{x(C||"")},[C]);const w=o.find(m=>m.value===S),N=w?.value===Cn,k=w?.status==="retired",E=()=>{if(!j.trim())return;d(j);const m=j.trim().toLowerCase().replace(/\s+/g,"-");$(""),O(!1),setTimeout(()=>M(m),100)};return e.jsxs("div",{className:`${s.configPanel} ${s.flex1}`,children:[e.jsxs("div",{className:`${s.headerFlex}`,style:{marginBottom:w&&!G||G?"20px":"0"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{id:"type-config-label",className:s.label,style:{display:"none"},children:"Select Type"}),e.jsx(Ds,{value:S,options:[{value:"",label:"Select a type to configure...",icon:"HelpCircle",color:"var(--text-secondary)"},...o.map(m=>({value:m.value,label:m.status==="retired"?`${m.label} (Retired)`:m.label,icon:m.icon||"Box",color:m.color||"violet-500"}))],onChange:m=>{M(String(m)),O(!1)},disabled:G,ariaLabelledBy:"type-config-label"})]}),G?e.jsx("button",{type:"button",className:`${s.browseBtn} ${s.cancelBtnRed}`,onClick:()=>O(!1),title:"Cancel creation",children:e.jsx(Bs,{size:18})}):e.jsx("button",{type:"button",className:s.browseBtn,onClick:()=>O(!0),title:"Create new type",children:e.jsx(ms,{size:18})})]}),G&&e.jsxs("div",{className:`${s.configItem} ${s.marginBottom16}`,children:[e.jsx("div",{className:`${s.labelRow} ${s.marginBottom8}`,children:e.jsx("label",{className:s.settingsLabel,children:"New Type Label"})}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsx("input",{type:"text",className:s.input,placeholder:"Enter type name",value:j,onChange:m=>$(m.target.value),onKeyDown:m=>{m.key==="Enter"&&E()},autoFocus:!0}),e.jsx("button",{type:"button",className:s.saveSettingsBtn,onClick:E,disabled:!j.trim(),children:"Create"})]})]}),w&&!G&&e.jsxs("div",{className:s.flex1,children:[e.jsx("div",{className:`${s.configDivider} ${s.marginBottom20}`}),e.jsx("div",{className:s.flexBetweenCenter,children:e.jsxs("div",{className:`${s.flexColGap4} ${s.flex1}`,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Display Label"}),e.jsx("input",{className:s.input,value:B,onChange:m=>x(m.target.value),onBlur:()=>T?.(B.trim())}),e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Label"}),e.jsxs("div",{className:s.gridConfig,children:[e.jsx("input",{className:s.input,value:P,onChange:m=>W(m.target.value),onBlur:()=>g(w.value,{label:P}),onKeyDown:m=>{m.key==="Enter"&&m.currentTarget.blur()}}),!N&&e.jsxs("button",{type:"button",onClick:()=>{if(k){g(w.value,{status:"active"});return}confirm(`Retire type "${w.label}"? Existing tasks using it will keep it as a legacy type until reassigned.`)&&u(w.value)},title:k?"Restore Type":"Retire Type",className:`${s.destructiveBtn} ${s.deleteBtnMedium}`,children:[e.jsx(Xe,{size:14,className:s.trashIcon})," ",k?"Restore":"Retire"]})]})]})}),e.jsx("p",{className:`${s.settingsHint} ${s.marginTop12}`,children:N?"Task is the protected fallback type and cannot be retired.":k?"Retired types stay available as legacy values on existing tasks until you reassign them.":"Retiring a type removes it from new task selection while preserving it as a legacy value on tasks that already use it."}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin}`}),e.jsxs("div",{className:s.configSection,children:[e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock} ${s.subLabelBlock12}`,children:"Visual Style"}),e.jsxs("div",{className:s.categorySubConfig,children:[e.jsx("div",{className:s.colorPickerGrid,children:Qe.map(m=>{const U=Q(m)||"#000000",h=w.color===m,_=w.icon&&xe[w.icon]?xe[w.icon]:St;return e.jsx("button",{type:"button",className:`${s.colorSwatch} ${h?s.colorSwatchActive:""}`,style:{borderColor:h?U:void 0,"--swatch-color":U,"--swatch-border-color":`${U}80`},onClick:()=>g(w.value,{color:m}),title:m,children:e.jsx(_,{size:14,style:{color:U}})},m)})}),e.jsx("div",{className:s.iconGrid,children:Es.map(m=>{const U=xe[m];return e.jsx("button",{type:"button",className:`${s.iconPickerBtn} ${w.icon===m?s.iconPickerBtnActive:""}`,style:w.icon===m?{borderColor:Q(w.color),color:Q(w.color),background:`${Q(w.color)}15`}:{},onClick:()=>g(w.value,{icon:m}),title:m,children:e.jsx(U,{size:16})},m)})})]})]})]}),!w&&!G&&e.jsx("div",{className:`${D.emptyStateItalic} ${D.emptyStateBare}`,children:"Select a type above to manage"})]})}function Vi({priorities:n,onUpdatePriorities:o,displayLabel:d,onUpdateDisplayLabel:u}){const[g,C]=i.useState(""),[T,S]=i.useState(null),[M,G]=i.useState(d||"");i.useEffect(()=>{const j=n.find($=>String($.value)===String(g))||null;S(j)},[n,g]),i.useEffect(()=>{G(d||"")},[d]);const O=(j,$)=>{o(n.map(P=>String(P.value)===String(j)?{...P,...$}:P))};return e.jsxs("div",{className:`${s.configPanel} ${s.flex1}`,children:[e.jsxs("div",{className:s.marginBottom20,children:[e.jsx("label",{id:"priority-config-label",className:s.label,style:{display:"none"},children:"Select Priority"}),e.jsx(Ds,{value:g,options:[{value:"",label:"Select a priority level to configure...",icon:"HelpCircle",color:"var(--text-secondary)"},...n.map(j=>({value:j.value,label:j.label,icon:j.icon||"Gauge",color:j.color||"blue-500"}))],onChange:j=>C(j),ariaLabelledBy:"priority-config-label"})]}),T?e.jsxs("div",{className:s.flex1,style:{overflowY:"auto",marginRight:"-8px",paddingRight:"8px"},children:[e.jsx("div",{className:`${s.configDivider} ${s.marginBottom20}`}),e.jsxs("div",{className:`${s.configSection} ${s.marginBottom20}`,children:[e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock}`,children:"General"}),e.jsx("p",{className:s.settingsHint,style:{marginBottom:"12px"},children:"Priority uses a fixed ordered scale. You can rename and restyle levels, but not add, remove, or reorder them here."}),e.jsxs("div",{className:s.gridConfig,children:[e.jsxs("div",{className:s.flexColGap4,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Display Label"}),e.jsx("input",{className:s.input,value:M,onChange:j=>G(j.target.value),onBlur:()=>u?.(M.trim())})]}),e.jsxs("div",{className:s.flexColGap4,children:[e.jsx("label",{className:`${s.label} ${s.inputLabel}`,children:"Label"}),e.jsx("input",{className:s.input,value:T.label,onChange:j=>O(T.value,{label:j.target.value})})]})]})]}),e.jsx("div",{className:`${s.configDivider} ${s.configDividerMargin}`}),e.jsxs("div",{className:s.configSection,children:[e.jsx("label",{className:`${s.subLabel} ${s.subLabelBlock} ${s.subLabelBlock12}`,children:"Visual Style"}),e.jsxs("div",{className:s.categorySubConfig,children:[e.jsx("div",{className:s.colorPickerGrid,children:Qe.map(j=>{const $=Q(j)||"#000000",P=T.color===j,W=T.icon&&xe[T.icon]?xe[T.icon]:$a;return e.jsx("button",{type:"button",className:`${s.colorSwatch} ${P?s.colorSwatchActive:""}`,style:{borderColor:P?$:void 0,"--swatch-color":$,"--swatch-border-color":`${$}80`},onClick:()=>O(T.value,{color:j}),title:j,children:e.jsx(W,{size:14,style:{color:$}})},j)})}),e.jsx("div",{className:s.iconGrid,children:Es.map(j=>{const $=xe[j]||$a;return e.jsx("button",{type:"button",className:`${s.iconPickerBtn} ${T.icon===j?s.iconPickerBtnActive:""}`,style:T.icon===j?{borderColor:Q(T.color),color:Q(T.color),background:`${Q(T.color)}15`}:{},onClick:()=>O(T.value,{icon:j}),title:j,children:e.jsx($,{size:16})},j)})})]})]})]}):e.jsx("div",{className:`${D.emptyStateItalic} ${D.emptyStateBare}`,children:"Select a priority above to manage"})]})}function Ki(n){return n.map(o=>({...o,aliases:Array.isArray(o.aliases)?[...o.aliases]:void 0}))}function qi(n){return n.map(o=>({...o,aliases:Array.isArray(o.aliases)?[...o.aliases]:void 0,options:Ki(Array.isArray(o.options)?o.options:[])}))}const Ji=[{id:"client-delivery",label:"Client Delivery",description:"Taxonomies for client-facing work, approvals, and service commitments.",domainTag:"operations",bestFor:"Agencies, consulting, and service delivery work.",taxonomies:[{id:"approval-stage",label:"Approval Stage",description:"Track where work sits in the client or internal approval pipeline.",widgetType:"select",isSystem:!1,multiSelect:!1,isRequired:!1,formEnabled:!0,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:"draft",label:"Draft",color:"blue-200",icon:"Pencil",status:"active"},{value:"internal-review",label:"Internal Review",color:"blue-500",icon:"Users",status:"active"},{value:"client-review",label:"Client Review",color:"amber-500",icon:"MessageSquare",status:"active"},{value:"approved",label:"Approved",color:"emerald-500",icon:"CheckCircle",status:"active"}]},{id:"service-line",label:"Service Line",description:"Identify which delivery lane owns or contributes to this work.",widgetType:"select",isSystem:!1,multiSelect:!0,isRequired:!1,formEnabled:!0,filterEnabled:!0,sortEnabled:!1,status:"active",options:[{value:"strategy",label:"Strategy",color:"violet-500",icon:"Target",status:"active"},{value:"content",label:"Content",color:"sky-500",icon:"Pencil",status:"active"},{value:"delivery",label:"Delivery",color:"emerald-500",icon:"Briefcase",status:"active"},{value:"reporting",label:"Reporting",color:"amber-500",icon:"Activity",status:"active"}]}]},{id:"content-operations",label:"Content Operations",description:"Reusable taxonomies for channels, publishing readiness, and editorial planning.",domainTag:"content",bestFor:"Editorial calendars, content teams, and publishing operations.",taxonomies:[{id:"content-channel",label:"Content Channel",description:"Show where a piece of work will be published or reused.",widgetType:"select",isSystem:!1,multiSelect:!0,isRequired:!1,formEnabled:!0,filterEnabled:!0,sortEnabled:!1,status:"active",options:[{value:"blog",label:"Blog",color:"blue-500",icon:"FileText",status:"active"},{value:"email",label:"Email",color:"amber-500",icon:"Mail",status:"active"},{value:"social",label:"Social",color:"violet-500",icon:"Flag",status:"active"},{value:"webinar",label:"Webinar",color:"violet-500",icon:"Video",status:"active"}]},{id:"publish-readiness",label:"Publish Readiness",description:"Track whether a content task is ready to move into scheduling or release.",widgetType:"select",isSystem:!1,multiSelect:!1,isRequired:!0,formEnabled:!0,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:"not-started",label:"Not Started",color:"blue-200",icon:"Circle",status:"active"},{value:"in-review",label:"In Review",color:"amber-500",icon:"Search",status:"active"},{value:"ready",label:"Ready",color:"emerald-500",icon:"Rocket",status:"active"}]},{id:"effort-band",label:"Effort Band",description:"A lightweight numeric scale for content effort without using complexity.",widgetType:"level",isSystem:!1,multiSelect:!1,isRequired:!1,formEnabled:!1,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:1,label:"Light",color:"teal-500",icon:"Wind",status:"active"},{value:2,label:"Standard",color:"blue-500",icon:"Minus",status:"active"},{value:3,label:"Heavy",color:"orange-500",icon:"Gauge",status:"active"}]}]},{id:"product-delivery",label:"Product Delivery",description:"Useful planning taxonomies for delivery stages, stakeholders, and delivery risk.",domainTag:"product",bestFor:"Product teams, implementation work, and cross-functional delivery.",taxonomies:[{id:"delivery-stage",label:"Delivery Stage",description:"Track how work moves from intake through active delivery.",widgetType:"select",isSystem:!1,multiSelect:!1,isRequired:!0,formEnabled:!0,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:"backlog",label:"Backlog",color:"blue-200",icon:"Inbox",status:"active"},{value:"scoping",label:"Scoping",color:"sky-500",icon:"Search",status:"active"},{value:"ready",label:"Ready",color:"blue-500",icon:"Check",status:"active"},{value:"in-flight",label:"In Flight",color:"indigo-500",icon:"Play",status:"active"},{value:"blocked",label:"Blocked",color:"amber-500",icon:"Pause",status:"active"},{value:"done",label:"Done",color:"green-500",icon:"CheckCircle",status:"active"}]},{id:"stakeholder",label:"Stakeholder",description:"Show which audience or stakeholder group is most relevant to the work.",widgetType:"select",isSystem:!1,multiSelect:!0,isRequired:!1,formEnabled:!0,filterEnabled:!0,sortEnabled:!1,status:"active",options:[{value:"internal",label:"Internal",color:"blue-500",icon:"Users",status:"active"},{value:"client",label:"Client",color:"amber-500",icon:"Briefcase",status:"active"},{value:"leadership",label:"Leadership",color:"violet-500",icon:"Flag",status:"active"},{value:"partner",label:"Partner",color:"teal-500",icon:"Globe",status:"active"}]},{id:"risk-level",label:"Risk Level",description:"A simple signal for delivery or coordination risk.",widgetType:"level",isSystem:!1,multiSelect:!1,isRequired:!1,formEnabled:!1,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:1,label:"Low",color:"teal-500",icon:"Wind",status:"active"},{value:2,label:"Medium",color:"amber-500",icon:"Gauge",status:"active"},{value:3,label:"High",color:"red-500",icon:"TriangleAlert",status:"active"}]}]},{id:"content-production",label:"Content Production",description:"Production-oriented taxonomies for content stages, channels, and asset effort.",domainTag:"marketing",bestFor:"Marketing teams, campaigns, and multi-channel asset production.",taxonomies:[{id:"content-stage",label:"Content Stage",description:"Track where a content asset sits in the production lifecycle.",widgetType:"select",isSystem:!1,multiSelect:!1,isRequired:!0,formEnabled:!0,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:"outline",label:"Outline",color:"blue-200",icon:"Pencil",status:"active"},{value:"draft",label:"Draft",color:"blue-500",icon:"FileText",status:"active"},{value:"review",label:"Review",color:"amber-500",icon:"Search",status:"active"},{value:"approved",label:"Approved",color:"green-500",icon:"CheckCircle",status:"active"},{value:"published",label:"Published",color:"violet-500",icon:"Rocket",status:"active"}]},{id:"distribution-channel",label:"Distribution Channel",description:"Capture where the asset will be published or promoted.",widgetType:"select",isSystem:!1,multiSelect:!0,isRequired:!1,formEnabled:!0,filterEnabled:!0,sortEnabled:!1,status:"active",options:[{value:"blog",label:"Blog",color:"blue-500",icon:"FileText",status:"active"},{value:"email",label:"Email",color:"amber-500",icon:"Mail",status:"active"},{value:"video",label:"Video",color:"violet-500",icon:"Video",status:"active"},{value:"social",label:"Social",color:"indigo-500",icon:"Flag",status:"active"},{value:"docs",label:"Docs",color:"sky-500",icon:"Book",status:"active"}]},{id:"asset-effort",label:"Asset Effort",description:"Estimate the relative production effort for a content asset.",widgetType:"level",isSystem:!1,multiSelect:!1,isRequired:!1,formEnabled:!1,filterEnabled:!0,sortEnabled:!0,status:"active",options:[{value:1,label:"Quick",color:"teal-500",icon:"Wind",status:"active"},{value:2,label:"Standard",color:"blue-500",icon:"Minus",status:"active"},{value:3,label:"Campaign",color:"orange-500",icon:"Rocket",status:"active"}]}]}];function Yi(){return Ji.map(n=>({...n,taxonomies:qi(n.taxonomies)}))}const Zi="_libraryContainer_94zm2_1",Qi="_introCard_94zm2_7",Xi="_eyebrow_94zm2_17",eo="_introTitle_94zm2_28",so="_introCopy_94zm2_35",to="_prototypeNotice_94zm2_43",ao="_libraryGrid_94zm2_49",no="_packList_94zm2_56",io="_packCard_94zm2_62",oo="_packCardInteractive_94zm2_73",lo="_packCardActive_94zm2_88",ro="_packHeader_94zm2_94",co="_packHeaderText_94zm2_101",po="_packTitleRow_94zm2_108",uo="_packTitle_94zm2_108",mo="_packBadge_94zm2_122",ho="_packDescription_94zm2_137",go="_packBestFor_94zm2_144",xo="_packCounts_94zm2_151",bo="_packTaxonomyPreview_94zm2_157",yo="_packTaxonomyChip_94zm2_163",vo="_packTaxonomyMore_94zm2_175",fo="_packCountChip_94zm2_185",jo="_packActions_94zm2_198",Co="_packActionHint_94zm2_204",ko="_previewPanel_94zm2_212",No="_previewHeader_94zm2_224",To="_previewSummaryRow_94zm2_230",wo="_previewTitle_94zm2_236",So="_previewBestFor_94zm2_243",$o="_previewSubtext_94zm2_250",_o="_previewSection_94zm2_256",Lo="_previewSectionTitle_94zm2_262",Io="_previewList_94zm2_271",Mo="_previewItem_94zm2_277",Po="_previewItemLabel_94zm2_288",Bo="_previewItemMeta_94zm2_298",Ao="_customTaxonomyCard_94zm2_304",Do="_customTaxonomyHeader_94zm2_314",Eo="_customTaxonomyDescription_94zm2_321",Ro="_customTaxonomyBadges_94zm2_328",Go="_customTaxonomyBadge_94zm2_328",zo="_applyPanel_94zm2_347",Oo="_applyTitle_94zm2_357",Fo="_applyCopy_94zm2_364",Ho="_analysisPanel_94zm2_371",Uo="_analysisCopy_94zm2_381",Wo="_analysisWarning_94zm2_388",Vo="_checkboxList_94zm2_395",Ko="_checkboxLabel_94zm2_401",qo="_prototypeResult_94zm2_409",Jo="_prototypeError_94zm2_415",r={libraryContainer:Zi,introCard:Qi,eyebrow:Xi,introTitle:eo,introCopy:so,prototypeNotice:to,libraryGrid:ao,packList:no,packCard:io,packCardInteractive:oo,packCardActive:lo,packHeader:ro,packHeaderText:co,packTitleRow:po,packTitle:uo,packBadge:mo,packDescription:ho,packBestFor:go,packCounts:xo,packTaxonomyPreview:bo,packTaxonomyChip:yo,packTaxonomyMore:vo,packCountChip:fo,packActions:jo,packActionHint:Co,previewPanel:ko,previewHeader:No,previewSummaryRow:To,previewTitle:wo,previewBestFor:So,previewSubtext:$o,previewSection:_o,previewSectionTitle:Lo,previewList:Io,previewItem:Mo,previewItemLabel:Po,previewItemMeta:Bo,customTaxonomyCard:Ao,customTaxonomyHeader:Do,customTaxonomyDescription:Eo,customTaxonomyBadges:Ro,customTaxonomyBadge:Go,applyPanel:zo,applyTitle:Oo,applyCopy:Fo,analysisPanel:Ho,analysisCopy:Uo,analysisWarning:Wo,checkboxList:Vo,checkboxLabel:Ko,prototypeResult:qo,prototypeError:Jo};function Yo(n,o="Layers"){const d=xe[n||o]||xe[o];return e.jsx(d,{size:15})}function Ba(n){return{categories:n.categories.length>0,types:n.types.length>0,priorities:n.priorities.length>0}}function Ps(n){const{title:o,items:d}=n;return e.jsxs("section",{className:r.previewSection,children:[e.jsx("h4",{className:r.previewSectionTitle,children:o}),e.jsx("div",{className:r.previewList,children:d.map(u=>e.jsxs("div",{className:r.previewItem,children:[e.jsxs("span",{className:r.previewItemLabel,children:[e.jsx("span",{style:{color:u.color?`var(--color-${u.color}, var(--text-secondary))`:"var(--text-secondary)"},children:Yo(u.icon)}),e.jsx("span",{children:u.label})]}),u.meta?e.jsx("span",{className:r.previewItemMeta,children:u.meta}):null]},u.key))})]})}function Aa(n){let o=0,d=0,u=0,g=0;return n.taxonomies.forEach(C=>{C.multiSelect&&(o+=1),C.widgetType==="level"&&(d+=1),C.isRequired&&(u+=1),C.formEnabled!==!1&&(g+=1)}),{multiSelectCount:o,numericCount:d,requiredCount:u,formEnabledCount:g}}function Zo(n){const o=[];return o.push(n.widgetType==="level"?"Numeric":"Descriptive"),n.multiSelect&&o.push("Multi-select"),n.isRequired&&o.push("Required"),n.formEnabled!==!1&&o.push("Shows in forms"),n.filterEnabled&&o.push("Filterable"),n.sortEnabled&&o.push("Sortable"),o}function Qo(n){return{...n,aliases:Array.isArray(n.aliases)?[...n.aliases]:void 0,options:Array.isArray(n.options)?n.options.map(o=>({...o,aliases:Array.isArray(o.aliases)?[...o.aliases]:void 0})):[]}}function Ha(n,o){n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),o())}function Xo(n){const{onAnalyzeSystemTaxonomyPack:o,onApplySystemTaxonomyPack:d}=n,u=i.useMemo(()=>Ra(),[]),[g,C]=i.useState(u),[T,S]=i.useState(u[0]?.id||""),[M,G]=i.useState(()=>u[0]?Ba(u[0]):{categories:!0,types:!0,priorities:!0}),[O,j]=i.useState(!1),[$,P]=i.useState(null),[W,B]=i.useState(!1),[x,w]=i.useState(!1),N=g.find(h=>h.id===T)||g[0]||null,k=i.useMemo(()=>!N||!o?null:o(N),[o,N]);i.useEffect(()=>{let h=!1;return B(!0),fetch("/api/taskforce/taxonomy-library").then(async _=>{if(!_.ok)return null;const a=await _.json().catch(()=>({})),c=Array.isArray(a?.packs)?a.packs:[];return!h&&c.length>0&&(C(c),S(L=>c.some(f=>f.id===L)?L:c[0].id)),null}).catch(()=>null).finally(()=>{h||B(!1)}),()=>{h=!0}},[]);const E=h=>{const _=g.find(a=>a.id===h);S(h),G(_?Ba(_):{categories:!0,types:!0,priorities:!0}),j(!1),P(null)},m=h=>{G(_=>({..._,[h]:!_[h]}))},U=()=>{if(!N)return;if(Object.entries(M).filter(([,_])=>_).map(([_])=>_).length===0){P({type:"error",message:"Select at least one taxonomy section to apply."});return}if(!d){P({type:"error",message:"System taxonomy pack apply is not available in this surface yet."});return}w(!0),P(null),d({pack:N,sections:M,remapExistingValuesToDefault:O}).then(_=>{if(_?.success){P({type:"success",message:`${N.label} was applied to the selected taxonomy sections.`});return}P({type:"error",message:_?.error||"Failed to apply the selected taxonomy pack."})}).catch(_=>{P({type:"error",message:_ instanceof Error?_.message:"Failed to apply the selected taxonomy pack."})}).finally(()=>{w(!1)})};return N?e.jsxs("div",{className:r.libraryContainer,children:[e.jsxs("section",{className:r.introCard,children:[e.jsxs("span",{className:r.eyebrow,children:[e.jsx($t,{size:14}),"System Taxonomy Library"]}),e.jsx("h3",{className:r.introTitle,children:"Browse starter packs before you replace anything."}),e.jsx("p",{className:r.introCopy,children:"Library packs give you coordinated categories, task types, and priority scales. Apply replaces only the sections you choose."}),W?e.jsx("p",{className:r.prototypeNotice,children:"Loading available packs…"}):null]}),e.jsxs("div",{className:r.libraryGrid,children:[e.jsx("div",{className:r.packList,children:g.map(h=>{const _=h.id===T;return e.jsxs("article",{className:`${r.packCard} ${r.packCardInteractive} ${_?r.packCardActive:""}`,role:"button",tabIndex:0,"aria-pressed":_,onClick:()=>E(h.id),onKeyDown:a=>Ha(a,()=>E(h.id)),children:[e.jsx("div",{className:r.packHeader,children:e.jsxs("div",{className:r.packHeaderText,children:[e.jsx("div",{className:r.packTitleRow,children:e.jsx("h4",{className:r.packTitle,children:h.label})}),e.jsx("p",{className:r.packDescription,children:h.description})]})}),e.jsxs("div",{className:r.packCounts,children:[e.jsxs("span",{className:r.packCountChip,children:[e.jsx(Oa,{size:13}),h.categories.length," categories"]}),e.jsxs("span",{className:r.packCountChip,children:[e.jsx(_n,{size:13}),h.types.length," types"]}),e.jsxs("span",{className:r.packCountChip,children:[e.jsx(ne,{size:13}),h.priorities.length," priority levels"]})]}),e.jsx("div",{className:r.packActions,children:e.jsx("button",{type:"button",className:s.submitBtn,onClick:()=>E(h.id),children:"Apply"})})]},h.id)})}),e.jsxs("aside",{className:r.previewPanel,children:[e.jsxs("div",{className:r.previewHeader,children:[e.jsx("h3",{className:r.previewTitle,children:N.label}),e.jsx("p",{className:r.previewSubtext,children:"Read-only preview. Applying this pack will replace only the sections you choose."})]}),e.jsx(Ps,{title:"Categories",items:N.categories.map(h=>({key:h.value,label:h.label,icon:h.icon,color:h.color}))}),e.jsx(Ps,{title:"Task Types",items:N.types.map(h=>({key:h.value,label:h.label,icon:h.icon,color:h.color,meta:h.status==="retired"?"Retired":void 0}))}),e.jsx(Ps,{title:"Priority Levels",items:N.priorities.map(h=>({key:String(h.value),label:h.label,icon:h.icon,color:h.color,meta:`Level ${h.value}`}))}),e.jsxs("section",{className:r.applyPanel,children:[e.jsx("h4",{className:r.applyTitle,children:"Apply Selected Sections"}),e.jsx("p",{className:r.applyCopy,children:"Applying this pack will replace the selected taxonomy sections in this workspace."}),k?e.jsxs("div",{className:r.analysisPanel,children:[k.unmatchedCategoryValues.length>0?e.jsxs("p",{className:r.analysisCopy,children:[k.unmatchedCategoryValues.length," category value",k.unmatchedCategoryValues.length===1?"":"s"," will be preserved as legacy unless you remap to default."]}):null,k.unmatchedTypeValues.length>0?e.jsxs("p",{className:r.analysisCopy,children:[k.unmatchedTypeValues.length," type value",k.unmatchedTypeValues.length===1?"":"s"," will be preserved as legacy unless you remap to default."]}):null,k.incompatiblePriorityValues.length>0?e.jsxs("p",{className:r.analysisWarning,children:["Existing tasks use priority level",k.incompatiblePriorityValues.length===1?"":"s"," ",k.incompatiblePriorityValues.join(", "),". Priority replacement will be blocked unless you remap unmatched existing values to default."]}):null,k.unmatchedCategoryValues.length===0&&k.unmatchedTypeValues.length===0&&k.incompatiblePriorityValues.length===0?e.jsx("p",{className:r.analysisCopy,children:"This pack lines up with the current workspace values for the selected taxonomy sections."}):null]}):null,e.jsxs("div",{className:r.checkboxList,children:[e.jsxs("label",{className:r.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:M.categories,onChange:()=>m("categories")}),e.jsx("span",{children:"Categories"})]}),e.jsxs("label",{className:r.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:M.types,onChange:()=>m("types")}),e.jsx("span",{children:"Types"})]}),e.jsxs("label",{className:r.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:M.priorities,onChange:()=>m("priorities")}),e.jsx("span",{children:"Priorities"})]})]}),e.jsxs("label",{className:r.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:O,onChange:()=>j(h=>!h)}),e.jsx("span",{children:"Remap unmatched existing values to default"})]}),e.jsx("p",{className:r.applyCopy,children:"Leave this off to preserve unmatched category and type values as legacy entries. Priority replacement will be blocked if existing tasks use values outside the selected pack."}),e.jsx("div",{className:r.packActions,children:e.jsx("button",{type:"button",className:s.submitBtn,onClick:U,disabled:x,children:x?"Applying…":"Apply Pack"})}),$?e.jsx("p",{className:`${r.prototypeResult} ${$.type==="error"?r.prototypeError:""}`,children:$.message}):null]})]})]})]}):e.jsx("div",{className:s.emptyState,children:e.jsx("p",{className:"tf-empty-copy",children:"No system taxonomy library packs are available."})})}function el(n){const{taxonomies:o=[],onUpdateCustomTaxonomies:d}=n,u=i.useMemo(()=>Yi(),[]),[g,C]=i.useState(u),[T,S]=i.useState(u[0]?.id||""),[M,G]=i.useState(!1),[O,j]=i.useState(null),[$,P]=i.useState(u[0]?.taxonomies.map(a=>a.id)||[]),[W,B]=i.useState(null),x=g.find(a=>a.id===T)||g[0]||null,w=x?Aa(x):null,N=i.useMemo(()=>x?x.taxonomies.filter(a=>$.includes(a.id)):[],[x,$]),k=i.useMemo(()=>new Set($),[$]),E=i.useMemo(()=>{const a=new Set(o.map(c=>c.id));return N.map(c=>c.id).filter(c=>a.has(c))},[N,o]),m=i.useMemo(()=>{if(!x)return[];const a=new Set(o.map(c=>c.id));return x.taxonomies.filter(c=>k.has(c.id)&&!a.has(c.id))},[x,k,o]);if(i.useEffect(()=>{let a=!1;return G(!0),j(null),fetch("/api/taskforce/custom-taxonomy-library").then(async c=>{if(!c.ok)throw new Error(`Failed to load custom taxonomy packs (${c.status})`);const L=await c.json().catch(()=>({})),f=Array.isArray(L?.packs)?L.packs:[];!a&&f.length>0&&(C(f),S(R=>f.some(p=>p.id===R)?R:f[0].id))}).catch(c=>{a||j(c instanceof Error?c.message:"Failed to load custom taxonomy packs.")}).finally(()=>{a||G(!1)}),()=>{a=!0}},[]),i.useEffect(()=>{P(x?.taxonomies.map(a=>a.id)||[]),B(null)},[T,x]),!x)return e.jsx("div",{className:s.emptyState,children:e.jsx("p",{className:"tf-empty-copy",children:"No custom taxonomy library packs are available."})});const U=a=>{P(c=>c.includes(a)?c.filter(L=>L!==a):[...c,a]),B(null)},h=()=>{P(m.map(a=>a.id)),B(null)},_=()=>{if($.length===0){B({type:"error",message:"Select at least one taxonomy to install."});return}if(E.length>0){B({type:"error",message:`This workspace already has ${E.length} taxonomy ${E.length===1?"id":"ids"} that match your current selection. Deselect conflicting taxonomies before installing this pack.`});return}if(!d){B({type:"error",message:"Custom taxonomy install is not available in this surface yet."});return}d([...o,...m.map(a=>Qo(a))]),B({type:"success",message:`${m.length} custom ${m.length===1?"taxonomy was":"taxonomies were"} added to this workspace.`})};return e.jsxs("div",{className:r.libraryContainer,children:[e.jsxs("section",{className:r.introCard,children:[e.jsxs("span",{className:r.eyebrow,children:[e.jsx(_a,{size:14}),"Custom Taxonomy Library"]}),e.jsx("h3",{className:r.introTitle,children:"Browse reusable custom taxonomy packs."}),e.jsx("p",{className:r.introCopy,children:"These packs install workspace-owned custom taxonomies such as approval stages, channels, and effort bands. Review a pack, choose the taxonomies you want, and install them into this workspace."}),M?e.jsx("p",{className:r.prototypeNotice,children:"Loading available packs…"}):null,O?e.jsx("p",{className:`${r.prototypeResult} ${r.prototypeError}`,children:O}):null]}),e.jsxs("div",{className:r.libraryGrid,children:[e.jsx("div",{className:r.packList,children:g.map(a=>{const c=a.id===T,L=Aa(a),f=a.taxonomies.slice(0,3).map(R=>R.label);return e.jsxs("article",{className:`${r.packCard} ${r.packCardInteractive} ${c?r.packCardActive:""}`,role:"button",tabIndex:0,"aria-pressed":c,onClick:()=>S(a.id),onKeyDown:R=>Ha(R,()=>S(a.id)),children:[e.jsx("div",{className:r.packHeader,children:e.jsxs("div",{className:r.packHeaderText,children:[e.jsxs("div",{className:r.packTitleRow,children:[e.jsx("h4",{className:r.packTitle,children:a.label}),a.domainTag?e.jsx("span",{className:r.packBadge,children:a.domainTag}):null]}),e.jsx("p",{className:r.packDescription,children:a.description}),a.bestFor?e.jsxs("p",{className:r.packBestFor,children:[e.jsx("strong",{children:"Best for:"})," ",a.bestFor]}):null]})}),e.jsxs("div",{className:r.packCounts,children:[e.jsxs("span",{className:r.packCountChip,children:[e.jsx(_a,{size:13}),a.taxonomies.length," taxonomies"]}),L.multiSelectCount>0?e.jsx("span",{className:r.packCountChip,children:"Multi-select"}):null,L.numericCount>0?e.jsx("span",{className:r.packCountChip,children:"Numeric"}):null,L.requiredCount>0?e.jsx("span",{className:r.packCountChip,children:"Required"}):null]}),e.jsxs("div",{className:r.packTaxonomyPreview,children:[f.map(R=>e.jsx("span",{className:r.packTaxonomyChip,children:R},R)),a.taxonomies.length>f.length?e.jsxs("span",{className:r.packTaxonomyMore,children:["+",a.taxonomies.length-f.length," more"]}):null]}),e.jsx("div",{className:r.packActions,children:e.jsx("span",{className:r.packActionHint,children:c?"Previewing":"Click to Preview"})})]},a.id)})}),e.jsxs("aside",{className:r.previewPanel,children:[e.jsxs("div",{className:r.previewHeader,children:[e.jsx("h3",{className:r.previewTitle,children:x.label}),x.bestFor?e.jsxs("p",{className:r.previewBestFor,children:[e.jsx("strong",{children:"Best for:"})," ",x.bestFor]}):null,e.jsx("p",{className:r.previewSubtext,children:"Review each taxonomy before installing it into this workspace. Installed taxonomies become normal workspace-owned custom taxonomies."})]}),e.jsxs("div",{className:r.previewSummaryRow,children:[e.jsxs("span",{className:r.packCountChip,children:[x.taxonomies.length," taxonomies"]}),(w?.formEnabledCount||0)>0?e.jsxs("span",{className:r.packCountChip,children:[w.formEnabledCount," show in forms"]}):null,(w?.numericCount||0)>0?e.jsxs("span",{className:r.packCountChip,children:[w.numericCount," numeric"]}):null,(w?.requiredCount||0)>0?e.jsxs("span",{className:r.packCountChip,children:[w.requiredCount," required"]}):null]}),e.jsxs("section",{className:r.applyPanel,children:[e.jsx("h4",{className:r.applyTitle,children:"Choose Taxonomies to Install"}),e.jsx("p",{className:r.applyCopy,children:"Select only the taxonomies you want to add. This first pass installs new custom taxonomies only and asks you to skip conflicts rather than replace them."}),e.jsx("div",{className:r.checkboxList,children:x.taxonomies.map(a=>e.jsxs("label",{className:r.checkboxLabel,children:[e.jsx("input",{type:"checkbox",checked:$.includes(a.id),onChange:()=>U(a.id)}),e.jsxs("span",{children:[a.label,o.some(c=>c.id===a.id)?" (Already installed)":""]})]},a.id))}),e.jsxs("div",{className:r.analysisPanel,children:[e.jsxs("p",{className:r.analysisCopy,children:[$.length," ",$.length===1?"taxonomy is":"taxonomies are"," currently selected from this pack."]}),m.length>0?e.jsxs("p",{className:r.analysisCopy,children:[m.length," selected ",m.length===1?"taxonomy is":"taxonomies are"," ready to install right now."]}):e.jsx("p",{className:r.analysisCopy,children:"No selected taxonomies are currently installable."}),E.length>0?e.jsxs("p",{className:r.analysisWarning,children:[E.length," selected ",E.length===1?"taxonomy conflicts":"taxonomies conflict"," with existing workspace ids: ",E.join(", "),"."]}):null]}),e.jsxs("div",{className:r.packActions,children:[E.length>0?e.jsx("button",{type:"button",className:s.cancelBtn,onClick:h,children:"Select Installable Only"}):null,e.jsx("button",{type:"button",className:s.submitBtn,onClick:_,disabled:$.length===0||m.length===0,children:"Install Selected Taxonomies"})]}),W?e.jsx("p",{className:`${r.prototypeResult} ${W.type==="error"?r.prototypeError:""}`,children:W.message}):null]}),x.taxonomies.map(a=>e.jsxs("section",{className:r.customTaxonomyCard,children:[e.jsx("div",{className:r.customTaxonomyHeader,children:e.jsxs("div",{children:[e.jsx("h4",{className:r.previewSectionTitle,children:a.label}),a.description?e.jsx("p",{className:r.customTaxonomyDescription,children:a.description}):null]})}),E.includes(a.id)?e.jsx("p",{className:r.analysisWarning,children:"Conflicts with an existing taxonomy id in this workspace."}):null,e.jsx("div",{className:r.customTaxonomyBadges,children:Zo(a).map(c=>e.jsx("span",{className:r.customTaxonomyBadge,children:c},c))}),e.jsx(Ps,{title:a.widgetType==="level"?"Levels":"Options",items:a.options.map(c=>({key:`${a.id}:${c.value}`,label:c.label,icon:c.icon,color:c.color,meta:a.widgetType==="level"?`Level ${c.value}`:String(c.value)}))})]},a.id))]})]})]})}function Da(n){const{mode:o="system",taxonomies:d,onUpdateCustomTaxonomies:u,onAnalyzeSystemTaxonomyPack:g,onApplySystemTaxonomyPack:C}=n;return o==="custom"?e.jsx(el,{taxonomies:d,onUpdateCustomTaxonomies:u}):e.jsx(Xo,{onAnalyzeSystemTaxonomyPack:g,onApplySystemTaxonomyPack:C})}function sl(n){const{taxonomies:o,onUpdateTaxonomies:d,taxonomyDisplayLabels:u,onUpdateTaxonomyDisplayLabels:g,categories:C,pathValidation:T,onUpdateCategory:S,onRemoveCategory:M,onSaveCategory:G,onAddPath:O,onRemovePath:j,onUpdateCategoryIcon:$,onUpdateCategoryColor:P,onBrowseFolders:W,types:B,onSaveType:x,onRemoveType:w,onUpdateType:N,priorities:k,onUpdatePriorities:E,onAnalyzeSystemTaxonomyPack:m,onApplySystemTaxonomyPack:U,manualComplexityEnabled:h,onManualComplexityEnabledChange:_,initialTab:a}=n,[c,L]=i.useState(a||""),[f,R]=i.useState(a?"detail":"list"),[p,F]=i.useState(!1),[J,re]=i.useState(""),es=i.useMemo(()=>Ra().length,[]),ss=i.useMemo(()=>Fi({categories:C,types:B,priorities:k,taxonomies:o,manualComplexityEnabled:h,displayLabels:u}),[C,h,k,o,u,B]),Rs=()=>{if(!J.trim())return;const v=J.toLowerCase().trim().replace(/\s+/g,"-");if(o.some(X=>X.id===v)){alert("A taxonomy with this ID already exists");return}const Y={id:v,label:J.trim(),options:[],widgetType:"select",isSystem:!1,multiSelect:!1,formEnabled:!1,filterEnabled:!0,sortEnabled:!1};d([...o,Y]),re(""),F(!1),L(v),R("detail")},Gs=v=>{d(o.map(Y=>Y.id===v.id?v:Y))},zs=v=>{const Y=o.map(X=>X.id===v?{...X,status:"retired"}:X);d(Y),R("list")},Os=v=>{const Y=o.map(X=>X.id===v?{...X,status:"active"}:X);d(Y)},De=v=>{L(v),R("detail")},hs=(v,Y)=>{const X=o.findIndex(Us=>Us.id===v);if(X<0)return;const ts=X+Y;if(ts<0||ts>=o.length)return;const as=[...o],[Hs]=as.splice(X,1);as.splice(ts,0,Hs),d(as)},gs=ss.find(v=>v.id===c),xs=gs?.taxonomy,Fs=ss.filter(v=>v.kind!=="custom"),Ie=ss.filter(v=>v.kind==="custom");return f==="list"?e.jsxs("div",{className:y.taxonomyDrillDown,children:[e.jsxs("div",{className:y.drillDownList,children:[e.jsx("section",{className:y.librarySection,children:e.jsxs("button",{className:y.libraryLauncher,onClick:()=>De("library"),children:[e.jsxs("div",{className:y.libraryLauncherInfo,children:[e.jsx("span",{className:y.libraryLauncherIcon,children:e.jsx($t,{size:18})}),e.jsxs("div",{className:y.libraryLauncherText,children:[e.jsx("span",{className:y.libraryLauncherLabel,children:"System Taxonomy Library"}),e.jsx("span",{className:y.libraryLauncherSubtext,children:"Browse curated packs for categories, task types, and priority scales."})]})]}),e.jsxs("span",{className:y.libraryLauncherMeta,children:[es," curated packs",e.jsx(Le,{size:16,className:y.chevron})]})]})}),e.jsxs("div",{className:y.drillDownSection,children:[e.jsx("h4",{className:y.drillDownSectionTitle,children:"System Taxonomies"}),Fs.map(v=>e.jsxs("button",{className:`${y.drillDownItem} ${v.id==="complexities"&&!h?y.drillDownItemDimmed:""}`,onClick:()=>De(v.id),children:[e.jsxs("div",{className:y.drillDownItemInfo,children:[e.jsx(Ln,{size:16,className:y.systemIcon}),e.jsxs("div",{className:y.drillDownItemText,children:[e.jsx("span",{className:y.drillDownItemLabel,children:v.label}),e.jsx("span",{className:y.drillDownItemSubtext,children:v.summary})]})]}),e.jsx(Le,{size:16,className:y.chevron})]},v.id))]}),e.jsxs("div",{className:y.drillDownSection,children:[e.jsxs("div",{className:y.drillDownSectionHeader,children:[e.jsx("h4",{className:y.drillDownSectionTitle,children:"Custom Taxonomies"}),e.jsxs("button",{className:D.addTaxonomyBtnSmall,onClick:()=>F(!0),title:"Add Custom Taxonomy",children:[e.jsx(ms,{size:14})," New"]})]}),e.jsxs("button",{className:y.drillDownItem,onClick:()=>De("custom-library"),children:[e.jsxs("div",{className:y.drillDownItemInfo,children:[e.jsx($t,{size:16,className:y.systemIcon}),e.jsxs("div",{className:y.drillDownItemText,children:[e.jsx("span",{className:y.drillDownItemLabel,children:"Custom Taxonomy Library"}),e.jsx("span",{className:y.drillDownItemSubtext,children:"Reusable templates for future custom taxonomy packs"})]})]}),e.jsx(Le,{size:16,className:y.chevron})]}),Ie.length===0?e.jsx("div",{className:s.emptyState,children:e.jsx("p",{className:"tf-empty-copy",children:"No custom taxonomies yet."})}):Ie.map(v=>e.jsxs("div",{className:`${y.drillDownItem} ${v.taxonomy?.status==="retired"?y.drillDownItemDimmed:""}`,children:[e.jsxs("button",{className:y.drillDownItemAction,onClick:()=>De(v.id),children:[e.jsxs("div",{className:y.drillDownItemInfo,children:[e.jsx(In,{size:16}),e.jsxs("div",{className:y.drillDownItemText,children:[e.jsx("span",{className:y.drillDownItemLabel,children:v.taxonomy?.status==="retired"?`${v.label} (Retired)`:v.label}),e.jsx("span",{className:y.drillDownItemSubtext,children:v.summary})]})]}),e.jsx(Le,{size:16,className:y.chevron})]}),e.jsxs("div",{className:y.orderButtons,children:[e.jsx("button",{type:"button",className:s.browseBtn,title:"Move taxonomy up",onClick:Y=>{Y.stopPropagation(),hs(v.id,-1)},disabled:Ie[0]?.id===v.id,children:e.jsx(Ga,{size:16})}),e.jsx("button",{type:"button",className:s.browseBtn,title:"Move taxonomy down",onClick:Y=>{Y.stopPropagation(),hs(v.id,1)},disabled:Ie[Ie.length-1]?.id===v.id,children:e.jsx(za,{size:16})})]})]},v.id))]})]}),p&&e.jsx("div",{className:y.createOverlay,children:e.jsxs("div",{className:y.createDialog,children:[e.jsx("h3",{className:y.createDialogTitle,children:"New Taxonomy"}),e.jsxs("div",{className:y.inputGroup,children:[e.jsx("label",{className:s.label,children:"Name"}),e.jsx("input",{className:s.input,placeholder:"Enter taxonomy name",value:J,onChange:v=>re(v.target.value),autoFocus:!0})]}),e.jsxs("div",{className:y.dialogActions,children:[e.jsx("button",{className:`${s.submitBtn} ${y.createSubmit}`,onClick:Rs,disabled:!J.trim(),children:"Create"}),e.jsx("button",{className:`${s.cancelBtn} ${y.createCancel}`,onClick:()=>{F(!1),re("")},children:"Cancel"})]})]})})]}):e.jsxs("div",{className:y.taxonomyDetailView,children:[e.jsx("div",{className:y.detailHeader,children:e.jsxs("div",{className:y.taxonomyBreadcrumbs,children:[e.jsxs("button",{className:y.breadcrumbPrev,onClick:()=>R("list"),title:"Back to All Taxonomies",children:[e.jsx(Mn,{size:16,className:y.breadcrumbIcon}),"Taxonomies"]}),e.jsx(Le,{size:14,className:y.breadcrumbDivider}),e.jsx("h3",{className:y.breadcrumbActive,children:c==="library"?"System Taxonomy Library":c==="custom-library"?"Custom Taxonomy Library":gs?.label||"Taxonomy"})]})}),e.jsx("div",{className:y.detailContent,children:c==="library"?e.jsx(Da,{mode:"system",onAnalyzeSystemTaxonomyPack:m,onApplySystemTaxonomyPack:U}):c==="custom-library"?e.jsx(Da,{mode:"custom",taxonomies:o,onUpdateCustomTaxonomies:d}):c==="categories"?e.jsx(Ui,{displayLabel:u?.category,onUpdateDisplayLabel:v=>g?.({category:v}),categories:C,pathValidation:T,onUpdateCategory:S,onRemoveCategory:M,onSaveCategory:G,onAddPath:O,onRemovePath:j,onUpdateCategoryIcon:$,onUpdateCategoryColor:P,onBrowseFolders:W}):c==="types"?e.jsx(Wi,{displayLabel:u?.type,onUpdateDisplayLabel:v=>g?.({type:v}),types:B,onSaveType:x,onRemoveType:w,onUpdateType:N}):c==="complexities"?e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h4",{className:s.settingSubtitle,children:"Complexity"}),e.jsx("p",{className:s.settingsHint,children:"Complexity is estimated by AI and system logic by default."}),e.jsx("p",{className:s.settingsHint,children:"Enable this to let users set complexity manually and show the Complexity field in Add/Edit Task. When disabled, the Complexity field is hidden from the task form."}),e.jsxs("label",{className:s.archiveToggle,children:[e.jsx("input",{type:"checkbox",checked:h,onChange:v=>{_(v.target.checked)}}),e.jsx("span",{children:"Manual Complexity"})]})]}):xs?e.jsx(Hi,{taxonomy:xs,onUpdateTaxonomy:Gs,onRemoveTaxonomy:zs,onRestoreTaxonomy:Os}):c==="priorities"?e.jsx(Vi,{displayLabel:u?.priority,onUpdateDisplayLabel:v=>g?.({priority:v}),priorities:k,onUpdatePriorities:E}):e.jsxs("div",{className:s.emptyState,children:[e.jsx("p",{className:"tf-empty-copy",children:"Taxonomy not found."}),e.jsx("button",{className:s.submitBtn,onClick:()=>R("list"),children:"Return to List"})]})})]})}const tl={sun:Rn,wind:En,moon:Dn,sparkles:Fa},Ea=["tasks:read","tasks:write","workspace:read"],Ze={key:"#93c5fd",token:"#c084fc",punctuation:"#cbd5e1",text:"#f8fafc"};function pl(n){const{settingsModel:o,onSectionChange:d,renderMode:u="full"}=n,g=u==="mcp-only",{currentTheme:C,globalTheme:T,themeUseGlobalDefault:S,keyShortcut:M,jsonBackupEnabled:G,globalJsonBackupEnabled:O,globalWeekStartsOn:j,locale:$="en-US",supportedLocales:P=["en-US","es-419","pt-BR"],jsonBackupUseGlobalDefault:W,manualComplexityEnabled:B,checklistDropdownEnabled:x=!0,showTaskCardStatusLabel:w=!1,initialSection:N,onThemeChange:k,onSaveTheme:E,onSaveGlobalTheme:m,onResetProjectToGlobal:U,onKeyShortcutChange:h,onJsonBackupEnabledChange:_,onSaveGlobalJsonBackupEnabled:a,onSaveGlobalWeekStartsOn:c,onSaveLocale:L,onManualComplexityEnabledChange:f,onChecklistDropdownEnabledChange:R,onShowTaskCardStatusLabelChange:p,onSaveSettings:F,onShowFolderBrowserChange:J,onBrowserTargetChange:re,onFetchFolders:es,categories:ss,pathValidation:Rs,taxonomyDisplayLabels:Gs,onUpdateCategory:zs,onRemoveCategory:Os,onSaveCategory:De,onAddPath:hs,onRemovePath:gs,onUpdateCategoryIcon:xs,onUpdateCategoryColor:Fs,types:Ie,onSaveType:v,onRemoveType:Y,onUpdateType:X,taxonomies:ts,onUpdateTaxonomies:as,priorities:Hs,onUpdatePriorities:Us,onAnalyzeSystemTaxonomyPack:Ua,onApplySystemTaxonomyPack:Wa,onUpdateTaxonomyDisplayLabels:Va,projectRoot:be,projectName:Ee,mcpHostRoot:ns,serverHostRoot:is,mcpScriptPath:ye,tenantId:Lt,workspaceId:os,runtimeMode:Re="local",cloudAuthBaseUrl:Ws="",cloudMcpBaseUrl:Vs="",fetchCloudAuthApi:Ge,checkLocalMcpCliHealth:It,getLocalUpdateStatus:Mt,workspaceSwitchingEnabled:Ka=!1,currentWorkspaceRole:qa="member",currentWorkspaceName:ze="",onDeleteWorkspace:Ks,onMcpHostRootChange:Ja,onOpenCloudAuth:qs,isAuthenticated:Pt=!1,setupState:se=null,buildInfo:Bt=null,onSaveSetupMode:al,onSaveWorkspaceProfile:Js,initiativeTemplates:Oe=[],onRefreshInitiativeTemplates:Ys,onCreateInitiativeFromTemplate:Zs}=o,At=Re!=="cloud",[Fe,V]=i.useState(null),[bs,Ya]=i.useState(()=>se?.mode==="operations"?"operations":"core"),[Dt,Et]=i.useState(()=>String(se?.workspace?.name||"").trim()),[Rt,Gt]=i.useState(()=>String(se?.workspace?.description||"")),[ls,zt]=i.useState(""),[Qs,Za]=i.useState(""),[Ot,Ft]=i.useState(!1),[z,ce]=i.useState(()=>g?"mcp":"general"),[Xs,rs]=i.useState(!0),[je,ys]=i.useState(()=>"project");i.useEffect(()=>{Oe.length>0&&!ls&&zt(Oe[0].id)},[Oe,ls]),i.useEffect(()=>{if(!Fe)return;const t=setTimeout(()=>V(null),2500);return()=>clearTimeout(t)},[Fe]),i.useEffect(()=>{Ya(se?.mode==="operations"?"operations":"core")},[se?.mode]),i.useEffect(()=>{Et(String(se?.workspace?.name||"").trim()),Gt(String(se?.workspace?.description||""))},[se?.workspace?.name,se?.workspace?.description]);const Qa=async t=>{k(t);const l=await E(t);V({type:l?"success":"error",message:l?"Project theme saved.":"Failed to save project theme."})},Ht=(t,l,b)=>{const I=tl[t.icon];return e.jsxs("button",{className:`${s.themeBtn} tf-button-tile ${l===t.id?s.activeTheme:""}`,onClick:()=>{b(t.id)},children:[e.jsx(I,{size:20})," ",t.label]},t.id)},et=Re==="cloud"?"cloud":"local",[vs,st]=i.useState(et),[de,tt]=i.useState(!1),[pe,cs]=i.useState(!0),[Xa,Ut]=i.useState(0),[ie,fs]=i.useState({status:"idle"}),[Me,js]=i.useState(!1),[Cs,ks]=i.useState(!1),[we,at]=i.useState({status:"idle"}),[Wt,nt]=i.useState(null),[Vt,Kt]=i.useState(!1),[it,qt]=i.useState(!0),[ot,Ns]=i.useState([]),[en,Jt]=i.useState(!1),[Yt,lt]=i.useState(null),[ds,Ts]=i.useState(null),ws=i.useMemo(()=>`${String(ze||se?.workspace?.name||Ee||os||"Taskforce Workspace").trim()} MCP`,[ze,se?.workspace?.name,Ee,os]),[Zt,rt]=i.useState(ws),[ct,Qt]=i.useState(""),[He,ps]=i.useState(null),[te,Se]=i.useState(null),[Ue,Pe]=i.useState(null),[Xt,dt]=i.useState(null),[ae,pt]=i.useState("general"),[ea,sa]=i.useState(!1),[H,ke]=i.useState(null),[ue,ta]=i.useState([]),[sn,aa]=i.useState(!1),[na,We]=i.useState(null),[ia,oa]=i.useState(null);i.useEffect(()=>{st(et)},[et]),i.useEffect(()=>{rt(t=>t.trim().length>0?t:ws)},[ws]),i.useEffect(()=>{if(!He)return;const t=setTimeout(()=>ps(null),3500);return()=>clearTimeout(t)},[He]),i.useEffect(()=>{if(!te)return;const t=setTimeout(()=>Se(null),3500);return()=>clearTimeout(t)},[te]),i.useEffect(()=>{if(!Ue)return;const t=setTimeout(()=>Pe(null),3500);return()=>clearTimeout(t)},[Ue]);const Ve=i.useMemo(()=>{const t=kn(Vs||Ws||""),l=String(t||Vs||Ws||"").trim().replace(/\/+$/,"");return l?`${l}/mcp`:typeof window>"u"?"/mcp":`${window.location.origin.replace(/\/+$/,"")}/mcp`},[Vs,Ws]),tn=Re!=="cloud",Ss=Re==="cloud"||vs==="cloud",la=Re!=="cloud"&&vs==="local",ra=z==="mcp"&&la,ca=String(ns||is||"").trim(),ut=!!(ca&&ca!==String(be||"").trim());i.useEffect(()=>{if(!ra||!pe){fs({status:"idle"}),js(!1),ks(!1);return}if(ut){fs({status:"host-unverified"}),js(!1);return}let t=!1;return js(!0),It().then(l=>{t||fs({status:"result",result:l})}).catch(()=>{t||fs({status:"result",result:{state:"unusable",code:"GLOBAL_CLI_HEALTH_REQUEST_FAILED",message:"Taskforce could not validate the global CLI. Use Local / npx or retry the check.",executablePath:null,cliVersion:null,appVersion:String(Bt?.version||""),serverName:null,toolCount:null}})}).finally(()=>{t||js(!1)}),()=>{t=!0}},[Bt?.version,It,Xa,ra,ut,pe]),i.useEffect(()=>{if(!Cs)return;let t=!1;return at({status:"loading"}),Mt().then(l=>{t||at({status:"result",result:l.targets.globalCli})}).catch(l=>{t||at({status:"error",message:l instanceof Error?l.message:"Taskforce could not determine the Global CLI installation channel."})}),()=>{t=!0}},[Mt,Cs]);const Ke=Pt,an=i.useMemo(()=>{const t={active:0,expired:1,revoked:2};return[...ot].sort((l,b)=>{const I=(t[l.status]??99)-(t[b.status]??99);return I!==0?I:String(b.createdAt||"").localeCompare(String(l.createdAt||""))})},[ot]),qe=i.useMemo(()=>On(ze||null,Ee||null),[ze,Ee]),Be=Xt?.trim()||"",$s=Be||"<<GENERATE_TOKEN>>",K=i.useMemo(()=>Hn({clientId:ae,endpoint:Ve,tokenValue:$s,serverId:qe}),[Ve,qe,$s,ae]),_s=K.kind==="json"?K.serverConfig??null:null,da=["chatgpt-desktop","claude-chat","grok-chat","gemini-chat","mistral-chat","perplexity-chat"].includes(ae),pa="Resolve your profile with Taskforce.",mt=i.useMemo(()=>{const t=String(be||"").trim();return t?`[projects.${JSON.stringify(t)}]
|
|
6
|
-
trust_level = "trusted"`:""},[be]),ua=i.useMemo(()=>ue.find(t=>t.provider==="chatgpt"&&t.status==="active")||null,[ue]),ma=i.useMemo(()=>ue.find(t=>t.provider==="claude"&&t.status==="active")||null,[ue]),ha=i.useMemo(()=>ue.find(t=>t.provider==="grok"&&t.status==="active")||null,[ue]),ga=i.useMemo(()=>ue.find(t=>t.provider==="gemini"&&t.status==="active")||null,[ue]),xa=i.useMemo(()=>ue.find(t=>t.provider==="mistral"&&t.status==="active")||null,[ue]),ba=i.useMemo(()=>ue.find(t=>t.provider==="perplexity"&&t.status==="active")||null,[ue]),Ls={"chatgpt-desktop":ua,"claude-chat":ma,"grok-chat":ha,"gemini-chat":ga,"mistral-chat":xa,"perplexity-chat":ba}[ae]||null,nn={"chatgpt-desktop":"ChatGPT Desktop","claude-chat":"Claude Chat","grok-chat":"Grok","gemini-chat":"Gemini Spark","mistral-chat":"Mistral Vibe","perplexity-chat":"Perplexity"}[ae]||"This client",on=i.useMemo(()=>{if(K.kind==="text")return K.renderedText||"";let t={[K.rootKey||"mcpServers"]:{[qe]:K.serverConfig}};for(const l of[...K.wrapperKeys||[]].reverse())t={[l]:t};return JSON.stringify(t,null,2)},[K,qe]),ht=(t,l,b="mcpServers",I=[])=>{const A={color:Ze.key},q={color:Ze.token,fontWeight:"bold"},ee={color:Ze.punctuation},me={color:Ze.text},fe=$s,le=[...I,b],Ae=" ".repeat(le.length+1),Is=JSON.stringify(l,null,2).split(`
|
|
7
|
-
`).map((Te,Ce)=>Ce===0?Te:`${Ae}${Te}`).join(`
|
|
8
|
-
`).split(fe);return e.jsxs(e.Fragment,{children:[e.jsx("span",{style:ee,children:"{"}),`
|
|
9
|
-
`,le.map((Te,Ce)=>e.jsxs(Ms.Fragment,{children:[`${" ".repeat(Ce+1)}`,e.jsx("span",{style:A,children:`"${Te}"`}),e.jsx("span",{style:A,children:":"})," ",e.jsx("span",{style:ee,children:"{"}),`
|
|
10
|
-
`]},`mcp-container-open-${Te}-${Ce}`)),Ae,e.jsxs("span",{style:me,children:[`"${t}"`,": ",Is.map((Te,Ce)=>e.jsxs(Ms.Fragment,{children:[Te,Ce<Is.length-1&&e.jsx("span",{style:q,children:fe})]},`config-segment-${Ce}`))]}),`
|
|
11
|
-
`,[...le].reverse().map((Te,Ce)=>e.jsxs(Ms.Fragment,{children:[`${" ".repeat(le.length-Ce)}`,e.jsx("span",{style:ee,children:"}"}),`
|
|
12
|
-
`]},`mcp-container-close-${Te}-${Ce}`)),e.jsx("span",{style:ee,children:"}"})]})},gt=t=>{const l={color:Ze.text},b={color:Ze.token,fontWeight:"bold"},I=$s,A=String(t||"").split(I);return A.map((q,ee)=>e.jsxs(Ms.Fragment,{children:[e.jsx("span",{style:l,children:q}),ee<A.length-1&&e.jsx("span",{style:b,children:I})]},`text-config-${ee}`))},us=async(t,l)=>{try{await navigator.clipboard.writeText(t),Se(null),tt(l),setTimeout(()=>tt(!1),2e3)}catch{tt(!1),Se({type:"error",message:"Could not copy to the clipboard. Select the text and copy it manually."})}},ln=async t=>{try{await navigator.clipboard.writeText(t),Se(null),nt(t),setTimeout(()=>nt(null),2e3)}catch{nt(null),Se({type:"error",message:"Could not copy to the clipboard. Select the text and copy it manually."})}},xt=()=>e.jsxs("div",{className:s.mcpRegistrationHint,children:[e.jsx("span",{children:"Once the MCP is configured, prompt your agent:"}),e.jsx("button",{type:"button",className:s.mcpRegistrationPrompt,onClick:()=>us(pa,"registration"),title:de==="registration"?"Copied":"Copy prompt",children:pa})]}),bt=()=>ae!=="codex"||!mt?null:e.jsxs("div",{className:s.mcpCodexTrustNote,children:[e.jsxs("div",{className:s.mcpCodexTrustHeader,children:[e.jsxs("div",{children:[e.jsx("div",{className:s.mcpCodexTrustTitle,children:"Codex Project Trust"}),e.jsx("div",{className:s.settingDescription,children:"Project-local .codex/config.toml is only loaded after Codex trusts this repository. Add this to ~/.codex/config.toml if you use a repo-local Codex config."})]}),e.jsx("button",{type:"button",className:`${s.copyBtn} ${de==="codex-trust"?s.copyBtnActive:""}`,onClick:()=>us(mt,"codex-trust"),title:de==="codex-trust"?"Copied":"Copy Codex trust snippet","aria-label":"Copy Codex trust snippet",children:de==="codex-trust"?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14})})]}),e.jsx("pre",{className:s.mcpCodexTrustCode,children:e.jsx("code",{children:mt})})]}),rn=()=>e.jsxs("div",{className:`${s.mcpAuthRequiredCard} ${s.marginTop16}`,children:[e.jsx("div",{className:s.mcpAuthRequiredIcon,children:e.jsx(La,{size:20})}),e.jsxs("div",{className:s.mcpAuthRequiredBody,children:[e.jsx("h3",{className:s.settingTitle,children:"Sign in to use Cloud MCP"}),e.jsx("p",{className:s.settingDescription,children:"Cloud MCP connects remote agents through your Taskforce cloud account. Register or sign in to generate cloud MCP tokens, copy client configuration, and connect hosted MCP agents to this workspace."}),qs&&e.jsxs("div",{className:s.mcpAuthRequiredActions,children:[e.jsx("button",{type:"button",className:s.copyBtn,onClick:()=>qs("login"),children:"Sign In"}),e.jsx("button",{type:"button",className:s.copyBtn,onClick:()=>qs("register"),children:"Register"})]})]})]}),ya=()=>{if(!da&&!Be){Se({type:"error",message:"Generate a token before copying the Cloud MCP configuration."});return}Se(null),us(on,"full")},va=ie.status==="result"&&ie.result.state!=="unusable"&&ie.result.executablePath&&!ut?ie.result.executablePath:"taskforce",yt=pe&&ie.status==="result"&&ie.result.state==="unusable",ve=ie.status==="result"&&ie.result.state==="version-mismatch"?ie.result:null,fa=ie.status==="result"&&ie.result.state==="unusable"?ie.result:null,Ne=we.status==="result"?we.result:null,ja=Ne?.channel==="npm-global"?"npm":Ne?.channel==="homebrew"?"Homebrew":Ne?.channel==="development"?"Development checkout":Ne?.channel==="npx-project-local"?"Local / npx":"Unknown",vt=Ne?.manualCommands||[],cn=()=>{let t=ye||"",l=be||"";const b=ns||is;if(b&&be){if(ye&&ye.startsWith(be))t=ye.replace(be,b);else if(ye&&ye.includes("/node_modules/")){const Is=ye.indexOf("/node_modules/");t=b+ye.substring(Is)}l=b}const I=(ye||"").endsWith(".ts"),A=Ee||(be?be.split(/[/\\]/).pop():"project"),q=_t(`taskforce-${A}`,"taskforce-project"),ee=(Lt||"").trim()||"your-tenant-id",me=(os||se?.workspaceId||"").trim(),fe=me&&me!=="default"?me:"your-workspace-id",le=Tn(typeof window>"u"?null:window.location.origin),Ae={TASKFORCE_TENANT_ID:ee,TASKFORCE_WORKSPACE_ID:fe,TASKFORCE_MCP_CONNECTION_ID:zn(fe,ae,l||be||t),...le?{TASKFORCE_APP_BASE_URL:le}:{},TASKFORCE_SHARED_LOCAL_MCP_ENABLED:"true",TASKFORCE_SHARED_LOCAL_MCP_CLIENT_MODE:"proxy",TASKFORCE_MCP_TOOL_PROFILE:"default",...Gn(ae)},Je=pe?{command:va,args:["mcp",l||"."],env:Ae}:{command:I?"npx":"node",args:I?["-y","tsx",t,l]:[t,l],env:Ae};return!pe&&!Je.args[Je.args.length-1]&&(Je.args[Je.args.length-1]=".../path/to/project/root"),{serverId:q,serverConfig:Je}},$e=i.useMemo(()=>cn(),[ye,be,ns,is,Ee,Lt,os,se?.workspaceId,ae,pe,va]),oe=i.useMemo(()=>Un({clientId:ae,serverId:$e.serverId,serverConfig:$e.serverConfig}),[$e,ae]),Ca=oe.kind==="json"?oe.serverConfig??null:null,dn=i.useMemo(()=>{if(oe.kind==="text")return oe.renderedText||"";let t={[oe.rootKey||"mcpServers"]:{[$e.serverId]:oe.serverConfig}};for(const l of[...oe.wrapperKeys||[]].reverse())t={[l]:t};return JSON.stringify(t,null,2)},[oe,$e.serverId]),pn=(t="full")=>{if(!ye&&!pe)return;if(yt){Se({type:"error",message:"The global CLI is not usable. Choose Local / npx or retry the health check."});return}const l=t==="full"?dn:`"${$e.serverId}": ${JSON.stringify($e.serverConfig,null,2)}`;us(l,t)},ka=async()=>{if(Ke){Jt(!0),lt(null);try{const t=await Ge("/api/taskforce/settings/mcp/tokens",{method:"GET",credentials:"include"}),l=await t.json().catch(()=>({}));if(!t.ok){lt(String(l?.error||"Failed to load MCP tokens."));return}Ns(Array.isArray(l?.items)?l.items:[])}catch{lt("Failed to load MCP tokens.")}finally{Jt(!1)}}},ft=async()=>{if(Ke){aa(!0),We(null);try{const t=await Ge("/api/taskforce/settings/mcp/connectors",{method:"GET",credentials:"include"}),l=await t.json().catch(()=>({}));if(!t.ok){We(String(l?.error||"Failed to load MCP connectors."));return}ta(Array.isArray(l?.items)?l.items:[])}catch{We("Failed to load MCP connectors.")}finally{aa(!1)}}},un=async()=>{const t=Zt.trim();if(!t){ps({type:"error",message:"Token name is required."});return}Ts("create"),ps(null),ke(null);try{const l=await Ge("/api/taskforce/settings/mcp/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,scopes:Ea,expiresAt:ct?new Date(`${ct}T00:00:00`).toISOString():null})}),b=await l.json().catch(()=>({}));if(!l.ok){ps({type:"error",message:String(b?.error||"Failed to create token.")});return}dt(String(b?.token||"")),ke(null),rt(ws),Qt(""),Ns(I=>b?.record?[b.record,...I.filter(q=>q.id!==b.record.id)]:I)}catch{ps({type:"error",message:"Failed to create token."})}finally{Ts(null)}},jt=async(t,l)=>{if(!(l==="delete"&&!window.confirm("Delete this token record? This does not affect active tokens."))){Ts(`${l}:${t}`),Pe(null);try{const b=l==="delete"?`/api/taskforce/settings/mcp/tokens/${encodeURIComponent(t)}`:`/api/taskforce/settings/mcp/tokens/${encodeURIComponent(t)}/${l}`,I=await Ge(b,{method:l==="delete"?"DELETE":"POST",credentials:"include"}),A=await I.json().catch(()=>({}));if(!I.ok){Pe({type:"error",message:String(A?.error||`Failed to ${l} token.`)});return}if(l==="regenerate"?(dt(String(A?.token||"")),ke(null),Pe({type:"success",message:"Token regenerated. Copy the new value from the Full Token field."})):Pe(l==="delete"?{type:"success",message:"Token deleted."}:{type:"success",message:"Token revoked."}),l==="delete"){Ns(ee=>ee.filter(me=>me.id!==t));return}const q=A?.record||null;q?.id?Ns(ee=>ee.map(me=>me.id===q.id?q:me)):await ka()}catch{Pe({type:"error",message:`Failed to ${l} token.`})}finally{Ts(null)}}},mn=async()=>{const t=Be;if(!t){ke({type:"error",message:"Generate or paste a full token before testing the MCP connection."});return}sa(!0),ke(null);try{const l=await Ge("/api/taskforce/settings/mcp/test-connection",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,requiredScopes:Ea})}),b=await l.json().catch(()=>({}));if(!l.ok){const A=b?.details&&typeof b.details=="object"?b.details:{},q=Array.isArray(A?.missingScopes)?A.missingScopes.map(Ae=>String(Ae)):[],ee=typeof A?.tokenWorkspaceId=="string"?String(A.tokenWorkspaceId):void 0,me=typeof A?.endpoint=="string"?String(A.endpoint):Ve;let fe=b?.code==="MCP_TOKEN_MISSING_SCOPES"&&q.length>0?`Token is missing required scopes: ${q.join(", ")}.`:String(b?.error||"Failed to test MCP connection."),le;b?.code==="MCP_ENDPOINT_GATEWAY_ERROR"?(fe="The dedicated MCP host is responding with a gateway error.",le="This usually means the cloud MCP service is degraded. Retry shortly, and if it keeps failing treat it as an environment incident rather than a bad token."):b?.code==="MCP_ENDPOINT_TIMEOUT"?(fe="The dedicated MCP host timed out during MCP initialization.",le="This usually points to a degraded or overloaded cloud MCP service."):b?.code==="MCP_ENDPOINT_UNREACHABLE"?(fe="The dedicated MCP host could not be reached.",le="Check the cloud MCP hostname and environment health before rotating credentials."):b?.code==="MCP_ENDPOINT_REJECTED_VALIDATED_TOKEN"&&(fe="The dedicated MCP host rejected a token that validated locally.",le="This suggests the MCP host is stale, routed incorrectly, or out of sync with auth data."),ke({type:"error",message:fe,workspaceName:ee,endpoint:me,errorCode:typeof b?.code=="string"?String(b.code):void 0,followup:le});return}const I=b?.result&&typeof b.result=="object"?b.result:{};ke({type:"success",message:"Connection looks good for this workspace.",scopes:Array.isArray(I?.scopes)?I.scopes.map(A=>String(A)):[],workspaceName:typeof I?.workspaceName=="string"?String(I.workspaceName):"",workspaceId:typeof I?.workspaceId=="string"?String(I.workspaceId):"",endpoint:typeof I?.endpoint=="string"?String(I.endpoint):Ve})}catch{ke({type:"error",message:"Failed to test MCP connection.",endpoint:Ve,followup:"The settings page could not complete the connection probe. Check your network connection and the selected cloud environment."})}finally{sa(!1)}},hn=async t=>{oa(t),We(null);try{const l=await Ge(`/api/taskforce/settings/mcp/connectors/${encodeURIComponent(t)}/disconnect`,{method:"POST",credentials:"include"}),b=await l.json().catch(()=>({}));if(!l.ok){We(String(b?.error||"Failed to disconnect connector."));return}const I=b?.record||null;I?.id?ta(A=>A.map(q=>q.id===I.id?I:q)):await ft()}catch{We("Failed to disconnect connector.")}finally{oa(null)}};i.useEffect(()=>{if(Ke){if(z==="mcp"&&Ss){ka(),ft();return}z==="integrations"&&ft()}},[z,Ss,Ke]),i.useEffect(()=>{z==="initiatives"&&Oe.length===0&&Ys?.()},[z,Oe.length,Ys]),i.useEffect(()=>{N&&(N==="categories"||N==="types"?ce("taxonomy"):N==="documents"?ce("general"):N==="appearance-application"?(rs(!0),ce("appearanceApplication")):N==="appearance-task-cards"?(rs(!0),ce("appearanceTaskCards")):N==="appearance-task-forms"?(rs(!0),ce("appearanceTaskForms")):ce(N==="initiatives"?"initiatives":N==="agents"?"general":N==="mcp"?g?"mcp":"general":N==="integrations"?"integrations":N))},[N,g]),i.useEffect(()=>{(z==="appearanceApplication"||z==="appearanceTaskCards"||z==="appearanceTaskForms")&&rs(!0)},[z]);const gn=t=>{re({type:"category",value:t}),es(""),J(!0)},Na=[{key:"general",label:"General",icon:e.jsx(An,{size:14}),section:"general"},{key:"taxonomy",label:"Taxonomy",icon:e.jsx(Oa,{size:14}),section:"taxonomy"},{key:"integrations",label:"Integrations",icon:e.jsx(La,{size:14}),section:"integrations"}],xn=[{key:"appearanceApplication",label:"Application",section:"appearance-application"},{key:"appearanceTaskCards",label:"Task cards",section:"appearance-task-cards"},{key:"appearanceTaskForms",label:"Task forms",section:"appearance-task-forms"}],Ct=(t,l)=>{ce(t),d?.(l)},bn=()=>e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:`${s.settingTitle} tf-heading-section`,children:"Theme"}),e.jsx("div",{className:s.buttonGrid,children:wa.map(t=>Ht(t,C,Qa))})]}),yn=()=>e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:`${s.settingTitle} tf-heading-section`,children:"Theme Defaults"}),e.jsx("div",{className:s.buttonGrid,children:wa.map(t=>Ht(t,T,async l=>{const b=await m(l);V({type:b?"success":"error",message:b?"Global theme saved.":"Failed to save global theme."})}))})]}),vn=()=>e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:`${s.settingTitle} tf-heading-section`,children:"Task Form"}),e.jsxs("label",{className:s.archiveToggle,children:[e.jsx("input",{type:"checkbox",checked:x,onChange:async t=>{if(!R)return;const l=await R(t.target.checked);V({type:l?"success":"error",message:l?"Checklist dropdown setting saved.":"Failed to save checklist dropdown setting."})},disabled:!R}),e.jsx("span",{children:"Enable checklist dropdown in task form"})]})]});return e.jsx("div",{className:`${s.settingsTab} ${g?s.settingsTabMcpOnly:""}`.trim(),children:e.jsxs("div",{className:`${s.settingsLayout} ${g?s.settingsLayoutMcpOnly:""}`.trim(),children:[!g&&e.jsxs("aside",{className:s.settingsSidebar,children:[e.jsx("div",{className:s.settingsSidebarHeader,children:"Sections"}),e.jsxs("div",{className:`${s.settingsSidebarNav} tf-scrollbar tf-scrollbar--track-transparent tf-scrollbar--compact`,children:[Na.filter(t=>t.key==="general").map(t=>e.jsxs("button",{className:`${s.settingsSidebarBtn} ${z===t.key?s.settingsSidebarBtnActive:""}`,onClick:()=>Ct(t.key,t.section),children:[t.icon,e.jsx("span",{children:t.label})]},t.key)),e.jsxs("div",{className:s.settingsSidebarGroup,children:[e.jsxs("button",{className:`${s.settingsSidebarBtn} ${s.settingsSidebarGroupBtn} ${z==="appearanceApplication"||z==="appearanceTaskCards"||z==="appearanceTaskForms"?s.settingsSidebarBtnActive:""}`,onClick:()=>rs(t=>!t),"aria-expanded":Xs,"aria-controls":"settings-appearance-nav",children:[e.jsx(Fa,{size:14}),e.jsx("span",{className:s.settingsSidebarGroupLabel,children:"Appearance"}),e.jsx("span",{className:s.settingsSidebarGroupChevron,children:Xs?e.jsx(Nt,{size:14}):e.jsx(Le,{size:14})})]}),Xs&&e.jsx("div",{id:"settings-appearance-nav",className:s.settingsSidebarSubnav,children:xn.map(t=>e.jsx("button",{className:`${s.settingsSidebarSubBtn} ${z===t.key?s.settingsSidebarBtnActive:""}`,onClick:()=>Ct(t.key,t.section),children:e.jsx("span",{children:t.label})},t.key))})]}),Na.filter(t=>t.key!=="general").map(t=>e.jsxs("button",{className:`${s.settingsSidebarBtn} ${z===t.key?s.settingsSidebarBtnActive:""}`,onClick:()=>Ct(t.key,t.section),children:[t.icon,e.jsx("span",{children:t.label})]},t.key))]})]}),e.jsxs("div",{className:s.settingsContent,children:[Fe&&e.jsxs("div",{className:`${s.settingsToast} ${Fe.type==="success"?s.settingsToastSuccess:s.settingsToastError}`,children:[Fe.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),e.jsx("span",{children:Fe.message})]}),z==="general"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:`${s.settingsTabs} tf-scrollbar tf-scrollbar--track-transparent tf-scrollbar--compact`,children:[e.jsx("button",{className:`${s.settingsTabBtn} ${je==="project"?s.settingsTabBtnActive:""}`,onClick:()=>ys("project"),children:"Project"}),e.jsx("button",{className:`${s.settingsTabBtn} ${je==="global"?s.settingsTabBtnActive:""}`,onClick:()=>ys("global"),children:"Global"})]}),je==="project"&&e.jsx("div",{className:s.pathInputGroup,style:{justifyContent:"flex-end"},children:e.jsx("button",{onClick:async()=>{if(!window.confirm("Reset project Theme and Backups to global defaults?"))return;const l=await U();V({type:l?"success":"error",message:l?"Project settings reset to global.":"Failed to reset project settings."})},className:s.copyBtn,children:"Reset to Global"})})]}),je==="project"&&e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:s.pathInputGroup,children:[e.jsxs("label",{className:s.label,style:{minWidth:"110px"},children:[bs==="operations"?"Mission":"Project"," name:"]}),e.jsx("input",{className:s.input,type:"text",value:Dt,onChange:t=>Et(t.target.value),placeholder:bs==="operations"?"Mission name":"Project name"})]}),e.jsxs("div",{className:s.pathInputGroup,children:[e.jsx("label",{className:s.label,style:{minWidth:"110px"},children:"Description:"}),e.jsx("textarea",{className:s.textarea,value:Rt,onChange:t=>Gt(t.target.value),placeholder:bs==="operations"?"Mission description (optional)":"Project description (optional)",rows:3})]}),e.jsx("div",{className:s.pathInputGroup,style:{justifyContent:"flex-end"},children:e.jsx("button",{onClick:async()=>{if(!Js)return;const t=await Js({workspaceId:se?.workspaceId,name:Dt,description:Rt});V({type:t.success?"success":"error",message:t.success?`${bs==="operations"?"Mission":"Project"} profile saved.`:t.error||"Failed to save workspace profile."})},className:s.copyBtn,disabled:!Js,children:"Save"})})]}),je==="project"&&e.jsx("div",{className:s.settingGroup,children:At&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:s.settingTitle,children:"Backup"}),e.jsxs("label",{className:s.archiveToggle,children:[e.jsx("input",{type:"checkbox",checked:G,onChange:async t=>{const l=await _(t.target.checked);V({type:l?"success":"error",message:l?"Project backup setting saved.":"Failed to save project backup setting."})}}),e.jsx("span",{children:"Enable automatic JSON backup (`.taskforce/tasks.json`)"})]})]})}),je==="global"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:s.settingGroup,children:At&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:s.settingTitle,children:"Backup"}),e.jsxs("label",{className:s.archiveToggle,children:[e.jsx("input",{type:"checkbox",checked:O,onChange:async t=>{const l=await a(t.target.checked);V({type:l?"success":"error",message:l?"Global backup default saved.":"Failed to save global backup default."})}}),e.jsx("span",{children:"Enable global JSON backup default"})]})]})}),e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Regional"}),e.jsxs("div",{className:s.pathInputGroup,children:[e.jsx("label",{className:s.label,style:{minWidth:"110px"},children:"Calendar start:"}),e.jsxs("select",{className:s.input,value:j,onChange:async t=>{const l=t.target.value,b=await c(l);V({type:b?"success":"error",message:b?`Week start saved (${l==="sunday"?"Sunday":"Monday"}).`:"Failed to save week start."})},style:{maxWidth:"220px"},children:[e.jsx("option",{value:"sunday",children:"Sunday"}),e.jsx("option",{value:"monday",children:"Monday"})]})]}),e.jsxs("div",{className:s.pathInputGroup,children:[e.jsx("label",{className:s.label,style:{minWidth:"110px"},children:"Language:"}),e.jsx("select",{className:s.input,value:$,onChange:async t=>{const l=t.target.value;if(!L)return;const b=await L(l);V({type:b?"success":"error",message:b?`Language saved (${l}).`:"Failed to save language."})},style:{maxWidth:"220px"},disabled:!L,children:P.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Keyboard Shortcut"}),e.jsxs("div",{className:s.pathInputGroup,children:[e.jsxs("div",{className:s.shortcutInputWrapper,children:[e.jsx(Pn,{size:16,className:s.inputIcon}),e.jsx("input",{type:"text",value:M,onChange:t=>h(t.target.value),placeholder:"e.g. Alt+T, Ctrl+Shift+K",className:`${s.input} ${s.shortcutInput}`})]}),e.jsx("button",{onClick:async()=>{const t=await F();V({type:t?"success":"error",message:t?"Global shortcut saved.":"Failed to save global shortcut."})},className:`${s.saveSettingsBtn} ${s.saveSettingsBtnWrapper}`,children:"Save"})]}),e.jsxs("p",{className:s.settingHelper,children:["Supported modifiers: Alt, Option, Ctrl, Shift, Meta (Cmd). Example: ",e.jsx("code",{children:"Alt+T"})," or ",e.jsx("code",{children:"Ctrl+Shift+L"}),"."]})]})]}),je==="project"&&Re==="cloud"&&e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Danger Zone"}),Ka?Pt?qa!=="owner"?e.jsx("p",{className:s.settingHelper,children:"Only workspace owners can delete a workspace."}):e.jsx("div",{className:s.pathInputGroup,children:e.jsxs("button",{className:s.destructiveBtn,onClick:async()=>{if(!Ks)return;const t=String(os||"").trim();if(!t||t==="default"){V({type:"error",message:"A non-default workspace is required for deletion."});return}const l=String(ze||"").trim(),b=window.prompt(`Type "${l}" to permanently delete this workspace.`);if(b===null)return;if(b.trim()!==l){V({type:"error",message:"Workspace name confirmation did not match."});return}const I=await Ks(t);if(!I.success){V({type:"error",message:I.error||"Failed to delete workspace."});return}const A=Array.isArray(I.cleanupWarnings)?I.cleanupWarnings.length:0;V({type:A>0?"error":"success",message:A>0?`Workspace deleted with ${A} cleanup warning(s).`:"Workspace deleted."})},disabled:!Ks,children:[e.jsx(Xe,{size:14,style:{marginRight:8}}),"Delete Workspace"]})}):e.jsx("p",{className:s.settingHelper,children:"Sign in to manage workspace deletion."}):e.jsx("p",{className:s.settingHelper,children:"Workspace deletion is available in cloud runtime only."})]})]}),z==="appearanceApplication"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:s.settingGroup,children:e.jsxs("div",{className:`${s.settingsTabs} tf-scrollbar tf-scrollbar--track-transparent tf-scrollbar--compact`,children:[e.jsx("button",{className:`${s.settingsTabBtn} ${je==="project"?s.settingsTabBtnActive:""}`,onClick:()=>ys("project"),children:"Project"}),e.jsx("button",{className:`${s.settingsTabBtn} ${je==="global"?s.settingsTabBtnActive:""}`,onClick:()=>ys("global"),children:"Global"})]})}),je==="project"?bn():yn()]}),z==="appearanceTaskCards"&&e.jsxs("div",{className:s.settingGroup,children:[e.jsx("h3",{className:`${s.settingTitle} tf-heading-section`,children:"Task Cards"}),e.jsxs("label",{className:s.archiveToggle,children:[e.jsx("input",{type:"checkbox",checked:w,onChange:async t=>{if(!p)return;const l=await p(t.target.checked);V({type:l?"success":"error",message:l?"Task card status label setting saved.":"Failed to save task card status label setting."})},disabled:!p}),e.jsx("span",{children:"Show status label"})]})]}),z==="appearanceTaskForms"&&vn(),z==="initiatives"&&e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:s.settingTitleRow,children:[e.jsx("h3",{className:s.settingTitle,children:"Initiative Templates"}),e.jsx("button",{className:s.copyBtn,onClick:()=>{Ys?.()},children:"Refresh"})]}),e.jsx("p",{className:`${s.settingsHint} ${s.marginBottom12}`,children:"Create launch, migration, or incident initiatives from reusable templates."}),e.jsxs("div",{className:s.exportItem,children:[e.jsx("label",{className:s.label,children:"Template"}),e.jsx("select",{className:s.input,value:ls,onChange:t=>{const l=t.target.value;zt(l)},children:Oe.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs("div",{className:`${s.exportItem} ${s.marginTop12}`,children:[e.jsx("label",{className:s.label,children:"Initiative Title"}),e.jsx("input",{className:s.input,placeholder:"Enter initiative title",value:Qs,onChange:t=>Za(t.target.value)})]}),e.jsxs("button",{className:`${s.secondaryHeaderBtn} ${s.marginTop12}`,disabled:Ot||!ls||!Qs.trim()||!Zs,onClick:async()=>{if(!Zs)return;Ft(!0);const t=await Zs({templateId:ls,title:Qs.trim()});Ft(!1),V({type:t.success?"success":"error",message:t.success?"Initiative created from template.":t.error||"Failed to create initiative."})},children:[Ot?e.jsx(_e,{size:14,className:s.spinner}):e.jsx(Tt,{size:14}),"Create Initiative"]})]}),z==="taxonomy"&&e.jsxs("div",{className:`${s.settingGroup} ${s.flex1} ${s.flexCol}`,children:[e.jsx("h3",{className:s.settingTitle,children:"Taxonomy & Classification"}),e.jsx("p",{className:s.settingsHint,children:"Configure categories, task types, and custom classification systems."}),e.jsx(sl,{taxonomies:ts,onUpdateTaxonomies:as,onApplySystemTaxonomyPack:Wa,taxonomyDisplayLabels:Gs,onUpdateTaxonomyDisplayLabels:Va,categories:ss,pathValidation:Rs,onUpdateCategory:zs,onRemoveCategory:Os,onSaveCategory:De,onAddPath:hs,onRemovePath:gs,onUpdateCategoryIcon:xs,onUpdateCategoryColor:Fs,onBrowseFolders:gn,types:Ie,onSaveType:v,onRemoveType:Y,onUpdateType:X,priorities:Hs,onUpdatePriorities:Us,onAnalyzeSystemTaxonomyPack:Ua,manualComplexityEnabled:B,onManualComplexityEnabledChange:async t=>{const l=await f(t);V({type:l?"success":"error",message:l?"Project complexity setting saved.":"Failed to save project complexity setting."})},initialTab:N==="categories"||N==="types"||N==="priorities"?N:void 0})]}),z==="mcp"&&e.jsxs("div",{className:s.settingsGroup,children:[tn&&e.jsxs("div",{className:s.settingsTabs,children:[e.jsx("button",{className:`${s.settingsTabBtn} ${vs==="local"?s.settingsTabBtnActive:""}`,onClick:()=>st("local"),children:"Local MCP"}),e.jsx("button",{className:`${s.settingsTabBtn} ${vs==="cloud"?s.settingsTabBtnActive:""}`,onClick:()=>st("cloud"),children:"Cloud MCP"})]}),Ss&&!Ke&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Cloud MCP"}),e.jsx("span",{className:s.settingDescription,children:"Cloud MCP connects agents to Taskforce through the hosted MCP endpoint. Use this for remote MCP clients or tools that cannot access your local Taskforce install."})]})}),rn()]}),Ss&&Ke&&e.jsx(e.Fragment,{children:da?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Cloud MCP"}),e.jsx("span",{className:s.settingDescription,children:"Cloud MCP connects agents to Taskforce through the hosted MCP endpoint. Use this for remote MCP clients or tools that cannot access your local Taskforce install."})]})}),e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"OAuth Connector Setup"}),e.jsxs("span",{className:s.settingDescription,children:[nn," uses the Taskforce OAuth connector flow instead of a personal MCP token."]})]}),e.jsx("div",{className:`${Ls?s.successMessage:s.settingHelper} ${s.marginTop12}`,children:Ls?e.jsxs(e.Fragment,{children:[e.jsx(ne,{size:14}),e.jsxs("div",{children:[e.jsx("div",{children:"Connector already authorized for this workspace."}),e.jsxs("div",{className:s.settingHelper,children:["Last used ",Ls.lastUsedAt?new Date(Ls.lastUsedAt).toLocaleString():"not yet"]})]})]}):"No active connector authorization for this workspace yet."}),e.jsx("div",{className:s.settingDescription,style:{marginTop:"12px"},children:"Use the server URL above in your client, then finish the OAuth authorization flow from the Integrations tab."}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",width:"100%",marginTop:"12px"},children:e.jsx("button",{className:s.copyBtn,onClick:()=>ce("integrations"),children:"Open Integrations"})})]}),e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.codeBlockWrapperCustom} ${s.marginTop12}`,style:{minHeight:"260px"},children:[e.jsxs("div",{className:s.codeHeader,children:[e.jsx("span",{className:s.codeLabel,children:"Cloud MCP Configuration"}),e.jsxs("div",{className:s.codeHeaderActions,children:[e.jsx("select",{className:s.settingInput,value:ae,onChange:t=>pt(t.target.value),"aria-label":"MCP client",style:{width:"auto",minWidth:"170px",padding:"6px 12px",fontSize:"12px",borderRadius:"8px"},children:wt.map(t=>e.jsx("option",{value:t.id,disabled:t.disabled,children:t.label},t.id))}),e.jsx("button",{className:`${s.copyBtn} ${de==="full"?s.copyBtnActive:""}`,onClick:ya,title:"Copy full configuration file",children:de==="full"?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14})})]})]}),e.jsx("pre",{className:s.settingsCodeBlock,children:e.jsx("code",{children:_s?ht(qe,_s,K.rootKey||"mcpServers",K.wrapperKeys||[]):gt(K.renderedText||"")})})]}),te&&e.jsxs("div",{className:`${te.type==="success"?s.successMessage:s.errorMessage} ${s.marginTop12}`,children:[te.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),te.message]}),e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.marginTop12}`,children:[e.jsx("div",{className:s.codeHeader,children:e.jsx("span",{className:s.codeLabel,children:K.instructionLabel})}),e.jsxs("div",{style:{padding:"16px 20px"},children:[e.jsx("div",{className:s.settingDescription,children:K.instructionText}),bt(),xt()]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Cloud MCP"}),e.jsx("span",{className:s.settingDescription,children:"Cloud MCP connects agents to Taskforce through the hosted MCP endpoint. Use this for remote MCP clients or tools that cannot access your local Taskforce install."})]})}),e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.codeBlockWrapperCustom} ${s.marginTop16}`,children:[e.jsx("div",{className:s.codeHeader,children:e.jsx("div",{className:s.settingLabelGroup,style:{gap:"2px"},children:e.jsx("span",{className:s.codeLabel,children:"Generate Token"})})}),e.jsx("div",{className:s.mcpTokenCardBody,children:e.jsxs("div",{className:s.mcpTokenFormGrid,children:[e.jsxs("div",{className:s.settingsItem,style:{gap:"6px"},children:[e.jsx("div",{className:s.settingLabelGroup,children:e.jsx("span",{className:s.settingDescription,children:"Token Name"})}),e.jsx("input",{type:"text",className:s.settingInput,placeholder:"Enter a recognizable token name",value:Zt,onChange:t=>rt(t.target.value)})]}),e.jsxs("div",{className:s.settingsItem,style:{gap:"6px"},children:[e.jsx("div",{className:s.settingLabelGroup,children:e.jsx("span",{className:s.settingDescription,children:"Expiry (Optional)"})}),e.jsx("input",{type:"date",className:`${s.settingInput} ${s.taskFormDateInput}`,value:ct,onChange:t=>Qt(t.target.value)})]})]})}),e.jsxs("div",{className:s.mcpTokenOutputWrap,children:[e.jsx("div",{className:s.settingLabelGroup,children:e.jsx("span",{className:s.settingDescription,children:"Full Token"})}),e.jsx("input",{type:"text",className:`${s.settingInput} ${s.mcpTokenValueInput}`,placeholder:"Generate a token to populate the full secret",value:Xt||"",onChange:t=>{dt(t.target.value),ke(null)}})]}),e.jsxs("div",{className:s.mcpTokenActionRow,children:[e.jsxs("button",{className:s.copyBtn,onClick:()=>{mn()},disabled:!Be||ea,title:"Test Token","aria-label":"Test Token",children:[ea?e.jsx(_e,{size:14,className:s.spinIcon}):e.jsx(Tt,{size:14}),e.jsx("span",{children:"TEST TOKEN"})]}),e.jsxs("button",{className:`${s.copyBtn} ${de==="token"?s.copyBtnActive:""}`,onClick:()=>Be&&us(Be,"token"),disabled:!Be,title:"Copy Token","aria-label":"Copy Token",children:[de==="token"?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14}),e.jsx("span",{children:"COPY TOKEN"})]}),e.jsxs("button",{className:s.copyBtn,onClick:()=>{un()},disabled:ds==="create",title:"Generate Token","aria-label":"Generate Token",children:[ds==="create"?e.jsx(_e,{size:14,className:s.spinIcon}):e.jsx(Tt,{size:14}),e.jsx("span",{children:"GENERATE TOKEN"})]})]}),He&&e.jsxs("div",{className:`${He.type==="success"?s.successMessage:s.errorMessage} ${s.marginTop12}`,children:[He.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),He.message]}),H&&e.jsxs("div",{className:`${H.type==="success"?s.successMessage:s.errorMessage} ${s.marginTop12}`,children:[H.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),e.jsxs("div",{children:[e.jsx("div",{children:H.message}),H.type==="success"&&(H.workspaceName||H.workspaceId)&&e.jsxs("div",{className:s.settingHelper,children:["Workspace: ",H.workspaceName||H.workspaceId,H.workspaceId?` (${H.workspaceId})`:""]}),H.type==="success"&&Array.isArray(H.scopes)&&H.scopes.length>0&&e.jsxs("div",{className:s.settingHelper,children:["Granted scopes: ",H.scopes.join(", ")]}),H.endpoint&&e.jsxs("div",{className:s.settingHelper,children:["Endpoint: ",H.endpoint]}),H.type==="error"&&H.errorCode&&e.jsxs("div",{className:s.settingHelper,children:["Error code: ",H.errorCode]}),H.type==="error"&&H.followup&&e.jsx("div",{className:s.settingHelper,children:H.followup})]})]})]}),e.jsxs("div",{className:s.settingGroup,children:[e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.codeBlockWrapperCustom} ${s.marginTop12}`,style:{minHeight:"260px"},children:[e.jsxs("div",{className:s.codeHeader,children:[e.jsx("span",{className:s.codeLabel,children:"Cloud MCP Configuration"}),e.jsxs("div",{className:s.codeHeaderActions,children:[e.jsx("select",{className:s.settingInput,value:ae,onChange:t=>pt(t.target.value),"aria-label":"MCP client",style:{width:"auto",minWidth:"170px",padding:"6px 12px",fontSize:"12px",borderRadius:"8px"},children:wt.map(t=>e.jsx("option",{value:t.id,disabled:t.disabled,children:t.label},t.id))}),e.jsx("button",{className:`${s.copyBtn} ${de==="full"?s.copyBtnActive:""}`,onClick:ya,title:"Copy full configuration file",children:de==="full"?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14})})]})]}),e.jsx("pre",{className:s.settingsCodeBlock,children:e.jsx("code",{children:_s?ht(qe,_s,K.rootKey||"mcpServers",K.wrapperKeys||[]):gt(K.renderedText||"")})})]}),te&&e.jsxs("div",{className:`${te.type==="success"?s.successMessage:s.errorMessage} ${s.marginTop12}`,children:[te.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),te.message]}),e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.marginTop12}`,children:[e.jsx("div",{className:s.codeHeader,children:e.jsx("span",{className:s.codeLabel,children:K.instructionLabel})}),e.jsxs("div",{style:{padding:"16px 20px"},children:[e.jsx("div",{className:s.settingDescription,children:K.instructionText}),bt(),xt()]})]})]}),e.jsxs("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:[e.jsxs("div",{className:s.toggleHeading,onClick:()=>qt(t=>!t),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),qt(l=>!l))},role:"button",tabIndex:0,title:it?"Hide workspace tokens":"Show workspace tokens",children:[e.jsx("label",{className:s.label,children:"Your Tokens"}),it?e.jsx(Nt,{size:14}):e.jsx(Le,{size:14})]}),it&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s.settingDescription} ${s.marginTop12}`,children:"Manage tokens created for this workspace."}),Ue&&e.jsxs("div",{className:`${Ue.type==="success"?s.successMessage:s.errorMessage} ${s.marginTop12}`,children:[Ue.type==="success"?e.jsx(ne,{size:14}):e.jsx(Z,{size:14}),Ue.message]}),en?e.jsx("p",{className:s.settingHelper,children:"Loading tokens…"}):Yt?e.jsxs("div",{className:s.errorMessage,children:[e.jsx(Z,{size:14}),Yt]}):ot.length===0?e.jsx("p",{className:s.settingHelper,children:"No MCP tokens yet."}):e.jsx("div",{className:s.settingGroup,children:an.map(t=>e.jsxs("div",{className:`${s.settingsItem} ${s.marginTop12}`,style:{padding:"14px 16px",borderRadius:"12px",border:"1px solid var(--border-primary, rgba(255, 255, 255, 0.1))",background:"rgba(255, 255, 255, 0.03)"},children:[e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsxs("div",{className:s.labelGroupFlex,children:[e.jsx("label",{className:s.settingLabel,children:t.name}),e.jsx("span",{className:`${s.configBadge} ${t.status==="revoked"?s.configBadgeRevoked:t.status==="expired"?s.configBadgeExpired:s.configBadgeActive}`,children:t.status})]}),e.jsx("span",{className:s.settingDescription,style:{fontFamily:'"JetBrains Mono", "Fira Code", monospace'},children:t.tokenPrefix}),e.jsxs("span",{className:s.settingDescription,children:["Scopes: ",t.scopes.join(", ")]}),e.jsxs("span",{className:s.settingDescription,children:["Created ",new Date(t.createdAt).toLocaleDateString(),t.lastUsedAt?` · Last used ${new Date(t.lastUsedAt).toLocaleString()}`:" · Never used"]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",justifyContent:"flex-end"},children:[t.status==="active"&&e.jsx("button",{className:s.copyBtn,onClick:()=>{jt(t.id,"regenerate")},disabled:ds===`regenerate:${t.id}`,children:"Regenerate"}),t.status==="active"&&e.jsx("button",{className:s.copyBtn,onClick:()=>{jt(t.id,"revoke")},disabled:ds===`revoke:${t.id}`,children:"Revoke"}),t.status!=="active"&&e.jsx("button",{className:s.copyBtn,onClick:()=>{jt(t.id,"delete")},disabled:ds===`delete:${t.id}`,children:"Delete"})]})]},t.id))})]})]})]})}),la&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Local MCP"}),e.jsx("span",{className:s.settingDescription,children:"Local MCP connects through your local Taskforce install and does not require a cloud access token. Use this for Codex, Claude Code CLI, Gemini CLI, and similar local MCP clients."})]})}),pe&&ie.status==="host-unverified"&&e.jsxs("div",{className:`${s.mcpHealthCompactAlert} ${s.marginTop12}`,role:"status",children:[e.jsx(Z,{size:17,"aria-hidden":"true"}),e.jsxs("div",{className:s.mcpHealthCompactBody,children:[e.jsx("strong",{children:"Global MCP cannot be checked on this host"}),e.jsxs("span",{children:["This project uses host path mapping. Verify ",e.jsx("code",{children:"taskforce --version"})," in the host environment, or use Local / npx."]})]}),e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>cs(!1),children:"Use Local / npx"})]}),pe&&ve&&e.jsxs("div",{className:`${s.mcpHealthUpdateRow} ${s.marginTop12}`,role:"status",children:[e.jsx("div",{className:s.mcpHealthUpdateIcon,children:e.jsx(Z,{size:17,"aria-hidden":"true"})}),e.jsxs("div",{className:s.mcpHealthCompactBody,children:[e.jsx("strong",{children:"Global MCP update available"}),e.jsxs("span",{children:[ve.cliVersion||"Unknown version"," installed"," · ",ve.appVersion," expected"]})]}),e.jsxs("button",{type:"button",className:`tf-button-secondary tf-button-compact ${s.mcpHealthStableAction}`,onClick:()=>ks(!0),disabled:Me,"aria-busy":Me,children:[Me&&e.jsx(_e,{className:s.spinner,size:14,"aria-hidden":"true"}),"Review update"]})]}),pe&&fa&&e.jsxs("div",{className:`${s.mcpHealthBlockingAlert} ${s.marginTop12}`,role:"alert",children:[e.jsx(Z,{size:18,"aria-hidden":"true"}),e.jsxs("div",{className:s.mcpHealthCompactBody,children:[e.jsx("strong",{children:"Global MCP is unavailable"}),e.jsx("span",{children:fa.message})]}),e.jsxs("div",{className:s.mcpHealthCompactActions,children:[e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>cs(!1),children:"Use Local / npx"}),e.jsxs("button",{type:"button",className:`tf-button-secondary tf-button-compact ${s.mcpHealthStableAction}`,onClick:()=>Ut(t=>t+1),disabled:Me,"aria-busy":Me,"aria-label":Me?"Checking Global MCP":"Check again",children:[Me&&e.jsx(_e,{className:s.spinner,size:14,"aria-hidden":"true"}),"Check again"]})]})]}),te?.type==="error"&&!Cs&&e.jsxs("div",{className:`${s.mcpHealthCopyError} ${s.marginTop12}`,role:"alert",children:[e.jsx(Z,{size:14,"aria-hidden":"true"}),te.message]}),e.jsx(Nn,{isOpen:Cs&&!!ve,onClose:()=>ks(!1),title:"Update Global MCP",size:"md",theme:C,children:ve&&e.jsxs("div",{className:s.mcpUpdateDialog,children:[e.jsx("p",{className:s.mcpUpdateDialogIntro,children:"Your Global MCP CLI is usable, but it does not match this Taskforce app. Update it, then restart any running MCP clients."}),e.jsxs("dl",{className:s.mcpUpdateVersionGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Installed CLI"}),e.jsx("dd",{children:ve.cliVersion||"Unknown"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Expected by app"}),e.jsx("dd",{children:ve.appVersion})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Installation channel"}),e.jsx("dd",{children:we.status==="loading"?"Detecting…":ja})]})]}),we.status==="loading"&&e.jsxs("div",{className:s.mcpUpdateLoading,role:"status","aria-live":"polite",children:[e.jsx(_e,{className:s.spinner,size:15,"aria-hidden":"true"}),"Detecting the package manager…"]}),we.status==="error"&&e.jsxs("div",{className:s.mcpUpdateNotice,role:"status",children:[e.jsx(Z,{size:16,"aria-hidden":"true"}),e.jsxs("span",{children:[we.message," Check again, or update using the package manager you originally used."]})]}),vt.length>0&&we.status!=="loading"&&e.jsxs("div",{className:s.mcpUpdateCommands,children:[e.jsx("span",{className:s.mcpUpdateSectionLabel,children:Ne?.channel==="unknown"||Ne?.channel==="conflicting"||we.status==="error"?"Choose your install method":`Update with ${ja}`}),vt.map(t=>e.jsxs("div",{className:s.mcpHealthCommandRow,children:[e.jsx("code",{className:s.mcpHealthCommand,children:t}),e.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>{ln(t)},"aria-label":`Copy command: ${t}`,children:[Wt===t?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14}),Wt===t?"Copied":"Copy"]})]},t))]}),Ne&&vt.length===0&&e.jsxs("div",{className:s.mcpUpdateNotice,role:"status",children:[e.jsx(Z,{size:16,"aria-hidden":"true"}),e.jsxs("span",{children:[Ne.guidance," Use Local / npx for this checkout if the versions cannot be aligned."]})]}),te?.type==="error"&&e.jsxs("div",{className:s.mcpHealthCopyError,role:"alert",children:[e.jsx(Z,{size:14,"aria-hidden":"true"}),te.message]}),e.jsx("p",{className:s.mcpUpdateRestartGuidance,children:"After updating, restart Codex, Claude, Gemini, or any other client using this Global MCP configuration."}),e.jsxs("details",{className:s.mcpUpdateDiagnostics,children:[e.jsx("summary",{children:"Technical details"}),e.jsxs("dl",{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Executable"}),e.jsx("dd",{children:ve.executablePath||"Not reported"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"MCP server"}),e.jsx("dd",{children:ve.serverName||"Not reported"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Tools reported"}),e.jsx("dd",{children:ve.toolCount??"Not reported"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Health code"}),e.jsx("dd",{children:ve.code})]})]})]}),e.jsxs("div",{className:s.mcpUpdateDialogActions,children:[e.jsx("button",{type:"button",className:"tf-button-secondary",onClick:()=>cs(!1),children:"Use Local / npx"}),e.jsxs("button",{type:"button",className:"tf-button-primary","data-modal-initial-focus":!0,onClick:()=>{ks(!1),Ut(t=>t+1)},children:[e.jsx(Bn,{size:15}),"Check again"]})]})]})}),e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.codeBlockWrapperCustom}`,children:[e.jsxs("div",{className:s.codeHeader,children:[e.jsx("span",{className:s.codeLabel,children:"Local MCP Configuration"}),e.jsxs("div",{className:s.codeHeaderActions,children:[e.jsx("select",{className:s.settingInput,value:ae,onChange:t=>pt(t.target.value),"aria-label":"MCP client",style:{width:"auto",minWidth:"170px",padding:"6px 12px",fontSize:"12px",borderRadius:"8px"},children:wt.map(t=>e.jsx("option",{value:t.id,disabled:t.disabled,children:t.label},t.id))}),e.jsx("button",{className:`${s.copyBtn} ${de==="full"?s.copyBtnActive:""}`,onClick:()=>pn("full"),disabled:yt,title:yt?"Global CLI health check required":"Copy full configuration file",children:de==="full"?e.jsx(ne,{size:14}):e.jsx(Ye,{size:14})})]})]}),e.jsx("pre",{className:s.settingsCodeBlock,children:e.jsx("code",{children:Ca?ht($e.serverId,Ca,oe.rootKey||"mcpServers",oe.wrapperKeys||[]):gt(oe.renderedText||"")})})]}),e.jsxs("div",{className:`${s.codeBlockWrapper} ${s.marginTop12}`,children:[e.jsx("div",{className:s.codeHeader,children:e.jsx("span",{className:s.codeLabel,children:oe.instructionLabel})}),e.jsxs("div",{style:{padding:"16px 20px"},children:[e.jsx("div",{className:s.settingDescription,children:oe.instructionText}),bt(),xt()]})]}),e.jsx("div",{className:`${s.settingGroup} ${s.marginTop12}`,children:e.jsxs("div",{className:s.toggleHeading,onClick:()=>Kt(t=>!t),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),Kt(l=>!l))},role:"button",tabIndex:0,title:"Show advanced MCP install options",children:[e.jsx("label",{className:s.label,children:"Advanced"}),Vt?e.jsx(Nt,{size:14}):e.jsx(Le,{size:14})]})}),Vt&&e.jsxs("div",{className:`${s.settingGroup} ${s.marginTop12}`,children:[e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Advanced Installation Mode"}),e.jsx("span",{className:s.settingDescription,children:"Global mode is recommended. Local / npx is intended for Taskforce development workflows."})]}),e.jsxs("div",{className:s.buttonGrid,children:[e.jsx("button",{className:`${s.themeBtn} ${pe?s.activeTheme:""}`,onClick:()=>cs(!0),children:"Global"}),e.jsx("button",{className:`${s.themeBtn} ${pe?"":s.activeTheme}`,onClick:()=>cs(!1),children:"Local / npx (Dev)"})]}),e.jsxs("div",{className:`${s.settingsItem} ${s.marginTop16}`,children:[e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsxs("div",{className:s.labelGroupFlex,children:[e.jsx("label",{className:s.settingLabel,children:"MCP Path Mapping (Host Root)"}),is&&!ns&&e.jsx("span",{className:s.configBadge,children:"Server Configured"})]}),e.jsx("span",{className:s.settingDescription,children:"If running in Docker, WSL, or Remote Dev, provide the absolute path to this project as seen by your host OS."})]}),e.jsx("div",{className:s.pathInputWrapper,children:e.jsx("input",{type:"text",className:s.settingInput,placeholder:is||"/Users/username/Projects/my-project or C:\\Projects\\my-project",value:ns||"",onChange:t=>Ja?.(t.target.value)})})]})]})]})]}),z==="integrations"&&e.jsxs("div",{className:s.settingsGroup,children:[e.jsx("div",{className:s.settingGroup,children:e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsx("h3",{className:s.settingTitle,children:"Integrations"}),e.jsx("span",{className:s.settingDescription,children:"Manage OAuth-based app connectors separately from MCP tokens and local client setup."})]})}),e.jsxs("div",{className:`${s.settingGroup} ${s.marginTop16}`,children:[[{key:"chatgpt",label:"ChatGPT Connector",description:"Use the dedicated MCP host in ChatGPT Apps & Connectors. Taskforce handles OAuth and binds each connector authorization to one workspace.",emptyMessage:"No active ChatGPT connector grant for this workspace yet.",connector:ua},{key:"claude",label:"Claude Chat Connector",description:"Use the dedicated MCP host in Claude Settings > Connectors. Taskforce handles OAuth and binds each connector authorization to one workspace.",emptyMessage:"No active Claude Chat connector grant for this workspace yet.",connector:ma},{key:"grok",label:"Grok Connector",description:"Use the custom MCP connector flow at grok.com/connectors. Taskforce handles OAuth and binds each connector authorization to one workspace.",emptyMessage:"No active Grok connector grant for this workspace yet.",connector:ha},{key:"gemini",label:"Gemini Spark Connector",description:"Custom MCP apps are currently limited to eligible Gemini Spark users. Taskforce support will open when Google makes the flow broadly available.",emptyMessage:"No active Gemini Spark connector grant for this workspace yet.",connector:ga,comingSoon:!0},{key:"mistral",label:"Mistral Vibe Connector",description:"Custom MCP connectors are not consistently available in the current Mistral Vibe chat experience. Taskforce support will open when Mistral exposes the flow broadly.",emptyMessage:"No active Mistral Vibe connector grant for this workspace yet.",connector:xa,comingSoon:!0},{key:"perplexity",label:"Perplexity Connector",description:"Custom remote MCP availability varies by Perplexity plan and rollout. Taskforce support will open after its OAuth flow is broadly available and verified.",emptyMessage:"No active Perplexity connector grant for this workspace yet.",connector:ba,comingSoon:!0}].map(t=>{const l=t.connector,b=t.comingSoon===!0;return e.jsxs("div",{className:`${s.settingsItem} ${s.marginTop12}`,style:{padding:"16px",borderRadius:"14px",border:"1px solid var(--border-primary, rgba(255, 255, 255, 0.1))",background:"rgba(255, 255, 255, 0.03)"},children:[e.jsxs("div",{className:s.settingLabelGroup,children:[e.jsxs("div",{className:s.labelGroupFlex,children:[e.jsx("label",{className:s.settingLabel,children:t.label}),e.jsx("span",{className:`${s.configBadge} ${l&&!b?s.configBadgeActive:s.configBadgeRevoked}`,children:b?"coming soon":l?"connected":"not connected"})]}),e.jsx("span",{className:s.settingDescription,children:t.description}),!b&&e.jsx("span",{className:s.settingDescription,style:{fontFamily:'"JetBrains Mono", "Fira Code", monospace'},children:Ve}),b?null:l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:s.settingDescription,children:["Authorized workspace: ",ze||l.workspaceId]}),e.jsxs("span",{className:s.settingDescription,children:["Granted scopes: ",l.scopes.join(", ")]}),e.jsxs("span",{className:s.settingDescription,children:["Connected ",new Date(l.createdAt).toLocaleString(),l.lastUsedAt?` · Last used ${new Date(l.lastUsedAt).toLocaleString()}`:" · Never used"]})]}):e.jsx("span",{className:s.settingDescription,children:t.emptyMessage})]}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",flexWrap:"wrap"},children:l&&!b&&e.jsxs("button",{className:s.copyBtn,onClick:()=>{hn(l.id)},disabled:ia===l.id,children:[ia===l.id?e.jsx(_e,{size:14,className:s.spinIcon}):e.jsx(Xe,{size:14}),"Disconnect"]})})]},t.key)}),sn&&e.jsx("p",{className:`${s.settingHelper} ${s.marginTop12}`,children:"Loading connector grants…"}),na&&e.jsxs("div",{className:`${s.errorMessage} ${s.marginTop12}`,children:[e.jsx(Z,{size:14}),na]})]})]})]})]})})}export{pl as TaskSettings};
|