






#import "PinItemCostViewController.h"
#import "SDWebImageManager.h"
#import "BusToast.h"
#import "NSString+NoiseCrop.h"

@interface PinItemCostViewController ()

@property (nonatomic, strong) UIImageView *namePeerZipImageView;
@property (nonatomic, strong) UITextField *occlusionTextField;
@property (nonatomic, strong) UITextField *cachePrettyTextField;

@end

@implementation PinItemCostViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.smallBayerButton.hidden = [self.treeStretch[0] boolValue];
    
    CGFloat ellipseBuiltIncreaseParticleView = DidTodayWax.invitePencil.kernelAscent;
    
    UILabel *sawLabel = [DidTodayWax dutchTotalPresenceProtocolsPrincipal:DidTodayWax.fixEraSafeTaps.expensiveMarkupOperateCapacityDisk];
    sawLabel.numberOfLines = 0;
    [self.view addSubview:sawLabel];
    [sawLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(DidTodayWax.invitePencil.forbiddenTab);
        make.left.mas_equalTo(DidTodayWax.invitePencil.optCutterYet);
        make.right.mas_equalTo(-DidTodayWax.invitePencil.optCutterYet);
    }];
    
    
    self.occlusionTextField = [DidTodayWax cupRadioHerField:DidTodayWax.fixEraSafeTaps.applyTransmitTelephoneNineteenPasteArm isSecure:NO];
    [self.view addSubview:self.occlusionTextField];
    [self.occlusionTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(sawLabel.mas_bottom).offset(ellipseBuiltIncreaseParticleView);
        make.left.mas_equalTo(DidTodayWax.invitePencil.tabPrimeText);
        make.right.mas_equalTo(-DidTodayWax.invitePencil.tabPrimeText);
        make.height.mas_equalTo(DidTodayWax.invitePencil.gravitySwipe);
    }];
    
    
    self.cachePrettyTextField = [DidTodayWax cupRadioHerField:DidTodayWax.fixEraSafeTaps.factoriesInjectionProvidingRealWarpCatalyst isSecure:NO];;
    [self.view addSubview:self.cachePrettyTextField];
    [self.cachePrettyTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.occlusionTextField.mas_bottom).offset(ellipseBuiltIncreaseParticleView);
        make.left.right.equalTo(self.occlusionTextField);
        make.height.mas_equalTo(DidTodayWax.invitePencil.gravitySwipe);
    }];
    
    
    UIImageView *strongImageView = nil;
    if ([self.treeStretch[1] length] > 0) {
        
        strongImageView = [[UIImageView alloc] init];
        strongImageView.backgroundColor = UIColor.lightGrayColor;
        strongImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:strongImageView];
        [strongImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.cachePrettyTextField.mas_bottom).offset(ellipseBuiltIncreaseParticleView);
            make.width.mas_equalTo(self.cachePrettyTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.namePeerZipImageView = strongImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.treeStretch[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(), ^{
                strongImageView.image = image2;
                CGFloat shift = image2.size.height / image2.size.width;
                [strongImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((DidTodayWax.invitePencil.processesDividingBoxLookupPopoverWidth -DidTodayWax.invitePencil.tabPrimeText*2)*shift);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.namePeerZipImageView ? self.namePeerZipImageView.frame.size.height + DidTodayWax.invitePencil.kernelAscent +DidTodayWax.invitePencil.fragmentsSpotlightArtSlashOptRoot : DidTodayWax.invitePencil.fragmentsSpotlightArtSlashOptRoot;
                    
                    make.size.mas_equalTo(CGSizeMake(DidTodayWax.invitePencil.processesDividingBoxLookupPopoverWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.namePeerZipImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.namePeerZipImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *barsPivotButton = [DidTodayWax rejectShiftInvitedObserverRectifiedColor:DidTodayWax.fixEraSafeTaps.basalDolbyExportFurlongsExpanded];
    [barsPivotButton addTarget:self action:@selector(midHowLocationsBetterHitLongitude:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:barsPivotButton];
    [barsPivotButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-DidTodayWax.invitePencil.ageEnterSort);
        make.left.right.equalTo(self.occlusionTextField);
        make.height.mas_equalTo(DidTodayWax.invitePencil.itsStarSlant);
    }];
    
}

- (void)midHowLocationsBetterHitLongitude:(id)sender {
if (self.occlusionTextField.text.interNextBin || self.cachePrettyTextField.text.interNextBin) {
        [CanAlertView maleFitRemoveAscendedStylisticDownload:DidTodayWax.fixEraSafeTaps.alertTail message:DidTodayWax.fixEraSafeTaps.redProducedStoodInactiveSeeArt completion:nil];
        return;
    }
    if ([self.briefRuleFire respondsToSelector:@selector(typeExtentsCycleFinalizeBirthSawWithName:energy:completion:)]) {
        [StoodStyleView hexDrawDogTipWindow];
        [self.briefRuleFire typeExtentsCycleFinalizeBirthSawWithName:self.occlusionTextField.text energy:self.cachePrettyTextField.text completion:^(id object) {
            [StoodStyleView disablingElevatedAppleStepsonResonantWindow];
            if ([object boolValue]) {
                [[SexualSobManager shared] forGenreSideWindow];
                [BusToast sigmoidOld:DidTodayWax.fixEraSafeTaps.sinBlusteryEightZoneElementTwo];
            }
        }];
    }
}

@end
