import { c as _c } from "react/compiler-runtime";
import type { ThinkingBlock, ThinkingBlockParam } from '@anthropic-ai/sdk/resources/index.mjs';
import React from 'react';
import { Box, Text } from '../../ink.js';
import { CtrlOToExpand } from '../CtrlOToExpand.js';
import { Markdown } from '../Markdown.js';
type Props = {
  // Accept either full ThinkingBlock/ThinkingBlockParam or a minimal shape with just type and thinking
  param: ThinkingBlock | ThinkingBlockParam | {
    type: 'thinking';
    thinking: string;
  };
  addMargin: boolean;
  isTranscriptMode: boolean;
  verbose: boolean;
  /** When true, hide this thinking block entirely (used for past thinking in transcript mode) */
  hideInTranscript?: boolean;
};
export function AssistantThinkingMessage(t0) {
  const $ = _c(9);
  const {
    param: t1,
    addMargin: t2,
    isTranscriptMode,
    verbose,
    hideInTranscript: t3
  } = t0;
  const {
    thinking
  } = t1;
  const addMargin = t2 === undefined ? false : t2;
  const hideInTranscript = t3 === undefined ? false : t3;
  if (!thinking) {
    return null;
  }
  if (hideInTranscript) {
    return null;
  }
  const shouldShowFullThinking = isTranscriptMode || verbose;
  if (!shouldShowFullThinking) {
    const t4 = addMargin ? 1 : 0;
    let t5;
    if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
      t5 = <Text dimColor={true} italic={true}>{"\u2234 Thinking"} <CtrlOToExpand /></Text>;
      $[0] = t5;
    } else {
      t5 = $[0];
    }
    let t6;
    if ($[1] !== t4) {
      t6 = <Box marginTop={t4}>{t5}</Box>;
      $[1] = t4;
      $[2] = t6;
    } else {
      t6 = $[2];
    }
    return t6;
  }
  const t4 = addMargin ? 1 : 0;
  let t5;
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
    t5 = <Text dimColor={true} italic={true}>{"\u2234 Thinking"}…</Text>;
    $[3] = t5;
  } else {
    t5 = $[3];
  }
  let t6;
  if ($[4] !== thinking) {
    t6 = <Box paddingLeft={2}><Markdown dimColor={true}>{thinking}</Markdown></Box>;
    $[4] = thinking;
    $[5] = t6;
  } else {
    t6 = $[5];
  }
  let t7;
  if ($[6] !== t4 || $[7] !== t6) {
    t7 = <Box flexDirection="column" gap={1} marginTop={t4} width="100%">{t5}{t6}</Box>;
    $[6] = t4;
    $[7] = t6;
    $[8] = t7;
  } else {
    t7 = $[8];
  }
  return t7;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJUaGlua2luZ0Jsb2NrIiwiVGhpbmtpbmdCbG9ja1BhcmFtIiwiUmVhY3QiLCJCb3giLCJUZXh0IiwiQ3RybE9Ub0V4cGFuZCIsIk1hcmtkb3duIiwiUHJvcHMiLCJwYXJhbSIsInR5cGUiLCJ0aGlua2luZyIsImFkZE1hcmdpbiIsImlzVHJhbnNjcmlwdE1vZGUiLCJ2ZXJib3NlIiwiaGlkZUluVHJhbnNjcmlwdCIsIkFzc2lzdGFudFRoaW5raW5nTWVzc2FnZSIsInQwIiwiJCIsIl9jIiwidDEiLCJ0MiIsInQzIiwidW5kZWZpbmVkIiwic2hvdWxkU2hvd0Z1bGxUaGlua2luZyIsInQ0IiwidDUiLCJTeW1ib2wiLCJmb3IiLCJsYWJlbCIsInQ2IiwidDciXSwic291cmNlcyI6WyJBc3Npc3RhbnRUaGlua2luZ01lc3NhZ2UudHN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHtcbiAgVGhpbmtpbmdCbG9jayxcbiAgVGhpbmtpbmdCbG9ja1BhcmFtLFxufSBmcm9tICdAYW50aHJvcGljLWFpL3Nkay9yZXNvdXJjZXMvaW5kZXgubWpzJ1xuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgQm94LCBUZXh0IH0gZnJvbSAnLi4vLi4vaW5rLmpzJ1xuaW1wb3J0IHsgQ3RybE9Ub0V4cGFuZCB9IGZyb20gJy4uL0N0cmxPVG9FeHBhbmQuanMnXG5pbXBvcnQgeyBNYXJrZG93biB9IGZyb20gJy4uL01hcmtkb3duLmpzJ1xuXG50eXBlIFByb3BzID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