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 _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;
}
import { ConfigProvider } from "antd";
import classNames from "clsx";
import React, { useContext } from "react";
import { useStyle } from "./style";
/**
 * 文字加载组件
 *
 * 使用CSS动画展示闪光文字效果的加载状态组件，支持自定义文本、样式和动画开关。
 *
 * @component
 * @example
 * // 基础用法
 * <TextLoading />
 *
 * @example
 * // 自定义文本
 * <TextLoading text="加载中..." />
 *
 * @example
 * // 自定义样式
 * <TextLoading
 *   text="正在处理"
 *   fontSize="20px"
 *   style={{ margin: '20px' }}
 * />
 *
 * @example
 * // 禁用动画
 * <TextLoading disabled={true} />
 *
 * @param props - 组件属性
 * @param props.text - 要显示的文本内容，默认为 "Loading..."
 * @param props.disabled - 是否禁用闪光动画，默认为 false
 * @param props.className - 容器类名
 * @param props.style - 容器自定义样式
 * @param props.fontSize - 字体大小
 * @returns 渲染的文字加载组件
 */ export var TextLoading = function TextLoading(param) {
    var _param_text = param.text, text = _param_text === void 0 ? 'Loading...' : _param_text, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, className = param.className, style = param.style, fontSize = param.fontSize;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var prefixCls = getPrefixCls('agentic-text-loading');
    var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    var containerStyle = _object_spread({
        fontSize: fontSize
    }, style);
    var _obj;
    return wrapSSR(/*#__PURE__*/ React.createElement("span", {
        className: classNames(prefixCls, hashId, className, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-disabled"), disabled), _define_property(_obj, "".concat(prefixCls, "-dark"), theme === 'dark'), _define_property(_obj, "".concat(prefixCls, "-light"), theme === 'light'), _obj)),
        style: containerStyle,
        "data-testid": "text-loading",
        "aria-label": text,
        role: "status",
        "aria-live": "polite"
    }, text));
};
export default TextLoading;
