






#import "PaceFadeSpringViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Magnesium.h"
#import "NSString+PlaceOnline.h"

@interface PaceFadeSpringViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *femaleSymbolicControl;
@property (nonatomic, strong) UIView * gaussianIndexedPagerDoubleChanging;
@property (nonatomic, strong) UIView * coulombsRetExtraStampMetabolic;

@property (nonatomic, strong) UIScrollView * fatSystolicView;

@end

@implementation PaceFadeSpringViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.golfRawSumButton.hidden = YES;
    self.itsPickerButton.hidden = YES;
    
    UISegmentedControl *failingView = [[UISegmentedControl alloc] initWithItems:@[RowGivenOut.nineHisSoloTen.renewedExecutingPullDolbyDiscreteAppend,RowGivenOut.nineHisSoloTen.contentsSlashedRearrangeQuietEnhancedObserver]];
    failingView.layer.masksToBounds = YES; 
    failingView.layer.cornerRadius = 2;    
    [failingView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RowGivenOut drainBackColor]} forState:UIControlStateSelected];
    [failingView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RowGivenOut drainBackColor]} forState:UIControlStateNormal];
    [self.view addSubview:failingView];
    [failingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(RowGivenOut.mathProxyKin.identitySix);
    }];
    [failingView addTarget:self action:@selector(didMenFlowNet:) forControlEvents:UIControlEventValueChanged];
    self.femaleSymbolicControl = failingView;
    
    _fatSystolicView = [[UIScrollView alloc]init];
    _fatSystolicView.pagingEnabled = YES;
    _fatSystolicView.delegate = self;
    [self.view addSubview:_fatSystolicView];
    [_fatSystolicView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(RowGivenOut.mathProxyKin.automaticDay);
        make.right.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.automaticDay);
        make.top.equalTo(self.view).offset(RowGivenOut.mathProxyKin.saySnowRound);
        make.bottom.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.moreElements);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.fatSystolicView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.fatSystolicView);
        make.height.equalTo(_fatSystolicView);
    }];
    
    UIView * pingDeltaBag = [self whoHostAirView:[RowGivenOut redTenQuantityAmpereArm]];
    [containerView addSubview:pingDeltaBag];
    [pingDeltaBag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.fatSystolicView);
    }];
    self.gaussianIndexedPagerDoubleChanging = pingDeltaBag;
    
    UIView * usedTabWrong = [self whoHostAirView:[RowGivenOut returnDeltaUtteranceOpacityPerson]];
    [containerView addSubview:usedTabWrong];
    [usedTabWrong mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(pingDeltaBag.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.fatSystolicView);
    }];
    self.coulombsRetExtraStampMetabolic = usedTabWrong;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(usedTabWrong.mas_right);
    }];
    
    if (![self.schoolUnify boolValue]) {
        UIButton *closureButton = [RowGivenOut moreCutoffGuestSecondRedefinedColor:RowGivenOut.nineHisSoloTen.afterFlipSpa];
        [closureButton setBackgroundImage:[UIImage causeHintLeaveColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [closureButton addTarget:self action:@selector(seekEmergencyFrontSkippedRealCanceling:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:closureButton];
        
        [closureButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.theReminder);
            make.left.equalTo(self.view).offset(RowGivenOut.mathProxyKin.automaticDay);
            make.right.equalTo(self.view.mas_centerX).offset(-RowGivenOut.mathProxyKin.theSumThick);
            make.height.mas_equalTo(RowGivenOut.mathProxyKin.audibleTotal);
        }];
    }

    UIButton *dueKnowButton =  [RowGivenOut moreCutoffGuestSecondRedefinedColor:RowGivenOut.nineHisSoloTen.peakDidOur];
    [dueKnowButton addTarget:self action:@selector(headRemovableRedirectConsoleSoftnessWriting:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:dueKnowButton];
    BOOL buildButton = ![self.schoolUnify boolValue];
    [dueKnowButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.theReminder);
        make.right.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.automaticDay);
        
        if (buildButton) {
            make.left.equalTo(self.view.mas_centerX).offset(RowGivenOut.mathProxyKin.theSumThick);
        } else {
            make.left.equalTo(self.view).offset(RowGivenOut.mathProxyKin.automaticDay);
        }
        make.height.mas_equalTo(RowGivenOut.mathProxyKin.audibleTotal);
    }];
    
    failingView.selectedSegmentIndex = 0;
    [self didMenFlowNet:failingView];
}

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

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

- (void)observingBroadcastWillCutKindText:(NSInteger)type {
    NSString *withinUser = nil;
    UIView *contentView = nil;
    withinUser = type == 0 ? [RowGivenOut redTenQuantityAmpereArm]:[RowGivenOut returnDeltaUtteranceOpacityPerson];
    contentView = type == 0 ? self.gaussianIndexedPagerDoubleChanging:self.coulombsRetExtraStampMetabolic;
    
    if (withinUser.hindiDecimal) {
        return;
    }
    
    if ([[withinUser pathExtension] containsString:RowGivenOut.mathProxyKin.entropyPossibleInternalRoleTap]) {
        UITextView *redView = (UITextView *)contentView;
        if (redView.text.length > 0) {
            return;
        }

        
        [OutWetFactView valueCoercionView:contentView];

        
        NSURL *url = [NSURL URLWithString:withinUser];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [OutWetFactView americanNetscapeSaturatedVitalRomanianView:contentView];
                
                if (error || data.length == 0) {
                    
                    redView.text = RowGivenOut.nineHisSoloTen.hundredEnclosingOperatingEldestDiscardExpensive;
                    return;
                }
                
                
                NSString *outMoveMaySay = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                redView.text = outMoveMaySay ?: RowGivenOut.nineHisSoloTen.takeArmpitParseBehaveNoneOddReturning;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *affine = (WKWebView *)contentView;
        if (!affine.isLoading && affine.estimatedProgress == 1) {
            [OutWetFactView americanNetscapeSaturatedVitalRomanianView:contentView];
            return;
        }
        [OutWetFactView valueCoercionView:contentView];
        NSString *pastHertz =  [withinUser.mayOnceDarwinQueryDisposeKannada stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:pastHertz];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [affine loadRequest:request];
    }
}

- (void)seekEmergencyFrontSkippedRealCanceling:(id)sender {
    [self publishAbovePrefersIdleFetchAction:nil];
    if (self.renameExclusiveProtocolsSpeakersBevel) {
        self.renameExclusiveProtocolsSpeakersBevel(NO);
    }
}

- (void)headRemovableRedirectConsoleSoftnessWriting:(id)sender {
    [self publishAbovePrefersIdleFetchAction:nil];
    if (self.renameExclusiveProtocolsSpeakersBevel) {
        self.renameExclusiveProtocolsSpeakersBevel(YES);
    }
}

- (UIView *)whoHostAirView:(NSString *)string {
    UIView *urgencyJust = nil;
    if ([[string pathExtension] containsString:RowGivenOut.mathProxyKin.entropyPossibleInternalRoleTap]) {
        UITextView * verySort = [UITextView new];
        verySort.editable = NO;
        verySort.backgroundColor = UIColor.whiteColor;
        verySort.textColor = UIColor.grayColor;
        urgencyJust = verySort;
    }else {
        WKWebView *cubeAxesMan = [[WKWebView alloc] initWithFrame:CGRectZero];
        cubeAxesMan.backgroundColor = UIColor.clearColor;
        cubeAxesMan.scrollView.backgroundColor = UIColor.lightGrayColor;
        cubeAxesMan.opaque = YES;
        cubeAxesMan.scrollView.bounces =NO;
        cubeAxesMan.scrollView.showsVerticalScrollIndicator = NO;
        cubeAxesMan.scrollView.showsHorizontalScrollIndicator = NO;
        cubeAxesMan.navigationDelegate = self;
        urgencyJust = cubeAxesMan;
    }
    return urgencyJust;
}

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

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

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

@end
