






#import "LeaveDueMolarViewController.h"
#import "FarToast.h"
#import "PersonInfo.h"

@interface LeaveDueMolarViewController ()

@property (nonatomic, strong) UIImageView *eggPeopleView;
@property (nonatomic, strong) UIButton *sinWhiteAddButton;
@property (nonatomic, strong) UIView *plateSelfView;
@property (nonatomic, strong) UILabel *boldThinLabel;
@property (nonatomic, strong) UITextField *joinTorchBoxTextField;
@property (nonatomic, strong) UITextField *bestWetArmWonTextField;
@end

@implementation LeaveDueMolarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.catAtomTryButton.hidden = YES;
    
    if ([PersonInfo breakingKilometerHexGarbageAirImage]) {
        self.eggPeopleView = [[UIImageView alloc] initWithImage:[PersonInfo breakingKilometerHexGarbageAirImage]];
        [self.view addSubview:self.eggPeopleView];
        self.eggPeopleView.hidden = YES;
        [self.eggPeopleView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(PaceDownHue.absoluteAuto.youNapDerive);
            make.left.equalTo(self.ductilityButton.mas_right);
            make.top.equalTo(self.view).offset(PaceDownHue.absoluteAuto.barsEvictWho);
        }];
    }
    
    self.plateSelfView = [PaceDownHue plateSelfView];
    self.plateSelfView.hidden = YES;
    [self.view addSubview:self.plateSelfView];
    [self.plateSelfView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([PersonInfo breakingKilometerHexGarbageAirImage]) {
            make.centerY.equalTo(self.eggPeopleView);
            make.left.equalTo(self.eggPeopleView.mas_right).offset(PaceDownHue.absoluteAuto.eggEmbedded);
        }else {
            make.top.equalTo(self.view).offset(PaceDownHue.absoluteAuto.barsEvictWho);
            make.left.equalTo(self.ductilityButton.mas_right).offset(PaceDownHue.absoluteAuto.eggEmbedded);
        }
        make.right.equalTo(self.catAtomTryButton.mas_left);
        make.height.mas_equalTo(PaceDownHue.absoluteAuto.youNapDerive);
    }];
    
    self.boldThinLabel = [PaceDownHue queueProblemShiftSilenceFitness:PaceDownHue.touchBusyMalay.sameFrequencyStopCoverFree];
    self.boldThinLabel.numberOfLines = 0;
    [self.view addSubview:self.boldThinLabel];
    [self.boldThinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PaceDownHue.absoluteAuto.oldLogDetach);
        make.left.mas_equalTo(PaceDownHue.absoluteAuto.tipPanRegion);
        make.right.mas_equalTo(-PaceDownHue.absoluteAuto.tipPanRegion);
    }];
    
    
    self.joinTorchBoxTextField = [PaceDownHue alignedIndexingSixteenKelvinGlobalAccount];
    self.joinTorchBoxTextField.enabled = NO;
    self.joinTorchBoxTextField.text = self.hisEllipsis[PaceDownHue.absoluteAuto.tapBeenFileName];
    [self glyphKoreanTorqueTraveledGetDiscountView:self.joinTorchBoxTextField text:PaceDownHue.touchBusyMalay.commentsKinManagedDecimalTransient];
    [self.view addSubview:self.joinTorchBoxTextField];
    [self.joinTorchBoxTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.boldThinLabel.mas_bottom).offset(PaceDownHue.absoluteAuto.kinTiedThird);
        make.left.mas_equalTo(PaceDownHue.absoluteAuto.queryButLine);
        make.right.mas_equalTo(-PaceDownHue.absoluteAuto.queryButLine);
        make.height.mas_equalTo(PaceDownHue.absoluteAuto.pitchLastEra);
    }];
    
    
    self.bestWetArmWonTextField = [PaceDownHue alignedIndexingSixteenKelvinGlobalAccount];
    self.bestWetArmWonTextField.enabled = NO;
    self.bestWetArmWonTextField.text = self.hisEllipsis[PaceDownHue.absoluteAuto.lowBiometryKey];
    [self glyphKoreanTorqueTraveledGetDiscountView:self.bestWetArmWonTextField text:PaceDownHue.touchBusyMalay.earCupQuarterGeneratorUse];
    [self.view addSubview:self.bestWetArmWonTextField];
    [self.bestWetArmWonTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.joinTorchBoxTextField.mas_bottom).offset(PaceDownHue.absoluteAuto.kinTiedThird);
        make.left.right.equalTo(self.joinTorchBoxTextField);
        make.height.mas_equalTo(PaceDownHue.absoluteAuto.pitchLastEra);
    }];
    
    
    UIButton *headerOffButton = [PaceDownHue issueSolidUnsafeRelevanceInsetColor:PaceDownHue.touchBusyMalay.enableSupplySonOverdueLong];
    [headerOffButton addTarget:self action:@selector(aboutBuilderBitsMutationsLawAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:headerOffButton];
    [headerOffButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.bestWetArmWonTextField.mas_bottom).offset(PaceDownHue.absoluteAuto.kinTiedThird);
        make.left.right.equalTo(self.bestWetArmWonTextField);
        make.height.mas_equalTo(PaceDownHue.absoluteAuto.youNapDerive);
    }];
    
    
    self.sinWhiteAddButton = [PaceDownHue withinUploadLeftRadioSubset:PaceDownHue.touchBusyMalay.denseCosmicBendModifyMultipleExpensive];
    [self.sinWhiteAddButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.sinWhiteAddButton addTarget:self action:@selector(lighterEncodeMutationYouUnableAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sinWhiteAddButton];
    [self.sinWhiteAddButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(headerOffButton.mas_bottom).offset(PaceDownHue.absoluteAuto.canObscured);
        make.centerX.equalTo(self.view);
    }];
}

- (void)glyphKoreanTorqueTraveledGetDiscountView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(PaceDownHue.absoluteAuto.youNapDerive, PaceDownHue.absoluteAuto.pitchLastEra)};
    UILabel *tryBasal = [[UILabel alloc] initWithFrame:frame];
    tryBasal.text = text;
    tryBasal.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = tryBasal;
}

- (void)lighterEncodeMutationYouUnableAction:(UIButton *)sender {
    [[AboutLikeManager shared] bookFusionRealmBeaconsLetterAudioViewController:self.navigationController];
}

- (void)aboutBuilderBitsMutationsLawAction:(UIButton *)sender {
    sender.hidden = YES;
    self.boldThinLabel.hidden = YES;
    self.plateSelfView.hidden = NO;
    self.eggPeopleView.hidden = NO;
    self.sinWhiteAddButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(PaceDownHue.absoluteAuto.dietaryLostPinNewtonsSomaliWidth, PaceDownHue.absoluteAuto.curlSumCloudFilmCancelledMagnitude-PaceDownHue.absoluteAuto.commentVital));
    }];
    [self.joinTorchBoxTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.plateSelfView.mas_bottom).offset(PaceDownHue.absoluteAuto.kinTiedThird);
    }];
    [self.view layoutIfNeeded];
    
    BOOL rotor = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:PaceDownHue.absoluteAuto.upperCustomWrappedSpatialMarginsDistinctMax];
    if (!rotor) {
        self.catAtomTryButton.hidden = NO;
        [AskAlertView notationWasTokenTriggerYouBars:nil message:PaceDownHue.touchBusyMalay.unboundRepairSliceAssertPipe completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= PaceDownHue.absoluteAuto.sinkOldAlign;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:detachPencilRuleExpectsBadPayments:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image detachPencilRuleExpectsBadPayments:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[AboutLikeManager shared] bookFusionRealmBeaconsLetterAudioViewController:self.navigationController];
        [FarToast linePop:PaceDownHue.touchBusyMalay.callDecayPreferredPoolLead];
    }else {
        self.catAtomTryButton.hidden = NO;
        [AskAlertView notationWasTokenTriggerYouBars:nil message:PaceDownHue.touchBusyMalay.unboundRepairSliceAssertPipe completion:nil];
    }
}

@end
