import type { AppLocale } from "../locale";
import { DEFAULT_LOCALE } from "../locale";

export type EditorFormInputPanelMessages = {
  sectionTitle: string;
  styleSectionTitle: string;

  labelTypeLabel: string;
  labelTypeOptionText: string;
  labelTypeOptionImage: string;

  fieldLabelLabel: string;

  labelDisplayLabel: string;
  labelDisplayOptionVisible: string;
  labelDisplayOptionHidden: string;
  labelDisplayOptionFloating: string;

  layoutLabel: string;
  layoutOptionStacked: string;
  layoutOptionInline: string;
  labelGapLabel: string;
  labelGapUnitLabel: string;

  // Presets for label gap
  labelGapPresetTight: string;
  labelGapPresetNormal: string;
  labelGapPresetRelaxed: string;
  labelGapPresetExtra: string;

  labelImageUrlLabel: string;
  labelImageAltLabel: string;

  submitKeyLabel: string;

  fieldTypeLabel: string;
  fieldTypeAria: string;
  fieldTypeOptionText: string;
  fieldTypeOptionEmail: string;
  fieldTypeOptionTextarea: string;

  placeholderLabel: string;
  placeholderAria: string;

  requiredNoticeText: string;

  textSizeLabel: string;
  textSizeUnitLabel: string;

  lineHeightLabel: string;
  lineHeightUnitLabel: string;

  // Presets for line height
  lineHeightPresetTight: string;
  lineHeightPresetNormal: string;
  lineHeightPresetLoose: string;

  letterSpacingLabel: string;
  letterSpacingUnitLabel: string;

  // Presets for letter spacing
  letterSpacingPresetTight: string;
  letterSpacingPresetNormal: string;
  letterSpacingPresetWide: string;

  textAlignLabel: string;
  textAlignOptionLeft: string;
  textAlignOptionCenter: string;
  textAlignOptionRight: string;

  widthModeLabel: string;
  widthModeAria: string;
  widthModeOptionAuto: string;
  widthModeOptionFull: string;
  widthModeOptionFixed: string;

  fixedWidthLabel: string;
  fixedWidthUnitLabel: string;

  // Presets for fixed width
  fixedWidthPresetSmall: string;
  fixedWidthPresetMedium: string;
  fixedWidthPresetLarge: string;

  paddingXLabel: string;
  paddingXUnitLabel: string;

  // Presets for horizontal padding
  paddingXPresetXs: string;
  paddingXPresetSm: string;
  paddingXPresetMd: string;
  paddingXPresetLg: string;
  paddingXPresetXl: string;

  paddingYLabel: string;
  paddingYUnitLabel: string;

  // Presets for vertical padding
  paddingYPresetXs: string;
  paddingYPresetSm: string;
  paddingYPresetMd: string;
  paddingYPresetLg: string;
  paddingYPresetXl: string;

  textColorLabel: string;
  textColorPickerAria: string;
  textColorHexAria: string;

  fillColorLabel: string;
  fillColorPickerAria: string;
  fillColorHexAria: string;

  strokeColorLabel: string;
  strokeColorPickerAria: string;
  strokeColorHexAria: string;

  borderRadiusLabel: string;
  borderRadiusPresetNone: string;
  borderRadiusPresetSmall: string;
  borderRadiusPresetMedium: string;
  borderRadiusPresetLarge: string;
  borderRadiusPresetFull: string;
};

const EDITOR_FORM_INPUT_PANEL_MESSAGES: Record<AppLocale, EditorFormInputPanelMessages> = {
  en: {
    sectionTitle: "Input field",
    styleSectionTitle: "Field style",

    labelTypeLabel: "Label type",
    labelTypeOptionText: "Text",
    labelTypeOptionImage: "Image",

    fieldLabelLabel: "Field label",

    labelDisplayLabel: "Label display mode",
    labelDisplayOptionVisible: "Visible (default)",
    labelDisplayOptionHidden: "Hidden",
    labelDisplayOptionFloating: "Floating label",

    layoutLabel: "Layout",
    layoutOptionStacked: "Vertical (default)",
    layoutOptionInline: "Horizontal (inline)",
    labelGapLabel: "Label/field gap",
    labelGapUnitLabel: "(px)",

    labelGapPresetTight: "Tight",
    labelGapPresetNormal: "Normal",
    labelGapPresetRelaxed: "Relaxed",
    labelGapPresetExtra: "Extra",

    labelImageUrlLabel: "Label image URL",
    labelImageAltLabel: "Label image alt text",

    submitKeyLabel: "Submit key",

    fieldTypeLabel: "Field type",
    fieldTypeAria: "Field type",
    fieldTypeOptionText: "Text",
    fieldTypeOptionEmail: "Email",
    fieldTypeOptionTextarea: "Multiline text",

    placeholderLabel: "Placeholder",
    placeholderAria: "Placeholder",

    requiredNoticeText: "Required state is configured in the form controller.",

    textSizeLabel: "Field text size",
    textSizeUnitLabel: "(px)",

    lineHeightLabel: "Field line height",
    lineHeightUnitLabel: "(px)",

    lineHeightPresetTight: "Tight",
    lineHeightPresetNormal: "Normal",
    lineHeightPresetLoose: "Loose",

    letterSpacingLabel: "Field letter spacing",
    letterSpacingUnitLabel: "(px)",

    letterSpacingPresetTight: "Tight",
    letterSpacingPresetNormal: "Normal",
    letterSpacingPresetWide: "Wide",

    textAlignLabel: "Text alignment",
    textAlignOptionLeft: "Left",
    textAlignOptionCenter: "Center",
    textAlignOptionRight: "Right",

    widthModeLabel: "Width",
    widthModeAria: "Width",
    widthModeOptionAuto: "Auto",
    widthModeOptionFull: "Full width",
    widthModeOptionFixed: "Fixed value",

    fixedWidthLabel: "Field fixed width",
    fixedWidthUnitLabel: "(px)",

    fixedWidthPresetSmall: "Small",
    fixedWidthPresetMedium: "Medium",
    fixedWidthPresetLarge: "Large",

    paddingXLabel: "Field horizontal padding",
    paddingXUnitLabel: "(px)",

    paddingXPresetXs: "Extra thin",
    paddingXPresetSm: "Thin",
    paddingXPresetMd: "Normal",
    paddingXPresetLg: "Wide",
    paddingXPresetXl: "Extra wide",

    paddingYLabel: "Field vertical padding",
    paddingYUnitLabel: "(px)",

    paddingYPresetXs: "Extra thin",
    paddingYPresetSm: "Thin",
    paddingYPresetMd: "Normal",
    paddingYPresetLg: "Wide",
    paddingYPresetXl: "Extra wide",

    textColorLabel: "Field text color",
    textColorPickerAria: "Field text color picker",
    textColorHexAria: "Field text color HEX",

    fillColorLabel: "Field fill color",
    fillColorPickerAria: "Field fill color picker",
    fillColorHexAria: "Field fill color HEX",

    strokeColorLabel: "Field border color",
    strokeColorPickerAria: "Field border color picker",
    strokeColorHexAria: "Field border color HEX",

    borderRadiusLabel: "Field border radius",
    borderRadiusPresetNone: "None",
    borderRadiusPresetSmall: "Small",
    borderRadiusPresetMedium: "Medium",
    borderRadiusPresetLarge: "Large",
    borderRadiusPresetFull: "Fully rounded",
  },
  ko: {
    sectionTitle: "입력 필드",
    styleSectionTitle: "필드 스타일",

    labelTypeLabel: "라벨 타입",
    labelTypeOptionText: "텍스트",
    labelTypeOptionImage: "이미지",

    fieldLabelLabel: "필드 라벨",

    labelDisplayLabel: "라벨 표시 방식",
    labelDisplayOptionVisible: "표시 (기본)",
    labelDisplayOptionHidden: "숨김",
    labelDisplayOptionFloating: "플로팅 라벨",

    layoutLabel: "레이아웃",
    layoutOptionStacked: "세로 (기본)",
    layoutOptionInline: "가로 (인라인)",
    labelGapLabel: "라벨/필드 간격",
    labelGapUnitLabel: "(px)",

    labelGapPresetTight: "타이트",
    labelGapPresetNormal: "보통",
    labelGapPresetRelaxed: "느슨",
    labelGapPresetExtra: "넓게",

    labelImageUrlLabel: "라벨 이미지 URL",
    labelImageAltLabel: "라벨 이미지 대체 텍스트",

    submitKeyLabel: "전송 키",

    fieldTypeLabel: "필드 타입",
    fieldTypeAria: "필드 타입",
    fieldTypeOptionText: "텍스트",
    fieldTypeOptionEmail: "이메일",
    fieldTypeOptionTextarea: "긴 텍스트",

    placeholderLabel: "Placeholder",
    placeholderAria: "Placeholder",

    requiredNoticeText: "필수 여부는 폼 컨트롤러에서 설정합니다.",

    textSizeLabel: "필드 텍스트 크기",
    textSizeUnitLabel: "(px)",

    lineHeightLabel: "필드 줄간격",
    lineHeightUnitLabel: "(px)",

    lineHeightPresetTight: "타이트",
    lineHeightPresetNormal: "보통",
    lineHeightPresetLoose: "루즈",

    letterSpacingLabel: "필드 자간",
    letterSpacingUnitLabel: "(px)",

    letterSpacingPresetTight: "좁게",
    letterSpacingPresetNormal: "보통",
    letterSpacingPresetWide: "넓게",

    textAlignLabel: "텍스트 정렬",
    textAlignOptionLeft: "왼쪽",
    textAlignOptionCenter: "가운데",
    textAlignOptionRight: "오른쪽",

    widthModeLabel: "너비",
    widthModeAria: "너비",
    widthModeOptionAuto: "자동",
    widthModeOptionFull: "전체 폭",
    widthModeOptionFixed: "고정 값",

    fixedWidthLabel: "필드 고정 너비",
    fixedWidthUnitLabel: "(px)",

    fixedWidthPresetSmall: "작게",
    fixedWidthPresetMedium: "보통",
    fixedWidthPresetLarge: "넓게",

    paddingXLabel: "필드 가로 패딩",
    paddingXUnitLabel: "(px)",

    paddingXPresetXs: "아주 얇게",
    paddingXPresetSm: "얇게",
    paddingXPresetMd: "보통",
    paddingXPresetLg: "넓게",
    paddingXPresetXl: "아주 넓게",

    paddingYLabel: "필드 세로 패딩",
    paddingYUnitLabel: "(px)",

    paddingYPresetXs: "아주 얇게",
    paddingYPresetSm: "얇게",
    paddingYPresetMd: "보통",
    paddingYPresetLg: "넓게",
    paddingYPresetXl: "아주 넓게",

    textColorLabel: "필드 텍스트 색상",
    textColorPickerAria: "필드 텍스트 색상 피커",
    textColorHexAria: "필드 텍스트 색상 HEX",

    fillColorLabel: "필드 채움 색상",
    fillColorPickerAria: "필드 채움 색상 피커",
    fillColorHexAria: "필드 채움 색상 HEX",

    strokeColorLabel: "필드 테두리 색상",
    strokeColorPickerAria: "필드 테두리 색상 피커",
    strokeColorHexAria: "필드 테두리 색상 HEX",

    borderRadiusLabel: "필드 모서리 둥글기",
    borderRadiusPresetNone: "없음",
    borderRadiusPresetSmall: "작게",
    borderRadiusPresetMedium: "보통",
    borderRadiusPresetLarge: "크게",
    borderRadiusPresetFull: "완전 둥글게",
  },
};

export function getEditorFormInputPanelMessages(locale: AppLocale | null | undefined): EditorFormInputPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_FORM_INPUT_PANEL_MESSAGES[key] ?? EDITOR_FORM_INPUT_PANEL_MESSAGES[DEFAULT_LOCALE];
}
