//Imports
import { Dimensions } from "react-native";

//Constants
const SCREEN_WIDTH = Math.round(Dimensions.get("window").width);
const SCREEN_HEIGHT = Math.round(Dimensions.get("window").height);

const PRIVATE_CAR_20101 = 20101;
const PRIVATE_CAR_20102 = 20102;
const PRIVATE_CAR_20103 = 20103;
const BIKE_20201 = 20201;
const BIKE_20202 = 20202;
const CUMMERCIAL_20301 = 20301;
const CUMMERCIAL_20302 = 20302;

const EXTERNAL_DAMAGE = "External Damage";
const INTERNAL_DAMAGE = "Internal Damage";
const RC_BOOK = "RC Book";
const RC_BOOK_HN = "आरसी बुक";
const DRIVING_LICENSE = "Driving License";
const POLICE_FIR = "Police FIR";
const AADHAR_CARD = "Aadhar Card";
const PAN_CARD = "PAN Card";
const CNG = "CNG Kit";
const CNG_HN = "सीएनजी किट";
const WEB_REQUEST = "isWebRequest";
const ANDROID_REQUEST = "isAndroidRequest";
const super_thank_you = "Super, thank you!";
const your_preins_apprvd =
  "Your pre-inspection is completed and the quote has been instantly approved";
const thank_you = "Thank you!";
const preinsp_com_will_update =
  "The pre-inspection process is completed We will update you soon with further details";
const DIRECT_PORTAL_AGENTCODE = "1000651";
const image_pose_blur = "The image is blurred";
const image_pose_dark = "The light is not enough for the vehicle to be visible";
const image_pose_wrong = "You’ve captured the wrong side";

const VIDEO_TITLE = "Take a 360° video";
const VIDEO_TITLE_HN = '360 ° वीडियो लें "';
const VIDEO_URL =
  "https://d2h44aw7l5xdvz.cloudfront.net/videos/self-inspection-for-car.mp4";
const SELFI_IMAGE = "First click a selfie with your vehicle";
const ODOMETER =
  "Enter the vehicle, turn it on and take images of your odometer";
const SELFI_IMAGE_HN = "सबसे पहले अपनी कार के साथ एक सेल्फी क्लिक करें";
const ODOMETER_HN =
  "गाड़ीमें प्रवेश करें, इसे चालू करें और अपने ओडोमीटर के फ़ोटोलें";
const CHASSIS_NUMBER = "CHP";

//2W
const ACTIVITY_TYPE_MOTOR_2W_PRE_INSPECTION_SELF_SURVEY = "26";
const ACTIVITY_TYPE_MOTOR_2W_RE_INSPECTION_SELF_SURVEY = "49";
const ACTIVITY_TYPE_MOTOR_2W_OD_PRE_INSPECTION_SELF_SURVEY = "60";
const ACTIVITY_TYPE_MOTOR_2W_OD_RE_INSPECTION_SELF_SURVEY = "62";


// 4W
const ACTIVITY_TYPE_MOTOR_PRE_INSPECTION_SELF_SURVEY = "50";
const ACTIVITY_TYPE_MOTOR_4W_OD_NB_PRE_INSPECTION_SELF_SURVEY = "63";
const ACTIVITY_TYPE_MOTOR_4W_PRE_INSPECTION_SELF_SURVEY ="5";
const ACTIVITY_TYPE_MOTOR_4W_OD_PRE_INSPECTION_SELF_SURVEY = "59";
const ACTIVITY_TYPE_MOTOR_4W_OD_RE_INSPECTION_SELF_SURVEY = "61";
const ACTIVITY_TYPE_MOTOR_4W_OD_NB_RE_INSPECTION_SELF_SURVEY="64"

// CV
const ACTIVITY_TYPE_MOTOR_CVOD_PRE_INSPECTION_SELF_SURVEY = "30";
const ACTIVITY_TYPE_MOTOR_CV_RE_INSPECTION_SELF_SURVEY="51"


const PUC = "Upload PUC Certificate (Optional)";
const PUC_Hn = "पीयूसी प्रमाणपत्र (वैकल्पिक) अपलोड करें";

// pose
const BACK_LEFT_HAND_CORNER = "BLC";
const BACK_RIGHT_HAND_CORNER = "BRC";
const BACK_OF_THE_CAR = "BS";
const INSIDE_DASHBOARD = "DBD";
const ENGINE_COMPARTMENT = "ECR";
const FRONT_LEFT_HAND_CORNER = "FLC";
const FRONT_RIGHT_HAND_CORNER = "FRC";
const FRONT_OF_THE_CAR = "FS";
const PASSENGER_SIDE_LEFT_HAND_SIDE = "LS";
const DRIVER_SIDE_RIGHT_HAND_SIDE = "RS";
const WINDSCREEN_OF_THE_CAR = "WS";
const DOC = "DOC";
const DL = "DL";
const RCB = "RCB";
const FIR = "FIR";
const INTERNAL_DAMAGED_AREA_FOCUSED_VIDEO = "IDA";
const EXTERNAL_DAMAGED_AREA_FOCUSED_VIDEO = "EDA";

const get4WPoseFileNames = () => {
  var poseFiles = [];
  poseFiles = [
    BACK_LEFT_HAND_CORNER,
    BACK_RIGHT_HAND_CORNER,
    BACK_OF_THE_CAR,
    INSIDE_DASHBOARD,
    ENGINE_COMPARTMENT,
    FRONT_LEFT_HAND_CORNER,
    FRONT_RIGHT_HAND_CORNER,
    FRONT_OF_THE_CAR,
    PASSENGER_SIDE_LEFT_HAND_SIDE,
    DRIVER_SIDE_RIGHT_HAND_SIDE,
    WINDSCREEN_OF_THE_CAR,
    DOC,
  ];
  return poseFiles;
};

const get2WPoseFileNotDoc = () => {
  var poseFiles = [];
  poseFiles = [
    FRONT_OF_THE_CAR,
    PASSENGER_SIDE_LEFT_HAND_SIDE,
    BACK_OF_THE_CAR,
    DRIVER_SIDE_RIGHT_HAND_SIDE,
    "TS",
    FRONT_LEFT_HAND_CORNER,
    FRONT_RIGHT_HAND_CORNER,
    BACK_LEFT_HAND_CORNER,
    BACK_RIGHT_HAND_CORNER,
    INSIDE_DASHBOARD,
    ENGINE_COMPARTMENT,
  ];

  return poseFiles;
};

const detectOnlyPoseFileNames = () => {
  return [ENGINE_COMPARTMENT, DOC, INSIDE_DASHBOARD];
};

const multiplePics = () => {
  return [
    DL,
    RCB,
    FIR,
    INTERNAL_DAMAGED_AREA_FOCUSED_VIDEO,
    EXTERNAL_DAMAGED_AREA_FOCUSED_VIDEO,
  ];
};

const canGoVideoPi=(activityTypeId)=>{
  if (activityTypeId==ACTIVITY_TYPE_MOTOR_4W_OD_NB_PRE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_4W_OD_PRE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_4W_PRE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_4W_OD_RE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_4W_OD_NB_RE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_PRE_INSPECTION_SELF_SURVEY) {
    return true
  }
  else
  {
    return false
  }
  }

  const is2Wflow=(activityTypeId)=>{
    if (activityTypeId==ACTIVITY_TYPE_MOTOR_2W_PRE_INSPECTION_SELF_SURVEY
      ||activityTypeId==ACTIVITY_TYPE_MOTOR_2W_RE_INSPECTION_SELF_SURVEY
      ||activityTypeId==ACTIVITY_TYPE_MOTOR_2W_OD_PRE_INSPECTION_SELF_SURVEY
      ||activityTypeId==ACTIVITY_TYPE_MOTOR_2W_OD_RE_INSPECTION_SELF_SURVEY) {
      return true
  }
  else{
    return false
  }
}

const isCVFlow=(activityTypeId)=>{
  if (activityTypeId==ACTIVITY_TYPE_MOTOR_CVOD_PRE_INSPECTION_SELF_SURVEY
    ||activityTypeId==ACTIVITY_TYPE_MOTOR_CV_RE_INSPECTION_SELF_SURVEY) {
    return true
}
else{
  return false
}
}

const REGISTRATION_NUMBER_REGX =
  "[A-Z]{2}[0-9]{1,2}(?:[A-Z])?(?:[A-Z]*)?[0-9]{4}";
const POLICY_NUMBER_REGX = "[A-Z]{1}[0-9]{9}";
export {
  SCREEN_WIDTH,
  SCREEN_HEIGHT,
  EXTERNAL_DAMAGE,
  INTERNAL_DAMAGE,
  RC_BOOK,
  DRIVING_LICENSE,
  POLICE_FIR,
  AADHAR_CARD,
  PAN_CARD,
  CNG,
  VIDEO_TITLE,
  SELFI_IMAGE,
  ODOMETER,
  VIDEO_URL,
  PRIVATE_CAR_20101,
  PRIVATE_CAR_20102,
  PRIVATE_CAR_20103,
  BIKE_20201,
  BIKE_20202,
  CUMMERCIAL_20301,
  CUMMERCIAL_20302,
  CHASSIS_NUMBER,
  ACTIVITY_TYPE_MOTOR_2W_PRE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_PRE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_4W_OD_NB_PRE_INSPECTION_SELF_SURVEY,
  WEB_REQUEST,
  ANDROID_REQUEST,
  super_thank_you,
  your_preins_apprvd,
  thank_you,
  preinsp_com_will_update,
  DIRECT_PORTAL_AGENTCODE,
  image_pose_blur,
  image_pose_dark,
  image_pose_wrong,
  VIDEO_TITLE_HN,
  RC_BOOK_HN,
  ODOMETER_HN,
  SELFI_IMAGE_HN,
  CNG_HN,
  ACTIVITY_TYPE_MOTOR_CVOD_PRE_INSPECTION_SELF_SURVEY,
  PUC,
  PUC_Hn,
  REGISTRATION_NUMBER_REGX,
  POLICY_NUMBER_REGX,
  get4WPoseFileNames,
  get2WPoseFileNotDoc,
  detectOnlyPoseFileNames,
  multiplePics,
  DOC,
  ACTIVITY_TYPE_MOTOR_4W_PRE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_4W_OD_PRE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_4W_OD_RE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_4W_OD_NB_RE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_2W_RE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_2W_OD_PRE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_2W_OD_RE_INSPECTION_SELF_SURVEY,
  ACTIVITY_TYPE_MOTOR_CV_RE_INSPECTION_SELF_SURVEY,
  canGoVideoPi,
  is2Wflow,
  isCVFlow
};
