






#import "WaitTheAllExecViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Enclosing.h"
#import "NSString+PieceBagSay.h"

@interface WaitTheAllExecViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *carCubeSeeLeftControl;
@property (nonatomic, strong) UIView * componentPinTransposeOceanPredicate;
@property (nonatomic, strong) UIView * resultBounceHueOpticalConstants;

@property (nonatomic, strong) UIScrollView * sideKeysOwnView;

@end

@implementation WaitTheAllExecViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.familyStayButton.hidden = YES;
    self.sentSlideButton.hidden = YES;
    
    UISegmentedControl *publishView = [[UISegmentedControl alloc] initWithItems:@[WetDoneFill.wideHostLooper.aliveAuthorityCallGeometricModernHidden,WetDoneFill.wideHostLooper.diskBufferedStairBlinkAscenderBag]];
    publishView.layer.masksToBounds = YES; 
    publishView.layer.cornerRadius = 2;    
    [publishView setTitleTextAttributes:@{NSForegroundColorAttributeName:[WetDoneFill scrollHasColor]} forState:UIControlStateSelected];
    [publishView setTitleTextAttributes:@{NSForegroundColorAttributeName:[WetDoneFill scrollHasColor]} forState:UIControlStateNormal];
    [self.view addSubview:publishView];
    [publishView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(WetDoneFill.artSensitive.blurLowPrep);
    }];
    [publishView addTarget:self action:@selector(designerBrown:) forControlEvents:UIControlEventValueChanged];
    self.carCubeSeeLeftControl = publishView;
    
    _sideKeysOwnView = [[UIScrollView alloc]init];
    _sideKeysOwnView.pagingEnabled = YES;
    _sideKeysOwnView.delegate = self;
    [self.view addSubview:_sideKeysOwnView];
    [_sideKeysOwnView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(WetDoneFill.artSensitive.drumPopBrown);
        make.right.equalTo(self.view).offset(-WetDoneFill.artSensitive.drumPopBrown);
        make.top.equalTo(self.view).offset(WetDoneFill.artSensitive.northOptTree);
        make.bottom.equalTo(self.view).offset(-WetDoneFill.artSensitive.finderSeePop);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.sideKeysOwnView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.sideKeysOwnView);
        make.height.equalTo(_sideKeysOwnView);
    }];
    
    UIView * bagNapReduce = [self requestTopView:[WetDoneFill truncatedTraveledLossModelNot]];
    [containerView addSubview:bagNapReduce];
    [bagNapReduce mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.sideKeysOwnView);
    }];
    self.componentPinTransposeOceanPredicate = bagNapReduce;
    
    UIView * somaliEnergy = [self requestTopView:[WetDoneFill adaptiveQualifiedExistVariationSave]];
    [containerView addSubview:somaliEnergy];
    [somaliEnergy mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bagNapReduce.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.sideKeysOwnView);
    }];
    self.resultBounceHueOpticalConstants = somaliEnergy;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(somaliEnergy.mas_right);
    }];
    
    if (![self.patchFatYou boolValue]) {
        UIButton *hairTwoButton = [WetDoneFill takeBendReachableResultsDatumColor:WetDoneFill.wideHostLooper.pintControls];
        [hairTwoButton setBackgroundImage:[UIImage driveStrongestColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [hairTwoButton addTarget:self action:@selector(saturatedLiteralCapBufferingAlbumDeleting:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:hairTwoButton];
        [hairTwoButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-WetDoneFill.artSensitive.yetThirdMax);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(WetDoneFill.artSensitive.bagVitalFile);
        }];
    }
    
    UIButton *encodedButton =  [WetDoneFill takeBendReachableResultsDatumColor:WetDoneFill.wideHostLooper.staticList];
    [encodedButton addTarget:self action:@selector(desiredPhoneUnionRedirectsAllDaughters:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:encodedButton];
    [encodedButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-WetDoneFill.artSensitive.yetThirdMax);
        make.centerX.equalTo(self.view).multipliedBy(![self.patchFatYou boolValue]?1.35:1);
        make.height.mas_equalTo(WetDoneFill.artSensitive.bagVitalFile);
    }];
    
    publishView.selectedSegmentIndex = 0;
    [self designerBrown:publishView];
}

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

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

- (void)mixerAuthorRebuildFeatAscenderText:(NSInteger)type {
    NSString *busyForBin = nil;
    UIView *contentView = nil;
    busyForBin = type == 0 ? [WetDoneFill truncatedTraveledLossModelNot]:[WetDoneFill adaptiveQualifiedExistVariationSave];
    contentView = type == 0 ? self.componentPinTransposeOceanPredicate:self.resultBounceHueOpticalConstants;
    
    if (busyForBin.tipSlabLater) {
        return;
    }
    
    if ([[busyForBin pathExtension] containsString:WetDoneFill.artSensitive.ambientSubsetRearSoftballCatalog]) {
        UITextView *sumView = (UITextView *)contentView;
        if (sumView.text.length > 0) {
            return;
        }

        
        [WristInferView didBinTransitView:contentView];

        
        NSURL *url = [NSURL URLWithString:busyForBin];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [WristInferView panProcessScrollReferenceProcessesView:contentView];
                
                if (error || data.length == 0) {
                    
                    sumView.text = WetDoneFill.wideHostLooper.lingerStandardConnectedLossySoftnessSense;
                    return;
                }
                
                
                NSString *endFarSixTree = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                sumView.text = endFarSixTree ?: WetDoneFill.wideHostLooper.preserveTallDependingSpineTagAltimeterBatch;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *dogMen = (WKWebView *)contentView;
        if (!dogMen.isLoading && dogMen.estimatedProgress == 1) {
            [WristInferView panProcessScrollReferenceProcessesView:contentView];
            return;
        }
        [WristInferView didBinTransitView:contentView];
        NSString *mayEnergy =  [busyForBin.messagingPressedHybridArmSwapHead stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:mayEnergy];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [dogMen loadRequest:request];
    }
}

- (void)saturatedLiteralCapBufferingAlbumDeleting:(id)sender {
    [self browseConfigureRecognizeRecorderLinerAction:nil];
    if (self.interruptAttributePlaybackOldReached) {
        self.interruptAttributePlaybackOldReached(NO);
    }
}

- (void)desiredPhoneUnionRedirectsAllDaughters:(id)sender {
    [self browseConfigureRecognizeRecorderLinerAction:nil];
    if (self.interruptAttributePlaybackOldReached) {
        self.interruptAttributePlaybackOldReached(YES);
    }
}

- (UIView *)requestTopView:(NSString *)string {
    UIView *sinLacrosse = nil;
    if ([[string pathExtension] containsString:WetDoneFill.artSensitive.ambientSubsetRearSoftballCatalog]) {
        UITextView * tallType = [UITextView new];
        tallType.editable = NO;
        tallType.backgroundColor = UIColor.whiteColor;
        tallType.textColor = UIColor.grayColor;
        sinLacrosse = tallType;
    }else {
        WKWebView *airCivilNow = [[WKWebView alloc] initWithFrame:CGRectZero];
        airCivilNow.backgroundColor = UIColor.clearColor;
        airCivilNow.scrollView.backgroundColor = UIColor.lightGrayColor;
        airCivilNow.opaque = YES;
        airCivilNow.scrollView.bounces =NO;
        airCivilNow.scrollView.showsVerticalScrollIndicator = NO;
        airCivilNow.scrollView.showsHorizontalScrollIndicator = NO;
        airCivilNow.navigationDelegate = self;
        sinLacrosse = airCivilNow;
    }
    return sinLacrosse;
}

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

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

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

@end
