






#import "CalendarSobViewController.h"
#import "SDWebImageManager.h"
#import "EraToast.h"
#import "NSString+AskFinger.h"

@interface CalendarSobViewController ()

@property (nonatomic, strong) UIImageView *catReturnedImageView;
@property (nonatomic, strong) UITextField *mutationsTextField;
@property (nonatomic, strong) UITextField *rangeStylusTextField;

@end

@implementation CalendarSobViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.leadHowHasButton.hidden = [self.glyphMenCat[0] boolValue];
    
    CGFloat undoneInvisibleEightStandParticle = PutBelowEye.yetRevealHow.paymentsPeak;
    
    UILabel *eggLabel = [PutBelowEye tensionAssertRaceResumedPrevent:PutBelowEye.listColumnRoot.satisfiedBigStackDutchBad];
    eggLabel.numberOfLines = 0;
    [self.view addSubview:eggLabel];
    [eggLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PutBelowEye.yetRevealHow.allDimension);
        make.left.mas_equalTo(PutBelowEye.yetRevealHow.bigTagsBasal);
        make.right.mas_equalTo(-PutBelowEye.yetRevealHow.bigTagsBasal);
    }];
    
    
    self.mutationsTextField = [PutBelowEye netBurnTypeField:PutBelowEye.listColumnRoot.rejectHandballRenamingLinkageArbitraryExtra isSecure:NO];
    [self.view addSubview:self.mutationsTextField];
    [self.mutationsTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(eggLabel.mas_bottom).offset(undoneInvisibleEightStandParticle);
        make.left.mas_equalTo(PutBelowEye.yetRevealHow.prologPostal);
        make.right.mas_equalTo(-PutBelowEye.yetRevealHow.prologPostal);
        make.height.mas_equalTo(PutBelowEye.yetRevealHow.eyeGramChunk);
    }];
    
    
    self.rangeStylusTextField = [PutBelowEye netBurnTypeField:PutBelowEye.listColumnRoot.tintArmpitChatterBorderedRetSolve isSecure:NO];;
    [self.view addSubview:self.rangeStylusTextField];
    [self.rangeStylusTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mutationsTextField.mas_bottom).offset(undoneInvisibleEightStandParticle);
        make.left.right.equalTo(self.mutationsTextField);
        make.height.mas_equalTo(PutBelowEye.yetRevealHow.eyeGramChunk);
    }];
    
    
    UIImageView *anyFaxImageView = nil;
    if ([self.glyphMenCat[1] length] > 0) {
        
        anyFaxImageView = [[UIImageView alloc] init];
        anyFaxImageView.backgroundColor = UIColor.lightGrayColor;
        anyFaxImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:anyFaxImageView];
        [anyFaxImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.rangeStylusTextField.mas_bottom).offset(undoneInvisibleEightStandParticle);
            make.width.mas_equalTo(self.rangeStylusTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.catReturnedImageView = anyFaxImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.glyphMenCat[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(), ^{
                anyFaxImageView.image = image2;
                CGFloat pulse = image2.size.height / image2.size.width;
                [anyFaxImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((PutBelowEye.yetRevealHow.aboutStandardTeethSpaceLikeWidth -PutBelowEye.yetRevealHow.prologPostal*2)*pulse);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.catReturnedImageView ? self.catReturnedImageView.frame.size.height + PutBelowEye.yetRevealHow.paymentsPeak +PutBelowEye.yetRevealHow.cursorsFinishedSecondPaceRunHint : PutBelowEye.yetRevealHow.cursorsFinishedSecondPaceRunHint;
                    
                    make.size.mas_equalTo(CGSizeMake(PutBelowEye.yetRevealHow.aboutStandardTeethSpaceLikeWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.catReturnedImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.catReturnedImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *includingButton = [PutBelowEye escapingRectifiedAcceptingStopEarlierColor:PutBelowEye.listColumnRoot.beginningSearchingFairGloballyGrade];
    [includingButton addTarget:self action:@selector(semaphoreLargerReverseOrangeWinFrame:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:includingButton];
    [includingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-PutBelowEye.yetRevealHow.whiteTextual);
        make.left.right.equalTo(self.mutationsTextField);
        make.height.mas_equalTo(PutBelowEye.yetRevealHow.eyeSpotlight);
    }];
    
}

- (void)semaphoreLargerReverseOrangeWinFrame:(id)sender {

}

@end
