






#import "SafeSayTenItemViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+Anonymous.h"
#import "NSString+ResourceSob.h"

@interface SafeSayTenItemViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *encodePressureControl;
@property (nonatomic, strong) UIView * punjabiInviteReadyDriveTags;
@property (nonatomic, strong) UIView * selfEditorialFetchedDestroyHigher;

@property (nonatomic, strong) UIScrollView * ordinaryOurView;

@end

@implementation SafeSayTenItemViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.cascadeNotButton.hidden = YES;
    self.markWristButton.hidden = YES;
    
    UISegmentedControl *longDayView = [[UISegmentedControl alloc] initWithItems:@[RuleListCut.costSonKnowKit.kitLatvianSenderNotCourseNotify,RuleListCut.costSonKnowKit.precisionImperialMonotonicNetSpaceTeacher]];
    longDayView.layer.masksToBounds = YES; 
    longDayView.layer.cornerRadius = 2;    
    [longDayView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RuleListCut slopeLockColor]} forState:UIControlStateSelected];
    [longDayView setTitleTextAttributes:@{NSForegroundColorAttributeName:[RuleListCut slopeLockColor]} forState:UIControlStateNormal];
    [self.view addSubview:longDayView];
    [longDayView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(RuleListCut.coloredDraft.rawTallSame);
    }];
    [longDayView addTarget:self action:@selector(logFiberClaim:) forControlEvents:UIControlEventValueChanged];
    self.encodePressureControl = longDayView;
    
    _ordinaryOurView = [[UIScrollView alloc]init];
    _ordinaryOurView.pagingEnabled = YES;
    _ordinaryOurView.delegate = self;
    [self.view addSubview:_ordinaryOurView];
    [_ordinaryOurView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(RuleListCut.coloredDraft.funOtherGolf);
        make.right.equalTo(self.view).offset(-RuleListCut.coloredDraft.funOtherGolf);
        make.top.equalTo(self.view).offset(RuleListCut.coloredDraft.idleVibrancy);
        make.bottom.equalTo(self.view).offset(-RuleListCut.coloredDraft.recordRepair);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.ordinaryOurView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.ordinaryOurView);
        make.height.equalTo(_ordinaryOurView);
    }];
    
    UIView * onlineDecide = [self trySawCaseView:[RuleListCut indexingDragArtEvaluatedDisplays]];
    [containerView addSubview:onlineDecide];
    [onlineDecide mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.ordinaryOurView);
    }];
    self.punjabiInviteReadyDriveTags = onlineDecide;
    
    UIView * dividingMain = [self trySawCaseView:[RuleListCut disablingCapHallRatingsSelected]];
    [containerView addSubview:dividingMain];
    [dividingMain mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(onlineDecide.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.ordinaryOurView);
    }];
    self.selfEditorialFetchedDestroyHigher = dividingMain;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(dividingMain.mas_right);
    }];
    
    if (![self.mostlyPlate boolValue]) {
        UIButton *outCubeButton = [RuleListCut nominallyObstacleUnchangedBlobHybridColor:RuleListCut.costSonKnowKit.didWhiteSort];
        [outCubeButton setBackgroundImage:[UIImage fitRunHoursAllColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [outCubeButton addTarget:self action:@selector(recordDecayReuseOperationKelvinWidget:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:outCubeButton];
        
        [outCubeButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-RuleListCut.coloredDraft.sequenceBin);
            make.left.equalTo(self.view).offset(RuleListCut.coloredDraft.funOtherGolf);
            make.right.equalTo(self.view.mas_centerX).offset(-RuleListCut.coloredDraft.asleepScene);
            make.height.mas_equalTo(RuleListCut.coloredDraft.youSideScene);
        }];
    }

    UIButton *waxLazyButton =  [RuleListCut nominallyObstacleUnchangedBlobHybridColor:RuleListCut.costSonKnowKit.tooTapFire];
    [waxLazyButton addTarget:self action:@selector(willSayCubeDegradedUtilityDark:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:waxLazyButton];
    BOOL rotorButton = ![self.mostlyPlate boolValue];
    [waxLazyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-RuleListCut.coloredDraft.sequenceBin);
        make.right.equalTo(self.view).offset(-RuleListCut.coloredDraft.funOtherGolf);
        
        if (rotorButton) {
            make.left.equalTo(self.view.mas_centerX).offset(RuleListCut.coloredDraft.asleepScene);
        } else {
            make.left.equalTo(self.view).offset(RuleListCut.coloredDraft.funOtherGolf);
        }
        make.height.mas_equalTo(RuleListCut.coloredDraft.youSideScene);
    }];
    
    longDayView.selectedSegmentIndex = 0;
    [self logFiberClaim:longDayView];
}

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

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

- (void)nanogramsScannerSpectralQueueUsesText:(NSInteger)type {
    NSString *coverDutch = nil;
    UIView *contentView = nil;
    coverDutch = type == 0 ? [RuleListCut indexingDragArtEvaluatedDisplays]:[RuleListCut disablingCapHallRatingsSelected];
    contentView = type == 0 ? self.punjabiInviteReadyDriveTags:self.selfEditorialFetchedDestroyHigher;
    
    if (coverDutch.faceBitChina) {
        return;
    }
    
    if ([[coverDutch pathExtension] containsString:RuleListCut.coloredDraft.thirdMiterDemandJobTwo]) {
        UITextView *badView = (UITextView *)contentView;
        if (badView.text.length > 0) {
            return;
        }

        
        [IllegalRedView winSuccessDayView:contentView];

        
        NSURL *url = [NSURL URLWithString:coverDutch];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [IllegalRedView existingRevokedReleasedCombineLoveView:contentView];
                
                if (error || data.length == 0) {
                    
                    badView.text = RuleListCut.costSonKnowKit.muteFillerEraSparseSensorAnimation;
                    return;
                }
                
                
                NSString *ropeDidTabLog = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                badView.text = ropeDidTabLog ?: RuleListCut.costSonKnowKit.changeEncryptGreatReportingEntriesFaceVersions;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *ownSon = (WKWebView *)contentView;
        if (!ownSon.isLoading && ownSon.estimatedProgress == 1) {
            [IllegalRedView existingRevokedReleasedCombineLoveView:contentView];
            return;
        }
        [IllegalRedView winSuccessDayView:contentView];
        NSString *angleSort =  [coverDutch.waterAppendingTeethRawValueCollapses stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:angleSort];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [ownSon loadRequest:request];
    }
}

- (void)recordDecayReuseOperationKelvinWidget:(id)sender {
    [self indentSlightRowBandAboutAction:nil];
    if (self.candidateSentinelEvictMonthBut) {
        self.candidateSentinelEvictMonthBut(NO);
    }
}

- (void)willSayCubeDegradedUtilityDark:(id)sender {
    [self indentSlightRowBandAboutAction:nil];
    if (self.candidateSentinelEvictMonthBut) {
        self.candidateSentinelEvictMonthBut(YES);
    }
}

- (UIView *)trySawCaseView:(NSString *)string {
    UIView *waterArtery = nil;
    if ([[string pathExtension] containsString:RuleListCut.coloredDraft.thirdMiterDemandJobTwo]) {
        UITextView * faceLose = [UITextView new];
        faceLose.editable = NO;
        faceLose.backgroundColor = UIColor.whiteColor;
        faceLose.textColor = UIColor.grayColor;
        waterArtery = faceLose;
    }else {
        WKWebView *sunDogWaist = [[WKWebView alloc] initWithFrame:CGRectZero];
        sunDogWaist.backgroundColor = UIColor.clearColor;
        sunDogWaist.scrollView.backgroundColor = UIColor.lightGrayColor;
        sunDogWaist.opaque = YES;
        sunDogWaist.scrollView.bounces =NO;
        sunDogWaist.scrollView.showsVerticalScrollIndicator = NO;
        sunDogWaist.scrollView.showsHorizontalScrollIndicator = NO;
        sunDogWaist.navigationDelegate = self;
        waterArtery = sunDogWaist;
    }
    return waterArtery;
}

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

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

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

@end
