@iblai/iblai-js 1.27.0 → 2.1.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.
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useCallback, useReducer, useRef, useImperativeHandle, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
4
4
  import * as dataLayer from '@iblai/data-layer';
5
- import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, 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, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, 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, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useStarMentorMutation, useUnstarMentorMutation, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, 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, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, 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, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
6
- import { getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$3, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
5
+ import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, 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, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, 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, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useStarMentorMutation, useUnstarMentorMutation, 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, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, 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, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
6
+ import { getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, 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, 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';
@@ -98750,6 +98750,7 @@ var datasetsTabLabels$3 = {
98750
98750
  title: "Datasets",
98751
98751
  description: "Manage training datasets and knowledge sources."
98752
98752
  },
98753
+ infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
98753
98754
  search: {
98754
98755
  placeholder: "Search datasets..."
98755
98756
  },
@@ -100719,18 +100720,10 @@ var settingsTabLabels$3 = {
100719
100720
  label: "Featured",
100720
100721
  tooltip: "Feature this agent to highlight it in listings."
100721
100722
  },
100722
- ltiAccessible: {
100723
- label: "LTI Accessible",
100724
- tooltip: "Allows this agent to be accessible via LTI launches. Unselecting this will immediately remove access for any users users that have launched this via LTI."
100725
- },
100726
100723
  showAttachment: {
100727
100724
  label: "Show Attachment",
100728
100725
  tooltip: "Show Attachment Options in Chat Interface"
100729
100726
  },
100730
- showVoiceCall: {
100731
- label: "Show Voice Call",
100732
- tooltip: "Show Voice Call Options in Chat Interface"
100733
- },
100734
100727
  showVoiceRecord: {
100735
100728
  label: "Show Voice Record",
100736
100729
  tooltip: "Show Voice Recording Options in Chat Interface"
@@ -100748,6 +100741,22 @@ var settingsTabLabels$3 = {
100748
100741
  altText: "Agent",
100749
100742
  uploadHint: "+ Upload",
100750
100743
  removeAriaLabel: "Remove image"
100744
+ },
100745
+ enhancedDocRetrieval: {
100746
+ label: "Enhanced document retrieval",
100747
+ tooltip: "Run multiple search queries per question to pull in more relevant documents."
100748
+ },
100749
+ promptCaching: {
100750
+ label: "Prompt caching",
100751
+ tooltip: "Cache repeated prompt context to lower latency and cost on long conversations."
100752
+ },
100753
+ privateMode: {
100754
+ label: "Enable private mode",
100755
+ tooltip: "When on, every conversation with this agent runs in private mode — no chat history or memory is stored for any user. Use this for sensitive or compliance-bound deployments."
100756
+ },
100757
+ smartDocRetrieval: {
100758
+ label: "Smart document retrieval",
100759
+ tooltip: "Use function calling during voice calls to fetch documents only when needed."
100751
100760
  }
100752
100761
  },
100753
100762
  actions: {
@@ -100758,7 +100767,8 @@ var settingsTabLabels$3 = {
100758
100767
  },
100759
100768
  toasts: {
100760
100769
  saveSuccess: "Agent updated successfully",
100761
- saveError: "Failed to update agent"
100770
+ saveError: "Failed to update agent",
100771
+ voiceCallError: "Agent saved, but voice-call settings could not be updated"
100762
100772
  },
100763
100773
  deleteModal: {
100764
100774
  title: "Delete Agent",
@@ -100786,6 +100796,16 @@ var settingsTabLabels$3 = {
100786
100796
  successToast: "Agent copied successfully. Switching to new agent",
100787
100797
  errorToast: "Failed to copy agent",
100788
100798
  missingContextToast: "Unable to copy agent. Missing context."
100799
+ },
100800
+ subTabs: {
100801
+ basic: "Basic",
100802
+ discovery: "Discovery",
100803
+ capabilities: "Capabilities"
100804
+ },
100805
+ sections: {
100806
+ chatExperience: "Chat experience",
100807
+ voiceCalls: "Voice & calls",
100808
+ advanced: "Advanced"
100789
100809
  }
100790
100810
  };
100791
100811
  var skillsProfileAddSkillDialog$3 = {
@@ -101343,21 +101363,18 @@ var tabsSettingsTab$3 = {
101343
101363
  whoCanViewTooltipAriaLabel: "More info about chat access",
101344
101364
  whoCanChatTooltipAriaLabel: "More info about chat access",
101345
101365
  featuredTooltipAriaLabel: "More info about featured",
101346
- ltiAccessibleTooltipAriaLabel: "More info about lti accessibility",
101347
101366
  showAttachmentTooltipAriaLabel: "More info about show attachment",
101348
- showVoiceCallTooltipAriaLabel: "More info about show voice call",
101349
101367
  showVoiceRecordTooltipAriaLabel: "More info about show voice record",
101350
101368
  allowCopiesTooltipAriaLabel: "More info about allow copies",
101351
101369
  showReasoningTooltipAriaLabel: "More info about verbose reasoning",
101352
- featuredToggleAriaLabel: "Featured {state}",
101353
- ltiAccessibleToggleAriaLabel: "Is lti accessible {state}",
101354
- showAttachmentToggleAriaLabel: "Show attachment {state}",
101355
- showVoiceCallToggleAriaLabel: "Show voice call {state}",
101356
- showVoiceRecordToggleAriaLabel: "Show voice record {state}",
101357
- allowCopiesToggleAriaLabel: "Allow copies {state}",
101358
- showReasoningToggleAriaLabel: "Verbose reasoning {state}",
101359
101370
  toggleStateEnabled: "enabled",
101360
- toggleStateDisabled: "disabled"
101371
+ toggleStateDisabled: "disabled",
101372
+ settingsSubCategoriesAriaLabel: "Settings sub-categories",
101373
+ enhancedDocRetrievalTooltipAriaLabel: "More info about enhanced document retrieval",
101374
+ promptCachingTooltipAriaLabel: "More info about prompt caching",
101375
+ privateModeTooltipAriaLabel: "More info about enable private mode",
101376
+ smartDocRetrievalTooltipAriaLabel: "More info about smart document retrieval",
101377
+ toggleAriaLabel: "{label} {state}"
101361
101378
  };
101362
101379
  var tabsTeamsaccesspanel$3 = {
101363
101380
  permissionRead: "Read",
@@ -104433,6 +104450,7 @@ var datasetsTabLabels$2 = {
104433
104450
  title: "Jeux de données",
104434
104451
  description: "Gérez les jeux de données d'entraînement et les sources de connaissances."
104435
104452
  },
104453
+ infoBox: "Formez votre agent avec vos propres contenus. Importez des documents, des fichiers ou des liens, et il y puisera ses réponses — en s'appuyant sur votre contenu plutôt qu'en devinant.",
104436
104454
  search: {
104437
104455
  placeholder: "Rechercher des jeux de données..."
104438
104456
  },
@@ -106402,18 +106420,10 @@ var settingsTabLabels$2 = {
106402
106420
  label: "En vedette",
106403
106421
  tooltip: "Mettez cet agent en avant pour le mettre en valeur dans les listes."
106404
106422
  },
106405
- ltiAccessible: {
106406
- label: "Accessible via LTI",
106407
- tooltip: "Permet à cet agent d'être accessible via les lancements LTI. La désélection supprimera immédiatement l'accès pour tous les utilisateurs qui ont lancé cet agent via LTI."
106408
- },
106409
106423
  showAttachment: {
106410
106424
  label: "Afficher les pièces jointes",
106411
106425
  tooltip: "Afficher les options de pièces jointes dans l'interface de chat"
106412
106426
  },
106413
- showVoiceCall: {
106414
- label: "Afficher l'appel vocal",
106415
- tooltip: "Afficher les options d'appel vocal dans l'interface de chat"
106416
- },
106417
106427
  showVoiceRecord: {
106418
106428
  label: "Afficher l'enregistrement vocal",
106419
106429
  tooltip: "Afficher les options d'enregistrement vocal dans l'interface de chat"
@@ -106431,6 +106441,22 @@ var settingsTabLabels$2 = {
106431
106441
  altText: "Agent",
106432
106442
  uploadHint: "+ Téléverser",
106433
106443
  removeAriaLabel: "Supprimer l'image"
106444
+ },
106445
+ enhancedDocRetrieval: {
106446
+ label: "Enhanced document retrieval",
106447
+ tooltip: "Run multiple search queries per question to pull in more relevant documents."
106448
+ },
106449
+ promptCaching: {
106450
+ label: "Prompt caching",
106451
+ tooltip: "Cache repeated prompt context to lower latency and cost on long conversations."
106452
+ },
106453
+ privateMode: {
106454
+ label: "Enable private mode",
106455
+ tooltip: "When on, every conversation with this agent runs in private mode — no chat history or memory is stored for any user. Use this for sensitive or compliance-bound deployments."
106456
+ },
106457
+ smartDocRetrieval: {
106458
+ label: "Smart document retrieval",
106459
+ tooltip: "Use function calling during voice calls to fetch documents only when needed."
106434
106460
  }
106435
106461
  },
106436
106462
  actions: {
@@ -106441,7 +106467,8 @@ var settingsTabLabels$2 = {
106441
106467
  },
106442
106468
  toasts: {
106443
106469
  saveSuccess: "Agent mis à jour avec succès",
106444
- saveError: "Échec de la mise à jour de l'agent"
106470
+ saveError: "Échec de la mise à jour de l'agent",
106471
+ voiceCallError: "Agent saved, but voice-call settings could not be updated"
106445
106472
  },
106446
106473
  deleteModal: {
106447
106474
  title: "Supprimer l'agent",
@@ -106469,6 +106496,16 @@ var settingsTabLabels$2 = {
106469
106496
  successToast: "Agent copié avec succès. Basculement vers le nouvel agent",
106470
106497
  errorToast: "Échec de la copie de l'agent",
106471
106498
  missingContextToast: "Impossible de copier l'agent. Contexte manquant."
106499
+ },
106500
+ subTabs: {
106501
+ basic: "Basic",
106502
+ discovery: "Discovery",
106503
+ capabilities: "Capabilities"
106504
+ },
106505
+ sections: {
106506
+ chatExperience: "Chat experience",
106507
+ voiceCalls: "Voice & calls",
106508
+ advanced: "Advanced"
106472
106509
  }
106473
106510
  };
106474
106511
  var skillsProfileAddSkillDialog$2 = {
@@ -107026,21 +107063,18 @@ var tabsSettingsTab$2 = {
107026
107063
  whoCanViewTooltipAriaLabel: "Plus d'informations sur l'accès à la consultation",
107027
107064
  whoCanChatTooltipAriaLabel: "Plus d'informations sur l'accès au chat",
107028
107065
  featuredTooltipAriaLabel: "Plus d'informations sur la mise en avant",
107029
- ltiAccessibleTooltipAriaLabel: "Plus d'informations sur l'accessibilité LTI",
107030
107066
  showAttachmentTooltipAriaLabel: "Plus d'informations sur l'affichage des pièces jointes",
107031
- showVoiceCallTooltipAriaLabel: "Plus d'informations sur l'affichage des appels vocaux",
107032
107067
  showVoiceRecordTooltipAriaLabel: "Plus d'informations sur l'affichage de l'enregistrement vocal",
107033
107068
  allowCopiesTooltipAriaLabel: "Plus d'informations sur l'autorisation des copies",
107034
107069
  showReasoningTooltipAriaLabel: "Plus d'informations sur le raisonnement détaillé",
107035
- featuredToggleAriaLabel: "Mis en avant {state}",
107036
- ltiAccessibleToggleAriaLabel: "Accessible via LTI {state}",
107037
- showAttachmentToggleAriaLabel: "Affichage des pièces jointes {state}",
107038
- showVoiceCallToggleAriaLabel: "Affichage des appels vocaux {state}",
107039
- showVoiceRecordToggleAriaLabel: "Affichage de l'enregistrement vocal {state}",
107040
- allowCopiesToggleAriaLabel: "Autoriser les copies {state}",
107041
- showReasoningToggleAriaLabel: "Raisonnement détaillé {state}",
107042
107070
  toggleStateEnabled: "activé",
107043
- toggleStateDisabled: "désactivé"
107071
+ toggleStateDisabled: "désactivé",
107072
+ settingsSubCategoriesAriaLabel: "Settings sub-categories",
107073
+ enhancedDocRetrievalTooltipAriaLabel: "More info about enhanced document retrieval",
107074
+ promptCachingTooltipAriaLabel: "More info about prompt caching",
107075
+ privateModeTooltipAriaLabel: "More info about enable private mode",
107076
+ smartDocRetrievalTooltipAriaLabel: "More info about smart document retrieval",
107077
+ toggleAriaLabel: "{label} {state}"
107044
107078
  };
107045
107079
  var tabsTeamsaccesspanel$2 = {
107046
107080
  permissionRead: "Lire",
@@ -110116,6 +110150,7 @@ var datasetsTabLabels$1 = {
110116
110150
  title: "Conjuntos de datos",
110117
110151
  description: "Administre los conjuntos de datos de entrenamiento y las fuentes de conocimiento."
110118
110152
  },
110153
+ infoBox: "Enseña a tu agente con tu propio material. Sube documentos, archivos o enlaces y responderá a partir de ellos, basándose en tu contenido en lugar de adivinar.",
110119
110154
  search: {
110120
110155
  placeholder: "Buscar conjuntos de datos..."
110121
110156
  },
@@ -112085,18 +112120,10 @@ var settingsTabLabels$1 = {
112085
112120
  label: "Destacado",
112086
112121
  tooltip: "Destaque este agente para resaltarlo en los listados."
112087
112122
  },
112088
- ltiAccessible: {
112089
- label: "Accesible vía LTI",
112090
- tooltip: "Permite que este agente sea accesible mediante lanzamientos LTI. Al deseleccionar, se eliminará inmediatamente el acceso para todos los usuarios que lo hayan lanzado a través de LTI."
112091
- },
112092
112123
  showAttachment: {
112093
112124
  label: "Mostrar archivos adjuntos",
112094
112125
  tooltip: "Mostrar opciones de archivos adjuntos en la interfaz de chat"
112095
112126
  },
112096
- showVoiceCall: {
112097
- label: "Mostrar llamada de voz",
112098
- tooltip: "Mostrar opciones de llamada de voz en la interfaz de chat"
112099
- },
112100
112127
  showVoiceRecord: {
112101
112128
  label: "Mostrar grabación de voz",
112102
112129
  tooltip: "Mostrar opciones de grabación de voz en la interfaz de chat"
@@ -112114,6 +112141,22 @@ var settingsTabLabels$1 = {
112114
112141
  altText: "Agente",
112115
112142
  uploadHint: "+ Subir",
112116
112143
  removeAriaLabel: "Eliminar imagen"
112144
+ },
112145
+ enhancedDocRetrieval: {
112146
+ label: "Enhanced document retrieval",
112147
+ tooltip: "Run multiple search queries per question to pull in more relevant documents."
112148
+ },
112149
+ promptCaching: {
112150
+ label: "Prompt caching",
112151
+ tooltip: "Cache repeated prompt context to lower latency and cost on long conversations."
112152
+ },
112153
+ privateMode: {
112154
+ label: "Enable private mode",
112155
+ tooltip: "When on, every conversation with this agent runs in private mode — no chat history or memory is stored for any user. Use this for sensitive or compliance-bound deployments."
112156
+ },
112157
+ smartDocRetrieval: {
112158
+ label: "Smart document retrieval",
112159
+ tooltip: "Use function calling during voice calls to fetch documents only when needed."
112117
112160
  }
112118
112161
  },
112119
112162
  actions: {
@@ -112124,7 +112167,8 @@ var settingsTabLabels$1 = {
112124
112167
  },
112125
112168
  toasts: {
112126
112169
  saveSuccess: "Agente actualizado correctamente",
112127
- saveError: "Error al actualizar el agente"
112170
+ saveError: "Error al actualizar el agente",
112171
+ voiceCallError: "Agent saved, but voice-call settings could not be updated"
112128
112172
  },
112129
112173
  deleteModal: {
112130
112174
  title: "Eliminar agente",
@@ -112152,6 +112196,16 @@ var settingsTabLabels$1 = {
112152
112196
  successToast: "Agente copiado correctamente. Cambiando al nuevo agente",
112153
112197
  errorToast: "Error al copiar el agente",
112154
112198
  missingContextToast: "No se puede copiar el agente. Falta contexto."
112199
+ },
112200
+ subTabs: {
112201
+ basic: "Basic",
112202
+ discovery: "Discovery",
112203
+ capabilities: "Capabilities"
112204
+ },
112205
+ sections: {
112206
+ chatExperience: "Chat experience",
112207
+ voiceCalls: "Voice & calls",
112208
+ advanced: "Advanced"
112155
112209
  }
112156
112210
  };
112157
112211
  var skillsProfileAddSkillDialog$1 = {
@@ -112709,21 +112763,18 @@ var tabsSettingsTab$1 = {
112709
112763
  whoCanViewTooltipAriaLabel: "Más información sobre el acceso de visualización",
112710
112764
  whoCanChatTooltipAriaLabel: "Más información sobre el acceso al chat",
112711
112765
  featuredTooltipAriaLabel: "Más información sobre destacado",
112712
- ltiAccessibleTooltipAriaLabel: "Más información sobre la accesibilidad LTI",
112713
112766
  showAttachmentTooltipAriaLabel: "Más información sobre mostrar adjuntos",
112714
- showVoiceCallTooltipAriaLabel: "Más información sobre mostrar llamadas de voz",
112715
112767
  showVoiceRecordTooltipAriaLabel: "Más información sobre mostrar grabación de voz",
112716
112768
  allowCopiesTooltipAriaLabel: "Más información sobre permitir copias",
112717
112769
  showReasoningTooltipAriaLabel: "Más información sobre el razonamiento detallado",
112718
- featuredToggleAriaLabel: "Destacado {state}",
112719
- ltiAccessibleToggleAriaLabel: "Accesible vía LTI {state}",
112720
- showAttachmentToggleAriaLabel: "Mostrar adjuntos {state}",
112721
- showVoiceCallToggleAriaLabel: "Mostrar llamadas de voz {state}",
112722
- showVoiceRecordToggleAriaLabel: "Mostrar grabación de voz {state}",
112723
- allowCopiesToggleAriaLabel: "Permitir copias {state}",
112724
- showReasoningToggleAriaLabel: "Razonamiento detallado {state}",
112725
112770
  toggleStateEnabled: "activado",
112726
- toggleStateDisabled: "desactivado"
112771
+ toggleStateDisabled: "desactivado",
112772
+ settingsSubCategoriesAriaLabel: "Settings sub-categories",
112773
+ enhancedDocRetrievalTooltipAriaLabel: "More info about enhanced document retrieval",
112774
+ promptCachingTooltipAriaLabel: "More info about prompt caching",
112775
+ privateModeTooltipAriaLabel: "More info about enable private mode",
112776
+ smartDocRetrievalTooltipAriaLabel: "More info about smart document retrieval",
112777
+ toggleAriaLabel: "{label} {state}"
112727
112778
  };
112728
112779
  var tabsTeamsaccesspanel$1 = {
112729
112780
  permissionRead: "Leer",
@@ -115799,6 +115850,7 @@ var datasetsTabLabels = {
115799
115850
  title: "数据集",
115800
115851
  description: "管理训练数据集和知识来源。"
115801
115852
  },
115853
+ infoBox: "用您自己的资料训练智能体。上传文档、文件或链接,它就会依据这些内容作答——基于您的内容,而不是凭空猜测。",
115802
115854
  search: {
115803
115855
  placeholder: "搜索数据集..."
115804
115856
  },
@@ -117768,18 +117820,10 @@ var settingsTabLabels = {
117768
117820
  label: "推荐",
117769
117821
  tooltip: "将此智能体设为推荐,使其在列表中突出显示。"
117770
117822
  },
117771
- ltiAccessible: {
117772
- label: "支持 LTI 访问",
117773
- tooltip: "允许通过 LTI 启动访问此智能体。取消选择后,所有通过 LTI 启动此智能体的用户将立即失去访问权限。"
117774
- },
117775
117823
  showAttachment: {
117776
117824
  label: "显示附件",
117777
117825
  tooltip: "在聊天界面中显示附件选项"
117778
117826
  },
117779
- showVoiceCall: {
117780
- label: "显示语音通话",
117781
- tooltip: "在聊天界面中显示语音通话选项"
117782
- },
117783
117827
  showVoiceRecord: {
117784
117828
  label: "显示语音录制",
117785
117829
  tooltip: "在聊天界面中显示语音录制选项"
@@ -117797,6 +117841,22 @@ var settingsTabLabels = {
117797
117841
  altText: "智能体",
117798
117842
  uploadHint: "+ 上传",
117799
117843
  removeAriaLabel: "移除图片"
117844
+ },
117845
+ enhancedDocRetrieval: {
117846
+ label: "Enhanced document retrieval",
117847
+ tooltip: "Run multiple search queries per question to pull in more relevant documents."
117848
+ },
117849
+ promptCaching: {
117850
+ label: "Prompt caching",
117851
+ tooltip: "Cache repeated prompt context to lower latency and cost on long conversations."
117852
+ },
117853
+ privateMode: {
117854
+ label: "Enable private mode",
117855
+ tooltip: "When on, every conversation with this agent runs in private mode — no chat history or memory is stored for any user. Use this for sensitive or compliance-bound deployments."
117856
+ },
117857
+ smartDocRetrieval: {
117858
+ label: "Smart document retrieval",
117859
+ tooltip: "Use function calling during voice calls to fetch documents only when needed."
117800
117860
  }
117801
117861
  },
117802
117862
  actions: {
@@ -117807,7 +117867,8 @@ var settingsTabLabels = {
117807
117867
  },
117808
117868
  toasts: {
117809
117869
  saveSuccess: "智能体已成功更新",
117810
- saveError: "更新智能体失败"
117870
+ saveError: "更新智能体失败",
117871
+ voiceCallError: "Agent saved, but voice-call settings could not be updated"
117811
117872
  },
117812
117873
  deleteModal: {
117813
117874
  title: "删除智能体",
@@ -117835,6 +117896,16 @@ var settingsTabLabels = {
117835
117896
  successToast: "智能体已成功复制。正在切换到新智能体",
117836
117897
  errorToast: "复制智能体失败",
117837
117898
  missingContextToast: "无法复制智能体。缺少上下文。"
117899
+ },
117900
+ subTabs: {
117901
+ basic: "Basic",
117902
+ discovery: "Discovery",
117903
+ capabilities: "Capabilities"
117904
+ },
117905
+ sections: {
117906
+ chatExperience: "Chat experience",
117907
+ voiceCalls: "Voice & calls",
117908
+ advanced: "Advanced"
117838
117909
  }
117839
117910
  };
117840
117911
  var skillsProfileAddSkillDialog = {
@@ -118392,21 +118463,18 @@ var tabsSettingsTab = {
118392
118463
  whoCanViewTooltipAriaLabel: "关于查看访问权限的更多信息",
118393
118464
  whoCanChatTooltipAriaLabel: "关于聊天访问权限的更多信息",
118394
118465
  featuredTooltipAriaLabel: "关于精选的更多信息",
118395
- ltiAccessibleTooltipAriaLabel: "关于 LTI 可访问性的更多信息",
118396
118466
  showAttachmentTooltipAriaLabel: "关于显示附件的更多信息",
118397
- showVoiceCallTooltipAriaLabel: "关于显示语音通话的更多信息",
118398
118467
  showVoiceRecordTooltipAriaLabel: "关于显示语音录制的更多信息",
118399
118468
  allowCopiesTooltipAriaLabel: "关于允许复制的更多信息",
118400
118469
  showReasoningTooltipAriaLabel: "关于详细推理的更多信息",
118401
- featuredToggleAriaLabel: "精选 {state}",
118402
- ltiAccessibleToggleAriaLabel: "LTI 可访问 {state}",
118403
- showAttachmentToggleAriaLabel: "显示附件 {state}",
118404
- showVoiceCallToggleAriaLabel: "显示语音通话 {state}",
118405
- showVoiceRecordToggleAriaLabel: "显示语音录制 {state}",
118406
- allowCopiesToggleAriaLabel: "允许复制 {state}",
118407
- showReasoningToggleAriaLabel: "详细推理 {state}",
118408
118470
  toggleStateEnabled: "已启用",
118409
- toggleStateDisabled: "已禁用"
118471
+ toggleStateDisabled: "已禁用",
118472
+ settingsSubCategoriesAriaLabel: "Settings sub-categories",
118473
+ enhancedDocRetrievalTooltipAriaLabel: "More info about enhanced document retrieval",
118474
+ promptCachingTooltipAriaLabel: "More info about prompt caching",
118475
+ privateModeTooltipAriaLabel: "More info about enable private mode",
118476
+ smartDocRetrievalTooltipAriaLabel: "More info about smart document retrieval",
118477
+ toggleAriaLabel: "{label} {state}"
118410
118478
  };
118411
118479
  var tabsTeamsaccesspanel = {
118412
118480
  permissionRead: "读取",
@@ -249936,23 +250004,36 @@ function useAgentSettings() {
249936
250004
  return ctx;
249937
250005
  }
249938
250006
 
249939
- function useDatasetsWithPagination(itemsPerPage = 5) {
250007
+ function useDatasetsWithPagination(itemsPerPage = 5, opts = {}) {
250008
+ const { page: controlledPage, search: controlledSearch, onPageChange, onSearchChange } = opts;
250009
+ // Controlled/uncontrolled is decided per axis, independently.
250010
+ const isPageControlled = controlledPage !== undefined;
250011
+ const isSearchControlled = controlledSearch !== undefined;
249940
250012
  const { tenantKey, mentorId, username } = useAgentSettings();
249941
- const [searchQuery, setSearchQuery] = React__default.useState('');
250013
+ // Input echo — keeps typing responsive in both modes and is the source of
250014
+ // truth for the search term when uncontrolled. Seeded from the controlled
250015
+ // value so a URL-driven search shows up immediately on mount.
250016
+ const [searchQuery, setSearchQuery] = React__default.useState(isSearchControlled ? controlledSearch : '');
249942
250017
  const [debouncedSearchQuery] = a$3(searchQuery, 500);
249943
- const [currentPage, setCurrentPage] = React__default.useState(1);
250018
+ const [localPage, setLocalPage] = React__default.useState(1);
249944
250019
  const [isTraining, setIsTraining] = React__default.useState(false);
249945
- const [queryParams, setQueryParams] = React__default.useState({
249946
- limit: itemsPerPage,
249947
- offset: 0,
249948
- query: debouncedSearchQuery,
249949
- });
250020
+ const currentPage = isPageControlled ? controlledPage : localPage;
250021
+ // Reset to the first page during render (not in an effect) when the debounced
250022
+ // search changes, so the query never fires with a stale offset. Only touches
250023
+ // internal page state — in page-controlled mode the host performs the reset
250024
+ // via the onSearchChange contract above.
250025
+ const [lastSearchQuery, setLastSearchQuery] = React__default.useState(debouncedSearchQuery);
250026
+ if (lastSearchQuery !== debouncedSearchQuery) {
250027
+ setLastSearchQuery(debouncedSearchQuery);
250028
+ if (!isPageControlled)
250029
+ setLocalPage(1);
250030
+ }
249950
250031
  const { data: datasets, isLoading: isDatasetsLoading, isFetching: isDatasetsFetching, } = useGetTrainingDocumentsQuery({
249951
250032
  org: tenantKey,
249952
250033
  pathway: mentorId,
249953
- limit: queryParams.limit,
249954
- offset: queryParams.offset,
249955
- search: queryParams.query,
250034
+ limit: itemsPerPage,
250035
+ offset: (currentPage - 1) * itemsPerPage,
250036
+ search: debouncedSearchQuery,
249956
250037
  // @ts-expect-error userId is not in the typed args but the API accepts it
249957
250038
  userId: username !== null && username !== void 0 ? username : '',
249958
250039
  }, {
@@ -249973,24 +250054,31 @@ function useDatasetsWithPagination(itemsPerPage = 5) {
249973
250054
  setIsTraining(_isTraining);
249974
250055
  }
249975
250056
  }, [isDatasetsFetching]);
249976
- // Effect to update offset when page changes
250057
+ // Report the debounced search back to the host (search-controlled only).
250058
+ // Firing this implies a page reset — see the onSearchChange contract above.
249977
250059
  React__default.useEffect(() => {
249978
- setQueryParams((prev) => ({
249979
- ...prev,
249980
- offset: (currentPage - 1) * itemsPerPage,
249981
- }));
249982
- }, [currentPage, itemsPerPage]);
249983
- // Effect to update query parameter when search changes
250060
+ if (!isSearchControlled)
250061
+ return;
250062
+ if (debouncedSearchQuery === controlledSearch)
250063
+ return;
250064
+ onSearchChange === null || onSearchChange === void 0 ? void 0 : onSearchChange(debouncedSearchQuery);
250065
+ }, [debouncedSearchQuery, isSearchControlled]);
250066
+ // Reconcile the input echo when the controlled search changes externally
250067
+ // (back/forward, reload, shared link) without clobbering in-flight typing.
249984
250068
  React__default.useEffect(() => {
249985
- setQueryParams((prev) => ({
249986
- ...prev,
249987
- query: debouncedSearchQuery,
249988
- offset: 0, // Reset to first page when search changes
249989
- }));
249990
- setCurrentPage(1); // Also reset current page state
249991
- }, [debouncedSearchQuery]);
250069
+ if (!isSearchControlled)
250070
+ return;
250071
+ if (controlledSearch === debouncedSearchQuery)
250072
+ return;
250073
+ setSearchQuery(controlledSearch);
250074
+ }, [controlledSearch, isSearchControlled]);
249992
250075
  const handlePageChange = (newPage) => {
249993
- setCurrentPage(newPage);
250076
+ if (isPageControlled) {
250077
+ onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(newPage);
250078
+ }
250079
+ else {
250080
+ setLocalPage(newPage);
250081
+ }
249994
250082
  // Scroll to top of the list when changing pages
249995
250083
  window.scrollTo({ top: 0, behavior: 'smooth' });
249996
250084
  };
@@ -251893,6 +251981,9 @@ var addMentorToProjectModal = /*#__PURE__*/Object.freeze({
251893
251981
  AddMentorToProjectModal: AddMentorToProjectModal
251894
251982
  });
251895
251983
 
251984
+ const CustomSwitch = React.forwardRef(({ className, checked, onCheckedChange, ...props }, ref) => (jsx(Root$c, { checked: checked, onCheckedChange: onCheckedChange, className: cn('peer focus-visible:ring-ring focus-visible:ring-offset-background inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200', className), ...props, ref: ref, children: jsx(Thumb, { className: cn('pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0') }) })));
251985
+ CustomSwitch.displayName = Root$c.displayName;
251986
+
251896
251987
  const DeleteDatasetModal$1 = dynamic(() => Promise.resolve().then(function () { return deleteDatasetModal; }).then((mod) => ({
251897
251988
  default: mod.DeleteDatasetModal,
251898
251989
  })));
@@ -251994,7 +252085,7 @@ function TrainingStatusSwitch({ is_trained, url, training_status, disabled, hand
251994
252085
  if (training_status === 'pending') {
251995
252086
  return (jsx(Badge, { variant: "outline", className: "bg-blue-50 text-blue-700", children: t('datasetsTabDatasetItem.inProgress') }));
251996
252087
  }
251997
- return (jsx(Switch, { checked: is_trained, onCheckedChange: () => {
252088
+ return (jsx(CustomSwitch, { checked: is_trained, onCheckedChange: () => {
251998
252089
  // If trying to train an untrained dataset, show the modal
251999
252090
  if (!is_trained) {
252000
252091
  onTrainRequest === null || onTrainRequest === void 0 ? void 0 : onTrainRequest();
@@ -252052,6 +252143,7 @@ const AGENT_DATASETS_TAB_LABELS = {
252052
252143
  title: 'Datasets',
252053
252144
  description: 'Manage training datasets and knowledge sources.',
252054
252145
  },
252146
+ infoBox: "Teach your agent with your own material. Upload documents, files, or links and it'll answer from them — grounded in your content instead of guessing.",
252055
252147
  search: {
252056
252148
  placeholder: 'Search datasets...',
252057
252149
  },
@@ -252111,6 +252203,7 @@ function buildDatasetsTabLabels(t) {
252111
252203
  title: t('datasetsTabLabels.header.title'),
252112
252204
  description: t('datasetsTabLabels.header.description'),
252113
252205
  },
252206
+ infoBox: t('datasetsTabLabels.infoBox'),
252114
252207
  search: {
252115
252208
  placeholder: t('datasetsTabLabels.search.placeholder'),
252116
252209
  },
@@ -259471,9 +259564,6 @@ const CourseContentLayout = ({ courseId, isPlatformAdmin, currentTenant, tabHref
259471
259564
  }, children: children }) })] })] })] }) }));
259472
259565
  };
259473
259566
 
259474
- const CustomSwitch = React.forwardRef(({ className, checked, onCheckedChange, ...props }, ref) => (jsx(Root$c, { checked: checked, onCheckedChange: onCheckedChange, className: cn('peer focus-visible:ring-ring focus-visible:ring-offset-background inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200', className), ...props, ref: ref, children: jsx(Thumb, { className: cn('pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0') }) })));
259475
- CustomSwitch.displayName = Root$c.displayName;
259476
-
259477
259567
  /**
259478
259568
  * Label contract for the Settings tab and its two sub-modals.
259479
259569
  *
@@ -259504,6 +259594,16 @@ const AGENT_SETTINGS_TAB_LABELS = {
259504
259594
  title: 'Settings',
259505
259595
  description: "Configure your agent's basic settings and preferences.",
259506
259596
  },
259597
+ subTabs: {
259598
+ basic: 'Basic',
259599
+ discovery: 'Discovery',
259600
+ capabilities: 'Capabilities',
259601
+ },
259602
+ sections: {
259603
+ chatExperience: 'Chat experience',
259604
+ voiceCalls: 'Voice & calls',
259605
+ advanced: 'Advanced',
259606
+ },
259507
259607
  fields: {
259508
259608
  name: {
259509
259609
  label: 'Name',
@@ -259547,18 +259647,10 @@ const AGENT_SETTINGS_TAB_LABELS = {
259547
259647
  label: 'Featured',
259548
259648
  tooltip: 'Feature this agent to highlight it in listings.',
259549
259649
  },
259550
- ltiAccessible: {
259551
- label: 'LTI Accessible',
259552
- tooltip: 'Allows this agent to be accessible via LTI launches. Unselecting this will immediately remove access for any users users that have launched this via LTI.',
259553
- },
259554
259650
  showAttachment: {
259555
259651
  label: 'Show Attachment',
259556
259652
  tooltip: 'Show Attachment Options in Chat Interface',
259557
259653
  },
259558
- showVoiceCall: {
259559
- label: 'Show Voice Call',
259560
- tooltip: 'Show Voice Call Options in Chat Interface',
259561
- },
259562
259654
  showVoiceRecord: {
259563
259655
  label: 'Show Voice Record',
259564
259656
  tooltip: 'Show Voice Recording Options in Chat Interface',
@@ -259571,6 +259663,22 @@ const AGENT_SETTINGS_TAB_LABELS = {
259571
259663
  label: 'Verbose Reasoning',
259572
259664
  tooltip: 'Show the agent’s reasoning steps while it responds.',
259573
259665
  },
259666
+ enhancedDocRetrieval: {
259667
+ label: 'Enhanced document retrieval',
259668
+ tooltip: 'Run multiple search queries per question to pull in more relevant documents.',
259669
+ },
259670
+ promptCaching: {
259671
+ label: 'Prompt caching',
259672
+ tooltip: 'Cache repeated prompt context to lower latency and cost on long conversations.',
259673
+ },
259674
+ privateMode: {
259675
+ label: 'Enable private mode',
259676
+ tooltip: 'When on, every conversation with this agent runs in private mode — no chat history or memory is stored for any user. Use this for sensitive or compliance-bound deployments.',
259677
+ },
259678
+ smartDocRetrieval: {
259679
+ label: 'Smart document retrieval',
259680
+ tooltip: 'Use function calling during voice calls to fetch documents only when needed.',
259681
+ },
259574
259682
  image: {
259575
259683
  label: 'Image',
259576
259684
  altText: 'Agent',
@@ -259587,6 +259695,7 @@ const AGENT_SETTINGS_TAB_LABELS = {
259587
259695
  toasts: {
259588
259696
  saveSuccess: 'Agent updated successfully',
259589
259697
  saveError: 'Failed to update agent',
259698
+ voiceCallError: 'Agent saved, but voice-call settings could not be updated',
259590
259699
  },
259591
259700
  deleteModal: {
259592
259701
  title: 'Delete Agent',
@@ -259627,6 +259736,16 @@ function buildSettingsTabLabels(t) {
259627
259736
  title: t('settingsTabLabels.header.title'),
259628
259737
  description: t('settingsTabLabels.header.description'),
259629
259738
  },
259739
+ subTabs: {
259740
+ basic: t('settingsTabLabels.subTabs.basic'),
259741
+ discovery: t('settingsTabLabels.subTabs.discovery'),
259742
+ capabilities: t('settingsTabLabels.subTabs.capabilities'),
259743
+ },
259744
+ sections: {
259745
+ chatExperience: t('settingsTabLabels.sections.chatExperience'),
259746
+ voiceCalls: t('settingsTabLabels.sections.voiceCalls'),
259747
+ advanced: t('settingsTabLabels.sections.advanced'),
259748
+ },
259630
259749
  fields: {
259631
259750
  name: {
259632
259751
  label: t('settingsTabLabels.fields.name.label'),
@@ -259670,18 +259789,10 @@ function buildSettingsTabLabels(t) {
259670
259789
  label: t('settingsTabLabels.fields.featured.label'),
259671
259790
  tooltip: t('settingsTabLabels.fields.featured.tooltip'),
259672
259791
  },
259673
- ltiAccessible: {
259674
- label: t('settingsTabLabels.fields.ltiAccessible.label'),
259675
- tooltip: t('settingsTabLabels.fields.ltiAccessible.tooltip'),
259676
- },
259677
259792
  showAttachment: {
259678
259793
  label: t('settingsTabLabels.fields.showAttachment.label'),
259679
259794
  tooltip: t('settingsTabLabels.fields.showAttachment.tooltip'),
259680
259795
  },
259681
- showVoiceCall: {
259682
- label: t('settingsTabLabels.fields.showVoiceCall.label'),
259683
- tooltip: t('settingsTabLabels.fields.showVoiceCall.tooltip'),
259684
- },
259685
259796
  showVoiceRecord: {
259686
259797
  label: t('settingsTabLabels.fields.showVoiceRecord.label'),
259687
259798
  tooltip: t('settingsTabLabels.fields.showVoiceRecord.tooltip'),
@@ -259694,6 +259805,22 @@ function buildSettingsTabLabels(t) {
259694
259805
  label: t('settingsTabLabels.fields.showReasoning.label'),
259695
259806
  tooltip: t('settingsTabLabels.fields.showReasoning.tooltip'),
259696
259807
  },
259808
+ enhancedDocRetrieval: {
259809
+ label: t('settingsTabLabels.fields.enhancedDocRetrieval.label'),
259810
+ tooltip: t('settingsTabLabels.fields.enhancedDocRetrieval.tooltip'),
259811
+ },
259812
+ promptCaching: {
259813
+ label: t('settingsTabLabels.fields.promptCaching.label'),
259814
+ tooltip: t('settingsTabLabels.fields.promptCaching.tooltip'),
259815
+ },
259816
+ privateMode: {
259817
+ label: t('settingsTabLabels.fields.privateMode.label'),
259818
+ tooltip: t('settingsTabLabels.fields.privateMode.tooltip'),
259819
+ },
259820
+ smartDocRetrieval: {
259821
+ label: t('settingsTabLabels.fields.smartDocRetrieval.label'),
259822
+ tooltip: t('settingsTabLabels.fields.smartDocRetrieval.tooltip'),
259823
+ },
259697
259824
  image: {
259698
259825
  label: t('settingsTabLabels.fields.image.label'),
259699
259826
  altText: t('settingsTabLabels.fields.image.altText'),
@@ -259710,6 +259837,7 @@ function buildSettingsTabLabels(t) {
259710
259837
  toasts: {
259711
259838
  saveSuccess: t('settingsTabLabels.toasts.saveSuccess'),
259712
259839
  saveError: t('settingsTabLabels.toasts.saveError'),
259840
+ voiceCallError: t('settingsTabLabels.toasts.voiceCallError'),
259713
259841
  },
259714
259842
  deleteModal: {
259715
259843
  title: t('settingsTabLabels.deleteModal.title'),
@@ -259759,8 +259887,9 @@ function resolveSettingsTabLabels(override, t) {
259759
259887
  }
259760
259888
 
259761
259889
  function useEditMentorSettings({ onSuccessfulSave, labels }) {
259762
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
259763
- const { tenantKey, mentorId, username, executeGatedAction } = useAgentSettings();
259890
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
259891
+ const { tenantKey, mentorId, username, enableRBAC, executeGatedAction } = useAgentSettings();
259892
+ const dispatch = useDispatch();
259764
259893
  const { data: categories, isLoading: isLoadingCategories } = useGetMentorCategoriesQuery(
259765
259894
  // @ts-expect-error userId is not part of the query type definition
259766
259895
  { org: tenantKey, userId: username !== null && username !== void 0 ? username : '' }, {
@@ -259771,28 +259900,43 @@ function useEditMentorSettings({ onSuccessfulSave, labels }) {
259771
259900
  { mentor: mentorId, org: tenantKey, userId: username !== null && username !== void 0 ? username : '' }, {
259772
259901
  skip: !mentorId || !tenantKey || !username || isLoadingCategories,
259773
259902
  });
259903
+ const m = mentor;
259774
259904
  const [editMentor, { isLoading: isLoadingEditMentor }] = useEditMentorMutation();
259905
+ // Tenant gate for the agent-level "Enable private mode" row — hidden when off.
259906
+ const { data: tenantChatPrivacyConfig } = useGetTenantChatPrivacyConfigQuery$1({ org: tenantKey !== null && tenantKey !== void 0 ? tenantKey : '', userId: username !== null && username !== void 0 ? username : '' }, { skip: !tenantKey || !username });
259907
+ const tenantAllowsChatPrivacyControl = !!(tenantChatPrivacyConfig === null || tenantChatPrivacyConfig === void 0 ? void 0 : tenantChatPrivacyConfig.allow_user_chat_privacy_control);
259908
+ // `use_function_calling_for_rag` lives on CallConfiguration; use the inlined
259909
+ // config, else fetch the list. (The voice / screen-share toggles moved to
259910
+ // their own tabs, but this field still lives in Settings.)
259911
+ const inlineCallConfig = (_a = m === null || m === void 0 ? void 0 : m.call_configuration) !== null && _a !== void 0 ? _a : undefined;
259912
+ const { data: callConfigList } = useGetCallConfigurationsQuery({ org: tenantKey, userId: username !== null && username !== void 0 ? username : '', mentor: mentorId }, {
259913
+ skip: inlineCallConfig !== undefined || !tenantKey || !username || !mentorId,
259914
+ });
259915
+ const existingCallConfig = inlineCallConfig !== null && inlineCallConfig !== void 0 ? inlineCallConfig : callConfigList === null || callConfigList === void 0 ? void 0 : callConfigList[0];
259916
+ const [createCallConfig] = useCreateCallConfigurationMutation();
259917
+ const [updateCallConfig] = useUpdateCallConfigurationMutation();
259775
259918
  const isDisabled = isLoadingCategories || isLoadingMentor || isLoadingEditMentor;
259776
- const firstCategory = (mentor === null || mentor === void 0 ? void 0 : mentor.categories) && ((_a = mentor === null || mentor === void 0 ? void 0 : mentor.categories) === null || _a === void 0 ? void 0 : _a.length) > 0 ? mentor === null || mentor === void 0 ? void 0 : mentor.categories[0] : null;
259919
+ const firstCategory = (m === null || m === void 0 ? void 0 : m.categories) && ((_b = m === null || m === void 0 ? void 0 : m.categories) === null || _b === void 0 ? void 0 : _b.length) > 0 ? m === null || m === void 0 ? void 0 : m.categories[0] : null;
259777
259920
  const form = useForm({
259778
259921
  defaultValues: {
259779
- mentor_name: (mentor === null || mentor === void 0 ? void 0 : mentor.mentor_name) || '',
259780
- mentor_description: (mentor === null || mentor === void 0 ? void 0 : mentor.mentor_description) || '',
259922
+ mentor_name: (m === null || m === void 0 ? void 0 : m.mentor_name) || '',
259923
+ mentor_description: (m === null || m === void 0 ? void 0 : m.mentor_description) || '',
259781
259924
  categories: firstCategory ? firstCategory.id : null,
259782
- profile_image: (mentor === null || mentor === void 0 ? void 0 : mentor.profile_image) || '',
259783
- mentor_visibility: ((_b = mentor === null || mentor === void 0 ? void 0 : mentor.mentor_visibility) === null || _b === void 0 ? void 0 : _b.toString()) || '',
259784
- allow_anonymous: (mentor === null || mentor === void 0 ? void 0 : mentor.allow_anonymous) ? 'true' : 'false',
259785
- is_featured: (_c = mentor === null || mentor === void 0 ? void 0 : mentor.is_featured) !== null && _c !== void 0 ? _c : false,
259786
- show_attachment: (_d = mentor === null || mentor === void 0 ? void 0 : mentor.show_attachment) !== null && _d !== void 0 ? _d : true,
259787
- show_voice_call: (_e = mentor === null || mentor === void 0 ? void 0 : mentor.show_voice_call) !== null && _e !== void 0 ? _e : true,
259788
- show_voice_record: (_f = mentor === null || mentor === void 0 ? void 0 : mentor.show_voice_record) !== null && _f !== void 0 ? _f : true,
259789
- // @ts-expect-error - is_lti_accessible exists in API response but not in type
259790
- is_lti_accessible: (_g = mentor === null || mentor === void 0 ? void 0 : mentor.is_lti_accessible) !== null && _g !== void 0 ? _g : false,
259791
- forkable: (_h = mentor === null || mentor === void 0 ? void 0 : mentor.forkable) !== null && _h !== void 0 ? _h : false,
259792
- // @ts-expect-error - show_reasoning exists in API response but not in type
259793
- show_reasoning: (_j = mentor === null || mentor === void 0 ? void 0 : mentor.show_reasoning) !== null && _j !== void 0 ? _j : false,
259925
+ profile_image: (m === null || m === void 0 ? void 0 : m.profile_image) || '',
259926
+ mentor_visibility: ((_c = m === null || m === void 0 ? void 0 : m.mentor_visibility) === null || _c === void 0 ? void 0 : _c.toString()) || '',
259927
+ allow_anonymous: (m === null || m === void 0 ? void 0 : m.allow_anonymous) ? 'true' : 'false',
259928
+ is_featured: (_d = m === null || m === void 0 ? void 0 : m.is_featured) !== null && _d !== void 0 ? _d : false,
259929
+ show_attachment: (_e = m === null || m === void 0 ? void 0 : m.show_attachment) !== null && _e !== void 0 ? _e : true,
259930
+ show_voice_record: (_f = m === null || m === void 0 ? void 0 : m.show_voice_record) !== null && _f !== void 0 ? _f : true,
259931
+ forkable: (_g = m === null || m === void 0 ? void 0 : m.forkable) !== null && _g !== void 0 ? _g : false,
259932
+ show_reasoning: (_h = m === null || m === void 0 ? void 0 : m.show_reasoning) !== null && _h !== void 0 ? _h : false,
259933
+ enable_multi_query_rag: (_j = m === null || m === void 0 ? void 0 : m.enable_multi_query_rag) !== null && _j !== void 0 ? _j : false,
259934
+ enable_prompt_caching: (_k = m === null || m === void 0 ? void 0 : m.enable_prompt_caching) !== null && _k !== void 0 ? _k : false,
259935
+ disable_chathistory: (_l = m === null || m === void 0 ? void 0 : m.disable_chathistory) !== null && _l !== void 0 ? _l : false,
259936
+ use_function_calling_for_rag: (_m = existingCallConfig === null || existingCallConfig === void 0 ? void 0 : existingCallConfig.use_function_calling_for_rag) !== null && _m !== void 0 ? _m : false,
259794
259937
  },
259795
259938
  onSubmit: async ({ value }) => {
259939
+ var _a;
259796
259940
  const values = {};
259797
259941
  if (value.profile_image instanceof File) {
259798
259942
  values.uploaded_profile_image = value.profile_image;
@@ -259818,21 +259962,37 @@ function useEditMentorSettings({ onSuccessfulSave, labels }) {
259818
259962
  if (value.show_attachment !== undefined) {
259819
259963
  values.show_attachment = value.show_attachment;
259820
259964
  }
259821
- if (value.show_voice_call !== undefined) {
259822
- values.show_voice_call = value.show_voice_call;
259823
- }
259824
259965
  if (value.show_voice_record !== undefined) {
259825
259966
  values.show_voice_record = value.show_voice_record;
259826
259967
  }
259827
- if (value.is_lti_accessible !== undefined) {
259828
- values.is_lti_accessible = value.is_lti_accessible;
259829
- }
259830
259968
  if (value.forkable !== undefined) {
259831
259969
  values.forkable = value.forkable;
259970
+ // A sets forkable_with_training_data in lock-step with forkable.
259971
+ values.forkable_with_training_data = value.forkable;
259832
259972
  }
259833
259973
  if (value.show_reasoning !== undefined) {
259834
259974
  values.show_reasoning = value.show_reasoning;
259835
259975
  }
259976
+ if (value.enable_multi_query_rag !== undefined) {
259977
+ values.enable_multi_query_rag = value.enable_multi_query_rag;
259978
+ }
259979
+ if (value.enable_prompt_caching !== undefined) {
259980
+ values.enable_prompt_caching = value.enable_prompt_caching;
259981
+ }
259982
+ if (value.disable_chathistory !== undefined) {
259983
+ values.disable_chathistory = value.disable_chathistory;
259984
+ }
259985
+ // Drop any field the user only has read access to. Including a read-only
259986
+ // field makes the PUT fail ("No permission to write field: ..."). A few
259987
+ // payload keys are gated under a differently named permission key.
259988
+ const fieldPermissions = (_a = m === null || m === void 0 ? void 0 : m.permissions) === null || _a === void 0 ? void 0 : _a.field;
259989
+ const writableValues = pickWritableFields(values, fieldPermissions, {
259990
+ enableRBAC,
259991
+ fieldNameMap: {
259992
+ uploaded_profile_image: 'profile_image',
259993
+ categories: 'metadata',
259994
+ },
259995
+ });
259836
259996
  try {
259837
259997
  const savedMentor = await editMentor({
259838
259998
  mentor: mentorId,
@@ -259840,9 +260000,49 @@ function useEditMentorSettings({ onSuccessfulSave, labels }) {
259840
260000
  // @ts-expect-error userId is not part of the mutation query type definition
259841
260001
  userId: username !== null && username !== void 0 ? username : '',
259842
260002
  formData: {
259843
- ...values,
260003
+ ...writableValues,
259844
260004
  },
259845
260005
  }).unwrap();
260006
+ // Refresh the nav-bar chat-privacy toggle — the mentor-settings mutation
260007
+ // doesn't invalidate chat-privacy-effective. Unconditional on purpose.
260008
+ dispatch(chatPrivacyApiSlice.util.invalidateTags(['ChatPrivacyEffective']));
260009
+ // Sync `use_function_calling_for_rag` to CallConfiguration only when
260010
+ // changed (POST a new config if none exists, else PATCH). `show_voice_call`
260011
+ // (Voice tab) and `enable_video` (Screen Share tab) are no longer written
260012
+ // from Settings.
260013
+ const prevFnCalling = (existingCallConfig === null || existingCallConfig === void 0 ? void 0 : existingCallConfig.use_function_calling_for_rag) ? true : false;
260014
+ const callConfigChanged = value.use_function_calling_for_rag !== prevFnCalling;
260015
+ if (callConfigChanged && tenantKey && username && mentorId !== undefined) {
260016
+ try {
260017
+ if (existingCallConfig === null || existingCallConfig === void 0 ? void 0 : existingCallConfig.id) {
260018
+ await updateCallConfig({
260019
+ org: tenantKey,
260020
+ userId: username,
260021
+ id: existingCallConfig.id,
260022
+ requestBody: {
260023
+ use_function_calling_for_rag: value.use_function_calling_for_rag,
260024
+ },
260025
+ }).unwrap();
260026
+ }
260027
+ else {
260028
+ await createCallConfig({
260029
+ org: tenantKey,
260030
+ userId: username,
260031
+ requestBody: {
260032
+ mentor: mentorId,
260033
+ mode: 'realtime',
260034
+ language: 'en',
260035
+ use_function_calling_for_rag: value.use_function_calling_for_rag,
260036
+ },
260037
+ }).unwrap();
260038
+ }
260039
+ }
260040
+ catch (callConfigError) {
260041
+ // Settings already saved — surface a separate toast if the sync fails.
260042
+ console.error(JSON.stringify({ tenant: tenantKey, callConfigError }));
260043
+ toast.error(labels.toasts.voiceCallError);
260044
+ }
260045
+ }
259846
260046
  toast.success(labels.toasts.saveSuccess);
259847
260047
  onSuccessfulSave === null || onSuccessfulSave === void 0 ? void 0 : onSuccessfulSave(savedMentor);
259848
260048
  }
@@ -259867,9 +260067,146 @@ function useEditMentorSettings({ onSuccessfulSave, labels }) {
259867
260067
  handleSubmit,
259868
260068
  isDisabled,
259869
260069
  isLoadingEditMentor,
260070
+ tenantAllowsChatPrivacyControl,
259870
260071
  };
259871
260072
  }
259872
260073
 
260074
+ /**
260075
+ * Basic sub-tab: name, read-only unique id, description, category, and the
260076
+ * profile-image upload.
260077
+ */
260078
+ function BasicSubTab({ form, labels, mentor, isDisabled, categories }) {
260079
+ var _a, _b, _c, _d;
260080
+ const t = useT();
260081
+ const { mentorId, enableRBAC } = useAgentSettings();
260082
+ const fileInputRef = React__default.useRef(null);
260083
+ const { copy, status: copyStatus } = useCopyToClipboard(1000);
260084
+ return (jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-[1fr_200px]", children: [jsxs("div", { className: "order-2 space-y-6 sm:order-1", children: [jsx(WithFormPermissions, { name: "mentor_name",
260085
+ // @ts-expect-error permissions field type is opaque
260086
+ permissions: (_a = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _a === void 0 ? void 0 : _a.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_name", children: (field) => {
260087
+ const hasNoValue = field.state.value === '';
260088
+ const isDirty = field.state.meta.isDirty;
260089
+ const hasNoValueAndIsDirty = hasNoValue && isDirty;
260090
+ return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.name.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: labels.fields.name.placeholder, disabled: isDisabled || disabled }), hasNoValueAndIsDirty && (jsx("p", { className: "text-xs text-red-500", children: labels.fields.name.requiredError }))] }));
260091
+ } })) }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: labels.fields.uniqueId.label }), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { value: mentorId || '', readOnly: true, disabled: true, className: "flex-1 cursor-not-allowed bg-gray-50", placeholder: t('tabsSettingsTab.uniqueIdPlaceholder') }), jsx(Button$1, { type: "button", variant: "outline", size: "icon", onClick: () => mentorId && copy(mentorId), disabled: !mentorId, "aria-label": copyStatus === 'success'
260092
+ ? labels.fields.uniqueId.copyButtonSuccessAriaLabel
260093
+ : labels.fields.uniqueId.copyButtonIdleAriaLabel, children: copyStatus === 'success' ? (jsx(Check, { className: "h-4 w-4" })) : (jsx(Copy, { className: "h-4 w-4" })) })] })] }), jsx(WithFormPermissions, { name: "mentor_description",
260094
+ // @ts-expect-error permissions field type is opaque
260095
+ permissions: (_b = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _b === void 0 ? void 0 : _b.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_description", children: (field) => {
260096
+ const hasNoValue = field.state.value === '';
260097
+ const isDirty = field.state.meta.isDirty;
260098
+ const hasNoValueAndIsDirty = hasNoValue && isDirty;
260099
+ return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.description.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Textarea, { value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: labels.fields.description.placeholder, className: "min-h-[150px]", disabled: isDisabled || disabled }), hasNoValueAndIsDirty && (jsx("p", { className: "text-xs text-red-500", children: labels.fields.description.requiredError }))] }));
260100
+ } })) }), jsx(WithFormPermissions, { name: "metadata",
260101
+ // @ts-expect-error permissions field type is opaque
260102
+ permissions: (_c = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _c === void 0 ? void 0 : _c.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "categories", children: (field) => {
260103
+ var _a;
260104
+ return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.category.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, "aria-label": t('tabsSettingsTab.categorySelectAriaLabel'), children: jsxs(Button$1, { variant: "outline", role: "combobox", className: "w-full justify-between", disabled: isDisabled || disabled, children: [field.state.value
260105
+ ? (_a = categories === null || categories === void 0 ? void 0 : categories.find((category) => category.id === field.state.value)) === null || _a === void 0 ? void 0 : _a.name
260106
+ : labels.fields.category.triggerPlaceholder, jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full max-w-[490px] p-0 sm:w-[400px] lg:w-[490px]", children: jsxs(Command, { children: [jsx(CommandInput, { placeholder: labels.fields.category.searchPlaceholder, className: "h-9" }), jsxs(CommandList, { children: [jsx(CommandEmpty, { children: labels.fields.category.emptyState }), jsx(CommandGroup, { children: categories === null || categories === void 0 ? void 0 : categories.map((category) => (jsxs(CommandItem, { value: category.id.toString(), onSelect: (currentValue) => {
260107
+ field.handleChange(Number(currentValue));
260108
+ }, children: [category.name, jsx(Check, { className: cn('ml-auto', field.state.value === category.id ? 'opacity-100' : 'opacity-0') })] }, category.id))) })] })] }) })] })] }));
260109
+ } })) })] }), jsx(WithFormPermissions, { name: "profile_image",
260110
+ // @ts-expect-error permissions field type is opaque
260111
+ permissions: (_d = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _d === void 0 ? void 0 : _d.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "profile_image", children: (field) => (jsxs("div", { className: "order-1 mb-6 space-y-2 sm:order-2 sm:mb-0", children: [jsx(Label$1, { className: "text-sm font-medium text-[#646464]", children: labels.fields.image.label }), jsxs("div", { className: "flex h-[200px] flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-200", onClick: (event) => {
260112
+ event.stopPropagation();
260113
+ if (!isDisabled && fileInputRef.current) {
260114
+ fileInputRef.current.click();
260115
+ }
260116
+ }, children: [field.state.value ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof field.state.value === 'string'
260117
+ ? field.state.value
260118
+ : URL.createObjectURL(field.state.value), alt: labels.fields.image.altText, className: "h-full w-full rounded-lg object-cover", height: 200, width: 200, onClick: (event) => {
260119
+ event.stopPropagation();
260120
+ } }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", className: "absolute top-2 right-2 h-7 w-7 cursor-pointer rounded-full", onClick: (event) => {
260121
+ event.stopPropagation();
260122
+ if (!isDisabled && fileInputRef.current) {
260123
+ field.handleChange(null);
260124
+ fileInputRef.current.value = '';
260125
+ }
260126
+ }, "aria-label": labels.fields.image.removeAriaLabel, disabled: isDisabled || disabled, children: jsx(X$2, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: labels.fields.image.uploadHint })), jsx("input", { type: "file", accept: "image/*", ref: fileInputRef, disabled: isDisabled || disabled, onChange: (event) => {
260127
+ var _a;
260128
+ const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
260129
+ if (file) {
260130
+ field.handleChange(file);
260131
+ }
260132
+ }, className: "hidden" })] })] })) })) })] }));
260133
+ }
260134
+
260135
+ /**
260136
+ * A single label + info-tooltip + `CustomSwitch` row bound to a boolean field
260137
+ * of the settings form. Collapses the block that was copy-pasted for every
260138
+ * capability/discovery toggle, including the state-aware switch `aria-label`
260139
+ * and the optional `WithFormPermissions` RBAC gate.
260140
+ */
260141
+ function SettingToggleField({ form, name, label, tooltip, tooltipAriaLabel, isDisabled, permissionName, fieldPermissions, enableRBAC, testId, }) {
260142
+ const t = useT();
260143
+ const row = (gatedDisabled) => (jsx(form.Field, { name: name, children: (field) => {
260144
+ const value = field.state.value;
260145
+ return (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": tooltipAriaLabel, children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || gatedDisabled, "aria-label": t('tabsSettingsTab.toggleAriaLabel', {
260146
+ label,
260147
+ state: value
260148
+ ? t('tabsSettingsTab.toggleStateEnabled')
260149
+ : t('tabsSettingsTab.toggleStateDisabled'),
260150
+ }), "data-testid": testId })] }));
260151
+ } }));
260152
+ if (!permissionName) {
260153
+ return row(false);
260154
+ }
260155
+ return (jsx(WithFormPermissions, { name: permissionName,
260156
+ // @ts-expect-error permissions field type is opaque
260157
+ permissions: fieldPermissions, enableRBAC: enableRBAC, children: ({ disabled }) => row(disabled) }));
260158
+ }
260159
+
260160
+ /**
260161
+ * The mentor settings query result does not (yet) type the RBAC `permissions`
260162
+ * bag. Read the field-permission map through this helper so the opaque-type
260163
+ * suppression lives in one place instead of at every call site.
260164
+ */
260165
+ function getFieldPermissions(mentor) {
260166
+ var _a;
260167
+ // @ts-expect-error permissions field type is opaque
260168
+ return (_a = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _a === void 0 ? void 0 : _a.field;
260169
+ }
260170
+
260171
+ const VISIBILITY_VALUES = {
260172
+ administrators: 'viewable_by_tenant_admins',
260173
+ students: 'viewable_by_tenant_students',
260174
+ anyone: 'viewable_by_anyone',
260175
+ };
260176
+ /**
260177
+ * Discovery sub-tab: who can view / who can chat visibility selects, plus the
260178
+ * "featured" toggle.
260179
+ */
260180
+ function DiscoverySubTab({ form, labels, mentor, isDisabled }) {
260181
+ var _a, _b;
260182
+ const t = useT();
260183
+ const { enableRBAC } = useAgentSettings();
260184
+ const visibilityOptions = React__default.useMemo(() => [
260185
+ {
260186
+ label: labels.fields.whoCanView.options.administrators,
260187
+ value: VISIBILITY_VALUES.administrators,
260188
+ },
260189
+ { label: labels.fields.whoCanView.options.students, value: VISIBILITY_VALUES.students },
260190
+ { label: labels.fields.whoCanView.options.anyone, value: VISIBILITY_VALUES.anyone },
260191
+ ], [labels]);
260192
+ return (jsxs("div", { className: "space-y-6", children: [jsx(WithFormPermissions, { name: "mentor_visibility",
260193
+ // @ts-expect-error permissions field type is opaque
260194
+ permissions: (_a = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _a === void 0 ? void 0 : _a.field, enableRBAC: enableRBAC, 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: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.whoCanView.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.whoCanViewTooltipAriaLabel'), 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: field.state.value, onValueChange: (value) => value && field.handleChange(value), required: true, disabled: isDisabled || disabled, children: [jsx(SelectTrigger, { "aria-label": labels.fields.whoCanView.triggerPlaceholder, children: jsx(SelectValue, { placeholder: labels.fields.whoCanView.triggerPlaceholder }) }), jsx(SelectContent, { children: visibilityOptions.map((visibility) => (jsx(SelectItem, { value: visibility.value, children: visibility.label }, visibility.value))) })] })] })) })) }), jsx(WithFormPermissions, { name: "allow_anonymous",
260195
+ // @ts-expect-error permissions field type is opaque
260196
+ permissions: (_b = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _b === void 0 ? void 0 : _b.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "allow_anonymous", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Label$1, { className: "text-sm font-medium text-[#646464]", children: [labels.fields.whoCanChat.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.whoCanChatTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.whoCanChat.tooltip }) })] }) })] }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => value && field.handleChange(value), disabled: isDisabled || disabled, children: [jsx(SelectTrigger, { "aria-label": labels.fields.whoCanChat.triggerPlaceholder, children: jsx(SelectValue, { placeholder: labels.fields.whoCanChat.triggerPlaceholder }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "true", children: labels.fields.whoCanChat.optionAnyone }), jsx(SelectItem, { value: "false", children: labels.fields.whoCanChat.optionAuthenticated })] })] })] })) })) }), jsx(SettingToggleField, { form: form, name: "is_featured", label: labels.fields.featured.label, tooltip: labels.fields.featured.tooltip, tooltipAriaLabel: t('tabsSettingsTab.featuredTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "is_featured", fieldPermissions: getFieldPermissions(mentor), enableRBAC: enableRBAC })] }));
260197
+ }
260198
+
260199
+ /**
260200
+ * Capabilities sub-tab: the chat-experience, voice-&-calls, and advanced
260201
+ * toggle groups.
260202
+ */
260203
+ function CapabilitiesSubTab({ form, labels, mentor, isDisabled, tenantAllowsChatPrivacyControl, }) {
260204
+ const t = useT();
260205
+ const { enableRBAC } = useAgentSettings();
260206
+ const fieldPermissions = getFieldPermissions(mentor);
260207
+ return (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "space-y-3", children: [jsx("h4", { className: "text-xs font-semibold tracking-wide text-gray-500 uppercase", children: labels.sections.chatExperience }), jsx(SettingToggleField, { form: form, name: "show_attachment", label: labels.fields.showAttachment.label, tooltip: labels.fields.showAttachment.tooltip, tooltipAriaLabel: t('tabsSettingsTab.showAttachmentTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "show_attachment", fieldPermissions: fieldPermissions, enableRBAC: enableRBAC }), jsx(SettingToggleField, { form: form, name: "show_reasoning", label: labels.fields.showReasoning.label, tooltip: labels.fields.showReasoning.tooltip, tooltipAriaLabel: t('tabsSettingsTab.showReasoningTooltipAriaLabel'), isDisabled: isDisabled }), jsx(SettingToggleField, { form: form, name: "enable_multi_query_rag", label: labels.fields.enhancedDocRetrieval.label, tooltip: labels.fields.enhancedDocRetrieval.tooltip, tooltipAriaLabel: t('tabsSettingsTab.enhancedDocRetrievalTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "enable_multi_query_rag", fieldPermissions: fieldPermissions, enableRBAC: enableRBAC }), jsx(SettingToggleField, { form: form, name: "enable_prompt_caching", label: labels.fields.promptCaching.label, tooltip: labels.fields.promptCaching.tooltip, tooltipAriaLabel: t('tabsSettingsTab.promptCachingTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "enable_prompt_caching", fieldPermissions: fieldPermissions, enableRBAC: enableRBAC })] }), jsxs("div", { className: "space-y-3", children: [jsx("h4", { className: "text-xs font-semibold tracking-wide text-gray-500 uppercase", children: labels.sections.voiceCalls }), jsx(SettingToggleField, { form: form, name: "show_voice_record", label: labels.fields.showVoiceRecord.label, tooltip: labels.fields.showVoiceRecord.tooltip, tooltipAriaLabel: t('tabsSettingsTab.showVoiceRecordTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "show_voice_record", fieldPermissions: fieldPermissions, enableRBAC: enableRBAC }), jsx(SettingToggleField, { form: form, name: "use_function_calling_for_rag", label: labels.fields.smartDocRetrieval.label, tooltip: labels.fields.smartDocRetrieval.tooltip, tooltipAriaLabel: t('tabsSettingsTab.smartDocRetrievalTooltipAriaLabel'), isDisabled: isDisabled, testId: "settings-use-function-calling-for-rag-switch" })] }), jsxs("div", { className: "space-y-3", children: [jsx("h4", { className: "text-xs font-semibold tracking-wide text-gray-500 uppercase", children: labels.sections.advanced }), tenantAllowsChatPrivacyControl && (jsx(SettingToggleField, { form: form, name: "disable_chathistory", label: labels.fields.privateMode.label, tooltip: labels.fields.privateMode.tooltip, tooltipAriaLabel: t('tabsSettingsTab.privateModeTooltipAriaLabel'), isDisabled: isDisabled, permissionName: "disable_chathistory", fieldPermissions: fieldPermissions, enableRBAC: enableRBAC, testId: "settings-disable-chathistory-switch" })), jsx(SettingToggleField, { form: form, name: "forkable", label: labels.fields.allowCopies.label, tooltip: labels.fields.allowCopies.tooltip, tooltipAriaLabel: t('tabsSettingsTab.allowCopiesTooltipAriaLabel'), isDisabled: isDisabled })] })] }));
260208
+ }
260209
+
259873
260210
  /* istanbul ignore next -- @preserve dynamic import is not testable in unit tests */
259874
260211
  const DeleteMentorModal$1 = dynamic(() => Promise.resolve().then(function () { return deleteMentorModal; }).then((module) => ({
259875
260212
  default: module.DeleteMentorModal,
@@ -259878,141 +260215,27 @@ const DeleteMentorModal$1 = dynamic(() => Promise.resolve().then(function () { r
259878
260215
  const CopyMentorModal$1 = dynamic(() => Promise.resolve().then(function () { return copyMentorModal; }).then((module) => ({
259879
260216
  default: module.CopyMentorModal,
259880
260217
  })), { ssr: false });
259881
- const VISIBILITY_VALUES = {
259882
- administrators: 'viewable_by_tenant_admins',
259883
- students: 'viewable_by_tenant_students',
259884
- anyone: 'viewable_by_anyone',
259885
- };
259886
260218
  function AgentSettingsTab({ onSuccessfulSave, onSuccessfulDelete, tenants, isLoadingTenants, onSuccessfulCopy, labels: labelsOverride, }) {
259887
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
259888
260219
  const t = useT();
259889
- // ── React hooks ──────────────────────────────────────────────────────
259890
- const fileInputRef = React__default.useRef(null);
259891
260220
  const [isDeleteModalOpen, setIsDeleteModalOpen] = React__default.useState(false);
259892
260221
  const [isCopyModalOpen, setIsCopyModalOpen] = React__default.useState(false);
260222
+ const [subTab, setSubTab] = React__default.useState('basic');
259893
260223
  const labels = React__default.useMemo(() => resolveSettingsTabLabels(labelsOverride, t), [labelsOverride, t]);
259894
- const visibilityOptions = React__default.useMemo(() => [
259895
- {
259896
- label: labels.fields.whoCanView.options.administrators,
259897
- value: VISIBILITY_VALUES.administrators,
259898
- },
259899
- {
259900
- label: labels.fields.whoCanView.options.students,
259901
- value: VISIBILITY_VALUES.students,
259902
- },
259903
- {
259904
- label: labels.fields.whoCanView.options.anyone,
259905
- value: VISIBILITY_VALUES.anyone,
259906
- },
259907
- ], [labels]);
259908
- // ── Custom hooks ────────────────────────────────────────────────────
259909
260224
  const { tenantKey, mentorId, username, enableRBAC } = useAgentSettings();
259910
- const { copy, status: copyStatus } = useCopyToClipboard(1000);
259911
- const { mentor, categories, form, handleSubmit, isDisabled, isLoadingEditMentor } = useEditMentorSettings({ onSuccessfulSave, labels });
259912
- return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsx("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
259913
- overflowY: 'auto',
259914
- overflowX: 'hidden',
259915
- }, tabIndex: 0, role: "region", "aria-label": t('tabsSettingsTab.settingsFormRegionAriaLabel'), children: jsxs("form", { onSubmit: (formEvent) => {
259916
- formEvent.preventDefault();
259917
- formEvent.stopPropagation();
259918
- handleSubmit();
259919
- }, children: [jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-[1fr_200px]", children: [jsxs("div", { className: "order-2 space-y-6 sm:order-1", children: [jsx(WithFormPermissions, { name: "mentor_name",
259920
- // @ts-expect-error permissions field type is opaque
259921
- permissions: (_a = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _a === void 0 ? void 0 : _a.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_name", children: (field) => {
259922
- const hasNoValue = field.state.value === '';
259923
- const isDirty = field.state.meta.isDirty;
259924
- const hasNoValueAndIsDirty = hasNoValue && isDirty;
259925
- return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.name.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: labels.fields.name.placeholder, disabled: isDisabled || disabled }), hasNoValueAndIsDirty && (jsx("p", { className: "text-xs text-red-500", children: labels.fields.name.requiredError }))] }));
259926
- } })) }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: labels.fields.uniqueId.label }), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { value: mentorId || '', readOnly: true, disabled: true, className: "flex-1 cursor-not-allowed bg-gray-50", placeholder: t('tabsSettingsTab.uniqueIdPlaceholder') }), jsx(Button$1, { type: "button", variant: "outline", size: "icon", onClick: () => mentorId && copy(mentorId), disabled: !mentorId, "aria-label": copyStatus === 'success'
259927
- ? labels.fields.uniqueId.copyButtonSuccessAriaLabel
259928
- : labels.fields.uniqueId.copyButtonIdleAriaLabel, children: copyStatus === 'success' ? (jsx(Check, { className: "h-4 w-4" })) : (jsx(Copy, { className: "h-4 w-4" })) })] })] }), jsx(WithFormPermissions, { name: "mentor_description",
259929
- // @ts-expect-error permissions field type is opaque
259930
- permissions: (_b = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _b === void 0 ? void 0 : _b.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "mentor_description", children: (field) => {
259931
- const hasNoValue = field.state.value === '';
259932
- const isDirty = field.state.meta.isDirty;
259933
- const hasNoValueAndIsDirty = hasNoValue && isDirty;
259934
- return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.description.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Textarea, { value: field.state.value, onChange: (e) => field.handleChange(e.target.value), placeholder: labels.fields.description.placeholder, className: "min-h-[150px]", disabled: isDisabled || disabled }), hasNoValueAndIsDirty && (jsx("p", { className: "text-xs text-red-500", children: labels.fields.description.requiredError }))] }));
259935
- } })) }), jsx(WithFormPermissions, { name: "metadata",
259936
- // @ts-expect-error permissions field type is opaque
259937
- permissions: (_c = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _c === void 0 ? void 0 : _c.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "categories", children: (field) => {
259938
- var _a;
259939
- return (jsxs("div", { className: "space-y-2", children: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.category.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, "aria-label": t('tabsSettingsTab.categorySelectAriaLabel'), children: jsxs(Button$1, { variant: "outline", role: "combobox", className: "w-full justify-between", disabled: isDisabled || disabled, children: [field.state.value
259940
- ? (_a = categories === null || categories === void 0 ? void 0 : categories.find((category) => category.id === field.state.value)) === null || _a === void 0 ? void 0 : _a.name
259941
- : labels.fields.category.triggerPlaceholder, jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full max-w-[490px] p-0 sm:w-[400px] lg:w-[490px]", children: jsxs(Command, { children: [jsx(CommandInput, { placeholder: labels.fields.category.searchPlaceholder, className: "h-9" }), jsxs(CommandList, { children: [jsx(CommandEmpty, { children: labels.fields.category.emptyState }), jsx(CommandGroup, { children: categories === null || categories === void 0 ? void 0 : categories.map((category) => (jsxs(CommandItem, { value: category.id.toString(), onSelect: (currentValue) => {
259942
- field.handleChange(Number(currentValue));
259943
- }, children: [category.name, jsx(Check, { className: cn('ml-auto', field.state.value === category.id
259944
- ? 'opacity-100'
259945
- : 'opacity-0') })] }, category.id))) })] })] }) })] })] }));
259946
- } })) }), jsx(WithFormPermissions, { name: "mentor_visibility",
259947
- // @ts-expect-error permissions field type is opaque
259948
- permissions: (_d = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _d === void 0 ? void 0 : _d.field, enableRBAC: enableRBAC, 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: [jsxs(Label$1, { className: "flex items-center text-sm font-medium text-[#646464]", children: [labels.fields.whoCanView.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.whoCanViewTooltipAriaLabel'), 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: field.state.value, onValueChange: (value) => value && field.handleChange(value), required: true, disabled: isDisabled || disabled, children: [jsx(SelectTrigger, { "aria-label": labels.fields.whoCanView.triggerPlaceholder, children: jsx(SelectValue, { placeholder: labels.fields.whoCanView.triggerPlaceholder }) }), jsx(SelectContent, { children: visibilityOptions.map((visibility) => (jsx(SelectItem, { value: visibility.value, children: visibility.label }, visibility.value))) })] })] })) })) }), jsx(WithFormPermissions, { name: "allow_anonymous",
259949
- // @ts-expect-error permissions field type is opaque
259950
- permissions: (_e = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _e === void 0 ? void 0 : _e.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "allow_anonymous", children: (field) => (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Label$1, { className: "text-sm font-medium text-[#646464]", children: [labels.fields.whoCanChat.label, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.whoCanChatTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.whoCanChat.tooltip }) })] }) })] }), jsxs(Select$1, { value: field.state.value, onValueChange: (value) => value && field.handleChange(value), disabled: isDisabled || disabled, children: [jsx(SelectTrigger, { "aria-label": labels.fields.whoCanChat.triggerPlaceholder, children: jsx(SelectValue, { placeholder: labels.fields.whoCanChat.triggerPlaceholder }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "true", children: labels.fields.whoCanChat.optionAnyone }), jsx(SelectItem, { value: "false", children: labels.fields.whoCanChat.optionAuthenticated })] })] })] })) })) }), jsx(WithFormPermissions, { name: "is_featured",
259951
- // @ts-expect-error permissions field type is opaque
259952
- permissions: (_f = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _f === void 0 ? void 0 : _f.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "is_featured", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.featured.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('tabsSettingsTab.featuredTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.featured.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || disabled, "aria-label": t('tabsSettingsTab.featuredToggleAriaLabel', {
259953
- state: field.state.value
259954
- ? t('tabsSettingsTab.toggleStateEnabled')
259955
- : t('tabsSettingsTab.toggleStateDisabled'),
259956
- }) })] })) })) }), jsx(WithFormPermissions, { name: "is_lti_accessible",
259957
- // @ts-expect-error permissions field type is opaque
259958
- permissions: (_g = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _g === void 0 ? void 0 : _g.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "is_lti_accessible", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.ltiAccessible.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.ltiAccessibleTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.ltiAccessible.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || disabled, "aria-label": t('tabsSettingsTab.ltiAccessibleToggleAriaLabel', {
259959
- state: field.state.value
259960
- ? t('tabsSettingsTab.toggleStateEnabled')
259961
- : t('tabsSettingsTab.toggleStateDisabled'),
259962
- }) })] })) })) }), jsx(WithFormPermissions, { name: "show_attachment",
259963
- // @ts-expect-error permissions field type is opaque
259964
- permissions: (_h = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _h === void 0 ? void 0 : _h.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "show_attachment", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.showAttachment.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.showAttachmentTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.showAttachment.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || disabled, "aria-label": t('tabsSettingsTab.showAttachmentToggleAriaLabel', {
259965
- state: field.state.value
259966
- ? t('tabsSettingsTab.toggleStateEnabled')
259967
- : t('tabsSettingsTab.toggleStateDisabled'),
259968
- }) })] })) })) }), jsx(WithFormPermissions, { name: "show_voice_call",
259969
- // @ts-expect-error permissions field type is opaque
259970
- permissions: (_j = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _j === void 0 ? void 0 : _j.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "show_voice_call", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.showVoiceCall.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.showVoiceCallTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.showVoiceCall.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || disabled, "aria-label": t('tabsSettingsTab.showVoiceCallToggleAriaLabel', {
259971
- state: field.state.value
259972
- ? t('tabsSettingsTab.toggleStateEnabled')
259973
- : t('tabsSettingsTab.toggleStateDisabled'),
259974
- }) })] })) })) }), jsx(WithFormPermissions, { name: "show_voice_record",
259975
- // @ts-expect-error permissions field type is opaque
259976
- permissions: (_k = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _k === void 0 ? void 0 : _k.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "show_voice_record", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.showVoiceRecord.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.showVoiceRecordTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.showVoiceRecord.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled || disabled, "aria-label": t('tabsSettingsTab.showVoiceRecordToggleAriaLabel', {
259977
- state: field.state.value
259978
- ? t('tabsSettingsTab.toggleStateEnabled')
259979
- : t('tabsSettingsTab.toggleStateDisabled'),
259980
- }) })] })) })) }), jsx(form.Field, { name: "forkable", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.allowCopies.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.allowCopiesTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.allowCopies.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled, "aria-label": t('tabsSettingsTab.allowCopiesToggleAriaLabel', {
259981
- state: field.state.value
259982
- ? t('tabsSettingsTab.toggleStateEnabled')
259983
- : t('tabsSettingsTab.toggleStateDisabled'),
259984
- }) })] })) }), jsx(form.Field, { name: "show_reasoning", children: (field) => (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: labels.fields.showReasoning.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { type: "button", "aria-label": t('tabsSettingsTab.showReasoningTooltipAriaLabel'), children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: labels.fields.showReasoning.tooltip }) })] }) })] }), jsx(CustomSwitch, { checked: field.state.value, onCheckedChange: (checked) => field.handleChange(checked), disabled: isDisabled, "aria-label": t('tabsSettingsTab.showReasoningToggleAriaLabel', {
259985
- state: field.state.value
259986
- ? t('tabsSettingsTab.toggleStateEnabled')
259987
- : t('tabsSettingsTab.toggleStateDisabled'),
259988
- }) })] })) })] }), jsx(WithFormPermissions, { name: "profile_image",
259989
- // @ts-expect-error permissions field type is opaque
259990
- permissions: (_l = mentor === null || mentor === void 0 ? void 0 : mentor.permissions) === null || _l === void 0 ? void 0 : _l.field, enableRBAC: enableRBAC, children: ({ disabled }) => (jsx(form.Field, { name: "profile_image", children: (field) => (jsxs("div", { className: "order-1 mb-6 space-y-2 sm:order-2 sm:mb-0", children: [jsx(Label$1, { className: "text-sm font-medium text-[#646464]", children: labels.fields.image.label }), jsxs("div", { className: "flex h-[200px] flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-200", onClick: (event) => {
259991
- event.stopPropagation();
259992
- if (!isDisabled && fileInputRef.current) {
259993
- fileInputRef.current.click();
259994
- }
259995
- }, children: [field.state.value ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof field.state.value === 'string'
259996
- ? field.state.value
259997
- : URL.createObjectURL(field.state.value), alt: labels.fields.image.altText, className: "h-full w-full rounded-lg object-cover", height: 200, width: 200, onClick: (event) => {
259998
- event.stopPropagation();
259999
- } }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", className: "absolute top-2 right-2 h-7 w-7 cursor-pointer rounded-full", onClick: (event) => {
260000
- event.stopPropagation();
260001
- if (!isDisabled && fileInputRef.current) {
260002
- field.handleChange(null);
260003
- fileInputRef.current.value = '';
260004
- }
260005
- }, "aria-label": labels.fields.image.removeAriaLabel, disabled: isDisabled || disabled, children: jsx(X$2, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: labels.fields.image.uploadHint })), jsx("input", { type: "file", accept: "image/*", ref: fileInputRef, disabled: isDisabled || disabled, onChange: (event) => {
260006
- var _a;
260007
- const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
260008
- if (file) {
260009
- field.handleChange(file);
260010
- }
260011
- }, className: "hidden" })] })] })) })) })] }), jsx("div", { className: "mt-6 flex items-center", children: jsxs("div", { className: "flex gap-2", children: [jsx(form.Subscribe, { selector: (state) => ({ isFormValid: state.canSubmit }), children: ({ isFormValid }) => (jsx(WithFormPermissions, { name: "object",
260012
- // @ts-expect-error permissions type is opaque
260013
- permissions: mentor === null || mentor === void 0 ? void 0 : mentor.permissions, enableRBAC: enableRBAC, children: ({ disabled }) => !disabled && (jsx(Button$1, { type: "submit", disabled: isDisabled || !isFormValid, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoadingEditMentor ? labels.actions.saving : labels.actions.save })) })) }), (mentor === null || mentor === void 0 ? void 0 : mentor.forkable) && (jsx(Button$1, { onClick: () => setIsCopyModalOpen(true), type: "button", disabled: isDisabled, variant: "outline", children: labels.actions.copy })), jsx(WithFormPermissions, { name: "object",
260014
- // @ts-expect-error permissions type is opaque
260015
- permissions: mentor === null || mentor === void 0 ? void 0 : mentor.permissions, enableRBAC: enableRBAC, children: ({ canDelete }) => canDelete && (jsx(Button$1, { onClick: () => setIsDeleteModalOpen(true), type: "button", disabled: isDisabled, variant: "outline", children: labels.actions.delete })) })] }) })] }) }), jsx(DeleteMentorModal$1, { isOpen: isDeleteModalOpen, onClose: () => setIsDeleteModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username, onSuccessfulDelete: onSuccessfulDelete, labels: labels.deleteModal }), jsx(CopyMentorModal$1, { open: isCopyModalOpen, onClose: () => setIsCopyModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username, tenants: tenants, isLoadingTenants: isLoadingTenants, onSuccessfulCopy: onSuccessfulCopy, labels: labels.copyModal })] }));
260225
+ const { mentor, categories, form, handleSubmit, isDisabled, isLoadingEditMentor, tenantAllowsChatPrivacyControl, } = useEditMentorSettings({ onSuccessfulSave, labels });
260226
+ const subTabTriggerClass = 'px-3 py-1.5 text-sm font-medium text-gray-700 data-[state=active]:bg-white data-[state=active]:text-gray-900';
260227
+ return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [jsx("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
260228
+ overflowY: 'auto',
260229
+ overflowX: 'hidden',
260230
+ }, tabIndex: 0, role: "region", "aria-label": t('tabsSettingsTab.settingsFormRegionAriaLabel'), children: jsx("form", { onSubmit: (formEvent) => {
260231
+ formEvent.preventDefault();
260232
+ formEvent.stopPropagation();
260233
+ handleSubmit();
260234
+ }, children: jsxs(Tabs, { value: subTab, onValueChange: (value) => setSubTab(value), className: "space-y-4", children: [jsxs(TabsList, { className: "inline-flex h-auto rounded-md bg-gray-100 p-1", "aria-label": t('tabsSettingsTab.settingsSubCategoriesAriaLabel'), children: [jsx(TabsTrigger, { value: "basic", className: subTabTriggerClass, children: labels.subTabs.basic }), jsx(TabsTrigger, { value: "discovery", className: subTabTriggerClass, children: labels.subTabs.discovery }), jsx(TabsTrigger, { value: "capabilities", className: subTabTriggerClass, children: labels.subTabs.capabilities })] }), jsx(TabsContent, { value: "basic", forceMount: true, className: "m-0 data-[state=inactive]:hidden", children: jsx(BasicSubTab, { form: form, labels: labels, mentor: mentor, isDisabled: isDisabled, categories: categories }) }), jsx(TabsContent, { value: "discovery", forceMount: true, className: "m-0 data-[state=inactive]:hidden", children: jsx(DiscoverySubTab, { form: form, labels: labels, mentor: mentor, isDisabled: isDisabled }) }), jsx(TabsContent, { value: "capabilities", forceMount: true, className: "m-0 data-[state=inactive]:hidden", children: jsx(CapabilitiesSubTab, { form: form, labels: labels, mentor: mentor, isDisabled: isDisabled, tenantAllowsChatPrivacyControl: tenantAllowsChatPrivacyControl }) })] }) }) }), jsxs("div", { className: "flex flex-shrink-0 justify-end gap-2 border-t border-gray-200 bg-white px-3 py-4", children: [jsx(WithFormPermissions, { name: "object",
260235
+ // @ts-expect-error permissions type is opaque
260236
+ permissions: mentor === null || mentor === void 0 ? void 0 : mentor.permissions, enableRBAC: enableRBAC, children: ({ canDelete }) => canDelete && (jsx(Button$1, { onClick: () => setIsDeleteModalOpen(true), type: "button", disabled: isDisabled, variant: "outline", children: labels.actions.delete })) }), (mentor === null || mentor === void 0 ? void 0 : mentor.forkable) && (jsx(Button$1, { onClick: () => setIsCopyModalOpen(true), type: "button", disabled: isDisabled, variant: "outline", children: labels.actions.copy })), jsx(form.Subscribe, { selector: (state) => ({ isFormValid: state.canSubmit }), children: ({ isFormValid }) => (jsx(WithFormPermissions, { name: "object",
260237
+ // @ts-expect-error permissions type is opaque
260238
+ permissions: mentor === null || mentor === void 0 ? void 0 : mentor.permissions, enableRBAC: enableRBAC, children: ({ disabled }) => !disabled && (jsx(Button$1, { type: "button", onClick: () => handleSubmit(), disabled: isDisabled || !isFormValid, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoadingEditMentor ? labels.actions.saving : labels.actions.save })) })) })] })] }), jsx(DeleteMentorModal$1, { isOpen: isDeleteModalOpen, onClose: () => setIsDeleteModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username, onSuccessfulDelete: onSuccessfulDelete, labels: labels.deleteModal }), jsx(CopyMentorModal$1, { open: isCopyModalOpen, onClose: () => setIsCopyModalOpen(false), tenantKey: tenantKey, mentorId: mentorId, username: username, tenants: tenants, isLoadingTenants: isLoadingTenants, onSuccessfulCopy: onSuccessfulCopy, labels: labels.copyModal })] }));
260016
260239
  }
260017
260240
 
260018
260241
  function DeleteMentorModal({ isOpen, onClose, tenantKey, mentorId, username, onSuccessfulDelete, labels = AGENT_SETTINGS_TAB_LABELS.deleteModal, }) {
@@ -265150,15 +265373,29 @@ function AgentHumanSupportTab({ PaginationComponent = IblPagination, labels: lab
265150
265373
  : labels.list.untitled }) }), jsx("div", { className: "mx-auto w-full max-w-full overflow-x-hidden", children: selectedTicket && renderTicketDetail(selectedTicket) })] }) })] }));
265151
265374
  }
265152
265375
 
265153
- function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal, PaginationComponent, }) {
265376
+ function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId, AddResourceModal, PaginationComponent, page, search, onPageChange, onSearchChange, }) {
265154
265377
  var _a;
265155
- const { executeGatedAction } = useAgentSettings();
265378
+ const { tenantKey, mentorId, username, rbacPermissions, executeGatedAction } = useAgentSettings();
265156
265379
  const t = useT();
265157
265380
  const labels = React__default.useMemo(() => resolveDatasetsTabLabels(labelsOverride, t), [labelsOverride, t]);
265158
265381
  const [showAddResourceModal, setShowAddResourceModal] = React__default.useState(false);
265159
265382
  const openAddResourceModal = () => setShowAddResourceModal(true);
265160
265383
  const closeAddResourceModal = () => setShowAddResourceModal(false);
265161
- const { datasets, isDatasetsLoading, isDatasetsFetching, searchQuery, setSearchQuery, currentPage, totalPages, handlePageChange, } = useDatasetsWithPagination();
265384
+ const { data: mentorSettings } = useGetMentorSettingsQuery({
265385
+ mentor: mentorId,
265386
+ org: tenantKey,
265387
+ // @ts-ignore
265388
+ userId: username !== null && username !== void 0 ? username : '',
265389
+ }, {
265390
+ skip: !mentorId || !tenantKey || !username,
265391
+ });
265392
+ // The RBAC path uses the mentor DB id returned by the settings query — the
265393
+ // URL/modal mentor id is not the same value as the one RBAC permissions are
265394
+ // keyed by. While mentor_id is undefined (still loading), the path will not
265395
+ // match any entry and WithPermissions resolves hasPermission=false.
265396
+ // @ts-ignore mentor_id exists on MentorSettings
265397
+ const createResource = `/mentors/${mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_id}/documents/#create`;
265398
+ const { datasets, isDatasetsLoading, isDatasetsFetching, searchQuery, setSearchQuery, currentPage, totalPages, handlePageChange, } = useDatasetsWithPagination(5, { page, search, onPageChange, onSearchChange });
265162
265399
  const handleAddResourceClick = () => {
265163
265400
  if (executeGatedAction) {
265164
265401
  executeGatedAction(() => openAddResourceModal());
@@ -265167,14 +265404,22 @@ function AgentDatasetsTab({ labels: labelsOverride, onSelect, selectedDatasetId,
265167
265404
  openAddResourceModal();
265168
265405
  }
265169
265406
  };
265170
- return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsx("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
265407
+ return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-600", children: labels.header.description })] }) }), jsxs("div", { className: "flex-1 space-y-4 p-3 lg:p-4", style: {
265171
265408
  overflowY: 'auto',
265172
265409
  overflowX: 'hidden',
265173
- }, children: jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center", children: [jsxs("div", { className: "relative w-full sm:w-64", children: [isDatasetsFetching ? (jsx(Spinner, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-gray-500" })) : (jsx(Search, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-gray-500" })), jsx(Input, { type: "search", placeholder: labels.search.placeholder, className: "pl-8", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value) })] }), jsxs(Button$1, { onClick: handleAddResourceClick, size: "sm", className: "cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.addResource.button] })] }), jsx("div", { className: "overflow-hidden rounded-md border", children: jsx("div", { className: "overflow-x-auto sm:mx-0", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isDatasetsLoading ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.typeColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.tokensColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.intervalColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.visibilityColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.statusColumn })] }) }), jsx(DatasetItemList
265174
- // @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
265410
+ }, children: [jsx("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", "data-testid": "datasets-info-box", children: labels.infoBox }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center", children: [jsxs("div", { className: "relative w-full sm:w-64", children: [isDatasetsFetching ? (jsx(Spinner, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-blue-500" })) : (jsx(Search, { className: "absolute top-2.5 left-2.5 h-4 w-4 text-gray-500" })), jsx(Input
265411
+ // `type="text"` (not "search") so the browser renders no
265412
+ // native clear (✕) button; the Search icon + placeholder
265413
+ // convey the search affordance instead.
265175
265414
  , {
265415
+ // `type="text"` (not "search") so the browser renders no
265416
+ // native clear (✕) button; the Search icon + placeholder
265417
+ // convey the search affordance instead.
265418
+ type: "text", placeholder: labels.search.placeholder, className: "pl-8", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value) })] }), jsx(WithPermissions, { rbacResource: createResource, rbacPermissions: rbacPermissions !== null && rbacPermissions !== void 0 ? rbacPermissions : {}, children: ({ hasPermission }) => hasPermission ? (jsxs(Button$1, { onClick: handleAddResourceClick, size: "sm", className: "cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.addResource.button] })) : null })] }), jsx("div", { className: "overflow-hidden rounded-md border", children: jsx("div", { className: "overflow-x-auto sm:mx-0", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isDatasetsLoading ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.typeColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.tokensColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.intervalColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.visibilityColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.table.statusColumn })] }) }), jsx(DatasetItemList
265176
265419
  // @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
265177
- datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], onSelect: onSelect, selectedDatasetId: selectedDatasetId, labels: labels })] })) }) }) }), PaginationComponent && (jsx(PaginationComponent, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading })), AddResourceModal && (jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true }))] }) })] }));
265420
+ , {
265421
+ // @ts-ignore - Type mismatch between RetrieverDocumentEmbedding[] and Dataset[], id property type difference
265422
+ datasets: (_a = datasets === null || datasets === void 0 ? void 0 : datasets.results) !== null && _a !== void 0 ? _a : [], onSelect: onSelect, selectedDatasetId: selectedDatasetId, labels: labels })] })) }) }) }), PaginationComponent && (jsx(PaginationComponent, { currentPage: currentPage, totalPages: totalPages, onPageChange: handlePageChange, disabled: isDatasetsFetching || isDatasetsLoading })), AddResourceModal && (jsx(AddResourceModal, { isOpen: showAddResourceModal, onClose: () => closeAddResourceModal(), keepParentOpen: true }))] })] })] }));
265178
265423
  }
265179
265424
 
265180
265425
  /**