





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface MenuUndefinedBikeTatarEntropyClean : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation MenuUndefinedBikeTatarEntropyClean

- (void)dealloc {
    
}

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

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

- (void)martialProvinceExponentDeliverBezelExpiredTraverse:(NSString *)appId complete:(void (^_Nullable)(BOOL pitchLogin))complete {

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


- (void)whoPrefixNetSessionsDrainController:(UIViewController *_Nonnull)controller array:(NSArray *)array retried:(void (^_Nullable)(NSDictionary * _Nonnull trapInuit))retried userBarDay:(void (^_Nullable)(NSString * _Nonnull error))error coloredAction:(void(^)(NSInteger))action {
    self.streamedSafariAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self takeEachPress:controller editArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull cervicalResult) {
        if (cervicalResult.error) {
            error(cervicalResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull cervicalResult) {
        
        if (cervicalResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                retried(cervicalResult.data);
            });
        }else {
            error(cervicalResult.message);
        }
    }];
}





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

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

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

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

@end
