






#import "HelpPostalHairViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+FinalFast.h"
#import "NSString+SawShotAuto.h"

@interface HelpPostalHairViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *rollAsleepPoolControl;
@property (nonatomic, strong) UIView * lemmaDividerGenreMaintainPoster;
@property (nonatomic, strong) UIView * contextsRandomBackKeyDecoder;

@property (nonatomic, strong) UIScrollView * reusableAllView;

@end

@implementation HelpPostalHairViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.retMileItsButton.hidden = YES;
    self.satisfiedButton.hidden = YES;
    
    UISegmentedControl *sawMakeView = [[UISegmentedControl alloc] initWithItems:@[BounceBrief.airDigitSobSee.readableRowPortraitsSwedishRootThat,BounceBrief.airDigitSobSee.binSpatialDisableSnapLowThirteen]];
    sawMakeView.layer.masksToBounds = YES; 
    sawMakeView.layer.cornerRadius = 2;    
    [sawMakeView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BounceBrief randomIllColor]} forState:UIControlStateSelected];
    [sawMakeView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BounceBrief randomIllColor]} forState:UIControlStateNormal];
    [self.view addSubview:sawMakeView];
    [sawMakeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(BounceBrief.cropSobCanon.thinGetSalt);
    }];
    [sawMakeView addTarget:self action:@selector(keyboardBlood:) forControlEvents:UIControlEventValueChanged];
    self.rollAsleepPoolControl = sawMakeView;
    
    _reusableAllView = [[UIScrollView alloc]init];
    _reusableAllView.pagingEnabled = YES;
    _reusableAllView.delegate = self;
    [self.view addSubview:_reusableAllView];
    [_reusableAllView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(BounceBrief.cropSobCanon.errorFaceNap);
        make.right.equalTo(self.view).offset(-BounceBrief.cropSobCanon.errorFaceNap);
        make.top.equalTo(self.view).offset(BounceBrief.cropSobCanon.modifyLength);
        make.bottom.equalTo(self.view).offset(-BounceBrief.cropSobCanon.sodiumHourly);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.reusableAllView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.reusableAllView);
        make.height.equalTo(_reusableAllView);
    }];
    
    UIView * countTimeYet = [self tryEditSixView:[BounceBrief nodeSpouseCancelsTooEntry]];
    [containerView addSubview:countTimeYet];
    [countTimeYet mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.reusableAllView);
    }];
    self.lemmaDividerGenreMaintainPoster = countTimeYet;
    
    UIView * armenianSalt = [self tryEditSixView:[BounceBrief passwordsSaturatedHeartUnderlineBuddy]];
    [containerView addSubview:armenianSalt];
    [armenianSalt mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(countTimeYet.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.reusableAllView);
    }];
    self.contextsRandomBackKeyDecoder = armenianSalt;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(armenianSalt.mas_right);
    }];
    
    if (![self.netMetadata boolValue]) {
        UIButton *acquireButton = [BounceBrief followHoursWristSecondCaseColor:BounceBrief.airDigitSobSee.liftStormAnd];
        [acquireButton setBackgroundImage:[UIImage civilDueTabTipColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [acquireButton addTarget:self action:@selector(bendPassivelyDroppedMapExclusionMusic:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:acquireButton];
        [acquireButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-BounceBrief.cropSobCanon.disabledFit);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(BounceBrief.cropSobCanon.artSpaString);
        }];
    }
    
    UIButton *rainKeyButton =  [BounceBrief followHoursWristSecondCaseColor:BounceBrief.airDigitSobSee.bitItsDeep];
    [rainKeyButton addTarget:self action:@selector(sayLawWinAgeStationWater:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:rainKeyButton];
    [rainKeyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-BounceBrief.cropSobCanon.disabledFit);
        make.centerX.equalTo(self.view).multipliedBy(![self.netMetadata boolValue]?1.35:1);
        make.height.mas_equalTo(BounceBrief.cropSobCanon.artSpaString);
    }];
    
    sawMakeView.selectedSegmentIndex = 0;
    [self keyboardBlood:sawMakeView];
}

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

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

- (void)pubAccountDoneSlantShrinkText:(NSInteger)type {
    NSString *airGetMole = nil;
    UIView *contentView = nil;
    airGetMole = type == 0 ? [BounceBrief nodeSpouseCancelsTooEntry]:[BounceBrief passwordsSaturatedHeartUnderlineBuddy];
    contentView = type == 0 ? self.lemmaDividerGenreMaintainPoster:self.contextsRandomBackKeyDecoder;
    
    if (airGetMole.showReversed) {
        return;
    }
    
    if ([[airGetMole pathExtension] containsString:BounceBrief.cropSobCanon.profileBlusteryLeftExcludedArtery]) {
        UITextView *sunView = (UITextView *)contentView;
        if (sunView.text.length > 0) {
            return;
        }

        
        [MeterBrandView pagerInactiveView:contentView];

        
        NSURL *url = [NSURL URLWithString:airGetMole];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [MeterBrandView barsThroughInfiniteOrdinalSexView:contentView];
                
                if (error || data.length == 0) {
                    
                    sunView.text = BounceBrief.airDigitSobSee.nordicTryFoodExistentItalicSign;
                    return;
                }
                
                
                NSString *indianLiteral = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                sunView.text = indianLiteral ?: BounceBrief.airDigitSobSee.revisionsLettersRealmBankTerminalGaspVector;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *gopher = (WKWebView *)contentView;
        if (!gopher.isLoading && gopher.estimatedProgress == 1) {
            [MeterBrandView barsThroughInfiniteOrdinalSexView:contentView];
            return;
        }
        [MeterBrandView pagerInactiveView:contentView];
        NSString *undoTotal =  [airGetMole.jobProcessorWayMarginsMultipleReuse stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:undoTotal];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [gopher loadRequest:request];
    }
}

- (void)bendPassivelyDroppedMapExclusionMusic:(id)sender {
    [self handledFarPreventsArbitraryVitalityAction:nil];
    if (self.firstJustAbortPresentedAspect) {
        self.firstJustAbortPresentedAspect(NO);
    }
}

- (void)sayLawWinAgeStationWater:(id)sender {
    [self handledFarPreventsArbitraryVitalityAction:nil];
    if (self.firstJustAbortPresentedAspect) {
        self.firstJustAbortPresentedAspect(YES);
    }
}

- (UIView *)tryEditSixView:(NSString *)string {
    UIView *metricsWord = nil;
    if ([[string pathExtension] containsString:BounceBrief.cropSobCanon.profileBlusteryLeftExcludedArtery]) {
        UITextView * warnOnce = [UITextView new];
        warnOnce.editable = NO;
        warnOnce.backgroundColor = UIColor.whiteColor;
        warnOnce.textColor = UIColor.grayColor;
        metricsWord = warnOnce;
    }else {
        WKWebView *viewLargest = [[WKWebView alloc] initWithFrame:CGRectZero];
        viewLargest.backgroundColor = UIColor.clearColor;
        viewLargest.scrollView.backgroundColor = UIColor.lightGrayColor;
        viewLargest.opaque = YES;
        viewLargest.scrollView.bounces =NO;
        viewLargest.scrollView.showsVerticalScrollIndicator = NO;
        viewLargest.scrollView.showsHorizontalScrollIndicator = NO;
        viewLargest.navigationDelegate = self;
        metricsWord = viewLargest;
    }
    return metricsWord;
}

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

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

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

@end
