import { useMemo } from "react";
import { mapOpenClawMessagesToMessageBubbleData } from "./mapOpenClawMessages";
/**
 * 将 OpenClaw 会话 / transcript 风格的 messages 转为 MessageBubbleData[]（与 {@link mapOpenClawMessagesToMessageBubbleData} 一致，带 memo）。
 */ export function useOpenClawMessageBubbleData(messages, mapOptions, mapMessage) {
    var _ref = mapOptions !== null && mapOptions !== void 0 ? mapOptions : {}, baseTime = _ref.baseTime, timeStepMs = _ref.timeStepMs, bumpUpdateAtOnLastMessage = _ref.bumpUpdateAtOnLastMessage, getMessageId = _ref.getMessageId, toolRoleAs = _ref.toolRoleAs, appendToolCallsToContent = _ref.appendToolCallsToContent, preserveRawInExtra = _ref.preserveRawInExtra, useOpenClawTimestamps = _ref.useOpenClawTimestamps, preserveOpenClawRawInExtra = _ref.preserveOpenClawRawInExtra;
    return useMemo(function() {
        return mapOpenClawMessagesToMessageBubbleData(messages, mapOptions, mapMessage);
    }, [
        messages,
        baseTime,
        timeStepMs,
        bumpUpdateAtOnLastMessage,
        getMessageId,
        toolRoleAs,
        appendToolCallsToContent,
        preserveRawInExtra,
        useOpenClawTimestamps,
        preserveOpenClawRawInExtra,
        mapMessage
    ]);
}
