






#import "LawLawInterHexViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+DrumVowel.h"
#import "NSString+DecibelDone.h"

@interface LawLawInterHexViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *personBiometryControl;
@property (nonatomic, strong) UIView * adverbPickOverflowCatMotion;
@property (nonatomic, strong) UIView * observingChangeBrandNetworkBox;

@property (nonatomic, strong) UIScrollView * rowsPurposeView;

@end

@implementation LawLawInterHexViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sendPinUseButton.hidden = YES;
    self.retRetainButton.hidden = YES;
    
    UISegmentedControl *sayRearView = [[UISegmentedControl alloc] initWithItems:@[TooCloudSun.methodCaseItem.solidHyphenMiddleChallengeFifteenWet,TooCloudSun.methodCaseItem.opaqueMapWonFilmTicketsImmediate]];
    sayRearView.layer.masksToBounds = YES; 
    sayRearView.layer.cornerRadius = 2;    
    [sayRearView setTitleTextAttributes:@{NSForegroundColorAttributeName:[TooCloudSun semicolonColor]} forState:UIControlStateSelected];
    [sayRearView setTitleTextAttributes:@{NSForegroundColorAttributeName:[TooCloudSun semicolonColor]} forState:UIControlStateNormal];
    [self.view addSubview:sayRearView];
    [sayRearView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(TooCloudSun.seeFocusSlab.serviceBody);
    }];
    [sayRearView addTarget:self action:@selector(treeKitBagTop:) forControlEvents:UIControlEventValueChanged];
    self.personBiometryControl = sayRearView;
    
    _rowsPurposeView = [[UIScrollView alloc]init];
    _rowsPurposeView.pagingEnabled = YES;
    _rowsPurposeView.delegate = self;
    [self.view addSubview:_rowsPurposeView];
    [_rowsPurposeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(TooCloudSun.seeFocusSlab.obstacleOnce);
        make.right.equalTo(self.view).offset(-TooCloudSun.seeFocusSlab.obstacleOnce);
        make.top.equalTo(self.view).offset(TooCloudSun.seeFocusSlab.napWhoCutter);
        make.bottom.equalTo(self.view).offset(-TooCloudSun.seeFocusSlab.permanentRed);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.rowsPurposeView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.rowsPurposeView);
        make.height.equalTo(_rowsPurposeView);
    }];
    
    UIView * socketSunBad = [self windowsAirView:[TooCloudSun wakeDescribeEngineMoireButterfly]];
    [containerView addSubview:socketSunBad];
    [socketSunBad mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.rowsPurposeView);
    }];
    self.adverbPickOverflowCatMotion = socketSunBad;
    
    UIView * notIcelandic = [self windowsAirView:[TooCloudSun tintCollectorMisplacedStillRet]];
    [containerView addSubview:notIcelandic];
    [notIcelandic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(socketSunBad.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.rowsPurposeView);
    }];
    self.observingChangeBrandNetworkBox = notIcelandic;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(notIcelandic.mas_right);
    }];
    
    if (![self.tablePanFor boolValue]) {
        UIButton *hueCallButton = [TooCloudSun mouthExtentsLettishSquaresMonotonicColor:TooCloudSun.methodCaseItem.acceptAllYet];
        [hueCallButton setBackgroundImage:[UIImage raiseHisIcyTheColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [hueCallButton addTarget:self action:@selector(tropicalMostReportPintScrollBound:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:hueCallButton];
        
        [hueCallButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-TooCloudSun.seeFocusSlab.didLiftJoin);
            make.left.equalTo(self.view).offset(TooCloudSun.seeFocusSlab.obstacleOnce);
            make.right.equalTo(self.view.mas_centerX).offset(-TooCloudSun.seeFocusSlab.tagsRefresh);
            make.height.mas_equalTo(TooCloudSun.seeFocusSlab.rawUnfocused);
        }];
    }

    UIButton *upscaleButton =  [TooCloudSun mouthExtentsLettishSquaresMonotonicColor:TooCloudSun.methodCaseItem.oddToolTen];
    [upscaleButton addTarget:self action:@selector(barrierAltimeterEstimateWonStableDecoding:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:upscaleButton];
    BOOL pasteButton = ![self.tablePanFor boolValue];
    [upscaleButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-TooCloudSun.seeFocusSlab.didLiftJoin);
        make.right.equalTo(self.view).offset(-TooCloudSun.seeFocusSlab.obstacleOnce);
        
        if (pasteButton) {
            make.left.equalTo(self.view.mas_centerX).offset(TooCloudSun.seeFocusSlab.tagsRefresh);
        } else {
            make.left.equalTo(self.view).offset(TooCloudSun.seeFocusSlab.obstacleOnce);
        }
        make.height.mas_equalTo(TooCloudSun.seeFocusSlab.rawUnfocused);
    }];
    
    sayRearView.selectedSegmentIndex = 0;
    [self treeKitBagTop:sayRearView];
}

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

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

- (void)scannerCentralsFiveTransposeCommandText:(NSInteger)type {
    NSString *floorRoman = nil;
    UIView *contentView = nil;
    floorRoman = type == 0 ? [TooCloudSun wakeDescribeEngineMoireButterfly]:[TooCloudSun tintCollectorMisplacedStillRet];
    contentView = type == 0 ? self.adverbPickOverflowCatMotion:self.observingChangeBrandNetworkBox;
    
    if (floorRoman.voiceFooters) {
        return;
    }
    
    if ([[floorRoman pathExtension] containsString:TooCloudSun.seeFocusSlab.comparePreviewsAbortedFlatnessCreamy]) {
        UITextView *catView = (UITextView *)contentView;
        if (catView.text.length > 0) {
            return;
        }

        
        [DogButtonsView hitOutPushWonView:contentView];

        
        NSURL *url = [NSURL URLWithString:floorRoman];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [DogButtonsView hurricaneGigabytesPickSpecifiedPaddleView:contentView];
                
                if (error || data.length == 0) {
                    
                    catView.text = TooCloudSun.methodCaseItem.jouleEndFactActualShortcutNautical;
                    return;
                }
                
                
                NSString *beganEvictPub = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                catView.text = beganEvictPub ?: TooCloudSun.methodCaseItem.symbolKitBoundHybridBirthGregorianLost;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *sumCap = (WKWebView *)contentView;
        if (!sumCap.isLoading && sumCap.estimatedProgress == 1) {
            [DogButtonsView hurricaneGigabytesPickSpecifiedPaddleView:contentView];
            return;
        }
        [DogButtonsView hitOutPushWonView:contentView];
        NSString *createHue =  [floorRoman.featuredNearestPencilClipUnderlineUse stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:createHue];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [sumCap loadRequest:request];
    }
}

- (void)tropicalMostReportPintScrollBound:(id)sender {
    [self pipeUpperSortingLifetimeTransposeAction:nil];
    if (self.gracefulObservePlanHourHusband) {
        self.gracefulObservePlanHourHusband(NO);
    }
}

- (void)barrierAltimeterEstimateWonStableDecoding:(id)sender {
    [self pipeUpperSortingLifetimeTransposeAction:nil];
    if (self.gracefulObservePlanHourHusband) {
        self.gracefulObservePlanHourHusband(YES);
    }
}

- (UIView *)windowsAirView:(NSString *)string {
    UIView *semanticFax = nil;
    if ([[string pathExtension] containsString:TooCloudSun.seeFocusSlab.comparePreviewsAbortedFlatnessCreamy]) {
        UITextView * rainNear = [UITextView new];
        rainNear.editable = NO;
        rainNear.backgroundColor = UIColor.whiteColor;
        rainNear.textColor = UIColor.grayColor;
        semanticFax = rainNear;
    }else {
        WKWebView *earRollDraw = [[WKWebView alloc] initWithFrame:CGRectZero];
        earRollDraw.backgroundColor = UIColor.clearColor;
        earRollDraw.scrollView.backgroundColor = UIColor.lightGrayColor;
        earRollDraw.opaque = YES;
        earRollDraw.scrollView.bounces =NO;
        earRollDraw.scrollView.showsVerticalScrollIndicator = NO;
        earRollDraw.scrollView.showsHorizontalScrollIndicator = NO;
        earRollDraw.navigationDelegate = self;
        semanticFax = earRollDraw;
    }
    return semanticFax;
}

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

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

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

@end
