






#import "BeginWakeTrackButton.h"
#import "CityPublish.h"
#import "UIImage+EyeImage.h"
#import "NibblesSubsetController.h"
#import "UIImage+EyeImage.h"
#import "UIColor+OutColor.h"

@implementation BeginWakeTrackButton

- (instancetype)initPingEndArtsViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.sexualSoccerViewController = viewController;
        [self roundAppearOutdoorPubExposures];
    }
    return self;
}


- (void)roundAppearOutdoorPubExposures {
    
    NSArray *boldStreamAmbienceAzimuthMust = [PreserveItsBringSerializePager beaconsCapacityKeySendChinese:[KeyWatched class]];
    
    
    NSString *caseOffZoomOddCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block KeyWatched *minWinGlyphFun = nil;
    [boldStreamAmbienceAzimuthMust enumerateObjectsUsingBlock:^(KeyWatched *country, NSUInteger idx, BOOL *stop) {
        if ([country.staleEndTurnCode caseInsensitiveCompare:caseOffZoomOddCode] == NSOrderedSame) {
            minWinGlyphFun = country;
            *stop = YES; 
        }
    }];
    self.createPaymentsRevealedModifyCoverage = minWinGlyphFun;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",CityPublish.halfInferCan.angleOneCause, minWinGlyphFun.tallEveryCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *setupCupImage = [UIImage extentsTenGroupDistortedTriggerName:CityPublish.halfInferCan.finnishThatClipThermalColleagueLocale];
    
    
    CGSize displayNoteSize = CGSizeMake(13, 13); 
    
    
    UIImage *petiteImage = [self expensiveClearImage:setupCupImage sinFatalSize:displayNoteSize];
    
    
    [self setImage:petiteImage forState:UIControlStateNormal];
    [self setImage:[petiteImage 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 priorityDecideColor:[CityPublish.audioRestColor reasonDominantProducingTooRetPackage:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage priorityDecideColor:[[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(lossSignCanClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)expensiveClearImage:(UIImage *)image sinFatalSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat waterLearn = targetSize.width / image.size.width;
    CGFloat thatWetRain = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(waterLearn, thatWetRain);
    
    
    CGRect cosmicRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - cosmicRect.size.width) / 2.0,
                               (targetSize.height - cosmicRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                cosmicRect.size.width,
                                cosmicRect.size.height)];
    
    UIImage *badImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return badImage;
}


- (void)lossSignCanClicked {
    WarnPopWayRandomDrumDueViewController *bag = [WarnPopWayRandomDrumDueViewController new];
    bag.restSwipeDelegate = self;
    [self.sexualSoccerViewController.navigationController pushViewController:bag animated:NO];
}

- (void)persistTooSleepDepthFlashServicesDownPitch:(KeyWatched *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",CityPublish.halfInferCan.angleOneCause, country.tallEveryCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.createPaymentsRevealedModifyCoverage = country;
}

- (void)dealloc {
    
}
@end
