//
// Config.m
// Project
//
// Created by haibara on 1/21/16.
//
//

#import "AllConfig.h"
#import "SDK.h"
#import "CocoaUtils.h"

NSString *const PUNCTUATION_EXCLAMATION_MARK = @"!";
NSString *const PUNCTUATION_COMMA = @",";
NSString *const PUNCTUATION_QUESTION_MARK = @"?";
NSString *const PUNCTUATION_PERIOD = @".";
NSString *const PUNCTUATION_COLON = @":";
NSString *const PUNCTUATION_ELLIPSIS = @"...";
NSString *const PUNCTUATION_PARENTHESES_LEFT = @"(";
NSString *const PUNCTUATION_PARENTHESES_RIGHT = @")";
NSString *const PUNCTUATION_BRACKETS_LEFT = @"[";
NSString *const PUNCTUATION_BRACKETS_RIGHT = @"]";
NSString *const WORD_DIVIDER_SPACE = @" ";

CGFloat const kDefaultRoundedCornerRadius = 4;

NSString *const UserDefaultsKeyEAIntroViewSkipped = @"showIntroWithCustomView";
NSString *const UserDefaultsKeyUserID = @"userId";
NSString *const UserDefaultsKeyUserName = @"loginUsername";
NSString *const UserDefaultsKeyUserPassword = @"loginPassword";
NSString *const UserDefaultsKeyUserRegisterNotification = @"registerNotification";
NSString *const UserDefaultsKeyCalendarEventsEnabled = @"storeEvent";
NSString *const UserDefaultsKeyCalendarEventIdentifiersForUpcomingItineraries = @"ItineraryDepartureCalendarEventIdentifiers";
NSString *const UserDefaultsKeyDeviceToken = @"deviceToken";
NSString *const UserDefaultsKeyUserNotificationsEnabled = @"UserNotificationsEnabled";
NSString *const UserDefaultsKeyAmazonSNSEndpointArn = @"AmazonSNSEndpointArn";
NSString *const UserDefaultsKeyNotificationErrorList = @"NotificationErrorList";
NSString *const UserDefaultsKeyHistoryBusSearchDepartureList = @"HistoryBusSearchDepartureList";
NSString *const UserDefaultsKeyHistoryHotelSearchDestinationList = @"HistoryHotelSearchDestinationList";
NSString *const UserDefaultsKeyHistoryTourSearchDestinationList = @"HistoryTourSearchDestinationList";
NSString *const UserDefaultsKeyHistoryNotificationList = @"HistoryNotificationList";

NSString *const LoginStatusDidChangeNotification = @"LoginStatusDidChangeNotification";
NSString *const SegueDidPerformNotification = @"SegueDidPerformNotification";
NSString *const UpcomingItinerariesCountDidChangeNotification = @"UpcomingItinerariesCountDidChangeNotification";
NSString *const BookingFinishNotification = @"BookingFinishNotification";
NSString *const UnreadMessageNotification = @"unreadMessage";

NSString *const WXPayRespNotification = @"WXPayRespNotification";
NSString *const UPPaymentResultNotification = @"UPPaymentResultNotification";
NSString *const AlipayOrderPaymentResultNotification = @"AlipayOrderPaymentResultNotification";

#pragma clang diagnostic ignored "-Wprotocol"

@implementation AllConfig

#pragma mark - Public

+ (AppDelegate *)appDelegate {
	return (AppDelegate *)[UIApplication sharedApplication].delegate;
}

+ (NSString *)responseException {
	return IMLocalizedString(@"An error occurred, please try again later.");
}

+(NSString *)appId{
	return nil;
}

+ (BOOL)isLiveServer {
#if DEBUG
	return ![self is_develop] && ![self is_testing_server];
#else
	return YES;
#endif
}

+ (NSString *)developServer {
#if TARGET_IPHONE_SIMULATOR
	return [NSString stringWithFormat:@"http://%@.taketours.com", [[CocoaUtils userName] isEqualToString:@"haibara"] ? @"haibara" : @"vae"];
#else
	return @"http://appdev.taketours.com:9999";
#endif
}

+ (NSString *)javaSearchLocalhost {
	return @"http://192.168.20.64:8080/search";
}

+ (NSString *)javaAppLocalhost {
#if TARGET_IPHONE_SIMULATOR
    return @"http://java.taketours.com:9988/app";
#else
	return @"http://hz249.gotobus.com:9964/app";
#endif
}

+ (NSString *)javaSearchEndpoint {
#if DEBUG
	return [self isJavaSearchLocalhost] ? [self javaSearchLocalhost] : [self javaSearchLiveEndpoint];
#else
	return [self javaSearchLiveEndpoint];
#endif
}

+ (NSString *)javaAppEndpoint {
#if DEBUG
	return [self isJavaAppLocalhost] ? [self javaAppLocalhost] : [self javaAppLiveEndpoint];
#else
	return [self javaAppLiveEndpoint];
#endif
}

+ (NSString *)paypalClientId {
#if DEBUG
	return [self isPaypalSandbox] ? [self paypalSandboxClientId] : [self paypalLiveClientId];
#else
	return [self paypalLiveClientId];
#endif
}

+ (NSString *)paypalSecret {
#if DEBUG
	return [self isPaypalSandbox] ? [self paypalSandboxSecret] : [self paypalLiveSecret];
#else
	return [self paypalLiveSecret];
#endif
}

+ (NSString *)AWSSNSPlatformApplicationArn {
#if DEBUG
	return [self AWSSNSSandboxPlatformApplicationArn];
#else
	return [self AWSSNSLivePlatformApplicationArn];
#endif
}

+ (BOOL)isAffiliate{
	return YES;
}

#pragma mark - <MainSiteConfig>

+ (BOOL)is_bus_site {
	return NO;
}

+ (BOOL)is_tours_site {
	return NO;
}

+ (NSDictionary *)rangedPhones {
	return nil;
}

#pragma mark - <ClientSiteConfig>

+ (NSInteger)clientDomainId {
	return 0;
}

+ (NSString *)clientServiceProvider {
	return nil;
}

#pragma mark - <WebServiceConfig>

+ (NSString *)javaSearchLiveEndpoint {
	return [[self liveServer] stringByAppendingString:@"/search"];
}

+ (NSString *)javaAppLiveEndpoint {
	return [[self liveServer] stringByAppendingString:@"/app"];
}

#pragma mark - <AWSConfig>


+ (NSString *)AWSStaticCredentialsAccessKey {
	return @"AKIAJZEPUM4RZYFJS4RA";
}

+ (NSString *)AWSStaticCredentialsSecretKey {
	return @"90eOF8gc+mSsHCZ0TpQA1d1VTDAaRSa7wxE/lqRW";
}

+ (NSString *)AWSSNSSandboxPlatformApplicationArn {
	return nil;
}

+ (NSString *)AWSSNSLivePlatformApplicationArn {
	return nil;
}

#pragma mark - <PiwikConfig>

+ (NSString *)piwikBaseUrl {
	return @"https://owa.taketours.com/piwik/piwik.php";
}

+ (NSString *)piwikSiteId {
	return nil;
}

#pragma mark - <WeChatConfig>

+ (NSString *)wechatAppId {
	return nil;
}

#pragma mark - <ThirdPartyPaymentConfig>

+ (NSString *)alipayUrlScheme {
	return nil;
}

+ (NSString *)unionpayUrlScheme {
	return nil;
}

@end
