






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


@implementation DogDerivedFaxViewController

- (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.touchesNeed.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.touchesNeed mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[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 {
    UIWindow *offFeetWindow = [[AutoIntroManager shared] drySlightBagWindow];
    UIEdgeInsets safe = offFeetWindow.safeAreaInsets;
    CGFloat toneMaskShift = 0;
#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] || [UIDevice getWas]) {//无刘海
            toneMaskShift = UIScreen.mainScreen.bounds.size.height*WinSubAbove.indicatorBadgeAccuracyWonName;
        }else {
            toneMaskShift = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*WinSubAbove.indicatorBadgeAccuracyWonName;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, toneMaskShift);
        
    }else { 
        if (![UIDevice balanced] || [UIDevice getWas]) {//无刘海
            toneMaskShift = UIScreen.mainScreen.bounds.size.width * WinSubAbove.indicatorBadgeAccuracyWonName;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                toneMaskShift = (UIScreen.mainScreen.bounds.size.width - safe.left) * WinSubAbove.indicatorBadgeAccuracyWonName;
            }else {
                toneMaskShift = (UIScreen.mainScreen.bounds.size.width - safe.right) * WinSubAbove.indicatorBadgeAccuracyWonName;
            }
        }
        return CGSizeMake(toneMaskShift, 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) {
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.boxLegalLoseSize);
        }];
    }else {
        
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.left.mas_equalTo(safe.left);
                make.size.mas_equalTo(self.boxLegalLoseSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.boxLegalLoseSize);
            }];
        }
    }
}

- (void)herPrintableFootnoteProtocolsReplies:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super herPrintableFootnoteProtocolsReplies:touches withEvent:event];
    [[AutoIntroManager shared] moduleGeorgianThousandFlatnessTransposeIgnoresViewController:self.navigationController];
}

@end
