






#import "SpaAlienOldButton.h"
#import "BadgeSunIcy.h"
#import "UIImage+MidImage.h"
#import "SDWebImageManager.h"

@interface SpaAlienOldButton ()


@property (nonatomic, strong) NSTimer *torchSlantPostTimer;

@property (nonatomic, assign) NSInteger modifyEndsFaxHasCoverageInserting;

@property (nonatomic, copy) NSString *redCapSindhiDepthTrust;

@end

@implementation SpaAlienOldButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self touchesAffiliateAnimatedAlternateRevert];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self touchesAffiliateAnimatedAlternateRevert];
    }
    return self;
}


- (void)touchesAffiliateAnimatedAlternateRevert {
    
    self.shortStoodTouchSonReceiverPolar = 60;
    self.redCapSindhiDepthTrust = BadgeSunIcy.lastCaretReply.applyFindLoudSpecificSetupSixCode;
    [self setTitle:self.redCapSindhiDepthTrust forState:UIControlStateNormal];

    
    NSString *pingChatWhile = [BadgeSunIcy subgroupProductChapterSexStoodImage];
    if (pingChatWhile) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:pingChatWhile]
                                                    options:0
                                                   progress:nil
                                                  completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
            if (image) {
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self setBackgroundImage:image forState:UIControlStateNormal];
                    [self setBackgroundImage:[UIImage assemblyInviteColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage assemblyInviteColor:BadgeSunIcy.lemmaBestColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage assemblyInviteColor:BadgeSunIcy.lemmaBestColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage assemblyInviteColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = BadgeSunIcy.greekBlueArt.alongAirUndo;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];

    
    [self addTarget:self action:@selector(runSpeakMapClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)runSpeakMapClicked {
    [self reversingObserverAirBrowseProposal];
    if (self.firstIdiomNowAction) {
        self.firstIdiomNowAction();
    }
}


- (void)reversingObserverAirBrowseProposal {
    self.enabled = NO;
    self.modifyEndsFaxHasCoverageInserting = self.shortStoodTouchSonReceiverPolar;
    [self creationOfferFixingMeasureCatalogUnwind];
    
    
    self.torchSlantPostTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(howWhileOwnFilenameDecay:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)howWhileOwnFilenameDecay:(NSTimer *)radix {
    self.modifyEndsFaxHasCoverageInserting--;
    if (self.modifyEndsFaxHasCoverageInserting <= 0) {
        [self fiberSubscriptArbiterHundredsParagraph];
    } else {
        [self creationOfferFixingMeasureCatalogUnwind];
    }
}


- (void)creationOfferFixingMeasureCatalogUnwind {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",BadgeSunIcy.lastCaretReply.alertFingerSegueMustHundredsAdditionCode, (long)self.modifyEndsFaxHasCoverageInserting];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)fiberSubscriptArbiterHundredsParagraph {
    [self.torchSlantPostTimer invalidate];
    self.torchSlantPostTimer = nil;
    self.enabled = YES;
    [self setTitle:self.redCapSindhiDepthTrust forState:UIControlStateNormal];
}

- (void)dealloc {
    
    [self.torchSlantPostTimer invalidate];
    self.torchSlantPostTimer = nil;
}

@end
