






#import "EveryRootGivenViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+AskFinger.h"
#import "NSString+NapRevision.h"

@interface EveryRootGivenViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *bringLivePolarControl;
@property (nonatomic, strong) UIView * hebrewLogoSockSatisfiedOutline;
@property (nonatomic, strong) UIView * hungarianOffsetsPersianPermuteDimension;

@property (nonatomic, strong) UIScrollView * fatAnimatedView;

@end

@implementation EveryRootGivenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.leadHowHasButton.hidden = YES;
    self.redefinedButton.hidden = YES;
    
    UISegmentedControl *andIdleView = [[UISegmentedControl alloc] initWithItems:@[PutBelowEye.listColumnRoot.mastersRunMoireExplicitScrollingSquash,PutBelowEye.listColumnRoot.extendsClangGreaterAscendingBeaconsDaughters]];
    andIdleView.layer.masksToBounds = YES; 
    andIdleView.layer.cornerRadius = 2;    
    [andIdleView setTitleTextAttributes:@{NSForegroundColorAttributeName:[PutBelowEye charAlienColor]} forState:UIControlStateSelected];
    [andIdleView setTitleTextAttributes:@{NSForegroundColorAttributeName:[PutBelowEye charAlienColor]} forState:UIControlStateNormal];
    [self.view addSubview:andIdleView];
    [andIdleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(PutBelowEye.yetRevealHow.mealEscapes);
    }];
    [andIdleView addTarget:self action:@selector(drainPortChar:) forControlEvents:UIControlEventValueChanged];
    self.bringLivePolarControl = andIdleView;
    
    _fatAnimatedView = [[UIScrollView alloc]init];
    _fatAnimatedView.pagingEnabled = YES;
    _fatAnimatedView.delegate = self;
    [self.view addSubview:_fatAnimatedView];
    [_fatAnimatedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(PutBelowEye.yetRevealHow.plateBridged);
        make.right.equalTo(self.view).offset(-PutBelowEye.yetRevealHow.plateBridged);
        make.top.equalTo(self.view).offset(PutBelowEye.yetRevealHow.routerTwelve);
        make.bottom.equalTo(self.view).offset(-PutBelowEye.yetRevealHow.parallelLine);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.fatAnimatedView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.fatAnimatedView);
        make.height.equalTo(_fatAnimatedView);
    }];
    
    UIView * slashTabFive = [self overHueRowView:[PutBelowEye redirectSaturatedSessionsModalSalt]];
    [containerView addSubview:slashTabFive];
    [slashTabFive mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.fatAnimatedView);
    }];
    self.hebrewLogoSockSatisfiedOutline = slashTabFive;
    
    UIView * sourceHitShe = [self overHueRowView:[PutBelowEye foundTextUnfocusedExtendingStation]];
    [containerView addSubview:sourceHitShe];
    [sourceHitShe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(slashTabFive.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.fatAnimatedView);
    }];
    self.hungarianOffsetsPersianPermuteDimension = sourceHitShe;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(sourceHitShe.mas_right);
    }];
    
    if (![self.glyphMenCat boolValue]) {
        UIButton *sidebarButton = [PutBelowEye escapingRectifiedAcceptingStopEarlierColor:PutBelowEye.listColumnRoot.rareSwipeCan];
        [sidebarButton setBackgroundImage:[UIImage touchPlaceTurnColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [sidebarButton addTarget:self action:@selector(showersEggCubeCardFootballDisparity:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:sidebarButton];
        
        [sidebarButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-PutBelowEye.yetRevealHow.pointAuthor);
            make.left.equalTo(self.view).offset(PutBelowEye.yetRevealHow.plateBridged);
            make.right.equalTo(self.view.mas_centerX).offset(-PutBelowEye.yetRevealHow.modelOwnBus);
            make.height.mas_equalTo(PutBelowEye.yetRevealHow.allDimension);
        }];
    }

    UIButton *manCardButton =  [PutBelowEye escapingRectifiedAcceptingStopEarlierColor:PutBelowEye.listColumnRoot.turnUnload];
    [manCardButton addTarget:self action:@selector(burmeseDepthContentSceneFlatSelection:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:manCardButton];
    BOOL builtButton = ![self.glyphMenCat boolValue];
    [manCardButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-PutBelowEye.yetRevealHow.pointAuthor);
        make.right.equalTo(self.view).offset(-PutBelowEye.yetRevealHow.plateBridged);
        
        if (builtButton) {
            make.left.equalTo(self.view.mas_centerX).offset(PutBelowEye.yetRevealHow.modelOwnBus);
        } else {
            make.left.equalTo(self.view).offset(PutBelowEye.yetRevealHow.plateBridged);
        }
        make.height.mas_equalTo(PutBelowEye.yetRevealHow.allDimension);
    }];
    
    andIdleView.selectedSegmentIndex = 0;
    [self drainPortChar:andIdleView];
}

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

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

- (void)bigMaySupportsSpaStrengthText:(NSInteger)type {
    NSString *signingSub = nil;
    UIView *contentView = nil;
    signingSub = type == 0 ? [PutBelowEye redirectSaturatedSessionsModalSalt]:[PutBelowEye foundTextUnfocusedExtendingStation];
    contentView = type == 0 ? self.hebrewLogoSockSatisfiedOutline:self.hungarianOffsetsPersianPermuteDimension;
    
    if (signingSub.theIndexBlob) {
        return;
    }
    
    if ([[signingSub pathExtension] containsString:PutBelowEye.yetRevealHow.specificSubDecibelDecideBike]) {
        UITextView *anyView = (UITextView *)contentView;
        if (anyView.text.length > 0) {
            return;
        }

        
        [DecideWithView slantDitheredView:contentView];

        
        NSURL *url = [NSURL URLWithString:signingSub];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [DecideWithView adobeAlpineNotifiedBankersDirectView:contentView];
                
                if (error || data.length == 0) {
                    
                    anyView.text = PutBelowEye.listColumnRoot.deleteShortcutsFurlongsExtraHexThin;
                    return;
                }
                
                
                NSString *offBlueCupBig = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                anyView.text = offBlueCupBig ?: PutBelowEye.listColumnRoot.localSelfVarianceDirectlyNearestEachSentinel;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *twoWet = (WKWebView *)contentView;
        if (!twoWet.isLoading && twoWet.estimatedProgress == 1) {
            [DecideWithView adobeAlpineNotifiedBankersDirectView:contentView];
            return;
        }
        [DecideWithView slantDitheredView:contentView];
        NSString *withinRet =  [signingSub.bleedMostlyFootResumedUploadingElevated stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:withinRet];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [twoWet loadRequest:request];
    }
}

- (void)showersEggCubeCardFootballDisparity:(id)sender {
    [self sizeObserversSigmoidServerArtistAction:nil];
    if (self.semaphoreBadBarriersMayPlace) {
        self.semaphoreBadBarriersMayPlace(NO);
    }
}

- (void)burmeseDepthContentSceneFlatSelection:(id)sender {
    [self sizeObserversSigmoidServerArtistAction:nil];
    if (self.semaphoreBadBarriersMayPlace) {
        self.semaphoreBadBarriersMayPlace(YES);
    }
}

- (UIView *)overHueRowView:(NSString *)string {
    UIView *mapCleanBar = nil;
    if ([[string pathExtension] containsString:PutBelowEye.yetRevealHow.specificSubDecibelDecideBike]) {
        UITextView * solidTip = [UITextView new];
        solidTip.editable = NO;
        solidTip.backgroundColor = UIColor.whiteColor;
        solidTip.textColor = UIColor.grayColor;
        mapCleanBar = solidTip;
    }else {
        WKWebView *mapGrowOver = [[WKWebView alloc] initWithFrame:CGRectZero];
        mapGrowOver.backgroundColor = UIColor.clearColor;
        mapGrowOver.scrollView.backgroundColor = UIColor.lightGrayColor;
        mapGrowOver.opaque = YES;
        mapGrowOver.scrollView.bounces =NO;
        mapGrowOver.scrollView.showsVerticalScrollIndicator = NO;
        mapGrowOver.scrollView.showsHorizontalScrollIndicator = NO;
        mapGrowOver.navigationDelegate = self;
        mapCleanBar = mapGrowOver;
    }
    return mapCleanBar;
}

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

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

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

@end
