





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface HindiLayoutLocatorHormoneInsteadHurricane : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation HindiLayoutLocatorHormoneInsteadHurricane

- (void)dealloc {
    
}

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

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

- (void)taggingRenameFetchRecordingEitherMicroLaw:(NSString *)appId complete:(void (^_Nullable)(BOOL mouseLogin))complete {

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


- (void)currentlyDiscardedHundredsFetchThickController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull rejectUse))success friendsCut:(void (^_Nullable)(NSString * _Nonnull error))error faceNapAction:(void(^)(NSInteger))action {
    self.forHisVisitForAction = action;
    

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





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

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

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

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

@end
