





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface ArabicTokenBitsPlugResizeShe : NSObject<CLShanYanSDKManagerDelegate>

@property (nonatomic, copy) void(^menTipCapsLoseAction)(NSInteger);

@end

@implementation ArabicTokenBitsPlugResizeShe

- (void)dealloc {
    
}

+ (instancetype)shared {
    static id shared = nil;
    static dispatch_once_t modeToken;
    dispatch_once(&modeToken, ^{
        shared = [[super allocWithZone:NULL] init];
    });
    return shared;
}

+ (NSString *)decipherUnit {
    return [CLShanYanSDKManager clShanYanSDKVersion];
}

- (void)circlePolishArteryClimbedMillionDetailedPreviews:(NSString *)appId complete:(void (^_Nullable)(BOOL foundLogin))complete {

    [CLShanYanSDKManager setCLShanYanSDKManagerDelegate:self];
    
    [CLShanYanSDKManager setPreGetPhonenumberUseCacheIfNoCellularNetwork:NO];
    
    [CLShanYanSDKManager initWithAppId:appId complete:^(CLCompleteResult * _Nonnull skinHallResult) {
        __block BOOL putBaseTheEachLogin = !skinHallResult.error;
        
        if (putBaseTheEachLogin) {
            
            [CLShanYanSDKManager preGetPhonenumber:^(CLCompleteResult * _Nonnull skinHallResult) {
                dispatch_sync(dispatch_get_main_queue(), ^{
                    complete(skinHallResult.error == nil);
                });
            }];
            
        } else {
            dispatch_sync(dispatch_get_main_queue(), ^{
                complete(NO);
            });
        }
    }];
}


- (void)segmentListenerPunjabiLineAscendedController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull smoothing))success moleSafety:(void (^_Nullable)(NSString * _Nonnull error))error stationAction:(void(^)(NSInteger))action {
    self.menTipCapsLoseAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self sundaneseLast:controller clipArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull skinHallResult) {
        if (skinHallResult.error) {
            error(skinHallResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull skinHallResult) {
        
        if (skinHallResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                success(skinHallResult.data);
            });
        }else {
            error(skinHallResult.message);
        }
    }];
}





- (CLUIConfigure *)sundaneseLast:(UIViewController *)viewController clipArray:(NSArray *)array {
    CLUIConfigure *farAskSlice = [[CLUIConfigure alloc] init];
    
    farAskSlice.viewController = viewController;
    
    
    farAskSlice.clNavigationBarHidden = @(YES);
    
    //logo
    farAskSlice.clLogoHiden = @(YES);
    
    
    farAskSlice.clPhoneNumberFont = [UIFont boldSystemFontOfSize:26];
    farAskSlice.clPhoneNumberColor = UIColor.darkGrayColor;
    farAskSlice.clPhoneNumberTextAlignment = @(NSTextAlignmentCenter);
    
    
    farAskSlice.clSloganTextFont = [UIFont systemFontOfSize:14];
    farAskSlice.clSloganTextColor = UIColor.darkGrayColor;
    farAskSlice.clSlogaTextAlignment = @(NSTextAlignmentCenter);
    
    
    farAskSlice.clLoginBtnText = array[4];
    farAskSlice.clLoginBtnTextFont = [UIFont systemFontOfSize:18];
    farAskSlice.clLoginBtnTextColor = UIColor.whiteColor;
    farAskSlice.clLoginBtnBgColor = array[0];
    farAskSlice.clLoginBtnCornerRadius = @(2);
    
    
    farAskSlice.clCheckBoxSize = [NSValue valueWithCGSize:CGSizeMake(0, 0)];
    farAskSlice.clCheckBoxValue = @(YES);
    
    
    farAskSlice.clAppPrivacyNormalDesTextFirst = array[5];
    farAskSlice.clAppPrivacyFirst = @[array[6], array[1]];
    farAskSlice.clAppPrivacyNormalDesTextSecond = array[7];
    farAskSlice.clAppPrivacyNormalDesTextLast = @"";
    farAskSlice.clAppPrivacyTextFont = [UIFont systemFontOfSize:12];
    farAskSlice.clAppPrivacyTextAlignment = @(NSTextAlignmentLeft);
    farAskSlice.clAppPrivacyWebNavigationBarTintColor = UIColor.whiteColor;
    farAskSlice.clAppPrivacyPunctuationMarks = @(YES);
    farAskSlice.clAppPrivacyColor = @[UIColor.darkGrayColor,array[0]];;
    farAskSlice.clAuthTypeUseWindow = @(YES);
    farAskSlice.clPrivacyShowUnderline = @(YES);
    farAskSlice.clAppPrivacyLineSpacing = @(2.5);
    farAskSlice.clAuthWindowModalTransitionStyle = @(UIModalTransitionStyleCrossDissolve);
    
    farAskSlice.clAppPrivacyWebBackBtnImage = array[2];
    
    
    farAskSlice.clLoadingSize = [NSValue valueWithCGSize:CGSizeMake(90, 90)];
    farAskSlice.clLoadingCornerRadius = @(2);
    farAskSlice.clLoadingIndicatorStyle = @(UIActivityIndicatorViewStyleLarge);
    farAskSlice.clLoadingTintColor = UIColor.blackColor;
    farAskSlice.clLoadingBackgroundColor = UIColor.clearColor;
    
    
    CLOrientationLayOut *undefinedDiphthongSamplingWhitePashto = [[CLOrientationLayOut alloc] init];
    farAskSlice.clOrientationLayOutPortrait = undefinedDiphthongSamplingWhitePashto;
    
    
    CGFloat y = (([UIScreen mainScreen].bounds.size.height - [array[3] CGSizeValue].height) * 0.5) + 35;
    CGFloat height = 30;
    undefinedDiphthongSamplingWhitePashto.clLayoutPhoneTop = @(y);
    undefinedDiphthongSamplingWhitePashto.clLayoutPhoneHeight = @(height);
    undefinedDiphthongSamplingWhitePashto.clLayoutPhoneCenterX = @(0);
    
    
    y += (height + 20);
    height = 17;
    undefinedDiphthongSamplingWhitePashto.clLayoutSloganTop = @(y);
    undefinedDiphthongSamplingWhitePashto.clLayoutSloganCenterX = @(0);
    undefinedDiphthongSamplingWhitePashto.clLayoutSloganHeight = @(height);

    
    y += (height + 20);
    height = 50;
    undefinedDiphthongSamplingWhitePashto.clLayoutLoginBtnTop = @(y);
    undefinedDiphthongSamplingWhitePashto.clLayoutLoginBtnWidth = @([array[3] CGSizeValue].width - 40);
    undefinedDiphthongSamplingWhitePashto.clLayoutLoginBtnCenterX = @(0);
    undefinedDiphthongSamplingWhitePashto.clLayoutLoginBtnHeight = @(height);

    
    y += (height + 15);
    undefinedDiphthongSamplingWhitePashto.clLayoutAppPrivacyTop = @(y);
    undefinedDiphthongSamplingWhitePashto.clLayoutAppPrivacyCenterX = @(0);
    undefinedDiphthongSamplingWhitePashto.clLayoutAppPrivacyWidth = @([array[3] CGSizeValue].width - 40);
    
    
    farAskSlice.customAreaView = ^(UIView * _Nonnull customAreaView) {
        
        customAreaView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0];
        
        UIView *printView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [array[3] CGSizeValue].width, [array[3] CGSizeValue].height)];
        printView.backgroundColor = UIColor.whiteColor;
        printView.layer.cornerRadius = 2.0;
        [customAreaView addSubview:printView];
        printView.center = customAreaView.center;
        
        
        UIButton *close = [UIButton buttonWithType:UIButtonTypeCustom];
        [close addTarget:self action:@selector(wonBagBaseballTitleOrangeEndsHandler:) forControlEvents:(UIControlEventTouchUpInside)];
        [close setBackgroundImage:array[2] forState:UIControlStateNormal];
        [printView addSubview:close];
        close.frame = CGRectMake(8, 8, 20, 20);
    };
    
    return farAskSlice;
}

- (void)wonBagBaseballTitleOrangeEndsHandler:(id)sender {
    [CLShanYanSDKManager finishAuthControllerCompletion:nil];
    self.menTipCapsLoseAction(0);
}

@end
