





#import <CL_ShanYanSDK/CL_ShanYanSDK.h>

@interface SucceedBeginDanceForkReportsRecording : NSObject<CLShanYanSDKManagerDelegate>

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

@end

@implementation SucceedBeginDanceForkReportsRecording

- (void)dealloc {
    
}

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

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

- (void)ownFindProduceMostRunningClaimArt:(NSString *)appId complete:(void (^_Nullable)(BOOL worldLogin))complete {

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


- (void)birthdayCardPipePingInterController:(UIViewController *_Nonnull)controller array:(NSArray *)array twoArts:(void (^_Nullable)(NSDictionary * _Nonnull wrongMole))twoArts decimalBit:(void (^_Nullable)(NSString * _Nonnull error))error tempArmAction:(void(^)(NSInteger))action {
    self.artsFoggyAvailAction = action;
    

    [CLShanYanSDKManager quickAuthLoginWithConfigure:[self valueQuerying:controller plusArray:array] openLoginAuthListener:^(CLCompleteResult * _Nonnull seeMicroResult) {
        if (seeMicroResult.error) {
            error(seeMicroResult.message);
        }
    } oneKeyLoginListener:^(CLCompleteResult * _Nonnull seeMicroResult) {
        
        if (seeMicroResult.error == nil) {
            dispatch_sync(dispatch_get_main_queue(), ^{
                twoArts(seeMicroResult.data);
            });
        }else {
            error(seeMicroResult.message);
        }
    }];
}





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

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

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

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

@end
