






#import "CutZeroArmBackViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+PatchFeet.h"
#import "NSString+PlanContact.h"

@interface CutZeroArmBackViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *clickSeparatedControl;
@property (nonatomic, strong) UIView * weekGatherBroadcastPromotionOvulation;
@property (nonatomic, strong) UIView * contextHardOuterOddIts;

@property (nonatomic, strong) UIScrollView * saveProductView;

@end

@implementation CutZeroArmBackViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.hueBookNotButton.hidden = YES;
    self.silentNetButton.hidden = YES;
    
    UISegmentedControl *missingView = [[UISegmentedControl alloc] initWithItems:@[MixSnowBits.theBinAlignWax.atomGolfUserKurdishCarrierProtocol,MixSnowBits.theBinAlignWax.sinhaleseDrivenExponentFalloffRainLess]];
    missingView.layer.masksToBounds = YES; 
    missingView.layer.cornerRadius = 2;    
    [missingView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MixSnowBits hallLaterColor]} forState:UIControlStateSelected];
    [missingView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MixSnowBits hallLaterColor]} forState:UIControlStateNormal];
    [self.view addSubview:missingView];
    [missingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(MixSnowBits.packRouteToo.servicesDue);
    }];
    [missingView addTarget:self action:@selector(packWarnSmart:) forControlEvents:UIControlEventValueChanged];
    self.clickSeparatedControl = missingView;
    
    _saveProductView = [[UIScrollView alloc]init];
    _saveProductView.pagingEnabled = YES;
    _saveProductView.delegate = self;
    [self.view addSubview:_saveProductView];
    [_saveProductView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(MixSnowBits.packRouteToo.armLoopPanel);
        make.right.equalTo(self.view).offset(-MixSnowBits.packRouteToo.armLoopPanel);
        make.top.equalTo(self.view).offset(MixSnowBits.packRouteToo.waxWasSindhi);
        make.bottom.equalTo(self.view).offset(-MixSnowBits.packRouteToo.funUnableWon);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.saveProductView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.saveProductView);
        make.height.equalTo(_saveProductView);
    }];
    
    UIView * followOunces = [self minimumAskView:[MixSnowBits wakeYellowMomentaryDeletionPunjabi]];
    [containerView addSubview:followOunces];
    [followOunces mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.saveProductView);
    }];
    self.weekGatherBroadcastPromotionOvulation = followOunces;
    
    UIView * hexProcessed = [self minimumAskView:[MixSnowBits adoptCategorySubWinSmall]];
    [containerView addSubview:hexProcessed];
    [hexProcessed mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(followOunces.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.saveProductView);
    }];
    self.contextHardOuterOddIts = hexProcessed;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(hexProcessed.mas_right);
    }];
    
    if (![self.thatMainFor boolValue]) {
        UIButton *filmWonButton = [MixSnowBits paymentsOriginDashArteryMetricsColor:MixSnowBits.theBinAlignWax.writeBigFeat];
        [filmWonButton setBackgroundImage:[UIImage capFitHasSpineColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [filmWonButton addTarget:self action:@selector(strongestModifiedMountKeysEncryptedOperator:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:filmWonButton];
        
        [filmWonButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-MixSnowBits.packRouteToo.plusAccount);
            make.left.equalTo(self.view).offset(MixSnowBits.packRouteToo.armLoopPanel);
            make.right.equalTo(self.view.mas_centerX).offset(-MixSnowBits.packRouteToo.parentSlide);
            make.height.mas_equalTo(MixSnowBits.packRouteToo.clipAllSheet);
        }];
    }

    UIButton *freeDryButton =  [MixSnowBits paymentsOriginDashArteryMetricsColor:MixSnowBits.theBinAlignWax.allowTotal];
    [freeDryButton addTarget:self action:@selector(closeHandlesInnerGradientGenderActive:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:freeDryButton];
    BOOL mouseButton = ![self.thatMainFor boolValue];
    [freeDryButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-MixSnowBits.packRouteToo.plusAccount);
        make.right.equalTo(self.view).offset(-MixSnowBits.packRouteToo.armLoopPanel);
        
        if (mouseButton) {
            make.left.equalTo(self.view.mas_centerX).offset(MixSnowBits.packRouteToo.parentSlide);
        } else {
            make.left.equalTo(self.view).offset(MixSnowBits.packRouteToo.armLoopPanel);
        }
        make.height.mas_equalTo(MixSnowBits.packRouteToo.clipAllSheet);
    }];
    
    missingView.selectedSegmentIndex = 0;
    [self packWarnSmart:missingView];
}

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

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

- (void)browsingAnchorsMenSequencerImpliedText:(NSInteger)type {
    NSString *leftUnlock = nil;
    UIView *contentView = nil;
    leftUnlock = type == 0 ? [MixSnowBits wakeYellowMomentaryDeletionPunjabi]:[MixSnowBits adoptCategorySubWinSmall];
    contentView = type == 0 ? self.weekGatherBroadcastPromotionOvulation:self.contextHardOuterOddIts;
    
    if (leftUnlock.bleedTallHow) {
        return;
    }
    
    if ([[leftUnlock pathExtension] containsString:MixSnowBits.packRouteToo.elapsedEntropyInvertAvailableIncludes]) {
        UITextView *carView = (UITextView *)contentView;
        if (carView.text.length > 0) {
            return;
        }

        
        [LoseBufferView collapsedPlanView:contentView];

        
        NSURL *url = [NSURL URLWithString:leftUnlock];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [LoseBufferView darkerMalformedWaxTryAuthorsView:contentView];
                
                if (error || data.length == 0) {
                    
                    carView.text = MixSnowBits.theBinAlignWax.depthIntegrityParticlePoliciesCiphersAttribute;
                    return;
                }
                
                
                NSString *buddyIncludes = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                carView.text = buddyIncludes ?: MixSnowBits.theBinAlignWax.tooArmourQuietDustGainStrokeAppending;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *assume = (WKWebView *)contentView;
        if (!assume.isLoading && assume.estimatedProgress == 1) {
            [LoseBufferView darkerMalformedWaxTryAuthorsView:contentView];
            return;
        }
        [LoseBufferView collapsedPlanView:contentView];
        NSString *cupFamily =  [leftUnlock.cathedralSoftEncryptUnorderedEnergySnapshot stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:cupFamily];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [assume loadRequest:request];
    }
}

- (void)strongestModifiedMountKeysEncryptedOperator:(id)sender {
    [self telephotoMenBandNapGenerateAction:nil];
    if (self.theNanogramsProceedTransferRecycle) {
        self.theNanogramsProceedTransferRecycle(NO);
    }
}

- (void)closeHandlesInnerGradientGenderActive:(id)sender {
    [self telephotoMenBandNapGenerateAction:nil];
    if (self.theNanogramsProceedTransferRecycle) {
        self.theNanogramsProceedTransferRecycle(YES);
    }
}

- (UIView *)minimumAskView:(NSString *)string {
    UIView *sevenEndIcy = nil;
    if ([[string pathExtension] containsString:MixSnowBits.packRouteToo.elapsedEntropyInvertAvailableIncludes]) {
        UITextView * recorder = [UITextView new];
        recorder.editable = NO;
        recorder.backgroundColor = UIColor.whiteColor;
        recorder.textColor = UIColor.grayColor;
        sevenEndIcy = recorder;
    }else {
        WKWebView *askUnlocked = [[WKWebView alloc] initWithFrame:CGRectZero];
        askUnlocked.backgroundColor = UIColor.clearColor;
        askUnlocked.scrollView.backgroundColor = UIColor.lightGrayColor;
        askUnlocked.opaque = YES;
        askUnlocked.scrollView.bounces =NO;
        askUnlocked.scrollView.showsVerticalScrollIndicator = NO;
        askUnlocked.scrollView.showsHorizontalScrollIndicator = NO;
        askUnlocked.navigationDelegate = self;
        sevenEndIcy = askUnlocked;
    }
    return sevenEndIcy;
}

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

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

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

@end
