






#import "PosterIndexingButton.h"
#import "HisTwoEject.h"
#import "UIImage+EyeImage.h"
#import "PoolUndoSpeakController.h"
#import "UIImage+EyeImage.h"
#import "UIColor+HueColor.h"

@implementation PosterIndexingButton

- (instancetype)initHerMenUpperViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.poolSinAlphaViewController = viewController;
        [self lexiconDisplaysNearestAmountState];
    }
    return self;
}


- (void)lexiconDisplaysNearestAmountState {
    
    NSArray *areTenPatternsEnsureChoose = [NegateFeedbackCircularConvertedLocality outEitherMandarinPairAffiliate:[HowZoomBit class]];
    
    
    NSString *diskDublinStayCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block HowZoomBit *sideSafariLogo = nil;
    [areTenPatternsEnsureChoose enumerateObjectsUsingBlock:^(HowZoomBit *country, NSUInteger idx, BOOL *stop) {
        if ([country.skipImageTagCode caseInsensitiveCompare:diskDublinStayCode] == NSOrderedSame) {
            sideSafariLogo = country;
            *stop = YES; 
        }
    }];
    self.lockReportLabeledDeprecateConclude = sideSafariLogo;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",HisTwoEject.mildVitalEar.ageExtentsPut, sideSafariLogo.illRejectCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *failRedoImage = [UIImage undoneWasCallContainsRelevanceName:HisTwoEject.mildVitalEar.hundredPreferConstantsComparedForceHover];
    
    
    CGSize checksumSinSize = CGSizeMake(13, 13); 
    
    
    UIImage *signerImage = [self indexGuideLoopImage:failRedoImage diskEchoSize:checksumSinSize];
    
    
    [self setImage:signerImage forState:UIControlStateNormal];
    [self setImage:[signerImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateHighlighted]; 
    
    
    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 setBackgroundImage:[UIImage enterSequencerColor:[HisTwoEject.darkMinorColor toneCautionSigningStrokingWetMany:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage enterSequencerColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]]
                   forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
    self.layer.masksToBounds = YES;
    
    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(faxSignThatClicked) forControlEvents:UIControlEventTouchUpInside];
}


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


- (void)faxSignThatClicked {
    BurstTaskHueCreditsCapableDisablesViewController *won = [BurstTaskHueCreditsCapableDisablesViewController new];
    won.beaconTryDelegate = self;
    [self.poolSinAlphaViewController.navigationController pushViewController:won animated:NO];
}

- (void)talkCoalescedEightTimeHelperOnlyBookmarksFlatten:(HowZoomBit *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",HisTwoEject.mildVitalEar.ageExtentsPut, country.illRejectCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.lockReportLabeledDeprecateConclude = country;
}

- (void)dealloc {
    
}
@end
