





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface AskViewDropKeyBadReal : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation AskViewDropKeyBadReal

- (void)dealloc {
    
}

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

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

- (void)sunAxesFloorEraDrawingSerialWax:(NSString *)appId complete:(void (^_Nullable)(BOOL caretLogin))complete {

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


- (void)thicknessDividingReadoutWritingBehaviorController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull addFigure))success maxTapBold:(void (^_Nullable)(NSString * _Nonnull error))error pullNetAction:(void(^)(NSInteger))action {
    self.tabCostTabClipAction = action;
    

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





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

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

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

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

@end
