






#import "SubConflictViewController.h"
#import "SDWebImageManager.h"
#import "OffToast.h"
#import "NSString+SlowReset.h"

@interface SubConflictViewController ()

@property (nonatomic, strong) UIImageView *fitFiveMillImageView;
@property (nonatomic, strong) UITextField *wakeUsageTextField;
@property (nonatomic, strong) UITextField *ampereSpellTextField;

@end

@implementation SubConflictViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.maskHeaderButton.hidden = [self.ownAutoGolf[0] boolValue];
    
    CGFloat taskFunnelAwakeExpireConfigure = InvertPinch.didThousands.lexiconTilde;
    
    UILabel *artLabel = [InvertPinch contactsFarUnsavedAxesTrial:InvertPinch.knowSunTalkHas.stalledPashtoParsecsRedirectsAlternate];
    artLabel.numberOfLines = 0;
    [self.view addSubview:artLabel];
    [artLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(InvertPinch.didThousands.extentSeeUse);
        make.left.mas_equalTo(InvertPinch.didThousands.illBitNepali);
        make.right.mas_equalTo(-InvertPinch.didThousands.illBitNepali);
    }];
    
    
    self.wakeUsageTextField = [InvertPinch localesFoldField:InvertPinch.knowSunTalkHas.frameSexLoudLabelBleedGigabytes isSecure:NO];
    [self.view addSubview:self.wakeUsageTextField];
    [self.wakeUsageTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(artLabel.mas_bottom).offset(taskFunnelAwakeExpireConfigure);
        make.left.mas_equalTo(InvertPinch.didThousands.redoAddition);
        make.right.mas_equalTo(-InvertPinch.didThousands.redoAddition);
        make.height.mas_equalTo(InvertPinch.didThousands.wordMagicBag);
    }];
    
    
    self.ampereSpellTextField = [InvertPinch localesFoldField:InvertPinch.knowSunTalkHas.swahiliSpatialContainSecurityPreservesParticle isSecure:NO];;
    [self.view addSubview:self.ampereSpellTextField];
    [self.ampereSpellTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.wakeUsageTextField.mas_bottom).offset(taskFunnelAwakeExpireConfigure);
        make.left.right.equalTo(self.wakeUsageTextField);
        make.height.mas_equalTo(InvertPinch.didThousands.wordMagicBag);
    }];
    
    
    UIImageView *switchImageView = nil;
    if ([self.ownAutoGolf[1] length] > 0) {
        
        switchImageView = [[UIImageView alloc] init];
        switchImageView.backgroundColor = UIColor.lightGrayColor;
        switchImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:switchImageView];
        [switchImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.ampereSpellTextField.mas_bottom).offset(taskFunnelAwakeExpireConfigure);
            make.width.mas_equalTo(self.ampereSpellTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.fitFiveMillImageView = switchImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.ownAutoGolf[1]] options:0 progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                switchImageView.image = image2;
                CGFloat stake = image2.size.height / image2.size.width;
                [switchImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((InvertPinch.didThousands.keyAscendedLinearDidAutoWidth -InvertPinch.didThousands.redoAddition*2)*stake);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.fitFiveMillImageView ? self.fitFiveMillImageView.frame.size.height + InvertPinch.didThousands.lexiconTilde +InvertPinch.didThousands.pairDenyOrderedWaxMissingConsumes : InvertPinch.didThousands.pairDenyOrderedWaxMissingConsumes;
                    
                    make.size.mas_equalTo(CGSizeMake(InvertPinch.didThousands.keyAscendedLinearDidAutoWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.fitFiveMillImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.fitFiveMillImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *nowAcrossButton = [InvertPinch greekSampleAffineEpisodeDownColor:InvertPinch.knowSunTalkHas.fatalInfoLiteralNotGreek];
    [nowAcrossButton addTarget:self action:@selector(lacrosseAdditionsAngleWarpTargetedExistent:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:nowAcrossButton];
    [nowAcrossButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-InvertPinch.didThousands.icyMergeHash);
        make.left.right.equalTo(self.wakeUsageTextField);
        make.height.mas_equalTo(InvertPinch.didThousands.jouleIterate);
    }];
    
}

- (void)lacrosseAdditionsAngleWarpTargetedExistent:(id)sender {
if (self.wakeUsageTextField.text.theSiteBuilt || self.ampereSpellTextField.text.theSiteBuilt) {
        [BigAlertView clickPatternsRegionUnloadPopSemantic:InvertPinch.knowSunTalkHas.pasteWide message:InvertPinch.knowSunTalkHas.passwordsEyeArmLinearBarsMin completion:nil];
        return;
    }
    if ([self.swipeShutdown respondsToSelector:@selector(searchContentDueFunnelOverhangAdditionsWithName:linger:completion:)]) {
        [YouMetricsView smartNotPieceWindow];
        [self.swipeShutdown searchContentDueFunnelOverhangAdditionsWithName:self.wakeUsageTextField.text linger:self.ampereSpellTextField.text completion:^(id object) {
            [YouMetricsView beaconsRunningWasPastePutWindow];
            if ([object boolValue]) {
                [[UploadWhoManager shared] windowMayCapWindow];
                [OffToast malteseSon:InvertPinch.knowSunTalkHas.inhalerItsAlphaAchievedHitBaseball];
            }
        }];
    }
}

@end
