






#import "ReceivesFollowViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+ReloadPan.h"
#import "NSString+WaySettling.h"

@interface ReceivesFollowViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *subgroupMediumControl;
@property (nonatomic, strong) UIView * receiverInnerOwnerSheVisit;
@property (nonatomic, strong) UIView * reusableCreditsDigitFixRebus;

@property (nonatomic, strong) UIScrollView * walkWaitAddView;

@end

@implementation ReceivesFollowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sawPageWonButton.hidden = YES;
    self.sheLittleButton.hidden = YES;
    
    UISegmentedControl *kannadaView = [[UISegmentedControl alloc] initWithItems:@[BurstPetite.setupScheduled.fingerScatteredDetachPluralNepaliWaist,BurstPetite.setupScheduled.askLaunchedWinTableSmileOwnership]];
    kannadaView.layer.masksToBounds = YES; 
    kannadaView.layer.cornerRadius = 2;    
    [kannadaView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BurstPetite finalTurnColor]} forState:UIControlStateSelected];
    [kannadaView setTitleTextAttributes:@{NSForegroundColorAttributeName:[BurstPetite finalTurnColor]} forState:UIControlStateNormal];
    [self.view addSubview:kannadaView];
    [kannadaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(BurstPetite.virtualSheet.boxRoleBack);
    }];
    [kannadaView addTarget:self action:@selector(cubicBoundBed:) forControlEvents:UIControlEventValueChanged];
    self.subgroupMediumControl = kannadaView;
    
    _walkWaitAddView = [[UIScrollView alloc]init];
    _walkWaitAddView.pagingEnabled = YES;
    _walkWaitAddView.delegate = self;
    [self.view addSubview:_walkWaitAddView];
    [_walkWaitAddView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(BurstPetite.virtualSheet.playShapeMap);
        make.right.equalTo(self.view).offset(-BurstPetite.virtualSheet.playShapeMap);
        make.top.equalTo(self.view).offset(BurstPetite.virtualSheet.millibarsGet);
        make.bottom.equalTo(self.view).offset(-BurstPetite.virtualSheet.chatPriorRaw);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.walkWaitAddView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.walkWaitAddView);
        make.height.equalTo(_walkWaitAddView);
    }];
    
    UIView * editEmptyNet = [self ourFlowMapView:[BurstPetite masterSplatUbiquityEjectRange]];
    [containerView addSubview:editEmptyNet];
    [editEmptyNet mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.walkWaitAddView);
    }];
    self.receiverInnerOwnerSheVisit = editEmptyNet;
    
    UIView * mapObservers = [self ourFlowMapView:[BurstPetite russianLoseAverageBagInsertion]];
    [containerView addSubview:mapObservers];
    [mapObservers mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(editEmptyNet.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.walkWaitAddView);
    }];
    self.reusableCreditsDigitFixRebus = mapObservers;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(mapObservers.mas_right);
    }];
    
    if (![self.forTiedRows boolValue]) {
        UIButton *anotherButton = [BurstPetite paragraphPicturePositionHisSumColor:BurstPetite.setupScheduled.clientNearby];
        [anotherButton setBackgroundImage:[UIImage reverseReturnsColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [anotherButton addTarget:self action:@selector(squareFunctionsMutePagerDecoderPinch:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:anotherButton];
        
        [anotherButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-BurstPetite.virtualSheet.moveHandled);
            make.left.equalTo(self.view).offset(BurstPetite.virtualSheet.playShapeMap);
            make.right.equalTo(self.view.mas_centerX).offset(-BurstPetite.virtualSheet.partGeneral);
            make.height.mas_equalTo(BurstPetite.virtualSheet.airAuthority);
        }];
    }

    UIButton *fitnessButton =  [BurstPetite paragraphPicturePositionHisSumColor:BurstPetite.setupScheduled.slashLevel];
    [fitnessButton addTarget:self action:@selector(decryptSayDigitAssistiveMegahertzDisables:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:fitnessButton];
    BOOL stairButton = ![self.forTiedRows boolValue];
    [fitnessButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-BurstPetite.virtualSheet.moveHandled);
        make.right.equalTo(self.view).offset(-BurstPetite.virtualSheet.playShapeMap);
        
        if (stairButton) {
            make.left.equalTo(self.view.mas_centerX).offset(BurstPetite.virtualSheet.partGeneral);
        } else {
            make.left.equalTo(self.view).offset(BurstPetite.virtualSheet.playShapeMap);
        }
        make.height.mas_equalTo(BurstPetite.virtualSheet.airAuthority);
    }];
    
    kannadaView.selectedSegmentIndex = 0;
    [self cubicBoundBed:kannadaView];
}

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

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

- (void)fixingControlsPrintedProximityColleagueText:(NSInteger)type {
    NSString *costDueUse = nil;
    UIView *contentView = nil;
    costDueUse = type == 0 ? [BurstPetite masterSplatUbiquityEjectRange]:[BurstPetite russianLoseAverageBagInsertion];
    contentView = type == 0 ? self.receiverInnerOwnerSheVisit:self.reusableCreditsDigitFixRebus;
    
    if (costDueUse.napTapExpect) {
        return;
    }
    
    if ([[costDueUse pathExtension] containsString:BurstPetite.virtualSheet.genderImpliedJustModeDebugging]) {
        UITextView *tapView = (UITextView *)contentView;
        if (tapView.text.length > 0) {
            return;
        }

        
        [OnceMidSeeView textualBrokenView:contentView];

        
        NSURL *url = [NSURL URLWithString:costDueUse];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [OnceMidSeeView menstrualSelectorsModifiedBracketSourceView:contentView];
                
                if (error || data.length == 0) {
                    
                    tapView.text = BurstPetite.setupScheduled.loopAllHourSunAwakeMolar;
                    return;
                }
                
                
                NSString *sensorTrusted = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                tapView.text = sensorTrusted ?: BurstPetite.setupScheduled.walkInfoTailOuncesSenderDeleteBlock;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *winFax = (WKWebView *)contentView;
        if (!winFax.isLoading && winFax.estimatedProgress == 1) {
            [OnceMidSeeView menstrualSelectorsModifiedBracketSourceView:contentView];
            return;
        }
        [OnceMidSeeView textualBrokenView:contentView];
        NSString *bitSodium =  [costDueUse.mayWhoBookmarkSedentaryEnumerateVendor stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:bitSodium];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [winFax loadRequest:request];
    }
}

- (void)squareFunctionsMutePagerDecoderPinch:(id)sender {
    [self recipientEyeSilencedEnumerateThinAction:nil];
    if (self.retainNegativePinListenerDomains) {
        self.retainNegativePinListenerDomains(NO);
    }
}

- (void)decryptSayDigitAssistiveMegahertzDisables:(id)sender {
    [self recipientEyeSilencedEnumerateThinAction:nil];
    if (self.retainNegativePinListenerDomains) {
        self.retainNegativePinListenerDomains(YES);
    }
}

- (UIView *)ourFlowMapView:(NSString *)string {
    UIView *vortexAllow = nil;
    if ([[string pathExtension] containsString:BurstPetite.virtualSheet.genderImpliedJustModeDebugging]) {
        UITextView * ourReady = [UITextView new];
        ourReady.editable = NO;
        ourReady.backgroundColor = UIColor.whiteColor;
        ourReady.textColor = UIColor.grayColor;
        vortexAllow = ourReady;
    }else {
        WKWebView *freeFunPick = [[WKWebView alloc] initWithFrame:CGRectZero];
        freeFunPick.backgroundColor = UIColor.clearColor;
        freeFunPick.scrollView.backgroundColor = UIColor.lightGrayColor;
        freeFunPick.opaque = YES;
        freeFunPick.scrollView.bounces =NO;
        freeFunPick.scrollView.showsVerticalScrollIndicator = NO;
        freeFunPick.scrollView.showsHorizontalScrollIndicator = NO;
        freeFunPick.navigationDelegate = self;
        vortexAllow = freeFunPick;
    }
    return vortexAllow;
}

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

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

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

@end
