@iblai/iblai-js 1.18.0 → 1.18.2
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useRef, useEffect, useState, useCallback, useLayoutEffect, forwardRef, createElement as createElement$1, useMemo, createContext, useReducer, useImperativeHandle, useContext, useId as useId$2, useDebugValue, isValidElement, Children, PureComponent, cloneElement, Component, lazy, Suspense } from 'react';
|
|
3
3
|
import { LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, 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, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
4
|
-
import { useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, 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, 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, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
|
|
4
|
+
import { useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, 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, 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, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
|
|
5
5
|
import { toast, Toaster as Toaster$1 } from 'sonner';
|
|
6
6
|
import { jsx, Fragment as Fragment$1, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
8
8
|
import ReactDOM__default from 'react-dom';
|
|
9
9
|
import { z as z$1 } from 'zod';
|
|
10
10
|
import { useDispatch, useSelector } from 'react-redux';
|
|
11
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
12
|
+
import { createDialogScope } from '@radix-ui/react-dialog';
|
|
11
13
|
import { NotificationSourceTypeEnum, StateEnum, MentorVisibilityEnum, PromptVisibilityEnum } from '@iblai/iblai-api';
|
|
12
14
|
import { useSearchParams, useRouter, usePathname, useParams } from 'next/navigation';
|
|
13
15
|
import { skipToken } from '@reduxjs/toolkit/query';
|
|
14
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
15
|
-
import { createDialogScope } from '@radix-ui/react-dialog';
|
|
16
16
|
import Image$4 from 'next/image';
|
|
17
17
|
import dynamic from 'next/dynamic';
|
|
18
18
|
import Link$2 from 'next/link';
|
|
@@ -86744,7 +86744,7 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
|
|
|
86744
86744
|
}, children: [jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-6 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [isUserMetadataEdxLoading || isUploadingProfileImage ? (jsx(Skeleton, { className: "h-20 w-20 mb-6 rounded-full", "aria-label": "Loading profile image" })) : (jsxs("button", { type: "button", className: "relative w-20 h-20 mb-6 cursor-pointer group rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2", onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), onClick: handleAvatarClick, "aria-label": "Upload profile picture", children: [jsxs(Avatar, { className: "h-20 w-20", children: [((_b = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _b === void 0 ? void 0 : _b.has_image) ? (jsx(AvatarImage, { src: (_c = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _c === void 0 ? void 0 : _c.image_url_full, alt: "Profile picture", className: "rounded-full object-cover w-full h-full group-hover:opacity-80 transition-opacity" })) : customization.useGravatarPicFallback ? (jsx(Gravatar$1, { className: "w-full h-full rounded-full object-cover group-hover:opacity-80 transition-opacity", email: userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email, size: 80, alt: "Profile picture from Gravatar" })) : (jsx(Fragment$1, {})), jsx(AvatarFallback, { className: cn('bg-blue-800 text-white text-xl rounded-full', customization.useGravatarPicFallback &&
|
|
86745
86745
|
!((_d = userMetadataEdx === null || userMetadataEdx === void 0 ? void 0 : userMetadataEdx.profile_image) === null || _d === void 0 ? void 0 : _d.image_url_full)
|
|
86746
86746
|
? 'hidden'
|
|
86747
|
-
: ''), children: getInitials((userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '') })] }), isHovering && (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-blue-800 rounded-full border-4 border-white/20", "aria-hidden": "true", children: jsx("span", { className: "text-white text-xs font-medium text-center px-2", children: "Upload" }) })), jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileUpload, className: "hidden", "aria-label": "Choose profile picture to upload", tabIndex: -1 })] })), jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 text-center mb-4", children: [userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name, customization.showUsernameField && `, ${userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username}`] }), jsxs("div", { className: "flex justify-center space-x-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(RoleIcon, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), jsx("span", { children: isAdmin ? 'Admin' : '
|
|
86747
|
+
: ''), children: getInitials((userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username) || (userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.email) || '') })] }), isHovering && (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-blue-800 rounded-full border-4 border-white/20", "aria-hidden": "true", children: jsx("span", { className: "text-white text-xs font-medium text-center px-2", children: "Upload" }) })), jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileUpload, className: "hidden", "aria-label": "Choose profile picture to upload", tabIndex: -1 })] })), jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 text-center mb-4", children: [userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.name, customization.showUsernameField && `, ${userMetadata === null || userMetadata === void 0 ? void 0 : userMetadata.username}`] }), jsxs("div", { className: "flex justify-center space-x-3", children: [jsxs("div", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded font-medium flex items-center text-sm", children: [jsx(RoleIcon, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), jsx("span", { children: isAdmin ? 'Admin' : 'User' })] }), customization.showPlatformName && (jsx("div", { className: "bg-gray-100 text-gray-600 px-4 py-2 rounded text-xs font-medium", children: tenant.toUpperCase() }))] })] }), jsx("nav", { className: "flex-1 overflow-y-auto", style: { minHeight: 0 }, "aria-label": "Profile tabs", children: jsx("div", { className: "p-4", children: jsx("div", { className: "flex flex-col space-y-2", role: "tablist", "aria-orientation": "vertical", children: TABS.map((tab) => (jsxs("button", { role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `${tab.id}-tabpanel`, id: `${tab.id}-tab`, onClick: () => setActiveTab(tab.id), className: `w-full justify-start px-4 py-3 text-left rounded-lg transition-all flex items-center text-base ${activeTab === tab.id
|
|
86748
86748
|
? 'bg-blue-50 text-blue-700 font-medium'
|
|
86749
86749
|
: 'hover:bg-gray-50 text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100'}`, children: [jsx(tab.renderIcon, { className: "h-5 w-5 mr-3 flex-shrink-0", "aria-hidden": "true" }), jsx("span", { className: "truncate", children: tab.label })] }, tab.id))) }) }) })] }), jsx("nav", { className: "lg:hidden", "aria-label": "Profile tabs mobile", children: jsx("div", { className: "w-full justify-start px-6 py-2 bg-white border-b border-gray-200 rounded-none h-auto overflow-x-auto", children: jsx("div", { className: "flex space-x-2", role: "tablist", "aria-orientation": "horizontal", children: TABS.map((tab) => (jsxs("button", { role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `${tab.id}-tabpanel`, id: `${tab.id}-tab-mobile`, onClick: () => setActiveTab(tab.id), className: `flex items-center gap-2 px-3 py-2 rounded-lg whitespace-nowrap text-sm transition-all ${activeTab === tab.id
|
|
86750
86750
|
? 'bg-blue-50 text-blue-600 font-medium'
|
|
@@ -89043,7 +89043,7 @@ function UsersTab({ tenant, onInviteClick }) {
|
|
|
89043
89043
|
const userData = isResultsWithPolicies
|
|
89044
89044
|
? (users === null || users === void 0 ? void 0 : users.results).data
|
|
89045
89045
|
: [];
|
|
89046
|
-
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1", children: [jsxs("div", { className: "relative mb-6 max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setQuerySearch(event.target.value), placeholder: "Search users", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": "Search users" }), searchQuery.length > 0 && (searchQuery !== debouncedSearchQuery || isLoading) && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "mb-6", children: jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: onInviteClick, children: "Invite" }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Name" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Email" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Role" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Policies" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[18%]", children: "Status" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [userData.map((user, index) => (jsxs("tr", { children: [jsx("td", { "aria-label": 'user-management-name-column', className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm whitespace-nowrap overflow-hidden text-ellipsis max-w-0", children: jsx("div", { className: "truncate", children: user.name }) }), jsx("td", { "aria-label": 'user-management-email-column', className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm max-w-0", children: jsx("div", { className: "truncate", children: user.email }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Select$1, { value: user.is_admin ? 'admin' : 'student', onValueChange: () => handleUserRoleChange(user), children: [jsx(SelectTrigger, { className: "w-full text-sm", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { className: "text-sm", children: [jsx(SelectItem, { value: "admin", children: "Admin" }), jsx(SelectItem, { value: "student", children: "
|
|
89046
|
+
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1", children: [jsxs("div", { className: "relative mb-6 max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setQuerySearch(event.target.value), placeholder: "Search users", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": "Search users" }), searchQuery.length > 0 && (searchQuery !== debouncedSearchQuery || isLoading) && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx("div", { className: "mb-6", children: jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: onInviteClick, children: "Invite" }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment$1, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Name" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Email" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: "Role" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[25%]", children: "Policies" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[18%]", children: "Status" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [userData.map((user, index) => (jsxs("tr", { children: [jsx("td", { "aria-label": 'user-management-name-column', className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm whitespace-nowrap overflow-hidden text-ellipsis max-w-0", children: jsx("div", { className: "truncate", children: user.name }) }), jsx("td", { "aria-label": 'user-management-email-column', className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm max-w-0", children: jsx("div", { className: "truncate", children: user.email }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Select$1, { value: user.is_admin ? 'admin' : 'student', onValueChange: () => handleUserRoleChange(user), children: [jsx(SelectTrigger, { className: "w-full text-sm", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { className: "text-sm", children: [jsx(SelectItem, { value: "admin", children: "Admin" }), jsx(SelectItem, { value: "student", children: "User" })] })] }) }), jsx("td", { className: "px-6 py-4", children: jsxs(Popover, { modal: true, open: openPolicyPopover === user.user_id, onOpenChange: (open) => setOpenPolicyPopover(open ? user.user_id : null), children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-expanded": openPolicyPopover === user.user_id, "aria-label": `Select policies for ${user.name}`, className: "w-full justify-between text-sm h-9 font-normal", disabled: updatingUserIds.has(user === null || user === void 0 ? void 0 : user.user_id), children: [jsx("span", { className: "truncate", children: user.is_admin
|
|
89047
89047
|
? `All (${allowedPolicies.length}) selected`
|
|
89048
89048
|
: user.policies && user.policies.length > 0
|
|
89049
89049
|
? `${user.policies.length} selected`
|
|
@@ -89669,6 +89669,37 @@ function GroupsTab({ tenant, isTeam = false, hasInviteUserPermission = false, ha
|
|
|
89669
89669
|
}, tenant: tenant, teamId: shareTeamId, teamName: shareTeamName }))] }));
|
|
89670
89670
|
}
|
|
89671
89671
|
|
|
89672
|
+
var U=1,Y$1=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k$2=.99,m=/[\\\/_+.#"@\[\(\{&]/,B$1=/[\\\/_+.#"@\[\(\{&]/g,K$1=/[\s-]/,X=/[\s-]/g;function G$1(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k$2;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G$1(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B$1),R&&A>0&&(E*=Math.pow(u,R.length))):K$1.test(_.charAt(c-1))?(E*=Y$1,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G$1(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X," ")}function W(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G$1(_,C,D(_),D(C),0,0,{})}
|
|
89673
|
+
|
|
89674
|
+
var N='[cmdk-group=""]',Y='[cmdk-group-items=""]',be='[cmdk-group-heading=""]',le$1='[cmdk-item=""]',ce=`${le$1}:not([aria-disabled="true"])`,Z="cmdk-item-select",T="data-value",Re$1=(r,o,n)=>W(r,o,n),ue=React.createContext(void 0),K=()=>React.useContext(ue),de$1=React.createContext(void 0),ee$1=()=>React.useContext(de$1),fe=React.createContext(void 0),me=React.forwardRef((r,o)=>{let n=L$1(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L$1(()=>new Set),c=L$1(()=>new Map),d=L$1(()=>new Map),f=L$1(()=>new Set),p=pe(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=useId$1(),q=useId$1(),_=useId$1(),I=React.useRef(null),v=ke();k$1(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k$1(()=>{v(6,ne);},[]);let E=React.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re$1;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N}[${T}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N))==null?void 0:s.querySelector(be))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le$1}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T));}function re(e){let a=M(),s=a==null?void 0:a.closest(N),i;for(;s&&!i;)s=e>0?we(s,N):De(s,N),i=s==null?void 0:s.querySelector(ce);i?E.setState("value",i.getAttribute(T)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React.createElement(Primitive.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z);i.dispatchEvent(l);}}}}},React.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B(r,e=>React.createElement(de$1.Provider,{value:E},React.createElement(ue.Provider,{value:U},e))))}),he=React.forwardRef((r,o)=>{var _,I;let n=useId$1(),u=React.useRef(null),c=React.useContext(fe),d=K(),f=pe(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k$1(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve(n,u,[r.value,r.children,u],r.keywords),m=ee$1(),R=P$1(v=>v.value&&v.value===b.current),x=P$1(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z,C),()=>v.removeEventListener(Z,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React.createElement(Primitive.div,{ref:composeRefs$1(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=useId$1(),p=React.useRef(null),b=React.useRef(null),m=useId$1(),R=K(),x=P$1(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k$1(()=>R.group(f),[]),ve(f,p,[r.value,r.heading,b]);let C=React.useMemo(()=>({id:f,forceMount:c}),[c]);return React.createElement(Primitive.div,{ref:composeRefs$1(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B(r,S=>React.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React.createElement(fe.Provider,{value:C},S))))}),ye$1=React.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React.useRef(null),d=P$1(f=>!f.search);return !n&&!d?null:React.createElement(Primitive.div,{ref:composeRefs$1(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee$1(),f=P$1(m=>m.search),p=P$1(m=>m.selectedItemId),b=K();return React.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React.createElement(Primitive.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React.useRef(null),f=React.useRef(null),p=P$1(m=>m.selectedItemId),b=K();return React.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React.createElement(Primitive.div,{ref:composeRefs$1(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B(r,m=>React.createElement("div",{ref:composeRefs$1(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React.createElement(DialogPrimitive.Root,{open:n,onOpenChange:u},React.createElement(DialogPrimitive.Portal,{container:f},React.createElement(DialogPrimitive.Overlay,{"cmdk-overlay":"",className:c}),React.createElement(DialogPrimitive.Content,{"aria-label":r.label,"cmdk-dialog":"",className:d},React.createElement(me,{ref:o,...p}))))}),Ie=React.forwardRef((r,o)=>P$1(u=>u.filtered.count===0)?React.createElement(Primitive.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React.createElement(Primitive.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B(r,f=>React.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me,{List:Ce,Item:he,Input:Se,Group:Ee,Separator:ye$1,Dialog:xe,Empty:Ie,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe(r){let o=React.useRef(r);return k$1(()=>{o.current=r;}),o}var k$1=typeof window=="undefined"?React.useEffect:React.useLayoutEffect;function L$1(r){let o=React.useRef();return o.current===void 0&&(o.current=r()),o}function P$1(r){let o=ee$1(),n=()=>r(o.snapshot());return React.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=React.useRef(),d=K();return k$1(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T,f),c.current=f;}),c}var ke=()=>{let[r,o]=React.useState(),n=L$1(()=>new Map);return k$1(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B({asChild:r,children:o},n){return r&&React.isValidElement(o)?React.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
|
|
89675
|
+
|
|
89676
|
+
const Command = React.forwardRef(({ className, ...props }, ref) => (jsx(_e, { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
|
|
89677
|
+
Command.displayName = _e.displayName;
|
|
89678
|
+
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx(_e.Input, { ref: ref, className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
|
|
89679
|
+
CommandInput.displayName = _e.Input.displayName;
|
|
89680
|
+
const CommandList = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
|
|
89681
|
+
CommandList.displayName = _e.List.displayName;
|
|
89682
|
+
const CommandEmpty = React.forwardRef((props, ref) => (jsx(_e.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
|
|
89683
|
+
CommandEmpty.displayName = _e.Empty.displayName;
|
|
89684
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Group, { ref: ref, className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props })));
|
|
89685
|
+
CommandGroup.displayName = _e.Group.displayName;
|
|
89686
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Separator, { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
|
|
89687
|
+
CommandSeparator.displayName = _e.Separator.displayName;
|
|
89688
|
+
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Item, { ref: ref, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
|
|
89689
|
+
CommandItem.displayName = _e.Item.displayName;
|
|
89690
|
+
|
|
89691
|
+
function ActionsCombobox({ selected, onSelect, }) {
|
|
89692
|
+
const [open, setOpen] = useState(false);
|
|
89693
|
+
const { data: definitions, isLoading, isError } = useGetRbacActionsDefinitionQuery(undefined);
|
|
89694
|
+
const entries = useMemo(() => Object.entries(definitions !== null && definitions !== void 0 ? definitions : {}), [definitions]);
|
|
89695
|
+
return (jsxs("div", { children: [jsxs(Button$1, { type: "button", variant: "outline", role: "combobox", "aria-label": "Search actions", "aria-expanded": open, onClick: () => setOpen((o) => !o), className: "w-full justify-between font-normal text-muted-foreground", children: ["Search actions\u2026", jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }), open && (jsx("div", { className: "mt-2 rounded-md border border-gray-200 dark:border-gray-700", children: jsxs(Command, { filter: (value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0), children: [jsx(CommandInput, { placeholder: "Search actions by key or description\u2026" }), jsxs(CommandList, { children: [isLoading && (jsxs("div", { className: "flex items-center justify-center py-6 text-sm text-muted-foreground", children: [jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin", "aria-hidden": "true" }), "Loading actions\u2026"] })), isError && (jsx("div", { className: "py-6 text-center text-sm text-red-500", children: "Failed to load actions" })), !isLoading && !isError && (jsxs(Fragment$1, { children: [jsx(CommandEmpty, { children: "No actions found." }), jsx(CommandGroup, { children: entries.map(([key, def]) => {
|
|
89696
|
+
const isAdded = selected.includes(key);
|
|
89697
|
+
return (jsxs(CommandItem, { value: `${key} ${def.description}`, onSelect: () => {
|
|
89698
|
+
onSelect(key);
|
|
89699
|
+
setOpen(false);
|
|
89700
|
+
}, className: "flex items-start gap-2", children: [jsx(Check, { className: `mt-0.5 h-4 w-4 shrink-0 ${isAdded ? 'opacity-100' : 'opacity-0'}`, "aria-hidden": "true" }), jsxs("div", { className: "flex flex-col gap-0.5", children: [jsx("span", { className: "font-mono text-xs", children: key }), jsx("span", { className: "text-xs text-muted-foreground", children: def.description })] })] }, key));
|
|
89701
|
+
}) })] }))] })] }) }))] }));
|
|
89702
|
+
}
|
|
89672
89703
|
function RolesTab({ tenant }) {
|
|
89673
89704
|
const [page, setPage] = useState(1);
|
|
89674
89705
|
const [searchQuery, setSearchQuery] = useState('');
|
|
@@ -89754,6 +89785,9 @@ function RolesTab({ tenant }) {
|
|
|
89754
89785
|
setActionInput('');
|
|
89755
89786
|
}
|
|
89756
89787
|
}
|
|
89788
|
+
function addActionKey(key) {
|
|
89789
|
+
setActions((prev) => (prev.includes(key) ? prev : [...prev, key]));
|
|
89790
|
+
}
|
|
89757
89791
|
function removeAction(action) {
|
|
89758
89792
|
setActions(actions.filter((a) => a !== action));
|
|
89759
89793
|
}
|
|
@@ -89816,7 +89850,7 @@ function RolesTab({ tenant }) {
|
|
|
89816
89850
|
setDeletingRoleId(null);
|
|
89817
89851
|
}
|
|
89818
89852
|
}
|
|
89819
|
-
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: data === null || data === void 0 ? void 0 : data.count, itemsPerPage: 10, itemLabel: "roles" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editing ? 'Edit Role' : 'New Role' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$2, { htmlFor: "r-name", children: "Role Name" }), jsx(Input, { id: "r-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter role name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$2, { htmlFor: "r-actions", children: "Actions" }), jsxs("div", { className: "space-y-2", children: [actions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: actions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove action ${action}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-actions", value: actionInput, onChange: (e) => setActionInput(e.target.value), onKeyDown: handleActionKeyDown, placeholder: "e.g., Ibl.Mentor
|
|
89853
|
+
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx(AdvancedPagination, { variant: "footer", className: "-mx-6 -mb-6 mt-4 rounded-b-lg", totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage), totalCount: data === null || data === void 0 ? void 0 : data.count, itemsPerPage: 10, itemLabel: "roles" })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { children: editing ? 'Edit Role' : 'New Role' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$2, { htmlFor: "r-name", children: "Role Name" }), jsx(Input, { id: "r-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter role name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$2, { htmlFor: "r-actions", children: "Actions" }), jsxs("div", { className: "space-y-2", children: [actions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: actions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove action ${action}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsx(ActionsCombobox, { selected: actions, onSelect: addActionKey }), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-actions", value: actionInput, onChange: (e) => setActionInput(e.target.value), onKeyDown: handleActionKeyDown, placeholder: "Or type a custom action, e.g., Ibl.Mentor/*/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addAction, disabled: !actionInput.trim(), "aria-label": "Add action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Search predefined actions above, or type a custom one. Supports wildcards (e.g., Ibl.Mentor/*/read)" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label$2, { htmlFor: "r-data-actions", children: "Data Actions" }), jsxs("div", { className: "space-y-2", children: [dataActions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: dataActions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeDataAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove data action ${action}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-data-actions", value: dataActionInput, onChange: (e) => setDataActionInput(e.target.value), onKeyDown: handleDataActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/email/read, Ibl.Core/*/name/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addDataAction, disabled: !dataActionInput.trim(), "aria-label": "Add data action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Field-level access (e.g., Ibl.Mentor/Settings/email/read)" })] })] })] }), jsxs(DialogFooter, { className: "mt-6 gap-1.5", children: [jsx(Button$1, { variant: "outline", onClick: () => setIsOpen(false), children: "Cancel" }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, className: "", children: jsx(Button$1, { onClick: onSubmit, disabled: !!editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white w-full", children: editing ? 'Save Role' : 'Create Role' }) }) }), editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal) && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot edit internal roles" }) }))] }) })] })] }) })] }));
|
|
89820
89854
|
}
|
|
89821
89855
|
|
|
89822
89856
|
function PoliciesTab({ tenant }) {
|
|
@@ -90533,7 +90567,7 @@ const TabDescription = ({ icon, title, children }) => {
|
|
|
90533
90567
|
return (jsxs("div", { className: "flex gap-3 items-start border rounded-lg p-4 bg-blue-50/60 border-blue-100", children: [jsx("div", { className: "shrink-0 w-9 h-9 rounded-md flex items-center justify-center bg-blue-100 text-blue-600", children: icon }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("h3", { className: "text-sm font-semibold mb-1 text-blue-900 hidden sm:block", children: title }), jsx("p", { className: `text-sm text-gray-600 leading-relaxed sm:line-clamp-none! ${expanded ? '' : 'line-clamp-2'}`, children: children }), jsx("button", { type: "button", onClick: () => setExpanded((prev) => !prev), className: "mt-1 text-xs font-medium text-blue-700 hover:text-blue-800 sm:hidden", children: expanded ? 'Read less' : 'Read more' })] })] }));
|
|
90534
90568
|
};
|
|
90535
90569
|
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, }) => {
|
|
90536
|
-
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions;
|
|
90570
|
+
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every mentor, while /platforms/", '{pk}', "/mentors/", '{pk}', "/ scopes to one."] }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: "Teams", children: "A team is a curated set of users that you can share with others \u2014 e.g., grant another user permission to view the team's analytics or send notifications to them." }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: "Alerts", children: "An alert pairs a team of watched users with one or more watchers who get notified when monitored events occur for a watched user. Each watcher subscribes to its own subset of events." }), jsx(AlertsTab$1, { tenant: tenant })] }))] }) }));
|
|
90537
90571
|
};
|
|
90538
90572
|
|
|
90539
90573
|
function DeleteApiModal({ isOpen, onClose, apiKey, tenantKey }) {
|
|
@@ -94335,10 +94369,11 @@ function daysFromCurrentDate(targetDate) {
|
|
|
94335
94369
|
const oneDay = 24 * 60 * 60 * 1000; // Number of milliseconds in a day
|
|
94336
94370
|
const timeDifference = targetDate.getTime() - currentDate.getTime();
|
|
94337
94371
|
const daysDifference = Math.ceil(timeDifference / oneDay);
|
|
94338
|
-
return daysDifference * 24 * 3600;
|
|
94372
|
+
return daysDifference * 24 * 3600; // Number of seconds in a day
|
|
94339
94373
|
}
|
|
94340
94374
|
function CreateApiModal({ isOpen, onClose, tenantKey, username }) {
|
|
94341
94375
|
const [apiKey, setApiKey] = React__default.useState(null);
|
|
94376
|
+
const [isCalendarOpen, setIsCalendarOpen] = React__default.useState(false);
|
|
94342
94377
|
const [createApiKey, { isLoading }] = useCreateApiKeyMutation();
|
|
94343
94378
|
const form = useForm({
|
|
94344
94379
|
defaultValues: createApiFormDefaultValues,
|
|
@@ -94382,9 +94417,12 @@ function CreateApiModal({ isOpen, onClose, tenantKey, username }) {
|
|
|
94382
94417
|
const isDirty = field.state.meta.isDirty;
|
|
94383
94418
|
const hasErrorAndIsDirty = hasError && isDirty;
|
|
94384
94419
|
return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label$2, { className: "flex items-center text-sm font-medium text-[#646464]", children: ["API Key Name", jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { placeholder: "API Key Name", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), autoComplete: "off" }), hasErrorAndIsDirty && (jsx("p", { className: "text-red-500 text-xs", children: (_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message }))] }));
|
|
94385
|
-
} }), jsx(form.Field, { name: "expiration_date", children: (field) => (jsxs("div", { className: "space-y-1.5", children: [jsx(Label$2, { className: "flex items-center text-sm font-medium text-[#646464]", children: "Expiration Date" }), jsxs(
|
|
94420
|
+
} }), jsx(form.Field, { name: "expiration_date", children: (field) => (jsxs("div", { className: "space-y-1.5", children: [jsx(Label$2, { className: "flex items-center text-sm font-medium text-[#646464]", children: "Expiration Date" }), jsxs("div", { children: [jsxs(Button$1, { type: "button", variant: "outline", "aria-haspopup": "dialog", "aria-expanded": isCalendarOpen, onClick: () => setIsCalendarOpen((open) => !open), className: cn('w-full pl-3 text-left font-normal', !field.state.value && 'text-muted-foreground'), children: [field.state.value ? (format$1(field.state.value, 'PPP')) : (jsx("span", { children: "Pick a date" })), jsx(Calendar$1, { className: "ml-auto h-4 w-4 opacity-50" })] }), isCalendarOpen && (jsx("div", { className: "mt-2 w-auto rounded-md border border-gray-200 dark:border-gray-700", children: jsx(Calendar, { mode: "single",
|
|
94386
94421
|
// @ts-expect-error - Calendar selected prop expects Date but form field may be null
|
|
94387
|
-
selected: field.state.value, onSelect:
|
|
94422
|
+
selected: field.state.value, onSelect: (date) => {
|
|
94423
|
+
field.handleChange(date !== null && date !== void 0 ? date : null);
|
|
94424
|
+
setIsCalendarOpen(false);
|
|
94425
|
+
}, disabled: (date) => date && date < new Date() }) }))] })] })) }), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({
|
|
94388
94426
|
canSubmit: state.canSubmit,
|
|
94389
94427
|
}), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }), apiKey && jsx(ApiKeyModal, { isOpen: true, onClose: () => setApiKey(null), apiKey: apiKey })] }));
|
|
94390
94428
|
}
|
|
@@ -95623,17 +95661,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
|
|
|
95623
95661
|
dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
|
|
95624
95662
|
draft.allow_students_to_create_mentors = checked;
|
|
95625
95663
|
}));
|
|
95626
|
-
toast.success('
|
|
95664
|
+
toast.success('User mentor creation setting updated successfully');
|
|
95627
95665
|
}
|
|
95628
95666
|
catch (error) {
|
|
95629
95667
|
console.error(JSON.stringify(error));
|
|
95630
|
-
toast.error('Failed to update
|
|
95668
|
+
toast.error('Failed to update user mentor creation setting');
|
|
95631
95669
|
}
|
|
95632
95670
|
};
|
|
95633
95671
|
if (isLoadingStudentMentorCreationStatus) {
|
|
95634
95672
|
return (jsx("div", { className: "rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("div", { className: "animate-pulse", children: jsxs("div", { className: "flex items-center justify-between", children: [jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3" }), jsx("div", { className: "h-6 w-11 bg-gray-200 rounded" })] }) }) }));
|
|
95635
95673
|
}
|
|
95636
|
-
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "
|
|
95674
|
+
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User Mentor Creation" }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": "More info about public registration", className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Allow users to create mentors in the mentor platform" }) })] }) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors, onCheckedChange: handleToggleStudentMentorCreation, disabled: isUpdatingStudentMentorCreationStatus, "aria-label": `User mentor creation ${(studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors) ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingStudentMentorCreationStatus && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })] }));
|
|
95637
95675
|
};
|
|
95638
95676
|
|
|
95639
95677
|
const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
@@ -132223,14 +132261,14 @@ var symbolTriangle = {
|
|
|
132223
132261
|
|
|
132224
132262
|
const c$1 = -0.5;
|
|
132225
132263
|
const s = sqrt$1(3) / 2;
|
|
132226
|
-
const k
|
|
132227
|
-
const a$1 = (k
|
|
132264
|
+
const k = 1 / sqrt$1(12);
|
|
132265
|
+
const a$1 = (k / 2 + 1) * 3;
|
|
132228
132266
|
|
|
132229
132267
|
var symbolWye = {
|
|
132230
132268
|
draw(context, size) {
|
|
132231
132269
|
const r = sqrt$1(size / a$1);
|
|
132232
|
-
const x0 = r / 2, y0 = r * k
|
|
132233
|
-
const x1 = x0, y1 = r * k
|
|
132270
|
+
const x0 = r / 2, y0 = r * k;
|
|
132271
|
+
const x1 = x0, y1 = r * k + r;
|
|
132234
132272
|
const x2 = -x1, y2 = y1;
|
|
132235
132273
|
context.moveTo(x0, y0);
|
|
132236
132274
|
context.lineTo(x1, y1);
|
|
@@ -141436,7 +141474,7 @@ var MAX_DIGITS = 1e9, // 0 to 1e9
|
|
|
141436
141474
|
MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), // 1286742750677284
|
|
141437
141475
|
|
|
141438
141476
|
// Decimal.prototype object
|
|
141439
|
-
P
|
|
141477
|
+
P = {};
|
|
141440
141478
|
|
|
141441
141479
|
|
|
141442
141480
|
// Decimal prototype methods
|
|
@@ -141485,7 +141523,7 @@ var MAX_DIGITS = 1e9, // 0 to 1e9
|
|
|
141485
141523
|
* Return a new Decimal whose value is the absolute value of this Decimal.
|
|
141486
141524
|
*
|
|
141487
141525
|
*/
|
|
141488
|
-
P
|
|
141526
|
+
P.absoluteValue = P.abs = function () {
|
|
141489
141527
|
var x = new this.constructor(this);
|
|
141490
141528
|
if (x.s) x.s = 1;
|
|
141491
141529
|
return x;
|
|
@@ -141499,7 +141537,7 @@ P$1.absoluteValue = P$1.abs = function () {
|
|
|
141499
141537
|
* 0 if they have the same value
|
|
141500
141538
|
*
|
|
141501
141539
|
*/
|
|
141502
|
-
P
|
|
141540
|
+
P.comparedTo = P.cmp = function (y) {
|
|
141503
141541
|
var i, j, xdL, ydL,
|
|
141504
141542
|
x = this;
|
|
141505
141543
|
|
|
@@ -141528,7 +141566,7 @@ P$1.comparedTo = P$1.cmp = function (y) {
|
|
|
141528
141566
|
* Return the number of decimal places of the value of this Decimal.
|
|
141529
141567
|
*
|
|
141530
141568
|
*/
|
|
141531
|
-
P
|
|
141569
|
+
P.decimalPlaces = P.dp = function () {
|
|
141532
141570
|
var x = this,
|
|
141533
141571
|
w = x.d.length - 1,
|
|
141534
141572
|
dp = (w - x.e) * LOG_BASE;
|
|
@@ -141546,7 +141584,7 @@ P$1.decimalPlaces = P$1.dp = function () {
|
|
|
141546
141584
|
* `precision` significant digits.
|
|
141547
141585
|
*
|
|
141548
141586
|
*/
|
|
141549
|
-
P
|
|
141587
|
+
P.dividedBy = P.div = function (y) {
|
|
141550
141588
|
return divide$2(this, new this.constructor(y));
|
|
141551
141589
|
};
|
|
141552
141590
|
|
|
@@ -141556,7 +141594,7 @@ P$1.dividedBy = P$1.div = function (y) {
|
|
|
141556
141594
|
* by the value of `y`, truncated to `precision` significant digits.
|
|
141557
141595
|
*
|
|
141558
141596
|
*/
|
|
141559
|
-
P
|
|
141597
|
+
P.dividedToIntegerBy = P.idiv = function (y) {
|
|
141560
141598
|
var x = this,
|
|
141561
141599
|
Ctor = x.constructor;
|
|
141562
141600
|
return round(divide$2(x, new Ctor(y), 0, 1), Ctor.precision);
|
|
@@ -141567,7 +141605,7 @@ P$1.dividedToIntegerBy = P$1.idiv = function (y) {
|
|
|
141567
141605
|
* Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.
|
|
141568
141606
|
*
|
|
141569
141607
|
*/
|
|
141570
|
-
P
|
|
141608
|
+
P.equals = P.eq = function (y) {
|
|
141571
141609
|
return !this.cmp(y);
|
|
141572
141610
|
};
|
|
141573
141611
|
|
|
@@ -141576,7 +141614,7 @@ P$1.equals = P$1.eq = function (y) {
|
|
|
141576
141614
|
* Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).
|
|
141577
141615
|
*
|
|
141578
141616
|
*/
|
|
141579
|
-
P
|
|
141617
|
+
P.exponent = function () {
|
|
141580
141618
|
return getBase10Exponent(this);
|
|
141581
141619
|
};
|
|
141582
141620
|
|
|
@@ -141586,7 +141624,7 @@ P$1.exponent = function () {
|
|
|
141586
141624
|
* false.
|
|
141587
141625
|
*
|
|
141588
141626
|
*/
|
|
141589
|
-
P
|
|
141627
|
+
P.greaterThan = P.gt = function (y) {
|
|
141590
141628
|
return this.cmp(y) > 0;
|
|
141591
141629
|
};
|
|
141592
141630
|
|
|
@@ -141596,7 +141634,7 @@ P$1.greaterThan = P$1.gt = function (y) {
|
|
|
141596
141634
|
* otherwise return false.
|
|
141597
141635
|
*
|
|
141598
141636
|
*/
|
|
141599
|
-
P
|
|
141637
|
+
P.greaterThanOrEqualTo = P.gte = function (y) {
|
|
141600
141638
|
return this.cmp(y) >= 0;
|
|
141601
141639
|
};
|
|
141602
141640
|
|
|
@@ -141605,7 +141643,7 @@ P$1.greaterThanOrEqualTo = P$1.gte = function (y) {
|
|
|
141605
141643
|
* Return true if the value of this Decimal is an integer, otherwise return false.
|
|
141606
141644
|
*
|
|
141607
141645
|
*/
|
|
141608
|
-
P
|
|
141646
|
+
P.isInteger = P.isint = function () {
|
|
141609
141647
|
return this.e > this.d.length - 2;
|
|
141610
141648
|
};
|
|
141611
141649
|
|
|
@@ -141614,7 +141652,7 @@ P$1.isInteger = P$1.isint = function () {
|
|
|
141614
141652
|
* Return true if the value of this Decimal is negative, otherwise return false.
|
|
141615
141653
|
*
|
|
141616
141654
|
*/
|
|
141617
|
-
P
|
|
141655
|
+
P.isNegative = P.isneg = function () {
|
|
141618
141656
|
return this.s < 0;
|
|
141619
141657
|
};
|
|
141620
141658
|
|
|
@@ -141623,7 +141661,7 @@ P$1.isNegative = P$1.isneg = function () {
|
|
|
141623
141661
|
* Return true if the value of this Decimal is positive, otherwise return false.
|
|
141624
141662
|
*
|
|
141625
141663
|
*/
|
|
141626
|
-
P
|
|
141664
|
+
P.isPositive = P.ispos = function () {
|
|
141627
141665
|
return this.s > 0;
|
|
141628
141666
|
};
|
|
141629
141667
|
|
|
@@ -141632,7 +141670,7 @@ P$1.isPositive = P$1.ispos = function () {
|
|
|
141632
141670
|
* Return true if the value of this Decimal is 0, otherwise return false.
|
|
141633
141671
|
*
|
|
141634
141672
|
*/
|
|
141635
|
-
P
|
|
141673
|
+
P.isZero = function () {
|
|
141636
141674
|
return this.s === 0;
|
|
141637
141675
|
};
|
|
141638
141676
|
|
|
@@ -141641,7 +141679,7 @@ P$1.isZero = function () {
|
|
|
141641
141679
|
* Return true if the value of this Decimal is less than `y`, otherwise return false.
|
|
141642
141680
|
*
|
|
141643
141681
|
*/
|
|
141644
|
-
P
|
|
141682
|
+
P.lessThan = P.lt = function (y) {
|
|
141645
141683
|
return this.cmp(y) < 0;
|
|
141646
141684
|
};
|
|
141647
141685
|
|
|
@@ -141650,7 +141688,7 @@ P$1.lessThan = P$1.lt = function (y) {
|
|
|
141650
141688
|
* Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.
|
|
141651
141689
|
*
|
|
141652
141690
|
*/
|
|
141653
|
-
P
|
|
141691
|
+
P.lessThanOrEqualTo = P.lte = function (y) {
|
|
141654
141692
|
return this.cmp(y) < 1;
|
|
141655
141693
|
};
|
|
141656
141694
|
|
|
@@ -141668,7 +141706,7 @@ P$1.lessThanOrEqualTo = P$1.lte = function (y) {
|
|
|
141668
141706
|
* [base] {number|string|Decimal} The base of the logarithm.
|
|
141669
141707
|
*
|
|
141670
141708
|
*/
|
|
141671
|
-
P
|
|
141709
|
+
P.logarithm = P.log = function (base) {
|
|
141672
141710
|
var r,
|
|
141673
141711
|
x = this,
|
|
141674
141712
|
Ctor = x.constructor,
|
|
@@ -141707,7 +141745,7 @@ P$1.logarithm = P$1.log = function (base) {
|
|
|
141707
141745
|
* `precision` significant digits.
|
|
141708
141746
|
*
|
|
141709
141747
|
*/
|
|
141710
|
-
P
|
|
141748
|
+
P.minus = P.sub = function (y) {
|
|
141711
141749
|
var x = this;
|
|
141712
141750
|
y = new x.constructor(y);
|
|
141713
141751
|
return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));
|
|
@@ -141719,7 +141757,7 @@ P$1.minus = P$1.sub = function (y) {
|
|
|
141719
141757
|
* `precision` significant digits.
|
|
141720
141758
|
*
|
|
141721
141759
|
*/
|
|
141722
|
-
P
|
|
141760
|
+
P.modulo = P.mod = function (y) {
|
|
141723
141761
|
var q,
|
|
141724
141762
|
x = this,
|
|
141725
141763
|
Ctor = x.constructor,
|
|
@@ -141748,7 +141786,7 @@ P$1.modulo = P$1.mod = function (y) {
|
|
|
141748
141786
|
* significant digits.
|
|
141749
141787
|
*
|
|
141750
141788
|
*/
|
|
141751
|
-
P
|
|
141789
|
+
P.naturalExponential = P.exp = function () {
|
|
141752
141790
|
return exp(this);
|
|
141753
141791
|
};
|
|
141754
141792
|
|
|
@@ -141758,7 +141796,7 @@ P$1.naturalExponential = P$1.exp = function () {
|
|
|
141758
141796
|
* truncated to `precision` significant digits.
|
|
141759
141797
|
*
|
|
141760
141798
|
*/
|
|
141761
|
-
P
|
|
141799
|
+
P.naturalLogarithm = P.ln = function () {
|
|
141762
141800
|
return ln(this);
|
|
141763
141801
|
};
|
|
141764
141802
|
|
|
@@ -141768,7 +141806,7 @@ P$1.naturalLogarithm = P$1.ln = function () {
|
|
|
141768
141806
|
* -1.
|
|
141769
141807
|
*
|
|
141770
141808
|
*/
|
|
141771
|
-
P
|
|
141809
|
+
P.negated = P.neg = function () {
|
|
141772
141810
|
var x = new this.constructor(this);
|
|
141773
141811
|
x.s = -x.s || 0;
|
|
141774
141812
|
return x;
|
|
@@ -141780,7 +141818,7 @@ P$1.negated = P$1.neg = function () {
|
|
|
141780
141818
|
* `precision` significant digits.
|
|
141781
141819
|
*
|
|
141782
141820
|
*/
|
|
141783
|
-
P
|
|
141821
|
+
P.plus = P.add = function (y) {
|
|
141784
141822
|
var x = this;
|
|
141785
141823
|
y = new x.constructor(y);
|
|
141786
141824
|
return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));
|
|
@@ -141793,7 +141831,7 @@ P$1.plus = P$1.add = function (y) {
|
|
|
141793
141831
|
* [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
|
|
141794
141832
|
*
|
|
141795
141833
|
*/
|
|
141796
|
-
P
|
|
141834
|
+
P.precision = P.sd = function (z) {
|
|
141797
141835
|
var e, sd, w,
|
|
141798
141836
|
x = this;
|
|
141799
141837
|
|
|
@@ -141823,7 +141861,7 @@ P$1.precision = P$1.sd = function (z) {
|
|
|
141823
141861
|
* significant digits.
|
|
141824
141862
|
*
|
|
141825
141863
|
*/
|
|
141826
|
-
P
|
|
141864
|
+
P.squareRoot = P.sqrt = function () {
|
|
141827
141865
|
var e, n, pr, r, s, t, wpr,
|
|
141828
141866
|
x = this,
|
|
141829
141867
|
Ctor = x.constructor;
|
|
@@ -141904,7 +141942,7 @@ P$1.squareRoot = P$1.sqrt = function () {
|
|
|
141904
141942
|
* `precision` significant digits.
|
|
141905
141943
|
*
|
|
141906
141944
|
*/
|
|
141907
|
-
P
|
|
141945
|
+
P.times = P.mul = function (y) {
|
|
141908
141946
|
var carry, e, i, k, r, rL, t, xdL, ydL,
|
|
141909
141947
|
x = this,
|
|
141910
141948
|
Ctor = x.constructor,
|
|
@@ -141969,7 +142007,7 @@ P$1.times = P$1.mul = function (y) {
|
|
|
141969
142007
|
* [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
|
|
141970
142008
|
*
|
|
141971
142009
|
*/
|
|
141972
|
-
P
|
|
142010
|
+
P.toDecimalPlaces = P.todp = function (dp, rm) {
|
|
141973
142011
|
var x = this,
|
|
141974
142012
|
Ctor = x.constructor;
|
|
141975
142013
|
|
|
@@ -141993,7 +142031,7 @@ P$1.toDecimalPlaces = P$1.todp = function (dp, rm) {
|
|
|
141993
142031
|
* [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
|
|
141994
142032
|
*
|
|
141995
142033
|
*/
|
|
141996
|
-
P
|
|
142034
|
+
P.toExponential = function (dp, rm) {
|
|
141997
142035
|
var str,
|
|
141998
142036
|
x = this,
|
|
141999
142037
|
Ctor = x.constructor;
|
|
@@ -142030,7 +142068,7 @@ P$1.toExponential = function (dp, rm) {
|
|
|
142030
142068
|
* (-0.5).toFixed(0) is '-0'.
|
|
142031
142069
|
*
|
|
142032
142070
|
*/
|
|
142033
|
-
P
|
|
142071
|
+
P.toFixed = function (dp, rm) {
|
|
142034
142072
|
var str, y,
|
|
142035
142073
|
x = this,
|
|
142036
142074
|
Ctor = x.constructor;
|
|
@@ -142056,7 +142094,7 @@ P$1.toFixed = function (dp, rm) {
|
|
|
142056
142094
|
* rounding mode `rounding`.
|
|
142057
142095
|
*
|
|
142058
142096
|
*/
|
|
142059
|
-
P
|
|
142097
|
+
P.toInteger = P.toint = function () {
|
|
142060
142098
|
var x = this,
|
|
142061
142099
|
Ctor = x.constructor;
|
|
142062
142100
|
return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);
|
|
@@ -142067,7 +142105,7 @@ P$1.toInteger = P$1.toint = function () {
|
|
|
142067
142105
|
* Return the value of this Decimal converted to a number primitive.
|
|
142068
142106
|
*
|
|
142069
142107
|
*/
|
|
142070
|
-
P
|
|
142108
|
+
P.toNumber = function () {
|
|
142071
142109
|
return +this;
|
|
142072
142110
|
};
|
|
142073
142111
|
|
|
@@ -142085,7 +142123,7 @@ P$1.toNumber = function () {
|
|
|
142085
142123
|
* y {number|string|Decimal} The power to which to raise this Decimal.
|
|
142086
142124
|
*
|
|
142087
142125
|
*/
|
|
142088
|
-
P
|
|
142126
|
+
P.toPower = P.pow = function (y) {
|
|
142089
142127
|
var e, k, pr, r, sign, yIsInt,
|
|
142090
142128
|
x = this,
|
|
142091
142129
|
Ctor = x.constructor,
|
|
@@ -142175,7 +142213,7 @@ P$1.toPower = P$1.pow = function (y) {
|
|
|
142175
142213
|
* [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
|
|
142176
142214
|
*
|
|
142177
142215
|
*/
|
|
142178
|
-
P
|
|
142216
|
+
P.toPrecision = function (sd, rm) {
|
|
142179
142217
|
var e, str,
|
|
142180
142218
|
x = this,
|
|
142181
142219
|
Ctor = x.constructor;
|
|
@@ -142207,7 +142245,7 @@ P$1.toPrecision = function (sd, rm) {
|
|
|
142207
142245
|
* [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
|
|
142208
142246
|
*
|
|
142209
142247
|
*/
|
|
142210
|
-
P
|
|
142248
|
+
P.toSignificantDigits = P.tosd = function (sd, rm) {
|
|
142211
142249
|
var x = this,
|
|
142212
142250
|
Ctor = x.constructor;
|
|
142213
142251
|
|
|
@@ -142232,7 +142270,7 @@ P$1.toSignificantDigits = P$1.tosd = function (sd, rm) {
|
|
|
142232
142270
|
* `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.
|
|
142233
142271
|
*
|
|
142234
142272
|
*/
|
|
142235
|
-
P
|
|
142273
|
+
P.toString = P.valueOf = P.val = P.toJSON = P[Symbol.for('nodejs.util.inspect.custom')] = function () {
|
|
142236
142274
|
var x = this,
|
|
142237
142275
|
e = getBase10Exponent(x),
|
|
142238
142276
|
Ctor = x.constructor;
|
|
@@ -143263,7 +143301,7 @@ function clone(obj) {
|
|
|
143263
143301
|
else throw Error(invalidArgument + value);
|
|
143264
143302
|
}
|
|
143265
143303
|
|
|
143266
|
-
Decimal.prototype = P
|
|
143304
|
+
Decimal.prototype = P;
|
|
143267
143305
|
|
|
143268
143306
|
Decimal.ROUND_UP = 0;
|
|
143269
143307
|
Decimal.ROUND_DOWN = 1;
|
|
@@ -160499,7 +160537,7 @@ var ForAll = "∀";
|
|
|
160499
160537
|
var Fouriertrf = "ℱ";
|
|
160500
160538
|
var Fscr = "ℱ";
|
|
160501
160539
|
var GJcy = "Ѓ";
|
|
160502
|
-
var G
|
|
160540
|
+
var G = ">";
|
|
160503
160541
|
var GT = ">";
|
|
160504
160542
|
var Gamma = "Γ";
|
|
160505
160543
|
var Gammad = "Ϝ";
|
|
@@ -160577,7 +160615,7 @@ var Kfr = "𝔎";
|
|
|
160577
160615
|
var Kopf = "𝕂";
|
|
160578
160616
|
var Kscr = "𝒦";
|
|
160579
160617
|
var LJcy = "Љ";
|
|
160580
|
-
var L
|
|
160618
|
+
var L = "<";
|
|
160581
160619
|
var LT = "<";
|
|
160582
160620
|
var Lacute = "Ĺ";
|
|
160583
160621
|
var Lambda = "Λ";
|
|
@@ -160779,7 +160817,7 @@ var Rarrtl = "⤖";
|
|
|
160779
160817
|
var Rcaron = "Ř";
|
|
160780
160818
|
var Rcedil = "Ŗ";
|
|
160781
160819
|
var Rcy = "Р";
|
|
160782
|
-
var Re
|
|
160820
|
+
var Re = "ℜ";
|
|
160783
160821
|
var ReverseElement = "∋";
|
|
160784
160822
|
var ReverseEquilibrium = "⇋";
|
|
160785
160823
|
var ReverseUpEquilibrium = "⥯";
|
|
@@ -161263,7 +161301,7 @@ var dd = "ⅆ";
|
|
|
161263
161301
|
var ddagger = "‡";
|
|
161264
161302
|
var ddarr = "⇊";
|
|
161265
161303
|
var ddotseq = "⩷";
|
|
161266
|
-
var de
|
|
161304
|
+
var de = "°";
|
|
161267
161305
|
var deg = "°";
|
|
161268
161306
|
var delta = "δ";
|
|
161269
161307
|
var demptyv = "⦱";
|
|
@@ -161325,7 +161363,7 @@ var ecirc = "ê";
|
|
|
161325
161363
|
var ecolon = "≕";
|
|
161326
161364
|
var ecy = "э";
|
|
161327
161365
|
var edot = "ė";
|
|
161328
|
-
var ee
|
|
161366
|
+
var ee = "ⅇ";
|
|
161329
161367
|
var efDot = "≒";
|
|
161330
161368
|
var efr = "𝔢";
|
|
161331
161369
|
var eg = "⪚";
|
|
@@ -161627,7 +161665,7 @@ var ldquor = "„";
|
|
|
161627
161665
|
var ldrdhar = "⥧";
|
|
161628
161666
|
var ldrushar = "⥋";
|
|
161629
161667
|
var ldsh = "↲";
|
|
161630
|
-
var le
|
|
161668
|
+
var le = "≤";
|
|
161631
161669
|
var leftarrow = "←";
|
|
161632
161670
|
var leftarrowtail = "↢";
|
|
161633
161671
|
var leftharpoondown = "↽";
|
|
@@ -162529,7 +162567,7 @@ var yacute = "ý";
|
|
|
162529
162567
|
var yacy = "я";
|
|
162530
162568
|
var ycirc = "ŷ";
|
|
162531
162569
|
var ycy = "ы";
|
|
162532
|
-
var ye
|
|
162570
|
+
var ye = "¥";
|
|
162533
162571
|
var yen = "¥";
|
|
162534
162572
|
var yfr = "𝔶";
|
|
162535
162573
|
var yicy = "ї";
|
|
@@ -162720,7 +162758,7 @@ var require$$0 = {
|
|
|
162720
162758
|
Fouriertrf: Fouriertrf,
|
|
162721
162759
|
Fscr: Fscr,
|
|
162722
162760
|
GJcy: GJcy,
|
|
162723
|
-
G: G
|
|
162761
|
+
G: G,
|
|
162724
162762
|
GT: GT,
|
|
162725
162763
|
Gamma: Gamma,
|
|
162726
162764
|
Gammad: Gammad,
|
|
@@ -162798,7 +162836,7 @@ var require$$0 = {
|
|
|
162798
162836
|
Kopf: Kopf,
|
|
162799
162837
|
Kscr: Kscr,
|
|
162800
162838
|
LJcy: LJcy,
|
|
162801
|
-
L: L
|
|
162839
|
+
L: L,
|
|
162802
162840
|
LT: LT,
|
|
162803
162841
|
Lacute: Lacute,
|
|
162804
162842
|
Lambda: Lambda,
|
|
@@ -163001,7 +163039,7 @@ var require$$0 = {
|
|
|
163001
163039
|
Rcaron: Rcaron,
|
|
163002
163040
|
Rcedil: Rcedil,
|
|
163003
163041
|
Rcy: Rcy,
|
|
163004
|
-
Re: Re
|
|
163042
|
+
Re: Re,
|
|
163005
163043
|
ReverseElement: ReverseElement,
|
|
163006
163044
|
ReverseEquilibrium: ReverseEquilibrium,
|
|
163007
163045
|
ReverseUpEquilibrium: ReverseUpEquilibrium,
|
|
@@ -163485,7 +163523,7 @@ var require$$0 = {
|
|
|
163485
163523
|
ddagger: ddagger,
|
|
163486
163524
|
ddarr: ddarr,
|
|
163487
163525
|
ddotseq: ddotseq,
|
|
163488
|
-
de: de
|
|
163526
|
+
de: de,
|
|
163489
163527
|
deg: deg,
|
|
163490
163528
|
delta: delta,
|
|
163491
163529
|
demptyv: demptyv,
|
|
@@ -163547,7 +163585,7 @@ var require$$0 = {
|
|
|
163547
163585
|
ecolon: ecolon,
|
|
163548
163586
|
ecy: ecy,
|
|
163549
163587
|
edot: edot,
|
|
163550
|
-
ee: ee
|
|
163588
|
+
ee: ee,
|
|
163551
163589
|
efDot: efDot,
|
|
163552
163590
|
efr: efr,
|
|
163553
163591
|
eg: eg,
|
|
@@ -163850,7 +163888,7 @@ var require$$0 = {
|
|
|
163850
163888
|
ldrdhar: ldrdhar,
|
|
163851
163889
|
ldrushar: ldrushar,
|
|
163852
163890
|
ldsh: ldsh,
|
|
163853
|
-
le: le
|
|
163891
|
+
le: le,
|
|
163854
163892
|
leftarrow: leftarrow,
|
|
163855
163893
|
leftarrowtail: leftarrowtail,
|
|
163856
163894
|
leftharpoondown: leftharpoondown,
|
|
@@ -164752,7 +164790,7 @@ var require$$0 = {
|
|
|
164752
164790
|
yacy: yacy,
|
|
164753
164791
|
ycirc: ycirc,
|
|
164754
164792
|
ycy: ycy,
|
|
164755
|
-
ye: ye
|
|
164793
|
+
ye: ye,
|
|
164756
164794
|
yen: yen,
|
|
164757
164795
|
yfr: yfr,
|
|
164758
164796
|
yicy: yicy,
|
|
@@ -191449,7 +191487,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
191449
191487
|
/* Error or no data state */
|
|
191450
191488
|
jsx("div", { className: "flex items-center justify-center h-full text-gray-400", children: jsxs("div", { className: "text-center", children: [jsx(X$1, { className: "h-6 w-6 mx-auto mb-2 text-red-400" }), jsx("p", { children: "No transcript details available" }), jsx("p", { className: "text-sm mt-1", children: "Unable to load transcript for this conversation." })] }) })) : (
|
|
191451
191489
|
/* Data loaded successfully */
|
|
191452
|
-
jsxs(Fragment$1, { children: [jsxs("div", { className: "mb-4 flex-shrink-0", children: [jsx("h2", { className: "text-lg font-semibold mb-2", children: "Conversation Transcript" }), jsxs("div", { className: "text-sm text-gray-500", children: [jsxs("div", { children: ["Full Name: ", ((_a = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _a === void 0 ? void 0 : _a.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_b = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _b === void 0 ? void 0 : _b.username) || '-'] }), jsxs("div", { children: ["Mentor: ", ((_c = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _c === void 0 ? void 0 : _c.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_d = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _d === void 0 ? void 0 : _d.model) || '-'] })] })] }), jsx("div", { className: "flex-1 overflow-y-auto space-y-4 min-h-0", children: ((_e = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _e === void 0 ? void 0 : _e.length) > 0 ? ((_f = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _f === void 0 ? void 0 : _f.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: `p-3 rounded-lg bg-blue-100 ml-4`, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "
|
|
191490
|
+
jsxs(Fragment$1, { children: [jsxs("div", { className: "mb-4 flex-shrink-0", children: [jsx("h2", { className: "text-lg font-semibold mb-2", children: "Conversation Transcript" }), jsxs("div", { className: "text-sm text-gray-500", children: [jsxs("div", { children: ["Full Name: ", ((_a = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _a === void 0 ? void 0 : _a.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_b = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _b === void 0 ? void 0 : _b.username) || '-'] }), jsxs("div", { children: ["Mentor: ", ((_c = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _c === void 0 ? void 0 : _c.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_d = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _d === void 0 ? void 0 : _d.model) || '-'] })] })] }), jsx("div", { className: "flex-1 overflow-y-auto space-y-4 min-h-0", children: ((_e = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _e === void 0 ? void 0 : _e.length) > 0 ? ((_f = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _f === void 0 ? void 0 : _f.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: `p-3 rounded-lg bg-blue-100 ml-4`, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "User" }) }), jsx("p", { className: "text-sm", children: getMessageContent(message.human) })] }, `${index}-human`)), (message === null || message === void 0 ? void 0 : message.ai) && (jsxs("div", { className: `p-3 rounded-lg bg-white mr-4`, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "Mentor" }) }), jsx(Markdown, { children: getMessageContent(message.ai) })] }, `${index}-ai`))] }, index)))) : (jsx("div", { className: "text-center text-gray-500 py-8", children: jsx("p", { children: "No messages in this conversation." }) })) })] })) }));
|
|
191453
191491
|
};
|
|
191454
191492
|
return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Average number of messages per conversation", value: ((_a = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_messages_per_conversation) === null || _a === void 0 ? void 0 : _a.value) || 0, percentage: ((_b = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_messages_per_conversation) === null || _b === void 0 ? void 0 : _b.percentage_change) ||
|
|
191455
191493
|
undefined, loading: isLoadingTranscriptsConversationHeadlineData }), jsx(StatCard, { title: "Average cost per conversation", value: Number(((_c = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_cost_per_conversation) === null || _c === void 0 ? void 0 : _c.value) || 0).toFixed(2), percentage: ((_d = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_cost_per_conversation) === null || _d === void 0 ? void 0 : _d.percentage_change) ||
|
|
@@ -191470,7 +191508,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
191470
191508
|
? 'Negative'
|
|
191471
191509
|
: transcript.sentiment === 'positive'
|
|
191472
191510
|
? 'Positive'
|
|
191473
|
-
: 'Neutral', ' ', "User Sentiment"] })] }) }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["
|
|
191511
|
+
: 'Neutral', ' ', "User Sentiment"] })] }) }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["User: ", (transcript === null || transcript === void 0 ? void 0 : transcript.name) || (transcript === null || transcript === void 0 ? void 0 : transcript.username) || '-'] }), jsxs("div", { children: ["Mentor: ", (transcript === null || transcript === void 0 ? void 0 : transcript.mentor) || '-'] })] }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["model: ", (transcript === null || transcript === void 0 ? void 0 : transcript.model) || '-'] }), jsxs("div", { children: ["user_id: ", (transcript === null || transcript === void 0 ? void 0 : transcript.username) || '-'] })] }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500", children: [jsxs("div", { children: [transcript.message_count, " messages"] }), jsx("div", { children: "\u2022" }), jsxs("div", { children: ["$", Number((transcript === null || transcript === void 0 ? void 0 : transcript.cost) || 0).toFixed(2), " estimated cost"] }), (transcript === null || transcript === void 0 ? void 0 : transcript.created_at) && (jsxs(Fragment$1, { children: [jsx("div", { children: "\u2022" }), jsxs("div", { children: ["Created ", formatRelativeTime(transcript.created_at)] })] }))] })] }, transcript.session));
|
|
191474
191512
|
})) : (
|
|
191475
191513
|
// Empty state
|
|
191476
191514
|
jsx("div", { className: "text-center py-12", children: jsx("p", { className: "text-gray-500", children: filters.topicSearch || filters.userSearch || filters.rating
|
|
@@ -191489,7 +191527,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
191489
191527
|
/* Error or no data state */
|
|
191490
191528
|
jsx("div", { className: "flex items-center justify-center h-full text-gray-400", children: jsxs("div", { className: "text-center", children: [jsx(X$1, { className: "h-6 w-6 mx-auto mb-2 text-red-400" }), jsx("p", { children: "No transcript details available" }), jsx("p", { className: "text-sm mt-1", children: "Unable to load transcript for this conversation." })] }) })) : (
|
|
191491
191529
|
/* Data loaded successfully */
|
|
191492
|
-
jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "mb-4", children: jsxs("div", { className: "text-sm text-gray-500 space-y-1", children: [jsxs("div", { children: ["Full Name: ", ((_g = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _g === void 0 ? void 0 : _g.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_h = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _h === void 0 ? void 0 : _h.username) || '-'] }), jsxs("div", { children: ["Mentor: ", ((_j = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _j === void 0 ? void 0 : _j.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_k = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _k === void 0 ? void 0 : _k.model) || '-'] })] }) }), jsx("div", { className: "space-y-4 pb-4", children: ((_l = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _l === void 0 ? void 0 : _l.length) > 0 ? ((_m = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _m === void 0 ? void 0 : _m.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: "p-3 rounded-lg bg-blue-100 ml-4", children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "
|
|
191530
|
+
jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "mb-4", children: jsxs("div", { className: "text-sm text-gray-500 space-y-1", children: [jsxs("div", { children: ["Full Name: ", ((_g = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _g === void 0 ? void 0 : _g.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_h = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _h === void 0 ? void 0 : _h.username) || '-'] }), jsxs("div", { children: ["Mentor: ", ((_j = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _j === void 0 ? void 0 : _j.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_k = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _k === void 0 ? void 0 : _k.model) || '-'] })] }) }), jsx("div", { className: "space-y-4 pb-4", children: ((_l = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _l === void 0 ? void 0 : _l.length) > 0 ? ((_m = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _m === void 0 ? void 0 : _m.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: "p-3 rounded-lg bg-blue-100 ml-4", children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "User" }) }), jsx("p", { className: "text-sm", children: getMessageContent(message.human) })] })), (message === null || message === void 0 ? void 0 : message.ai) && (jsxs("div", { className: "p-3 rounded-lg bg-white mr-4 border", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "Mentor" }) }), jsx(Markdown, { children: getMessageContent(message.ai) })] }))] }, index)))) : (jsx("div", { className: "text-center text-gray-500 py-8", children: jsx("p", { children: "No messages in this conversation." }) })) })] })) })] }) }))] }));
|
|
191493
191531
|
}
|
|
191494
191532
|
|
|
191495
191533
|
const phaseConfig = {
|
|
@@ -193186,25 +193224,6 @@ function AnalyticsMonetizationStats({ tenantKey }) {
|
|
|
193186
193224
|
setPaywallPage(paywallsData.previous_page), children: "Previous" }), jsxs("span", { className: "text-xs text-gray-500", children: ["Page ", paywallPage] }), jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 text-xs", disabled: paywallsData.next_page === null, onClick: () => paywallsData.next_page !== null && setPaywallPage(paywallsData.next_page), children: "Next" })] })] }))] }) })] }));
|
|
193187
193225
|
}
|
|
193188
193226
|
|
|
193189
|
-
var U=1,Y$1=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k$1=.99,m=/[\\\/_+.#"@\[\(\{&]/,B$1=/[\\\/_+.#"@\[\(\{&]/g,K$1=/[\s-]/,X=/[\s-]/g;function G(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k$1;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B$1),R&&A>0&&(E*=Math.pow(u,R.length))):K$1.test(_.charAt(c-1))?(E*=Y$1,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X," ")}function W(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G(_,C,D(_),D(C),0,0,{})}
|
|
193190
|
-
|
|
193191
|
-
var N='[cmdk-group=""]',Y='[cmdk-group-items=""]',be='[cmdk-group-heading=""]',le='[cmdk-item=""]',ce=`${le}:not([aria-disabled="true"])`,Z="cmdk-item-select",T="data-value",Re=(r,o,n)=>W(r,o,n),ue=React.createContext(void 0),K=()=>React.useContext(ue),de=React.createContext(void 0),ee=()=>React.useContext(de),fe=React.createContext(void 0),me=React.forwardRef((r,o)=>{let n=L(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L(()=>new Set),c=L(()=>new Map),d=L(()=>new Map),f=L(()=>new Set),p=pe(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=useId$1(),q=useId$1(),_=useId$1(),I=React.useRef(null),v=ke();k(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k(()=>{v(6,ne);},[]);let E=React.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N}[${T}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N))==null?void 0:s.querySelector(be))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T));}function re(e){let a=M(),s=a==null?void 0:a.closest(N),i;for(;s&&!i;)s=e>0?we(s,N):De(s,N),i=s==null?void 0:s.querySelector(ce);i?E.setState("value",i.getAttribute(T)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React.createElement(Primitive.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z);i.dispatchEvent(l);}}}}},React.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B(r,e=>React.createElement(de.Provider,{value:E},React.createElement(ue.Provider,{value:U},e))))}),he=React.forwardRef((r,o)=>{var _,I;let n=useId$1(),u=React.useRef(null),c=React.useContext(fe),d=K(),f=pe(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve(n,u,[r.value,r.children,u],r.keywords),m=ee(),R=P(v=>v.value&&v.value===b.current),x=P(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z,C),()=>v.removeEventListener(Z,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React.createElement(Primitive.div,{ref:composeRefs$1(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=useId$1(),p=React.useRef(null),b=React.useRef(null),m=useId$1(),R=K(),x=P(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k(()=>R.group(f),[]),ve(f,p,[r.value,r.heading,b]);let C=React.useMemo(()=>({id:f,forceMount:c}),[c]);return React.createElement(Primitive.div,{ref:composeRefs$1(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B(r,S=>React.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React.createElement(fe.Provider,{value:C},S))))}),ye=React.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React.useRef(null),d=P(f=>!f.search);return !n&&!d?null:React.createElement(Primitive.div,{ref:composeRefs$1(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee(),f=P(m=>m.search),p=P(m=>m.selectedItemId),b=K();return React.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React.createElement(Primitive.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React.useRef(null),f=React.useRef(null),p=P(m=>m.selectedItemId),b=K();return React.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React.createElement(Primitive.div,{ref:composeRefs$1(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B(r,m=>React.createElement("div",{ref:composeRefs$1(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React.createElement(DialogPrimitive.Root,{open:n,onOpenChange:u},React.createElement(DialogPrimitive.Portal,{container:f},React.createElement(DialogPrimitive.Overlay,{"cmdk-overlay":"",className:c}),React.createElement(DialogPrimitive.Content,{"aria-label":r.label,"cmdk-dialog":"",className:d},React.createElement(me,{ref:o,...p}))))}),Ie=React.forwardRef((r,o)=>P(u=>u.filtered.count===0)?React.createElement(Primitive.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React.createElement(Primitive.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B(r,f=>React.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me,{List:Ce,Item:he,Input:Se,Group:Ee,Separator:ye,Dialog:xe,Empty:Ie,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe(r){let o=React.useRef(r);return k(()=>{o.current=r;}),o}var k=typeof window=="undefined"?React.useEffect:React.useLayoutEffect;function L(r){let o=React.useRef();return o.current===void 0&&(o.current=r()),o}function P(r){let o=ee(),n=()=>r(o.snapshot());return React.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=React.useRef(),d=K();return k(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T,f),c.current=f;}),c}var ke=()=>{let[r,o]=React.useState(),n=L(()=>new Map);return k(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B({asChild:r,children:o},n){return r&&React.isValidElement(o)?React.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
|
|
193192
|
-
|
|
193193
|
-
const Command = React.forwardRef(({ className, ...props }, ref) => (jsx(_e, { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
|
|
193194
|
-
Command.displayName = _e.displayName;
|
|
193195
|
-
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx(_e.Input, { ref: ref, className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
|
|
193196
|
-
CommandInput.displayName = _e.Input.displayName;
|
|
193197
|
-
const CommandList = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
|
|
193198
|
-
CommandList.displayName = _e.List.displayName;
|
|
193199
|
-
const CommandEmpty = React.forwardRef((props, ref) => (jsx(_e.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
|
|
193200
|
-
CommandEmpty.displayName = _e.Empty.displayName;
|
|
193201
|
-
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Group, { ref: ref, className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props })));
|
|
193202
|
-
CommandGroup.displayName = _e.Group.displayName;
|
|
193203
|
-
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Separator, { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
|
|
193204
|
-
CommandSeparator.displayName = _e.Separator.displayName;
|
|
193205
|
-
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Item, { ref: ref, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
|
|
193206
|
-
CommandItem.displayName = _e.Item.displayName;
|
|
193207
|
-
|
|
193208
193227
|
const formatDateToYYYYMMDD = (date) => {
|
|
193209
193228
|
if (!date)
|
|
193210
193229
|
return undefined;
|
|
@@ -201639,9 +201658,9 @@ function EditAgentPromptModal({ isOpen, onClose, label, value, onSave, disabled
|
|
|
201639
201658
|
/** Neutral default base template (`template_name`) for a new agent. */
|
|
201640
201659
|
const DEFAULT_AGENT_TEMPLATE = 'ai-mentor';
|
|
201641
201660
|
const DEFAULT_AGENT_PROMPTS = {
|
|
201642
|
-
system: `You are a helpful instructor, ready to answer the
|
|
201661
|
+
system: `You are a helpful instructor, ready to answer the user's questions. Answer quickly and concisely. Offer to go in depth or explain with an example where necessary. Will tip you $200 if the user understands what you say.
|
|
201643
201662
|
|
|
201644
|
-
Given this information, help
|
|
201663
|
+
Given this information, help users understand by providing explanations, examples, analogies.
|
|
201645
201664
|
Given the data you will receive from the vector store extracted parts of a long document and a question, create a final answer. Do not tell the user how you are going to answer the question. If and ONLY if the current message from the user is a greeting, greet back and ask them how you may help them. DO NOT needlessly keep greeting or repeating messages to the user. If the there is no data from the document or it is blank, or no chat history, do not tell the user that the document is blank and also do not tell them that you have not asked any questions just answer normally with your own knowledge
|
|
201646
201665
|
|
|
201647
201666
|
IMPORTANT: You must ONLY reply to the current message from the user.
|
|
@@ -201658,7 +201677,7 @@ Generate suggested prompts for the user based on the conversation.
|
|
|
201658
201677
|
};
|
|
201659
201678
|
const DEFAULT_VISIBILITY_OPTIONS = [
|
|
201660
201679
|
{ label: 'Administrators', value: 'viewable_by_tenant_admins' },
|
|
201661
|
-
{ label: '
|
|
201680
|
+
{ label: 'Users', value: 'viewable_by_tenant_students' },
|
|
201662
201681
|
{ label: 'Anyone', value: 'viewable_by_anyone' },
|
|
201663
201682
|
];
|
|
201664
201683
|
/** Index into DEFAULT_VISIBILITY_OPTIONS used as the initial visibility. */
|