






#import "PortFitEastMaxViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Strongest.h"
#import "NSString+FeatLimited.h"

@interface PortFitEastMaxViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *logFeetOutRuleControl;
@property (nonatomic, strong) UIView * anonymousReachedSpecifyPhoneticFit;
@property (nonatomic, strong) UIView * betterPresentedLettishEyeValidity;

@property (nonatomic, strong) UIScrollView * extraBagSpaView;

@end

@implementation PortFitEastMaxViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.libraryFarButton.hidden = YES;
    self.clearLoveButton.hidden = YES;
    
    UISegmentedControl *weightsView = [[UISegmentedControl alloc] initWithItems:@[ClaimMaxBig.allFeedEarGolf.grandauntDueChangingHallMinCookie,ClaimMaxBig.allFeedEarGolf.themeSecondConductorSnowPurchasedGenerates]];
    weightsView.layer.masksToBounds = YES; 
    weightsView.layer.cornerRadius = 2;    
    [weightsView setTitleTextAttributes:@{NSForegroundColorAttributeName:[ClaimMaxBig nineSlideColor]} forState:UIControlStateSelected];
    [weightsView setTitleTextAttributes:@{NSForegroundColorAttributeName:[ClaimMaxBig nineSlideColor]} forState:UIControlStateNormal];
    [self.view addSubview:weightsView];
    [weightsView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(ClaimMaxBig.applierPatch.penPeriodic);
    }];
    [weightsView addTarget:self action:@selector(threePackStep:) forControlEvents:UIControlEventValueChanged];
    self.logFeetOutRuleControl = weightsView;
    
    _extraBagSpaView = [[UIScrollView alloc]init];
    _extraBagSpaView.pagingEnabled = YES;
    _extraBagSpaView.delegate = self;
    [self.view addSubview:_extraBagSpaView];
    [_extraBagSpaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(ClaimMaxBig.applierPatch.deferringOpt);
        make.right.equalTo(self.view).offset(-ClaimMaxBig.applierPatch.deferringOpt);
        make.top.equalTo(self.view).offset(ClaimMaxBig.applierPatch.oldFormInset);
        make.bottom.equalTo(self.view).offset(-ClaimMaxBig.applierPatch.loadDaughter);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.extraBagSpaView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.extraBagSpaView);
        make.height.equalTo(_extraBagSpaView);
    }];
    
    UIView * promisedBars = [self squareGrayView:[ClaimMaxBig icyUseAdaptiveChunkyChatter]];
    [containerView addSubview:promisedBars];
    [promisedBars mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.extraBagSpaView);
    }];
    self.anonymousReachedSpecifyPhoneticFit = promisedBars;
    
    UIView * northSpaReal = [self squareGrayView:[ClaimMaxBig geometryHintBitmapStackZoom]];
    [containerView addSubview:northSpaReal];
    [northSpaReal mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(promisedBars.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.extraBagSpaView);
    }];
    self.betterPresentedLettishEyeValidity = northSpaReal;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(northSpaReal.mas_right);
    }];
    
    if (![self.upscaleDays boolValue]) {
        UIButton *dogLeadButton = [ClaimMaxBig reportingOptionalNonceEquallyBreakingColor:ClaimMaxBig.allFeedEarGolf.nodeEraState];
        [dogLeadButton setBackgroundImage:[UIImage capturedReviewColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [dogLeadButton addTarget:self action:@selector(modifiedAcrossReservedBehaveUnwindSurge:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:dogLeadButton];
        [dogLeadButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-ClaimMaxBig.applierPatch.nameEyeRope);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(ClaimMaxBig.applierPatch.availButNine);
        }];
    }
    
    UIButton *muteWayButton =  [ClaimMaxBig reportingOptionalNonceEquallyBreakingColor:ClaimMaxBig.allFeedEarGolf.adjustsCan];
    [muteWayButton addTarget:self action:@selector(returnsTailSiblingsReportingMeteringDiscards:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:muteWayButton];
    [muteWayButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-ClaimMaxBig.applierPatch.nameEyeRope);
        make.centerX.equalTo(self.view).multipliedBy(![self.upscaleDays boolValue]?1.35:1);
        make.height.mas_equalTo(ClaimMaxBig.applierPatch.availButNine);
    }];
    
    weightsView.selectedSegmentIndex = 0;
    [self threePackStep:weightsView];
}

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

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

- (void)answerFixIdenticalRedoTrackText:(NSInteger)type {
    NSString *phoneMalay = nil;
    UIView *contentView = nil;
    phoneMalay = type == 0 ? [ClaimMaxBig icyUseAdaptiveChunkyChatter]:[ClaimMaxBig geometryHintBitmapStackZoom];
    contentView = type == 0 ? self.anonymousReachedSpecifyPhoneticFit:self.betterPresentedLettishEyeValidity;
    
    if (phoneMalay.hexStandBand) {
        return;
    }
    
    if ([[phoneMalay pathExtension] containsString:ClaimMaxBig.applierPatch.sayFractionsSpecifierAnonymousGrouped]) {
        UITextView *yetView = (UITextView *)contentView;
        if (yetView.text.length > 0) {
            return;
        }

        
        [TopAgeDrumView icyBayerSpineView:contentView];

        
        NSURL *url = [NSURL URLWithString:phoneMalay];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [TopAgeDrumView exponentQualifierKoreanVerboseAffectingView:contentView];
                
                if (error || data.length == 0) {
                    
                    yetView.text = ClaimMaxBig.allFeedEarGolf.loopReceiveTriggeredDarkCyclingCapture;
                    return;
                }
                
                
                NSString *towerLogExtra = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                yetView.text = towerLogExtra ?: ClaimMaxBig.allFeedEarGolf.pubStateBuddyObscuredModifyDefinedWrite;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *syntax = (WKWebView *)contentView;
        if (!syntax.isLoading && syntax.estimatedProgress == 1) {
            [TopAgeDrumView exponentQualifierKoreanVerboseAffectingView:contentView];
            return;
        }
        [TopAgeDrumView icyBayerSpineView:contentView];
        NSString *promotion =  [phoneMalay.logPersonalIndexMolarGeorgianEdga stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:promotion];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [syntax loadRequest:request];
    }
}

- (void)modifiedAcrossReservedBehaveUnwindSurge:(id)sender {
    [self uploadJouleSindhiGlobalSelectorAction:nil];
    if (self.bestDaysBigWaxLead) {
        self.bestDaysBigWaxLead(NO);
    }
}

- (void)returnsTailSiblingsReportingMeteringDiscards:(id)sender {
    [self uploadJouleSindhiGlobalSelectorAction:nil];
    if (self.bestDaysBigWaxLead) {
        self.bestDaysBigWaxLead(YES);
    }
}

- (UIView *)squareGrayView:(NSString *)string {
    UIView *pinArtsLast = nil;
    if ([[string pathExtension] containsString:ClaimMaxBig.applierPatch.sayFractionsSpecifierAnonymousGrouped]) {
        UITextView * bendBold = [UITextView new];
        bendBold.editable = NO;
        bendBold.backgroundColor = UIColor.whiteColor;
        bendBold.textColor = UIColor.grayColor;
        pinArtsLast = bendBold;
    }else {
        WKWebView *topLeakyTen = [[WKWebView alloc] initWithFrame:CGRectZero];
        topLeakyTen.backgroundColor = UIColor.clearColor;
        topLeakyTen.scrollView.backgroundColor = UIColor.lightGrayColor;
        topLeakyTen.opaque = YES;
        topLeakyTen.scrollView.bounces =NO;
        topLeakyTen.scrollView.showsVerticalScrollIndicator = NO;
        topLeakyTen.scrollView.showsHorizontalScrollIndicator = NO;
        topLeakyTen.navigationDelegate = self;
        pinArtsLast = topLeakyTen;
    }
    return pinArtsLast;
}

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

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

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

@end
