






#import "OnlyConvergedStartBloodImperialViewController.h"
#import "ResignForViewController.h"
#import "ForPlanIcyScalingCutCell.h"

@interface OnlyConvergedStartBloodImperialViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *eggNetChildIncrementCookiesView;

@property (nonatomic, strong) UIView *filterBagView;

@property (nonatomic, strong) UITableView *subCommentView;


@property (nonatomic, assign) BOOL kilobytesRecordSlovenianGivenPaper;

@property (nonatomic, weak) id predictedVital;

@property (nonatomic, strong) NSMutableArray *boldEggMenMapArray;

@property (nonatomic, strong) NSMutableArray *netMakerArray;

@property (nonatomic, strong) UIButton *centerMaskButton;
@property (nonatomic, strong) UIButton *stationRuleButton;

@end

@implementation OnlyConvergedStartBloodImperialViewController

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (_netMakerArray.count > 0 && self.kilobytesRecordSlovenianGivenPaper) {
        self.kilobytesRecordSlovenianGivenPaper = NO;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        CGFloat bottom = HisGeometry.sinkIcyLeaky.musicLookFit;
        make.centerX.equalTo(self.view.superview);
        make.centerY.equalTo(self.view.superview).offset(+bottom/2);
        make.height.mas_equalTo([HisGeometry genderAmbienceSlopeSixPhaseOrderSize].height+bottom);
        make.width.mas_equalTo([HisGeometry genderAmbienceSlopeSixPhaseOrderSize].width);
    }];
}

- (void)setKilobytesRecordSlovenianGivenPaper:(BOOL)kilobytesRecordSlovenianGivenPaper {
    
    _kilobytesRecordSlovenianGivenPaper = kilobytesRecordSlovenianGivenPaper;
    
    _netMakerArray = kilobytesRecordSlovenianGivenPaper ? _boldEggMenMapArray : [NSMutableArray arrayWithObject:_predictedVital];
    
    [self.subCommentView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!kilobytesRecordSlovenianGivenPaper ? HisGeometry.sinkIcyLeaky.catFlushPlug : self.netMakerArray.count > 3 ? 3 * HisGeometry.sinkIcyLeaky.catFlushPlug  : self.netMakerArray.count * HisGeometry.sinkIcyLeaky.catFlushPlug);
    }];
    
    self.subCommentView.scrollEnabled = kilobytesRecordSlovenianGivenPaper;
    
    [self.subCommentView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.subCommentView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _boldEggMenMapArray = [[HisGeometry browseListOverflowBackwardFind] mutableCopy];
    
    _predictedVital = _boldEggMenMapArray.firstObject;
    
    [self relayGoldenCovariantOppositeProfiles];
    
    self.kilobytesRecordSlovenianGivenPaper = NO;
}

- (void)relayGoldenCovariantOppositeProfiles {
    
    _eggNetChildIncrementCookiesView = [[UIView alloc] init];
    _eggNetChildIncrementCookiesView.backgroundColor = UIColor.whiteColor;
    _eggNetChildIncrementCookiesView.layer.cornerRadius = 2;
    [self.view addSubview:_eggNetChildIncrementCookiesView];
    [self.view sendSubviewToBack:_eggNetChildIncrementCookiesView];
    [_eggNetChildIncrementCookiesView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([HisGeometry genderAmbienceSlopeSixPhaseOrderSize]);
    }];
    
    
    UIView *filterBagView = [HisGeometry filterBagView];
    [self.view addSubview:filterBagView];
    self.filterBagView = filterBagView;
    [filterBagView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HisGeometry.sinkIcyLeaky.askDemandWas);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.fastRecorded);
        make.left.equalTo(self.barFusionButton.mas_right);
        make.right.equalTo(self.magicPieceButton.mas_left);
    }];
    
    
    _subCommentView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _subCommentView.backgroundColor = [UIColor whiteColor];
    _subCommentView.layer.masksToBounds = YES;
    _subCommentView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _subCommentView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _subCommentView.layer.borderColor = [HisGeometry schedulerColor].CGColor;
    _subCommentView.layer.borderWidth = 0.6;
    _subCommentView.layer.cornerRadius = 2;
    _subCommentView.rowHeight = HisGeometry.sinkIcyLeaky.catFlushPlug;
    _subCommentView.delegate = self;
    _subCommentView.dataSource = self;
    [_subCommentView registerClass:[ForPlanIcyScalingCutCell class] forCellReuseIdentifier:NSStringFromClass(ForPlanIcyScalingCutCell.class)];
    [self.view addSubview:_subCommentView];
    [self.subCommentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.filterBagView.mas_bottom).offset(HisGeometry.sinkIcyLeaky.askDemandWas);
        make.left.equalTo(self.eggNetChildIncrementCookiesView).offset(HisGeometry.sinkIcyLeaky.precisionUse);
        make.right.equalTo(self.eggNetChildIncrementCookiesView).offset(-HisGeometry.sinkIcyLeaky.precisionUse);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.catFlushPlug);
    }];
    
    
    self.centerMaskButton = [HisGeometry objectFallbackSplatBackupSound:HisGeometry.illLoudEarFlow.clipRelativeDatumPopEmbedding];
    [self.centerMaskButton addTarget:self action:@selector(secondaryFollowerSemicolonDemandUnlockInfinityAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.eggNetChildIncrementCookiesView addSubview:self.centerMaskButton];
    [self.centerMaskButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.eggNetChildIncrementCookiesView).offset(-HisGeometry.sinkIcyLeaky.askDemandWas);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.stationRuleButton = [HisGeometry momentaryQueryingTryExclusiveSamplingColor:HisGeometry.illLoudEarFlow.rollSiteFix];
    [self.stationRuleButton addTarget:self action:@selector(parserSoccerUpperOurFunnelBehaviors:) forControlEvents:UIControlEventTouchUpInside];
    [self.eggNetChildIncrementCookiesView addSubview:self.stationRuleButton];
    [self.stationRuleButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.centerMaskButton.mas_top).offset(-HisGeometry.sinkIcyLeaky.secretThread);
        make.left.right.equalTo(self.subCommentView);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.adjustsStamp);
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _netMakerArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ForPlanIcyScalingCutCell *thin = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(ForPlanIcyScalingCutCell.class) forIndexPath:indexPath];
    NSArray *plusDash = _netMakerArray[indexPath.row];
    
    thin.bondModeName.text = plusDash[0];
    
    thin.renewedAirView.image = [[UIImage kannadaScheduledCatalystManHandName:plusDash[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    thin.entropyMuteTime.text = [NSString stringWithFormat:@"%@ %@",HisGeometry.illLoudEarFlow.sinkFixWindowMayAcrossTime,[self parentFourZipDrawingCostDetectionTime:[plusDash[2] doubleValue]]];
    
    thin.accessoryType = self.kilobytesRecordSlovenianGivenPaper ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return thin;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    _predictedVital = _netMakerArray[indexPath.row];
    self.kilobytesRecordSlovenianGivenPaper = !self.kilobytesRecordSlovenianGivenPaper;
}


- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return self.kilobytesRecordSlovenianGivenPaper;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id plusDash = _netMakerArray[indexPath.row];
        
        [_netMakerArray removeObject:plusDash];
        
        [_boldEggMenMapArray removeObject:plusDash];
        
        if ([self.prefixDestroy respondsToSelector:@selector(roleDecodeGreekThemeStackSpeakersName:completion:)]) {
            [self.prefixDestroy roleDecodeGreekThemeStackSpeakersName:plusDash[0] completion:^(id object) {
                
            }];
        }
        
        if(_boldEggMenMapArray.count > 0){
            
            _netMakerArray = _boldEggMenMapArray;
            _predictedVital = _netMakerArray.firstObject;
            self.kilobytesRecordSlovenianGivenPaper = YES;
            
        }
    }
}


- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"Delete";
}

- (void)warnGigabitsWalkingGeometryFocused:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super warnGigabitsWalkingGeometryFocused:touches withEvent:event];
    self.kilobytesRecordSlovenianGivenPaper = NO;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    self.kilobytesRecordSlovenianGivenPaper = NO;
}


- (void)secondaryFollowerSemicolonDemandUnlockInfinityAction:(UIButton *)sender {
    ResignForViewController *stayKinAndSex = [ResignForViewController new];
    stayKinAndSex.prefixDestroy = self.prefixDestroy;
    [self.navigationController pushViewController:stayKinAndSex animated:NO];
}

- (void)parserSoccerUpperOurFunnelBehaviors:(UIButton *)sender {
    if ([self.prefixDestroy respondsToSelector:@selector(agePhysicalSeparateCutExistingTriggersWasName:completion:)]) {
        [OldestSnowView warpRawButIcyWindow];
        [self.prefixDestroy agePhysicalSeparateCutExistingTriggersWasName:self.predictedVital[0] completion:^(id object) {
            [OldestSnowView grantingOrangeStepperFitnessLatvianWindow];
        }];
    }
}


- (NSString *)parentFourZipDrawingCostDetectionTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double pushLossTime = now - beTime;
    NSString * sinAwayTall;
    
    NSDate * eraDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * two = [[NSDateFormatter alloc] init];
    [two setDateFormat:@"HH:mm"];
    NSString * dryYard = [two stringFromDate:eraDate];
    
    [two setDateFormat:@"dd"];
    NSString * global = [two stringFromDate:[NSDate date]];
    NSString * pinTree = [two stringFromDate:eraDate];
    
    if (pushLossTime < 60) {
        sinAwayTall = HisGeometry.illLoudEarFlow.titleBridged;
    }else if (pushLossTime < 60 * 60) {
        sinAwayTall = [NSString stringWithFormat:@"%ld%@",(long)pushLossTime / 60, HisGeometry.illLoudEarFlow.violationAssistantAboutShadowLazy];
    }else if(pushLossTime < 24 * 60 * 60 && [global integerValue] == [pinTree integerValue]){
        sinAwayTall = [NSString stringWithFormat:@"%@ %@",HisGeometry.illLoudEarFlow.hexSubTake,dryYard];
    }else if(pushLossTime < 24 * 60 * 60 * 2 && [global integerValue] != [pinTree integerValue]){
        if ([global integerValue] - [pinTree integerValue] == 1 || ([pinTree integerValue] - [global integerValue] > 10 && [global integerValue] == 1)) {
            sinAwayTall = [NSString stringWithFormat:@"%@ %@",HisGeometry.illLoudEarFlow.withinUsedHair,dryYard];
        }else{
            [two setDateFormat:@"MM-dd HH:mm"];
            sinAwayTall = [two stringFromDate:eraDate];
        }
    }else if(pushLossTime < 24 * 60 * 60 * 365){
        [two setDateFormat:@"MM-dd HH:mm"];
        sinAwayTall = [two stringFromDate:eraDate];
    }else{
        [two setDateFormat:@"yyyy-MM-dd HH:mm"];
        sinAwayTall = [two stringFromDate:eraDate];
    }
    return sinAwayTall;
}

@end
