import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { WizardAgentTerminalPanel } from "./WizardAgentTerminalPanel";
import { WizardBlockingSummary } from "./WizardCommunicationCards";
import { WizardTaskDetailsPanel } from "./WizardTaskDetailsPanel";
export function WizardTask(props) {
    const { task, agentId, agentStub, profiles, executionDisplay, canEdit, isPlanTask, isEditingDescription, localDescriptionMarkdown, isSavingDescription, isEditingPlan, localPlanMarkdown, isSavingPlan, showFullTerminal, shouldCollapseApprovalCommunication, shouldRenderAgentTerminalPanel, shouldShowAgentTerminal, shouldShowBlockingSummary, unresolvedBlockingDetails, openChatButton, summaryPlaceholderMessage, hideSummaryWaitingPlaceholder, onDescriptionChange, onDescriptionSave, onDescriptionCancel, onPlanEdit, onPlanChange, onPlanSave, onPlanCancel, onShowTerminal, onHideTerminal, onQuestionnaireOpenChange, onTaskChanged, onAttachmentsChanged, onTaskApproved, showApprovedState, hasNextReviewTask, onReviewNext, onInteractionSubmitted, onCloseTask, onSelectTask, } = props;
    const canShowAgentChatTab = shouldShowAgentTerminal && !!agentStub;
    const isAgentChatTabActive = canShowAgentChatTab && showFullTerminal;
    const fullTerminalPanel = agentStub ? (_jsx(WizardAgentTerminalPanel, { agentStub: agentStub, profiles: profiles, isActive: shouldShowAgentTerminal, displayMode: "full", hideBottomControls: false, className: "h-full min-h-0 overflow-hidden", onInteractionSubmitted: onInteractionSubmitted, onQuestionnaireOpenChange: onQuestionnaireOpenChange, openChatButton: openChatButton, summaryPlaceholderMessage: summaryPlaceholderMessage, hideSummaryWaitingPlaceholder: hideSummaryWaitingPlaceholder })) : null;
    const taskDetailsContent = (_jsx(WizardTaskDetailsPanel, { task: task, agentId: agentId, executionDisplay: executionDisplay, canEdit: canEdit, isPlanTask: isPlanTask, isEditingDescription: isEditingDescription, localDescriptionMarkdown: localDescriptionMarkdown, isSavingDescription: isSavingDescription, isEditingPlan: isEditingPlan, localPlanMarkdown: localPlanMarkdown, isSavingPlan: isSavingPlan, shouldCollapseApprovalCommunication: shouldCollapseApprovalCommunication, openChatButton: openChatButton, canShowAgentChatTab: canShowAgentChatTab, isAgentChatTabActive: isAgentChatTabActive, agentChatContent: isAgentChatTabActive && shouldRenderAgentTerminalPanel
            ? fullTerminalPanel
            : null, onDescriptionChange: onDescriptionChange, onDescriptionSave: onDescriptionSave, onDescriptionCancel: onDescriptionCancel, onPlanEdit: onPlanEdit, onPlanChange: onPlanChange, onPlanSave: onPlanSave, onPlanCancel: onPlanCancel, onTaskChanged: onTaskChanged, onAttachmentsChanged: onAttachmentsChanged, onTaskApproved: onTaskApproved, showApprovedState: showApprovedState, hasNextReviewTask: hasNextReviewTask, onReviewNext: onReviewNext, onShowAgentChat: onShowTerminal, onShowTaskDetails: onHideTerminal, onCloseTask: onCloseTask }));
    const hasBottomPanelContent = shouldShowBlockingSummary;
    const taskDetailsContainerClass = "flex min-h-0 flex-1 flex-col overflow-hidden";
    const bottomPanelContent = (_jsx("div", { className: "flex shrink-0 flex-col", children: _jsx("div", { className: "min-h-0 flex-1", children: shouldShowBlockingSummary ? (_jsx(WizardBlockingSummary, { unresolvedBlockingDetails: unresolvedBlockingDetails, onSelectTask: onSelectTask })) : null }) }));
    const taskTabContent = (_jsxs(_Fragment, { children: [_jsx("div", { className: taskDetailsContainerClass, children: taskDetailsContent }), hasBottomPanelContent ? bottomPanelContent : null] }));
    return taskTabContent;
}
//# sourceMappingURL=WizardTask.js.map