






#import "SheBlurLinkHerViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+MildQuery.h"
#import "NSString+AlphabetTop.h"

@interface SheBlurLinkHerViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *rollArtsClientControl;
@property (nonatomic, strong) UIView * cocoaInactiveMayManBadge;
@property (nonatomic, strong) UIView * bracketWonCapableInvertNonce;

@property (nonatomic, strong) UIScrollView * doneRefusedView;

@end

@implementation SheBlurLinkHerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.declineRawButton.hidden = YES;
    self.nearHumanButton.hidden = YES;
    
    UISegmentedControl *arePinkView = [[UISegmentedControl alloc] initWithItems:@[PartialBest.itsOneFlowEasy.volumesQuantizeAudiencesFoundNowCut,PartialBest.itsOneFlowEasy.footballSpeedBirthdayRangeBitIntro]];
    arePinkView.layer.masksToBounds = YES; 
    arePinkView.layer.cornerRadius = 2;    
    [arePinkView setTitleTextAttributes:@{NSForegroundColorAttributeName:[PartialBest turnOtherColor]} forState:UIControlStateSelected];
    [arePinkView setTitleTextAttributes:@{NSForegroundColorAttributeName:[PartialBest turnOtherColor]} forState:UIControlStateNormal];
    [self.view addSubview:arePinkView];
    [arePinkView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(PartialBest.mouseEarlier.ageDirector);
    }];
    [arePinkView addTarget:self action:@selector(mixSobMinimum:) forControlEvents:UIControlEventValueChanged];
    self.rollArtsClientControl = arePinkView;
    
    _doneRefusedView = [[UIScrollView alloc]init];
    _doneRefusedView.pagingEnabled = YES;
    _doneRefusedView.delegate = self;
    [self.view addSubview:_doneRefusedView];
    [_doneRefusedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(PartialBest.mouseEarlier.barCutoffHow);
        make.right.equalTo(self.view).offset(-PartialBest.mouseEarlier.barCutoffHow);
        make.top.equalTo(self.view).offset(PartialBest.mouseEarlier.hasKnowWaist);
        make.bottom.equalTo(self.view).offset(-PartialBest.mouseEarlier.canShadowFat);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.doneRefusedView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.doneRefusedView);
        make.height.equalTo(_doneRefusedView);
    }];
    
    UIView * detailsEuler = [self illEpsilonView:[PartialBest elementsNeedPosterPlateMobile]];
    [containerView addSubview:detailsEuler];
    [detailsEuler mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.doneRefusedView);
    }];
    self.cocoaInactiveMayManBadge = detailsEuler;
    
    UIView * divideMinute = [self illEpsilonView:[PartialBest tapsArrangerPatternLocalSuggest]];
    [containerView addSubview:divideMinute];
    [divideMinute mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(detailsEuler.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.doneRefusedView);
    }];
    self.bracketWonCapableInvertNonce = divideMinute;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(divideMinute.mas_right);
    }];
    
    if (![self.redoNineEgg boolValue]) {
        UIButton *tintLogButton = [PartialBest textualEllipsisBankStopMonthColor:PartialBest.itsOneFlowEasy.canDocuments];
        [tintLogButton setBackgroundImage:[UIImage addColorTryWayColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [tintLogButton addTarget:self action:@selector(stepWetPreparedBetweenFactoriesMusic:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:tintLogButton];
        
        [tintLogButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-PartialBest.mouseEarlier.anyFitTotal);
            make.left.equalTo(self.view).offset(PartialBest.mouseEarlier.barCutoffHow);
            make.right.equalTo(self.view.mas_centerX).offset(-PartialBest.mouseEarlier.stickyVideo);
            make.height.mas_equalTo(PartialBest.mouseEarlier.binBusyClose);
        }];
    }

    UIButton *badFoodButton =  [PartialBest textualEllipsisBankStopMonthColor:PartialBest.itsOneFlowEasy.quickFrame];
    [badFoodButton addTarget:self action:@selector(insteadRequiringTableSoundPaletteTrash:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:badFoodButton];
    BOOL sliceButton = ![self.redoNineEgg boolValue];
    [badFoodButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-PartialBest.mouseEarlier.anyFitTotal);
        make.right.equalTo(self.view).offset(-PartialBest.mouseEarlier.barCutoffHow);
        
        if (sliceButton) {
            make.left.equalTo(self.view.mas_centerX).offset(PartialBest.mouseEarlier.stickyVideo);
        } else {
            make.left.equalTo(self.view).offset(PartialBest.mouseEarlier.barCutoffHow);
        }
        make.height.mas_equalTo(PartialBest.mouseEarlier.binBusyClose);
    }];
    
    arePinkView.selectedSegmentIndex = 0;
    [self mixSobMinimum:arePinkView];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    [self.rollArtsClientControl setSelectedSegmentIndex:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
    [self renamingEffectiveLowerIssuerTorchText:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
}

- (void)mixSobMinimum:(UISegmentedControl *)sender {
    [self renamingEffectiveLowerIssuerTorchText:sender.selectedSegmentIndex == 0?0:1];
    [self.doneRefusedView setContentOffset:CGPointMake(sender.selectedSegmentIndex == 0?0:self.doneRefusedView.frame.size.width, 0) animated:YES];
}

- (void)renamingEffectiveLowerIssuerTorchText:(NSInteger)type {
    NSString *seeFlights = nil;
    UIView *contentView = nil;
    seeFlights = type == 0 ? [PartialBest elementsNeedPosterPlateMobile]:[PartialBest tapsArrangerPatternLocalSuggest];
    contentView = type == 0 ? self.cocoaInactiveMayManBadge:self.bracketWonCapableInvertNonce;
    
    if (seeFlights.tapWonFunnel) {
        return;
    }
    
    if ([[seeFlights pathExtension] containsString:PartialBest.mouseEarlier.traitTooAccuracyUndoTagalog]) {
        UITextView *seeView = (UITextView *)contentView;
        if (seeView.text.length > 0) {
            return;
        }

        
        [LinkArmBadView wayDegreesHowView:contentView];

        
        NSURL *url = [NSURL URLWithString:seeFlights];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [LinkArmBadView sexualPublishBorderEarHueView:contentView];
                
                if (error || data.length == 0) {
                    
                    seeView.text = PartialBest.itsOneFlowEasy.organizeStreamsStrongEmbeddedDescendReversing;
                    return;
                }
                
                
                NSString *guideFeedback = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                seeView.text = guideFeedback ?: PartialBest.itsOneFlowEasy.centerTryStormToneSchedulerSubmittedWorkouts;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *optOwn = (WKWebView *)contentView;
        if (!optOwn.isLoading && optOwn.estimatedProgress == 1) {
            [LinkArmBadView sexualPublishBorderEarHueView:contentView];
            return;
        }
        [LinkArmBadView wayDegreesHowView:contentView];
        NSString *swapClang =  [seeFlights.directlyPageBlurUploadingFontSpeed stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:swapClang];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [optOwn loadRequest:request];
    }
}

- (void)stepWetPreparedBetweenFactoriesMusic:(id)sender {
    [self indianCheckingPassPascalWetAction:nil];
    if (self.allocatedSetupMountGenericsCleanup) {
        self.allocatedSetupMountGenericsCleanup(NO);
    }
}

- (void)insteadRequiringTableSoundPaletteTrash:(id)sender {
    [self indianCheckingPassPascalWetAction:nil];
    if (self.allocatedSetupMountGenericsCleanup) {
        self.allocatedSetupMountGenericsCleanup(YES);
    }
}

- (UIView *)illEpsilonView:(NSString *)string {
    UIView *songArmHand = nil;
    if ([[string pathExtension] containsString:PartialBest.mouseEarlier.traitTooAccuracyUndoTagalog]) {
        UITextView * addTrial = [UITextView new];
        addTrial.editable = NO;
        addTrial.backgroundColor = UIColor.whiteColor;
        addTrial.textColor = UIColor.grayColor;
        songArmHand = addTrial;
    }else {
        WKWebView *willMaySpan = [[WKWebView alloc] initWithFrame:CGRectZero];
        willMaySpan.backgroundColor = UIColor.clearColor;
        willMaySpan.scrollView.backgroundColor = UIColor.lightGrayColor;
        willMaySpan.opaque = YES;
        willMaySpan.scrollView.bounces =NO;
        willMaySpan.scrollView.showsVerticalScrollIndicator = NO;
        willMaySpan.scrollView.showsHorizontalScrollIndicator = NO;
        willMaySpan.navigationDelegate = self;
        songArmHand = willMaySpan;
    }
    return songArmHand;
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    [LinkArmBadView sexualPublishBorderEarHueView:webView];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    UIEdgeInsets rotorWatch = [[HelloFormManager shared] winGatheringWindow].safeAreaInsets;
    rotorWatch.top    += 10;
    rotorWatch.left   += 10;
    rotorWatch.bottom += 10;
    rotorWatch.right  += 10;

    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(rotorWatch);
    }];
}

@end
