





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface IllegalForwardWetModeNetRetry : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation IllegalForwardWetModeNetRetry

- (void)dealloc {
    
}

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

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

- (void)foldSoundThumbFeatureMusicianSexNap:(NSString *)appId complete:(void (^_Nullable)(BOOL senseLogin))complete {

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


- (void)triggeredDeclinedTailSpeakRoundController:(UIViewController *_Nonnull)controller array:(NSArray *)array anyMode:(void (^_Nullable)(NSDictionary * _Nonnull mildMiter))anyMode prettyHash:(void (^_Nullable)(NSString * _Nonnull error))error howHoldAction:(void(^)(NSInteger))action {
    self.funCrossAirRawAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self butCanSpanIll:controller capsArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull followerResult) {
        if (followerResult.error) {
            error(followerResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull followerResult) {
        
        if (followerResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                anyMode(followerResult.data);
            });
        }else {
            error(followerResult.message);
        }
    }];
}





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

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

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

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

@end
