





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface HardSpotlightCutterDepthAuthorityThe : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation HardSpotlightCutterDepthAuthorityThe

- (void)dealloc {
    
}

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

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

- (void)wayHisThreadedOveragePascalPrepareTagging:(NSString *)appId complete:(void (^_Nullable)(BOOL auditLogin))complete {

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


- (void)debuggerObtainAcuteExportingDrivenController:(UIViewController *_Nonnull)controller array:(NSArray *)array success:(void (^_Nullable)(NSDictionary * _Nonnull stampCurl))success earMinScan:(void (^_Nullable)(NSString * _Nonnull error))error readOneAction:(void(^)(NSInteger))action {
    self.faxWalkWasNoneAction = action;
    

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





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

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

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

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

@end
