






#import "ButOriginsViewController.h"
#import "AutoIntroManager.h"
#import "EngineerView.h"
#import "UIColor+FunColor.h"
#import "UIDevice+BoxDevice.h"
#import "UIImage+TooImage.h"
#import "WaxOlympusConfig.h"

@interface ButOriginsViewController ()

@property (nonatomic, strong) UIView * dayWaxView;
@property (nonatomic, strong) UIImageView * dogView;

@end

@implementation ButOriginsViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = WinSubAbove.rainInverseAdditionMixerSubgroupLong ? [UIColor descendedDiscoverStepperBlinkCautionSegments:WinSubAbove.rainInverseAdditionMixerSubgroupLong]:UIColor.whiteColor;

    self.insetAllCut = self.endOnlyCall;
    [EngineerView butterfly];
    
    self.dayWaxView = [UIView new];
    self.dayWaxView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.dayWaxView];
    
    self.dogView = [[UIImageView alloc] initWithImage:[UIImage cricketKinSaveElevationDiskName:WinSubAbove.swipeFlagDay.eraserLineDepthExchangeVideoTail]];;
    [self.view addSubview:self.dogView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(icyPublisher) name:WinSubAbove.swipeFlagDay.ornamentsHighTagReferenceDesignBond object:nil];
}

- (void)icyPublisher {
    [self.touchesNeed reload];
}

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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([WinSubAbove legalSoccerTotalShiftWhiteName] && WaxOlympusConfig.shared.persistCheckedDuePriorGuest.unlockedAir.didOneGuide) {
        [EngineerView foldExact];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)boxLegalLoseSize {
    if ([UIDevice getWas]) {
        return CGSizeMake(WinSubAbove.worldKernelDiscountsIndirectExclude, WinSubAbove.worldKernelDiscountsIndirectExclude);
    }
    UIWindow *offFeetWindow = [[AutoIntroManager shared] drySlightBagWindow];
    UIEdgeInsets safe = offFeetWindow.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 balanced]) {
            return CGSizeMake(UIScreen.mainScreen.bounds.size.width, WinSubAbove.worldKernelDiscountsIndirectExclude);
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, WinSubAbove.worldKernelDiscountsIndirectExclude + safe.bottom);
    }else {
        if (![UIDevice balanced]) {
            return CGSizeMake(WinSubAbove.worldKernelDiscountsIndirectExclude,UIScreen.mainScreen.bounds.size.height);
        }
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            return CGSizeMake(WinSubAbove.worldKernelDiscountsIndirectExclude + safe.left,UIScreen.mainScreen.bounds.size.height);
        }else {
            return CGSizeMake(WinSubAbove.worldKernelDiscountsIndirectExclude + 5,UIScreen.mainScreen.bounds.size.height);
        }
    }
}

- (void)expectMillionAddCreateCompared {
    UIWindow *offFeetWindow = [[AutoIntroManager shared] drySlightBagWindow];
    UIEdgeInsets safe = offFeetWindow.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 getWas]) {
            self.dayWaxView.layer.cornerRadius = 5.f;
            self.dayWaxView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
        }
        [self.dayWaxView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view.mas_top);
            make.left.right.equalTo(self.view);
            make.height.mas_equalTo(WinSubAbove.swipeFlagDay.hexRangeLeap);
        }];
        [self.dogView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.dayWaxView.mas_top);
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(WinSubAbove.swipeFlagDay.friendsBlend, WinSubAbove.swipeFlagDay.commandPoint));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.boxLegalLoseSize);
        }];
        [self.touchesNeed mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.height.mas_equalTo(WinSubAbove.worldKernelDiscountsIndirectExclude);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(0, self.boxLegalLoseSize.height);
    }else {
        
        if ([UIDevice getWas]) {
            self.dayWaxView.layer.cornerRadius = 5.f;
            self.dayWaxView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
        }
        [self.dayWaxView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.view.mas_right);
            make.top.bottom.equalTo(self.view);
            make.width.mas_equalTo(WinSubAbove.swipeFlagDay.hexRangeLeap);
        }];
        UIImage *faxThumbImage = [UIImage cricketKinSaveElevationDiskName:WinSubAbove.swipeFlagDay.eraserLineDepthExchangeVideoTail];
        UIImage *earlierImage = [UIImage imageWithCGImage:faxThumbImage.CGImage
                                                    scale:faxThumbImage.scale
                                              orientation:UIImageOrientationRight]; 
        self.dogView.image = earlierImage;
        [self.dogView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.dayWaxView.mas_right);
            make.centerY.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(WinSubAbove.swipeFlagDay.commandPoint, WinSubAbove.swipeFlagDay.friendsBlend));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerY.left.mas_equalTo(0);
            make.size.mas_equalTo(self.boxLegalLoseSize);
        }];
        [self.touchesNeed mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(0);
            make.width.mas_equalTo(WinSubAbove.worldKernelDiscountsIndirectExclude);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(-self.boxLegalLoseSize.width, 0);
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)herPrintableFootnoteProtocolsReplies:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    undoAdd(self);
    [super herPrintableFootnoteProtocolsReplies: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.boxLegalLoseSize.height);;
        } completion:^(BOOL finished) {
            [[AutoIntroManager shared] moduleGeorgianThousandFlatnessTransposeIgnoresViewController:self.navigationController];
        }];
    }else {
        [UIView animateWithDuration:0.3 animations:^{
            self.view.transform = CGAffineTransformMakeTranslation(-weakself.boxLegalLoseSize.width, 0);
        } completion:^(BOOL finished) {
            [[AutoIntroManager shared] moduleGeorgianThousandFlatnessTransposeIgnoresViewController:weakself.navigationController];
        }];
    }
}

@end
