# [DEF:TrivialUtilityShot:Module]
# @COMPLEXITY: 1
# @PURPOSE: Reference implementation of a zero-overhead utility using implicit Complexity 1.

import re
from datetime import datetime, timezone
from typing import Optional

# [DEF:slugify:Function]
# @PURPOSE: Converts a string to a URL-safe slug.
def slugify(text: str) -> str:
    if not text:
        return ""
    text = text.lower().strip()
    text = re.sub(r'[^\w\s-]', '', text)
    return re.sub(r'[-\s]+', '-', text)
# [/DEF:slugify:Function]

# [DEF:get_utc_now:Function]
def get_utc_now() -> datetime:
    """Returns current UTC datetime (purpose is omitted because it's obvious)."""
    return datetime.now(timezone.utc)
# [/DEF:get_utc_now:Function]

# [DEF:PaginationDTO:Class]
class PaginationDTO:
    # [DEF:__init__:Function]
    def __init__(self, page: int = 1, size: int = 50):
        self.page = max(1, page)
        self.size = min(max(1, size), 1000)
    # [/DEF:__init__:Function]

    # [DEF:offset:Function]
    @property
    def offset(self) -> int:
        return (self.page - 1) * self.size
    # [/DEF:offset:Function]
# [/DEF:PaginationDTO:Class]

# [/DEF:TrivialUtilityShot:Module]