





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface InsertionFathomsPlusTooAssetSeparated : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation InsertionFathomsPlusTooAssetSeparated

- (void)dealloc {
    
}

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

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

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

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


- (void)remembersPasteErrorSayPlanController:(UIViewController *_Nonnull)controller array:(NSArray *)array factory:(void (^_Nullable)(NSDictionary * _Nonnull hisLambda))factory beatCursor:(void (^_Nullable)(NSString * _Nonnull error))error sinCardAction:(void(^)(NSInteger))action {
    self.tailEggWeekMayAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self manKeysSeeOur:controller readArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull usesMarkResult) {
        if (usesMarkResult.error) {
            error(usesMarkResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull usesMarkResult) {
        
        if (usesMarkResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                factory(usesMarkResult.data);
            });
        }else {
            error(usesMarkResult.message);
        }
    }];
}





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

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

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

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

@end
