@iblai/iblai-js 2.17.1 → 2.18.0
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/web-containers/source/index.esm.js +1382 -408
- package/dist/web-containers/source/next/index.esm.js +1300 -261
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useReducer, useRef, useImperativeHandle, useCallback, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
|
|
3
|
+
import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useReducer, useRef, useImperativeHandle, useCallback, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, Fragment as Fragment$2, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
|
|
4
4
|
import * as dataLayer from '@iblai/data-layer';
|
|
5
|
-
import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useGetLlmsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
|
|
6
|
-
import { removeAuthItem, setAuthItem, isTauriEmbeddedLLMHost, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL,
|
|
5
|
+
import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useUserLlmUsageSummary, useUserLlmSpendOverTime, useUserLlmCostByModel, useUserLlmCostByService, useUserLlmRecentActivity, USER_LLM_RECENT_ACTIVITY_PAGE_SIZE, useUserLlmTraceObservations, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useGetVectorDocumentsQuery, useGetLlmsQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
|
|
6
|
+
import { removeAuthItem, setAuthItem, isTauriEmbeddedLLMHost, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, isPureWatcher, getInitials, useTenantMetadata, useUsername, selectStreaming, isLoggedIn, TOOL_NAME_MAP, WRITE_TODOS_TOOL, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, pickWritableFields, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$3, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, use401TokenRefresh, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
7
7
|
import { useDispatch, useSelector } from 'react-redux';
|
|
8
8
|
import { toast } from 'sonner';
|
|
9
9
|
import { useSearchParams, useParams, useRouter, usePathname } from 'next/navigation';
|
|
@@ -99736,7 +99736,13 @@ var profileAccount$3 = {
|
|
|
99736
99736
|
tabBenchmarks: "Benchmarks",
|
|
99737
99737
|
descBenchmarks: "Build benchmark suites of test inputs to evaluate agents.",
|
|
99738
99738
|
tabMemory: "Memory",
|
|
99739
|
-
descMemory: "Manage user global memories and agent memories."
|
|
99739
|
+
descMemory: "Manage user global memories and agent memories.",
|
|
99740
|
+
groupWorkspace: "Workspace",
|
|
99741
|
+
groupAiData: "AI & data",
|
|
99742
|
+
groupSystem: "System",
|
|
99743
|
+
ariaSettingsNav: "Organization settings",
|
|
99744
|
+
ariaSettingsNavMobile: "Organization settings (mobile)",
|
|
99745
|
+
groupFinance: "Finance"
|
|
99740
99746
|
};
|
|
99741
99747
|
var profileAddCreditsModal$3 = {
|
|
99742
99748
|
title: "Add Credits",
|
|
@@ -99932,7 +99938,6 @@ var profileIndex$3 = {
|
|
|
99932
99938
|
langSpanish: "Spanish",
|
|
99933
99939
|
langFrench: "French",
|
|
99934
99940
|
checkboxDisplayMentorAI: "Display Agent Sidebar",
|
|
99935
|
-
checkboxDisplayLeaderboard: "Display Leaderboard",
|
|
99936
99941
|
labelFacebook: "Facebook",
|
|
99937
99942
|
placeholderFacebook: "Facebook",
|
|
99938
99943
|
labelLinkedIn: "LinkedIn",
|
|
@@ -99953,7 +99958,16 @@ var profileIndex$3 = {
|
|
|
99953
99958
|
descChatHistoryPreview: "Conversations with AI agents.",
|
|
99954
99959
|
ariaAddEducation: "Add education",
|
|
99955
99960
|
ariaAddExperience: "Add experience",
|
|
99956
|
-
ariaAddResume: "Add resume"
|
|
99961
|
+
ariaAddResume: "Add resume",
|
|
99962
|
+
tabLlmUsage: "Usage",
|
|
99963
|
+
descLlmUsage: "See how much AI you have used: spend, tokens and requests across your conversations.",
|
|
99964
|
+
groupProfile: "Profile",
|
|
99965
|
+
groupAiData: "AI & data",
|
|
99966
|
+
groupAccount: "Account",
|
|
99967
|
+
groupRecords: "Records",
|
|
99968
|
+
descLlmUsagePreview: "Spend, tokens and requests across conversations.",
|
|
99969
|
+
sectionFeatures: "Features",
|
|
99970
|
+
tooltipDisplayMentorAI: "Keeps the AI agent panel beside whatever you are working on, so you can ask questions without leaving the page."
|
|
99957
99971
|
};
|
|
99958
99972
|
var profileInviteUserContent$3 = {
|
|
99959
99973
|
inviteUsersTitle: "Invite Users",
|
|
@@ -102978,6 +102992,81 @@ var analyticsTraces$3 = {
|
|
|
102978
102992
|
mentorScopeTitle: "Agent scope narrows the trace list only.",
|
|
102979
102993
|
mentorScopeBody: "Row-level observations cannot be filtered to a single agent upstream — open a trace to see its own calls."
|
|
102980
102994
|
};
|
|
102995
|
+
var profileLlmUsage$3 = {
|
|
102996
|
+
rangeLabel: "Date range",
|
|
102997
|
+
rangeToday: "Today",
|
|
102998
|
+
range7d: "7 days",
|
|
102999
|
+
range30d: "30 days",
|
|
103000
|
+
range90d: "90 days",
|
|
103001
|
+
rangeAllTime: "All time",
|
|
103002
|
+
periodToday: "Today",
|
|
103003
|
+
period7d: "Last 7 days",
|
|
103004
|
+
period30d: "Last 30 days",
|
|
103005
|
+
period90d: "Last 90 days",
|
|
103006
|
+
periodAllTime: "All time",
|
|
103007
|
+
scopeSelf: "Only your own activity is shown",
|
|
103008
|
+
refresh: "Refresh usage",
|
|
103009
|
+
kpiSpend: "Spend",
|
|
103010
|
+
kpiTokens: "Tokens",
|
|
103011
|
+
kpiRequests: "Requests",
|
|
103012
|
+
kpiAvgCost: "Avg cost per request",
|
|
103013
|
+
kpiTokensSub: "{value} per request",
|
|
103014
|
+
kpiRequestsSub: "AI calls",
|
|
103015
|
+
kpiAvgCostSub: "Spend divided by requests",
|
|
103016
|
+
chartTitle: "Spend over time",
|
|
103017
|
+
chartSubtitleDay: "Daily spend in US dollars",
|
|
103018
|
+
chartSubtitleWeek: "Weekly spend in US dollars",
|
|
103019
|
+
chartSubtitleMonth: "Monthly spend in US dollars",
|
|
103020
|
+
chartAria: "Spend over time. Use the left and right arrow keys to read each bar.",
|
|
103021
|
+
chartNoData: "No spend in this period.",
|
|
103022
|
+
chartTableCaption: "Spend per period",
|
|
103023
|
+
colPeriod: "Period",
|
|
103024
|
+
colCost: "Cost",
|
|
103025
|
+
byModelTitle: "By model",
|
|
103026
|
+
byModelSubtitle: "Share of your spend per model",
|
|
103027
|
+
byServiceTitle: "By service",
|
|
103028
|
+
byServiceSubtitle: "Where your spend comes from",
|
|
103029
|
+
otherRow: "Other",
|
|
103030
|
+
unknownModel: "Unknown model",
|
|
103031
|
+
unknownService: "Other service",
|
|
103032
|
+
breakdownEmpty: "Nothing to break down in this period.",
|
|
103033
|
+
sectionError: "This section couldn't be loaded.",
|
|
103034
|
+
activityTitle: "Recent activity",
|
|
103035
|
+
activitySubtitle: "Your latest AI requests, newest first. Open one to see each step.",
|
|
103036
|
+
activityEmpty: "No requests in this period.",
|
|
103037
|
+
colWhen: "When",
|
|
103038
|
+
colService: "Service",
|
|
103039
|
+
colSession: "Session",
|
|
103040
|
+
colLatency: "Latency",
|
|
103041
|
+
colDetails: "Details",
|
|
103042
|
+
showSteps: "Show steps for {when}",
|
|
103043
|
+
hideSteps: "Hide steps for {when}",
|
|
103044
|
+
stepsLoading: "Loading steps…",
|
|
103045
|
+
stepsEmpty: "No steps were recorded for this request.",
|
|
103046
|
+
stepsError: "The steps for this request couldn't be loaded.",
|
|
103047
|
+
colStep: "Step",
|
|
103048
|
+
colModel: "Model",
|
|
103049
|
+
colInput: "Input",
|
|
103050
|
+
colOutput: "Output",
|
|
103051
|
+
colTotal: "Total",
|
|
103052
|
+
paginationSummary: "Showing {from}–{to} of {total}",
|
|
103053
|
+
previous: "Previous",
|
|
103054
|
+
next: "Next",
|
|
103055
|
+
emptyTitle: "No AI usage in this period",
|
|
103056
|
+
emptyBody: "Chats, memory and other AI requests show up here once they happen. Try a longer range.",
|
|
103057
|
+
emptyAction90: "Show last 90 days",
|
|
103058
|
+
emptyActionAll: "Show all time",
|
|
103059
|
+
errorForbiddenTitle: "Usage isn't available",
|
|
103060
|
+
errorForbiddenBody: "We couldn't load usage for this account.",
|
|
103061
|
+
errorUnavailableTitle: "Usage is temporarily unavailable",
|
|
103062
|
+
errorUnavailableBody: "Please try again in a few minutes.",
|
|
103063
|
+
errorUnauthorizedTitle: "Your session has expired",
|
|
103064
|
+
errorUnauthorizedBody: "Sign in again to see your usage.",
|
|
103065
|
+
errorUnknownTitle: "Something went wrong",
|
|
103066
|
+
errorUnknownBody: "We couldn't load your usage.",
|
|
103067
|
+
tryAgain: "Try again",
|
|
103068
|
+
scopeUser: "Usage for {username}"
|
|
103069
|
+
};
|
|
102981
103070
|
var en = {
|
|
102982
103071
|
accessTabAddAccess: accessTabAddAccess$3,
|
|
102983
103072
|
accessTabLabels: accessTabLabels$3,
|
|
@@ -103262,7 +103351,8 @@ var en = {
|
|
|
103262
103351
|
analyticsChartCard: analyticsChartCard$3,
|
|
103263
103352
|
analyticsCostTabs: analyticsCostTabs$3,
|
|
103264
103353
|
analyticsLlmUsage: analyticsLlmUsage$3,
|
|
103265
|
-
analyticsTraces: analyticsTraces$3
|
|
103354
|
+
analyticsTraces: analyticsTraces$3,
|
|
103355
|
+
profileLlmUsage: profileLlmUsage$3
|
|
103266
103356
|
};
|
|
103267
103357
|
|
|
103268
103358
|
var accessTabAddAccess$2 = {
|
|
@@ -107093,7 +107183,13 @@ var profileAccount$2 = {
|
|
|
107093
107183
|
tabBenchmarks: "Benchmarks",
|
|
107094
107184
|
descBenchmarks: "Créez des suites de benchmarks d'entrées de test pour évaluer les agents.",
|
|
107095
107185
|
tabMemory: "Mémoire",
|
|
107096
|
-
descMemory: "Gérez les mémoires globales des utilisateurs et les mémoires des agents."
|
|
107186
|
+
descMemory: "Gérez les mémoires globales des utilisateurs et les mémoires des agents.",
|
|
107187
|
+
groupWorkspace: "Espace de travail",
|
|
107188
|
+
groupAiData: "IA et données",
|
|
107189
|
+
groupSystem: "Système",
|
|
107190
|
+
ariaSettingsNav: "Paramètres de l'organisation",
|
|
107191
|
+
ariaSettingsNavMobile: "Paramètres de l'organisation (mobile)",
|
|
107192
|
+
groupFinance: "Finance"
|
|
107097
107193
|
};
|
|
107098
107194
|
var profileAddCreditsModal$2 = {
|
|
107099
107195
|
title: "Ajouter des crédits",
|
|
@@ -107289,7 +107385,6 @@ var profileIndex$2 = {
|
|
|
107289
107385
|
langSpanish: "Espagnol",
|
|
107290
107386
|
langFrench: "Français",
|
|
107291
107387
|
checkboxDisplayMentorAI: "Afficher la barre latérale de l'agent",
|
|
107292
|
-
checkboxDisplayLeaderboard: "Afficher le classement",
|
|
107293
107388
|
labelFacebook: "Facebook",
|
|
107294
107389
|
placeholderFacebook: "Facebook",
|
|
107295
107390
|
labelLinkedIn: "LinkedIn",
|
|
@@ -107310,7 +107405,16 @@ var profileIndex$2 = {
|
|
|
107310
107405
|
descChatHistoryPreview: "Conversations avec les agents IA.",
|
|
107311
107406
|
ariaAddEducation: "Ajouter une formation",
|
|
107312
107407
|
ariaAddExperience: "Ajouter une expérience",
|
|
107313
|
-
ariaAddResume: "Ajouter un CV"
|
|
107408
|
+
ariaAddResume: "Ajouter un CV",
|
|
107409
|
+
tabLlmUsage: "Utilisation",
|
|
107410
|
+
descLlmUsage: "Voyez combien d'IA vous avez utilisé : dépenses, jetons et requêtes dans vos conversations.",
|
|
107411
|
+
groupProfile: "Profil",
|
|
107412
|
+
groupAiData: "IA et données",
|
|
107413
|
+
groupAccount: "Compte",
|
|
107414
|
+
groupRecords: "Dossiers",
|
|
107415
|
+
descLlmUsagePreview: "Dépenses, jetons et requêtes dans les conversations.",
|
|
107416
|
+
sectionFeatures: "Fonctionnalités",
|
|
107417
|
+
tooltipDisplayMentorAI: "Garde le panneau de l'agent IA à côté de ce que vous faites, pour poser des questions sans quitter la page."
|
|
107314
107418
|
};
|
|
107315
107419
|
var profileInviteUserContent$2 = {
|
|
107316
107420
|
inviteUsersTitle: "Inviter des utilisateurs",
|
|
@@ -110169,6 +110273,81 @@ var analyticsTraces$2 = {
|
|
|
110169
110273
|
mentorScopeTitle: "La portée par agent ne restreint que la liste des traces.",
|
|
110170
110274
|
mentorScopeBody: "Les observations au niveau ligne ne peuvent pas être filtrées sur un seul agent — ouvrez une trace pour voir ses propres appels."
|
|
110171
110275
|
};
|
|
110276
|
+
var profileLlmUsage$2 = {
|
|
110277
|
+
rangeLabel: "Période",
|
|
110278
|
+
rangeToday: "Aujourd'hui",
|
|
110279
|
+
range7d: "7 jours",
|
|
110280
|
+
range30d: "30 jours",
|
|
110281
|
+
range90d: "90 jours",
|
|
110282
|
+
rangeAllTime: "Tout",
|
|
110283
|
+
periodToday: "Aujourd'hui",
|
|
110284
|
+
period7d: "7 derniers jours",
|
|
110285
|
+
period30d: "30 derniers jours",
|
|
110286
|
+
period90d: "90 derniers jours",
|
|
110287
|
+
periodAllTime: "Depuis le début",
|
|
110288
|
+
scopeSelf: "Seule votre propre activité est affichée",
|
|
110289
|
+
refresh: "Actualiser l'utilisation",
|
|
110290
|
+
kpiSpend: "Dépenses",
|
|
110291
|
+
kpiTokens: "Jetons",
|
|
110292
|
+
kpiRequests: "Requêtes",
|
|
110293
|
+
kpiAvgCost: "Coût moyen par requête",
|
|
110294
|
+
kpiTokensSub: "{value} par requête",
|
|
110295
|
+
kpiRequestsSub: "Appels à l'IA",
|
|
110296
|
+
kpiAvgCostSub: "Dépenses divisées par les requêtes",
|
|
110297
|
+
chartTitle: "Dépenses dans le temps",
|
|
110298
|
+
chartSubtitleDay: "Dépenses quotidiennes en dollars américains",
|
|
110299
|
+
chartSubtitleWeek: "Dépenses hebdomadaires en dollars américains",
|
|
110300
|
+
chartSubtitleMonth: "Dépenses mensuelles en dollars américains",
|
|
110301
|
+
chartAria: "Dépenses dans le temps. Utilisez les flèches gauche et droite pour lire chaque barre.",
|
|
110302
|
+
chartNoData: "Aucune dépense sur cette période.",
|
|
110303
|
+
chartTableCaption: "Dépenses par période",
|
|
110304
|
+
colPeriod: "Période",
|
|
110305
|
+
colCost: "Coût",
|
|
110306
|
+
byModelTitle: "Par modèle",
|
|
110307
|
+
byModelSubtitle: "Part de vos dépenses par modèle",
|
|
110308
|
+
byServiceTitle: "Par service",
|
|
110309
|
+
byServiceSubtitle: "D'où viennent vos dépenses",
|
|
110310
|
+
otherRow: "Autres",
|
|
110311
|
+
unknownModel: "Modèle inconnu",
|
|
110312
|
+
unknownService: "Autre service",
|
|
110313
|
+
breakdownEmpty: "Rien à détailler sur cette période.",
|
|
110314
|
+
sectionError: "Cette section n'a pas pu être chargée.",
|
|
110315
|
+
activityTitle: "Activité récente",
|
|
110316
|
+
activitySubtitle: "Vos dernières requêtes d'IA, les plus récentes d'abord. Ouvrez-en une pour voir chaque étape.",
|
|
110317
|
+
activityEmpty: "Aucune requête sur cette période.",
|
|
110318
|
+
colWhen: "Quand",
|
|
110319
|
+
colService: "Service",
|
|
110320
|
+
colSession: "Session",
|
|
110321
|
+
colLatency: "Latence",
|
|
110322
|
+
colDetails: "Détails",
|
|
110323
|
+
showSteps: "Afficher les étapes du {when}",
|
|
110324
|
+
hideSteps: "Masquer les étapes du {when}",
|
|
110325
|
+
stepsLoading: "Chargement des étapes…",
|
|
110326
|
+
stepsEmpty: "Aucune étape n'a été enregistrée pour cette requête.",
|
|
110327
|
+
stepsError: "Les étapes de cette requête n'ont pas pu être chargées.",
|
|
110328
|
+
colStep: "Étape",
|
|
110329
|
+
colModel: "Modèle",
|
|
110330
|
+
colInput: "Entrée",
|
|
110331
|
+
colOutput: "Sortie",
|
|
110332
|
+
colTotal: "Total",
|
|
110333
|
+
paginationSummary: "{from}–{to} sur {total}",
|
|
110334
|
+
previous: "Précédent",
|
|
110335
|
+
next: "Suivant",
|
|
110336
|
+
emptyTitle: "Aucune utilisation de l'IA sur cette période",
|
|
110337
|
+
emptyBody: "Les discussions, la mémoire et les autres requêtes d'IA apparaissent ici dès qu'elles ont lieu. Essayez une période plus longue.",
|
|
110338
|
+
emptyAction90: "Afficher les 90 derniers jours",
|
|
110339
|
+
emptyActionAll: "Tout afficher",
|
|
110340
|
+
errorForbiddenTitle: "L'utilisation n'est pas disponible",
|
|
110341
|
+
errorForbiddenBody: "Nous n'avons pas pu charger l'utilisation de ce compte.",
|
|
110342
|
+
errorUnavailableTitle: "L'utilisation est temporairement indisponible",
|
|
110343
|
+
errorUnavailableBody: "Veuillez réessayer dans quelques minutes.",
|
|
110344
|
+
errorUnauthorizedTitle: "Votre session a expiré",
|
|
110345
|
+
errorUnauthorizedBody: "Reconnectez-vous pour voir votre utilisation.",
|
|
110346
|
+
errorUnknownTitle: "Un problème est survenu",
|
|
110347
|
+
errorUnknownBody: "Nous n'avons pas pu charger votre utilisation.",
|
|
110348
|
+
tryAgain: "Réessayer",
|
|
110349
|
+
scopeUser: "Utilisation de {username}"
|
|
110350
|
+
};
|
|
110172
110351
|
var fr = {
|
|
110173
110352
|
accessTabAddAccess: accessTabAddAccess$2,
|
|
110174
110353
|
accessTabLabels: accessTabLabels$2,
|
|
@@ -110453,7 +110632,8 @@ var fr = {
|
|
|
110453
110632
|
analyticsChartCard: analyticsChartCard$2,
|
|
110454
110633
|
analyticsCostTabs: analyticsCostTabs$2,
|
|
110455
110634
|
analyticsLlmUsage: analyticsLlmUsage$2,
|
|
110456
|
-
analyticsTraces: analyticsTraces$2
|
|
110635
|
+
analyticsTraces: analyticsTraces$2,
|
|
110636
|
+
profileLlmUsage: profileLlmUsage$2
|
|
110457
110637
|
};
|
|
110458
110638
|
|
|
110459
110639
|
var accessTabAddAccess$1 = {
|
|
@@ -114284,7 +114464,13 @@ var profileAccount$1 = {
|
|
|
114284
114464
|
tabBenchmarks: "Benchmarks",
|
|
114285
114465
|
descBenchmarks: "Cree suites de benchmarks con entradas de prueba para evaluar agentes.",
|
|
114286
114466
|
tabMemory: "Memoria",
|
|
114287
|
-
descMemory: "Gestiona las memorias globales de los usuarios y las memorias de los agentes."
|
|
114467
|
+
descMemory: "Gestiona las memorias globales de los usuarios y las memorias de los agentes.",
|
|
114468
|
+
groupWorkspace: "Espacio de trabajo",
|
|
114469
|
+
groupAiData: "IA y datos",
|
|
114470
|
+
groupSystem: "Sistema",
|
|
114471
|
+
ariaSettingsNav: "Configuración de la organización",
|
|
114472
|
+
ariaSettingsNavMobile: "Configuración de la organización (móvil)",
|
|
114473
|
+
groupFinance: "Finanzas"
|
|
114288
114474
|
};
|
|
114289
114475
|
var profileAddCreditsModal$1 = {
|
|
114290
114476
|
title: "Agregar créditos",
|
|
@@ -114480,7 +114666,6 @@ var profileIndex$1 = {
|
|
|
114480
114666
|
langSpanish: "Español",
|
|
114481
114667
|
langFrench: "Francés",
|
|
114482
114668
|
checkboxDisplayMentorAI: "Mostrar barra lateral del agente",
|
|
114483
|
-
checkboxDisplayLeaderboard: "Mostrar tabla de clasificación",
|
|
114484
114669
|
labelFacebook: "Facebook",
|
|
114485
114670
|
placeholderFacebook: "Facebook",
|
|
114486
114671
|
labelLinkedIn: "LinkedIn",
|
|
@@ -114501,7 +114686,16 @@ var profileIndex$1 = {
|
|
|
114501
114686
|
descChatHistoryPreview: "Conversaciones con agentes de IA.",
|
|
114502
114687
|
ariaAddEducation: "Añadir educación",
|
|
114503
114688
|
ariaAddExperience: "Añadir experiencia",
|
|
114504
|
-
ariaAddResume: "Añadir currículum"
|
|
114689
|
+
ariaAddResume: "Añadir currículum",
|
|
114690
|
+
tabLlmUsage: "Uso",
|
|
114691
|
+
descLlmUsage: "Consulta cuánta IA has usado: gasto, tokens y solicitudes en tus conversaciones.",
|
|
114692
|
+
groupProfile: "Perfil",
|
|
114693
|
+
groupAiData: "IA y datos",
|
|
114694
|
+
groupAccount: "Cuenta",
|
|
114695
|
+
groupRecords: "Registros",
|
|
114696
|
+
descLlmUsagePreview: "Gasto, tokens y solicitudes en las conversaciones.",
|
|
114697
|
+
sectionFeatures: "Funciones",
|
|
114698
|
+
tooltipDisplayMentorAI: "Mantiene el panel del agente de IA junto a lo que estés haciendo, para que puedas preguntar sin salir de la página."
|
|
114505
114699
|
};
|
|
114506
114700
|
var profileInviteUserContent$1 = {
|
|
114507
114701
|
inviteUsersTitle: "Invitar usuarios",
|
|
@@ -117360,6 +117554,81 @@ var analyticsTraces$1 = {
|
|
|
117360
117554
|
mentorScopeTitle: "El alcance por agente solo acota la lista de trazas.",
|
|
117361
117555
|
mentorScopeBody: "Las observaciones a nivel de fila no pueden filtrarse por un solo agente — abre una traza para ver sus propias llamadas."
|
|
117362
117556
|
};
|
|
117557
|
+
var profileLlmUsage$1 = {
|
|
117558
|
+
rangeLabel: "Rango de fechas",
|
|
117559
|
+
rangeToday: "Hoy",
|
|
117560
|
+
range7d: "7 días",
|
|
117561
|
+
range30d: "30 días",
|
|
117562
|
+
range90d: "90 días",
|
|
117563
|
+
rangeAllTime: "Todo",
|
|
117564
|
+
periodToday: "Hoy",
|
|
117565
|
+
period7d: "Últimos 7 días",
|
|
117566
|
+
period30d: "Últimos 30 días",
|
|
117567
|
+
period90d: "Últimos 90 días",
|
|
117568
|
+
periodAllTime: "Todo el tiempo",
|
|
117569
|
+
scopeSelf: "Solo se muestra tu propia actividad",
|
|
117570
|
+
refresh: "Actualizar uso",
|
|
117571
|
+
kpiSpend: "Gasto",
|
|
117572
|
+
kpiTokens: "Tokens",
|
|
117573
|
+
kpiRequests: "Solicitudes",
|
|
117574
|
+
kpiAvgCost: "Costo promedio por solicitud",
|
|
117575
|
+
kpiTokensSub: "{value} por solicitud",
|
|
117576
|
+
kpiRequestsSub: "Llamadas a la IA",
|
|
117577
|
+
kpiAvgCostSub: "Gasto dividido entre solicitudes",
|
|
117578
|
+
chartTitle: "Gasto a lo largo del tiempo",
|
|
117579
|
+
chartSubtitleDay: "Gasto diario en dólares estadounidenses",
|
|
117580
|
+
chartSubtitleWeek: "Gasto semanal en dólares estadounidenses",
|
|
117581
|
+
chartSubtitleMonth: "Gasto mensual en dólares estadounidenses",
|
|
117582
|
+
chartAria: "Gasto a lo largo del tiempo. Usa las flechas izquierda y derecha para leer cada barra.",
|
|
117583
|
+
chartNoData: "No hay gasto en este período.",
|
|
117584
|
+
chartTableCaption: "Gasto por período",
|
|
117585
|
+
colPeriod: "Período",
|
|
117586
|
+
colCost: "Costo",
|
|
117587
|
+
byModelTitle: "Por modelo",
|
|
117588
|
+
byModelSubtitle: "Parte de tu gasto por modelo",
|
|
117589
|
+
byServiceTitle: "Por servicio",
|
|
117590
|
+
byServiceSubtitle: "De dónde proviene tu gasto",
|
|
117591
|
+
otherRow: "Otros",
|
|
117592
|
+
unknownModel: "Modelo desconocido",
|
|
117593
|
+
unknownService: "Otro servicio",
|
|
117594
|
+
breakdownEmpty: "No hay nada que desglosar en este período.",
|
|
117595
|
+
sectionError: "No se pudo cargar esta sección.",
|
|
117596
|
+
activityTitle: "Actividad reciente",
|
|
117597
|
+
activitySubtitle: "Tus solicitudes de IA más recientes, primero las más nuevas. Abre una para ver cada paso.",
|
|
117598
|
+
activityEmpty: "No hay solicitudes en este período.",
|
|
117599
|
+
colWhen: "Cuándo",
|
|
117600
|
+
colService: "Servicio",
|
|
117601
|
+
colSession: "Sesión",
|
|
117602
|
+
colLatency: "Latencia",
|
|
117603
|
+
colDetails: "Detalles",
|
|
117604
|
+
showSteps: "Mostrar pasos de {when}",
|
|
117605
|
+
hideSteps: "Ocultar pasos de {when}",
|
|
117606
|
+
stepsLoading: "Cargando pasos…",
|
|
117607
|
+
stepsEmpty: "No se registraron pasos para esta solicitud.",
|
|
117608
|
+
stepsError: "No se pudieron cargar los pasos de esta solicitud.",
|
|
117609
|
+
colStep: "Paso",
|
|
117610
|
+
colModel: "Modelo",
|
|
117611
|
+
colInput: "Entrada",
|
|
117612
|
+
colOutput: "Salida",
|
|
117613
|
+
colTotal: "Total",
|
|
117614
|
+
paginationSummary: "Mostrando {from}–{to} de {total}",
|
|
117615
|
+
previous: "Anterior",
|
|
117616
|
+
next: "Siguiente",
|
|
117617
|
+
emptyTitle: "Sin uso de IA en este período",
|
|
117618
|
+
emptyBody: "Los chats, la memoria y otras solicitudes de IA aparecen aquí cuando ocurren. Prueba un rango más amplio.",
|
|
117619
|
+
emptyAction90: "Mostrar los últimos 90 días",
|
|
117620
|
+
emptyActionAll: "Mostrar todo",
|
|
117621
|
+
errorForbiddenTitle: "El uso no está disponible",
|
|
117622
|
+
errorForbiddenBody: "No pudimos cargar el uso de esta cuenta.",
|
|
117623
|
+
errorUnavailableTitle: "El uso no está disponible temporalmente",
|
|
117624
|
+
errorUnavailableBody: "Inténtalo de nuevo en unos minutos.",
|
|
117625
|
+
errorUnauthorizedTitle: "Tu sesión ha expirado",
|
|
117626
|
+
errorUnauthorizedBody: "Vuelve a iniciar sesión para ver tu uso.",
|
|
117627
|
+
errorUnknownTitle: "Algo salió mal",
|
|
117628
|
+
errorUnknownBody: "No pudimos cargar tu uso.",
|
|
117629
|
+
tryAgain: "Intentar de nuevo",
|
|
117630
|
+
scopeUser: "Uso de {username}"
|
|
117631
|
+
};
|
|
117363
117632
|
var es = {
|
|
117364
117633
|
accessTabAddAccess: accessTabAddAccess$1,
|
|
117365
117634
|
accessTabLabels: accessTabLabels$1,
|
|
@@ -117644,7 +117913,8 @@ var es = {
|
|
|
117644
117913
|
analyticsChartCard: analyticsChartCard$1,
|
|
117645
117914
|
analyticsCostTabs: analyticsCostTabs$1,
|
|
117646
117915
|
analyticsLlmUsage: analyticsLlmUsage$1,
|
|
117647
|
-
analyticsTraces: analyticsTraces$1
|
|
117916
|
+
analyticsTraces: analyticsTraces$1,
|
|
117917
|
+
profileLlmUsage: profileLlmUsage$1
|
|
117648
117918
|
};
|
|
117649
117919
|
|
|
117650
117920
|
var accessTabAddAccess = {
|
|
@@ -121475,7 +121745,13 @@ var profileAccount = {
|
|
|
121475
121745
|
tabBenchmarks: "基准测试",
|
|
121476
121746
|
descBenchmarks: "构建包含测试输入的基准测试套件,以评估智能体。",
|
|
121477
121747
|
tabMemory: "记忆",
|
|
121478
|
-
descMemory: "管理用户的全局记忆和智能体记忆。"
|
|
121748
|
+
descMemory: "管理用户的全局记忆和智能体记忆。",
|
|
121749
|
+
groupWorkspace: "工作区",
|
|
121750
|
+
groupAiData: "AI 与数据",
|
|
121751
|
+
groupSystem: "系统",
|
|
121752
|
+
ariaSettingsNav: "组织设置",
|
|
121753
|
+
ariaSettingsNavMobile: "组织设置(移动端)",
|
|
121754
|
+
groupFinance: "财务"
|
|
121479
121755
|
};
|
|
121480
121756
|
var profileAddCreditsModal = {
|
|
121481
121757
|
title: "添加积分",
|
|
@@ -121671,7 +121947,6 @@ var profileIndex = {
|
|
|
121671
121947
|
langSpanish: "西班牙语",
|
|
121672
121948
|
langFrench: "法语",
|
|
121673
121949
|
checkboxDisplayMentorAI: "显示助手侧边栏",
|
|
121674
|
-
checkboxDisplayLeaderboard: "显示排行榜",
|
|
121675
121950
|
labelFacebook: "Facebook",
|
|
121676
121951
|
placeholderFacebook: "Facebook",
|
|
121677
121952
|
labelLinkedIn: "LinkedIn",
|
|
@@ -121692,7 +121967,16 @@ var profileIndex = {
|
|
|
121692
121967
|
descChatHistoryPreview: "与 AI 代理的对话。",
|
|
121693
121968
|
ariaAddEducation: "添加教育经历",
|
|
121694
121969
|
ariaAddExperience: "添加工作经历",
|
|
121695
|
-
ariaAddResume: "添加简历"
|
|
121970
|
+
ariaAddResume: "添加简历",
|
|
121971
|
+
tabLlmUsage: "用量",
|
|
121972
|
+
descLlmUsage: "查看你使用了多少 AI:各对话中的花费、令牌数和请求数。",
|
|
121973
|
+
groupProfile: "个人资料",
|
|
121974
|
+
groupAiData: "AI 与数据",
|
|
121975
|
+
groupAccount: "账户",
|
|
121976
|
+
groupRecords: "记录",
|
|
121977
|
+
descLlmUsagePreview: "各对话中的花费、令牌数和请求数。",
|
|
121978
|
+
sectionFeatures: "功能",
|
|
121979
|
+
tooltipDisplayMentorAI: "让 AI 助手面板始终显示在当前页面旁边,无需离开页面即可提问。"
|
|
121696
121980
|
};
|
|
121697
121981
|
var profileInviteUserContent = {
|
|
121698
121982
|
inviteUsersTitle: "邀请用户",
|
|
@@ -124551,6 +124835,81 @@ var analyticsTraces = {
|
|
|
124551
124835
|
mentorScopeTitle: "代理范围仅缩小追踪列表。",
|
|
124552
124836
|
mentorScopeBody: "行级观测记录无法按单个代理筛选 — 打开一条追踪查看它自己的调用。"
|
|
124553
124837
|
};
|
|
124838
|
+
var profileLlmUsage = {
|
|
124839
|
+
rangeLabel: "日期范围",
|
|
124840
|
+
rangeToday: "今天",
|
|
124841
|
+
range7d: "7 天",
|
|
124842
|
+
range30d: "30 天",
|
|
124843
|
+
range90d: "90 天",
|
|
124844
|
+
rangeAllTime: "全部",
|
|
124845
|
+
periodToday: "今天",
|
|
124846
|
+
period7d: "最近 7 天",
|
|
124847
|
+
period30d: "最近 30 天",
|
|
124848
|
+
period90d: "最近 90 天",
|
|
124849
|
+
periodAllTime: "全部时间",
|
|
124850
|
+
scopeSelf: "仅显示你自己的活动",
|
|
124851
|
+
refresh: "刷新用量",
|
|
124852
|
+
kpiSpend: "花费",
|
|
124853
|
+
kpiTokens: "令牌",
|
|
124854
|
+
kpiRequests: "请求",
|
|
124855
|
+
kpiAvgCost: "每次请求平均花费",
|
|
124856
|
+
kpiTokensSub: "每次请求 {value}",
|
|
124857
|
+
kpiRequestsSub: "AI 调用",
|
|
124858
|
+
kpiAvgCostSub: "花费除以请求数",
|
|
124859
|
+
chartTitle: "花费趋势",
|
|
124860
|
+
chartSubtitleDay: "每日花费(美元)",
|
|
124861
|
+
chartSubtitleWeek: "每周花费(美元)",
|
|
124862
|
+
chartSubtitleMonth: "每月花费(美元)",
|
|
124863
|
+
chartAria: "花费趋势。使用左右方向键逐个读取柱形。",
|
|
124864
|
+
chartNoData: "此期间没有花费。",
|
|
124865
|
+
chartTableCaption: "各期间花费",
|
|
124866
|
+
colPeriod: "期间",
|
|
124867
|
+
colCost: "花费",
|
|
124868
|
+
byModelTitle: "按模型",
|
|
124869
|
+
byModelSubtitle: "各模型占你花费的比例",
|
|
124870
|
+
byServiceTitle: "按服务",
|
|
124871
|
+
byServiceSubtitle: "你的花费来自哪里",
|
|
124872
|
+
otherRow: "其他",
|
|
124873
|
+
unknownModel: "未知模型",
|
|
124874
|
+
unknownService: "其他服务",
|
|
124875
|
+
breakdownEmpty: "此期间没有可细分的数据。",
|
|
124876
|
+
sectionError: "无法加载此部分。",
|
|
124877
|
+
activityTitle: "最近活动",
|
|
124878
|
+
activitySubtitle: "你最近的 AI 请求,最新的在前。展开可查看每个步骤。",
|
|
124879
|
+
activityEmpty: "此期间没有请求。",
|
|
124880
|
+
colWhen: "时间",
|
|
124881
|
+
colService: "服务",
|
|
124882
|
+
colSession: "会话",
|
|
124883
|
+
colLatency: "延迟",
|
|
124884
|
+
colDetails: "详情",
|
|
124885
|
+
showSteps: "显示 {when} 的步骤",
|
|
124886
|
+
hideSteps: "隐藏 {when} 的步骤",
|
|
124887
|
+
stepsLoading: "正在加载步骤…",
|
|
124888
|
+
stepsEmpty: "此请求没有记录任何步骤。",
|
|
124889
|
+
stepsError: "无法加载此请求的步骤。",
|
|
124890
|
+
colStep: "步骤",
|
|
124891
|
+
colModel: "模型",
|
|
124892
|
+
colInput: "输入",
|
|
124893
|
+
colOutput: "输出",
|
|
124894
|
+
colTotal: "合计",
|
|
124895
|
+
paginationSummary: "第 {from}–{to} 条,共 {total} 条",
|
|
124896
|
+
previous: "上一页",
|
|
124897
|
+
next: "下一页",
|
|
124898
|
+
emptyTitle: "此期间没有 AI 用量",
|
|
124899
|
+
emptyBody: "发生聊天、记忆和其他 AI 请求后,相关记录会显示在这里。请尝试更长的时间范围。",
|
|
124900
|
+
emptyAction90: "显示最近 90 天",
|
|
124901
|
+
emptyActionAll: "显示全部",
|
|
124902
|
+
errorForbiddenTitle: "无法查看用量",
|
|
124903
|
+
errorForbiddenBody: "无法加载此账户的用量。",
|
|
124904
|
+
errorUnavailableTitle: "用量暂时不可用",
|
|
124905
|
+
errorUnavailableBody: "请几分钟后再试。",
|
|
124906
|
+
errorUnauthorizedTitle: "你的会话已过期",
|
|
124907
|
+
errorUnauthorizedBody: "请重新登录以查看你的用量。",
|
|
124908
|
+
errorUnknownTitle: "出现问题",
|
|
124909
|
+
errorUnknownBody: "无法加载你的用量。",
|
|
124910
|
+
tryAgain: "重试",
|
|
124911
|
+
scopeUser: "{username} 的用量"
|
|
124912
|
+
};
|
|
124554
124913
|
var zh = {
|
|
124555
124914
|
accessTabAddAccess: accessTabAddAccess,
|
|
124556
124915
|
accessTabLabels: accessTabLabels,
|
|
@@ -124835,7 +125194,8 @@ var zh = {
|
|
|
124835
125194
|
analyticsChartCard: analyticsChartCard,
|
|
124836
125195
|
analyticsCostTabs: analyticsCostTabs,
|
|
124837
125196
|
analyticsLlmUsage: analyticsLlmUsage,
|
|
124838
|
-
analyticsTraces: analyticsTraces
|
|
125197
|
+
analyticsTraces: analyticsTraces,
|
|
125198
|
+
profileLlmUsage: profileLlmUsage
|
|
124839
125199
|
};
|
|
124840
125200
|
|
|
124841
125201
|
/**
|
|
@@ -131839,8 +132199,8 @@ function EducationDialog({ open, onOpenChange, org, username, education, onCompl
|
|
|
131839
132199
|
}, org: org, username: username })] }));
|
|
131840
132200
|
}
|
|
131841
132201
|
|
|
131842
|
-
const Card = React.forwardRef(({ className, ...props }, ref) => (jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
131843
|
-
Card.displayName = "Card";
|
|
132202
|
+
const Card$1 = React.forwardRef(({ className, ...props }, ref) => (jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
132203
|
+
Card$1.displayName = "Card";
|
|
131844
132204
|
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
131845
132205
|
CardHeader.displayName = "CardHeader";
|
|
131846
132206
|
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (jsx("div", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
|
|
@@ -131853,7 +132213,7 @@ const CardFooter = React.forwardRef(({ className, ...props }, ref) => (jsx("div"
|
|
|
131853
132213
|
CardFooter.displayName = "CardFooter";
|
|
131854
132214
|
|
|
131855
132215
|
function ProfileEmptyState({ icon: Icon, message }) {
|
|
131856
|
-
return (jsx(Card, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(Icon, { className: "h-10 w-10 mx-auto text-gray-300 mb-3", "aria-hidden": "true" }), jsx("p", { className: "text-sm text-gray-400", children: message })] }) }));
|
|
132216
|
+
return (jsx(Card$1, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(Icon, { className: "h-10 w-10 mx-auto text-gray-300 mb-3", "aria-hidden": "true" }), jsx("p", { className: "text-sm text-gray-400", children: message })] }) }));
|
|
131857
132217
|
}
|
|
131858
132218
|
|
|
131859
132219
|
const formatEducationDuration = (education, present) => {
|
|
@@ -154276,15 +154636,15 @@ function SubscriptionDetail({ subscription: initialSubscription, platformKey, on
|
|
|
154276
154636
|
if (isLoadingDetail) {
|
|
154277
154637
|
return (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsxs(Button$1, { variant: "ghost", size: "sm", onClick: onBack, className: "cursor-pointer", children: [jsx(ChevronLeft, { className: "h-4 w-4 mr-1" }), t('purchasesPurchasesTab.back')] }), jsx(Skeleton, { className: "h-6 w-48" })] }), jsx(Skeleton, { className: "h-64 w-full" })] }));
|
|
154278
154638
|
}
|
|
154279
|
-
return (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsxs(Button$1, { variant: "ghost", size: "sm", onClick: onBack, className: "cursor-pointer", children: [jsx(ChevronLeft, { className: "h-4 w-4 mr-1" }), t('purchasesPurchasesTab.back')] }), jsxs("div", { children: [jsx("h4", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: subscription.item_name || subscription.item_id }), jsx("span", { className: "text-xs text-gray-400 capitalize", children: subscription.item_type })] })] }), jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-5", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelStatus') }), jsx(Badge, { className: statusBadgeStyle(subscription.status), children: subscription.status })] }), jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelPlan') }), jsxs("div", { className: "text-right", children: [jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: (_b = subscription.price) === null || _b === void 0 ? void 0 : _b.name }), jsxs("span", { className: "text-sm text-gray-500 ml-2", children: [formatCurrency((_c = subscription.price) === null || _c === void 0 ? void 0 : _c.amount, (_d = subscription.price) === null || _d === void 0 ? void 0 : _d.currency), formatInterval((_e = subscription.price) === null || _e === void 0 ? void 0 : _e.interval)] })] })] }), jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelType') }), jsx(Badge, { variant: "secondary", className: "capitalize", children: subscription.item_type })] }), subscription.current_period_end && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: subscription.cancel_at_period_end
|
|
154639
|
+
return (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsxs(Button$1, { variant: "ghost", size: "sm", onClick: onBack, className: "cursor-pointer", children: [jsx(ChevronLeft, { className: "h-4 w-4 mr-1" }), t('purchasesPurchasesTab.back')] }), jsxs("div", { children: [jsx("h4", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: subscription.item_name || subscription.item_id }), jsx("span", { className: "text-xs text-gray-400 capitalize", children: subscription.item_type })] })] }), jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-5", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelStatus') }), jsx(Badge, { className: statusBadgeStyle(subscription.status), children: subscription.status })] }), jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelPlan') }), jsxs("div", { className: "text-right", children: [jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: (_b = subscription.price) === null || _b === void 0 ? void 0 : _b.name }), jsxs("span", { className: "text-sm text-gray-500 ml-2", children: [formatCurrency((_c = subscription.price) === null || _c === void 0 ? void 0 : _c.amount, (_d = subscription.price) === null || _d === void 0 ? void 0 : _d.currency), formatInterval((_e = subscription.price) === null || _e === void 0 ? void 0 : _e.interval)] })] })] }), jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelType') }), jsx(Badge, { variant: "secondary", className: "capitalize", children: subscription.item_type })] }), subscription.current_period_end && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: subscription.cancel_at_period_end
|
|
154280
154640
|
? t('purchasesPurchasesTab.labelAccessUntil')
|
|
154281
|
-
: t('purchasesPurchasesTab.labelRenewsOn') }), jsxs("span", { className: "text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1.5", children: [jsx(Calendar$1, { className: "h-3.5 w-3.5" }), new Date(subscription.current_period_end).toLocaleDateString()] })] })), subscription.created_at && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelSubscribedSince') }), jsxs("span", { className: "text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1.5", children: [jsx(Clock, { className: "h-3.5 w-3.5" }), new Date(subscription.created_at).toLocaleDateString()] })] })), subscription.is_grandfathered && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelLegacyAccess') }), jsxs(Badge, { className: "bg-amber-100 text-amber-700 border-amber-200 text-xs", children: [jsx(Shield, { className: "h-3 w-3 mr-1" }), t('purchasesPurchasesTab.badgeGrandfathered')] })] })), subscription.cancel_at_period_end && (jsxs("div", { className: "flex items-center gap-2 border-t pt-3 text-yellow-600", children: [jsx(TriangleAlert, { className: "h-4 w-4 flex-shrink-0" }), jsx("span", { className: "text-sm", children: t('purchasesPurchasesTab.warningWillNotRenew') })] }))] }) }), canCancel && !cancelResult && (jsx(Card, { className: "shadow-sm border border-blue-100", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 space-y-3", children: [jsx("h4", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.cancelSectionHeading') }), jsx("p", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.cancelSectionDescription') }), jsxs("div", { className: "flex gap-2 items-end", children: [jsxs("div", { className: "flex-1", children: [jsxs("label", { className: "text-xs text-gray-500 mb-1 block", children: [t('purchasesPurchasesTab.cancelConfirmLabelPrefix'), ' ', jsx("span", { className: "font-mono font-bold", children: "cancel" }), ' ', t('purchasesPurchasesTab.cancelConfirmLabelSuffix')] }), jsx(Input, { value: confirmText, onChange: (e) => setConfirmText(e.target.value), placeholder: t('purchasesPurchasesTab.cancelConfirmPlaceholder') })] }), jsxs(Button$1, { onClick: handleCancel, disabled: confirmText !== 'cancel' || isCanceling, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isCanceling ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(CircleX, { className: "h-4 w-4 mr-2" })), t('purchasesPurchasesTab.cancelButton')] })] })] }) })), (cancelResult === null || cancelResult === void 0 ? void 0 : cancelResult.canceled) && (jsx(Card, { className: "shadow-sm border border-green-200", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 text-center", children: [jsx(CircleX, { className: "h-8 w-8 text-gray-400 mx-auto mb-2" }), jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1", children: t('purchasesPurchasesTab.canceledHeading') }), jsx("p", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.canceledDescription') }), jsx(Button$1, { variant: "outline", size: "icon", onClick: onBack, "aria-label": t('purchasesPurchasesTab.backToPurchases'), className: "mt-3 h-8 w-8 cursor-pointer rounded-full border-0 bg-gray-100 text-gray-700 hover:bg-gray-200 hover:text-gray-900 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700 dark:hover:text-white", children: jsx(ArrowLeft, { className: "h-4 w-4" }) })] }) })), (cancelResult === null || cancelResult === void 0 ? void 0 : cancelResult.portalUrl) && (jsx(Card, { className: "shadow-sm border border-blue-200", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 text-center", children: [jsx(ExternalLink, { className: "h-8 w-8 text-blue-400 mx-auto mb-2" }), jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1", children: t('purchasesPurchasesTab.stripePortalHeading') }), jsx("p", { className: "text-xs text-gray-500 mb-3", children: t('purchasesPurchasesTab.stripePortalDescription') }), jsxs(Button$1, { onClick: () => window.open(cancelResult.portalUrl, '_blank'), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [jsx(ExternalLink, { className: "h-4 w-4 mr-2" }), t('purchasesPurchasesTab.openStripePortal')] })] }) }))] }));
|
|
154641
|
+
: t('purchasesPurchasesTab.labelRenewsOn') }), jsxs("span", { className: "text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1.5", children: [jsx(Calendar$1, { className: "h-3.5 w-3.5" }), new Date(subscription.current_period_end).toLocaleDateString()] })] })), subscription.created_at && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelSubscribedSince') }), jsxs("span", { className: "text-sm text-gray-600 dark:text-gray-400 flex items-center gap-1.5", children: [jsx(Clock, { className: "h-3.5 w-3.5" }), new Date(subscription.created_at).toLocaleDateString()] })] })), subscription.is_grandfathered && (jsxs("div", { className: "flex items-center justify-between border-t pt-3", children: [jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.labelLegacyAccess') }), jsxs(Badge, { className: "bg-amber-100 text-amber-700 border-amber-200 text-xs", children: [jsx(Shield, { className: "h-3 w-3 mr-1" }), t('purchasesPurchasesTab.badgeGrandfathered')] })] })), subscription.cancel_at_period_end && (jsxs("div", { className: "flex items-center gap-2 border-t pt-3 text-yellow-600", children: [jsx(TriangleAlert, { className: "h-4 w-4 flex-shrink-0" }), jsx("span", { className: "text-sm", children: t('purchasesPurchasesTab.warningWillNotRenew') })] }))] }) }), canCancel && !cancelResult && (jsx(Card$1, { className: "shadow-sm border border-blue-100", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 space-y-3", children: [jsx("h4", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t('purchasesPurchasesTab.cancelSectionHeading') }), jsx("p", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.cancelSectionDescription') }), jsxs("div", { className: "flex gap-2 items-end", children: [jsxs("div", { className: "flex-1", children: [jsxs("label", { className: "text-xs text-gray-500 mb-1 block", children: [t('purchasesPurchasesTab.cancelConfirmLabelPrefix'), ' ', jsx("span", { className: "font-mono font-bold", children: "cancel" }), ' ', t('purchasesPurchasesTab.cancelConfirmLabelSuffix')] }), jsx(Input, { value: confirmText, onChange: (e) => setConfirmText(e.target.value), placeholder: t('purchasesPurchasesTab.cancelConfirmPlaceholder') })] }), jsxs(Button$1, { onClick: handleCancel, disabled: confirmText !== 'cancel' || isCanceling, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isCanceling ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(CircleX, { className: "h-4 w-4 mr-2" })), t('purchasesPurchasesTab.cancelButton')] })] })] }) })), (cancelResult === null || cancelResult === void 0 ? void 0 : cancelResult.canceled) && (jsx(Card$1, { className: "shadow-sm border border-green-200", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 text-center", children: [jsx(CircleX, { className: "h-8 w-8 text-gray-400 mx-auto mb-2" }), jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1", children: t('purchasesPurchasesTab.canceledHeading') }), jsx("p", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.canceledDescription') }), jsx(Button$1, { variant: "outline", size: "icon", onClick: onBack, "aria-label": t('purchasesPurchasesTab.backToPurchases'), className: "mt-3 h-8 w-8 cursor-pointer rounded-full border-0 bg-gray-100 text-gray-700 hover:bg-gray-200 hover:text-gray-900 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700 dark:hover:text-white", children: jsx(ArrowLeft, { className: "h-4 w-4" }) })] }) })), (cancelResult === null || cancelResult === void 0 ? void 0 : cancelResult.portalUrl) && (jsx(Card$1, { className: "shadow-sm border border-blue-200", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-5 text-center", children: [jsx(ExternalLink, { className: "h-8 w-8 text-blue-400 mx-auto mb-2" }), jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1", children: t('purchasesPurchasesTab.stripePortalHeading') }), jsx("p", { className: "text-xs text-gray-500 mb-3", children: t('purchasesPurchasesTab.stripePortalDescription') }), jsxs(Button$1, { onClick: () => window.open(cancelResult.portalUrl, '_blank'), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [jsx(ExternalLink, { className: "h-4 w-4 mr-2" }), t('purchasesPurchasesTab.openStripePortal')] })] }) }))] }));
|
|
154282
154642
|
}
|
|
154283
154643
|
// ── Subscription Card (List Item) ──
|
|
154284
154644
|
function SubscriptionCard({ sub, onClick }) {
|
|
154285
154645
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
154286
154646
|
const t = useT();
|
|
154287
|
-
return (jsx(Card, { className: "shadow-sm border hover:border-blue-200 transition-colors cursor-pointer", style: { borderColor: 'oklch(.922 0 0)' }, onClick: onClick, children: jsx(CardContent, { className: "p-4", children: jsxs("div", { className: "flex items-start justify-between", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 truncate", children: sub.item_name || sub.item_id }), jsx(Badge, { variant: "secondary", className: "text-xs capitalize flex-shrink-0", children: sub.item_type })] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600", children: [jsx(CreditCard, { className: "h-3.5 w-3.5 text-gray-400" }), jsxs("span", { children: [(_a = sub.price) === null || _a === void 0 ? void 0 : _a.name, " \u2014", ' ', jsxs("span", { className: "font-semibold", children: [formatCurrency((_b = sub.price) === null || _b === void 0 ? void 0 : _b.amount, (_c = sub.price) === null || _c === void 0 ? void 0 : _c.currency), ((_d = sub.price) === null || _d === void 0 ? void 0 : _d.interval) === 'month'
|
|
154647
|
+
return (jsx(Card$1, { className: "shadow-sm border hover:border-blue-200 transition-colors cursor-pointer", style: { borderColor: 'oklch(.922 0 0)' }, onClick: onClick, children: jsx(CardContent, { className: "p-4", children: jsxs("div", { className: "flex items-start justify-between", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsx("h4", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 truncate", children: sub.item_name || sub.item_id }), jsx(Badge, { variant: "secondary", className: "text-xs capitalize flex-shrink-0", children: sub.item_type })] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600", children: [jsx(CreditCard, { className: "h-3.5 w-3.5 text-gray-400" }), jsxs("span", { children: [(_a = sub.price) === null || _a === void 0 ? void 0 : _a.name, " \u2014", ' ', jsxs("span", { className: "font-semibold", children: [formatCurrency((_b = sub.price) === null || _b === void 0 ? void 0 : _b.amount, (_c = sub.price) === null || _c === void 0 ? void 0 : _c.currency), ((_d = sub.price) === null || _d === void 0 ? void 0 : _d.interval) === 'month'
|
|
154288
154648
|
? t('purchasesPurchasesTab.intervalMonth')
|
|
154289
154649
|
: ((_e = sub.price) === null || _e === void 0 ? void 0 : _e.interval) === 'year'
|
|
154290
154650
|
? t('purchasesPurchasesTab.intervalYear')
|
|
@@ -154321,7 +154681,7 @@ function PurchasesTab({ org, username }) {
|
|
|
154321
154681
|
refetch();
|
|
154322
154682
|
} }));
|
|
154323
154683
|
}
|
|
154324
|
-
return (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: t('purchasesPurchasesTab.searchPlaceholder'), className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: t('purchasesPurchasesTab.filterStatusPlaceholder') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('purchasesPurchasesTab.filterAllStatuses') }), jsx(SelectItem, { value: "active", children: t('purchasesPurchasesTab.filterActive') }), jsx(SelectItem, { value: "trialing", children: t('purchasesPurchasesTab.filterTrialing') }), jsx(SelectItem, { value: "canceled", children: t('purchasesPurchasesTab.filterCanceled') }), jsx(SelectItem, { value: "past_due", children: t('purchasesPurchasesTab.filterPastDue') })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: t('purchasesPurchasesTab.filterTypePlaceholder') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('purchasesPurchasesTab.filterAllTypes') }), jsx(SelectItem, { value: "mentor", children: t('purchasesPurchasesTab.filterAgent') }), jsx(SelectItem, { value: "course", children: t('purchasesPurchasesTab.filterCourse') }), jsx(SelectItem, { value: "program", children: t('purchasesPurchasesTab.filterProgram') }), jsx(SelectItem, { value: "pathway", children: t('purchasesPurchasesTab.filterPathway') })] })] }), data && (jsx("span", { className: "text-xs text-gray-400 self-center ml-auto", children: t('purchasesPurchasesTab.purchaseCount', { count: data.count }) }))] }), isLoading ? (jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-24 w-full" }, i))) })) : (data === null || data === void 0 ? void 0 : data.results) && data.results.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "space-y-2", children: data.results.map((sub) => (jsx(SubscriptionCard, { sub: sub, onClick: () => setSelectedSubscription(sub) }, sub.unique_id))) }), (data.previous_page !== null || data.next_page !== null) && (jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsx("span", { className: "text-xs text-gray-400", children: t('purchasesPurchasesTab.paginationTotal', { count: data.count }) }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", disabled: data.previous_page === null, onClick: () => data.previous_page !== null && setPage(data.previous_page), className: "h-7 text-xs cursor-pointer", children: t('purchasesPurchasesTab.previousPage') }), jsx("span", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.pageIndicator', { page }) }), jsx(Button$1, { variant: "outline", size: "sm", disabled: data.next_page === null, onClick: () => data.next_page !== null && setPage(data.next_page), className: "h-7 text-xs cursor-pointer", children: t('purchasesPurchasesTab.nextPage') })] })] }))] })) : (jsx(Card, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(ShoppingBag, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: debouncedSearch.trim()
|
|
154684
|
+
return (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: t('purchasesPurchasesTab.searchPlaceholder'), className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: t('purchasesPurchasesTab.filterStatusPlaceholder') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('purchasesPurchasesTab.filterAllStatuses') }), jsx(SelectItem, { value: "active", children: t('purchasesPurchasesTab.filterActive') }), jsx(SelectItem, { value: "trialing", children: t('purchasesPurchasesTab.filterTrialing') }), jsx(SelectItem, { value: "canceled", children: t('purchasesPurchasesTab.filterCanceled') }), jsx(SelectItem, { value: "past_due", children: t('purchasesPurchasesTab.filterPastDue') })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: t('purchasesPurchasesTab.filterTypePlaceholder') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('purchasesPurchasesTab.filterAllTypes') }), jsx(SelectItem, { value: "mentor", children: t('purchasesPurchasesTab.filterAgent') }), jsx(SelectItem, { value: "course", children: t('purchasesPurchasesTab.filterCourse') }), jsx(SelectItem, { value: "program", children: t('purchasesPurchasesTab.filterProgram') }), jsx(SelectItem, { value: "pathway", children: t('purchasesPurchasesTab.filterPathway') })] })] }), data && (jsx("span", { className: "text-xs text-gray-400 self-center ml-auto", children: t('purchasesPurchasesTab.purchaseCount', { count: data.count }) }))] }), isLoading ? (jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-24 w-full" }, i))) })) : (data === null || data === void 0 ? void 0 : data.results) && data.results.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "space-y-2", children: data.results.map((sub) => (jsx(SubscriptionCard, { sub: sub, onClick: () => setSelectedSubscription(sub) }, sub.unique_id))) }), (data.previous_page !== null || data.next_page !== null) && (jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsx("span", { className: "text-xs text-gray-400", children: t('purchasesPurchasesTab.paginationTotal', { count: data.count }) }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", disabled: data.previous_page === null, onClick: () => data.previous_page !== null && setPage(data.previous_page), className: "h-7 text-xs cursor-pointer", children: t('purchasesPurchasesTab.previousPage') }), jsx("span", { className: "text-xs text-gray-500", children: t('purchasesPurchasesTab.pageIndicator', { page }) }), jsx(Button$1, { variant: "outline", size: "sm", disabled: data.next_page === null, onClick: () => data.next_page !== null && setPage(data.next_page), className: "h-7 text-xs cursor-pointer", children: t('purchasesPurchasesTab.nextPage') })] })] }))] })) : (jsx(Card$1, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(ShoppingBag, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: debouncedSearch.trim()
|
|
154325
154685
|
? t('purchasesPurchasesTab.emptySearchResult')
|
|
154326
154686
|
: t('purchasesPurchasesTab.emptyNoPurchases') })] }) }))] }));
|
|
154327
154687
|
}
|
|
@@ -165230,7 +165590,7 @@ function formatLocale(locale) {
|
|
|
165230
165590
|
"q": formatQuarter,
|
|
165231
165591
|
"Q": formatUnixTimestamp,
|
|
165232
165592
|
"s": formatUnixTimestampSeconds,
|
|
165233
|
-
"S": formatSeconds,
|
|
165593
|
+
"S": formatSeconds$1,
|
|
165234
165594
|
"u": formatWeekdayNumberMonday,
|
|
165235
165595
|
"U": formatWeekNumberSunday,
|
|
165236
165596
|
"V": formatWeekNumberISO,
|
|
@@ -165696,7 +166056,7 @@ function formatMinutes(d, p) {
|
|
|
165696
166056
|
return pad$1(d.getMinutes(), p, 2);
|
|
165697
166057
|
}
|
|
165698
166058
|
|
|
165699
|
-
function formatSeconds(d, p) {
|
|
166059
|
+
function formatSeconds$1(d, p) {
|
|
165700
166060
|
return pad$1(d.getSeconds(), p, 2);
|
|
165701
166061
|
}
|
|
165702
166062
|
|
|
@@ -178965,7 +179325,7 @@ function useGradebookData(type, org, username, page, search) {
|
|
|
178965
179325
|
page,
|
|
178966
179326
|
page_size: PAGE_SIZE$e,
|
|
178967
179327
|
platform_key: org,
|
|
178968
|
-
...(trimmed ? {
|
|
179328
|
+
...(trimmed ? { course_name: trimmed } : {}),
|
|
178969
179329
|
},
|
|
178970
179330
|
}, { skip: type !== 'courses', refetchOnMountOrArgChange: true });
|
|
178971
179331
|
const programsQ = useGetUserEnrolledProgramsQuery([{ username, platformKey: org }], { skip: type !== 'programs' });
|
|
@@ -179116,7 +179476,7 @@ function GradebookCard({ row, icon: Icon, onClick, }) {
|
|
|
179116
179476
|
var _a;
|
|
179117
179477
|
const t = useT();
|
|
179118
179478
|
const clickable = !!onClick;
|
|
179119
|
-
return (jsx(Card, { className: cn('shadow-sm border transition-colors', clickable && 'hover:border-blue-200 cursor-pointer'), style: { borderColor: 'oklch(.922 0 0)' }, onClick: onClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, onKeyDown: clickable
|
|
179479
|
+
return (jsx(Card$1, { className: cn('shadow-sm border transition-colors', clickable && 'hover:border-blue-200 cursor-pointer'), style: { borderColor: 'oklch(.922 0 0)' }, onClick: onClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, onKeyDown: clickable
|
|
179120
179480
|
? (e) => {
|
|
179121
179481
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
179122
179482
|
e.preventDefault();
|
|
@@ -219032,6 +219392,607 @@ function ChatHistoryTab({ org, username }) {
|
|
|
219032
219392
|
: t('chatHistoryChatHistoryTab.conversation') }) }), jsx("div", { className: "mx-auto max-w-full overflow-x-hidden", children: selectedSession && (jsx(ConversationPreview, { org: org, username: username, session: selectedSession, agent: resolveAgent(selectedSession) })) })] }) })] }), jsx(TabsContent, { value: "exports", className: "mt-0 min-h-0 flex-1 overflow-y-auto data-[state=inactive]:hidden", children: jsx(ReportHistory, { org: org, username: username, onDownload: downloadFromUrl }) })] }));
|
|
219033
219393
|
}
|
|
219034
219394
|
|
|
219395
|
+
/**
|
|
219396
|
+
* The info icon that sits on every analytics card and, on hover or keyboard
|
|
219397
|
+
* focus, explains what the card measures. The description doubles as the
|
|
219398
|
+
* accessible name so screen readers get it without needing the hover.
|
|
219399
|
+
*
|
|
219400
|
+
* Uses the tooltip primitives directly rather than the shared `TooltipContent`
|
|
219401
|
+
* because analytics wants a light popover, while `TooltipContent` is the dark
|
|
219402
|
+
* `bg-primary` style the rest of the app relies on.
|
|
219403
|
+
*/
|
|
219404
|
+
function CardInfoIcon({ title, description, className }) {
|
|
219405
|
+
return (jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("button", { type: "button", "aria-label": description, className: cn('shrink-0 cursor-help rounded p-1 text-[#898989] transition-colors hover:bg-gray-100 hover:text-[#38A1E5] focus-visible:ring-2 focus-visible:ring-[#38A1E5] focus-visible:outline-none', className), children: jsx(Info$3, { className: "h-4 w-4", "aria-hidden": "true" }) }) }), jsx(Portal$2, { children: jsxs(Content2$3, { "data-slot": "tooltip-content", side: "top", align: "center", sideOffset: 6, collisionPadding: 12, className: "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-w-[260px] rounded-lg border border-[oklch(0.922_0_0)] bg-white p-3 shadow-lg", children: [title && (jsx("div", { "data-slot": "tooltip-title", className: "mb-1 text-sm font-semibold text-[#484848]", children: title })), jsx("p", { "data-slot": "tooltip-description", className: "text-sm leading-relaxed text-[#646464]", children: description })] }) })] }));
|
|
219406
|
+
}
|
|
219407
|
+
|
|
219408
|
+
/**
|
|
219409
|
+
* Chart color system for the analytics surface.
|
|
219410
|
+
*
|
|
219411
|
+
* Single-series charts keep the app's established `#38A1E5`. Multi-series
|
|
219412
|
+
* charts (spend stacked by service, spend by model) use a categorical palette
|
|
219413
|
+
* validated for color-vision-deficiency separation on a white surface
|
|
219414
|
+
* (worst adjacent-pair CVD ΔE 9.1, worst normal-vision ΔE 19.6 — OKLab ×100):
|
|
219415
|
+
* hues are assigned in this fixed order, per entity, never cycled or reshuffled
|
|
219416
|
+
* when a filter changes the series count.
|
|
219417
|
+
*
|
|
219418
|
+
* Three of the light-surface slots sit below 3:1 contrast against white, so
|
|
219419
|
+
* every chart that uses them must carry visible direct labels or a table view
|
|
219420
|
+
* (all of ours do — ranked rows and legends carry the values as text).
|
|
219421
|
+
*/
|
|
219422
|
+
const CHART_SERIES_COLORS = [
|
|
219423
|
+
'#2a78d6', // blue
|
|
219424
|
+
'#eb6834', // orange
|
|
219425
|
+
'#1baf7a', // aqua
|
|
219426
|
+
'#eda100', // yellow
|
|
219427
|
+
'#e87ba4', // magenta
|
|
219428
|
+
'#008300', // green
|
|
219429
|
+
];
|
|
219430
|
+
/**
|
|
219431
|
+
* Color follows the entity: a service keeps its hue whether or not the other
|
|
219432
|
+
* services are on screen. Services beyond this list fold into slots in first-
|
|
219433
|
+
* seen order via {@link colorForSeries} rather than inventing new hues.
|
|
219434
|
+
*/
|
|
219435
|
+
const SERVICE_COLOR_ORDER = [
|
|
219436
|
+
'chat',
|
|
219437
|
+
'embeddings',
|
|
219438
|
+
'memory',
|
|
219439
|
+
'grading',
|
|
219440
|
+
'moderation',
|
|
219441
|
+
'call',
|
|
219442
|
+
];
|
|
219443
|
+
/**
|
|
219444
|
+
* Stable color for a named series. Known services get their fixed slot; an
|
|
219445
|
+
* unknown name hashes into the palette deterministically so the same name is
|
|
219446
|
+
* the same color on every render and every chart.
|
|
219447
|
+
*/
|
|
219448
|
+
function colorForSeries(name) {
|
|
219449
|
+
const fixed = SERVICE_COLOR_ORDER.indexOf(name);
|
|
219450
|
+
if (fixed >= 0)
|
|
219451
|
+
return CHART_SERIES_COLORS[fixed % CHART_SERIES_COLORS.length];
|
|
219452
|
+
let hash = 0;
|
|
219453
|
+
for (let i = 0; i < name.length; i++) {
|
|
219454
|
+
hash = (hash * 31 + name.charCodeAt(i)) >>> 0;
|
|
219455
|
+
}
|
|
219456
|
+
return CHART_SERIES_COLORS[hash % CHART_SERIES_COLORS.length];
|
|
219457
|
+
}
|
|
219458
|
+
|
|
219459
|
+
const LLM_USAGE_RANGES = ['today', '7d', '30d', '90d', 'all_time'];
|
|
219460
|
+
const DEFAULT_LLM_USAGE_RANGE = '30d';
|
|
219461
|
+
/** Buckets that keep the time axis readable for the chosen span. */
|
|
219462
|
+
function granularityForRange(range) {
|
|
219463
|
+
if (range === '90d')
|
|
219464
|
+
return 'week';
|
|
219465
|
+
if (range === 'all_time')
|
|
219466
|
+
return 'month';
|
|
219467
|
+
return 'day';
|
|
219468
|
+
}
|
|
219469
|
+
/** The next wider range, offered from the empty state. */
|
|
219470
|
+
function widerRange(range) {
|
|
219471
|
+
if (range === 'all_time')
|
|
219472
|
+
return null;
|
|
219473
|
+
if (range === '90d')
|
|
219474
|
+
return 'all_time';
|
|
219475
|
+
return '90d';
|
|
219476
|
+
}
|
|
219477
|
+
const DAY_MS = 86400000;
|
|
219478
|
+
const DAYS_IN_RANGE = { today: 1, '7d': 7, '30d': 30 };
|
|
219479
|
+
/**
|
|
219480
|
+
* Spend buckets for the chart. Daily ranges get every day of the window, with
|
|
219481
|
+
* zero where the backend sent no bucket (it omits empty days), so the axis is
|
|
219482
|
+
* continuous. Weekly and monthly ranges use the buckets as returned.
|
|
219483
|
+
*/
|
|
219484
|
+
function buildSpendSeries(points, range, now = new Date()) {
|
|
219485
|
+
var _a;
|
|
219486
|
+
const days = DAYS_IN_RANGE[range];
|
|
219487
|
+
if (!days || granularityForRange(range) !== 'day')
|
|
219488
|
+
return points;
|
|
219489
|
+
const byDate = new Map(points.map((point) => [point.date, point.totalCost]));
|
|
219490
|
+
const series = [];
|
|
219491
|
+
for (let offset = days - 1; offset >= 0; offset--) {
|
|
219492
|
+
const date = new Date(now.getTime() - offset * DAY_MS).toISOString().slice(0, 10);
|
|
219493
|
+
series.push({ date, totalCost: (_a = byDate.get(date)) !== null && _a !== void 0 ? _a : 0 });
|
|
219494
|
+
}
|
|
219495
|
+
return series;
|
|
219496
|
+
}
|
|
219497
|
+
/** Axis ceiling and ticks on a 1-2-5 step, so labels land on clean numbers. */
|
|
219498
|
+
function niceScale(max, tickCount = 4) {
|
|
219499
|
+
if (!Number.isFinite(max) || max <= 0)
|
|
219500
|
+
return { max: 1, ticks: [0, 0.25, 0.5, 0.75, 1] };
|
|
219501
|
+
const rough = max / tickCount;
|
|
219502
|
+
const magnitude = 10 ** Math.floor(Math.log10(rough));
|
|
219503
|
+
const residual = rough / magnitude;
|
|
219504
|
+
const step = (residual <= 1 ? 1 : residual <= 2 ? 2 : residual <= 5 ? 5 : 10) * magnitude;
|
|
219505
|
+
const top = Math.ceil(max / step - 1e-9) * step;
|
|
219506
|
+
const ticks = [];
|
|
219507
|
+
for (let value = 0; value <= top + step / 2; value += step) {
|
|
219508
|
+
ticks.push(Number(value.toPrecision(12)));
|
|
219509
|
+
}
|
|
219510
|
+
return { max: ticks[ticks.length - 1], ticks };
|
|
219511
|
+
}
|
|
219512
|
+
const usd = (fractionDigits) => new Intl.NumberFormat('en-US', {
|
|
219513
|
+
style: 'currency',
|
|
219514
|
+
currency: 'USD',
|
|
219515
|
+
minimumFractionDigits: fractionDigits,
|
|
219516
|
+
maximumFractionDigits: fractionDigits,
|
|
219517
|
+
});
|
|
219518
|
+
/**
|
|
219519
|
+
* Dollars with enough precision to be meaningful: small values keep four
|
|
219520
|
+
* decimals. `precise` keeps four decimals for anything under a dollar — for
|
|
219521
|
+
* per-request figures (a trace, a step, the average), where $0.0147 and
|
|
219522
|
+
* $0.0102 must not both read as $0.01.
|
|
219523
|
+
*/
|
|
219524
|
+
function formatCost(value, { precise = false } = {}) {
|
|
219525
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
219526
|
+
return '—';
|
|
219527
|
+
if (value === 0)
|
|
219528
|
+
return usd(2).format(0);
|
|
219529
|
+
const abs = Math.abs(value);
|
|
219530
|
+
if (abs < 0.0001)
|
|
219531
|
+
return `<${usd(4).format(0.0001)}`;
|
|
219532
|
+
if (abs < (precise ? 1 : 0.01))
|
|
219533
|
+
return usd(4).format(value);
|
|
219534
|
+
return usd(2).format(value);
|
|
219535
|
+
}
|
|
219536
|
+
/** Axis labels: whole dollars on big steps, cents (or finer) on small ones; zero is `$0`. */
|
|
219537
|
+
function formatAxisCost(value, step) {
|
|
219538
|
+
if (value === 0)
|
|
219539
|
+
return usd(0).format(0);
|
|
219540
|
+
const decimals = step >= 1 ? 0 : Math.min(4, Math.max(2, Math.ceil(-Math.log10(step))));
|
|
219541
|
+
return usd(decimals).format(value);
|
|
219542
|
+
}
|
|
219543
|
+
function formatCompact(value) {
|
|
219544
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
219545
|
+
return '—';
|
|
219546
|
+
return new Intl.NumberFormat('en-US', { notation: 'compact', maximumFractionDigits: 1 }).format(value);
|
|
219547
|
+
}
|
|
219548
|
+
function formatInteger(value) {
|
|
219549
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
219550
|
+
return '—';
|
|
219551
|
+
return Math.round(value).toLocaleString('en-US');
|
|
219552
|
+
}
|
|
219553
|
+
/** Trace and observation latency arrive in seconds. */
|
|
219554
|
+
function formatSeconds(value) {
|
|
219555
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
219556
|
+
return '—';
|
|
219557
|
+
return `${value < 10 ? value.toFixed(2) : value.toFixed(1)}s`;
|
|
219558
|
+
}
|
|
219559
|
+
/** `YYYY-MM-DD` bucket keys are UTC calendar dates. */
|
|
219560
|
+
function formatBucket(date, granularity) {
|
|
219561
|
+
const parsed = new Date(`${date.slice(0, 10)}T00:00:00Z`);
|
|
219562
|
+
if (Number.isNaN(parsed.getTime()))
|
|
219563
|
+
return date;
|
|
219564
|
+
return parsed.toLocaleDateString('en-US', granularity === 'month'
|
|
219565
|
+
? { month: 'short', year: 'numeric', timeZone: 'UTC' }
|
|
219566
|
+
: { month: 'short', day: 'numeric', timeZone: 'UTC' });
|
|
219567
|
+
}
|
|
219568
|
+
function formatWhen(iso) {
|
|
219569
|
+
if (!iso)
|
|
219570
|
+
return '—';
|
|
219571
|
+
const date = new Date(iso);
|
|
219572
|
+
if (Number.isNaN(date.getTime()))
|
|
219573
|
+
return '—';
|
|
219574
|
+
return date.toLocaleString('en-US', {
|
|
219575
|
+
month: 'short',
|
|
219576
|
+
day: 'numeric',
|
|
219577
|
+
hour: '2-digit',
|
|
219578
|
+
minute: '2-digit',
|
|
219579
|
+
});
|
|
219580
|
+
}
|
|
219581
|
+
/** `0feb37e6-d125-…-7c9ee0a252e7` → `0feb…52e7`; the full id stays in a title. */
|
|
219582
|
+
function shortId(id) {
|
|
219583
|
+
if (!id)
|
|
219584
|
+
return '—';
|
|
219585
|
+
return id.length > 12 ? `${id.slice(0, 4)}…${id.slice(-4)}` : id;
|
|
219586
|
+
}
|
|
219587
|
+
/**
|
|
219588
|
+
* Keeps the biggest rows and folds the rest into one "Other" row, so a long
|
|
219589
|
+
* tail never floods the card.
|
|
219590
|
+
*/
|
|
219591
|
+
function foldTail(rows, keep, otherLabel) {
|
|
219592
|
+
if (rows.length <= keep + 1)
|
|
219593
|
+
return rows;
|
|
219594
|
+
const head = rows.slice(0, keep);
|
|
219595
|
+
const tail = rows.slice(keep);
|
|
219596
|
+
return [
|
|
219597
|
+
...head,
|
|
219598
|
+
{
|
|
219599
|
+
key: '__other__',
|
|
219600
|
+
label: otherLabel,
|
|
219601
|
+
totalCost: tail.reduce((sum, row) => sum + row.totalCost, 0),
|
|
219602
|
+
count: tail.reduce((sum, row) => sum + row.count, 0),
|
|
219603
|
+
isOther: true,
|
|
219604
|
+
},
|
|
219605
|
+
];
|
|
219606
|
+
}
|
|
219607
|
+
/** Share of a total as a whole percent, keeping tiny non-zero shares visible. */
|
|
219608
|
+
function sharePercent(value, total) {
|
|
219609
|
+
if (!total || value <= 0)
|
|
219610
|
+
return 0;
|
|
219611
|
+
const pct = (value / total) * 100;
|
|
219612
|
+
return pct < 1 ? Math.round(pct * 10) / 10 : Math.round(pct);
|
|
219613
|
+
}
|
|
219614
|
+
|
|
219615
|
+
/** Single series, so the palette's lead hue; it clears 3:1 on white. */
|
|
219616
|
+
const BAR_COLOR = CHART_SERIES_COLORS[0];
|
|
219617
|
+
const PLOT_HEIGHT = 176;
|
|
219618
|
+
const MAX_X_LABELS = 5;
|
|
219619
|
+
/**
|
|
219620
|
+
* Spend per bucket as columns: ≤24px wide, 4px rounded tops, square at the
|
|
219621
|
+
* baseline, a hairline grid on clean ticks. Hover or arrow keys read one
|
|
219622
|
+
* column into the readout above the plot; the same numbers are in a
|
|
219623
|
+
* visually-hidden table for screen readers.
|
|
219624
|
+
*/
|
|
219625
|
+
function SpendChart({ points, granularity, }) {
|
|
219626
|
+
const t = useT();
|
|
219627
|
+
const [active, setActive] = useState(null);
|
|
219628
|
+
const { max, ticks } = useMemo(() => niceScale(Math.max(0, ...points.map((point) => point.totalCost))), [points]);
|
|
219629
|
+
const step = ticks.length > 1 ? ticks[1] - ticks[0] : max;
|
|
219630
|
+
const labelIndexes = useMemo(() => {
|
|
219631
|
+
if (points.length <= MAX_X_LABELS)
|
|
219632
|
+
return new Set(points.map((_, index) => index));
|
|
219633
|
+
const every = (points.length - 1) / (MAX_X_LABELS - 1);
|
|
219634
|
+
return new Set(Array.from({ length: MAX_X_LABELS }, (_, i) => Math.round(i * every)));
|
|
219635
|
+
}, [points]);
|
|
219636
|
+
const onKeyDown = (event) => {
|
|
219637
|
+
if (!points.length)
|
|
219638
|
+
return;
|
|
219639
|
+
const last = points.length - 1;
|
|
219640
|
+
const current = active !== null && active !== void 0 ? active : last;
|
|
219641
|
+
let next = null;
|
|
219642
|
+
if (event.key === 'ArrowRight')
|
|
219643
|
+
next = Math.min(last, active === null ? last : current + 1);
|
|
219644
|
+
if (event.key === 'ArrowLeft')
|
|
219645
|
+
next = Math.max(0, active === null ? last : current - 1);
|
|
219646
|
+
if (event.key === 'Home')
|
|
219647
|
+
next = 0;
|
|
219648
|
+
if (event.key === 'End')
|
|
219649
|
+
next = last;
|
|
219650
|
+
if (next === null)
|
|
219651
|
+
return;
|
|
219652
|
+
event.preventDefault();
|
|
219653
|
+
setActive(next);
|
|
219654
|
+
};
|
|
219655
|
+
const activePoint = active !== null ? points[active] : null;
|
|
219656
|
+
return (jsxs("div", { className: "flex flex-col gap-2", children: [jsx("p", { className: "h-5 text-sm text-gray-600 dark:text-gray-300", "aria-live": "polite", children: activePoint && (jsxs(Fragment$1, { children: [jsx("span", { className: "font-semibold tabular-nums text-gray-900 dark:text-gray-100", children: formatCost(activePoint.totalCost) }), ' ', jsxs("span", { className: "text-gray-500 dark:text-gray-400", children: ["\u00B7 ", formatBucket(activePoint.date, granularity)] })] })) }), jsxs("div", { className: "flex gap-2", children: [jsx("div", { className: "relative w-12 flex-shrink-0 text-right text-[11px] tabular-nums text-gray-500 dark:text-gray-400", style: { height: PLOT_HEIGHT }, "aria-hidden": "true", children: ticks.map((tick) => (jsx("span", { className: "absolute right-0 -translate-y-1/2 leading-none", style: { top: `${(1 - tick / max) * 100}%` }, children: formatAxisCost(tick, step) }, tick))) }), jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { role: "group", tabIndex: 0, "aria-label": t('profileLlmUsage.chartAria'), onKeyDown: onKeyDown, onBlur: () => setActive(null), onMouseLeave: () => setActive(null), className: "relative rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500", style: { height: PLOT_HEIGHT }, children: [ticks.map((tick) => (jsx("div", { className: tick === 0
|
|
219657
|
+
? 'absolute inset-x-0 border-t border-gray-300 dark:border-gray-600'
|
|
219658
|
+
: 'absolute inset-x-0 border-t border-gray-100 dark:border-gray-800', style: { top: `${(1 - tick / max) * 100}%` }, "aria-hidden": "true" }, tick))), jsx("div", { className: "absolute inset-0 flex items-end gap-[2px]", "aria-hidden": "true", children: points.map((point, index) => {
|
|
219659
|
+
const height = max > 0 ? (point.totalCost / max) * 100 : 0;
|
|
219660
|
+
const isActive = index === active;
|
|
219661
|
+
return (jsx("div", {
|
|
219662
|
+
// The whole column slot is the hover target, not just the bar.
|
|
219663
|
+
className: "flex h-full min-w-0 flex-1 items-end justify-center", onMouseEnter: () => setActive(index), children: jsx("div", { className: "w-full max-w-[24px] rounded-t-[4px] transition-opacity", style: {
|
|
219664
|
+
height: point.totalCost > 0 ? `max(${height}%, 2px)` : 0,
|
|
219665
|
+
background: BAR_COLOR,
|
|
219666
|
+
opacity: active === null || isActive ? 1 : 0.45,
|
|
219667
|
+
} }) }, point.date));
|
|
219668
|
+
}) })] }), jsx("div", { className: "relative mt-2 h-4 text-[11px] text-gray-500 dark:text-gray-400", "aria-hidden": "true", children: points.map((point, index) => labelIndexes.has(index) ? (jsx("span", { className: "absolute whitespace-nowrap", style: index === 0
|
|
219669
|
+
? { left: 0 }
|
|
219670
|
+
: index === points.length - 1
|
|
219671
|
+
? { right: 0 }
|
|
219672
|
+
: {
|
|
219673
|
+
left: `${((index + 0.5) / points.length) * 100}%`,
|
|
219674
|
+
transform: 'translateX(-50%)',
|
|
219675
|
+
}, children: formatBucket(point.date, granularity) }, point.date)) : null) })] })] }), jsxs("table", { className: "sr-only", children: [jsx("caption", { children: t('profileLlmUsage.chartTableCaption') }), jsx("thead", { children: jsxs("tr", { children: [jsx("th", { scope: "col", children: t('profileLlmUsage.colPeriod') }), jsx("th", { scope: "col", children: t('profileLlmUsage.colCost') })] }) }), jsx("tbody", { children: points.map((point) => (jsxs("tr", { children: [jsx("td", { children: formatBucket(point.date, granularity) }), jsx("td", { children: formatCost(point.totalCost) })] }, point.date))) })] })] }));
|
|
219676
|
+
}
|
|
219677
|
+
|
|
219678
|
+
const RANGE_LABEL_KEYS = {
|
|
219679
|
+
today: 'rangeToday',
|
|
219680
|
+
'7d': 'range7d',
|
|
219681
|
+
'30d': 'range30d',
|
|
219682
|
+
'90d': 'range90d',
|
|
219683
|
+
all_time: 'rangeAllTime',
|
|
219684
|
+
};
|
|
219685
|
+
const PERIOD_LABEL_KEYS = {
|
|
219686
|
+
today: 'periodToday',
|
|
219687
|
+
'7d': 'period7d',
|
|
219688
|
+
'30d': 'period30d',
|
|
219689
|
+
'90d': 'period90d',
|
|
219690
|
+
all_time: 'periodAllTime',
|
|
219691
|
+
};
|
|
219692
|
+
const CHART_SUBTITLE_KEYS = {
|
|
219693
|
+
day: 'chartSubtitleDay',
|
|
219694
|
+
week: 'chartSubtitleWeek',
|
|
219695
|
+
month: 'chartSubtitleMonth',
|
|
219696
|
+
};
|
|
219697
|
+
const BREAKDOWN_ROWS = 5;
|
|
219698
|
+
const MODEL_BAR_COLOR = CHART_SERIES_COLORS[0];
|
|
219699
|
+
const CARD = 'rounded-xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-950';
|
|
219700
|
+
function Card({ title, subtitle, aside, children, className, bodyClassName, }) {
|
|
219701
|
+
return (jsxs("section", { className: cn(CARD, className), "aria-label": title, children: [jsxs("div", { className: "flex items-start justify-between gap-4 px-5 pt-5", children: [jsxs("div", { className: "min-w-0", children: [jsx("h4", { className: "text-[15px] font-semibold text-gray-900 dark:text-gray-100", children: title }), subtitle && (jsx("p", { className: "mt-0.5 text-[13px] text-gray-500 dark:text-gray-400", children: subtitle }))] }), aside] }), jsx("div", { className: cn('px-5 pb-5 pt-4', bodyClassName), children: children })] }));
|
|
219702
|
+
}
|
|
219703
|
+
function RangeControl({ value, onChange, }) {
|
|
219704
|
+
const t = useT();
|
|
219705
|
+
const groupRef = useRef(null);
|
|
219706
|
+
const onKeyDown = (event, index) => {
|
|
219707
|
+
var _a, _b;
|
|
219708
|
+
const last = LLM_USAGE_RANGES.length - 1;
|
|
219709
|
+
let next = null;
|
|
219710
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowDown')
|
|
219711
|
+
next = index === last ? 0 : index + 1;
|
|
219712
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowUp')
|
|
219713
|
+
next = index === 0 ? last : index - 1;
|
|
219714
|
+
if (next === null)
|
|
219715
|
+
return;
|
|
219716
|
+
event.preventDefault();
|
|
219717
|
+
onChange(LLM_USAGE_RANGES[next]);
|
|
219718
|
+
(_b = (_a = groupRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[role="radio"]')[next]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
219719
|
+
};
|
|
219720
|
+
return (jsx("div", { ref: groupRef, role: "radiogroup", "aria-label": t('profileLlmUsage.rangeLabel'), className: "inline-flex max-w-full gap-0.5 overflow-x-auto rounded-lg bg-gray-100 p-[3px] dark:bg-gray-800", children: LLM_USAGE_RANGES.map((range, index) => {
|
|
219721
|
+
const checked = range === value;
|
|
219722
|
+
return (jsx("button", { type: "button", role: "radio", "aria-checked": checked, tabIndex: checked ? 0 : -1, onClick: () => onChange(range), onKeyDown: (event) => onKeyDown(event, index), className: cn('h-8 whitespace-nowrap rounded-md px-3 text-[13px] transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500', checked
|
|
219723
|
+
? 'bg-white font-semibold text-gray-900 shadow-sm ring-1 ring-gray-200 dark:bg-gray-950 dark:text-gray-100 dark:ring-gray-700'
|
|
219724
|
+
: 'font-medium text-gray-600 hover:text-gray-900 dark:text-gray-300'), children: t(`profileLlmUsage.${RANGE_LABEL_KEYS[range]}`) }, range));
|
|
219725
|
+
}) }));
|
|
219726
|
+
}
|
|
219727
|
+
function StatTile({ label, value, sub, loading, }) {
|
|
219728
|
+
return (jsxs("div", { className: cn(CARD, 'flex flex-col gap-2 p-4'), children: [jsx("p", { className: "text-[13px] font-medium text-gray-500 dark:text-gray-400", children: label }), loading ? (jsxs(Fragment$1, { children: [jsx(Skeleton, { className: "h-7 w-24" }), jsx(Skeleton, { className: "h-4 w-20" })] })) : (jsxs(Fragment$1, { children: [jsx("p", { className: "text-[26px] font-semibold leading-tight tracking-tight text-gray-900 dark:text-gray-100", children: value }), jsx("p", { className: "min-h-[1rem] text-xs text-gray-500 tabular-nums dark:text-gray-400", children: sub })] }))] }));
|
|
219729
|
+
}
|
|
219730
|
+
function StateMessage({ icon, tone = 'neutral', title, body, action, }) {
|
|
219731
|
+
return (jsxs("div", { className: cn(CARD, 'flex flex-col items-center gap-3 px-6 py-14 text-center'), role: tone === 'error' ? 'alert' : undefined, children: [jsx("div", { className: cn('flex h-12 w-12 items-center justify-center rounded-xl', tone === 'error'
|
|
219732
|
+
? 'bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300'
|
|
219733
|
+
: 'bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400'), "aria-hidden": "true", children: icon }), jsx("h4", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: title }), jsx("p", { className: "max-w-sm text-sm leading-relaxed text-gray-500 dark:text-gray-400", children: body }), action] }));
|
|
219734
|
+
}
|
|
219735
|
+
function RankedBars({ rows, total, colorFor, }) {
|
|
219736
|
+
return (jsx("ul", { className: "flex flex-col gap-3", children: rows.map((row) => {
|
|
219737
|
+
const share = sharePercent(row.totalCost, total);
|
|
219738
|
+
return (jsxs("li", { className: "flex flex-col gap-1.5", children: [jsxs("div", { className: "flex items-baseline justify-between gap-3 text-[13px]", children: [jsxs("span", { className: "flex min-w-0 items-center gap-2 font-medium text-gray-900 dark:text-gray-100", children: [jsx("span", { className: "h-2 w-2 flex-shrink-0 rounded-[2px]", style: { background: colorFor(row) }, "aria-hidden": "true" }), jsx("span", { className: "truncate", title: row.label, children: row.label })] }), jsxs("span", { className: "whitespace-nowrap tabular-nums text-gray-700 dark:text-gray-300", children: [formatCost(row.totalCost), jsxs("span", { className: "text-gray-500 dark:text-gray-400", children: [" \u00B7 ", share, "%"] })] })] }), jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800", "aria-hidden": "true", children: jsx("div", { className: "h-full rounded-full", style: { width: `${Math.min(100, share)}%`, background: colorFor(row) } }) })] }, row.key));
|
|
219739
|
+
}) }));
|
|
219740
|
+
}
|
|
219741
|
+
function BreakdownSkeleton() {
|
|
219742
|
+
return (jsx("div", { className: "flex flex-col gap-4", children: [0, 1, 2, 3].map((i) => (jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Skeleton, { className: "h-4 w-3/4" }), jsx(Skeleton, { className: "h-1.5 w-full" })] }, i))) }));
|
|
219743
|
+
}
|
|
219744
|
+
function SectionError() {
|
|
219745
|
+
const t = useT();
|
|
219746
|
+
return (jsxs("p", { className: "flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400", children: [jsx(CircleAlert, { className: "h-4 w-4 text-red-600", "aria-hidden": "true" }), t('profileLlmUsage.sectionError')] }));
|
|
219747
|
+
}
|
|
219748
|
+
const observationTokens = (o) => {
|
|
219749
|
+
var _a, _b, _c, _d, _e, _f;
|
|
219750
|
+
return ({
|
|
219751
|
+
input: (_b = (_a = o.usage) === null || _a === void 0 ? void 0 : _a.input) !== null && _b !== void 0 ? _b : o.promptTokens,
|
|
219752
|
+
output: (_d = (_c = o.usage) === null || _c === void 0 ? void 0 : _c.output) !== null && _d !== void 0 ? _d : o.completionTokens,
|
|
219753
|
+
total: (_f = (_e = o.usage) === null || _e === void 0 ? void 0 : _e.total) !== null && _f !== void 0 ? _f : o.totalTokens,
|
|
219754
|
+
});
|
|
219755
|
+
};
|
|
219756
|
+
const observationCost = (o) => { var _a, _b, _c; return (_b = (_a = o.calculatedTotalCost) !== null && _a !== void 0 ? _a : o.totalCost) !== null && _b !== void 0 ? _b : (_c = o.costDetails) === null || _c === void 0 ? void 0 : _c.total; };
|
|
219757
|
+
function TraceSteps({ steps, isLoading, error, }) {
|
|
219758
|
+
const t = useT();
|
|
219759
|
+
if (isLoading) {
|
|
219760
|
+
return (jsx("p", { className: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.stepsLoading') }));
|
|
219761
|
+
}
|
|
219762
|
+
if (error) {
|
|
219763
|
+
return (jsx("p", { className: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.stepsError') }));
|
|
219764
|
+
}
|
|
219765
|
+
if (!steps.length) {
|
|
219766
|
+
return (jsx("p", { className: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.stepsEmpty') }));
|
|
219767
|
+
}
|
|
219768
|
+
const cell = 'px-3 py-2 text-right tabular-nums';
|
|
219769
|
+
return (jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full text-[12.5px]", children: [jsx("thead", { children: jsxs("tr", { className: "text-left text-gray-500 dark:text-gray-400", children: [jsx("th", { scope: "col", className: "px-4 py-2 font-medium", children: t('profileLlmUsage.colStep') }), jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: t('profileLlmUsage.colModel') }), jsx("th", { scope: "col", className: cn(cell, 'font-medium'), children: t('profileLlmUsage.colInput') }), jsx("th", { scope: "col", className: cn(cell, 'font-medium'), children: t('profileLlmUsage.colOutput') }), jsx("th", { scope: "col", className: cn(cell, 'font-medium'), children: t('profileLlmUsage.colTotal') }), jsx("th", { scope: "col", className: cn(cell, 'font-medium'), children: t('profileLlmUsage.colLatency') }), jsx("th", { scope: "col", className: "px-4 py-2 text-right font-medium", children: t('profileLlmUsage.colCost') })] }) }), jsx("tbody", { children: steps.map((step) => {
|
|
219770
|
+
const tokens = observationTokens(step);
|
|
219771
|
+
return (jsxs("tr", { className: "border-t border-gray-100 text-gray-700 dark:border-gray-800 dark:text-gray-300", children: [jsx("td", { className: "px-4 py-2 font-medium text-gray-900 dark:text-gray-100", children: step.name || step.type || '—' }), jsx("td", { className: "px-3 py-2", children: step.providedModelName || step.model || '—' }), jsx("td", { className: cell, children: formatInteger(tokens.input) }), jsx("td", { className: cell, children: formatInteger(tokens.output) }), jsx("td", { className: cell, children: formatInteger(tokens.total) }), jsx("td", { className: cell, children: formatSeconds(step.latency) }), jsx("td", { className: "px-4 py-2 text-right font-semibold tabular-nums text-gray-900 dark:text-gray-100", children: formatCost(observationCost(step), { precise: true }) })] }, step.id));
|
|
219772
|
+
}) })] }) }));
|
|
219773
|
+
}
|
|
219774
|
+
/**
|
|
219775
|
+
* The profile "Usage" tab: AI spend, tokens and requests for the profile on
|
|
219776
|
+
* screen. Every request names that user, so an admin viewing someone else
|
|
219777
|
+
* sees their rows rather than the whole platform's.
|
|
219778
|
+
*/
|
|
219779
|
+
function LlmUsageTab({ org, username, isOwnProfile = true }) {
|
|
219780
|
+
var _a;
|
|
219781
|
+
const t = useT();
|
|
219782
|
+
const [range, setRange] = useState(DEFAULT_LLM_USAGE_RANGE);
|
|
219783
|
+
const [page, setPage] = useState(1);
|
|
219784
|
+
const [openTraceId, setOpenTraceId] = useState(null);
|
|
219785
|
+
const granularity = granularityForRange(range);
|
|
219786
|
+
const scope = { platformKey: org, username, date_filter: range };
|
|
219787
|
+
const summary = useUserLlmUsageSummary(scope);
|
|
219788
|
+
const spend = useUserLlmSpendOverTime({ ...scope, granularity });
|
|
219789
|
+
const byModel = useUserLlmCostByModel({ ...scope, limit: 20 });
|
|
219790
|
+
const byService = useUserLlmCostByService(scope);
|
|
219791
|
+
const activity = useUserLlmRecentActivity({
|
|
219792
|
+
...scope,
|
|
219793
|
+
page,
|
|
219794
|
+
limit: USER_LLM_RECENT_ACTIVITY_PAGE_SIZE,
|
|
219795
|
+
});
|
|
219796
|
+
const steps = useUserLlmTraceObservations({ ...scope, traceId: openTraceId });
|
|
219797
|
+
const changeRange = (next) => {
|
|
219798
|
+
setRange(next);
|
|
219799
|
+
setPage(1);
|
|
219800
|
+
setOpenTraceId(null);
|
|
219801
|
+
};
|
|
219802
|
+
const refreshAll = () => {
|
|
219803
|
+
summary.refetch();
|
|
219804
|
+
spend.refetch();
|
|
219805
|
+
byModel.refetch();
|
|
219806
|
+
byService.refetch();
|
|
219807
|
+
activity.refetch();
|
|
219808
|
+
if (openTraceId)
|
|
219809
|
+
steps.refetch();
|
|
219810
|
+
};
|
|
219811
|
+
const series = useMemo(() => buildSpendSeries(spend.points, range), [spend.points, range]);
|
|
219812
|
+
const modelRows = useMemo(() => foldTail(byModel.models.map((row, index) => ({
|
|
219813
|
+
key: row.model || `unknown-${index}`,
|
|
219814
|
+
label: row.model || t('profileLlmUsage.unknownModel'),
|
|
219815
|
+
totalCost: row.totalCost,
|
|
219816
|
+
count: row.count,
|
|
219817
|
+
})), BREAKDOWN_ROWS, t('profileLlmUsage.otherRow')), [byModel.models, t]);
|
|
219818
|
+
const serviceRows = useMemo(() => foldTail(byService.services.map((row, index) => ({
|
|
219819
|
+
key: row.service || `unknown-${index}`,
|
|
219820
|
+
label: row.service || t('profileLlmUsage.unknownService'),
|
|
219821
|
+
totalCost: row.totalCost,
|
|
219822
|
+
count: row.count,
|
|
219823
|
+
})), BREAKDOWN_ROWS, t('profileLlmUsage.otherRow')), [byService.services, t]);
|
|
219824
|
+
const modelTotal = modelRows.reduce((sum, row) => sum + row.totalCost, 0);
|
|
219825
|
+
const serviceTotal = serviceRows.reduce((sum, row) => sum + row.totalCost, 0);
|
|
219826
|
+
const totals = summary.summary;
|
|
219827
|
+
const periodLabel = t(`profileLlmUsage.${PERIOD_LABEL_KEYS[range]}`);
|
|
219828
|
+
const next = widerRange(range);
|
|
219829
|
+
const errorCopy = (error) => {
|
|
219830
|
+
if (error.kind === 'unavailable') {
|
|
219831
|
+
return {
|
|
219832
|
+
title: t('profileLlmUsage.errorUnavailableTitle'),
|
|
219833
|
+
body: t('profileLlmUsage.errorUnavailableBody'),
|
|
219834
|
+
};
|
|
219835
|
+
}
|
|
219836
|
+
if (error.kind === 'unauthorized') {
|
|
219837
|
+
return {
|
|
219838
|
+
title: t('profileLlmUsage.errorUnauthorizedTitle'),
|
|
219839
|
+
body: t('profileLlmUsage.errorUnauthorizedBody'),
|
|
219840
|
+
};
|
|
219841
|
+
}
|
|
219842
|
+
if (error.kind === 'forbidden' || error.kind === 'not_found') {
|
|
219843
|
+
return {
|
|
219844
|
+
title: t('profileLlmUsage.errorForbiddenTitle'),
|
|
219845
|
+
body: t('profileLlmUsage.errorForbiddenBody'),
|
|
219846
|
+
};
|
|
219847
|
+
}
|
|
219848
|
+
return {
|
|
219849
|
+
title: t('profileLlmUsage.errorUnknownTitle'),
|
|
219850
|
+
body: t('profileLlmUsage.errorUnknownBody'),
|
|
219851
|
+
};
|
|
219852
|
+
};
|
|
219853
|
+
const meta = activity.meta;
|
|
219854
|
+
const pageSize = (meta === null || meta === void 0 ? void 0 : meta.limit) || USER_LLM_RECENT_ACTIVITY_PAGE_SIZE;
|
|
219855
|
+
const from = meta && meta.totalItems > 0 ? (meta.page - 1) * pageSize + 1 : 0;
|
|
219856
|
+
const to = meta ? Math.min(meta.page * pageSize, meta.totalItems) : 0;
|
|
219857
|
+
const totalPages = (_a = meta === null || meta === void 0 ? void 0 : meta.totalPages) !== null && _a !== void 0 ? _a : 1;
|
|
219858
|
+
let body;
|
|
219859
|
+
if (summary.error) {
|
|
219860
|
+
const copy = errorCopy(summary.error);
|
|
219861
|
+
body = (jsx(StateMessage, { tone: "error", icon: jsx(CircleAlert, { className: "h-6 w-6" }), title: copy.title, body: copy.body, action: summary.error.kind !== 'unauthorized' && (jsx(Button$1, { onClick: refreshAll, className: "mt-1 bg-blue-600 text-white hover:bg-blue-700", children: t('profileLlmUsage.tryAgain') })) }));
|
|
219862
|
+
}
|
|
219863
|
+
else if (summary.isEmpty) {
|
|
219864
|
+
body = (jsx(StateMessage, { icon: jsx(Inbox, { className: "h-6 w-6" }), title: t('profileLlmUsage.emptyTitle'), body: t('profileLlmUsage.emptyBody'), action: next && (jsx(Button$1, { variant: "outline", onClick: () => changeRange(next), className: "mt-1", children: next === 'all_time'
|
|
219865
|
+
? t('profileLlmUsage.emptyActionAll')
|
|
219866
|
+
: t('profileLlmUsage.emptyAction90') })) }));
|
|
219867
|
+
}
|
|
219868
|
+
else {
|
|
219869
|
+
const loadingTotals = summary.isLoading || summary.isIdle;
|
|
219870
|
+
body = (jsxs(Fragment$1, { children: [jsxs("div", { className: "grid grid-cols-2 gap-3 xl:grid-cols-4", children: [jsx(StatTile, { label: t('profileLlmUsage.kpiSpend'), value: formatCost(totals === null || totals === void 0 ? void 0 : totals.totalCost), sub: periodLabel, loading: loadingTotals }), jsx(StatTile, { label: t('profileLlmUsage.kpiTokens'), value: formatCompact(totals === null || totals === void 0 ? void 0 : totals.totalTokens), sub: totals && totals.count > 0
|
|
219871
|
+
? t('profileLlmUsage.kpiTokensSub', {
|
|
219872
|
+
value: formatCompact(totals.totalTokens / totals.count),
|
|
219873
|
+
})
|
|
219874
|
+
: undefined, loading: loadingTotals }), jsx(StatTile, { label: t('profileLlmUsage.kpiRequests'), value: formatInteger(totals === null || totals === void 0 ? void 0 : totals.count), sub: t('profileLlmUsage.kpiRequestsSub'), loading: loadingTotals }), jsx(StatTile, { label: t('profileLlmUsage.kpiAvgCost'), value: totals && totals.count > 0
|
|
219875
|
+
? formatCost(totals.totalCost / totals.count, { precise: true })
|
|
219876
|
+
: '—', sub: t('profileLlmUsage.kpiAvgCostSub'), loading: loadingTotals })] }), jsx(Card, { title: t('profileLlmUsage.chartTitle'), subtitle: t(`profileLlmUsage.${CHART_SUBTITLE_KEYS[granularity]}`), aside: totals && (jsx("span", { className: "text-[15px] font-semibold tabular-nums text-gray-900 dark:text-gray-100", children: formatCost(totals.totalCost) })), bodyClassName: "pt-2", children: spend.isLoading || spend.isIdle ? (jsx(Skeleton, { className: "h-[220px] w-full" })) : spend.error ? (jsx(SectionError, {})) : series.length === 0 ? (jsx("p", { className: "py-10 text-center text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.chartNoData') })) : (jsx(SpendChart, { points: series, granularity: granularity })) }), jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [jsx(Card, { title: t('profileLlmUsage.byModelTitle'), subtitle: t('profileLlmUsage.byModelSubtitle'), children: byModel.isLoading || byModel.isIdle ? (jsx(BreakdownSkeleton, {})) : byModel.error ? (jsx(SectionError, {})) : modelRows.length === 0 ? (jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.breakdownEmpty') })) : (jsx(RankedBars, { rows: modelRows, total: modelTotal, colorFor: () => MODEL_BAR_COLOR })) }), jsx(Card, { title: t('profileLlmUsage.byServiceTitle'), subtitle: t('profileLlmUsage.byServiceSubtitle'), children: byService.isLoading || byService.isIdle ? (jsx(BreakdownSkeleton, {})) : byService.error ? (jsx(SectionError, {})) : serviceRows.length === 0 ? (jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.breakdownEmpty') })) : (jsx(RankedBars, { rows: serviceRows, total: serviceTotal,
|
|
219877
|
+
// Colour follows the service, so "chat" is the same hue everywhere.
|
|
219878
|
+
colorFor: (row) => (row.isOther ? '#9ca3af' : colorForSeries(row.key)) })) })] }), jsxs("section", { className: cn(CARD, 'overflow-hidden'), "aria-labelledby": "llm-activity-heading", children: [jsxs("div", { className: "border-b border-gray-200 px-5 py-4 dark:border-gray-800", children: [jsx("h4", { id: "llm-activity-heading", className: "text-[15px] font-semibold text-gray-900 dark:text-gray-100", children: t('profileLlmUsage.activityTitle') }), jsx("p", { className: "mt-0.5 text-[13px] text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.activitySubtitle') })] }), activity.isLoading || activity.isIdle ? (jsx("div", { className: "flex flex-col gap-3 p-5", children: [0, 1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-8 w-full" }, i))) })) : activity.error ? (jsx("div", { className: "p-5", children: jsx(SectionError, {}) })) : activity.isEmpty || activity.rows.length === 0 ? (jsx("p", { className: "p-5 text-sm text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.activityEmpty') })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full text-[13px]", children: [jsx("thead", { children: jsxs("tr", { className: "bg-gray-50 text-left text-gray-500 dark:bg-gray-900 dark:text-gray-400", children: [jsx("th", { scope: "col", className: "px-5 py-2.5 font-medium", children: t('profileLlmUsage.colWhen') }), jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: t('profileLlmUsage.colService') }), jsx("th", { scope: "col", className: "hidden px-3 py-2.5 font-medium md:table-cell", children: t('profileLlmUsage.colSession') }), jsx("th", { scope: "col", className: "px-3 py-2.5 text-right font-medium", children: t('profileLlmUsage.colLatency') }), jsx("th", { scope: "col", className: "px-3 py-2.5 text-right font-medium", children: t('profileLlmUsage.colCost') }), jsx("th", { scope: "col", className: "w-12 py-2.5 pl-2 pr-5", children: jsx("span", { className: "sr-only", children: t('profileLlmUsage.colDetails') }) })] }) }), jsx("tbody", { children: activity.rows.map((trace) => {
|
|
219879
|
+
const open = trace.id === openTraceId;
|
|
219880
|
+
const when = formatWhen(trace.timestamp);
|
|
219881
|
+
const service = trace.name || t('profileLlmUsage.unknownService');
|
|
219882
|
+
const stepsId = `llm-trace-${trace.id}-steps`;
|
|
219883
|
+
return (jsxs(Fragment$2, { children: [jsxs("tr", { className: cn('border-t border-gray-200 dark:border-gray-800', open && 'bg-gray-50 dark:bg-gray-900'), children: [jsx("td", { className: "whitespace-nowrap px-5 py-3 text-gray-900 dark:text-gray-100", children: when }), jsx("td", { className: "px-3 py-3", children: jsxs("span", { className: "inline-flex items-center gap-2 text-gray-700 dark:text-gray-300", children: [jsx("span", { className: "h-2 w-2 flex-shrink-0 rounded-[2px]", style: { background: colorForSeries(trace.name || '') }, "aria-hidden": "true" }), jsx("span", { className: "max-w-[16rem] truncate", title: service, children: service })] }) }), jsx("td", { className: "hidden px-3 py-3 font-mono text-xs text-gray-500 dark:text-gray-400 md:table-cell", title: trace.sessionId, children: shortId(trace.sessionId) }), jsx("td", { className: "px-3 py-3 text-right tabular-nums text-gray-700 dark:text-gray-300", children: formatSeconds(trace.latency) }), jsx("td", { className: "px-3 py-3 text-right font-semibold tabular-nums text-gray-900 dark:text-gray-100", children: formatCost(trace.totalCost, { precise: true }) }), jsx("td", { className: "py-2 pl-2 pr-5", children: jsx("button", { type: "button", "aria-expanded": open, "aria-controls": open ? stepsId : undefined, "aria-label": open
|
|
219884
|
+
? t('profileLlmUsage.hideSteps', { when })
|
|
219885
|
+
: t('profileLlmUsage.showSteps', { when }), onClick: () => setOpenTraceId(open ? null : trace.id), className: cn('flex h-8 w-8 items-center justify-center rounded-md transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500', open
|
|
219886
|
+
? 'bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-gray-100'
|
|
219887
|
+
: 'text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800'), children: open ? (jsx(ChevronDown, { className: "h-4 w-4", "aria-hidden": "true" })) : (jsx(ChevronRight, { className: "h-4 w-4", "aria-hidden": "true" })) }) })] }), open && (jsx("tr", { className: "bg-gray-50 dark:bg-gray-900", children: jsx("td", { colSpan: 6, className: "px-5 pb-4", children: jsx("div", { id: stepsId, className: "overflow-hidden rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-950", children: jsx(TraceSteps, { steps: steps.rows, isLoading: steps.isLoading, error: steps.error }) }) }) }))] }, trace.id));
|
|
219888
|
+
}) })] }) }), meta && (jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 border-t border-gray-200 px-5 py-3 dark:border-gray-800", children: [jsx("p", { className: "text-[13px] tabular-nums text-gray-500 dark:text-gray-400", children: t('profileLlmUsage.paginationSummary', {
|
|
219889
|
+
from: formatInteger(from),
|
|
219890
|
+
to: formatInteger(to),
|
|
219891
|
+
total: formatInteger(meta.totalItems),
|
|
219892
|
+
}) }), jsxs("div", { className: "flex gap-2", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 gap-1", disabled: page <= 1 || activity.isFetching, onClick: () => {
|
|
219893
|
+
setOpenTraceId(null);
|
|
219894
|
+
setPage((current) => Math.max(1, current - 1));
|
|
219895
|
+
}, children: [jsx(ChevronLeft, { className: "h-4 w-4", "aria-hidden": "true" }), t('profileLlmUsage.previous')] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 gap-1", disabled: page >= totalPages || activity.isFetching, onClick: () => {
|
|
219896
|
+
setOpenTraceId(null);
|
|
219897
|
+
setPage((current) => current + 1);
|
|
219898
|
+
}, children: [t('profileLlmUsage.next'), jsx(ChevronRight, { className: "h-4 w-4", "aria-hidden": "true" })] })] })] }))] }))] })] }));
|
|
219899
|
+
}
|
|
219900
|
+
const isRefreshing = summary.isFetching ||
|
|
219901
|
+
spend.isFetching ||
|
|
219902
|
+
byModel.isFetching ||
|
|
219903
|
+
byService.isFetching ||
|
|
219904
|
+
activity.isFetching;
|
|
219905
|
+
return (jsxs("div", { className: "flex flex-col gap-5", "data-testid": "llm-usage-tab", children: [jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [jsx(RangeControl, { value: range, onChange: changeRange }), jsxs("div", { className: "flex items-center gap-3", children: [jsxs("span", { className: "inline-flex items-center gap-1.5 text-[13px] text-gray-500 dark:text-gray-400", children: [jsx(Lock, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), isOwnProfile
|
|
219906
|
+
? t('profileLlmUsage.scopeSelf')
|
|
219907
|
+
: t('profileLlmUsage.scopeUser', { username })] }), jsx(Button$1, { variant: "outline", size: "icon", className: "h-9 w-9", onClick: refreshAll, disabled: isRefreshing, "aria-label": t('profileLlmUsage.refresh'), title: t('profileLlmUsage.refresh'), children: jsx(RefreshCw, { className: cn('h-4 w-4', isRefreshing && 'animate-spin'), "aria-hidden": "true" }) })] })] }), body] }));
|
|
219908
|
+
}
|
|
219909
|
+
|
|
219910
|
+
const tabId = (id, mobile) => (mobile ? `${id}-tab-mobile` : `${id}-tab`);
|
|
219911
|
+
/** Arrow/Home/End handling for the tab variant, with automatic activation. */
|
|
219912
|
+
function useTabKeyboard(items, onSelect, mobile) {
|
|
219913
|
+
const containerRef = useRef(null);
|
|
219914
|
+
const onKeyDown = (event, index) => {
|
|
219915
|
+
var _a, _b;
|
|
219916
|
+
const last = items.length - 1;
|
|
219917
|
+
let next = null;
|
|
219918
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowRight')
|
|
219919
|
+
next = index === last ? 0 : index + 1;
|
|
219920
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft')
|
|
219921
|
+
next = index === 0 ? last : index - 1;
|
|
219922
|
+
if (event.key === 'Home')
|
|
219923
|
+
next = 0;
|
|
219924
|
+
if (event.key === 'End')
|
|
219925
|
+
next = last;
|
|
219926
|
+
if (next === null)
|
|
219927
|
+
return;
|
|
219928
|
+
event.preventDefault();
|
|
219929
|
+
const target = items[next];
|
|
219930
|
+
onSelect(target.id);
|
|
219931
|
+
(_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[id="${tabId(target.id, mobile)}"]`)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
219932
|
+
};
|
|
219933
|
+
return { containerRef, onKeyDown };
|
|
219934
|
+
}
|
|
219935
|
+
/** Grouped vertical navigation for the desktop sidebar. */
|
|
219936
|
+
function SettingsSidebarNav({ groups, activeId, onSelect, variant, ariaLabel, }) {
|
|
219937
|
+
const visibleGroups = groups.filter((group) => group.items.length > 0);
|
|
219938
|
+
const flat = visibleGroups.flatMap((group) => group.items);
|
|
219939
|
+
const isTabs = variant === 'tabs';
|
|
219940
|
+
const { containerRef, onKeyDown } = useTabKeyboard(flat, onSelect, false);
|
|
219941
|
+
const renderItem = (item) => {
|
|
219942
|
+
const active = item.id === activeId;
|
|
219943
|
+
const Icon = item.icon;
|
|
219944
|
+
return (jsxs("button", { type: "button", onClick: () => onSelect(item.id), ...(isTabs
|
|
219945
|
+
? {
|
|
219946
|
+
role: 'tab',
|
|
219947
|
+
id: tabId(item.id, false),
|
|
219948
|
+
'aria-selected': active,
|
|
219949
|
+
'aria-controls': `${item.id}-tabpanel`,
|
|
219950
|
+
tabIndex: active ? 0 : -1,
|
|
219951
|
+
onKeyDown: (event) => onKeyDown(event, flat.indexOf(item)),
|
|
219952
|
+
}
|
|
219953
|
+
: { 'aria-current': active ? 'page' : undefined }), className: cn('group flex h-9 w-full items-center gap-2.5 rounded-lg px-2.5 text-left text-sm transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1', active
|
|
219954
|
+
? 'bg-white font-semibold text-gray-900 shadow-sm ring-1 ring-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:ring-gray-700'
|
|
219955
|
+
: 'font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100'), children: [jsx(Icon, { className: cn('h-4 w-4 flex-shrink-0', active
|
|
219956
|
+
? 'text-blue-600 dark:text-blue-400'
|
|
219957
|
+
: 'text-gray-500 group-hover:text-gray-700 dark:text-gray-400'), "aria-hidden": true }), jsx("span", { className: "truncate", children: item.label })] }, item.id));
|
|
219958
|
+
};
|
|
219959
|
+
return (jsx("nav", { className: "min-h-0 flex-1 overflow-y-auto px-3 py-4", "aria-label": ariaLabel, children: jsx("div", { ref: containerRef, className: "flex flex-col gap-4", ...(isTabs ? { role: 'tablist', 'aria-orientation': 'vertical' } : {}), children: visibleGroups.map((group) => (jsxs("div", { className: "flex flex-col gap-0.5", ...(isTabs
|
|
219960
|
+
? {}
|
|
219961
|
+
: { role: 'group', 'aria-labelledby': `settings-nav-group-${group.id}` }), children: [jsx("div", { id: `settings-nav-group-${group.id}`, className: "px-2.5 pb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", "aria-hidden": isTabs ? true : undefined, children: group.label }), group.items.map(renderItem)] }, group.id))) }) }));
|
|
219962
|
+
}
|
|
219963
|
+
/** Horizontally scrolling pills for small screens. */
|
|
219964
|
+
function SettingsMobileNav({ groups, activeId, onSelect, variant, ariaLabel, }) {
|
|
219965
|
+
const flat = groups.flatMap((group) => group.items);
|
|
219966
|
+
const isTabs = variant === 'tabs';
|
|
219967
|
+
const { containerRef, onKeyDown } = useTabKeyboard(flat, onSelect, true);
|
|
219968
|
+
return (jsx("nav", { className: "border-b border-gray-200 dark:border-gray-800 lg:hidden", "aria-label": ariaLabel, children: jsx("div", { ref: containerRef, className: "flex gap-2 overflow-x-auto px-4 py-2.5 [scrollbar-width:none] sm:px-6", ...(isTabs ? { role: 'tablist', 'aria-orientation': 'horizontal' } : {}), children: flat.map((item, index) => {
|
|
219969
|
+
const active = item.id === activeId;
|
|
219970
|
+
const Icon = item.icon;
|
|
219971
|
+
return (jsxs("button", { type: "button", onClick: () => onSelect(item.id), ...(isTabs
|
|
219972
|
+
? {
|
|
219973
|
+
role: 'tab',
|
|
219974
|
+
id: tabId(item.id, true),
|
|
219975
|
+
'aria-selected': active,
|
|
219976
|
+
'aria-controls': `${item.id}-tabpanel`,
|
|
219977
|
+
tabIndex: active ? 0 : -1,
|
|
219978
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
219979
|
+
}
|
|
219980
|
+
: { 'aria-current': active ? 'page' : undefined }), className: cn('flex h-9 flex-shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-3.5 text-sm transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1', active
|
|
219981
|
+
? 'bg-blue-600 font-semibold text-white dark:bg-blue-500 dark:text-white'
|
|
219982
|
+
: 'border border-gray-200 bg-white font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300'), children: [jsx(Icon, { className: "h-3.5 w-3.5", "aria-hidden": true }), jsx("span", { children: item.label })] }, item.id));
|
|
219983
|
+
}) }) }));
|
|
219984
|
+
}
|
|
219985
|
+
/** Small uppercase chip under the identity card (role, platform key). */
|
|
219986
|
+
function SettingsChip({ children, tone = 'neutral', icon: Icon, }) {
|
|
219987
|
+
return (jsxs("span", { className: cn('inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-semibold', tone === 'accent'
|
|
219988
|
+
? 'bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300'
|
|
219989
|
+
: 'bg-gray-100 text-gray-600 tracking-wide dark:bg-gray-800 dark:text-gray-300'), children: [Icon && jsx(Icon, { className: "h-3 w-3", "aria-hidden": true }), children] }));
|
|
219990
|
+
}
|
|
219991
|
+
function SettingsShell({ sidebarHeader, sidebarNav, mobileHeader, mobileNav, title, description, panelProps, footer, overlays, children, }) {
|
|
219992
|
+
const { className: panelClassName, ...restPanelProps } = panelProps !== null && panelProps !== void 0 ? panelProps : {};
|
|
219993
|
+
return (jsxs("div", { className: "flex h-full min-h-0 flex-col bg-white dark:bg-gray-950 lg:flex-row", children: [jsx("div", { className: "border-b border-gray-200 py-3 pl-4 pr-14 dark:border-gray-800 sm:pl-6 lg:hidden", children: mobileHeader }), mobileNav, jsxs("aside", { className: "hidden h-full w-[280px] flex-shrink-0 flex-col overflow-hidden border-r border-gray-200 bg-gray-50 dark:border-gray-800 dark:bg-gray-900 lg:flex", children: [jsx("div", { className: "flex-shrink-0 border-b border-gray-200 px-5 pb-4 pt-6 dark:border-gray-800", children: sidebarHeader }), sidebarNav] }), jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [jsxs("div", { className: "hidden flex-shrink-0 border-b border-gray-200 py-5 pl-8 pr-16 dark:border-gray-800 lg:block", children: [jsx("h3", { className: "text-xl font-semibold tracking-tight text-gray-900 dark:text-gray-100", children: title }), description && (jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: description }))] }), jsxs("div", { className: cn('min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-4 py-5 sm:px-6 lg:px-8 lg:py-6', panelClassName), ...restPanelProps, children: [jsxs("div", { className: "mb-5 lg:hidden", children: [jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: title }), description && (jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: description }))] }), children] }), footer && (jsx("div", { className: "flex-shrink-0 border-t border-gray-200 bg-white px-4 py-3 dark:border-gray-800 dark:bg-gray-950 sm:px-6 lg:px-8 lg:py-4", children: footer }))] }), overlays] }));
|
|
219994
|
+
}
|
|
219995
|
+
|
|
219035
219996
|
const COWORK_ENABLED_KEY = 'ibl_cowork_enabled';
|
|
219036
219997
|
/**
|
|
219037
219998
|
* Whether Cowork is enabled, read from localStorage. This is a user preference
|
|
@@ -219052,10 +220013,7 @@ function setCoworkEnabled(enabled) {
|
|
|
219052
220013
|
localStorage.setItem(COWORK_ENABLED_KEY, String(enabled));
|
|
219053
220014
|
}
|
|
219054
220015
|
|
|
219055
|
-
const
|
|
219056
|
-
return jsx(Icon, { ...props });
|
|
219057
|
-
};
|
|
219058
|
-
const TAB_DESC_KEYS = {
|
|
220016
|
+
const TAB_DESC_KEYS$1 = {
|
|
219059
220017
|
basic: 'descBasic',
|
|
219060
220018
|
social: 'descSocial',
|
|
219061
220019
|
education: 'descEducation',
|
|
@@ -219065,6 +220023,7 @@ const TAB_DESC_KEYS = {
|
|
|
219065
220023
|
memory: 'descMemory',
|
|
219066
220024
|
privacy: 'descPrivacy',
|
|
219067
220025
|
chatHistory: 'descChatHistory',
|
|
220026
|
+
llmUsage: 'descLlmUsage',
|
|
219068
220027
|
security: 'descSecurity',
|
|
219069
220028
|
advanced: 'descAdvanced',
|
|
219070
220029
|
};
|
|
@@ -219079,9 +220038,13 @@ const TAB_DESC_PREVIEW_KEYS = {
|
|
|
219079
220038
|
memory: 'descMemoryPreview',
|
|
219080
220039
|
privacy: 'descPrivacyPreview',
|
|
219081
220040
|
chatHistory: 'descChatHistoryPreview',
|
|
220041
|
+
llmUsage: 'descLlmUsagePreview',
|
|
219082
220042
|
};
|
|
219083
|
-
|
|
219084
|
-
|
|
220043
|
+
const LABEL_CLASS = 'text-sm font-medium text-gray-700 dark:text-gray-300';
|
|
220044
|
+
const FIELD_CLASS = 'h-10 w-full bg-white border-gray-300 text-sm text-gray-900 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100';
|
|
220045
|
+
const PRIMARY_BUTTON_CLASS = 'bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-500 disabled:bg-blue-600/60';
|
|
220046
|
+
function Profile({ tenant, username, tenants, onClose, customization = {}, isAdmin = false, targetTab = 'basic', onAccountDeleted, enableMemoryTab = false, showLlmUsageTab = true, localLLMProps, currentSPA = '', }) {
|
|
220047
|
+
var _a, _b, _c, _d, _e, _f;
|
|
219085
220048
|
const t = useT();
|
|
219086
220049
|
const { data: memsearchStatus, isError: isMemsearchStatusError } = useGetMemsearchStatusQuery({ org: tenant, userId: username }, { skip: !enableMemoryTab });
|
|
219087
220050
|
// Show memory tab if enabled for this platform AND memsearch is enabled (or status API is unavailable)
|
|
@@ -219100,34 +220063,46 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219100
220063
|
const rbacPermissions = useSelector(selectRbacPermissions);
|
|
219101
220064
|
const { currentTenant: viewerTenant } = useCurrentTenant();
|
|
219102
220065
|
const isChatHistoryVisible = !isReadOnly || canViewOtherUsersChatHistory(rbacPermissions, viewerTenant);
|
|
219103
|
-
|
|
219104
|
-
|
|
219105
|
-
|
|
220066
|
+
// Usage is always read for the profile on screen, so it works while
|
|
220067
|
+
// previewing someone else too — the backend decides whether this viewer may
|
|
220068
|
+
// see their rows, and answers 403 when they may not. A pure watcher (the
|
|
220069
|
+
// `/watchedgroups/#list` permission without tenant admin) is kept out of
|
|
220070
|
+
// cost reporting entirely, the same way the analytics tabs exclude them.
|
|
220071
|
+
const isLlmUsageVisible = showLlmUsageTab && !isPureWatcher(rbacPermissions, viewerTenant);
|
|
220072
|
+
// Add Advanced tab only when in Tauri app (Local Models is provided and available)
|
|
220073
|
+
const isAdvancedAvailable = (localLLMProps === null || localLLMProps === void 0 ? void 0 : localLLMProps.isAvailable) === true;
|
|
220074
|
+
const TABS = [
|
|
220075
|
+
{ id: 'basic', label: t('profileIndex.tabBasic'), icon: User, group: 'profile' },
|
|
220076
|
+
{ id: 'social', label: t('profileIndex.tabSocial'), icon: Globe, group: 'profile' },
|
|
219106
220077
|
...(isGradebookEnabled
|
|
219107
220078
|
? [
|
|
219108
220079
|
{
|
|
219109
220080
|
id: 'gradebook',
|
|
219110
220081
|
label: t('profileIndex.tabGradebook'),
|
|
219111
|
-
|
|
220082
|
+
icon: GraduationCap,
|
|
220083
|
+
group: 'records',
|
|
219112
220084
|
},
|
|
219113
220085
|
]
|
|
219114
220086
|
: []),
|
|
219115
220087
|
{
|
|
219116
220088
|
id: 'education',
|
|
219117
220089
|
label: t('profileIndex.tabEducation'),
|
|
219118
|
-
|
|
220090
|
+
icon: BookOpen,
|
|
220091
|
+
group: 'records',
|
|
219119
220092
|
},
|
|
219120
220093
|
{
|
|
219121
220094
|
id: 'experience',
|
|
219122
220095
|
label: t('profileIndex.tabExperience'),
|
|
219123
|
-
|
|
220096
|
+
icon: Briefcase,
|
|
220097
|
+
group: 'records',
|
|
219124
220098
|
},
|
|
219125
220099
|
...(isPurchasesEnabled
|
|
219126
220100
|
? [
|
|
219127
220101
|
{
|
|
219128
220102
|
id: 'purchases',
|
|
219129
220103
|
label: t('profileIndex.tabPurchases'),
|
|
219130
|
-
|
|
220104
|
+
icon: ShoppingBag,
|
|
220105
|
+
group: 'records',
|
|
219131
220106
|
},
|
|
219132
220107
|
]
|
|
219133
220108
|
: []),
|
|
@@ -219136,20 +220111,23 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219136
220111
|
{
|
|
219137
220112
|
id: 'memory',
|
|
219138
220113
|
label: t('profileIndex.tabMemory'),
|
|
219139
|
-
|
|
220114
|
+
icon: Archive,
|
|
220115
|
+
group: 'aiData',
|
|
219140
220116
|
},
|
|
219141
220117
|
]
|
|
219142
220118
|
: []),
|
|
219143
220119
|
// id stays as 'privacy' so callers passing `targetTab='privacy'` and
|
|
219144
220120
|
// any test selectors targeting #panel-privacy keep working. The
|
|
219145
220121
|
// user-visible `label` is "Privacy"; the chat-privacy feature itself
|
|
219146
|
-
// is still called "Private Mode" within the tab's content.
|
|
220122
|
+
// is still called "Private Mode" within the tab's content. It sits with
|
|
220123
|
+
// the account controls, just above Security.
|
|
219147
220124
|
...(isChatPrivacyEnabled
|
|
219148
220125
|
? [
|
|
219149
220126
|
{
|
|
219150
220127
|
id: 'privacy',
|
|
219151
220128
|
label: t('profileIndex.tabPrivacy'),
|
|
219152
|
-
|
|
220129
|
+
icon: Lock,
|
|
220130
|
+
group: 'account',
|
|
219153
220131
|
},
|
|
219154
220132
|
]
|
|
219155
220133
|
: []),
|
|
@@ -219158,7 +220136,18 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219158
220136
|
{
|
|
219159
220137
|
id: 'chatHistory',
|
|
219160
220138
|
label: t('profileIndex.tabChatHistory'),
|
|
219161
|
-
|
|
220139
|
+
icon: History,
|
|
220140
|
+
group: 'aiData',
|
|
220141
|
+
},
|
|
220142
|
+
]
|
|
220143
|
+
: []),
|
|
220144
|
+
...(isLlmUsageVisible
|
|
220145
|
+
? [
|
|
220146
|
+
{
|
|
220147
|
+
id: 'llmUsage',
|
|
220148
|
+
label: t('profileIndex.tabLlmUsage'),
|
|
220149
|
+
icon: Gauge,
|
|
220150
|
+
group: 'aiData',
|
|
219162
220151
|
},
|
|
219163
220152
|
]
|
|
219164
220153
|
: []),
|
|
@@ -219167,24 +220156,33 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219167
220156
|
{
|
|
219168
220157
|
id: 'security',
|
|
219169
220158
|
label: t('profileIndex.tabSecurity'),
|
|
219170
|
-
|
|
220159
|
+
icon: Shield,
|
|
220160
|
+
group: 'account',
|
|
220161
|
+
},
|
|
220162
|
+
]
|
|
220163
|
+
: []),
|
|
220164
|
+
...(isAdvancedAvailable
|
|
220165
|
+
? [
|
|
220166
|
+
{
|
|
220167
|
+
id: 'advanced',
|
|
220168
|
+
label: t('profileIndex.tabAdvanced'),
|
|
220169
|
+
icon: Settings$1,
|
|
220170
|
+
group: 'account',
|
|
219171
220171
|
},
|
|
219172
220172
|
]
|
|
219173
220173
|
: []),
|
|
219174
220174
|
];
|
|
219175
|
-
|
|
219176
|
-
|
|
219177
|
-
|
|
219178
|
-
|
|
219179
|
-
|
|
219180
|
-
|
|
219181
|
-
|
|
219182
|
-
|
|
219183
|
-
|
|
219184
|
-
|
|
219185
|
-
|
|
219186
|
-
: baseTabs;
|
|
219187
|
-
const RoleIcon = renderLucideIcon(User);
|
|
220175
|
+
const GROUP_LABELS = {
|
|
220176
|
+
profile: t('profileIndex.groupProfile'),
|
|
220177
|
+
records: t('profileIndex.groupRecords'),
|
|
220178
|
+
aiData: t('profileIndex.groupAiData'),
|
|
220179
|
+
account: t('profileIndex.groupAccount'),
|
|
220180
|
+
};
|
|
220181
|
+
const navGroups = Object.keys(GROUP_LABELS).map((group) => ({
|
|
220182
|
+
id: group,
|
|
220183
|
+
label: GROUP_LABELS[group],
|
|
220184
|
+
items: TABS.filter((tab) => tab.group === group),
|
|
220185
|
+
}));
|
|
219188
220186
|
const [activeTab, setActiveTab] = useState(targetTab);
|
|
219189
220187
|
const [isHovering, setIsHovering] = useState(false);
|
|
219190
220188
|
const fileInputRef = useRef(null);
|
|
@@ -219206,8 +220204,7 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219206
220204
|
};
|
|
219207
220205
|
// The picture itself, with no editing affordance around it. The wrapper
|
|
219208
220206
|
// below decides whether it is clickable.
|
|
219209
|
-
const profileAvatar = (jsxs(Avatar, { className: "h-
|
|
219210
|
-
!((_d = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _d === void 0 ? void 0 : _d.image_url_full)
|
|
220207
|
+
const profileAvatar = (jsxs(Avatar, { className: "h-14 w-14", children: [((_b = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _b === void 0 ? void 0 : _b.has_image) ? (jsx(AvatarImage, { src: (_c = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _c === void 0 ? void 0 : _c.image_url_full, alt: t('profileIndex.altProfilePicture'), className: "rounded-full object-cover w-full h-full group-hover:opacity-80 transition-opacity" })) : customization.useGravatarPicFallback ? (jsx(Gravatar, { className: "w-full h-full rounded-full object-cover group-hover:opacity-80 transition-opacity", email: userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email, size: 56, alt: t('profileIndex.altProfilePictureGravatar') })) : (jsx(Fragment$1, {})), jsx(AvatarFallback, { className: cn('bg-blue-800 text-white text-lg font-semibold rounded-full', customization.useGravatarPicFallback && !((_d = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _d === void 0 ? void 0 : _d.image_url_full)
|
|
219211
220208
|
? 'hidden'
|
|
219212
220209
|
: ''), children: getInitials((userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '') })] }));
|
|
219213
220210
|
const handleFileUpload = (event) => {
|
|
@@ -219252,115 +220249,122 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
219252
220249
|
// Rendered inline on the sub-tabs row (education/experience/resume), pushed to
|
|
219253
220250
|
// the far right. `headerAdd` already encodes which sub-tab is active, so this
|
|
219254
220251
|
// only appears on the sub-tabs that support adding/uploading.
|
|
219255
|
-
const headerAddButton = headerAdd && (
|
|
220252
|
+
const headerAddButton = headerAdd && (jsxs(Button$1, { size: "sm", onClick: headerAdd.onClick, className: cn('h-9 flex-shrink-0 gap-1.5 px-3', PRIMARY_BUTTON_CLASS), "aria-label": headerAdd.ariaLabel, children: [headerAdd.upload ? (jsx(Upload, { className: "h-4 w-4", "aria-hidden": "true" })) : (jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" })), jsx("span", { className: "hidden sm:inline", children: headerAdd.ariaLabel })] }));
|
|
219256
220253
|
const tabDescription = (id) => {
|
|
219257
|
-
const key = (isReadOnly && TAB_DESC_PREVIEW_KEYS[id]) || TAB_DESC_KEYS[id];
|
|
220254
|
+
const key = (isReadOnly && TAB_DESC_PREVIEW_KEYS[id]) || TAB_DESC_KEYS$1[id];
|
|
219258
220255
|
return key ? t(`profileIndex.${key}`) : '';
|
|
219259
220256
|
};
|
|
219260
|
-
|
|
219261
|
-
|
|
219262
|
-
|
|
219263
|
-
|
|
219264
|
-
|
|
219265
|
-
|
|
219266
|
-
|
|
219267
|
-
|
|
219268
|
-
|
|
219269
|
-
|
|
219270
|
-
|
|
219271
|
-
|
|
219272
|
-
|
|
219273
|
-
|
|
219274
|
-
|
|
219275
|
-
|
|
219276
|
-
|
|
219277
|
-
|
|
219278
|
-
|
|
219279
|
-
|
|
219280
|
-
|
|
219281
|
-
|
|
219282
|
-
|
|
219283
|
-
|
|
219284
|
-
|
|
219285
|
-
|
|
219286
|
-
|
|
219287
|
-
|
|
219288
|
-
|
|
219289
|
-
|
|
219290
|
-
|
|
219291
|
-
|
|
219292
|
-
|
|
219293
|
-
|
|
219294
|
-
|
|
219295
|
-
|
|
219296
|
-
|
|
219297
|
-
|
|
219298
|
-
|
|
219299
|
-
|
|
219300
|
-
|
|
219301
|
-
|
|
219302
|
-
|
|
219303
|
-
|
|
219304
|
-
|
|
219305
|
-
|
|
219306
|
-
|
|
219307
|
-
|
|
219308
|
-
|
|
219309
|
-
|
|
219310
|
-
|
|
219311
|
-
|
|
219312
|
-
|
|
219313
|
-
|
|
219314
|
-
|
|
219315
|
-
|
|
219316
|
-
|
|
219317
|
-
|
|
219318
|
-
|
|
219319
|
-
|
|
219320
|
-
|
|
219321
|
-
|
|
219322
|
-
|
|
219323
|
-
|
|
219324
|
-
|
|
219325
|
-
|
|
219326
|
-
|
|
219327
|
-
|
|
219328
|
-
|
|
219329
|
-
|
|
219330
|
-
|
|
219331
|
-
|
|
219332
|
-
|
|
219333
|
-
|
|
219334
|
-
|
|
219335
|
-
|
|
219336
|
-
|
|
219337
|
-
|
|
219338
|
-
|
|
219339
|
-
|
|
219340
|
-
|
|
219341
|
-
|
|
219342
|
-
|
|
219343
|
-
|
|
219344
|
-
|
|
219345
|
-
|
|
219346
|
-
|
|
219347
|
-
|
|
219348
|
-
|
|
219349
|
-
|
|
219350
|
-
|
|
219351
|
-
|
|
219352
|
-
|
|
219353
|
-
|
|
219354
|
-
|
|
219355
|
-
|
|
219356
|
-
|
|
219357
|
-
|
|
219358
|
-
|
|
219359
|
-
|
|
219360
|
-
|
|
219361
|
-
|
|
219362
|
-
|
|
219363
|
-
|
|
220257
|
+
const email = (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '';
|
|
220258
|
+
const displayName = (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || email;
|
|
220259
|
+
const roleChip = (jsx(SettingsChip, { tone: "accent", icon: User, children: isAdmin ? t('profileIndex.roleAdmin') : t('profileIndex.roleUser') }));
|
|
220260
|
+
const platformChip = customization.showPlatformName ? (jsx(SettingsChip, { children: tenant.toUpperCase() })) : null;
|
|
220261
|
+
const avatarBlock = isUserMetadataEdxLoading || isUploadingProfileImage ? (jsx(Skeleton, { className: "h-14 w-14 flex-shrink-0 rounded-full", "aria-label": t('profileIndex.ariaLoadingProfileImage') })) : isReadOnly ? (
|
|
220262
|
+
// Someone else's profile: show the picture, offer no way to replace it.
|
|
220263
|
+
jsx("div", { className: "relative h-14 w-14 flex-shrink-0 rounded-full", children: profileAvatar })) : (jsxs("button", { type: "button", className: "group relative h-14 w-14 flex-shrink-0 cursor-pointer rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2", onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), onClick: handleAvatarClick, "aria-label": t('profileIndex.ariaUploadProfilePicture'), children: [profileAvatar, isHovering && (jsx("div", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-blue-900/80", "aria-hidden": "true", children: jsx("span", { className: "px-1 text-center text-[11px] font-semibold text-white", children: t('profileIndex.uploadOverlay') }) })), jsx("span", { className: "absolute -bottom-0.5 -right-0.5 flex h-6 w-6 items-center justify-center rounded-full border border-gray-200 bg-white text-gray-700 shadow-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200", "aria-hidden": "true", children: jsx(Camera, { className: "h-3 w-3" }) }), jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileUpload, className: "hidden", "aria-label": t('profileIndex.ariaChooseProfilePicture'), tabIndex: -1 })] }));
|
|
220264
|
+
const sidebarHeader = (jsxs("div", { className: "flex flex-col gap-3", children: [jsxs("div", { className: "flex items-center gap-3", children: [avatarBlock, jsxs("div", { className: "min-w-0 space-y-1", children: [jsx("h2", { className: "truncate text-[15px] font-semibold text-gray-900 dark:text-gray-100", title: displayName, children: displayName }), jsxs("div", { className: "flex flex-wrap gap-1.5", children: [roleChip, platformChip] })] })] }), email && email !== displayName && (jsx("p", { className: "break-all text-[13px] leading-snug text-gray-500 dark:text-gray-400", title: email, children: email }))] }));
|
|
220265
|
+
// Name only: the email already sits in the sidebar card, which small
|
|
220266
|
+
// screens hide, and the dialog title covers the rest.
|
|
220267
|
+
const mobileHeader = (jsx("p", { className: "truncate text-[15px] font-semibold text-gray-900 dark:text-gray-100", children: (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || t('profileIndex.profileHeading') }));
|
|
220268
|
+
const isBusyBasic = basicForm.state.isSubmitting || isUserMetadataLoading || isReadOnly;
|
|
220269
|
+
const footer = !isReadOnly && ['basic', 'social'].includes(activeTab) ? (jsxs("div", { className: "flex justify-end gap-3", children: [jsx(Button$1, { onClick: onClose, variant: "outline", className: "h-10 px-4", children: t('profileIndex.buttonCancel') }), jsx(Button$1, { onClick: () => {
|
|
220270
|
+
if (activeTab === 'basic') {
|
|
220271
|
+
basicForm.handleSubmit();
|
|
220272
|
+
}
|
|
220273
|
+
else if (activeTab === 'social') {
|
|
220274
|
+
socialForm.handleSubmit();
|
|
220275
|
+
}
|
|
220276
|
+
}, className: cn('h-10 px-5', PRIMARY_BUTTON_CLASS), disabled: (activeTab === 'basic' && (basicForm.state.isSubmitting || isUserMetadataLoading)) ||
|
|
220277
|
+
(activeTab === 'social' && socialForm.state.isSubmitting), children: (activeTab === 'basic' && basicForm.state.isSubmitting) ||
|
|
220278
|
+
(activeTab === 'social' && socialForm.state.isSubmitting)
|
|
220279
|
+
? t('profileIndex.buttonSaving')
|
|
220280
|
+
: t('profileIndex.buttonSaveChanges') })] })) : null;
|
|
220281
|
+
const socialField = ({ id, name, label, placeholder, prefix, badge, validator, }) => (jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: id, className: LABEL_CLASS, children: label }), socialForm.Field({
|
|
220282
|
+
name,
|
|
220283
|
+
validators: {
|
|
220284
|
+
onChange: validator,
|
|
220285
|
+
},
|
|
220286
|
+
children: (field) => {
|
|
220287
|
+
var _a;
|
|
220288
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "relative mb-0", children: [jsx("div", { className: "pointer-events-none absolute inset-y-0 left-2 flex items-center", "aria-hidden": "true", children: jsx("div", { className: cn('flex h-7 w-7 items-center justify-center rounded-md text-white', badge.className), children: jsx("span", { className: cn('font-bold', badge.textClassName), children: badge.text }) }) }), jsx(Input, { id: id, className: cn(FIELD_CLASS, 'pl-12'), placeholder: placeholder, value: field.state.value, onChange: (e) => handleSocialLinkChange(e.target.value, field.handleChange, prefix), disabled: socialForm.state.isSubmitting || isReadOnly })] }), jsx("p", { className: "text-sm text-red-600 dark:text-red-400", role: ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) ? 'alert' : undefined, "aria-live": "polite", children: field.state.meta.errors })] }));
|
|
220289
|
+
},
|
|
220290
|
+
})] }));
|
|
220291
|
+
return (jsxs(SettingsShell, { sidebarHeader: sidebarHeader, sidebarNav: jsx(SettingsSidebarNav, { groups: navGroups, activeId: activeTab, onSelect: setActiveTab, variant: "tabs", ariaLabel: t('profileIndex.ariaProfileTabs') }), mobileHeader: mobileHeader, mobileNav: jsx(SettingsMobileNav, { groups: navGroups, activeId: activeTab, onSelect: setActiveTab, variant: "tabs", ariaLabel: t('profileIndex.ariaProfileTabsMobile') }),
|
|
220292
|
+
// Render the tab's label rather than the id — every label is already
|
|
220293
|
+
// cased correctly.
|
|
220294
|
+
title: (_f = (_e = TABS.find((tab) => tab.id === activeTab)) === null || _e === void 0 ? void 0 : _e.label) !== null && _f !== void 0 ? _f : activeTab, description: tabDescription(activeTab), panelProps: {
|
|
220295
|
+
role: 'tabpanel',
|
|
220296
|
+
id: `${activeTab}-tabpanel`,
|
|
220297
|
+
'aria-labelledby': `${activeTab}-tab`,
|
|
220298
|
+
tabIndex: 0,
|
|
220299
|
+
}, footer: footer, overlays: jsxs(Fragment$1, { children: [jsx(EducationDialog, { open: isEducationDialogOpen, onOpenChange: setIsEducationDialogOpen, education: undefined, org: tenant, username: username, onComplete: () => {
|
|
220300
|
+
// The education tab will handle refetching
|
|
220301
|
+
} }), jsx(ExperienceDialog, { open: isExperienceDialogOpen, onOpenChange: setIsExperienceDialogOpen, experience: undefined, org: tenant, username: username, onComplete: () => {
|
|
220302
|
+
// The experience tab will handle refetching
|
|
220303
|
+
} }), jsx(ToastProvider, {})] }), children: [activeTab === 'basic' && (jsxs("form", { onSubmit: (formEvent) => {
|
|
220304
|
+
formEvent.preventDefault();
|
|
220305
|
+
formEvent.stopPropagation();
|
|
220306
|
+
if (isReadOnly)
|
|
220307
|
+
return;
|
|
220308
|
+
basicForm.handleSubmit();
|
|
220309
|
+
}, className: "max-w-3xl space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 gap-x-5 gap-y-5 md:grid-cols-2", children: [jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: "fullName", className: LABEL_CLASS, children: t('profileIndex.labelFullName') }), basicForm.Field({
|
|
220310
|
+
name: 'fullName',
|
|
220311
|
+
validators: {
|
|
220312
|
+
onChange: basicValidators.fullName,
|
|
220313
|
+
onSubmit: basicValidators.fullName,
|
|
220314
|
+
},
|
|
220315
|
+
children: (field) => {
|
|
220316
|
+
var _a;
|
|
220317
|
+
return (jsxs(Fragment$1, { children: [jsx(Input, { id: "fullName", className: FIELD_CLASS, value: field.state.value, onChange: (e) => field.handleChange(e.target.value), disabled: isBusyBasic }), ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) > 0 && (jsx("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", role: "alert", children: field.state.meta.errors }))] }));
|
|
220318
|
+
},
|
|
220319
|
+
})] }), jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: "email", className: LABEL_CLASS, children: t('profileIndex.labelEmail') }), basicForm.Field({
|
|
220320
|
+
name: 'email',
|
|
220321
|
+
children: (field) => (jsx(Input, { id: "email", type: "email", className: FIELD_CLASS, value: field.state.value, onChange: (e) => field.handleChange(e.target.value), disabled: isBusyBasic })),
|
|
220322
|
+
})] }), customization.showUsernameField && (jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: "username", className: LABEL_CLASS, children: t('profileIndex.labelUsername') }), basicForm.Field({
|
|
220323
|
+
name: 'username',
|
|
220324
|
+
children: (field) => (jsx(Input, { id: "username", className: FIELD_CLASS, value: field.state.value, onChange: (e) => field.handleChange(e.target.value), disabled: isBusyBasic })),
|
|
220325
|
+
})] })), jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: "title", className: LABEL_CLASS, children: t('profileIndex.labelTitle') }), basicForm.Field({
|
|
220326
|
+
name: 'title',
|
|
220327
|
+
children: (field) => (jsx(Input, { id: "title", className: FIELD_CLASS, value: field.state.value, onChange: (e) => field.handleChange(e.target.value), disabled: isBusyBasic })),
|
|
220328
|
+
})] }), jsxs("div", { className: "space-y-1.5", children: [jsx("label", { htmlFor: "language", className: LABEL_CLASS, children: t('profileIndex.labelLanguage') }), basicForm.Field({
|
|
220329
|
+
name: 'language',
|
|
220330
|
+
children: (field) => (jsxs(Select$1, { defaultValue: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: isBusyBasic, children: [jsx(SelectTrigger, { id: "language", className: FIELD_CLASS, "aria-label": t('profileIndex.selectLanguagePlaceholder'), children: jsx(SelectValue, { placeholder: t('profileIndex.selectLanguagePlaceholder') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "en", children: t('profileIndex.langEnglish') }), jsx(SelectItem, { value: "es", children: t('profileIndex.langSpanish') }), jsx(SelectItem, { value: "fr", children: t('profileIndex.langFrench') })] })] })),
|
|
220331
|
+
})] }), jsxs("div", { className: "space-y-1.5 md:col-span-2", children: [jsx("label", { htmlFor: "about", className: LABEL_CLASS, children: t('profileIndex.labelAbout') }), basicForm.Field({
|
|
220332
|
+
name: 'about',
|
|
220333
|
+
children: (field) => (jsx(Textarea, { id: "about", placeholder: t('profileIndex.placeholderAbout'), className: cn(FIELD_CLASS, 'h-auto resize-none py-2.5 leading-relaxed'), rows: 4, value: field.state.value, onChange: (e) => field.handleChange(e.target.value), disabled: isBusyBasic })),
|
|
220334
|
+
})] })] }), customization.showMentorAIDisplayCheckbox && (jsxs("section", { className: "space-y-2.5", "aria-labelledby": "profile-features-heading", children: [jsx("h4", { id: "profile-features-heading", className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: t('profileIndex.sectionFeatures') }), jsx("div", { className: "divide-y divide-gray-200 rounded-xl border border-gray-200 dark:divide-gray-800 dark:border-gray-800", children: jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3.5", children: [jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [jsx("label", { htmlFor: "display-mentor", className: "text-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-gray-300", children: t('profileIndex.checkboxDisplayMentorAI') }), jsx(CardInfoIcon, { description: t('profileIndex.tooltipDisplayMentorAI') })] }), basicForm.Field({
|
|
220335
|
+
name: 'displayMentor',
|
|
220336
|
+
children: (field) => (jsx(Switch, { className: "data-[state=checked]:bg-blue-600", onCheckedChange: (checked) => field.handleChange(checked), checked: field.state.value, disabled: isBusyBasic, id: "display-mentor" })),
|
|
220337
|
+
})] }) })] }))] })), activeTab === 'social' && (jsxs("form", { className: "max-w-2xl space-y-5", onSubmit: (formEvent) => {
|
|
220338
|
+
formEvent.preventDefault();
|
|
220339
|
+
formEvent.stopPropagation();
|
|
220340
|
+
if (isReadOnly)
|
|
220341
|
+
return;
|
|
220342
|
+
socialForm.handleSubmit();
|
|
220343
|
+
}, children: [socialField({
|
|
220344
|
+
id: 'facebook',
|
|
220345
|
+
name: 'facebook',
|
|
220346
|
+
label: t('profileIndex.labelFacebook'),
|
|
220347
|
+
placeholder: t('profileIndex.placeholderFacebook'),
|
|
220348
|
+
prefix: FACEBOOK_URL_PREFIX,
|
|
220349
|
+
badge: { className: 'bg-[#1877F2]', text: 'f', textClassName: 'text-sm' },
|
|
220350
|
+
validator: socialValidators.facebook,
|
|
220351
|
+
}), socialField({
|
|
220352
|
+
id: 'linkedin',
|
|
220353
|
+
name: 'linkedIn',
|
|
220354
|
+
label: t('profileIndex.labelLinkedIn'),
|
|
220355
|
+
placeholder: t('profileIndex.placeholderLinkedIn'),
|
|
220356
|
+
prefix: LINKEDIN_URL_PREFIX,
|
|
220357
|
+
badge: { className: 'bg-[#0A66C2]', text: 'in', textClassName: 'text-xs' },
|
|
220358
|
+
validator: socialValidators.linkedIn,
|
|
220359
|
+
}), socialField({
|
|
220360
|
+
id: 'x',
|
|
220361
|
+
name: 'x',
|
|
220362
|
+
label: t('profileIndex.labelX'),
|
|
220363
|
+
placeholder: t('profileIndex.placeholderX'),
|
|
220364
|
+
prefix: X_URL_PREFIX,
|
|
220365
|
+
badge: { className: 'bg-black', text: 'X', textClassName: 'text-sm' },
|
|
220366
|
+
validator: socialValidators.x,
|
|
220367
|
+
})] })), activeTab === 'education' && (jsxs(Tabs, { value: educationSubTab, onValueChange: setEducationSubTab, className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxs(TabsList, { children: [jsx(TabsTrigger, { value: "education", children: t('profileIndex.tabEducation') }), jsx(TabsTrigger, { value: "credentials", children: t('gradebookGradebookTab.typeCredentials') }), jsx(TabsTrigger, { value: "skills", children: t('gradebookGradebookTab.typeSkills') })] }), headerAddButton] }), jsx(TabsContent, { value: "education", children: jsx(EducationTab, { org: tenant, username: username }) }), jsx(TabsContent, { value: "credentials", children: jsx(CredentialsList, { org: tenant, username: username }) }), jsx(TabsContent, { value: "skills", children: jsx(SkillsList, { org: tenant, username: username }) })] })), activeTab === 'gradebook' && jsx(GradebookTab, { org: tenant, username: username }), activeTab === 'experience' && (jsxs(Tabs, { value: experienceSubTab, onValueChange: setExperienceSubTab, className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsxs(TabsList, { children: [jsx(TabsTrigger, { value: "experience", children: t('profileIndex.tabExperience') }), jsx(TabsTrigger, { value: "resume", children: t('profileIndex.tabResume') })] }), headerAddButton] }), jsx(TabsContent, { value: "experience", children: jsx(ExperienceTab, { org: tenant, username: username }) }), jsx(TabsContent, { value: "resume", children: jsx(ResumeTab, { org: tenant, username: username }) })] })), activeTab === 'purchases' && jsx(PurchasesTab, { org: tenant, username: username }), activeTab === 'memory' && jsx(MemoryTab, { org: tenant, username: username }), activeTab === 'privacy' && jsx(ChatPrivacyTab, { org: tenant, username: username }), isChatHistoryVisible && activeTab === 'chatHistory' && (jsx(ChatHistoryTab, { org: tenant, username: username })), isLlmUsageVisible && activeTab === 'llmUsage' && (jsx(LlmUsageTab, { org: tenant, username: username, isOwnProfile: !isReadOnly })), !isReadOnly && activeTab === 'security' && (jsx(Security, { app: currentSPA || '', email: (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '', platformKey: tenant, onAccountDeleted: onAccountDeleted })), activeTab === 'advanced' && localLLMProps && (jsx("div", { className: "space-y-6", children: jsx(LocalModelsContent, { isAvailable: localLLMProps.isAvailable, state: localLLMProps.state, ollamaStatus: localLLMProps.ollamaStatus, systemMemory: localLLMProps.systemMemory, isUsingFoundry: localLLMProps.isUsingFoundry, foundryModels: localLLMProps.foundryModels, selectedFoundryModel: localLLMProps.selectedFoundryModel, foundryStatus: localLLMProps.foundryStatus, onStartDownload: localLLMProps.onStartDownload, onCancelDownload: localLLMProps.onCancelDownload, onInstallOllama: localLLMProps.onInstallOllama, onStopManager: localLLMProps.onStopManager, onInstallFoundry: localLLMProps.onInstallFoundry, onCheckStatus: localLLMProps.onCheckStatus, onResetState: localLLMProps.onResetState, onSelectFoundryModel: localLLMProps.onSelectFoundryModel }) }))] }));
|
|
219364
220368
|
}
|
|
219365
220369
|
|
|
219366
220370
|
function CSVEditor({ csvData, onSave, onCancel }) {
|
|
@@ -226898,19 +227902,6 @@ function AddCreditsModal({ isOpen, onClose, tenant }) {
|
|
|
226898
227902
|
return (jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent, { className: "max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: t('profileAddCreditsModal.title') }), jsx(DialogDescription, { children: t('profileAddCreditsModal.description') })] }), jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "credit-amount", className: "text-sm font-medium", children: t('profileAddCreditsModal.amountLabel') }), jsxs("div", { className: "relative", children: [jsx(DollarSign, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400" }), jsx(Input, { id: "credit-amount", type: "number", min: "0.01", step: "0.01", placeholder: "50.00", value: amount, onChange: (e) => setAmount(e.target.value), className: "pl-9" })] }), jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: t('profileAddCreditsModal.amountHint') })] }), jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-100 dark:border-blue-800", children: [jsx(CircleAlert, { className: "h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0" }), jsx("p", { className: "text-xs text-blue-700 dark:text-blue-300", children: t('profileAddCreditsModal.paymentMethodNotice') })] }), jsxs(DialogFooter, { className: "gap-2 sm:gap-0", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: handleClose, children: t('profileAddCreditsModal.cancel') }), jsx(Button$1, { type: "submit", disabled: isLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: isLoading ? (jsxs(Fragment$1, { children: [jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }), t('profileAddCreditsModal.processing')] })) : (t('profileAddCreditsModal.addCredits')) })] })] })] }) }));
|
|
226899
227903
|
}
|
|
226900
227904
|
|
|
226901
|
-
/**
|
|
226902
|
-
* The info icon that sits on every analytics card and, on hover or keyboard
|
|
226903
|
-
* focus, explains what the card measures. The description doubles as the
|
|
226904
|
-
* accessible name so screen readers get it without needing the hover.
|
|
226905
|
-
*
|
|
226906
|
-
* Uses the tooltip primitives directly rather than the shared `TooltipContent`
|
|
226907
|
-
* because analytics wants a light popover, while `TooltipContent` is the dark
|
|
226908
|
-
* `bg-primary` style the rest of the app relies on.
|
|
226909
|
-
*/
|
|
226910
|
-
function CardInfoIcon({ title, description, className }) {
|
|
226911
|
-
return (jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("button", { type: "button", "aria-label": description, className: cn('shrink-0 cursor-help rounded p-1 text-[#898989] transition-colors hover:bg-gray-100 hover:text-[#38A1E5] focus-visible:ring-2 focus-visible:ring-[#38A1E5] focus-visible:outline-none', className), children: jsx(Info$3, { className: "h-4 w-4", "aria-hidden": "true" }) }) }), jsx(Portal$2, { children: jsxs(Content2$3, { "data-slot": "tooltip-content", side: "top", align: "center", sideOffset: 6, collisionPadding: 12, className: "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-w-[260px] rounded-lg border border-[oklch(0.922_0_0)] bg-white p-3 shadow-lg", children: [title && (jsx("div", { "data-slot": "tooltip-title", className: "mb-1 text-sm font-semibold text-[#484848]", children: title })), jsx("p", { "data-slot": "tooltip-description", className: "text-sm leading-relaxed text-[#646464]", children: description })] }) })] }));
|
|
226912
|
-
}
|
|
226913
|
-
|
|
226914
227905
|
/**
|
|
226915
227906
|
* Shared utilities for tab label systems.
|
|
226916
227907
|
*
|
|
@@ -230131,11 +231122,11 @@ function StripeConnect({ platformKey }) {
|
|
|
230131
231122
|
}
|
|
230132
231123
|
};
|
|
230133
231124
|
if (isLoading) {
|
|
230134
|
-
return (jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex items-center gap-4", children: [jsx(Skeleton, { className: "h-12 w-12 rounded-full" }), jsxs("div", { className: "flex-1 space-y-2", children: [jsx(Skeleton, { className: "h-5 w-48" }), jsx(Skeleton, { className: "h-4 w-72" })] }), jsx(Skeleton, { className: "h-9 w-32" })] }) }) }));
|
|
231125
|
+
return (jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex items-center gap-4", children: [jsx(Skeleton, { className: "h-12 w-12 rounded-full" }), jsxs("div", { className: "flex-1 space-y-2", children: [jsx(Skeleton, { className: "h-5 w-48" }), jsx(Skeleton, { className: "h-4 w-72" })] }), jsx(Skeleton, { className: "h-9 w-32" })] }) }) }));
|
|
230135
231126
|
}
|
|
230136
231127
|
const isReady = status === null || status === void 0 ? void 0 : status.is_ready_for_payments;
|
|
230137
231128
|
const hasAccount = status === null || status === void 0 ? void 0 : status.has_account;
|
|
230138
|
-
return (jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-4", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsx("h4", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: t('monetizationStripeConnect.stripeConfiguration') }), isReady ? (jsx(Badge, { className: "bg-blue-100 text-blue-700 border-blue-200", children: t('monetizationStripeConnect.badgeConfigured') })) : hasAccount ? (jsx(Badge, { className: "bg-yellow-100 text-yellow-700 border-yellow-200", children: t('monetizationStripeConnect.badgeIncomplete') })) : (jsx(Badge, { variant: "secondary", children: t('monetizationStripeConnect.badgeNotConfigured') }))] }), isReady ? (jsxs("p", { className: "text-sm text-gray-500", children: [t('monetizationStripeConnect.stripeConnectedReady'), (status === null || status === void 0 ? void 0 : status.charges_enabled) && ' ' + t('monetizationStripeConnect.chargesEnabled'), (status === null || status === void 0 ? void 0 : status.payouts_enabled) && ' ' + t('monetizationStripeConnect.payoutsEnabled')] })) : hasAccount ? (jsx("p", { className: "text-sm text-gray-500", children: t('monetizationStripeConnect.onboardingIncomplete') })) : (jsx("p", { className: "text-sm text-gray-500", children: t('monetizationStripeConnect.connectStripePrompt') }))] }), jsx("div", { className: "flex gap-2 flex-shrink-0", children: isError ? null : isReady ? (jsxs(Button$1, { onClick: handleOpenDashboard, disabled: isRedirecting, variant: "outline", className: "cursor-pointer", children: [isRedirecting ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(ExternalLink, { className: "h-4 w-4 mr-2" })), t('monetizationStripeConnect.stripeDashboardButton')] })) : (jsxs(Button$1, { onClick: handleStartOnboarding, disabled: isStartingOnboarding || isRedirecting, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isStartingOnboarding || isRedirecting ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(Link$1, { className: "h-4 w-4 mr-2" })), isStartingOnboarding || isRedirecting
|
|
231129
|
+
return (jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-4", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsx("h4", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: t('monetizationStripeConnect.stripeConfiguration') }), isReady ? (jsx(Badge, { className: "bg-blue-100 text-blue-700 border-blue-200", children: t('monetizationStripeConnect.badgeConfigured') })) : hasAccount ? (jsx(Badge, { className: "bg-yellow-100 text-yellow-700 border-yellow-200", children: t('monetizationStripeConnect.badgeIncomplete') })) : (jsx(Badge, { variant: "secondary", children: t('monetizationStripeConnect.badgeNotConfigured') }))] }), isReady ? (jsxs("p", { className: "text-sm text-gray-500", children: [t('monetizationStripeConnect.stripeConnectedReady'), (status === null || status === void 0 ? void 0 : status.charges_enabled) && ' ' + t('monetizationStripeConnect.chargesEnabled'), (status === null || status === void 0 ? void 0 : status.payouts_enabled) && ' ' + t('monetizationStripeConnect.payoutsEnabled')] })) : hasAccount ? (jsx("p", { className: "text-sm text-gray-500", children: t('monetizationStripeConnect.onboardingIncomplete') })) : (jsx("p", { className: "text-sm text-gray-500", children: t('monetizationStripeConnect.connectStripePrompt') }))] }), jsx("div", { className: "flex gap-2 flex-shrink-0", children: isError ? null : isReady ? (jsxs(Button$1, { onClick: handleOpenDashboard, disabled: isRedirecting, variant: "outline", className: "cursor-pointer", children: [isRedirecting ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(ExternalLink, { className: "h-4 w-4 mr-2" })), t('monetizationStripeConnect.stripeDashboardButton')] })) : (jsxs(Button$1, { onClick: handleStartOnboarding, disabled: isStartingOnboarding || isRedirecting, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isStartingOnboarding || isRedirecting ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(Link$1, { className: "h-4 w-4 mr-2" })), isStartingOnboarding || isRedirecting
|
|
230139
231130
|
? t('monetizationStripeConnect.redirecting')
|
|
230140
231131
|
: hasAccount
|
|
230141
231132
|
? t('monetizationStripeConnect.completeSetup')
|
|
@@ -230288,12 +231279,12 @@ function PaywalledItemsList({ platformKey, onSelectItem, onAddCustomItem, }) {
|
|
|
230288
231279
|
page_size: PAGE_SIZE$a,
|
|
230289
231280
|
...(statusFilter !== 'all' && { is_enabled: statusFilter === 'active' }),
|
|
230290
231281
|
}, { refetchOnMountOrArgChange: true });
|
|
230291
|
-
return (jsxs("div", { className: "space-y-4", children: [jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", children: [jsx("h4", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: t('monetizationPaywalledItemsList.configureItemForSale') }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(ItemSearchDropdown, { platformKey: platformKey, onSelect: (itemType, uniqueId, name) => onSelectItem(itemType, uniqueId, name) }), jsx(Button$1, { variant: "outline", size: "icon", onClick: onAddCustomItem, className: "shrink-0 cursor-pointer", title: t('monetizationPaywalledItemsList.addCustomItemTitle'), children: jsx(Plus, { className: "h-4 w-4" }) })] })] }) }), jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("h4", { className: "text-sm font-medium text-gray-500", children: t('monetizationPaywalledItemsList.configuredItems') }), jsxs(Select$1, { value: statusFilter, onValueChange: (v) => {
|
|
231282
|
+
return (jsxs("div", { className: "space-y-4", children: [jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", children: [jsx("h4", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: t('monetizationPaywalledItemsList.configureItemForSale') }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(ItemSearchDropdown, { platformKey: platformKey, onSelect: (itemType, uniqueId, name) => onSelectItem(itemType, uniqueId, name) }), jsx(Button$1, { variant: "outline", size: "icon", onClick: onAddCustomItem, className: "shrink-0 cursor-pointer", title: t('monetizationPaywalledItemsList.addCustomItemTitle'), children: jsx(Plus, { className: "h-4 w-4" }) })] })] }) }), jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("h4", { className: "text-sm font-medium text-gray-500", children: t('monetizationPaywalledItemsList.configuredItems') }), jsxs(Select$1, { value: statusFilter, onValueChange: (v) => {
|
|
230292
231283
|
setStatusFilter(v);
|
|
230293
231284
|
setPage(1);
|
|
230294
231285
|
}, children: [jsx(SelectTrigger, { className: "w-[130px] h-8 text-xs", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: t('monetizationPaywalledItemsList.filterAll') }), jsx(SelectItem, { value: "active", children: t('monetizationPaywalledItemsList.filterActive') }), jsx(SelectItem, { value: "disabled", children: t('monetizationPaywalledItemsList.filterDisabled') })] })] })] }), isLoading ? (jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-16 w-full" }, i))) })) : (paywalls === null || paywalls === void 0 ? void 0 : paywalls.results) && paywalls.results.length > 0 ? (jsxs(Fragment$1, { children: [paywalls.results.map((pw) => {
|
|
230295
231286
|
var _a;
|
|
230296
|
-
return (jsx(Card, { className: "shadow-sm border hover:border-blue-200 transition-colors cursor-pointer", style: { borderColor: 'oklch(.922 0 0)' }, onClick: () => onSelectItem(pw.item_type, pw.item_id, pw.item_name), children: jsxs(CardContent, { className: "p-4 flex items-center justify-between", children: [jsx("div", { className: "flex items-center gap-3", children: jsxs("div", { children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: pw.item_name || pw.item_id }), jsxs("div", { className: "flex items-center gap-2 mt-0.5", children: [jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: displayItemType(pw.item_type) }), ((_a = pw.prices) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
231287
|
+
return (jsx(Card$1, { className: "shadow-sm border hover:border-blue-200 transition-colors cursor-pointer", style: { borderColor: 'oklch(.922 0 0)' }, onClick: () => onSelectItem(pw.item_type, pw.item_id, pw.item_name), children: jsxs(CardContent, { className: "p-4 flex items-center justify-between", children: [jsx("div", { className: "flex items-center gap-3", children: jsxs("div", { children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: pw.item_name || pw.item_id }), jsxs("div", { className: "flex items-center gap-2 mt-0.5", children: [jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: displayItemType(pw.item_type) }), ((_a = pw.prices) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
230297
231288
|
(() => {
|
|
230298
231289
|
const activeCount = pw.prices.filter((p) => p.is_active).length;
|
|
230299
231290
|
return activeCount > 0 ? (jsx("span", { className: "text-xs text-gray-400", children: activeCount !== 1
|
|
@@ -230349,7 +231340,7 @@ function PriceForm({ form, onChange, onSave, onCancel, isSaving, isEdit, }) {
|
|
|
230349
231340
|
const handleRemoveFeature = (index) => {
|
|
230350
231341
|
onChange({ ...form, features: form.features.filter((_, i) => i !== index) });
|
|
230351
231342
|
};
|
|
230352
|
-
return (jsx(Card, { className: "shadow-sm border border-blue-200 bg-blue-50/30", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4 space-y-3", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.nameLabel') }), jsx(Input, { value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: t('monetizationPriceManagement.namePlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.amountLabel') }), jsx(Input, { type: "number", min: 0, step: "0.01", value: form.amount, onChange: (e) => onChange({ ...form, amount: e.target.value }), placeholder: t('monetizationPriceManagement.amountPlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.intervalLabel') }), jsxs(Select$1, { value: form.interval, onValueChange: (v) => onChange({ ...form, interval: v }), children: [jsx(SelectTrigger, { className: "mt-1", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "month", children: t('monetizationPriceManagement.intervalMonthly') }), jsx(SelectItem, { value: "year", children: t('monetizationPriceManagement.intervalYearly') }), jsx(SelectItem, { value: "one_time", children: t('monetizationPriceManagement.intervalOneTime') })] })] })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.currencyLabel') }), jsx(Input, { value: form.currency, disabled: true, className: "mt-1 bg-gray-50 text-gray-500 cursor-not-allowed" })] })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.descriptionLabel') }), jsx(Input, { value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: t('monetizationPriceManagement.descriptionPlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.featuresLabel') }), form.features.length > 0 && (jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5 mb-1.5", children: form.features.map((feature, i) => (jsxs(Badge, { variant: "secondary", className: "text-xs font-normal pl-2 pr-1 py-0.5 flex items-center gap-1", children: [feature, jsx("button", { type: "button", onClick: () => handleRemoveFeature(i), className: "hover:bg-gray-300 rounded-full p-0.5 transition-colors cursor-pointer", children: jsx(X$2, { className: "h-2.5 w-2.5" }) })] }, i))) })), jsxs("div", { className: "flex gap-1.5 mt-1", children: [jsx(Input, { value: featureInput, onChange: (e) => setFeatureInput(e.target.value), onKeyDown: (e) => {
|
|
231343
|
+
return (jsx(Card$1, { className: "shadow-sm border border-blue-200 bg-blue-50/30", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4 space-y-3", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.nameLabel') }), jsx(Input, { value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: t('monetizationPriceManagement.namePlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.amountLabel') }), jsx(Input, { type: "number", min: 0, step: "0.01", value: form.amount, onChange: (e) => onChange({ ...form, amount: e.target.value }), placeholder: t('monetizationPriceManagement.amountPlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.intervalLabel') }), jsxs(Select$1, { value: form.interval, onValueChange: (v) => onChange({ ...form, interval: v }), children: [jsx(SelectTrigger, { className: "mt-1", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "month", children: t('monetizationPriceManagement.intervalMonthly') }), jsx(SelectItem, { value: "year", children: t('monetizationPriceManagement.intervalYearly') }), jsx(SelectItem, { value: "one_time", children: t('monetizationPriceManagement.intervalOneTime') })] })] })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.currencyLabel') }), jsx(Input, { value: form.currency, disabled: true, className: "mt-1 bg-gray-50 text-gray-500 cursor-not-allowed" })] })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.descriptionLabel') }), jsx(Input, { value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: t('monetizationPriceManagement.descriptionPlaceholder'), className: "mt-1" })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-xs text-gray-500", children: t('monetizationPriceManagement.featuresLabel') }), form.features.length > 0 && (jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5 mb-1.5", children: form.features.map((feature, i) => (jsxs(Badge, { variant: "secondary", className: "text-xs font-normal pl-2 pr-1 py-0.5 flex items-center gap-1", children: [feature, jsx("button", { type: "button", onClick: () => handleRemoveFeature(i), className: "hover:bg-gray-300 rounded-full p-0.5 transition-colors cursor-pointer", children: jsx(X$2, { className: "h-2.5 w-2.5" }) })] }, i))) })), jsxs("div", { className: "flex gap-1.5 mt-1", children: [jsx(Input, { value: featureInput, onChange: (e) => setFeatureInput(e.target.value), onKeyDown: (e) => {
|
|
230353
231344
|
if (e.key === 'Enter') {
|
|
230354
231345
|
e.preventDefault();
|
|
230355
231346
|
handleAddFeature();
|
|
@@ -230466,7 +231457,7 @@ function PriceManagement({ platformKey, itemType, itemId }) {
|
|
|
230466
231457
|
return editingPriceId === price.id ? (jsx(PriceForm, { form: formData, onChange: setFormData, onSave: handleUpdate, onCancel: () => {
|
|
230467
231458
|
setEditingPriceId(null);
|
|
230468
231459
|
setFormData(EMPTY_FORM$1);
|
|
230469
|
-
}, isSaving: isUpdating, isEdit: true }, price.id)) : (jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-4", children: jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx(Tag, { className: "h-4 w-4 text-gray-400" }), jsxs("div", { children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: price.name }), jsxs("span", { className: "text-sm font-semibold text-blue-600", children: ["$", price.amount, " ", formatInterval(price.interval)] }), !price.is_active && (jsx(Badge, { variant: "secondary", className: "text-xs", children: t('monetizationPriceManagement.inactiveBadge') }))] }), price.description && (jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: price.description })), ((_a = price.features) === null || _a === void 0 ? void 0 : _a.length) > 0 && (jsx("div", { className: "flex flex-wrap gap-1 mt-1", children: price.features.map((f, i) => (jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: f }, i))) }))] })] }), jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [jsx(Button$1, { onClick: () => handleStartEdit(price), variant: "ghost", size: "sm", className: "h-8 w-8 p-0 cursor-pointer", children: jsx(Pencil, { className: "h-3 w-3" }) }), jsx(Button$1, { onClick: () => handleDelete(price.id), variant: "ghost", size: "sm", disabled: deletingId === price.id, className: "h-8 w-8 p-0 text-red-500 hover:text-red-700 cursor-pointer", children: deletingId === price.id ? (jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" })) : (jsx(Trash2, { className: "h-3 w-3" })) })] })] }) }) }, price.id));
|
|
231460
|
+
}, isSaving: isUpdating, isEdit: true }, price.id)) : (jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx(CardContent, { className: "p-4", children: jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx(Tag, { className: "h-4 w-4 text-gray-400" }), jsxs("div", { children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: price.name }), jsxs("span", { className: "text-sm font-semibold text-blue-600", children: ["$", price.amount, " ", formatInterval(price.interval)] }), !price.is_active && (jsx(Badge, { variant: "secondary", className: "text-xs", children: t('monetizationPriceManagement.inactiveBadge') }))] }), price.description && (jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: price.description })), ((_a = price.features) === null || _a === void 0 ? void 0 : _a.length) > 0 && (jsx("div", { className: "flex flex-wrap gap-1 mt-1", children: price.features.map((f, i) => (jsx(Badge, { variant: "outline", className: "text-xs font-normal", children: f }, i))) }))] })] }), jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [jsx(Button$1, { onClick: () => handleStartEdit(price), variant: "ghost", size: "sm", className: "h-8 w-8 p-0 cursor-pointer", children: jsx(Pencil, { className: "h-3 w-3" }) }), jsx(Button$1, { onClick: () => handleDelete(price.id), variant: "ghost", size: "sm", disabled: deletingId === price.id, className: "h-8 w-8 p-0 text-red-500 hover:text-red-700 cursor-pointer", children: deletingId === price.id ? (jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" })) : (jsx(Trash2, { className: "h-3 w-3" })) })] })] }) }) }, price.id));
|
|
230470
231461
|
}) })) : (jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('monetizationPriceManagement.emptyState') }))] }));
|
|
230471
231462
|
}
|
|
230472
231463
|
|
|
@@ -230636,13 +231627,13 @@ function PaywallDetail({ platformKey, authURL, itemType, itemId, itemName, isCus
|
|
|
230636
231627
|
const currentIndex = wizardSteps.findIndex((s) => s.key === currentStep);
|
|
230637
231628
|
if (targetIndex < currentIndex)
|
|
230638
231629
|
setCurrentStep(step);
|
|
230639
|
-
} }), currentStep === 'custom-item' && isCustom && (jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-4", children: [jsx("h4", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300", children: t('monetizationPaywallDetail.stepItemDetails') }), jsxs("div", { className: "space-y-3", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelItemType') }), jsx(Input, { value: customItemType, onChange: (e) => setCustomItemType(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderItemType'), className: "mt-1", disabled: itemCreated }), customItemType && (jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.slugPreview', { slug: slugify(customItemType) }) }))] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelItemName') }), jsx(Input, { value: customItemName, onChange: (e) => setCustomItemName(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderItemName'), className: "mt-1", disabled: itemCreated }), customItemName && (jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.idPreview', { id: slugify(customItemName) }) }))] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelDescription') }), jsx(Textarea, { value: customDescription, onChange: (e) => setCustomDescription(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderDescription'), className: "mt-1", rows: 3 })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelProductUrl') }), jsx(Input, { type: "url", value: customProductUrl, onChange: (e) => setCustomProductUrl(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderProductUrl'), className: "mt-1", disabled: itemCreated }), jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.hintProductUrl') })] })] }), jsx("div", { className: "pt-3 border-t flex justify-end", children: jsxs(Button$1, { onClick: handleCreateCustomItem, disabled: isSaving || !customItemType.trim() || !customItemName.trim(), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isCreating ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(ChevronRight, { className: "h-4 w-4 mr-2" })), t('monetizationPaywallDetail.createAndContinue')] }) })] }) })), currentStep === 'paywall' && (jsx(Card, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-5", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelPaywallEnabled') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintPaywallEnabled') })] }), jsx(Switch, { checked: isEnabled, onCheckedChange: setIsEnabled, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: !isEnabled ? 'opacity-50 pointer-events-none' : '', children: [jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelAllowFreeTier') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintAllowFreeTier') })] }), jsx(Switch, { checked: allowFreeTier, onCheckedChange: setAllowFreeTier, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelTrialPeriod') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintTrialPeriod') })] }), jsx(Input, { type: "number", min: 0, value: trialDays, onChange: (e) => setTrialDays(parseInt(e.target.value) || 0), className: "w-24 text-right" })] }), jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelExistingUsers') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintExistingUsers') })] }), jsxs(Select$1, { value: grandfathering, onValueChange: (v) => setGrandfathering(v), children: [jsx(SelectTrigger, { className: "w-[180px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "free_forever", children: t('monetizationPaywallDetail.grandfatheringFreeForever') }), jsx(SelectItem, { value: "require_subscription", children: t('monetizationPaywallDetail.grandfatheringRequireSubscription') })] })] })] })] }), jsx("div", { className: "pt-3 border-t flex justify-end", children: jsxs(Button$1, { onClick: handleSaveConfig, disabled: isSaving, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isSaving ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(Check, { className: "h-4 w-4 mr-2" })), t('monetizationPaywallDetail.saveConfiguration')] }) })] }) })), currentStep === 'pricing' && (jsx(PriceManagement, { platformKey: platformKey, itemType: resolvedItemType, itemId: resolvedItemId }))] }));
|
|
231630
|
+
} }), currentStep === 'custom-item' && isCustom && (jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-4", children: [jsx("h4", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300", children: t('monetizationPaywallDetail.stepItemDetails') }), jsxs("div", { className: "space-y-3", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelItemType') }), jsx(Input, { value: customItemType, onChange: (e) => setCustomItemType(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderItemType'), className: "mt-1", disabled: itemCreated }), customItemType && (jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.slugPreview', { slug: slugify(customItemType) }) }))] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelItemName') }), jsx(Input, { value: customItemName, onChange: (e) => setCustomItemName(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderItemName'), className: "mt-1", disabled: itemCreated }), customItemName && (jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.idPreview', { id: slugify(customItemName) }) }))] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelDescription') }), jsx(Textarea, { value: customDescription, onChange: (e) => setCustomDescription(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderDescription'), className: "mt-1", rows: 3 })] }), jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelProductUrl') }), jsx(Input, { type: "url", value: customProductUrl, onChange: (e) => setCustomProductUrl(e.target.value), placeholder: t('monetizationPaywallDetail.placeholderProductUrl'), className: "mt-1", disabled: itemCreated }), jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('monetizationPaywallDetail.hintProductUrl') })] })] }), jsx("div", { className: "pt-3 border-t flex justify-end", children: jsxs(Button$1, { onClick: handleCreateCustomItem, disabled: isSaving || !customItemType.trim() || !customItemName.trim(), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isCreating ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(ChevronRight, { className: "h-4 w-4 mr-2" })), t('monetizationPaywallDetail.createAndContinue')] }) })] }) })), currentStep === 'paywall' && (jsx(Card$1, { className: "shadow-sm border", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-6 space-y-5", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelPaywallEnabled') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintPaywallEnabled') })] }), jsx(Switch, { checked: isEnabled, onCheckedChange: setIsEnabled, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: !isEnabled ? 'opacity-50 pointer-events-none' : '', children: [jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelAllowFreeTier') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintAllowFreeTier') })] }), jsx(Switch, { checked: allowFreeTier, onCheckedChange: setAllowFreeTier, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelTrialPeriod') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintTrialPeriod') })] }), jsx(Input, { type: "number", min: 0, value: trialDays, onChange: (e) => setTrialDays(parseInt(e.target.value) || 0), className: "w-24 text-right" })] }), jsxs("div", { className: "flex items-center justify-between py-3 border-t", children: [jsxs("div", { children: [jsx(Label$1, { className: "text-sm font-medium", children: t('monetizationPaywallDetail.labelExistingUsers') }), jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('monetizationPaywallDetail.hintExistingUsers') })] }), jsxs(Select$1, { value: grandfathering, onValueChange: (v) => setGrandfathering(v), children: [jsx(SelectTrigger, { className: "w-[180px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "free_forever", children: t('monetizationPaywallDetail.grandfatheringFreeForever') }), jsx(SelectItem, { value: "require_subscription", children: t('monetizationPaywallDetail.grandfatheringRequireSubscription') })] })] })] })] }), jsx("div", { className: "pt-3 border-t flex justify-end", children: jsxs(Button$1, { onClick: handleSaveConfig, disabled: isSaving, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isSaving ? (jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" })) : (jsx(Check, { className: "h-4 w-4 mr-2" })), t('monetizationPaywallDetail.saveConfiguration')] }) })] }) })), currentStep === 'pricing' && (jsx(PriceManagement, { platformKey: platformKey, itemType: resolvedItemType, itemId: resolvedItemId }))] }));
|
|
230640
231631
|
}
|
|
230641
231632
|
|
|
230642
231633
|
function PaywallConfig({ platformKey, authURL, disabled }) {
|
|
230643
231634
|
const [selectedItem, setSelectedItem] = useState(null);
|
|
230644
231635
|
if (disabled) {
|
|
230645
|
-
return (jsx(Card, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(Shield, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: "Connect Stripe first to configure paywalls." })] }) }));
|
|
231636
|
+
return (jsx(Card$1, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(Shield, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: "Connect Stripe first to configure paywalls." })] }) }));
|
|
230646
231637
|
}
|
|
230647
231638
|
if (selectedItem) {
|
|
230648
231639
|
return (jsx(PaywallDetail, { platformKey: platformKey, authURL: authURL, itemType: selectedItem.type, itemId: selectedItem.id, itemName: selectedItem.name, isCustom: selectedItem.isCustom, onBack: () => setSelectedItem(null) }));
|
|
@@ -264668,7 +265659,7 @@ function useWebsiteCrawlerResource(resource) {
|
|
|
264668
265659
|
function WebsiteCrawlModal({ resource }) {
|
|
264669
265660
|
const t = useT();
|
|
264670
265661
|
const { form, handleCheckUrlIsValid, crawlerMatchPatterns, setCrawlerMatchPatterns } = useWebsiteCrawlerResource(resource);
|
|
264671
|
-
return (jsxs(Card, { className: "mx-auto w-full max-w-2xl", role: "dialog", "aria-labelledby": "crawler-title", "aria-describedby": "crawler-description", children: [jsxs(CardHeader, { children: [jsx(CardTitle, { id: "crawler-title", className: "text-md font-semibold text-gray-600", children: t('resourceModalWebsiteCrawlModal.title') }), jsx("p", { id: "crawler-description", className: "text-muted-foreground text-sm", children: t('resourceModalWebsiteCrawlModal.description') })] }), jsx(CardContent, { children: jsx("form", { className: "space-y-4", onSubmit: (e) => {
|
|
265662
|
+
return (jsxs(Card$1, { className: "mx-auto w-full max-w-2xl", role: "dialog", "aria-labelledby": "crawler-title", "aria-describedby": "crawler-description", children: [jsxs(CardHeader, { children: [jsx(CardTitle, { id: "crawler-title", className: "text-md font-semibold text-gray-600", children: t('resourceModalWebsiteCrawlModal.title') }), jsx("p", { id: "crawler-description", className: "text-muted-foreground text-sm", children: t('resourceModalWebsiteCrawlModal.description') })] }), jsx(CardContent, { children: jsx("form", { className: "space-y-4", onSubmit: (e) => {
|
|
264672
265663
|
e.preventDefault();
|
|
264673
265664
|
e.stopPropagation();
|
|
264674
265665
|
form.handleSubmit();
|
|
@@ -266028,8 +267019,21 @@ function BenchmarksTab({ tenantKey, username, }) {
|
|
|
266028
267019
|
}), onClick: () => setViewBenchmark(benchmark.name), children: jsx(Eye, { className: "h-4 w-4" }) }) }) })] }, benchmark.name))), filtered.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 4, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: isFetching ? t('benchmarksIndex.loading') : t('benchmarksIndex.empty') }) }))] })] }) }), totalPages > 1 && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: setPage }) }))] })), jsx(CreateBenchmarkModal, { isOpen: showCreate, onClose: () => setShowCreate(false), tenantKey: tenantKey, username: username }), viewBenchmark && (jsx(BenchmarkItemsModal, { isOpen: !!viewBenchmark, onClose: () => setViewBenchmark(null), tenantKey: tenantKey, username: username, datasetName: viewBenchmark }))] }));
|
|
266029
267020
|
}
|
|
266030
267021
|
|
|
267022
|
+
const TAB_DESC_KEYS = {
|
|
267023
|
+
management: 'descManagement',
|
|
267024
|
+
organization: 'descOrganization',
|
|
267025
|
+
integrations: 'descIntegrations',
|
|
267026
|
+
billing: 'descBilling',
|
|
267027
|
+
monetization: 'descMonetization',
|
|
267028
|
+
datasets: 'descBenchmarks',
|
|
267029
|
+
memory: 'descMemory',
|
|
267030
|
+
advanced: 'descAdvanced',
|
|
267031
|
+
basic: 'descBasic',
|
|
267032
|
+
social: 'descSocial',
|
|
267033
|
+
security: 'descSecurity',
|
|
267034
|
+
};
|
|
266031
267035
|
function Account({ tenant, tenants = [], username, onInviteClick, email, mainPlatformKey, userActiveApp = null, showPlatformName = false, isAdmin = false, targetTab = 'basic', currentPlan: _currentPlan = '', currentSPA = '', authURL, onTenantUpdate, currentPlatformBaseDomain = '', enableRbac = false, showBenchmarks = false, rbacPermissions = {}, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', enableSupportPhone, showGradebookTab = false, onboardingBasePath = '', }) {
|
|
266032
|
-
var _a, _b, _c
|
|
267036
|
+
var _a, _b, _c;
|
|
266033
267037
|
const t = useT();
|
|
266034
267038
|
const currentTenant = tenants.find((ten) => ten.key === tenant);
|
|
266035
267039
|
const hasMonetizationPermission = checkRbacPermission(rbacPermissions, `/platforms/${tenant}/#can_sell_items`, enableRbac);
|
|
@@ -266042,17 +267046,46 @@ function Account({ tenant, tenants = [], username, onInviteClick, email, mainPla
|
|
|
266042
267046
|
*/
|
|
266043
267047
|
const canSeeBilling = !!(currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.show_paywall) && (isAdmin || hasMonetizationPermission);
|
|
266044
267048
|
const TABS = [
|
|
266045
|
-
{
|
|
266046
|
-
|
|
266047
|
-
|
|
267049
|
+
{
|
|
267050
|
+
id: 'organization',
|
|
267051
|
+
label: t('profileAccount.tabOrganization'),
|
|
267052
|
+
icon: Briefcase,
|
|
267053
|
+
group: 'workspace',
|
|
267054
|
+
},
|
|
267055
|
+
{
|
|
267056
|
+
id: 'management',
|
|
267057
|
+
label: t('profileAccount.tabManagement'),
|
|
267058
|
+
icon: Users,
|
|
267059
|
+
group: 'workspace',
|
|
267060
|
+
},
|
|
267061
|
+
{
|
|
267062
|
+
id: 'integrations',
|
|
267063
|
+
label: t('profileAccount.tabIntegrations'),
|
|
267064
|
+
icon: KeyRound,
|
|
267065
|
+
group: 'workspace',
|
|
267066
|
+
},
|
|
266048
267067
|
...(canMonetize
|
|
266049
|
-
? [
|
|
267068
|
+
? [
|
|
267069
|
+
{
|
|
267070
|
+
id: 'monetization',
|
|
267071
|
+
label: t('profileAccount.tabMonetization'),
|
|
267072
|
+
icon: Coins,
|
|
267073
|
+
group: 'finance',
|
|
267074
|
+
},
|
|
267075
|
+
]
|
|
266050
267076
|
: []),
|
|
266051
267077
|
...(showBenchmarks
|
|
266052
|
-
? [
|
|
267078
|
+
? [
|
|
267079
|
+
{
|
|
267080
|
+
id: 'datasets',
|
|
267081
|
+
label: t('profileAccount.tabBenchmarks'),
|
|
267082
|
+
icon: ListChecks,
|
|
267083
|
+
group: 'aiData',
|
|
267084
|
+
},
|
|
267085
|
+
]
|
|
266053
267086
|
: []),
|
|
266054
|
-
{ id: 'memory', label: t('profileAccount.tabMemory'), icon: Brain },
|
|
266055
|
-
{ id: 'advanced', label: t('profileAccount.tabAdvanced'), icon: Settings$1 },
|
|
267087
|
+
{ id: 'memory', label: t('profileAccount.tabMemory'), icon: Brain, group: 'aiData' },
|
|
267088
|
+
{ id: 'advanced', label: t('profileAccount.tabAdvanced'), icon: Settings$1, group: 'system' },
|
|
266056
267089
|
];
|
|
266057
267090
|
const [organizationLogo, setOrganizationLogo] = useState(`${LOGO_ENDPOINTS.light_logo(tenant)}?v=${Date.now()}`);
|
|
266058
267091
|
const hasUserTabPermission = checkRbacPermission(rbacPermissions, `/platforms/${tenant}/#can_manage_users`, enableRbac);
|
|
@@ -266097,56 +267130,61 @@ function Account({ tenant, tenants = [], username, onInviteClick, email, mainPla
|
|
|
266097
267130
|
firstInput.focus();
|
|
266098
267131
|
}
|
|
266099
267132
|
}, []);
|
|
266100
|
-
|
|
266101
|
-
|
|
266102
|
-
|
|
266103
|
-
|
|
266104
|
-
|
|
266105
|
-
|
|
266106
|
-
|
|
266107
|
-
|
|
266108
|
-
|
|
266109
|
-
|
|
266110
|
-
|
|
266111
|
-
|
|
266112
|
-
|
|
266113
|
-
|
|
266114
|
-
|
|
266115
|
-
|
|
266116
|
-
|
|
266117
|
-
|
|
266118
|
-
|
|
266119
|
-
|
|
266120
|
-
|
|
266121
|
-
|
|
266122
|
-
|
|
266123
|
-
|
|
266124
|
-
|
|
266125
|
-
|
|
266126
|
-
|
|
266127
|
-
|
|
266128
|
-
|
|
266129
|
-
|
|
266130
|
-
|
|
266131
|
-
|
|
266132
|
-
|
|
266133
|
-
|
|
266134
|
-
|
|
266135
|
-
|
|
266136
|
-
|
|
266137
|
-
|
|
266138
|
-
|
|
266139
|
-
|
|
266140
|
-
|
|
266141
|
-
|
|
266142
|
-
|
|
266143
|
-
|
|
266144
|
-
|
|
266145
|
-
|
|
266146
|
-
|
|
267133
|
+
/**
|
|
267134
|
+
* Billing and Monetization are mirrored into the host's URL through
|
|
267135
|
+
* `onTabChange`; leaving them for any other tab clears the param.
|
|
267136
|
+
*/
|
|
267137
|
+
const selectTab = (id) => {
|
|
267138
|
+
setActiveTab(id);
|
|
267139
|
+
if (id === 'billing') {
|
|
267140
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange('billing');
|
|
267141
|
+
return;
|
|
267142
|
+
}
|
|
267143
|
+
if ((activeTab === 'billing' || activeTab === 'monetization') &&
|
|
267144
|
+
id !== 'billing' &&
|
|
267145
|
+
id !== 'monetization') {
|
|
267146
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange('');
|
|
267147
|
+
}
|
|
267148
|
+
if (id === 'monetization') {
|
|
267149
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange('monetization');
|
|
267150
|
+
}
|
|
267151
|
+
};
|
|
267152
|
+
const billingTab = {
|
|
267153
|
+
id: 'billing',
|
|
267154
|
+
label: t('profileAccount.tabBilling'),
|
|
267155
|
+
icon: CreditCard,
|
|
267156
|
+
group: 'finance',
|
|
267157
|
+
};
|
|
267158
|
+
const navTabs = [...TABS, billingTab].filter((tab) => visibleTabIds.includes(tab.id));
|
|
267159
|
+
const GROUP_LABELS = {
|
|
267160
|
+
workspace: t('profileAccount.groupWorkspace'),
|
|
267161
|
+
finance: t('profileAccount.groupFinance'),
|
|
267162
|
+
aiData: t('profileAccount.groupAiData'),
|
|
267163
|
+
system: t('profileAccount.groupSystem'),
|
|
267164
|
+
};
|
|
267165
|
+
const navGroups = Object.keys(GROUP_LABELS).map((group) => ({
|
|
267166
|
+
id: group,
|
|
267167
|
+
label: GROUP_LABELS[group],
|
|
267168
|
+
items: navTabs.filter((tab) => tab.group === group),
|
|
267169
|
+
}));
|
|
267170
|
+
// Render the tab's `label` rather than the id so renames like
|
|
267171
|
+
// "datasets" → "Benchmarks" land in the header too. Billing lives outside
|
|
267172
|
+
// TABS (paywall-gated), so it needs its own translated label — the raw id
|
|
267173
|
+
// would render lowercase.
|
|
267174
|
+
const title = (_c = (_b = TABS.find((tab) => tab.id === activeTab)) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : (activeTab === 'billing' ? t('profileAccount.tabBilling') : activeTab);
|
|
267175
|
+
const description = TAB_DESC_KEYS[activeTab]
|
|
267176
|
+
? t(`profileAccount.${TAB_DESC_KEYS[activeTab]}`)
|
|
267177
|
+
: undefined;
|
|
267178
|
+
const platformName = (currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.platform_name) || (currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.name) || tenant;
|
|
267179
|
+
const roleChip = (jsx(SettingsChip, { tone: "accent", icon: User, children: isAdmin ? t('profileAccount.roleAdmin') : t('profileAccount.roleUser') }));
|
|
267180
|
+
const sidebarHeader = (jsxs("div", { className: "flex flex-col gap-3.5", children: [jsxs("div", { className: "flex items-center gap-3", children: [organizationLogo ? (jsx("div", { className: "flex h-14 w-14 flex-shrink-0 items-center justify-center overflow-hidden rounded-xl border border-gray-200 bg-white p-1 dark:border-gray-700", children: jsx(Image$4, { src: organizationLogo, alt: t('profileAccount.organizationLogoAlt'), width: 56, height: 56, className: "h-full w-full object-contain", onError: () => {
|
|
267181
|
+
setOrganizationLogo('');
|
|
267182
|
+
} }) })) : (jsx("div", { className: "flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-xl border border-blue-100 bg-blue-50 text-blue-600 dark:border-blue-900 dark:bg-blue-950 dark:text-blue-300", "aria-hidden": "true", children: jsx(BriefcaseBusiness, { className: "h-6 w-6" }) })), jsxs("div", { className: "min-w-0", children: [jsx("h2", { className: "truncate text-[15px] font-semibold text-gray-900 dark:text-gray-100", title: platformName, children: platformName }), platformName !== tenant && (jsx("p", { className: "truncate font-mono text-xs text-gray-500 dark:text-gray-400", children: tenant }))] })] }), jsxs("div", { className: "flex flex-wrap gap-1.5", children: [roleChip, showPlatformName && jsx(SettingsChip, { children: tenant.toUpperCase() })] })] }));
|
|
267183
|
+
const mobileHeader = (jsx("div", { className: "flex min-w-0 items-center justify-between gap-3", children: jsx("p", { className: "truncate text-[15px] font-semibold text-gray-900 dark:text-gray-100", children: platformName || t('profileAccount.profileTitle') }) }));
|
|
267184
|
+
return (jsx(SettingsShell, { sidebarHeader: sidebarHeader, sidebarNav: jsx(SettingsSidebarNav, { groups: navGroups, activeId: activeTab, onSelect: selectTab, variant: "buttons", ariaLabel: t('profileAccount.ariaSettingsNav') }), mobileHeader: mobileHeader, mobileNav: jsx(SettingsMobileNav, { groups: navGroups, activeId: activeTab, onSelect: selectTab, variant: "buttons", ariaLabel: t('profileAccount.ariaSettingsNavMobile') }), title: title, description: description, overlays: jsx(ToastProvider, {}), children: jsxs("div", { className: "space-y-6", children: [activeTab === 'management' && hasManagementPermissions && (jsx(Admin, { onboardingBasePath: onboardingBasePath, authSpaUrl: authURL, onInviteClick: onInviteClick, tenant: tenant, currentSpa: currentSPA, hasUserTabPermission: hasUserTabPermission, hasGroupsTabPermission: hasGroupsTabPermission, hasPoliciesTabPermission: hasPoliciesTabPermission, hasRolesTabPermission: hasRolesTabPermission, hasTeamsTabPermission: hasTeamsTabPermission, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, hasAlertsTabPermission: hasAlertsTabPermission, rbacPermissions: rbacPermissions, enableRbac: enableRbac, showGradebookTab: showGradebookTab })), activeTab === 'organization' && (jsx(OrganizationTab, { platformKey: tenant, tenant: tenants.find((ten) => ten.key === tenant), onTenantUpdate: onTenantUpdate, setOrganizationLogoFromOutside: setOrganizationLogo, defaultSupportPhone: defaultSupportPhone, enableSupportPhone: enableSupportPhone })), activeTab === 'integrations' && jsx(IntegrationsTab, { tenantKey: tenant, username: username }), activeTab === 'billing' && canSeeBilling && (jsx(BillingTab, { tenant: tenant, userActiveApp: userActiveApp, username: username, currentUserEmail: email, mainPlatformKey: mainPlatformKey })), activeTab === 'monetization' && jsx(MonetizationTab, { platformKey: tenant, authURL: authURL }), activeTab === 'datasets' && showBenchmarks && (jsx(BenchmarksTab, { tenantKey: tenant, username: username })), activeTab === 'memory' && jsx(MemoryAdminTab, { tenantKey: tenant, username: username }), activeTab === 'advanced' && (jsx(AdvancedTab, { platformKey: tenant, currentSPA: currentSPA, username: username, authURL: authURL, currentPlatformBaseDomain: currentPlatformBaseDomain }))] }) }));
|
|
266147
267185
|
}
|
|
266148
267186
|
|
|
266149
|
-
function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, showMentorAIDisplayCheckbox = false, showLeaderboardDisplayCheckbox = false, showGradebookTab = false, showUsernameField = false, showPlatformName = false, useGravatarPicFallback = true, enableCatalogInvite = false, targetTab = 'basic', currentPlan = '', currentSPA = '', userActiveApp = null, authURL, tenants = [], onTenantUpdate, currentPlatformBaseDomain = '', rbacPermissions = {}, enableRbac = false, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', onBillingTabRequest, onAccountDeleted, enableMemoryTab = false, showBenchmarks = false, localLLMProps, enableSupportPhone, onboardingBasePath = '', }) {
|
|
267187
|
+
function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, showMentorAIDisplayCheckbox = false, showLeaderboardDisplayCheckbox = false, showGradebookTab = false, showUsernameField = false, showPlatformName = false, useGravatarPicFallback = true, enableCatalogInvite = false, targetTab = 'basic', currentPlan = '', currentSPA = '', userActiveApp = null, authURL, tenants = [], onTenantUpdate, currentPlatformBaseDomain = '', rbacPermissions = {}, enableRbac = false, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', onBillingTabRequest, onAccountDeleted, enableMemoryTab = false, showLlmUsageTab = true, showBenchmarks = false, localLLMProps, enableSupportPhone, onboardingBasePath = '', }) {
|
|
266150
267188
|
const t = useT();
|
|
266151
267189
|
console.log('[UserProfileModal] localLLMProps received:', {
|
|
266152
267190
|
isAvailable: localLLMProps === null || localLLMProps === void 0 ? void 0 : localLLMProps.isAvailable,
|
|
@@ -266196,7 +267234,7 @@ function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, sho
|
|
|
266196
267234
|
if (!isInviteUserDialogOpen) {
|
|
266197
267235
|
onClose();
|
|
266198
267236
|
}
|
|
266199
|
-
}, children: jsxs(DialogContent, { autoFocus: false, forceMount: true, className: "max-w-7xl w-[85vw] p-0 gap-0 overflow-hidden bg-white profile-component-dialog", style: { height: '85vh', display: 'flex', flexDirection: 'column' }, children: [jsx(DialogTitle, { className: "sr-only", children: t('modalsUserProfileModal.dialogTitle') }), jsx(DialogDescription, { className: "sr-only", children: t('modalsUserProfileModal.dialogDescription') }), [
|
|
267237
|
+
}, children: jsxs(DialogContent, { autoFocus: false, forceMount: true, className: "max-w-7xl w-[85vw] p-0 gap-0 overflow-hidden bg-white sm:rounded-2xl profile-component-dialog", style: { height: '85vh', display: 'flex', flexDirection: 'column' }, children: [jsx(DialogTitle, { className: "sr-only", children: t('modalsUserProfileModal.dialogTitle') }), jsx(DialogDescription, { className: "sr-only", children: t('modalsUserProfileModal.dialogDescription') }), [
|
|
266200
267238
|
'basic',
|
|
266201
267239
|
'social',
|
|
266202
267240
|
'security',
|
|
@@ -266205,6 +267243,7 @@ function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, sho
|
|
|
266205
267243
|
'resume',
|
|
266206
267244
|
'memory',
|
|
266207
267245
|
'chatHistory',
|
|
267246
|
+
'llmUsage',
|
|
266208
267247
|
'advanced',
|
|
266209
267248
|
].includes(targetTab) && (jsx(Profile, { currentSPA: currentSPA, tenant: params.tenantKey, tenants: tenants, username: getUserName$1(), customization: {
|
|
266210
267249
|
showMentorAIDisplayCheckbox: showMentorAIDisplayCheckbox,
|
|
@@ -266213,7 +267252,7 @@ function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, sho
|
|
|
266213
267252
|
showPlatformName: showPlatformName,
|
|
266214
267253
|
useGravatarPicFallback: useGravatarPicFallback,
|
|
266215
267254
|
showGradebookTab: showGradebookTab,
|
|
266216
|
-
}, isAdmin: params.isAdmin, targetTab: targetTab, onClose: onClose, onAccountDeleted: onAccountDeleted, enableMemoryTab: enableMemoryTab, localLLMProps: localLLMProps })), [
|
|
267255
|
+
}, isAdmin: params.isAdmin, targetTab: targetTab, onClose: onClose, onAccountDeleted: onAccountDeleted, enableMemoryTab: enableMemoryTab, showLlmUsageTab: showLlmUsageTab, localLLMProps: localLLMProps })), [
|
|
266217
267256
|
'organization',
|
|
266218
267257
|
'management',
|
|
266219
267258
|
'integrations',
|
|
@@ -268807,7 +269846,7 @@ function ConversationStarters$1({ onTemplateSelect, guidedPrompts = [], disabled
|
|
|
268807
269846
|
}
|
|
268808
269847
|
return (jsxs("div", { className: cn('w-full max-w-6xl mx-auto px-4', className), children: [jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-6", children: t('welcomeChatConversationStarters.conversationStarters') }), jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-4", children: guidedPrompts.map((guidedPrompt, index) => {
|
|
268809
269848
|
var _a;
|
|
268810
|
-
return (jsx(Card, { className: cn('shadow-xs transition-all duration-200 bg-[#F5F8FF] border border-[#D0E0FF] h-full', disabled
|
|
269849
|
+
return (jsx(Card$1, { className: cn('shadow-xs transition-all duration-200 bg-[#F5F8FF] border border-[#D0E0FF] h-full', disabled
|
|
268811
269850
|
? 'opacity-50 cursor-not-allowed'
|
|
268812
269851
|
: 'cursor-pointer hover:shadow-sm focus:shadow-md focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2'), onClick: () => !disabled && onTemplateSelect(guidedPrompt.prompt), onKeyDown: (e) => {
|
|
268813
269852
|
if (disabled)
|
|
@@ -281126,7 +282165,7 @@ function AgentEmbedTab({ labels: labelsProp, urls, CopyCodeBlock, visibilityOpti
|
|
|
281126
282165
|
? jsValidation.warnings.length > 0
|
|
281127
282166
|
? 'bg-blue-50 text-blue-700'
|
|
281128
282167
|
: 'bg-green-50 text-green-700'
|
|
281129
|
-
: 'bg-red-50 text-red-700'), children: jsValidation.isValid ? (jsValidation.warnings.length > 0 ? (jsxs(Fragment$1, { children: [jsx(TriangleAlert, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.warnings')] })) : (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.valid')] }))) : (jsxs(Fragment$1, { children: [jsx(CircleAlert, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.invalid')] })) })) })] }), !jsValidation.isValid && (jsxs("div", { id: "js-errors", className: "rounded-lg border border-red-100 bg-red-50 p-3", role: "alert", children: [jsx("p", { className: "mb-1 text-sm font-medium text-red-800", children: t('tabsEmbedTab.jsValidationErrors') }), jsx("ul", { className: "list-inside list-disc space-y-0.5 text-sm text-red-700", children: jsValidation.errors.map((error, index) => (jsx("li", { children: error }, index))) })] })), jsValidation.isValid && jsValidation.warnings.length > 0 && (jsxs("div", { id: "js-warnings", className: "rounded-lg border border-blue-100 bg-blue-50 p-3", role: "status", children: [jsx("p", { className: "mb-1 text-sm font-medium text-blue-800", children: t('tabsEmbedTab.warningsHeading') }), jsx("ul", { className: "list-inside list-disc space-y-0.5 text-sm text-blue-700", children: jsValidation.warnings.map((warning, index) => (jsx("li", { children: warning }, index))) })] })), jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsx("p", { className: "text-xs text-gray-500", children: t('tabsEmbedTab.jsChangesHint') }), jsxs("div", { className: "flex items-center gap-2", children: [hasJsChanges && (jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: handleDiscardJs, disabled: isAdvancedDisabled, "aria-label": labels.actions.discard, children: labels.actions.discard })), jsx(Button$1, { type: "button", size: "sm", onClick: handleSaveJs, disabled: !canSaveJs, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", "aria-label": `${labels.actions.save} ${labels.advancedJs.title.toLowerCase()}`, children: isSavingAdvanced ? labels.actions.saving : labels.actions.save })] })] })] })) }))] }), jsx(form.Subscribe, { selector: (formState) => [formState.values.icon_selection], children: ([iconSelection]) => (jsxs(Fragment$1, { children: [jsx(form.Field, { name: "icon_selection", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.iconSelection }), jsxs(Select$1, { defaultValue: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectEmbedModeAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectModePlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "default", className: "text-[#646464]", children: t('tabsEmbedTab.iconSelectionDefault') }), jsx(SelectItem, { value: "custom", className: "text-[#646464]", children: t('tabsEmbedTab.iconSelectionCustom') })] })] })] })) }), iconSelection === 'custom' && (jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsx(Button$1, { type: "button", variant: "outline", className: "w-full bg-gray-50 text-gray-700 hover:bg-gray-100", onClick: () => setFocusEditCustomFloatingBubble(true), children: labels.iconEditor.title }), jsxs(Card, { children: [jsx(CardHeader, { className: "mb-0 pt-4 pb-0", children: jsx(CardTitle, { className: "text-sm font-medium text-[#646464]", children: t('tabsEmbedTab.livePreview') }) }), jsx(CardContent, { className: "mt-0", children: jsx(InteractiveBubbleConfigDisplay, { customFloatingBubbleConfig: customFloatingBubbleConfig, handleFloatingBubbleImageError: handleFloatingBubbleImageError }) })] })] }))] })) }), jsx("hr", { className: "my-4 border-t border-gray-200" }), jsx(form.Field, { name: "mode", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.modeSelection }), jsxs(Select$1, { defaultValue: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectEmbedModeAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectModePlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "default", className: "text-[#646464]", children: t('tabsEmbedTab.modeDefault') }), jsx(SelectItem, { value: "advanced", className: "text-[#646464]", children: t('tabsEmbedTab.modeAdvanced') })] })] })] })) }), jsx(form.Field, { name: "starter_prompts", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.starterPrompts.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoStarterPrompts'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.starterPrompts.tooltip }) })] }) })] }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectStarterPromptsAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectStarterPromptsPlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "guided_prompt", className: "text-[#646464]", children: t('tabsEmbedTab.guidedPrompts') }), jsx(SelectItem, { value: "suggested_prompt", className: "text-[#646464]", children: t('tabsEmbedTab.suggestedPrompts') })] })] })] })) }), jsx(WithFormPermissions, { name: "mentor_visibility",
|
|
282168
|
+
: 'bg-red-50 text-red-700'), children: jsValidation.isValid ? (jsValidation.warnings.length > 0 ? (jsxs(Fragment$1, { children: [jsx(TriangleAlert, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.warnings')] })) : (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.valid')] }))) : (jsxs(Fragment$1, { children: [jsx(CircleAlert, { className: "h-3.5 w-3.5" }), t('tabsEmbedTab.invalid')] })) })) })] }), !jsValidation.isValid && (jsxs("div", { id: "js-errors", className: "rounded-lg border border-red-100 bg-red-50 p-3", role: "alert", children: [jsx("p", { className: "mb-1 text-sm font-medium text-red-800", children: t('tabsEmbedTab.jsValidationErrors') }), jsx("ul", { className: "list-inside list-disc space-y-0.5 text-sm text-red-700", children: jsValidation.errors.map((error, index) => (jsx("li", { children: error }, index))) })] })), jsValidation.isValid && jsValidation.warnings.length > 0 && (jsxs("div", { id: "js-warnings", className: "rounded-lg border border-blue-100 bg-blue-50 p-3", role: "status", children: [jsx("p", { className: "mb-1 text-sm font-medium text-blue-800", children: t('tabsEmbedTab.warningsHeading') }), jsx("ul", { className: "list-inside list-disc space-y-0.5 text-sm text-blue-700", children: jsValidation.warnings.map((warning, index) => (jsx("li", { children: warning }, index))) })] })), jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsx("p", { className: "text-xs text-gray-500", children: t('tabsEmbedTab.jsChangesHint') }), jsxs("div", { className: "flex items-center gap-2", children: [hasJsChanges && (jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: handleDiscardJs, disabled: isAdvancedDisabled, "aria-label": labels.actions.discard, children: labels.actions.discard })), jsx(Button$1, { type: "button", size: "sm", onClick: handleSaveJs, disabled: !canSaveJs, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", "aria-label": `${labels.actions.save} ${labels.advancedJs.title.toLowerCase()}`, children: isSavingAdvanced ? labels.actions.saving : labels.actions.save })] })] })] })) }))] }), jsx(form.Subscribe, { selector: (formState) => [formState.values.icon_selection], children: ([iconSelection]) => (jsxs(Fragment$1, { children: [jsx(form.Field, { name: "icon_selection", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.iconSelection }), jsxs(Select$1, { defaultValue: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectEmbedModeAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectModePlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "default", className: "text-[#646464]", children: t('tabsEmbedTab.iconSelectionDefault') }), jsx(SelectItem, { value: "custom", className: "text-[#646464]", children: t('tabsEmbedTab.iconSelectionCustom') })] })] })] })) }), iconSelection === 'custom' && (jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsx(Button$1, { type: "button", variant: "outline", className: "w-full bg-gray-50 text-gray-700 hover:bg-gray-100", onClick: () => setFocusEditCustomFloatingBubble(true), children: labels.iconEditor.title }), jsxs(Card$1, { children: [jsx(CardHeader, { className: "mb-0 pt-4 pb-0", children: jsx(CardTitle, { className: "text-sm font-medium text-[#646464]", children: t('tabsEmbedTab.livePreview') }) }), jsx(CardContent, { className: "mt-0", children: jsx(InteractiveBubbleConfigDisplay, { customFloatingBubbleConfig: customFloatingBubbleConfig, handleFloatingBubbleImageError: handleFloatingBubbleImageError }) })] })] }))] })) }), jsx("hr", { className: "my-4 border-t border-gray-200" }), jsx(form.Field, { name: "mode", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.modeSelection }), jsxs(Select$1, { defaultValue: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectEmbedModeAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectModePlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "default", className: "text-[#646464]", children: t('tabsEmbedTab.modeDefault') }), jsx(SelectItem, { value: "advanced", className: "text-[#646464]", children: t('tabsEmbedTab.modeAdvanced') })] })] })] })) }), jsx(form.Field, { name: "starter_prompts", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-[#646464]", children: labels.fields.starterPrompts.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoStarterPrompts'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.starterPrompts.tooltip }) })] }) })] }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectStarterPromptsAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectStarterPromptsPlaceholder'), className: "text-[#646464]" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "guided_prompt", className: "text-[#646464]", children: t('tabsEmbedTab.guidedPrompts') }), jsx(SelectItem, { value: "suggested_prompt", className: "text-[#646464]", children: t('tabsEmbedTab.suggestedPrompts') })] })] })] })) }), jsx(WithFormPermissions, { name: "mentor_visibility",
|
|
281130
282169
|
// @ts-ignore
|
|
281131
282170
|
permissions: (_b = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.permissions) === null || _b === void 0 ? void 0 : _b.field, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_visibility", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(Label$1, { className: "text-sm font-medium text-[#646464]", children: labels.fields.whoCanView.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsEmbedTab.moreInfoVisibility'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.whoCanView.tooltip }) })] }) })] }), jsxs(Select$1, { value: typeof field.state.value === 'string' ? field.state.value : '', onValueChange: (value) => field.handleChange(value), disabled: form.state.isSubmitting || disabled, children: [jsx(SelectTrigger, { className: "text-[#646464]", "aria-label": t('tabsEmbedTab.selectWhoCanViewAriaLabel'), children: jsx(SelectValue, { placeholder: t('tabsEmbedTab.selectWhoCanViewPlaceholder'), className: "text-[#646464]" }) }), jsx(SelectContent, { children: visibilityOptions.map((visibility) => (jsx(SelectItem, { value: visibility.value, className: "text-[#646464]", children: visibility.label }, visibility.value))) })] })] })) })) }), jsx(WithFormPermissions, { name: "allow_anonymous",
|
|
281132
282171
|
// @ts-ignore
|
|
@@ -281157,7 +282196,7 @@ function AgentEmbedTab({ labels: labelsProp, urls, CopyCodeBlock, visibilityOpti
|
|
|
281157
282196
|
minHeight: '580px',
|
|
281158
282197
|
width: '100%',
|
|
281159
282198
|
minWidth: '280px',
|
|
281160
|
-
}, frameBorder: "0" })) }) })] }), focusEditCustomFloatingBubble && (jsx(Dialog, { open: focusEditCustomFloatingBubble, onOpenChange: (open) => setFocusEditCustomFloatingBubble(open), children: jsxs(DialogContent, { className: "max-h-[80vh] max-w-[600px] overflow-y-auto", children: [jsxs(DialogHeader, { className: "mb-1", children: [jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.iconEditor.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.iconEditor.description })] }), jsxs(Tabs, { defaultValue: "appearance", className: "w-full", children: [jsxs(TabsList, { className: "mb-4 grid h-10 w-full grid-cols-3", children: [jsxs(TabsTrigger, { value: "appearance", className: "flex items-center gap-2", children: [jsx(Palette, { className: "h-4 w-4" }), t('tabsEmbedTab.appearanceTab')] }), jsxs(TabsTrigger, { value: "position", className: "flex items-center gap-2", children: [jsx(Settings$1, { className: "h-4 w-4" }), t('tabsEmbedTab.positionTab')] }), jsxs(TabsTrigger, { value: "content", className: "flex items-center gap-2", children: [jsx(MessageCircle, { className: "h-4 w-4" }), t('tabsEmbedTab.contentTab')] })] }), jsx(TabsContent, { value: "appearance", className: "space-y-6", children: jsxs(Card, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.visualStyling') }) }), jsx(CardContent, { className: "space-y-6 pt-2", children: jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "backgroundColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.backgroundColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "backgroundColor", type: "color", value: customFloatingBubbleConfig.backgroundColor, onChange: (e) => updateConfig('backgroundColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.backgroundColor, onChange: (e) => updateConfig('backgroundColor', e.target.value), placeholder: "#3b82f6", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "textColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleTextColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "textColor", type: "color", value: customFloatingBubbleConfig.textColor, onChange: (e) => updateConfig('textColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.textColor, onChange: (e) => updateConfig('textColor', e.target.value), placeholder: "#ffffff", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitleTextColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleTextColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "subtitleTextColor", type: "color", value: customFloatingBubbleConfig.subtitleTextColor, onChange: (e) => updateConfig('subtitleTextColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.subtitleTextColor, onChange: (e) => updateConfig('subtitleTextColor', e.target.value), placeholder: "#e5e7eb", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "borderRadius", className: "text-sm text-gray-600", children: t('tabsEmbedTab.borderRadius') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.borderRadius, onChange: (e) => updateConfig('borderRadius', e.target.value), placeholder: "16", type: "range", min: 0, max: 100, step: 1, className: "flex-1", id: "borderRadius" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "imageSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.imageSize') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.imageSize, onChange: (e) => updateConfig('imageSize', e.target.value), placeholder: "16", type: "range", min: 0, max: 100, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "fontSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleFontSize') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "fontSize", value: customFloatingBubbleConfig.fontSize, onChange: (e) => updateConfig('fontSize', e.target.value), placeholder: "16", type: "range", min: 10, max: 24, step: 1, className: "flex-1" }), jsxs("span", { className: "flex min-w-[30px] items-center text-xs text-gray-500", children: [customFloatingBubbleConfig.fontSize, "px"] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitleFontSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleFontSize') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "subtitleFontSize", value: customFloatingBubbleConfig.subtitleFontSize, onChange: (e) => updateConfig('subtitleFontSize', e.target.value), placeholder: "12", type: "range", min: 8, max: 20, step: 1, className: "flex-1" }), jsxs("span", { className: "flex min-w-[30px] items-center text-xs text-gray-500", children: [customFloatingBubbleConfig.subtitleFontSize, "px"] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "shadow", className: "text-sm text-gray-600", children: t('tabsEmbedTab.useShadow') }), jsx("div", { className: "mt-2", children: jsxs(Select$1, { value: customFloatingBubbleConfig.shadow ? '1' : '0', onValueChange: (value) => updateConfig('shadow', value === '1'), children: [jsx(SelectTrigger, { children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: '1', children: t('tabsEmbedTab.yes') }), jsx(SelectItem, { value: '0', children: t('tabsEmbedTab.no') })] })] }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "padding", className: "text-sm text-gray-600", children: t('tabsEmbedTab.padding') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.padding, onChange: (e) => updateConfig('padding', e.target.value), placeholder: "1", type: "range", min: 0, max: 50, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "strokeWidth", className: "text-sm text-gray-600", children: t('tabsEmbedTab.strokeThickness') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.strokeWidth, onChange: (e) => updateConfig('strokeWidth', e.target.value), placeholder: "1", type: "range", min: 0, max: 10, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "strokeColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.strokeColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "strokeColor", type: "color", value: customFloatingBubbleConfig.strokeColor, onChange: (e) => updateConfig('strokeColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.strokeColor, onChange: (e) => updateConfig('strokeColor', e.target.value), placeholder: "#3b82f6", className: "flex-1" })] })] })] }) })] }) }), jsx(TabsContent, { value: "position", className: "space-y-6", children: jsxs(Card, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.positionLayout') }) }), jsx(CardContent, { className: "space-y-6 pt-0", children: jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "position", className: "text-sm text-gray-600", children: t('tabsEmbedTab.screenPosition') }), jsx("div", { className: "mt-2", children: jsxs(Select$1, { value: customFloatingBubbleConfig.position, onValueChange: (value) => updateConfig('position', value), children: [jsx(SelectTrigger, { children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "bottom-right", children: t('tabsEmbedTab.bottomRight') }), jsx(SelectItem, { value: "bottom-left", children: t('tabsEmbedTab.bottomLeft') }), jsx(SelectItem, { value: "top-right", children: t('tabsEmbedTab.topRight') }), jsx(SelectItem, { value: "top-left", children: t('tabsEmbedTab.topLeft') })] })] }) })] }) })] }) }), jsx(TabsContent, { value: "content", className: "space-y-6", children: jsxs(Card, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.textContent') }) }), jsxs(CardContent, { className: "space-y-4 pt-0", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "title", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleLabel') }), jsx(Input, { id: "title", value: customFloatingBubbleConfig.title, onChange: (e) => updateConfig('title', e.target.value), placeholder: "AI-powered assistant", className: "mt-2" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitle", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleText') }), jsx(Input, { id: "subtitle", value: customFloatingBubbleConfig.subtitle, onChange: (e) => updateConfig('subtitle', e.target.value), placeholder: "Created with AI", className: "mt-2" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "iconImage", className: "text-sm text-gray-600", children: t('tabsEmbedTab.iconImage') }), jsxs("div", { className: "mt-2 space-y-1", children: [jsx(Input, { id: "iconImage", type: "file", accept: "image/*", onChange: (e) => {
|
|
282199
|
+
}, frameBorder: "0" })) }) })] }), focusEditCustomFloatingBubble && (jsx(Dialog, { open: focusEditCustomFloatingBubble, onOpenChange: (open) => setFocusEditCustomFloatingBubble(open), children: jsxs(DialogContent, { className: "max-h-[80vh] max-w-[600px] overflow-y-auto", children: [jsxs(DialogHeader, { className: "mb-1", children: [jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.iconEditor.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.iconEditor.description })] }), jsxs(Tabs, { defaultValue: "appearance", className: "w-full", children: [jsxs(TabsList, { className: "mb-4 grid h-10 w-full grid-cols-3", children: [jsxs(TabsTrigger, { value: "appearance", className: "flex items-center gap-2", children: [jsx(Palette, { className: "h-4 w-4" }), t('tabsEmbedTab.appearanceTab')] }), jsxs(TabsTrigger, { value: "position", className: "flex items-center gap-2", children: [jsx(Settings$1, { className: "h-4 w-4" }), t('tabsEmbedTab.positionTab')] }), jsxs(TabsTrigger, { value: "content", className: "flex items-center gap-2", children: [jsx(MessageCircle, { className: "h-4 w-4" }), t('tabsEmbedTab.contentTab')] })] }), jsx(TabsContent, { value: "appearance", className: "space-y-6", children: jsxs(Card$1, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.visualStyling') }) }), jsx(CardContent, { className: "space-y-6 pt-2", children: jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "backgroundColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.backgroundColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "backgroundColor", type: "color", value: customFloatingBubbleConfig.backgroundColor, onChange: (e) => updateConfig('backgroundColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.backgroundColor, onChange: (e) => updateConfig('backgroundColor', e.target.value), placeholder: "#3b82f6", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "textColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleTextColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "textColor", type: "color", value: customFloatingBubbleConfig.textColor, onChange: (e) => updateConfig('textColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.textColor, onChange: (e) => updateConfig('textColor', e.target.value), placeholder: "#ffffff", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitleTextColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleTextColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "subtitleTextColor", type: "color", value: customFloatingBubbleConfig.subtitleTextColor, onChange: (e) => updateConfig('subtitleTextColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.subtitleTextColor, onChange: (e) => updateConfig('subtitleTextColor', e.target.value), placeholder: "#e5e7eb", className: "flex-1" })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "borderRadius", className: "text-sm text-gray-600", children: t('tabsEmbedTab.borderRadius') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.borderRadius, onChange: (e) => updateConfig('borderRadius', e.target.value), placeholder: "16", type: "range", min: 0, max: 100, step: 1, className: "flex-1", id: "borderRadius" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "imageSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.imageSize') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.imageSize, onChange: (e) => updateConfig('imageSize', e.target.value), placeholder: "16", type: "range", min: 0, max: 100, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "fontSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleFontSize') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "fontSize", value: customFloatingBubbleConfig.fontSize, onChange: (e) => updateConfig('fontSize', e.target.value), placeholder: "16", type: "range", min: 10, max: 24, step: 1, className: "flex-1" }), jsxs("span", { className: "flex min-w-[30px] items-center text-xs text-gray-500", children: [customFloatingBubbleConfig.fontSize, "px"] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitleFontSize", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleFontSize') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "subtitleFontSize", value: customFloatingBubbleConfig.subtitleFontSize, onChange: (e) => updateConfig('subtitleFontSize', e.target.value), placeholder: "12", type: "range", min: 8, max: 20, step: 1, className: "flex-1" }), jsxs("span", { className: "flex min-w-[30px] items-center text-xs text-gray-500", children: [customFloatingBubbleConfig.subtitleFontSize, "px"] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "shadow", className: "text-sm text-gray-600", children: t('tabsEmbedTab.useShadow') }), jsx("div", { className: "mt-2", children: jsxs(Select$1, { value: customFloatingBubbleConfig.shadow ? '1' : '0', onValueChange: (value) => updateConfig('shadow', value === '1'), children: [jsx(SelectTrigger, { children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: '1', children: t('tabsEmbedTab.yes') }), jsx(SelectItem, { value: '0', children: t('tabsEmbedTab.no') })] })] }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "padding", className: "text-sm text-gray-600", children: t('tabsEmbedTab.padding') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.padding, onChange: (e) => updateConfig('padding', e.target.value), placeholder: "1", type: "range", min: 0, max: 50, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "strokeWidth", className: "text-sm text-gray-600", children: t('tabsEmbedTab.strokeThickness') }), jsx("div", { className: "mt-2 flex gap-2", children: jsx(Input, { value: customFloatingBubbleConfig.strokeWidth, onChange: (e) => updateConfig('strokeWidth', e.target.value), placeholder: "1", type: "range", min: 0, max: 10, step: 1, className: "flex-1" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "strokeColor", className: "text-sm text-gray-600", children: t('tabsEmbedTab.strokeColor') }), jsxs("div", { className: "mt-2 flex gap-2", children: [jsx(Input, { id: "strokeColor", type: "color", value: customFloatingBubbleConfig.strokeColor, onChange: (e) => updateConfig('strokeColor', e.target.value), className: "h-10 w-16 rounded border p-1" }), jsx(Input, { value: customFloatingBubbleConfig.strokeColor, onChange: (e) => updateConfig('strokeColor', e.target.value), placeholder: "#3b82f6", className: "flex-1" })] })] })] }) })] }) }), jsx(TabsContent, { value: "position", className: "space-y-6", children: jsxs(Card$1, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.positionLayout') }) }), jsx(CardContent, { className: "space-y-6 pt-0", children: jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "position", className: "text-sm text-gray-600", children: t('tabsEmbedTab.screenPosition') }), jsx("div", { className: "mt-2", children: jsxs(Select$1, { value: customFloatingBubbleConfig.position, onValueChange: (value) => updateConfig('position', value), children: [jsx(SelectTrigger, { children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "bottom-right", children: t('tabsEmbedTab.bottomRight') }), jsx(SelectItem, { value: "bottom-left", children: t('tabsEmbedTab.bottomLeft') }), jsx(SelectItem, { value: "top-right", children: t('tabsEmbedTab.topRight') }), jsx(SelectItem, { value: "top-left", children: t('tabsEmbedTab.topLeft') })] })] }) })] }) })] }) }), jsx(TabsContent, { value: "content", className: "space-y-6", children: jsxs(Card$1, { children: [jsx(CardHeader, { className: "mb-0 px-4 py-3", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.textContent') }) }), jsxs(CardContent, { className: "space-y-4 pt-0", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "title", className: "text-sm text-gray-600", children: t('tabsEmbedTab.titleLabel') }), jsx(Input, { id: "title", value: customFloatingBubbleConfig.title, onChange: (e) => updateConfig('title', e.target.value), placeholder: "AI-powered assistant", className: "mt-2" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "subtitle", className: "text-sm text-gray-600", children: t('tabsEmbedTab.subtitleText') }), jsx(Input, { id: "subtitle", value: customFloatingBubbleConfig.subtitle, onChange: (e) => updateConfig('subtitle', e.target.value), placeholder: "Created with AI", className: "mt-2" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "iconImage", className: "text-sm text-gray-600", children: t('tabsEmbedTab.iconImage') }), jsxs("div", { className: "mt-2 space-y-1", children: [jsx(Input, { id: "iconImage", type: "file", accept: "image/*", onChange: (e) => {
|
|
281161
282200
|
var _a;
|
|
281162
282201
|
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
281163
282202
|
if (file) {
|
|
@@ -281172,7 +282211,7 @@ function AgentEmbedTab({ labels: labelsProp, urls, CopyCodeBlock, visibilityOpti
|
|
|
281172
282211
|
}
|
|
281173
282212
|
}, className: "h-[45px] file:mr-4 file:rounded-full file:border-0 file:bg-blue-50 file:px-4 file:py-2 file:text-sm file:font-semibold file:text-blue-700 hover:file:bg-blue-100" }), customFloatingBubbleConfig.image && (jsxs("div", { className: "my-3 flex items-center gap-3", children: [jsx("img", { src: customFloatingBubbleConfig.image || '/placeholder.svg', alt: t('tabsEmbedTab.chatIconPreviewAlt'), className: "h-12 w-12 rounded-lg border bg-gray-100 object-cover p-1" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: () => updateMultipleConfig({
|
|
281174
282213
|
image: null,
|
|
281175
|
-
}), children: t('tabsEmbedTab.removeImage') })] })), jsx("p", { className: "text-xs text-gray-500", children: t('tabsEmbedTab.iconUploadHint') })] })] })] })] }) })] }), jsxs(Card, { children: [jsx(CardHeader, { className: "mb-0 pt-4 pb-0", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.livePreview') }) }), jsx(CardContent, { children: jsx(InteractiveBubbleConfigDisplay, { customFloatingBubbleConfig: customFloatingBubbleConfig, handleFloatingBubbleImageError: handleFloatingBubbleImageError }) })] })] }) }))] }) }), jsx("div", { className: "flex flex-shrink-0 justify-end border-t border-gray-200 bg-white px-3 py-4", children: jsx(Button$1, { onClick: () => form.handleSubmit(), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-sm text-white hover:text-white hover:opacity-90", disabled: form.state.isSubmitting, children: form.state.isSubmitting ? labels.actions.creatingEmbed : labels.actions.createEmbed }) })] }), embedCode && (jsx(Dialog, { open: !!embedCode, onOpenChange: (open) => {
|
|
282214
|
+
}), children: t('tabsEmbedTab.removeImage') })] })), jsx("p", { className: "text-xs text-gray-500", children: t('tabsEmbedTab.iconUploadHint') })] })] })] })] }) })] }), jsxs(Card$1, { children: [jsx(CardHeader, { className: "mb-0 pt-4 pb-0", children: jsx(CardTitle, { className: "text-sm font-medium text-gray-600", children: t('tabsEmbedTab.livePreview') }) }), jsx(CardContent, { children: jsx(InteractiveBubbleConfigDisplay, { customFloatingBubbleConfig: customFloatingBubbleConfig, handleFloatingBubbleImageError: handleFloatingBubbleImageError }) })] })] }) }))] }) }), jsx("div", { className: "flex flex-shrink-0 justify-end border-t border-gray-200 bg-white px-3 py-4", children: jsx(Button$1, { onClick: () => form.handleSubmit(), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-sm text-white hover:text-white hover:opacity-90", disabled: form.state.isSubmitting, children: form.state.isSubmitting ? labels.actions.creatingEmbed : labels.actions.createEmbed }) })] }), embedCode && (jsx(Dialog, { open: !!embedCode, onOpenChange: (open) => {
|
|
281176
282215
|
if (!open) {
|
|
281177
282216
|
setEmbedCode('');
|
|
281178
282217
|
}
|
|
@@ -283648,7 +284687,7 @@ function AgentCard({ agent, onClick, variant = 'default', isStarred = false, isT
|
|
|
283648
284687
|
onClick(agent);
|
|
283649
284688
|
}
|
|
283650
284689
|
};
|
|
283651
|
-
return (jsx(Card, { className: "cursor-pointer rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow hover:shadow-md md:h-full", onClick: handleCardClick, tabIndex: 0, onKeyDown: handleCardKeyDown, "aria-label": `${exploreAriaPrefix} ${agent.name}. ${agent.description || ''}`, children: jsx(CardContent, { className: "p-6 md:h-full", children: jsxs("div", { className: "flex items-start gap-4 md:h-full", children: [jsxs(Avatar, { className: "h-12 w-12 shrink-0 rounded-full", children: [jsx(AvatarImage, { src: agent.profile_image, alt: agent.name, className: "object-cover" }), jsx(AvatarFallback, { children: agent.name.substring(0, 2).toUpperCase() })] }), jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsx("h3", { className: "text-sm font-medium text-gray-900", children: agent.name }), variant === 'with-star' && onToggleStar && (jsx(StarButton, { isStarred: isStarred, isToggling: isTogglingStar, disabled: disableStar, onClick: (e) => {
|
|
284690
|
+
return (jsx(Card$1, { className: "cursor-pointer rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow hover:shadow-md md:h-full", onClick: handleCardClick, tabIndex: 0, onKeyDown: handleCardKeyDown, "aria-label": `${exploreAriaPrefix} ${agent.name}. ${agent.description || ''}`, children: jsx(CardContent, { className: "p-6 md:h-full", children: jsxs("div", { className: "flex items-start gap-4 md:h-full", children: [jsxs(Avatar, { className: "h-12 w-12 shrink-0 rounded-full", children: [jsx(AvatarImage, { src: agent.profile_image, alt: agent.name, className: "object-cover" }), jsx(AvatarFallback, { children: agent.name.substring(0, 2).toUpperCase() })] }), jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { className: "mb-2 flex items-center justify-between", children: [jsx("h3", { className: "text-sm font-medium text-gray-900", children: agent.name }), variant === 'with-star' && onToggleStar && (jsx(StarButton, { isStarred: isStarred, isToggling: isTogglingStar, disabled: disableStar, onClick: (e) => {
|
|
283652
284691
|
e.stopPropagation();
|
|
283653
284692
|
onToggleStar(agent, e);
|
|
283654
284693
|
} }))] }), jsx("p", { className: "mb-3 line-clamp-2 text-sm leading-relaxed text-gray-600", children: agent.description }), agent.updated_at && (jsxs("p", { className: "text-xs text-gray-500", children: [updatedOnLabel, " ", formatDate(agent.updated_at)] }))] })] }) }) }));
|
|
@@ -283683,7 +284722,7 @@ function StarredAgentsSection() {
|
|
|
283683
284722
|
onUnauthenticatedAction === null || onUnauthenticatedAction === void 0 ? void 0 : onUnauthenticatedAction();
|
|
283684
284723
|
}, [username, onUnauthenticatedAction]);
|
|
283685
284724
|
const sectionLabels = labels.sections.starred;
|
|
283686
|
-
return (jsxs("div", { children: [jsx("h2", { className: "mb-4 text-lg font-medium text-gray-900", role: "heading", "aria-level": 2, children: sectionLabels.title }), agents.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", "data-testid": "favorites-card-list", role: "list", "aria-label": sectionLabels.ariaLabel, children: agents.map((agent) => (jsx("div", { role: "listitem", children: jsx(AgentCard, { agent: agent, onClick: onAgentClick, variant: "with-star", isStarred: agent.starred, isTogglingStar: togglingAgentId === String(agent.id), onToggleStar: toggleFavorite, disableStar: !username, updatedOnLabel: labels.card.updatedOn, exploreAriaPrefix: labels.card.exploreAriaPrefix }) }, agent.id))) }), hasMore && (jsx("div", { className: "mt-6 flex justify-center", children: jsx(Button$1, { variant: "outline", onClick: () => setLimit((prev) => prev + FAVORITE_AGENTS_LIMIT), disabled: isFetching, "aria-label": sectionLabels.loadMoreAriaLabel, role: "button", children: isFetching ? (jsxs("div", { className: "flex items-center gap-2", children: [jsx(Spinner, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { children: labels.loadingMore })] })) : (labels.seeMore) }) }))] })) : (jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3", children: jsx(Card, { "data-testid": "favorites-card", className: "cursor-pointer rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow duration-200 hover:shadow-md md:col-span-2 lg:col-span-3", onClick: handleFavoriteCardClick, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
284725
|
+
return (jsxs("div", { children: [jsx("h2", { className: "mb-4 text-lg font-medium text-gray-900", role: "heading", "aria-level": 2, children: sectionLabels.title }), agents.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", "data-testid": "favorites-card-list", role: "list", "aria-label": sectionLabels.ariaLabel, children: agents.map((agent) => (jsx("div", { role: "listitem", children: jsx(AgentCard, { agent: agent, onClick: onAgentClick, variant: "with-star", isStarred: agent.starred, isTogglingStar: togglingAgentId === String(agent.id), onToggleStar: toggleFavorite, disableStar: !username, updatedOnLabel: labels.card.updatedOn, exploreAriaPrefix: labels.card.exploreAriaPrefix }) }, agent.id))) }), hasMore && (jsx("div", { className: "mt-6 flex justify-center", children: jsx(Button$1, { variant: "outline", onClick: () => setLimit((prev) => prev + FAVORITE_AGENTS_LIMIT), disabled: isFetching, "aria-label": sectionLabels.loadMoreAriaLabel, role: "button", children: isFetching ? (jsxs("div", { className: "flex items-center gap-2", children: [jsx(Spinner, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { children: labels.loadingMore })] })) : (labels.seeMore) }) }))] })) : (jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3", children: jsx(Card$1, { "data-testid": "favorites-card", className: "cursor-pointer rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow duration-200 hover:shadow-md md:col-span-2 lg:col-span-3", onClick: handleFavoriteCardClick, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
283687
284726
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
283688
284727
|
e.preventDefault();
|
|
283689
284728
|
handleFavoriteCardClick();
|
|
@@ -283718,7 +284757,7 @@ function FeaturedAgentsSection() {
|
|
|
283718
284757
|
if (agents.length === 0 && !isFetching) {
|
|
283719
284758
|
return null;
|
|
283720
284759
|
}
|
|
283721
|
-
return (jsxs("div", { children: [jsx("h2", { className: "mb-4 text-lg font-medium text-gray-900", role: "heading", "aria-level": 2, children: sectionLabels.title }), agents.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: agents.map((agent) => (jsx(AgentCard, { agent: agent, onClick: onAgentClick, variant: "with-star", isStarred: agent.starred, isTogglingStar: togglingAgentId === String(agent.id), onToggleStar: toggleFavorite, disableStar: !username, updatedOnLabel: labels.card.updatedOn, exploreAriaPrefix: labels.card.exploreAriaPrefix }, agent.id))) }), hasMore && (jsx("div", { className: "mt-6 flex justify-center", children: jsx(Button$1, { variant: "outline", onClick: () => setLimit((prev) => prev + FEATURED_AGENTS_LIMIT), disabled: isFetching, "aria-label": sectionLabels.loadMoreAriaLabel, children: isFetching ? (jsxs("div", { className: "flex items-center gap-2", children: [jsx(Spinner, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { children: labels.loadingMore })] })) : (labels.seeMore) }) }))] })) : (jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3", children: jsx(Card, { className: "rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] md:col-span-2 lg:col-span-3", children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex items-start gap-4", children: [jsx("div", { className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-lg bg-[#D0E0FF]", children: jsx(Award, { className: "h-6 w-6 text-[#38A1E5]" }) }), jsxs("div", { className: "min-w-0 flex-1", children: [jsx("h3", { className: "mb-2 text-sm font-medium text-gray-900", children: sectionLabels.emptyTitle }), jsx("p", { className: "mb-3 text-sm leading-relaxed text-gray-600", children: sectionLabels.emptyDescription }), jsx("p", { className: "text-xs text-gray-500", children: sectionLabels.emptySubtext })] })] }) }) }) }))] }));
|
|
284760
|
+
return (jsxs("div", { children: [jsx("h2", { className: "mb-4 text-lg font-medium text-gray-900", role: "heading", "aria-level": 2, children: sectionLabels.title }), agents.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: agents.map((agent) => (jsx(AgentCard, { agent: agent, onClick: onAgentClick, variant: "with-star", isStarred: agent.starred, isTogglingStar: togglingAgentId === String(agent.id), onToggleStar: toggleFavorite, disableStar: !username, updatedOnLabel: labels.card.updatedOn, exploreAriaPrefix: labels.card.exploreAriaPrefix }, agent.id))) }), hasMore && (jsx("div", { className: "mt-6 flex justify-center", children: jsx(Button$1, { variant: "outline", onClick: () => setLimit((prev) => prev + FEATURED_AGENTS_LIMIT), disabled: isFetching, "aria-label": sectionLabels.loadMoreAriaLabel, children: isFetching ? (jsxs("div", { className: "flex items-center gap-2", children: [jsx(Spinner, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { children: labels.loadingMore })] })) : (labels.seeMore) }) }))] })) : (jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3", children: jsx(Card$1, { className: "rounded-lg border border-[#D0E0FF] bg-[#F5F8FF] md:col-span-2 lg:col-span-3", children: jsx(CardContent, { className: "p-6", children: jsxs("div", { className: "flex items-start gap-4", children: [jsx("div", { className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-lg bg-[#D0E0FF]", children: jsx(Award, { className: "h-6 w-6 text-[#38A1E5]" }) }), jsxs("div", { className: "min-w-0 flex-1", children: [jsx("h3", { className: "mb-2 text-sm font-medium text-gray-900", children: sectionLabels.emptyTitle }), jsx("p", { className: "mb-3 text-sm leading-relaxed text-gray-600", children: sectionLabels.emptyDescription }), jsx("p", { className: "text-xs text-gray-500", children: sectionLabels.emptySubtext })] })] }) }) }) }))] }));
|
|
283722
284761
|
}
|
|
283723
284762
|
|
|
283724
284763
|
function CustomAgentsSection() {
|
|
@@ -283750,7 +284789,7 @@ function CustomAgentsSection() {
|
|
|
283750
284789
|
onCreateAgent === null || onCreateAgent === void 0 ? void 0 : onCreateAgent();
|
|
283751
284790
|
}, [username, onUnauthenticatedAction, onCreateAgent]);
|
|
283752
284791
|
const sectionLabels = labels.sections.custom;
|
|
283753
|
-
const createCard = onCreateAgent ? (jsx(WithPermissions, { rbacResource: createAgentRbacResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => hasPermission || !enableRBAC ? (jsx(Card, { className: "cursor-pointer border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow duration-200 hover:shadow-md", onClick: handleCreate, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
284792
|
+
const createCard = onCreateAgent ? (jsx(WithPermissions, { rbacResource: createAgentRbacResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => hasPermission || !enableRBAC ? (jsx(Card$1, { className: "cursor-pointer border border-[#D0E0FF] bg-[#F5F8FF] transition-shadow duration-200 hover:shadow-md", onClick: handleCreate, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
283754
284793
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
283755
284794
|
e.preventDefault();
|
|
283756
284795
|
handleCreate();
|
|
@@ -286971,7 +288010,7 @@ function ExploreMentors({ tenantKey, onBrowseAll, onSelectMentor }) {
|
|
|
286971
288010
|
name: mentor.name,
|
|
286972
288011
|
// @ts-expect-error - description property may not exist on Mentor type
|
|
286973
288012
|
description: mentor.description || t('welcomeChatExploreMentors.noDescription'),
|
|
286974
|
-
}), children: jsx(Card, { className: "h-full cursor-pointer border border-[#D0E0FF] bg-[#F5F8FF] shadow-xs transition-all duration-200 focus-within:shadow-md hover:shadow-sm", children: jsx(CardContent, { className: "h-full p-4", children: jsxs("div", { className: "flex h-full items-start gap-3", children: [jsxs(Avatar, { className: "h-12 w-12 flex-shrink-0", children: [jsx(AvatarImage
|
|
288013
|
+
}), children: jsx(Card$1, { className: "h-full cursor-pointer border border-[#D0E0FF] bg-[#F5F8FF] shadow-xs transition-all duration-200 focus-within:shadow-md hover:shadow-sm", children: jsx(CardContent, { className: "h-full p-4", children: jsxs("div", { className: "flex h-full items-start gap-3", children: [jsxs(Avatar, { className: "h-12 w-12 flex-shrink-0", children: [jsx(AvatarImage
|
|
286975
288014
|
// @ts-expect-error - profile_image property may not exist on Mentor type
|
|
286976
288015
|
, {
|
|
286977
288016
|
// @ts-expect-error - profile_image property may not exist on Mentor type
|
|
@@ -287019,7 +288058,7 @@ function ConversationStarters({ onTemplateSelect, enabledGuidedPrompts, sessionI
|
|
|
287019
288058
|
}
|
|
287020
288059
|
return (jsxs("div", { className: "mx-auto w-full max-w-6xl px-4", children: [jsx("h2", { className: "mb-6 text-xl font-semibold text-gray-900", children: t('welcomeChatConversationStarters.heading') }), jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5", children: (_b = guidedPrompts === null || guidedPrompts === void 0 ? void 0 : guidedPrompts.results) === null || _b === void 0 ? void 0 : _b.map((guidedPrompt, index) => {
|
|
287021
288060
|
var _a;
|
|
287022
|
-
return (jsx(Card, { className: cn('h-full border border-[#D0E0FF] bg-[#F5F8FF] shadow-xs transition-all duration-200', isChatDisabledByRbac
|
|
288061
|
+
return (jsx(Card$1, { className: cn('h-full border border-[#D0E0FF] bg-[#F5F8FF] shadow-xs transition-all duration-200', isChatDisabledByRbac
|
|
287023
288062
|
? 'cursor-not-allowed opacity-50'
|
|
287024
288063
|
: 'cursor-pointer hover:shadow-sm focus:shadow-md focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 focus:outline-none'), onClick: () => !isChatDisabledByRbac && onTemplateSelect(guidedPrompt.prompt), onKeyDown: (e) => {
|
|
287025
288064
|
if (isChatDisabledByRbac)
|
|
@@ -288476,7 +289515,7 @@ function TaskMetricsCards({ tasksData, labels }) {
|
|
|
288476
289515
|
const totalTasks = tasksData.length;
|
|
288477
289516
|
const completedTasks = tasksData.filter((t) => t.status === 'Completed').length;
|
|
288478
289517
|
const failedTasks = tasksData.filter((t) => t.status === 'Failed').length;
|
|
288479
|
-
return (jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4", children: [jsx(Card, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.total }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: totalTasks })] }), jsx(ClipboardList, { className: "h-6 w-6 text-blue-500 flex-shrink-0" })] }) }), jsx(Card, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.completed }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: completedTasks })] }), jsx(CircleCheckBig, { className: "h-6 w-6 text-blue-500 flex-shrink-0" })] }) }), jsx(Card, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.failed }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: failedTasks })] }), jsx(CircleX, { className: "h-6 w-6 text-red-500 flex-shrink-0" })] }) })] }));
|
|
289518
|
+
return (jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4", children: [jsx(Card$1, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.total }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: totalTasks })] }), jsx(ClipboardList, { className: "h-6 w-6 text-blue-500 flex-shrink-0" })] }) }), jsx(Card$1, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.completed }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: completedTasks })] }), jsx(CircleCheckBig, { className: "h-6 w-6 text-blue-500 flex-shrink-0" })] }) }), jsx(Card$1, { className: "w-full bg-white border border-blue-200", children: jsxs(CardContent, { className: "p-4 flex flex-row items-center justify-between", children: [jsxs("div", { className: "flex flex-col", children: [jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: labels.metrics.failed }), jsx("p", { className: "text-2xl font-semibold text-gray-900", children: failedTasks })] }), jsx(CircleX, { className: "h-6 w-6 text-red-500 flex-shrink-0" })] }) })] }));
|
|
288480
289519
|
}
|
|
288481
289520
|
|
|
288482
289521
|
const STATUS_BADGE = {
|
|
@@ -289558,7 +290597,7 @@ function PromptCard({ prompt, onEdit, onSelect, title, tenantKey, userIsStudent
|
|
|
289558
290597
|
onSelect(prompt.prompt);
|
|
289559
290598
|
}
|
|
289560
290599
|
};
|
|
289561
|
-
return (jsxs(Fragment$1, { children: [jsx(Card, { className: "overflow-hidden border-0 bg-[#F8F8F8] transition-shadow hover:shadow-md", children: jsxs(CardContent, { className: "h-full p-4", children: [jsxs("div", { className: "mb-5 flex flex-1 items-start gap-2", children: [jsx(MessageSquare, { className: "mt-1 h-4 w-4 flex-shrink-0 text-gray-400" }), jsxs("div", { className: "flex-1", children: [jsx("h3", { className: "text-sm font-medium text-gray-600", children: title }), jsx(Markdown, { className: "mt-1 line-clamp-4 text-sm text-gray-500", children: parsePrompt(prompt.prompt) })] })] }), jsxs("div", { className: "flex flex-wrap justify-start gap-2", children: [!userIsStudent && (jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: handleEdit, disabled: isDeleting, children: [jsx(SquarePen, { className: "mr-1.5 h-3 w-3" }), t('promptGalleryModalPromptCard.edit')] })), jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: () => executeWithTrialCheck(handleRun), disabled: isDeleting, children: [jsx(Play, { className: "mr-1.5 h-3 w-3" }), t('promptGalleryModalPromptCard.run')] }), jsx(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: () => copy(prompt.prompt), disabled: isDeleting, children: status === 'success' ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "mr-1.5 h-3 w-3" }), " ", t('promptGalleryModalPromptCard.copied')] })) : (jsxs(Fragment$1, { children: [jsx(Copy, { className: "mr-1.5 h-3 w-3" }), " ", t('promptGalleryModalPromptCard.copy')] })) }), !userIsStudent && (jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600 hover:text-gray-600", onClick: () => executeWithTrialCheck(handleDelete), disabled: isDeleting, children: [jsx(DeleteIcon, { className: cn('mr-1.5 h-3 w-3', isDeleting && 'animate-spin') }), t('promptGalleryModalPromptCard.delete')] }))] })] }) }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { onClose: closeModal, isOpen: isModalOpen }))] }));
|
|
290600
|
+
return (jsxs(Fragment$1, { children: [jsx(Card$1, { className: "overflow-hidden border-0 bg-[#F8F8F8] transition-shadow hover:shadow-md", children: jsxs(CardContent, { className: "h-full p-4", children: [jsxs("div", { className: "mb-5 flex flex-1 items-start gap-2", children: [jsx(MessageSquare, { className: "mt-1 h-4 w-4 flex-shrink-0 text-gray-400" }), jsxs("div", { className: "flex-1", children: [jsx("h3", { className: "text-sm font-medium text-gray-600", children: title }), jsx(Markdown, { className: "mt-1 line-clamp-4 text-sm text-gray-500", children: parsePrompt(prompt.prompt) })] })] }), jsxs("div", { className: "flex flex-wrap justify-start gap-2", children: [!userIsStudent && (jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: handleEdit, disabled: isDeleting, children: [jsx(SquarePen, { className: "mr-1.5 h-3 w-3" }), t('promptGalleryModalPromptCard.edit')] })), jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: () => executeWithTrialCheck(handleRun), disabled: isDeleting, children: [jsx(Play, { className: "mr-1.5 h-3 w-3" }), t('promptGalleryModalPromptCard.run')] }), jsx(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600", onClick: () => copy(prompt.prompt), disabled: isDeleting, children: status === 'success' ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "mr-1.5 h-3 w-3" }), " ", t('promptGalleryModalPromptCard.copied')] })) : (jsxs(Fragment$1, { children: [jsx(Copy, { className: "mr-1.5 h-3 w-3" }), " ", t('promptGalleryModalPromptCard.copy')] })) }), !userIsStudent && (jsxs(Button$1, { variant: "outline", size: "sm", className: "flex h-7 items-center border-gray-200 px-3 text-xs font-normal text-gray-600 hover:text-gray-600", onClick: () => executeWithTrialCheck(handleDelete), disabled: isDeleting, children: [jsx(DeleteIcon, { className: cn('mr-1.5 h-3 w-3', isDeleting && 'animate-spin') }), t('promptGalleryModalPromptCard.delete')] }))] })] }) }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { onClose: closeModal, isOpen: isModalOpen }))] }));
|
|
289562
290601
|
}
|
|
289563
290602
|
|
|
289564
290603
|
function EmptyPrompts() {
|