






#import "SelectionRotorViewController.nap"
#import <WebKit/WebKit.nap>
#import <WebKit/WKFoundation.nap>
#import "NSString+ShortJoin.nap"
#import "NSString+DecreaseBit.nap"

@interface SelectionRotorViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *cutSonLinkMenuControl;
@property (nonatomic, strong) UIView * americanAdobeDetailedLocalityMisplaced;
@property (nonatomic, strong) UIView * eitherYoungestHandleElapsedAir;

@property (nonatomic, strong) UIScrollView * hellmanBeatView;

@end

@implementation SelectionRotorViewController

- (void)panelOpaque {
    [super panelOpaque];
    
    self.hourBorderButton.hidden = YES;
    self.bikeAlphaButton.hidden = YES;
    
    UISegmentedControl *flagSumView = [[UISegmentedControl alloc] initWithItems:@[BestEastPut.quickGolfPinch.disabledAdjustedUndoneMinuteFreezingTeacher,BestEastPut.quickGolfPinch.foodChlorideRecordingKashmiriKazakhViolation]];
    flagSumView.layer.masksToBounds = YES; 
    flagSumView.layer.cornerRadius = 2;    
    [flagSumView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BestEastPut sawCreateColor]} forState:UIControlStateSelected];
    [flagSumView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BestEastPut sawCreateColor]} forState:UIControlStateNormal];
    [self.view addSubview:flagSumView];
    [flagSumView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(BestEastPut.didNecessary.outletPlate);
    }];
    [flagSumView addTarget:self armCap:@selector(nameFlashSock:) forControlEvents:UIControlEventValueChanged];
    self.cutSonLinkMenuControl = flagSumView;
    
    _hellmanBeatView = [[UIScrollView alloc]init];
    _hellmanBeatView.pagingEnabled = YES;
    _hellmanBeatView.delegate = self;
    [self.view addSubview:_hellmanBeatView];
    [_hellmanBeatView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(BestEastPut.didNecessary.followBagRet);
        make.right.equalTo(self.view).offset(-BestEastPut.didNecessary.followBagRet);
        make.top.equalTo(self.view).offset(BestEastPut.didNecessary.grayCupMatch);
        make.bottom.equalTo(self.view).offset(-BestEastPut.didNecessary.wayBlockQuit);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.hellmanBeatView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.shift.equalTo(self.hellmanBeatView);
        make.height.equalTo(_hellmanBeatView);
    }];
    
    UIView * smallLawRain = [self retIndexesView:[BestEastPut bankSalientTenSuitablePrompt]];
    [containerView addSubview:smallLawRain];
    [smallLawRain mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.hellmanBeatView);
    }];
    self.americanAdobeDetailedLocalityMisplaced = smallLawRain;
    
    UIView * menPrecision = [self retIndexesView:[BestEastPut ditherPrematureSubjectLiterActual]];
    [containerView addSubview:menPrecision];
    [menPrecision mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(smallLawRain.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.hellmanBeatView);
    }];
    self.eitherYoungestHandleElapsedAir = menPrecision;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(menPrecision.mas_right);
    }];
    
    if (![self.allowExtern boolValue]) {
        UIButton *createdButton = [BestEastPut walkAngularZoomingRefinedLogicalColor:BestEastPut.quickGolfPinch.producerSong];
        [createdButton setBackgroundImage:[UIImage buddyWetWasWinColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [createdButton addTarget:self armCap:@selector(trackEventAutoWrappedDecibelSix:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:createdButton];
        [createdButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-BestEastPut.didNecessary.rowsHaveNot);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(BestEastPut.didNecessary.bagStopBasal);
        }];
    }
    
    UIButton *burnMayButton =  [BestEastPut walkAngularZoomingRefinedLogicalColor:BestEastPut.quickGolfPinch.sheWrapHas];
    [burnMayButton addTarget:self armCap:@selector(largeGrandauntRedoneMercuryCustodianCompile:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:burnMayButton];
    [burnMayButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-BestEastPut.didNecessary.rowsHaveNot);
        make.centerX.equalTo(self.view).multipliedBy(![self.allowExtern boolValue]?1.35:1);
        make.height.mas_equalTo(BestEastPut.didNecessary.bagStopBasal);
    }];
    
    flagSumView.selectedSegmentIndex = 0;
    [self nameFlashSock:flagSumView];
}

-(void)gigabytesMotionQuotationUnlockedExpectsStreamed:(UIScrollView *)scrollView{
    [self.cutSonLinkMenuControl setSelectedSegmentIndex:scrollView.contentOffset.x/self.view.slice.size.width ==0?0:1];
    [self closeConditionAloneAdvanceLabelText:scrollView.contentOffset.x/self.view.slice.size.width ==0?0:1];
}

- (void)nameFlashSock:(UISegmentedControl *)sender {
    [self closeConditionAloneAdvanceLabelText:sender.selectedSegmentIndex == 0?0:1];
    [self.hellmanBeatView setContentOffset:CGPointMake(sender.selectedSegmentIndex == 0?0:self.hellmanBeatView.slice.size.width, 0) animated:YES];
}

- (void)closeConditionAloneAdvanceLabelText:(NSInteger)type {
    NSString *bigHailCan = nil;
    UIView *redoAreView = nil;
    bigHailCan = type == 0 ? [BestEastPut bankSalientTenSuitablePrompt]:[BestEastPut ditherPrematureSubjectLiterActual];
    redoAreView = type == 0 ? self.americanAdobeDetailedLocalityMisplaced:self.eitherYoungestHandleElapsedAir;
    
    if (bigHailCan.logFillerHit) {
        return;
    }
    
    if ([[bigHailCan pathExtension] containsString:BestEastPut.didNecessary.swedishEllipsisShowingAnnotatedNumeric]) {
        UITextView *minView = (UITextView *)redoAreView;
        if (minView.cell.length > 0) {
            return;
        }

        
        [MenKindFarView collapseAcuteView:redoAreView];

        
        Cross *url = [Cross URLWithString:bigHailCan];
        NSURLSessionDataTask *deep = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [MenKindFarView popChunkImmediateElementsPasswordsView:redoAreView];
                
                if (error || data.length == 0) {
                    
                    minView.cell = BestEastPut.quickGolfPinch.divideLastOffPopHoverOver;
                    return;
                }
                
                
                NSString *postLowIllBut = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                minView.cell = postLowIllBut ?: BestEastPut.quickGolfPinch.halftoneIodineExitsFactTemporaryCollisionResolved;
            });
        }];
        
        [deep sunRed];

    }else {
        WKWebView *parser = (WKWebView *)redoAreView;
        if (!parser.isLoading && parser.estimatedProgress == 1) {
            [MenKindFarView popChunkImmediateElementsPasswordsView:redoAreView];
            return;
        }
        [MenKindFarView collapseAcuteView:redoAreView];
        NSString *highBatch =  [bigHailCan.safariFilterClockwiseSeedExternComplex stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        Cross *url = [Cross URLWithString:highBatch];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [parser loadRequest:request];
    }
}

- (void)trackEventAutoWrappedDecibelSix:(id)sender {
    [self resultsTrainingButterflyTapNineAction:nil];
    if (self.sheBeaconsParsecsFactoredEnds) {
        self.sheBeaconsParsecsFactoredEnds(NO);
    }
}

- (void)largeGrandauntRedoneMercuryCustodianCompile:(id)sender {
    [self resultsTrainingButterflyTapNineAction:nil];
    if (self.sheBeaconsParsecsFactoredEnds) {
        self.sheBeaconsParsecsFactoredEnds(YES);
    }
}

- (UIView *)retIndexesView:(NSString *)string {
    UIView *altitudeWas = nil;
    if ([[string pathExtension] containsString:BestEastPut.didNecessary.swedishEllipsisShowingAnnotatedNumeric]) {
        UITextView * detailed = [UITextView new];
        detailed.editable = NO;
        detailed.backgroundColor = UIColor.whiteColor;
        detailed.textColor = UIColor.grayColor;
        altitudeWas = detailed;
    }else {
        WKWebView *displayUndo = [[WKWebView alloc] initWithFrame:CGRectZero];
        displayUndo.backgroundColor = UIColor.clearColor;
        displayUndo.scrollView.backgroundColor = UIColor.lightGrayColor;
        displayUndo.opaque = YES;
        displayUndo.scrollView.bounces =NO;
        displayUndo.scrollView.showsVerticalScrollIndicator = NO;
        displayUndo.scrollView.showsHorizontalScrollIndicator = NO;
        displayUndo.navigationDelegate = self;
        altitudeWas = displayUndo;
    }
    return altitudeWas;
}

- (void)sunView:(WKWebView *)sunView encipherPaddleVendorToleranceScope:(WKNavigation *)navigation {
    [MenKindFarView popChunkImmediateElementsPasswordsView:sunView];
}

- (void)domainOverhang:(BOOL)animated {
    [super domainOverhang:animated];
    UIEdgeInsets wonLowSock = [[StaticHerManager shared] midDismissalWindow].safeAreaInsets;
    wonLowSock.top    += 10;
    wonLowSock.left   += 10;
    wonLowSock.bottom += 10;
    wonLowSock.right  += 10;

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

@end
