






#import "OneCurveThatCell.h"
#import "ZipCoulombs.h"
#import "Masonry.h"
#import "UIImage+TenImage.h"
#import "UIImageView+WebCache.h"
#import "NSString+EntityNet.h"

@interface OneCurveThatCell()


@property (nonatomic,strong) NSString * hierarchyBest;


@property (nonatomic,strong) UIImageView * callDayBagView;


@property (nonatomic,strong) UILabel * wakeDeleteLabel;


@property (nonatomic,strong) UILabel * napArmourLabel;

@property (nonatomic, strong) UIButton * subPutButton;

@end

@implementation OneCurveThatCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        self.clipsToBounds = YES;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = UIColor.clearColor;
        self.contentView.backgroundColor = UIColor.clearColor;
        
        self.callDayBagView = [UIImageView new];
        self.callDayBagView.tintColor = [ZipCoulombs zipSuddenColor];
        self.callDayBagView.layer.cornerRadius = ZipCoulombs.locatorCanon.literPostTwo;
        [self.contentView addSubview:self.callDayBagView];
        [self.callDayBagView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(ZipCoulombs.locatorCanon.sigmoidDeny);
            make.centerY.mas_equalTo(self.contentView);
            make.width.height.mas_equalTo(ZipCoulombs.locatorCanon.recordAirPub);
        }];
        
        self.wakeDeleteLabel = [UILabel new];
        self.wakeDeleteLabel.font = [UIFont boldSystemFontOfSize:ZipCoulombs.locatorCanon.hexSatisfied];
        self.wakeDeleteLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.wakeDeleteLabel];
        
        self.napArmourLabel = [UILabel new];
        self.napArmourLabel.font = [UIFont boldSystemFontOfSize:ZipCoulombs.locatorCanon.detectedRead];
        self.napArmourLabel.textColor = UIColor.darkGrayColor;
        [self.contentView addSubview:self.napArmourLabel];
        
        [self.wakeDeleteLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.callDayBagView.mas_right).offset(ZipCoulombs.locatorCanon.bedEqualLess);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self.napArmourLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.wakeDeleteLabel);
            make.top.equalTo(self.wakeDeleteLabel.mas_bottom).offset(ZipCoulombs.locatorCanon.photoCreamy);
        }];
        
        self.subPutButton = [[UIButton alloc] init];
        _subPutButton.userInteractionEnabled = NO;
        
        UIImage *image = [[UIImage eyeMatrixModernProcedureReportingName:ZipCoulombs.locatorCanon.policyFoodDiscardsStarMin] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
        [_subPutButton setBackgroundImage:[UIImage eyeMatrixModernProcedureReportingName:ZipCoulombs.locatorCanon.labeledItalianCapRateDecide] forState: UIControlStateNormal];
        [_subPutButton setBackgroundImage:image forState: UIControlStateSelected];
        _subPutButton.tintColor = [ZipCoulombs zipSuddenColor];
        [self.contentView addSubview:_subPutButton];
        [_subPutButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.offset(0);
            make.right.offset(-ZipCoulombs.locatorCanon.bedEqualLess);
            make.size.mas_equalTo(CGSizeMake(ZipCoulombs.locatorCanon.hexTowerName, ZipCoulombs.locatorCanon.hexTowerName));
        }];
    }
    return self;
}

- (void)setSelected:(BOOL)selected {
    _subPutButton.selected = selected;
    self.layer.borderWidth = selected ? 1:0;
    self.layer.borderColor = [ZipCoulombs zipSuddenColor].CGColor;
    
    if (selected) {
        self.contentView.backgroundColor = [UIColor colorWithRed:1.0 green:0.98 blue:0.94 alpha:0.95];
    } else {
        self.contentView.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.35];
    }
}

- (void)setFrame:(CGRect)frame {
    frame.origin.x = ZipCoulombs.locatorCanon.sigmoidDeny;
    frame.size.width -= ZipCoulombs.locatorCanon.hexSatisfied;
    frame.origin.y += ZipCoulombs.locatorCanon.sigmoidDeny;
    frame.size.height -= ZipCoulombs.locatorCanon.sigmoidDeny;
    [super setFrame:frame];
    
    self.layer.cornerRadius = frame.size.height / 2.0;
}

-(void)setHierarchyBest:(NSString *)hierarchyBest {
    _hierarchyBest = hierarchyBest;
    [self.callDayBagView sd_setImageWithURL:[NSURL URLWithString:hierarchyBest] placeholderImage:nil];
}

- (void)setCreateRain:(DefaultsExtrinsicAutoSedentaryRetSliding *)createRain {
    _createRain= createRain;
    self.hierarchyBest = createRain.arabicWax;
    self.wakeDeleteLabel.text = createRain.friendKit;
    NSString *note = createRain.hisLegacy?:@"";
    if (note.reuseMoodBig) {
        self.napArmourLabel.hidden = YES;
        [self.wakeDeleteLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.callDayBagView.mas_right).offset(ZipCoulombs.locatorCanon.bedEqualLess);
            make.centerY.equalTo(self.contentView);
        }];
    }else {
        self.napArmourLabel.hidden = NO;
        NSRange outHis = [note rangeOfString:ZipCoulombs.locatorCanon.jouleTeacherIcelandicBitReplacedHall];
        NSRange mapAir = [note rangeOfString:ZipCoulombs.locatorCanon.tapPrefixStriationUnifyTamilIntersect];
        
        if (outHis.length == 0 && mapAir.length == 0) {
            self.napArmourLabel.text = note;
            self.napArmourLabel.font = [UIFont systemFontOfSize:ZipCoulombs.locatorCanon.detectedRead];
            self.napArmourLabel.textColor = UIColor.lightGrayColor;
        }else {
            NSRange plainSon = NSMakeRange(outHis.location+outHis.length, mapAir.location-(outHis.location+outHis.length));
            NSString *legacy = [note substringWithRange:plainSon];
            NSString *reorder = [note stringByReplacingOccurrencesOfString:ZipCoulombs.locatorCanon.jouleTeacherIcelandicBitReplacedHall withString:@""];
            reorder = [reorder stringByReplacingOccurrencesOfString:ZipCoulombs.locatorCanon.tapPrefixStriationUnifyTamilIntersect withString:@""];
            
            plainSon = [reorder rangeOfString:legacy];
            NSMutableAttributedString *wayGenderAnd = [[NSMutableAttributedString alloc] initWithString:reorder];
            [wayGenderAnd addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, reorder.length)];
            [wayGenderAnd addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, reorder.length)];
            [wayGenderAnd addAttribute:NSForegroundColorAttributeName value:[ZipCoulombs zipSuddenColor] range:plainSon];
            [wayGenderAnd addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:plainSon];
            
            self.napArmourLabel.attributedText = wayGenderAnd;
        }
        
        [self.wakeDeleteLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.callDayBagView.mas_right).offset(ZipCoulombs.locatorCanon.bedEqualLess);
            make.top.equalTo(self.callDayBagView).offset(ZipCoulombs.locatorCanon.retCanonPen);
        }];
    }
}

@end
