import { resultComparisonEn } from './resultComparison';
import type { WidgetTranslations } from './types';

export const en: WidgetTranslations = {
  modal: {
    checkingAvailability: 'Checking Availability...',
    uploadPhoto: 'Upload Your Photo',
    creatingTryOn: 'Creating Try-On...',
    yourTryOn: 'Your Virtual Try-On',
    oops: 'Oops!',
    virtualTryOn: 'Virtual Try-On',
    sizeEstimation: 'Find your size',
  },
  checking: {
    availability: 'Checking availability...',
  },
  freeTier: {
    remaining: (count) => `${count} of 7 free try-ons remaining`,
  },
  errors: {
    photoBodyHidden: "Your clothes hide your waist, hips or legs, so we can't show this item reliably. Try a photo in fitted clothes.",
    qualityFailed: "We couldn't create a reliable try-on this time. Try again, or use another photo.",
    refused: "We couldn't create a try-on with this photo and item. Try another photo.",
    unexpected: 'An unexpected error occurred',
    network: 'Network error. Please check your connection and try again.',
    imageLoad: 'Could not load the clothing image. Please try again.',
    timeout: 'Processing took too long. Please try again.',
    server: 'Server error. Please try again later.',
    processingFailed: 'Try-on processing failed. Please try with a different photo.',
  },
  upload: {
    changePhoto: 'Change photo',
    reuseTitle: 'Use this photo again?',
    uploadPhoto: "Upload",
    guide: {
      do: "Do",
      dont: "Don’t",
      checks: [
        { title: "Full body", detail: "Head to feet in frame" },
        { title: "Just you", detail: "No one else in shot" },
        { title: "Fill the frame", detail: "Step back 2-3 m, not more" },
        { title: "Fitted clothes", detail: "So we see your shape" },
        { title: "Good lighting", detail: "Face a window" },
      ],
      avoid: ["Baggy clothes", "Cropped", "Too far", "Other people", "Too dark"],
      tip: "No one to help? Prop your phone at waist height and use a 3-second timer.",
    },
    title: 'Upload Your Photo',
    description:
      "The right photo makes your try-on look real.",
    invalidFile: 'Please select a valid image file (JPEG, PNG, or WebP)',
    unreadableImage: "We couldn't read this image. A JPEG or PNG works best.",
    processingFailed: 'Failed to process image. Please try another.',
    clickOrDrag: 'Click to upload or drag and drop',
    fileHint: 'JPEG, PNG, WebP and more',
    chooseDifferent: 'Choose Different Photo',
    useThis: 'Use This Photo',
    cancel: 'Cancel',
    privacyNote:
      'Your photo is stored locally on your device and never uploaded to our servers permanently.',
    consent: "I'm 18+ and I consent to an AI-generated try-on of my photo.",
    takePhoto: 'Take a photo',
    cameraTitle: 'Take a full-body photo',
    cameraStarting: 'Starting the camera…',
    cameraPreview: 'Live camera preview',
    cameraCapture: 'Take photo',
    cameraRetry: 'Retake',
    cameraUseUpload: 'Use file upload instead',
    cameraPermissionDenied: 'Camera access was denied. Allow it in your browser settings, or upload a photo instead.',
    cameraUnavailable: 'This browser does not support camera capture. You can still upload a photo.',
    cameraInsecure: 'Camera capture requires a secure HTTPS page. You can still upload a photo.',
    cameraNoDevice: 'No camera was found. Connect a camera, or upload a photo instead.',
    cameraBusy: 'The camera is unavailable or being used by another app. Close it there, or upload a photo.',
    cameraFailed: 'The camera could not start or capture a photo. Please retry or upload a photo.',
  },
  processing: {
    title: 'Creating Your Virtual Try-On',
    statuses: [
      'Nice photo! Uploading…',
      'Analyzing your photo',
      'Fitting the garment',
      'Adjusting the proportions',
      'Refining the details',
      'Finishing your result',
    ],
    elapsed: (tenths) => `${tenths.toFixed(1)}s`,
  },
  result: {
    ...resultComparisonEn,
    download: 'Download',
    tryDifferent: 'Try Different Photo',
    continueShopping: 'Continue Shopping',
    tryingOn: (productTitle) => `Trying on: ${productTitle}`,
    garmentThumbnail: 'The item you tried on',
    share: 'Share',
    viralShare: {
      title: "Share your look",
      instagram: "Instagram",
      whatsapp: "WhatsApp",
      preparing: "Preparing your image…",
      unavailable: "The image could not be prepared.",
      downloadImage: "Download",
      downloaded: "Image saved",
      downloadedMessageCopied: "Image saved, message copied",
      downloadedCopyFailed: "Image saved, message not copied",
      failed: "Could not share the photo. Please try again.",
    },
  },
  size: {
    offerTitle: 'What size should I order?',
    offerCta: 'Find my size',
    checkingPhoto: 'Checking your photo...',
    qcNotFullBody: 'For a size we need a photo showing you from head to feet.',
    qcPersonTooSmall: 'For a size we need a photo where you fill more of the frame.',
    qcNoPerson: "We couldn't find a person in this photo.",
    heightLabel: 'Your height (cm)',
    weightLabel: 'Your weight (kg), optional but it makes the answer noticeably better',
    fitLabel: 'How do you prefer it to fit?',
    fitTight: 'Fitted',
    fitRegular: 'Regular',
    fitLoose: 'Relaxed',
    invalidHeight: 'Please enter a height between 80 and 250 cm.',
    invalidWeight: 'Please enter a weight between 30 and 300 kg, or leave it empty.',
    submit: 'Get my size',
    estimating: 'Working out your size...',
    resultTitle: 'Your size',
    bandLow: "This is the closest match we could find. Check the store's own size details before ordering.",
    bandNoMatch: "We couldn't match your measurements to this guide closely. Check the store's size details before ordering.",
    bandGood: 'Based on the photo you used for the try-on.',
    bandVeryConfident: 'Based on your photo, this one should fit you well.',
    betweenSizes: "You're between two sizes, and both should work.",
    alsoConsider: (size) => `You could also consider size ${size}.`,
    alsoConsiderRoomier: (size) => `For a roomier fit, consider size ${size}.`,
    alsoConsiderCloser: (size) => `For a closer fit, consider size ${size}.`,
    cartUsesSize: (size) => `Add to cart will add size ${size}.`,
    addToCart: 'Add to cart',
    addToCartError: 'Could not select this variation. Please choose it on the product page.',
    addWeight: 'Add your weight for a better answer',
    retakePhoto: 'Use a better full-body photo',
    invalidPhoto: 'Please choose a JPEG, PNG, or WebP image.',
    failed: "We couldn't work out a size this time. You can still choose a size and continue shopping.",
    unavailable: 'Size recommendation is not available for this product right now. You can still choose a size and continue shopping.',
    close: 'Continue shopping',
    photoTitle: 'Use a photo for size estimation',
    photoDescription: 'Upload a clear full-body photo so we can compare your proportions with this store’s size guide. This does not create a virtual try-on image.',
    photoPrivacy: 'The photo is processed for this request and is not retained by Aisthetix. A copy can remain in this browser for reuse.',
    photoConsent: 'I’m 18+ and I consent to this photo being processed for a size recommendation.',
  },
  gallery: {
    open: 'Your try-ons',
    openWithCount: (count) => `Your try-ons (${count})`,
    title: 'Your try-ons',
    back: 'Back',
    emptyTitle: 'No try-ons yet',
    emptyMessage: 'Every look you create shows up here, on this device only.',
    viewProduct: 'View item',
    share: 'Share',
    remove: 'Remove',
    removeLabel: (productTitle) => `Remove the try-on for ${productTitle}`,
    untitledProduct: 'This item',
    garmentThumbnail: 'The item you tried on',
    today: 'Today',
    yesterday: 'Yesterday',
    formatDate: (date) =>
      date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }),
    privacyNote: 'Your try-ons stay on this device.',
  },
  share: {
    downloaded: 'Image saved to your device',
    copied: 'Product link copied',
    failed: 'Sharing is not available on this device',
  },
  counter: {
    remaining: (count) => `${count} try-on${count !== 1 ? 's' : ''} left`,
  },
  lead: {
    title: 'Keep trying things on',
    purpose:
      'Vela is the aisthetix demo store. Leave your email to keep trying items on, and we will write to you once about aisthetix.',
    emailLabel: 'Work email',
    emailPlaceholder: 'you@yourstore.com',
    consent: 'I agree to be contacted by aisthetix at this address.',
    submit: 'Continue',
    skip: 'Not now',
    sending: 'Sending...',
    error: 'We could not save that. Please check the address and try again.',
  },
  error: {
    useAnotherPhoto: "Use another photo",
    title: 'Something Went Wrong',
    suggestions: 'Here are some things you can try:',
    tip1: 'Make sure your photo shows your full body clearly',
    tip2: 'Try using a different photo with better lighting',
    tip3: 'Check your internet connection',
    tryAgain: 'Try Again',
    close: 'Close',
  },
  quota: {
    noSubscriptionTitle: 'Feature Not Available',
    noSubscriptionMessage:
      'Virtual try-on is currently not available. The store owner needs to activate this feature first.',
    limitReachedTitle: 'Virtual try-on will be back soon',
    limitReachedMessage:
      'We’re refreshing the virtual fitting room. Please continue browsing and check back shortly.',
    temporarilyUnavailableTitle: 'Feature Temporarily Unavailable',
    temporarilyUnavailableMessage:
      'Virtual try-on is temporarily unavailable. Please check back later or contact the store for assistance.',
    freeTierExhaustedTitle: 'Free Try-Ons Used',
    freeTierExhaustedMessage:
      "You've used all 7 free try-ons! The store owner can provide more access. Please check back later or contact the store for assistance.",
    visitorLimitReachedTitle: 'Try-On Limit Reached',
    visitorLimitReachedMessage: (minutes) => {
      if (!minutes || minutes <= 0) return "You've reached the try-on limit. Please try again later.";
      if (minutes < 60) return `You've reached the try-on limit. Try again in ${minutes} minute${minutes !== 1 ? 's' : ''}.`;
      const hours = Math.ceil(minutes / 60);
      return `You've reached the try-on limit. Try again in ${hours} hour${hours !== 1 ? 's' : ''}.`;
    },
    currentPlan: (planName) => `Current plan: ${planName}`,
    continueShopping: 'Continue shopping',
    close: 'Close',
  },
  warning: {
    freeRemaining: (count) =>
      `Only ${count} free try-on${count !== 1 ? 's' : ''} left`,
    monthlyRemaining: (count) =>
      `Only ${count} try-on${count !== 1 ? 's' : ''} left this month`,
    label: 'Limited try-ons remaining:',
  },
};
