import { isBreakpointsForPrefixType, isBoxDisplayType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
import { BoxDisplay } from '../../../constants/ui';
/**
 * A class for format BoxDisplayType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveBoxDisplayFormatter extends ResponsiveClassStringFormatter {
  /**
   * The `formatToken` function takes an input value and an optional breakpoint value, and returns a formatted string based on the input value.
   *
   * @param {BoxDisplayType} input - The `input` parameter is of type `BoxDisplayType`. It represents the display value for a box element.
   * @param {BreakpointsForPrefixType} [breakpoint] - The `breakpoint` parameter is an optional parameter of type `BreakpointsForPrefixType`. It is used to specify a breakpoint value for the prefix.
   * @returns {string} a string value.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isBoxDisplayType(input)) {
      if (input == 'none') {
        return `${prefix}v-hidden`;
      }
      return `${prefix}v-${input}`;
    }
    else {
      LogUtility.warn(`The box display value ${input} is invalid, it must be a value of: `, BoxDisplay);
      return '';
    }
  }
}
export default new ResponsiveBoxDisplayFormatter();
