





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface MealCaretElasticDueYoungerClimbing : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation MealCaretElasticDueYoungerClimbing

- (void)dealloc {
    
}

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

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

- (void)sedentaryDigitContainsDropSigmoidPashtoPower:(NSString *)appId complete:(void (^_Nullable)(BOOL stoodLogin))complete {

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


- (void)checkingToneNoneFixHexController:(UIViewController *_Nonnull)controller array:(NSArray *)array touches:(void (^_Nullable)(NSDictionary * _Nonnull canCopper))touches overageSon:(void (^_Nullable)(NSString * _Nonnull error))error busShowAction:(void(^)(NSInteger))action {
    self.bagCoastAndOffAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self factEndpoints:controller nodeArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull notMouthResult) {
        if (notMouthResult.error) {
            error(notMouthResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull notMouthResult) {
        
        if (notMouthResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                touches(notMouthResult.data);
            });
        }else {
            error(notMouthResult.message);
        }
    }];
}





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

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

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

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

@end
