import { computed } from 'vue'

export function useTravelReimbursementCreateViewUi(ctx) {
  const messageItemUi = computed(() => ({
    ASSISTANT_DISPLAY_NAME: ctx.ASSISTANT_DISPLAY_NAME,
    aiAvatar: ctx.aiAvatar,
    userAvatar: ctx.userAvatar,
    submitting: ctx.submitting.value,
    reviewActionBusy: ctx.reviewActionBusy.value,
    sessionSwitchBusy: ctx.sessionSwitchBusy.value,
    applicationPreviewEditor: ctx.applicationPreviewEditor.value,
    buildMessageBubbleClass: ctx.buildMessageBubbleClass,
    resolveStewardMissingFieldItems: ctx.resolveStewardMissingFieldItems,
    buildReviewMainMessageText: ctx.buildReviewMainMessageText,
    renderMarkdown: ctx.renderMarkdown,
    handleAssistantMarkdownClick: ctx.handleAssistantMarkdownClick,
    resolveApplicationPreviewRows: ctx.resolveApplicationPreviewRows,
    resolveApplicationPreviewEditorControl: ctx.resolveApplicationPreviewEditorControl,
    resolveApplicationPreviewEditorOptions: ctx.resolveApplicationPreviewEditorOptions,
    resolveApplicationPreviewMissingFields: ctx.resolveApplicationPreviewMissingFields,
    isApplicationPreviewEditing: ctx.isApplicationPreviewEditing,
    isApplicationPreviewDateEditorOpen: ctx.isApplicationPreviewDateEditorOpen,
    openApplicationPreviewEditor: ctx.openApplicationPreviewEditorFromUi,
    commitApplicationPreviewEditor: ctx.commitApplicationPreviewEditor,
    commitApplicationPreviewDateEditor: ctx.commitApplicationPreviewDateEditor,
    setApplicationPreviewDateMode: ctx.setApplicationPreviewDateMode,
    canApplyApplicationPreviewDateSelection: ctx.canApplyApplicationPreviewDateSelection,
    handleApplicationPreviewEditorKeydown: ctx.handleApplicationPreviewEditorKeydown,
    buildApplicationPreviewFooterText: ctx.buildApplicationPreviewFooterText,
    canRetryApplicationPreviewDecision: ctx.canRetryApplicationPreviewDecision,
    canSaveApplicationPreviewDraft: ctx.canSaveApplicationPreviewDraft,
    canSubmitApplicationPreview: ctx.canSubmitApplicationPreview,
    retryApplicationPreviewDecision: ctx.retryApplicationPreviewDecision,
    saveApplicationPreviewDraft: ctx.saveApplicationPreviewDraft,
    resolveAppliedApplicationPreviewMemories: ctx.resolveAppliedApplicationPreviewMemories,
    resolveVisibleApplicationLearningReceipts: ctx.resolveVisibleApplicationLearningReceipts,
    resolveApplicationLearningReceiptTitle: ctx.resolveApplicationLearningReceiptTitle,
    resolveApplicationMemoryEvidenceText: ctx.resolveApplicationMemoryEvidenceText,
    isForgettingApplicationMemory: ctx.isForgettingApplicationMemory,
    forgetApplicationPreviewMemory: ctx.forgetApplicationPreviewMemory,
    isApplicationDraftPayload: ctx.isApplicationDraftPayload,
    resolveApplicationDraftStatusLabel: ctx.resolveApplicationDraftStatusLabel,
    buildApplicationDraftSummaryItems: ctx.buildApplicationDraftSummaryItems,
    shouldShowDraftSavedCard: ctx.shouldShowDraftSavedCard,
    canOpenDraftDetail: ctx.canOpenDraftDetail,
    resolveReimbursementDraftClaimNo: ctx.resolveReimbursementDraftClaimNo,
    openApplicationDraftDetail: ctx.openApplicationDraftDetail,
    shouldShowAssistantMessageActions: ctx.shouldShowAssistantMessageActions,
    copyAssistantMessage: ctx.copyAssistantMessage,
    speakAssistantMessage: ctx.speakAssistantMessage,
    isMessageFeedbackSelected: ctx.isMessageFeedbackSelected,
    submitOperationFeedbackForMessage: ctx.submitOperationFeedbackForMessage,
    runWelcomeQuickAction: ctx.runShortcut,
    handleSuggestedAction: ctx.handleSuggestedAction,
    isSuggestedActionSelected: ctx.isSuggestedActionSelected,
    buildExpenseQueryWindowLabel: ctx.buildExpenseQueryWindowLabel,
    buildExpenseQueryHint: ctx.buildExpenseQueryHint,
    getExpenseQueryActivePage: ctx.getExpenseQueryActivePage,
    getExpenseQueryTotalPages: ctx.getExpenseQueryTotalPages,
    getExpenseQueryVisibleRecords: ctx.getExpenseQueryVisibleRecords,
    handleExpenseQueryRecordClick: ctx.handleExpenseQueryRecordClick,
    appendExpenseQueryRiskToConversation: ctx.appendExpenseQueryRiskToConversation,
    shiftExpenseQueryPage: ctx.shiftExpenseQueryPage,
    setExpenseQueryPage: ctx.setExpenseQueryPage,
    buildReviewPlainFollowupForMessage: ctx.buildReviewPlainFollowupForMessage,
    canUseInlineSaveDraft: ctx.canUseInlineSaveDraft,
    handleInlineSaveDraft: ctx.handleInlineSaveDraft,
    buildReviewNextStepRichCopyForMessage: ctx.buildReviewNextStepRichCopyForMessage,
    resolveReviewFooterActions: ctx.resolveReviewFooterActions,
    handleReviewAction: ctx.handleReviewAction,
    buildReviewPrimaryButtonLabel: ctx.buildReviewPrimaryButtonLabel
  }))

  const insightPanelUi = computed(() => ({
    showInsightPanel: ctx.showInsightPanel.value,
    isKnowledgeSession: ctx.isKnowledgeSession.value,
    activeReviewPayload: ctx.activeReviewPayload.value,
    isReviewFlowDrawer: ctx.isReviewFlowDrawer.value,
    currentInsight: ctx.currentInsight.value,
    currentIntentLabel: ctx.currentIntentLabel.value,
    reviewDrawerTitle: ctx.reviewDrawerTitle.value,
    reviewOverviewDrawerAvailable: ctx.reviewOverviewDrawerAvailable.value,
    isReviewOverviewDrawer: ctx.isReviewOverviewDrawer.value,
    submitting: ctx.submitting.value,
    reviewActionBusy: ctx.reviewActionBusy.value,
    switchToReviewOverviewDrawer: ctx.switchToReviewOverviewDrawer,
    reviewDocumentDrawerAvailable: ctx.reviewDocumentDrawerAvailable.value,
    isReviewDocumentDrawer: ctx.isReviewDocumentDrawer.value,
    toggleReviewDocumentDrawer: ctx.toggleReviewDocumentDrawer,
    reviewDocumentDrawerIcon: ctx.reviewDocumentDrawerIcon.value,
    reviewRiskDrawerAvailable: ctx.reviewRiskDrawerAvailable.value,
    isReviewRiskDrawer: ctx.isReviewRiskDrawer.value,
    toggleReviewRiskDrawer: ctx.toggleReviewRiskDrawer,
    reviewRiskDrawerIcon: ctx.reviewRiskDrawerIcon.value,
    reviewFlowDrawerAvailable: ctx.reviewFlowDrawerAvailable.value,
    flowOverallStatusTone: ctx.flowOverallStatusTone.value,
    toggleReviewFlowDrawer: ctx.toggleReviewFlowDrawer,
    reviewFlowDrawerIcon: ctx.reviewFlowDrawerIcon.value,
    activeSessionType: ctx.activeSessionType.value,
    reviewDrawerMode: ctx.reviewDrawerMode.value,
    hotKnowledgeQuestions: ctx.hotKnowledgeQuestions,
    deleteSessionBusy: ctx.deleteSessionBusy.value,
    sessionSwitchBusy: ctx.sessionSwitchBusy.value,
    askHotKnowledgeQuestion: ctx.askHotKnowledgeQuestion,
    resolveKnowledgeRankTone: ctx.resolveKnowledgeRankTone,
    resolveKnowledgeRankLabel: ctx.resolveKnowledgeRankLabel,
    flowOverallStatusText: ctx.flowOverallStatusText.value,
    flowTotalDurationText: ctx.flowTotalDurationText.value,
    flowRunId: ctx.flowRunId.value,
    flowRefreshBusy: ctx.flowRefreshBusy.value,
    refreshFlowRunDetail: ctx.refreshFlowRunDetail,
    flowSteps: ctx.activeFlowSteps.value,
    visibleFlowSteps: ctx.visibleFlowSteps.value,
    resolveFlowStepStatusLabel: ctx.resolveFlowStepStatusLabel,
    formatFlowStepDuration: ctx.formatFlowStepDuration,
    resolveFlowStepDetail: ctx.resolveFlowStepDetail,
    reviewIntentText: ctx.reviewIntentText.value,
    reviewFactCards: ctx.reviewFactCards.value,
    reviewInlineEditorKey: ctx.reviewInlineEditorKey.value,
    reviewInlineErrors: ctx.reviewInlineErrors.value,
    reviewInlineForm: ctx.reviewInlineForm.value,
    DATE_INPUT_FORMAT: ctx.DATE_INPUT_FORMAT,
    REVIEW_SCENE_OPTIONS: ctx.REVIEW_SCENE_OPTIONS,
    REVIEW_SCENE_OTHER_OPTION: ctx.REVIEW_SCENE_OTHER_OPTION,
    clearInlineReviewFieldError: ctx.clearInlineReviewFieldError,
    commitInlineReviewEditor: ctx.commitInlineReviewEditor,
    selectInlineScene: ctx.selectInlineScene,
    reviewInlinePendingFiles: ctx.reviewInlinePendingFiles.value,
    openInlineReviewEditor: ctx.openInlineReviewEditor,
    reviewPanelConfidence: ctx.reviewPanelConfidence.value,
    reviewCategoryOptions: ctx.reviewCategoryOptions.value,
    selectReviewCategory: ctx.selectReviewCategory,
    reviewSelectedOtherCategory: ctx.reviewSelectedOtherCategory.value,
    reviewOtherCategoryOpen: ctx.reviewOtherCategoryOpen.value,
    reviewOtherCategoryOptions: ctx.reviewOtherCategoryOptions.value,
    selectReviewOtherCategory: ctx.selectReviewOtherCategory,
    activeReviewDocumentIndex: ctx.activeReviewDocumentIndex.value,
    reviewDocumentCount: ctx.reviewDocumentCount.value,
    goReviewDocument: ctx.goReviewDocument,
    activeReviewDocument: ctx.activeReviewDocument.value,
    activeReviewDocumentPreview: ctx.activeReviewDocumentPreview.value,
    canPreviewActiveReviewDocument: ctx.canPreviewActiveReviewDocument.value,
    openActiveReviewDocumentPreview: ctx.openActiveReviewDocumentPreview,
    reviewRiskSummary: ctx.reviewRiskSummary.value,
    reviewRiskItems: ctx.reviewRiskItems.value,
    appendReviewRiskBriefToConversation: ctx.appendReviewRiskBriefToConversation,
    reviewRiskEmpty: ctx.reviewRiskEmpty.value,
    reviewHasUnsavedChanges: ctx.reviewHasUnsavedChanges.value,
    saveInlineReviewChanges: ctx.saveInlineReviewChanges
  }))

  return {
    insightPanelUi,
    messageItemUi
  }
}
