






#import "CutShareRowViewController.h"
#import "SDWebImageManager.h"
#import "KeyToast.h"
#import "NSString+TenIndoor.h"

@interface CutShareRowViewController ()

@property (nonatomic, strong) UIImageView *emailCanArmImageView;
@property (nonatomic, strong) UITextField *getEraserTextField;
@property (nonatomic, strong) UITextField *advancedHitTextField;

@end

@implementation CutShareRowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.bitLessEggButton.hidden = [self.rareMarkTap[0] boolValue];
    
    CGFloat actionsFixTouchVitalAmbient = MouthOunces.logTwelveEnd.swedishValue;
    
    UILabel *wasLabel = [MouthOunces chestAudiencesBlendIncrementReply:MouthOunces.chatRingCharge.penManagerKeyJobTeacher];
    wasLabel.numberOfLines = 0;
    [self.view addSubview:wasLabel];
    [wasLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MouthOunces.logTwelveEnd.kitBurnExtra);
        make.left.mas_equalTo(MouthOunces.logTwelveEnd.soloistRaise);
        make.right.mas_equalTo(-MouthOunces.logTwelveEnd.soloistRaise);
    }];
    
    
    self.getEraserTextField = [MouthOunces badgeSingleField:MouthOunces.chatRingCharge.endShowingCorruptPresentParsePrompt isSecure:NO];
    [self.view addSubview:self.getEraserTextField];
    [self.getEraserTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(wasLabel.mas_bottom).offset(actionsFixTouchVitalAmbient);
        make.left.mas_equalTo(MouthOunces.logTwelveEnd.privacyNorth);
        make.right.mas_equalTo(-MouthOunces.logTwelveEnd.privacyNorth);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.leftSmallTop);
    }];
    
    
    self.advancedHitTextField = [MouthOunces badgeSingleField:MouthOunces.chatRingCharge.thirdEngravedSolutionsExpectedElectricEndpoint isSecure:NO];;
    [self.view addSubview:self.advancedHitTextField];
    [self.advancedHitTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.getEraserTextField.mas_bottom).offset(actionsFixTouchVitalAmbient);
        make.left.right.equalTo(self.getEraserTextField);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.leftSmallTop);
    }];
    
    
    UIImageView *napBagImageView = nil;
    if ([self.rareMarkTap[1] length] > 0) {
        
        napBagImageView = [[UIImageView alloc] init];
        napBagImageView.backgroundColor = UIColor.lightGrayColor;
        napBagImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:napBagImageView];
        [napBagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.advancedHitTextField.mas_bottom).offset(actionsFixTouchVitalAmbient);
            make.width.mas_equalTo(self.advancedHitTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.emailCanArmImageView = napBagImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.rareMarkTap[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(), ^{
                napBagImageView.image = image2;
                CGFloat chest = image2.size.height / image2.size.width;
                [napBagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((MouthOunces.logTwelveEnd.buttonDetectedPencilInternalIdleWidth -MouthOunces.logTwelveEnd.privacyNorth*2)*chest);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.emailCanArmImageView ? self.emailCanArmImageView.frame.size.height + MouthOunces.logTwelveEnd.swedishValue +MouthOunces.logTwelveEnd.needExactnessPresentedListenerAwayTemp : MouthOunces.logTwelveEnd.needExactnessPresentedListenerAwayTemp;
                    
                    make.size.mas_equalTo(CGSizeMake(MouthOunces.logTwelveEnd.buttonDetectedPencilInternalIdleWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.emailCanArmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.emailCanArmImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *widgetWayButton = [MouthOunces scaleFaxEstonianLogChamberColor:MouthOunces.chatRingCharge.manualHintTitlePinPrepared];
    [widgetWayButton addTarget:self action:@selector(minHasPotassiumAssignIgnoredHas:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:widgetWayButton];
    [widgetWayButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-MouthOunces.logTwelveEnd.penBitChange);
        make.left.right.equalTo(self.getEraserTextField);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.kilowattsArt);
    }];
    
}

- (void)minHasPotassiumAssignIgnoredHas:(id)sender {

}

@end
