from dataclasses import dataclass
from typing import Any



@dataclass(frozen=True)
class _Const:
    char_limit: int = 4000
    pass



_const = _Const()


def hide_big_content(value: Any = None) -> Any:
    """
    Hide big-content in the object.

    :param value: 'param-value'
    :return: new object with hidden big-content
    """

    if value is None:
        value = ''

    if isinstance(value, dict):
        return {
            k: hide_big_content(value=v)
            for k, v in value.items()
        }

    elif isinstance(value, list):
        return [
            hide_big_content(value=v)
            for v in value
        ]

    elif isinstance(value, tuple):
        return tuple(
            hide_big_content(value=v)
            for v in value
        )

    else:
        try:
            value_str = str(value)
        except ValueError:
            return """
{
Hidden: Content too large for string conversion
...big-content hidden...
}
            """

        if len(value_str) > _const.char_limit:
            return f"""
{{
{value_str[:_const.char_limit]}
...big-content hidden...
}}
            """

    return value
