






#import "AudiencesLeapStarModalFactoredViewController.h"
#import "HailAlertViewController.h"
#import "RepeatsRunAlpineUrgentUnlockCell.h"

@interface AudiencesLeapStarModalFactoredViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *serbianTiedUnpluggedDeciliterAgeView;

@property (nonatomic, strong) UIView *strongOptView;

@property (nonatomic, strong) UITableView *busCancelsView;


@property (nonatomic, assign) BOOL deferringIcyMidFloatMonth;

@property (nonatomic, weak) id footersProduce;

@property (nonatomic, strong) NSMutableArray *givenParticleArray;

@property (nonatomic, strong) NSMutableArray *readJoinArray;

@property (nonatomic, strong) UIButton *manyEyeHerButton;
@property (nonatomic, strong) UIButton *recordVoiceButton;

@end

@implementation AudiencesLeapStarModalFactoredViewController

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

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

- (void)setDeferringIcyMidFloatMonth:(BOOL)deferringIcyMidFloatMonth {
    
    _deferringIcyMidFloatMonth = deferringIcyMidFloatMonth;
    
    _readJoinArray = deferringIcyMidFloatMonth ? _givenParticleArray : [NSMutableArray arrayWithObject:_footersProduce];
    
    [self.busCancelsView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!deferringIcyMidFloatMonth ? WetDoneFill.artSensitive.recycleEarly : self.readJoinArray.count > 3 ? 3 * WetDoneFill.artSensitive.recycleEarly  : self.readJoinArray.count * WetDoneFill.artSensitive.recycleEarly);
    }];
    
    self.busCancelsView.scrollEnabled = deferringIcyMidFloatMonth;
    
    [self.busCancelsView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.busCancelsView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _givenParticleArray = [[WetDoneFill exclusionLabeledHerDisplaysNecessary] mutableCopy];
    
    _footersProduce = _givenParticleArray.firstObject;
    
    [self lappishWaxDitherShutterFractions];
    
    self.deferringIcyMidFloatMonth = NO;
}

- (void)lappishWaxDitherShutterFractions {
    
    _serbianTiedUnpluggedDeciliterAgeView = [[UIView alloc] init];
    _serbianTiedUnpluggedDeciliterAgeView.backgroundColor = UIColor.whiteColor;
    _serbianTiedUnpluggedDeciliterAgeView.layer.cornerRadius = 2;
    [self.view addSubview:_serbianTiedUnpluggedDeciliterAgeView];
    [self.view sendSubviewToBack:_serbianTiedUnpluggedDeciliterAgeView];
    [_serbianTiedUnpluggedDeciliterAgeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([WetDoneFill elderHowAddCanadianInviteWaySize]);
    }];
    
    
    UIView *strongOptView = [WetDoneFill strongOptView];
    [self.view addSubview:strongOptView];
    self.strongOptView = strongOptView;
    [strongOptView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(WetDoneFill.artSensitive.dueLawInside);
        make.height.mas_equalTo(WetDoneFill.artSensitive.roleLaterThe);
        make.left.equalTo(self.sentSlideButton.mas_right);
        make.right.equalTo(self.familyStayButton.mas_left);
    }];
    
    
    _busCancelsView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _busCancelsView.backgroundColor = [UIColor whiteColor];
    _busCancelsView.layer.masksToBounds = YES;
    _busCancelsView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _busCancelsView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _busCancelsView.layer.borderColor = [WetDoneFill scrollHasColor].CGColor;
    _busCancelsView.layer.borderWidth = 0.6;
    _busCancelsView.layer.cornerRadius = 2;
    _busCancelsView.rowHeight = WetDoneFill.artSensitive.recycleEarly;
    _busCancelsView.delegate = self;
    _busCancelsView.dataSource = self;
    [_busCancelsView registerClass:[RepeatsRunAlpineUrgentUnlockCell class] forCellReuseIdentifier:NSStringFromClass(RepeatsRunAlpineUrgentUnlockCell.class)];
    [self.view addSubview:_busCancelsView];
    [self.busCancelsView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.strongOptView.mas_bottom).offset(WetDoneFill.artSensitive.dueLawInside);
        make.left.equalTo(self.serbianTiedUnpluggedDeciliterAgeView).offset(WetDoneFill.artSensitive.flipWhoCocoa);
        make.right.equalTo(self.serbianTiedUnpluggedDeciliterAgeView).offset(-WetDoneFill.artSensitive.flipWhoCocoa);
        make.height.mas_equalTo(WetDoneFill.artSensitive.recycleEarly);
    }];
    
    
    self.manyEyeHerButton = [WetDoneFill timeBeaconBatchExposuresLappish:WetDoneFill.wideHostLooper.freeSexTailPeriodicYou];
    [self.manyEyeHerButton addTarget:self action:@selector(emptyTrashCountryLexicalSensorClangAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.serbianTiedUnpluggedDeciliterAgeView addSubview:self.manyEyeHerButton];
    [self.manyEyeHerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.serbianTiedUnpluggedDeciliterAgeView).offset(-WetDoneFill.artSensitive.dueLawInside);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.recordVoiceButton = [WetDoneFill takeBendReachableResultsDatumColor:WetDoneFill.wideHostLooper.spectralWon];
    [self.recordVoiceButton addTarget:self action:@selector(menMergeNoticeChamberAngularAdd:) forControlEvents:UIControlEventTouchUpInside];
    [self.serbianTiedUnpluggedDeciliterAgeView addSubview:self.recordVoiceButton];
    [self.recordVoiceButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.manyEyeHerButton.mas_top).offset(-WetDoneFill.artSensitive.browsingBusy);
        make.left.right.equalTo(self.busCancelsView);
        make.height.mas_equalTo(WetDoneFill.artSensitive.hailCapacity);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    RepeatsRunAlpineUrgentUnlockCell *lose = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(RepeatsRunAlpineUrgentUnlockCell.class) forIndexPath:indexPath];
    NSArray *halfDrop = _readJoinArray[indexPath.row];
    
    lose.sumPowerName.text = halfDrop[0];
    
    lose.tapPanLastView.image = [[UIImage regionsScriptClearEarEllipseName:halfDrop[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    lose.youPlayThatTime.text = [NSString stringWithFormat:@"%@ %@",WetDoneFill.wideHostLooper.aboutArmBadBetweenFoundTime,[self requestAreDisappearSpouseFlatnessReduceTime:[halfDrop[2] doubleValue]]];
    
    lose.accessoryType = self.deferringIcyMidFloatMonth ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return lose;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id halfDrop = _readJoinArray[indexPath.row];
        
        [_readJoinArray removeObject:halfDrop];
        
        [_givenParticleArray removeObject:halfDrop];
        
        if ([self.notHerFoldOld respondsToSelector:@selector(utilitiesRelationsSuccessRestingStepperFitName:completion:)]) {
            [self.notHerFoldOld utilitiesRelationsSuccessRestingStepperFitName:halfDrop[0] completion:^(id object) {
                
            }];
        }
        
        if(_givenParticleArray.count > 0){
            
            _readJoinArray = _givenParticleArray;
            _footersProduce = _readJoinArray.firstObject;
            self.deferringIcyMidFloatMonth = YES;
            
        }
    }
}


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

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

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


- (void)emptyTrashCountryLexicalSensorClangAction:(UIButton *)sender {
    HailAlertViewController *copyrightGrow = [HailAlertViewController new];
    copyrightGrow.notHerFoldOld = self.notHerFoldOld;
    [self.navigationController pushViewController:copyrightGrow animated:NO];
}

- (void)menMergeNoticeChamberAngularAdd:(UIButton *)sender {
    if ([self.notHerFoldOld respondsToSelector:@selector(matrixTrackingDraftDecodeEarQuotationTabName:completion:)]) {
        [WristInferView willNapAndTheWindow];
        [self.notHerFoldOld matrixTrackingDraftDecodeEarQuotationTabName:self.footersProduce[0] completion:^(id object) {
            [WristInferView abortMenuImageQuantizeHoursWindow];
        }];
    }
}


- (NSString *)requestAreDisappearSpouseFlatnessReduceTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double limitOptTime = now - beTime;
    NSString * portBoxPlus;
    
    NSDate * hexDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * law = [[NSDateFormatter alloc] init];
    [law setDateFormat:@"HH:mm"];
    NSString * golfBed = [law stringFromDate:hexDate];
    
    [law setDateFormat:@"dd"];
    NSString * become = [law stringFromDate:[NSDate date]];
    NSString * sinkRet = [law stringFromDate:hexDate];
    
    if (limitOptTime < 60) {
        portBoxPlus = WetDoneFill.wideHostLooper.hexRankSigma;
    }else if (limitOptTime < 60 * 60) {
        portBoxPlus = [NSString stringWithFormat:@"%ld%@",(long)limitOptTime / 60, WetDoneFill.wideHostLooper.mobileDescendAnimatedCallingWrestling];
    }else if(limitOptTime < 24 * 60 * 60 && [become integerValue] == [sinkRet integerValue]){
        portBoxPlus = [NSString stringWithFormat:@"%@ %@",WetDoneFill.wideHostLooper.awayIssuer,golfBed];
    }else if(limitOptTime < 24 * 60 * 60 * 2 && [become integerValue] != [sinkRet integerValue]){
        if ([become integerValue] - [sinkRet integerValue] == 1 || ([sinkRet integerValue] - [become integerValue] > 10 && [become integerValue] == 1)) {
            portBoxPlus = [NSString stringWithFormat:@"%@ %@",WetDoneFill.wideHostLooper.seedCutHomeFix,golfBed];
        }else{
            [law setDateFormat:@"MM-dd HH:mm"];
            portBoxPlus = [law stringFromDate:hexDate];
        }
    }else if(limitOptTime < 24 * 60 * 60 * 365){
        [law setDateFormat:@"MM-dd HH:mm"];
        portBoxPlus = [law stringFromDate:hexDate];
    }else{
        [law setDateFormat:@"yyyy-MM-dd HH:mm"];
        portBoxPlus = [law stringFromDate:hexDate];
    }
    return portBoxPlus;
}

@end
