





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface MetabolicVolumeCentralDownFunnelBankers : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation MetabolicVolumeCentralDownFunnelBankers

- (void)dealloc {
    
}

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

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

- (void)punjabiPinProteinUptimeKeyBecomeFormat:(NSString *)appId complete:(void (^_Nullable)(BOOL chunkLogin))complete {

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


- (void)undoTintBlusterySaturatedWrappersController:(UIViewController *_Nonnull)controller array:(NSArray *)array letters:(void (^_Nullable)(NSDictionary * _Nonnull waitEnter))letters bringToken:(void (^_Nullable)(NSString * _Nonnull error))error fitDaysAction:(void(^)(NSInteger))action {
    self.jumpTabPutGaspAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self quoteOnceDash:controller feedArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull sixParseResult) {
        if (sixParseResult.error) {
            error(sixParseResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull sixParseResult) {
        
        if (sixParseResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                letters(sixParseResult.data);
            });
        }else {
            error(sixParseResult.message);
        }
    }];
}





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

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

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

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

@end
