"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAiActionTextUtils = generateAiActionTextUtils;
function generateAiActionTextUtils() {
    return `export const toTitle = (value: string): string =>
  value.length > 0 ? value.charAt(0).toUpperCase() + value.slice(1) : value

export const humanizeToken = (value: string): string =>
  value
    .replaceAll(/([A-Z])([A-Z][a-z])/g, '$1 $2')
    .replaceAll(/([a-z])([A-Z])/g, '$1 $2')
    .replaceAll(/[_-]+/g, ' ')
    .replaceAll(/\\s+/g, ' ')
    .trim()

export const formatInputValue = (value: unknown): string => {
  if (value === undefined || value === null) {
    return ''
  }

  if (typeof value === 'string') {
    const trimmed = value.trim()
    return trimmed.length > 0 ? '"' + trimmed + '"' : ''
  }

  if (typeof value === 'number' || typeof value === 'boolean') {
    return String(value)
  }

  if (Array.isArray(value)) {
    const entries = value.map((entry) => formatInputValue(entry)).filter((entry) => entry.length > 0)
    return entries.join(', ')
  }

  if (typeof value === 'object') {
    const entries = Object.entries(value as Record<string, unknown>)
      .map(([key, entry]) => {
        const formatted = formatInputValue(entry)
        if (!formatted) {
          return ''
        }
        return humanizeToken(key) + ': ' + formatted
      })
      .filter((entry) => entry.length > 0)
    return entries.join(', ')
  }

  return ''
}
`;
}
//# sourceMappingURL=ai-action-text.utils.generator.js.map