






#import "MenTrustSawAnyViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+LayerPair.h"
#import "NSString+NameMissing.h"

@interface MenTrustSawAnyViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *cupKeepOptZoomControl;
@property (nonatomic, strong) UIView * prepRelayFlushedBelowPeople;
@property (nonatomic, strong) UIView * ensureFlexibleFeedbackNominallyNumeric;

@property (nonatomic, strong) UIScrollView * tildeNegateView;

@end

@implementation MenTrustSawAnyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.ringRemoveButton.hidden = YES;
    self.cellTraitButton.hidden = YES;
    
    UISegmentedControl *licenseView = [[UISegmentedControl alloc] initWithItems:@[CityPublish.throughHosting.barTooShelfAdjustingEveryPhase,CityPublish.throughHosting.misplacedDividerLaunchingScalingTruncateStartup]];
    licenseView.layer.masksToBounds = YES; 
    licenseView.layer.cornerRadius = 2;    
    [licenseView setTitleTextAttributes:@{NSForegroundColorAttributeName:[CityPublish audioRestColor]} forState:UIControlStateSelected];
    [licenseView setTitleTextAttributes:@{NSForegroundColorAttributeName:[CityPublish audioRestColor]} forState:UIControlStateNormal];
    [self.view addSubview:licenseView];
    [licenseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(CityPublish.halfInferCan.logPoolLine);
    }];
    [licenseView addTarget:self action:@selector(terahertzTemp:) forControlEvents:UIControlEventValueChanged];
    self.cupKeepOptZoomControl = licenseView;
    
    _tildeNegateView = [[UIScrollView alloc]init];
    _tildeNegateView.pagingEnabled = YES;
    _tildeNegateView.delegate = self;
    [self.view addSubview:_tildeNegateView];
    [_tildeNegateView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(CityPublish.halfInferCan.animateStore);
        make.right.equalTo(self.view).offset(-CityPublish.halfInferCan.animateStore);
        make.top.equalTo(self.view).offset(CityPublish.halfInferCan.privacyTitle);
        make.bottom.equalTo(self.view).offset(-CityPublish.halfInferCan.helpSawSolid);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.tildeNegateView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.tildeNegateView);
        make.height.equalTo(_tildeNegateView);
    }];
    
    UIView * middleWidget = [self rawLightenView:[CityPublish icyRowsInvokePreparingCanonical]];
    [containerView addSubview:middleWidget];
    [middleWidget mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.tildeNegateView);
    }];
    self.prepRelayFlushedBelowPeople = middleWidget;
    
    UIView * nineteenTail = [self rawLightenView:[CityPublish busGatheringAnyModeSort]];
    [containerView addSubview:nineteenTail];
    [nineteenTail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(middleWidget.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.tildeNegateView);
    }];
    self.ensureFlexibleFeedbackNominallyNumeric = nineteenTail;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(nineteenTail.mas_right);
    }];
    
    if (![self.arrowSunSex boolValue]) {
        UIButton *encryptButton = [CityPublish segmentGeometricTripleOldestZoomColor:CityPublish.throughHosting.findDiscover];
        [encryptButton setBackgroundImage:[UIImage priorityDecideColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [encryptButton addTarget:self action:@selector(elapsedSafariDocumentPutOnlyExplicit:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:encryptButton];
        [encryptButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-CityPublish.halfInferCan.focusEyeWon);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(CityPublish.halfInferCan.dryFileSpine);
        }];
    }
    
    UIButton *rematchButton =  [CityPublish segmentGeometricTripleOldestZoomColor:CityPublish.throughHosting.farSubBoth];
    [rematchButton addTarget:self action:@selector(releasedCycleNetscapeVerifyTropicalFun:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:rematchButton];
    [rematchButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-CityPublish.halfInferCan.focusEyeWon);
        make.centerX.equalTo(self.view).multipliedBy(![self.arrowSunSex boolValue]?1.35:1);
        make.height.mas_equalTo(CityPublish.halfInferCan.dryFileSpine);
    }];
    
    licenseView.selectedSegmentIndex = 0;
    [self terahertzTemp:licenseView];
}

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

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

- (void)bandJumpSentFourteenOfferText:(NSInteger)type {
    NSString *capSuchCar = nil;
    UIView *contentView = nil;
    capSuchCar = type == 0 ? [CityPublish icyRowsInvokePreparingCanonical]:[CityPublish busGatheringAnyModeSort];
    contentView = type == 0 ? self.prepRelayFlushedBelowPeople:self.ensureFlexibleFeedbackNominallyNumeric;
    
    if (capSuchCar.multipleUses) {
        return;
    }
    
    if ([[capSuchCar pathExtension] containsString:CityPublish.halfInferCan.lawWeightsHindiButSimple]) {
        UITextView *tryView = (UITextView *)contentView;
        if (tryView.text.length > 0) {
            return;
        }

        
        [AreSnapCatView schemesRadialView:contentView];

        
        NSURL *url = [NSURL URLWithString:capSuchCar];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [AreSnapCatView allAgentHurricaneBitCollectView:contentView];
                
                if (error || data.length == 0) {
                    
                    tryView.text = CityPublish.throughHosting.removeOurEndFilenameAffiliateStreamed;
                    return;
                }
                
                
                NSString *eggExpiredMay = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                tryView.text = eggExpiredMay ?: CityPublish.throughHosting.butPauseSmallestHeadDisplaysFixEcho;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *runKey = (WKWebView *)contentView;
        if (!runKey.isLoading && runKey.estimatedProgress == 1) {
            [AreSnapCatView allAgentHurricaneBitCollectView:contentView];
            return;
        }
        [AreSnapCatView schemesRadialView:contentView];
        NSString *movieGray =  [capSuchCar.parallelHangPanelMisplacedAgeOutside stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:movieGray];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [runKey loadRequest:request];
    }
}

- (void)elapsedSafariDocumentPutOnlyExplicit:(id)sender {
    [self nibblesParentalPathSubIntervalsAction:nil];
    if (self.reviewVolumeListenProtectedOunces) {
        self.reviewVolumeListenProtectedOunces(NO);
    }
}

- (void)releasedCycleNetscapeVerifyTropicalFun:(id)sender {
    [self nibblesParentalPathSubIntervalsAction:nil];
    if (self.reviewVolumeListenProtectedOunces) {
        self.reviewVolumeListenProtectedOunces(YES);
    }
}

- (UIView *)rawLightenView:(NSString *)string {
    UIView *sockVeryTap = nil;
    if ([[string pathExtension] containsString:CityPublish.halfInferCan.lawWeightsHindiButSimple]) {
        UITextView * heavySun = [UITextView new];
        heavySun.editable = NO;
        heavySun.backgroundColor = UIColor.whiteColor;
        heavySun.textColor = UIColor.grayColor;
        sockVeryTap = heavySun;
    }else {
        WKWebView *allBusMount = [[WKWebView alloc] initWithFrame:CGRectZero];
        allBusMount.backgroundColor = UIColor.clearColor;
        allBusMount.scrollView.backgroundColor = UIColor.lightGrayColor;
        allBusMount.opaque = YES;
        allBusMount.scrollView.bounces =NO;
        allBusMount.scrollView.showsVerticalScrollIndicator = NO;
        allBusMount.scrollView.showsHorizontalScrollIndicator = NO;
        allBusMount.navigationDelegate = self;
        sockVeryTap = allBusMount;
    }
    return sockVeryTap;
}

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

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

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

@end
