






#import "RestBlockDirectorDogMapViewController.h"
#import "TooAppearViewController.h"
#import "FailingPauseNominalEasyDistinctCell.h"

@interface RestBlockDirectorDogMapViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UIView *committedSayPrintedBuildBankView;

@property (nonatomic, strong) UIView *oneScalarView;

@property (nonatomic, strong) UITableView *resizeLoopView;


@property (nonatomic, assign) BOOL birthTokenDetectionCustomRoute;

@property (nonatomic, weak) id runDidAlertRow;

@property (nonatomic, strong) NSMutableArray *usedConstantsArray;

@property (nonatomic, strong) NSMutableArray *beginYouArray;

@property (nonatomic, strong) UIButton *bigDelayedButton;
@property (nonatomic, strong) UIButton *additiveOddButton;

@end

@implementation RestBlockDirectorDogMapViewController

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

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

- (void)setBirthTokenDetectionCustomRoute:(BOOL)birthTokenDetectionCustomRoute {
    
    _birthTokenDetectionCustomRoute = birthTokenDetectionCustomRoute;
    
    _beginYouArray = birthTokenDetectionCustomRoute ? _usedConstantsArray : [NSMutableArray arrayWithObject:_runDidAlertRow];
    
    [self.resizeLoopView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(!birthTokenDetectionCustomRoute ? ButPhonetic.ditheredFast.heartbeatSix : self.beginYouArray.count > 3 ? 3 * ButPhonetic.ditheredFast.heartbeatSix  : self.beginYouArray.count * ButPhonetic.ditheredFast.heartbeatSix);
    }];
    
    self.resizeLoopView.scrollEnabled = birthTokenDetectionCustomRoute;
    
    [self.resizeLoopView reloadData];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.002 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.resizeLoopView setContentOffset:CGPointMake(0, 0) animated:NO];
    });
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.clearColor;
    
    _usedConstantsArray = [[ButPhonetic rootCostAliveInsertionChapter] mutableCopy];
    
    _runDidAlertRow = _usedConstantsArray.firstObject;
    
    [self mouthBlurPortalReloadReason];
    
    self.birthTokenDetectionCustomRoute = NO;
}

- (void)mouthBlurPortalReloadReason {
    
    _committedSayPrintedBuildBankView = [[UIView alloc] init];
    _committedSayPrintedBuildBankView.backgroundColor = UIColor.whiteColor;
    _committedSayPrintedBuildBankView.layer.cornerRadius = 2;
    [self.view addSubview:_committedSayPrintedBuildBankView];
    [self.view sendSubviewToBack:_committedSayPrintedBuildBankView];
    [_committedSayPrintedBuildBankView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view);
        make.centerX.equalTo(self.view);
        make.size.mas_equalTo([ButPhonetic uplinkWorkspaceSendClickedLongerLawSize]);
    }];
    
    
    UIView *oneScalarView = [ButPhonetic oneScalarView];
    [self.view addSubview:oneScalarView];
    self.oneScalarView = oneScalarView;
    [oneScalarView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(ButPhonetic.ditheredFast.caretFaceSpa);
        make.height.mas_equalTo(ButPhonetic.ditheredFast.pageEnabling);
        make.left.equalTo(self.areShadowButton.mas_right);
        make.right.equalTo(self.crossClampButton.mas_left);
    }];
    
    
    _resizeLoopView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
    _resizeLoopView.backgroundColor = [UIColor whiteColor];
    _resizeLoopView.layer.masksToBounds = YES;
    _resizeLoopView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
    _resizeLoopView.separatorColor = [UIColor systemGroupedBackgroundColor];
    _resizeLoopView.layer.borderColor = [ButPhonetic sonLegacyColor].CGColor;
    _resizeLoopView.layer.borderWidth = 0.6;
    _resizeLoopView.layer.cornerRadius = 2;
    _resizeLoopView.rowHeight = ButPhonetic.ditheredFast.heartbeatSix;
    _resizeLoopView.delegate = self;
    _resizeLoopView.dataSource = self;
    [_resizeLoopView registerClass:[FailingPauseNominalEasyDistinctCell class] forCellReuseIdentifier:NSStringFromClass(FailingPauseNominalEasyDistinctCell.class)];
    [self.view addSubview:_resizeLoopView];
    [self.resizeLoopView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.oneScalarView.mas_bottom).offset(ButPhonetic.ditheredFast.caretFaceSpa);
        make.left.equalTo(self.committedSayPrintedBuildBankView).offset(ButPhonetic.ditheredFast.lockRowChain);
        make.right.equalTo(self.committedSayPrintedBuildBankView).offset(-ButPhonetic.ditheredFast.lockRowChain);
        make.height.mas_equalTo(ButPhonetic.ditheredFast.heartbeatSix);
    }];
    
    
    self.bigDelayedButton = [ButPhonetic oldestTiedLookDuplexPipe:ButPhonetic.snowTabWhoDrum.allowableCroppingSexEarlierResting];
    [self.bigDelayedButton addTarget:self action:@selector(describesMakeTransferMapSexChatAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.committedSayPrintedBuildBankView addSubview:self.bigDelayedButton];
    [self.bigDelayedButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.committedSayPrintedBuildBankView).offset(-ButPhonetic.ditheredFast.caretFaceSpa);
        make.centerX.equalTo(self.view);
    }];
    
    
    self.additiveOddButton = [ButPhonetic maximumYearsVoiceEscapePrecisionColor:ButPhonetic.snowTabWhoDrum.earCanceled];
    [self.additiveOddButton addTarget:self action:@selector(quarterSwipeWorldCurlBodySoft:) forControlEvents:UIControlEventTouchUpInside];
    [self.committedSayPrintedBuildBankView addSubview:self.additiveOddButton];
    [self.additiveOddButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.bigDelayedButton.mas_top).offset(-ButPhonetic.ditheredFast.barrierStair);
        make.left.right.equalTo(self.resizeLoopView);
        make.height.mas_equalTo(ButPhonetic.ditheredFast.gramTableFat);
    }];
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    FailingPauseNominalEasyDistinctCell *rest = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(FailingPauseNominalEasyDistinctCell.class) forIndexPath:indexPath];
    NSArray *learnTop = _beginYouArray[indexPath.row];
    
    rest.callbackName.text = learnTop[0];
    
    rest.primaryOwnView.image = [[UIImage healthProvidedMillibarsOperatingDividerName:learnTop[1]] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
    
    rest.keyStreamedTime.text = [NSString stringWithFormat:@"%@ %@",ButPhonetic.snowTabWhoDrum.speakingMoodFilmTransposeBeenTime,[self originsHelloOldSemicolonAlbumConditionTime:[learnTop[2] doubleValue]]];
    
    rest.accessoryType = self.birthTokenDetectionCustomRoute ? UITableViewCellAccessoryNone :  UITableViewCellAccessoryDisclosureIndicator;
    
    return rest;
}

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


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

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

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        
        id learnTop = _beginYouArray[indexPath.row];
        
        [_beginYouArray removeObject:learnTop];
        
        [_usedConstantsArray removeObject:learnTop];
        
        if ([self.lowWinWarpBut respondsToSelector:@selector(armMiddleSurrogateTintEsperantoInfoName:completion:)]) {
            [self.lowWinWarpBut armMiddleSurrogateTintEsperantoInfoName:learnTop[0] completion:^(id object) {
                
            }];
        }
        
        if(_usedConstantsArray.count > 0){
            
            _beginYouArray = _usedConstantsArray;
            _runDidAlertRow = _beginYouArray.firstObject;
            self.birthTokenDetectionCustomRoute = YES;
            
        }
    }
}


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

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

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


- (void)describesMakeTransferMapSexChatAction:(UIButton *)sender {
    TooAppearViewController *briefIronSkip = [TooAppearViewController new];
    briefIronSkip.lowWinWarpBut = self.lowWinWarpBut;
    [self.navigationController pushViewController:briefIronSkip animated:NO];
}

- (void)quarterSwipeWorldCurlBodySoft:(UIButton *)sender {
    if ([self.lowWinWarpBut respondsToSelector:@selector(trialRearFireInterlaceDeprecateRankNeverName:completion:)]) {
        [HallOldestView proximityMealWindow];
        [self.lowWinWarpBut trialRearFireInterlaceDeprecateRankNeverName:self.runDidAlertRow[0] completion:^(id object) {
            [HallOldestView tryReclaimHertzThirteenCupWindow];
        }];
    }
}


- (NSString *)originsHelloOldSemicolonAlbumConditionTime:(double)beTime {
    
    NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
    double joinRootTime = now - beTime;
    NSString * hostBoldCat;
    
    NSDate * hueDate = [NSDate dateWithTimeIntervalSince1970:beTime];
    NSDateFormatter * kit = [[NSDateFormatter alloc] init];
    [kit setDateFormat:@"HH:mm"];
    NSString * certTap = [kit stringFromDate:hueDate];
    
    [kit setDateFormat:@"dd"];
    NSString * better = [kit stringFromDate:[NSDate date]];
    NSString * sobRows = [kit stringFromDate:hueDate];
    
    if (joinRootTime < 60) {
        hostBoldCat = ButPhonetic.snowTabWhoDrum.foggyAcquire;
    }else if (joinRootTime < 60 * 60) {
        hostBoldCat = [NSString stringWithFormat:@"%ld%@",(long)joinRootTime / 60, ButPhonetic.snowTabWhoDrum.midDarkSuggestedMealMid];
    }else if(joinRootTime < 24 * 60 * 60 && [better integerValue] == [sobRows integerValue]){
        hostBoldCat = [NSString stringWithFormat:@"%@ %@",ButPhonetic.snowTabWhoDrum.scoreSound,certTap];
    }else if(joinRootTime < 24 * 60 * 60 * 2 && [better integerValue] != [sobRows integerValue]){
        if ([better integerValue] - [sobRows integerValue] == 1 || ([sobRows integerValue] - [better integerValue] > 10 && [better integerValue] == 1)) {
            hostBoldCat = [NSString stringWithFormat:@"%@ %@",ButPhonetic.snowTabWhoDrum.calorieDefines,certTap];
        }else{
            [kit setDateFormat:@"MM-dd HH:mm"];
            hostBoldCat = [kit stringFromDate:hueDate];
        }
    }else if(joinRootTime < 24 * 60 * 60 * 365){
        [kit setDateFormat:@"MM-dd HH:mm"];
        hostBoldCat = [kit stringFromDate:hueDate];
    }else{
        [kit setDateFormat:@"yyyy-MM-dd HH:mm"];
        hostBoldCat = [kit stringFromDate:hueDate];
    }
    return hostBoldCat;
}

@end
