function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _extends() {
    _extends = Object.assign || function(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends.apply(this, arguments);
}
function _object_destructuring_empty(o) {
    if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
    return o;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { ConfigProvider } from "antd";
import clsx from "clsx";
import React, { useContext } from "react";
import { TextAnimate } from "../Components/TextAnimate";
import { TypingAnimation } from "../Components/TypingAnimation";
import { useStyle } from "./style";
/**
 * WelcomeMessage 组件 - 欢迎消息组件
 *
 * 该组件用于显示聊天开始时的欢迎消息，包含标题和描述信息。
 * 适用于聊天机器人、客服系统等场景的初始欢迎界面。
 *
 * @component
 * @description 欢迎消息组件，用于显示聊天开始时的欢迎信息
 * @param {WelcomeMessageProps} props - 组件属性
 * @param {React.ReactNode} [props.title] - 欢迎标题
 * @param {string} [props.description] - 欢迎描述
 * @param {Object} [props.classNames] - 自定义样式类名
 * @param {string} [props.classNames.title] - 标题样式类名
 * @param {string} [props.classNames.description] - 描述样式类名
 * @param {WelcomeMessageTitleAnimateProps} [props.titleAnimateProps] - 标题动画属性
 * @param {WelcomeMessageDescriptionAnimateProps} [props.descriptionAnimateProps] - 描述动画属性
 * @param {React.CSSProperties} [props.style] - 自定义样式
 * @param {string} [props.rootClassName] - 根节点样式类名
 *
 * @example
 * ```tsx
 * <WelcomeMessage
 *   title="欢迎使用 AI 助手"
 *   description="我可以帮助您解答问题、提供建议和完成任务"
 *   classNames={{
 *     title: 'custom-title',
 *     description: 'custom-description'
 *   }}
 * />
 * ```
 *
 * @returns {React.ReactElement} 渲染的欢迎消息组件
 *
 * @remarks
 * - 支持自定义标题和描述
 * - 提供灵活的样式配置
 * - 支持 React.ReactNode 类型内容
 * - 集成 Ant Design 主题系统
 * - 响应式布局适配
 */ export var WelcomeMessage = function WelcomeMessage(param) {
    var title = param.title, description = param.description, classNames = param.classNames, titleAnimateProps = param.titleAnimateProps, descriptionAnimateProps = param.descriptionAnimateProps, customStyle = param.style, rootClassName = param.rootClassName;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var prefixCls = getPrefixCls('agentic-welcome');
    var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    var _ref = customStyle || {}, ref = _object_destructuring_empty(_ref), restStyle = _extends({}, _ref);
    return wrapSSR(/*#__PURE__*/ React.createElement("div", {
        className: clsx(prefixCls, hashId, rootClassName),
        style: restStyle
    }, title && /*#__PURE__*/ React.createElement(TypingAnimation, _object_spread_props(_object_spread({
        as: "div"
    }, titleAnimateProps), {
        className: clsx("".concat(prefixCls, "-title"), classNames === null || classNames === void 0 ? void 0 : classNames.title)
    }), title), description && /*#__PURE__*/ React.createElement(TextAnimate, _object_spread_props(_object_spread({
        as: "div",
        animation: "blurInUp",
        by: "character",
        once: true
    }, descriptionAnimateProps), {
        className: clsx("".concat(prefixCls, "-description"), classNames === null || classNames === void 0 ? void 0 : classNames.description)
    }), description)));
};
