






#import "PlaceWasOwnViewController.h"
#import "SDWebImageManager.h"
#import "YouToast.h"
#import "NSString+DesignArm.h"

@interface PlaceWasOwnViewController ()

@property (nonatomic, strong) UIImageView *stateTooForImageView;
@property (nonatomic, strong) UITextField *inuitMostTextField;
@property (nonatomic, strong) UITextField *bayerRedSeeTextField;

@end

@implementation PlaceWasOwnViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.optUseHangButton.hidden = [self.freeKinDark[0] boolValue];
    
    CGFloat finnishAcuteDaysInteriorPostcard = MainMinimal.nordicPubTen.storylineFax;
    
    UILabel *wetLabel = [MainMinimal traveledPeriodRankWorldEnd:MainMinimal.tiedTagCertTen.jobWetSoloistLingerAllocated];
    wetLabel.numberOfLines = 0;
    [self.view addSubview:wetLabel];
    [wetLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MainMinimal.nordicPubTen.trustBurmese);
        make.left.mas_equalTo(MainMinimal.nordicPubTen.ropeBaseline);
        make.right.mas_equalTo(-MainMinimal.nordicPubTen.ropeBaseline);
    }];
    
    
    self.inuitMostTextField = [MainMinimal wonForceTenField:MainMinimal.tiedTagCertTen.recentRussianProvidersOriginLockingAppearing isSecure:NO];
    [self.view addSubview:self.inuitMostTextField];
    [self.inuitMostTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(wetLabel.mas_bottom).offset(finnishAcuteDaysInteriorPostcard);
        make.left.mas_equalTo(MainMinimal.nordicPubTen.capturingZip);
        make.right.mas_equalTo(-MainMinimal.nordicPubTen.capturingZip);
        make.height.mas_equalTo(MainMinimal.nordicPubTen.readPersonal);
    }];
    
    
    self.bayerRedSeeTextField = [MainMinimal wonForceTenField:MainMinimal.tiedTagCertTen.whiteFilmPermanentSliderAchievedBurn isSecure:NO];;
    [self.view addSubview:self.bayerRedSeeTextField];
    [self.bayerRedSeeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.inuitMostTextField.mas_bottom).offset(finnishAcuteDaysInteriorPostcard);
        make.left.right.equalTo(self.inuitMostTextField);
        make.height.mas_equalTo(MainMinimal.nordicPubTen.readPersonal);
    }];
    
    
    UIImageView *hybridImageView = nil;
    if ([self.freeKinDark[1] length] > 0) {
        
        hybridImageView = [[UIImageView alloc] init];
        hybridImageView.backgroundColor = UIColor.lightGrayColor;
        hybridImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:hybridImageView];
        [hybridImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.bayerRedSeeTextField.mas_bottom).offset(finnishAcuteDaysInteriorPostcard);
            make.width.mas_equalTo(self.bayerRedSeeTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.stateTooForImageView = hybridImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.freeKinDark[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(), ^{
                hybridImageView.image = image2;
                CGFloat renew = image2.size.height / image2.size.width;
                [hybridImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((MainMinimal.nordicPubTen.funRemovesHalfCompositeThresholdWidth -MainMinimal.nordicPubTen.capturingZip*2)*renew);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.stateTooForImageView ? self.stateTooForImageView.frame.size.height + MainMinimal.nordicPubTen.storylineFax +MainMinimal.nordicPubTen.unlockHumanEggBleedTelephotoVerbose : MainMinimal.nordicPubTen.unlockHumanEggBleedTelephotoVerbose;
                    
                    make.size.mas_equalTo(CGSizeMake(MainMinimal.nordicPubTen.funRemovesHalfCompositeThresholdWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.stateTooForImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.stateTooForImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *purchasedButton = [MainMinimal grandsonTransportQuarterSchedulerTowerColor:MainMinimal.tiedTagCertTen.marathiTooHasSonEither];
    [purchasedButton addTarget:self action:@selector(mouseEchoFamilyTorchSobAllow:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:purchasedButton];
    [purchasedButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-MainMinimal.nordicPubTen.maxFontMeter);
        make.left.right.equalTo(self.inuitMostTextField);
        make.height.mas_equalTo(MainMinimal.nordicPubTen.animationRet);
    }];
    
}

- (void)mouseEchoFamilyTorchSobAllow:(id)sender {
if (self.inuitMostTextField.text.swappedSmile || self.bayerRedSeeTextField.text.swappedSmile) {
        [FunAlertView caretProcessedLinerPeriodicRegistrySerialize:MainMinimal.tiedTagCertTen.engineEnd message:MainMinimal.tiedTagCertTen.extentsGeometryNineBarsModeToo completion:nil];
        return;
    }
    if ([self.bedEveryWrist respondsToSelector:@selector(sheBigPinIndexedSedentaryDeprecateWithName:runOne:completion:)]) {
        [TooRespondView blurBeatFloorWindow];
        [self.bedEveryWrist sheBigPinIndexedSedentaryDeprecateWithName:self.inuitMostTextField.text runOne:self.bayerRedSeeTextField.text completion:^(id object) {
            [TooRespondView sentMoleCurlSimulatesAbortedWindow];
            if ([object boolValue]) {
                [[VortexBusManager shared] nativeEscapeWindow];
                [YouToast burnIcyWin:MainMinimal.tiedTagCertTen.adverbHueRespectsWayFatSilent];
            }
        }];
    }
}

@end
