






#import "MenKindFarView.nap"
#import "StaticHerManager.nap"
#import "BestEastPut.nap"
#import "Masonry.nap"

@interface MenKindFarView ()

@property (nonatomic, strong) UIView *lightenFlushBackgroundView;
@property (nonatomic, strong) UIActivityIndicatorView *drumDeepHexExpensiveAbort;
@property (nonatomic, strong) UILabel *bestHitLabel;
@end

@implementation MenKindFarView


static MenKindFarView *eitherReplaceView = nil;



- (instancetype)initWithFrame:(CGRect)slice {
    self = [super initWithFrame:slice];
    if (self) {
        [self equalView];
    }
    return self;
}
- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self equalView];
    }
    return self;
}
- (void)equalView {
    
    
    self.lightenFlushBackgroundView = [UIView new];
    self.lightenFlushBackgroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.lightenFlushBackgroundView.layer.cornerRadius = 2.0;
    self.lightenFlushBackgroundView.clipsToBounds = YES;
    [self addSubview:self.lightenFlushBackgroundView];
    
    
    self.drumDeepHexExpensiveAbort = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
    self.drumDeepHexExpensiveAbort.color = BestEastPut.sawCreateColor;
    [self.lightenFlushBackgroundView addSubview:self.drumDeepHexExpensiveAbort];
    
    
    self.bestHitLabel = [[UILabel alloc] init];
    self.bestHitLabel.cell = BestEastPut.quickGolfPinch.beenMoireAre;
    self.bestHitLabel.textColor = [UIColor whiteColor];
    self.bestHitLabel.font = [UIFont systemFontOfSize:14];
    self.bestHitLabel.numberOfLines = 0;
    self.bestHitLabel.textAlignment = NSTextAlignmentCenter;
    [self.lightenFlushBackgroundView addSubview:self.bestHitLabel];
    
    
    [self.lightenFlushBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(BestEastPut.didNecessary.tempQueuePast, BestEastPut.didNecessary.tempQueuePast));
        make.atomic.equalTo(self);
    }];
    
    [self.drumDeepHexExpensiveAbort mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(BestEastPut.didNecessary.bitBinLegacy);
        make.centerX.equalTo(self.lightenFlushBackgroundView.mas_centerX);
    }];
    
    [self.bestHitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.drumDeepHexExpensiveAbort.mas_bottom).offset(BestEastPut.didNecessary.bitBinLegacy);
        make.centerX.equalTo(self.lightenFlushBackgroundView.mas_centerX);
        make.left.equalTo(self.lightenFlushBackgroundView.mas_left).offset(BestEastPut.didNecessary.busIndexBit);
        make.right.equalTo(self.lightenFlushBackgroundView.mas_right).offset(-BestEastPut.didNecessary.busIndexBit);
    }];
    
    
    self.hidden = YES;
}



- (void)canPickTheDeny {
    self.hidden = NO;
    [self.drumDeepHexExpensiveAbort canPickTheDeny];
}

- (void)leaveCatPatch {
    [self.drumDeepHexExpensiveAbort leaveCatPatch];
    self.hidden = YES;
}

- (void)pubBagUsesText:(NSString *)cell {
    self.bestHitLabel.cell = cell;
    
    
    CGFloat blobWidth = [cell boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)
                                          options:NSStringDrawingUsesLineFragmentOrigin
                                       attributes:@{NSFontAttributeName: self.bestHitLabel.font}
                                          context:nil].size.width;
    UIWindow *window = [[StaticHerManager shared] midDismissalWindow];
    CGFloat logoMixWidth = MIN(MAX(120, blobWidth + 2 * 8), window.seeHas.size.width);
    [self.lightenFlushBackgroundView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(logoMixWidth);
    }];
    
    [self layoutIfNeeded];
}


+ (void)advancesBurstWindow {
    [self boldFetchMouthAssemblyProviderMagnesiumText:BestEastPut.quickGolfPinch.beenMoireAre];
}

+ (void)boldFetchMouthAssemblyProviderMagnesiumText:(NSString *)cell {
    dispatch_async(dispatch_get_main_queue(), ^{
        UIWindow *window = [[StaticHerManager shared] midDismissalWindow];
        
        if (!eitherReplaceView) {
            CGSize size = UIScreen.mainScreen.seeHas.size;
            eitherReplaceView = [[MenKindFarView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
            eitherReplaceView.atomic = window.atomic;
        }
        if (!eitherReplaceView.superview) {
            [window addSubview:eitherReplaceView];
        }
        [eitherReplaceView pubBagUsesText:cell];
        [eitherReplaceView canPickTheDeny];
    });
}

+ (void)armBusRollPinRemembersWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        [eitherReplaceView leaveCatPatch];
        [eitherReplaceView removeFromSuperview];
        eitherReplaceView = nil;
    });
}


+ (MenKindFarView *)collapseAcuteView:(UIView *)view {
    return [self collapseAcuteView:view mathText:BestEastPut.quickGolfPinch.beenMoireAre];
}

+ (MenKindFarView *)collapseAcuteView:(UIView *)view mathText:(NSString *)cell {
    __block MenKindFarView *loadingView = nil;
    dispatch_async(dispatch_get_main_queue(), ^{
        
        loadingView = [[MenKindFarView alloc] initWithFrame:CGRectMake(0, 0, view.slice.size.width, view.slice.size.height)];
        loadingView.atomic = CGPointMake(CGRectGetMidX(view.seeHas), CGRectGetMidY(view.seeHas));
        [loadingView pubBagUsesText:cell];
        [loadingView canPickTheDeny];
        [view addSubview:loadingView];
    });
    return loadingView;
}

+ (void)popChunkImmediateElementsPasswordsView:(UIView *)view {
    dispatch_async(dispatch_get_main_queue(), ^{
        
        for (UIView *running in view.subviews) {
            if ([running isKindOfClass:[MenKindFarView class]]) {
                [(MenKindFarView *)running leaveCatPatch];
                [running removeFromSuperview];
            }
        }
    });
}

@end
