






#import "UpperMonthViewController.h"
#import "OutDemandManager.h"
#import "NearFreeView.h"
#import "UIColor+BusColor.h"
#import "UIDevice+CutDevice.h"
#import "UIImage+FixImage.h"
#import "PersonFillConfig.h"

@interface UpperMonthViewController ()

@property (nonatomic, strong) UIView * betterView;
@property (nonatomic, strong) UIImageView * waxView;

@end

@implementation UpperMonthViewController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = SkinEchoMen.longerCondensedWhoDerivedFinishReported ? [UIColor cellMildStopControlsDegradedPan:SkinEchoMen.longerCondensedWhoDerivedFinishReported]:UIColor.whiteColor;

    self.groupedOpen = self.downhillHer;
    [NearFreeView treePolar];
    
    self.betterView = [UIView new];
    self.betterView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.betterView];
    
    self.waxView = [[UIImageView alloc] initWithImage:[UIImage intentIcelandicGaspSwipeBarName:SkinEchoMen.pauseKirghiz.mixMouthDecryptedReturnedTheNepali]];;
    [self.view addSubview:self.waxView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kilogramDown) name:SkinEchoMen.pauseKirghiz.twistBeatEyeFatColumnCut object:nil];
}

- (void)kilogramDown {
    [self.youWeighted reload];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self printableScoreLanguagesExpandedMan];
}

//- (void)viewDidAppear:(BOOL)animated {


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([SkinEchoMen bothAllergyMatchPreserveRetName] && PersonFillConfig.shared.sceneFurlongsProtectedTopMeal.cutEverySee.treePartner) {
        [NearFreeView offerBusy];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)waxMetricSobSize {
    if ([UIDevice didMix]) {
        return CGSizeMake(SkinEchoMen.collectUnlearnButBankGrandaunt, SkinEchoMen.collectUnlearnButBankGrandaunt);
    }
    UIWindow *mealPenWindow = [[OutDemandManager shared] headlineSentWindow];
    UIEdgeInsets safe = mealPenWindow.safeAreaInsets;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        if (![UIDevice moireOld]) {
            return CGSizeMake(UIScreen.mainScreen.bounds.size.width, SkinEchoMen.collectUnlearnButBankGrandaunt);
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, SkinEchoMen.collectUnlearnButBankGrandaunt + safe.bottom);
    }else {
        if (![UIDevice moireOld]) {
            return CGSizeMake(SkinEchoMen.collectUnlearnButBankGrandaunt,UIScreen.mainScreen.bounds.size.height);
        }
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            return CGSizeMake(SkinEchoMen.collectUnlearnButBankGrandaunt + safe.left,UIScreen.mainScreen.bounds.size.height);
        }else {
            return CGSizeMake(SkinEchoMen.collectUnlearnButBankGrandaunt + 5,UIScreen.mainScreen.bounds.size.height);
        }
    }
}

- (void)printableScoreLanguagesExpandedMan {
    UIWindow *mealPenWindow = [[OutDemandManager shared] headlineSentWindow];
    UIEdgeInsets safe = mealPenWindow.safeAreaInsets;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        
        if ([UIDevice didMix]) {
            self.betterView.layer.cornerRadius = 5.f;
            self.betterView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
        }
        [self.betterView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view.mas_top);
            make.left.right.equalTo(self.view);
            make.height.mas_equalTo(SkinEchoMen.pauseKirghiz.slovakFunDog);
        }];
        [self.waxView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.betterView.mas_top);
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(SkinEchoMen.pauseKirghiz.tightNumeric, SkinEchoMen.pauseKirghiz.degreePinArt));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.waxMetricSobSize);
        }];
        [self.youWeighted mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.height.mas_equalTo(SkinEchoMen.collectUnlearnButBankGrandaunt);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(0, self.waxMetricSobSize.height);
    }else {
        
        if ([UIDevice didMix]) {
            self.betterView.layer.cornerRadius = 5.f;
            self.betterView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
        }
        [self.betterView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.view.mas_right);
            make.top.bottom.equalTo(self.view);
            make.width.mas_equalTo(SkinEchoMen.pauseKirghiz.slovakFunDog);
        }];
        UIImage *sixSugarImage = [UIImage intentIcelandicGaspSwipeBarName:SkinEchoMen.pauseKirghiz.mixMouthDecryptedReturnedTheNepali];
        UIImage *tipSaltImage = [UIImage imageWithCGImage:sixSugarImage.CGImage
                                                    scale:sixSugarImage.scale
                                              orientation:UIImageOrientationRight]; 
        self.waxView.image = tipSaltImage;
        [self.waxView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.betterView.mas_right);
            make.centerY.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(SkinEchoMen.pauseKirghiz.degreePinArt, SkinEchoMen.pauseKirghiz.tightNumeric));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerY.left.mas_equalTo(0);
            make.size.mas_equalTo(self.waxMetricSobSize);
        }];
        [self.youWeighted mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(0);
            make.width.mas_equalTo(SkinEchoMen.collectUnlearnButBankGrandaunt);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(-self.waxMetricSobSize.width, 0);
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)napPostWaterCapBatch:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    turnOne(self);
    [super napPostWaterCapBatch:touches withEvent:event];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        [UIView animateWithDuration:0.3 animations:^{
            weakself.view.transform = CGAffineTransformMakeTranslation(0, weakself.waxMetricSobSize.height);;
        } completion:^(BOOL finished) {
            [[OutDemandManager shared] canceledAsleepPauseSheStalledCreationViewController:self.navigationController];
        }];
    }else {
        [UIView animateWithDuration:0.3 animations:^{
            self.view.transform = CGAffineTransformMakeTranslation(-weakself.waxMetricSobSize.width, 0);
        } completion:^(BOOL finished) {
            [[OutDemandManager shared] canceledAsleepPauseSheStalledCreationViewController:weakself.navigationController];
        }];
    }
}

@end
