






#import "TwoPlaneNotCatButton.h"
#import "PrintFarFor.h"
#import "UIImage+MinImage.h"
#import "ThemeRawAbortController.h"
#import "UIImage+MinImage.h"
#import "UIColor+CatColor.h"

@implementation TwoPlaneNotCatButton

- (instancetype)initToneBedFastViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.healthHexAskViewController = viewController;
        [self extraCaptureFactoryFileCrop];
    }
    return self;
}


- (void)extraCaptureFactoryFileCrop {
    
    NSArray *malayEarMidQualifiedCanadian = [IdleAgentAspectEmptyUse stylisticMileMetalRowGender:[CutBestEgg class]];
    
    
    NSString *mayGramCurlOurCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block CutBestEgg *walkLikeUnsafe = nil;
    [malayEarMidQualifiedCanadian enumerateObjectsUsingBlock:^(CutBestEgg *country, NSUInteger idx, BOOL *stop) {
        if ([country.fixExecLeastCode caseInsensitiveCompare:mayGramCurlOurCode] == NSOrderedSame) {
            walkLikeUnsafe = country;
            *stop = YES; 
        }
    }];
    self.serializeOldJouleTruncateBatch = walkLikeUnsafe;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",PrintFarFor.guideMaySelf.canonMaleLazy, walkLikeUnsafe.menArtistCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *itsOrderImage = [UIImage lossyCurlRadialUnderlinePromotionName:PrintFarFor.guideMaySelf.midAgeCombineCupBringMid];
    
    
    CGSize partlyQuickSize = CGSizeMake(13, 13); 
    
    
    UIImage *funWhoImage = [self offsetLastSlabImage:itsOrderImage nodeTimeSize:partlyQuickSize];
    
    
    UIImage *templateImage = [funWhoImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    [self setImage:templateImage forState:UIControlStateNormal];
    [self setImage:templateImage forState:UIControlStateHighlighted];
    
    self.tintColor = UIColor.darkGrayColor;
    
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 
    CGFloat spacing = 3.0; 
    self.imageEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);  
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -spacing, 0, spacing);   
    
    
    [self setBackgroundColor:UIColor.clearColor];
    [self setTitleColor:UIColor.darkGrayColor forState:UIControlStateNormal];
    [self setTitleColor:UIColor.lightGrayColor forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];

    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(armApplyLowClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)offsetLastSlabImage:(UIImage *)image nodeTimeSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat filterTurn = targetSize.width / image.size.width;
    CGFloat areCapsRole = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(filterTurn, areCapsRole);
    
    
    CGRect rejectRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - rejectRect.size.width) / 2.0,
                               (targetSize.height - rejectRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                rejectRect.size.width,
                                rejectRect.size.height)];
    
    UIImage *herImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return herImage;
}


- (void)armApplyLowClicked {
    DiscoveryHertzArmCutBinStrictViewController *pen = [DiscoveryHertzArmCutBinStrictViewController new];
    pen.telephonyDelegate = self;
    [self.healthHexAskViewController.navigationController pushViewController:pen animated:NO];
}

- (void)growLeadScriptRelatedIronFemaleFathomsDisparity:(CutBestEgg *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",PrintFarFor.guideMaySelf.canonMaleLazy, country.menArtistCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.serializeOldJouleTruncateBatch = country;
}

- (void)dealloc {
    
}
@end
