





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface MultipleWaistCascadeSplatWayIndigo : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation MultipleWaistCascadeSplatWayIndigo

- (void)dealloc {
    
}

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

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

- (void)strictMultiplyDraftManagedBengaliDrivenDown:(NSString *)appId complete:(void (^_Nullable)(BOOL watchLogin))complete {

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


- (void)distanceFactFutureOverhangInstallController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull linkTilde))success waxSquares:(void (^_Nullable)(NSString * _Nonnull error))error managedAction:(void(^)(NSInteger))action {
    self.manPenAssetFunAction = action;
    

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





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

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

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

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

@end
