






#import "EncodeIndexButton.h"
#import "SheTintAuto.h"
#import "UIImage+ManImage.h"
#import "SDWebImageManager.h"

@interface EncodeIndexButton ()


@property (nonatomic, strong) NSTimer *eachRadialBlobTimer;

@property (nonatomic, assign) NSInteger singleRemainingUndefinedTapKeyBut;

@property (nonatomic, copy) NSString *linerThicknessAlignmentSpaceManual;

@end

@implementation EncodeIndexButton

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

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


- (void)markupAltitudeOriginUnfocusedLight {
    
    self.silentPublicSinhaleseLigatureAreaTool = 60;
    self.linerThicknessAlignmentSpaceManual = SheTintAuto.floatFootThird.execCyclingConsoleSentenceAcquireGeometryCode;
    [self setTitle:self.linerThicknessAlignmentSpaceManual forState:UIControlStateNormal];

    
    NSString *ratingsQuotes = [SheTintAuto preparingAdapterSawRankedArtsImage];
    if (ratingsQuotes) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:ratingsQuotes]
                                                    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 suchThumbCloudColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage suchThumbCloudColor:SheTintAuto.partFocusColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage suchThumbCloudColor:SheTintAuto.partFocusColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage suchThumbCloudColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)slantResizeClicked {
    [self boldDigitTopGainRearrange];
    if (self.farMajorResetAction) {
        self.farMajorResetAction();
    }
}


- (void)boldDigitTopGainRearrange {
    self.enabled = NO;
    self.singleRemainingUndefinedTapKeyBut = self.silentPublicSinhaleseLigatureAreaTool;
    [self foldDrivenPackagePluralReductionDownloads];
    
    
    self.eachRadialBlobTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(busGloballyIntrinsicDanceSexual:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)busGloballyIntrinsicDanceSexual:(NSTimer *)trust {
    self.singleRemainingUndefinedTapKeyBut--;
    if (self.singleRemainingUndefinedTapKeyBut <= 0) {
        [self chestMillibarsMattingLinearQuery];
    } else {
        [self foldDrivenPackagePluralReductionDownloads];
    }
}


- (void)foldDrivenPackagePluralReductionDownloads {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",SheTintAuto.floatFootThird.winBitRenewedArmTipNumberCode, (long)self.singleRemainingUndefinedTapKeyBut];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)chestMillibarsMattingLinearQuery {
    [self.eachRadialBlobTimer invalidate];
    self.eachRadialBlobTimer = nil;
    self.enabled = YES;
    [self setTitle:self.linerThicknessAlignmentSpaceManual forState:UIControlStateNormal];
}

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

@end
