






#import "SpellHasBagViewController.h"
#import "SDWebImageManager.h"
#import "ZipToast.h"
#import "NSString+MoreAlien.h"

@interface SpellHasBagViewController ()

@property (nonatomic, strong) UIImageView *actionsChatImageView;
@property (nonatomic, strong) UITextField *majorWakeTextField;
@property (nonatomic, strong) UITextField *clipSobSkinTextField;

@end

@implementation SpellHasBagViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.impactZoneButton.hidden = [self.primaryMile[0] boolValue];
    
    CGFloat zoneEditBoostYearsFile = BigAddition.noiseFactMen.pubMetalFade;
    
    UILabel *notLabel = [BigAddition usedClientWayProducingFade:BigAddition.lateTapLineAll.unwindingSupportedTeethPinLoose];
    notLabel.numberOfLines = 0;
    [self.view addSubview:notLabel];
    [notLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(BigAddition.noiseFactMen.ditherMetric);
        make.left.mas_equalTo(BigAddition.noiseFactMen.farsiInfoZip);
        make.right.mas_equalTo(-BigAddition.noiseFactMen.farsiInfoZip);
    }];
    
    
    self.majorWakeTextField = [BigAddition extendsTakeField:BigAddition.lateTapLineAll.generateReadyCombiningLayoutSixPen isSecure:NO];
    [self.view addSubview:self.majorWakeTextField];
    [self.majorWakeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(notLabel.mas_bottom).offset(zoneEditBoostYearsFile);
        make.left.mas_equalTo(BigAddition.noiseFactMen.anonymousAll);
        make.right.mas_equalTo(-BigAddition.noiseFactMen.anonymousAll);
        make.height.mas_equalTo(BigAddition.noiseFactMen.fourSugarSob);
    }];
    
    
    self.clipSobSkinTextField = [BigAddition extendsTakeField:BigAddition.lateTapLineAll.behaviorsSamplesManualSockBetweenReveal isSecure:NO];;
    [self.view addSubview:self.clipSobSkinTextField];
    [self.clipSobSkinTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.majorWakeTextField.mas_bottom).offset(zoneEditBoostYearsFile);
        make.left.right.equalTo(self.majorWakeTextField);
        make.height.mas_equalTo(BigAddition.noiseFactMen.fourSugarSob);
    }];
    
    
    UIImageView *sunHexImageView = nil;
    if ([self.primaryMile[1] length] > 0) {
        
        sunHexImageView = [[UIImageView alloc] init];
        sunHexImageView.backgroundColor = UIColor.lightGrayColor;
        sunHexImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:sunHexImageView];
        [sunHexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.clipSobSkinTextField.mas_bottom).offset(zoneEditBoostYearsFile);
            make.width.mas_equalTo(self.clipSobSkinTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.actionsChatImageView = sunHexImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.primaryMile[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(), ^{
                sunHexImageView.image = image2;
                CGFloat rebus = image2.size.height / image2.size.width;
                [sunHexImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((BigAddition.noiseFactMen.mostPongReplaceYardNicknameWidth -BigAddition.noiseFactMen.anonymousAll*2)*rebus);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.actionsChatImageView ? self.actionsChatImageView.frame.size.height + BigAddition.noiseFactMen.pubMetalFade +BigAddition.noiseFactMen.outcomeObserverTryHandlerSamplerFar : BigAddition.noiseFactMen.outcomeObserverTryHandlerSamplerFar;
                    
                    make.size.mas_equalTo(CGSizeMake(BigAddition.noiseFactMen.mostPongReplaceYardNicknameWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.actionsChatImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.actionsChatImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *challengeButton = [BigAddition jabberMenLowWhoCleanupColor:BigAddition.lateTapLineAll.writeSharpnessStorageRevealExpert];
    [challengeButton addTarget:self action:@selector(jobLostThumbTransposeRunningCampaign:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:challengeButton];
    [challengeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-BigAddition.noiseFactMen.lookHelloArt);
        make.left.right.equalTo(self.majorWakeTextField);
        make.height.mas_equalTo(BigAddition.noiseFactMen.visitedSugar);
    }];
    
}

- (void)jobLostThumbTransposeRunningCampaign:(id)sender {

}

@end
