// Unified constants for cap-creatives-ui
// Consolidated from legacy and v2 constants files

// --- Channel Constants ---
export const EMAIL = 'email';
export const SMS = 'sms';
export const MOBILE_PUSH = 'mobilepush';
export const WECHAT = 'wechat';
export const LINE = 'line';
export const WHATSAPP = 'whatsapp';
export const VIBER = 'viber';
export const FACEBOOK = 'facebook';
export const RCS = 'rcs';
export const ZALO = 'zalo';
export const INAPP = 'inapp';
export const ASSETS = 'assets';
export const TRANSACTION = 'transaction';
export const PUSH = 'push';
export const EMF = 'emf';
export const VENENO = 'veneno';
export const TEXT = 'text';
export const IOS = 'ios';
export const ANDROID = 'android';
export const EXTERNAL_URL = 'external_url';
export const BIG_TEXT = 'big_text';

// --- App State Constants ---
export const CREATE = 'create';
export const EDIT = 'edit';
export const PREVIEW = 'preview';
export const CREATIVES = 'creatives';
export const LOYALTY = 'loyalty';
export const CREATIVES_UI_VIEW = 'CREATIVES_UI_VIEW';
export const DEFAULT = 'default';
export const DEFAULT_MODULE = 'creatives';
export const DEFAULT_LOCALE = 'en';

// --- Feature Flags & Validation ---
export const STORE2DOOR_PLUS_ENABLED = 'STORE2DOOR_PLUS_ENABLED';
export const TRAI_DLT = 'TRAI_DLT';
export const CARD_BASED_SCOPE = 'CARD_BASED_SCOPE';
export const HOSPITALITY_BASED_SCOPE = 'HOSPITALITY_BASED_SCOPE';
export const REGISTRATION_CUSTOM_FIELD = 'Registration custom fields';
export const GIFT_CARDS = 'GIFT_CARDS';
export const PROMO_ENGINE = 'PROMO_ENGINE';
export const ENABLE_NEW_MPUSH = 'ENABLE_NEW_MPUSH';
export const ENABLE_NEW_EDITOR_FLOW_INAPP = 'ENABLE_NEW_EDITOR_FLOW_INAPP';
export const SUPPORT_CK_EDITOR = 'SUPPORT_CK_EDITOR';
export const CUSTOM_TAG = 'CustomTagMessage';
export const CUSTOMER_EXTENDED_FIELD = 'Customer extended fields';
export const EXTENDED_TAG = 'ExtendedTagMessage';
export const BADGES_UI_ENABLED = 'BADGES_UI_ENABLED';
export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
export const ENABLE_WECHAT = 'ENABLE_WECHAT';
export const ENABLE_CREATIVES_ARCHIVAL = 'ENABLE_CREATIVES_ARCHIVAL';
export const ENABLE_WEBPUSH = 'ENABLE_WEBPUSH';
export const ENABLE_CUSTOMER_BARCODE_TAG = 'ENABLE_CUSTOMER_BARCODE_TAG';
export const EMAIL_UNSUBSCRIBE_TAG_MANDATORY = 'EMAIL_UNSUBSCRIBE_TAG_MANDATORY';
export const ENABLE_AI_SUGGESTIONS = 'ENABLE_AI_SUGGESTIONS';
export const AI_CONTENT_BOT_DISABLED = 'AI_CONTENT_BOT_DISABLED';
export const AI_DOCUMENTATION_BOT_ENABLED = 'AI_DOCUMENTATION_BOT_ENABLED';
export const ENABLE_PRODUCT_SUPPORT_VIDEOS = 'ENABLE_PRODUCT_SUPPORT_VIDEOS';
export const SUPPORT_ENGAGEMENT_MODULE = 'SUPPORT_ENGAGEMENT_MODULE';
export const EMBEDDED = 'embedded';
// --- Tag/Validation Constants ---
export const CARD_RELATED_TAGS = [
  'card_series',
  'card_number',
  'card_issue_date',
  'card_status',
  'card_series_name',
  'card_name',
];
export const HOSPITALITY_RELATED_TAGS = [
  'hospitality_series',
  'tax_Code',
  'roomTypeCode',
  'bookingChannel',
  'hotelReservationID_ResID_Type',
  'lastModifyDateTime',
  'guestCounts_IsPerRoom',
  'ratePlan_RatePlanCode',
  'resID_Value',
  'numberOfUnits',
  'rateTimeUnit',
  'resStatus',
  'timeSpan_End',
  'roomStay_MarketCode',
  'createDateTime',
  'amount',
  'timeSpan_Start',
  'email',
  'resID_Source',
];
export const GIFT_VOUCHER_RELATED_TAGS = [
  'gift_voucher',
  'gift_voucher_expiry_date.FORMAT_1',
  'gift_voucher_expiry_date.FORMAT_2',
  'gift_voucher_expiry_date.FORMAT_3',
  'gift_voucher_expiry_date.FORMAT_4',
  'gift_voucher_expiry_date.FORMAT_5',
  'gift_voucher_expiry_date.FORMAT_6',
  'gift_voucher_expiry_date.FORMAT_7',
  'gift_voucher_expiry_date.FORMAT_8',
  'gift_voucher_expiry_date',
];
export const PROMO_ENGINE_RELATED_TAGS = [
  'promotion',
  'promotion_expiry_date.FORMAT_1',
  'promotion_expiry_date.FORMAT_2',
  'promotion_expiry_date.FORMAT_3',
  'promotion_expiry_date.FORMAT_4',
  'promotion_expiry_date.FORMAT_5',
  'promotion_expiry_date.FORMAT_6',
  'promotion_expiry_date.FORMAT_7',
  'promotion_expiry_date.FORMAT_8',
  'promotion_expiry_date',
];
export const BADGES_RELATED_TAGS = [
  'Badge_expiry_date',
  'badges_issue_expiry_date',
  'badge_expiry_mm_slash_dd_slash_yyyy',
  'badge_expiry_dd_slash_mm_slash_yyyy',
  'badge_expiry_yyyy_hyphen_mm_hyphen_dd',
  'badge_expiry_mm_slash_dd_slash_yy',
  'badge_expiry_dd_space_Mon_space_yyyy',
  'badge_expiry_Day_comma_space_Mon_space_dd_comma_space_yy',
  'badge_expiry_Dd_dot_mm_dot_yy',
  'badge_expiry_dd_space_Mon',
  'Days_until_expiry',
  'badges_enroll_expiry_date.FORMAT_1',
  'badges_enroll_expiry_date.FORMAT_2',
  'badges_enroll_expiry_date.FORMAT_3',
  'badges_enroll_expiry_date.FORMAT_4',
  'badges_enroll_expiry_date.FORMAT_5',
  'badges_enroll_expiry_date.FORMAT_6',
  'badges_enroll_expiry_date.FORMAT_7',
  'badges_enroll_expiry_date.FORMAT_8',
  'badges_enroll_expiring_in_days',
  'badges_issue_expiry_date.FORMAT_1',
  'badges_issue_expiry_date.FORMAT_2',
  'badges_issue_expiry_date.FORMAT_3',
  'badges_issue_expiry_date.FORMAT_4',
  'badges_issue_expiry_date.FORMAT_5',
  'badges_issue_expiry_date.FORMAT_6',
  'badges_issue_expiry_date.FORMAT_7',
  'badges_issue_expiry_date.FORMAT_8',
  'badges_issue_expiring_in_days',
];
export const BADGES_ENROLL = 'BADGES_ENROLL';
export const BADGES_ISSUE = 'BADGES_ISSUE';
export const CUSTOMER_BARCODE_TAG = 'customer_barcode';
export const COPY_OF = 'Copy of';
export const UNSUBSCRIBE_TAG = 'unsubscribe';
/** Whitespace-tolerant check for {{ unsubscribe }}-style tag in content. */
export const UNSUBSCRIBE_TAG_REGEX = new RegExp(`\\{\\{\\s*${UNSUBSCRIBE_TAG}\\s*\\}\\}`);
/** Matches {{ ... }} and captures the inner tag content (for scanning content for tags). */
export const TAG_CONTENT_REGEX = /{{([^}]+)}}/g;
export const ENTRY_TRIGGER_TAG_REGEX = /\bentryTrigger\.\w+(?:\.\w+)?(?:\(\w+\))?/g;
export const SKIP_TAGS_REGEX_GROUPS = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)", "Link_to_[a-zA-Z]", "SURVEY.*.TOKEN", "^[A-Za-z].*\\([a-zA-Z\\d]*\\)", "referral_unique_(code|url).*userid"];

export const GET_TRANSLATION_MAPPED = {
  'en': 'en-US',
  'zh-cn': 'zh',
  'zh': 'zh',
  'en-US': 'en-US',
  'ja-JP': 'ja-JP',
};

export const JAPANESE_HIDE_DATE_TAGS = [
  "mm/dd/yyyy",
  "dd/mm/yyyy",
  "mm/dd/yy",
  "dd Mon yyyy",
  "Day, Mon dd, yy",
  "dd.mm.yy",
  "dd Mon",
  "dd/m/yyyy",
];

export const LIQUID_SUPPORTED_CHANNELS = [EMAIL, SMS, MOBILE_PUSH, INAPP];

// --- Line Constants ---
export const STICKER = 'sticker';
export const IMAGE = 'image';
export const IMAGE_MAP = 'imagemap';
export const IMAGE_CAROUSEL = 'image_carousel';
export const TEMPLATE = 'flex';
export const VIDEO = 'video';


export const LOGOUT_REQUEST = 'cap/LOGOUT_REQUEST';
export const LOGOUT_SUCCESS = 'cap/LOGOUT_SUCCESS';
export const LOGOUT_FAILURE = 'cap/LOGOUT_FAILURE';

export const JAPANESE_HELP_TEXT = 'ヘルプ :トークンの定義';

export const TAG_TRANSLATION_DOC = 'https://docs.capillarytech.com/docs/tags-translation';
