<commit_before>//
//  InterfaceCustomization.swift
//  PinpointKit
//
//  Created by <NAME> on 5/13/16.
//  Copyright © 2016 Lickability. All rights reserved.
//

/// A struct that supplies customized interface text and appearance values.
public struct InterfaceCustomization {
    let interfaceText: InterfaceText
    let appearance: Appearance
    
    /**
     Initializes an InterfaceCustomization object.
     
     - parameter interfaceText: The interfact text customization.
     - parameter appearance:    The appearance customization.     
     */
    public init(interfaceText: InterfaceText = InterfaceText(), appearance: Appearance = Appearance()) {
        self.interfaceText = interfaceText
        self.appearance = appearance
    }
    
    /**
     *  A struct containing information about the appearance of displayed components.
     */
    public struct Appearance {
        /// The status bar style of PinpointKit.
        let statusBarStyle: UIStatusBarStyle
        
        /// The tint color of PinpointKit views used to style interactive and selected elements.
        let tintColor: UIColor?
        
        /// The fill color for annotations. If none is supplied, the `tintColor` of the relevant view will be used.
        let annotationFillColor: UIColor?
        
        /// The text attributes for annotations. Note that `NSForegroundColorAttributeName` can only be customized using `annotationFillColor`.
        let annotationTextAttributes: [NSAttributedString.Key: AnyObject]
        
        /// The stroke color for annotations.
        let annotationStrokeColor: UIColor

        /// The font used for navigation titles.
        let navigationTitleColor: UIColor
        
        /// The font used for navigation titles.
        let navigationTitleFont: UIFont
        
        /// The font used for the button that sends feedback.
        let feedbackSendButtonFont: UIFont
        
        /// The font used for the button that cancels feedback collection.
        let feedbackCancelButtonFont: UIFont
        
        /// The font used for the hint to the user on how to edit the screenshot from the feedback screen.
        let feedbackEditHintFont: UIFont
        
        /// The font used for the back button that takes the user back to the initial feedback collection screen.
        let feedbackBackButtonFont: UIFont

        /// The font used for the title of the cell that allows the user to toggle log collection.
        let logCollectionPermissionFont: UIFont
        
        /// The font used for displaying logs.
        let logFont: UIFont
        
        /// The font used for the text annotation tool segment in the editor.
        let editorTextAnnotationSegmentFont: UIFont
        
        /// The font used for the dismiss button in the editor displayed while editing a text annotation.
        let editorTextAnnotationDismissButtonFont: UIFont
        
        /// The font used for the done button in the editor to finish editing the image.
        let editorDoneButtonFont: UIFont
        
        /**
         Initializes an `Appearance` object with a optional annotation color properties.

         - parameter statusBarStyle:                        The status bar style of PinpointKit.
         - parameter tintColor:                             The tint color of the interface.
         - parameter annotationFillColor:                   The fill color for annotations. If none is supplied, the `tintColor` of the relevant view will be used.
         - parameter annotationStrokeColor:                 The stroke color for annotations.
         - parameter annotationTextAttributes:              The text attributes for annotations.
         - parameter navigationTitleColor:                  The color used for navigation titles.
         - parameter navigationTitleFont:                   The font used for navigation titles.
         - parameter feedbackSendButtonFont:                The font used for the button that sends feedback.
         - parameter feedbackCancelButtonFont:              The font used for the button that cancels feedback collection.
         - parameter feedbackEditHintFont:                  The font used for the hint to the user on how to edit the screenshot from the feedback screen.
         - parameter feedbackBackButtonFont:                The font used for the back button that takes the user back to the initial feedback collection screen.
         - parameter logCollectionPermissionFont:           The font used for the title of the cell that allows the user to toggle log collection.
         - parameter logFont:                               The font used for displaying logs.
         - parameter editorTextAnnotationSegmentFont:       The font used for the text annotation tool segment in the editor.
         - parameter editorTextAnnotationDismissButtonFont: The font used for the dismiss button in the editor displayed while editing a text annotation.
         - parameter editorDoneButtonFont:                  The font used for the done button in the editor to finish editing the image.
         */
        public init(statusBarStyle: UIStatusBarStyle = .default,
                    tintColor: UIColor? = .pinpointOrange(),
                    annotationFillColor: UIColor? = nil,
                    annotationStrokeColor: UIColor = .white,
                    annotationTextAttributes: [NSAttributedString.Key: AnyObject]? = nil,
                    navigationTitleColor: UIColor = Self.defaultNavigationBarTextColor,
                    navigationTitleFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    feedbackSendButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    feedbackCancelButtonFont: UIFont = .sourceSansProFont(ofSize: 19),
                    feedbackEditHintFont: UIFont = .sourceSansProFont(ofSize: 14),
                    feedbackBackButtonFont: UIFont = .sourceSansProFont(ofSize: 19),
                    logCollectionPermissionFont: UIFont = .sourceSansProFont(ofSize: 19),
                    logFont: UIFont = .menloRegularFont(ofSize: 10),
                    editorTextAnnotationSegmentFont: UIFont = .sourceSansProFont(ofSize: 18),
                    editorTextAnnotationDismissButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    editorDoneButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold)) {
            self.statusBarStyle = statusBarStyle
            self.tintColor = tintColor
            self.annotationFillColor = annotationFillColor
            self.annotationStrokeColor = annotationStrokeColor
            self.navigationTitleColor = navigationTitleColor
            
            // Custom annotation text attributes
            if var customAnnotationTextAttributes = annotationTextAttributes {
                // Ensure annotation font is set, if not use default font
                if customAnnotationTextAttributes[.font] == nil {
                    customAnnotationTextAttributes[.font] = type(of: self).DefaultAnnotationTextFont
                }
                self.annotationTextAttributes = customAnnotationTextAttributes
            } else {
                self.annotationTextAttributes = type(of: self).defaultTextAnnotationAttributes
            }
            
            self.logFont = logFont
            self.navigationTitleFont = navigationTitleFont
            self.feedbackSendButtonFont = feedbackSendButtonFont<commit_msg>Fixed compiler issue.<commit_after>//
//  InterfaceCustomization.swift
//  PinpointKit
//
//  Created by <NAME> on 5/13/16.
//  Copyright © 2016 Lickability. All rights reserved.
//

/// A struct that supplies customized interface text and appearance values.
public struct InterfaceCustomization {
    let interfaceText: InterfaceText
    let appearance: Appearance
    
    /**
     Initializes an InterfaceCustomization object.
     
     - parameter interfaceText: The interfact text customization.
     - parameter appearance:    The appearance customization.     
     */
    public init(interfaceText: InterfaceText = InterfaceText(), appearance: Appearance = Appearance()) {
        self.interfaceText = interfaceText
        self.appearance = appearance
    }
    
    /**
     *  A struct containing information about the appearance of displayed components.
     */
    public struct Appearance {
        /// The status bar style of PinpointKit.
        let statusBarStyle: UIStatusBarStyle
        
        /// The tint color of PinpointKit views used to style interactive and selected elements.
        let tintColor: UIColor?
        
        /// The fill color for annotations. If none is supplied, the `tintColor` of the relevant view will be used.
        let annotationFillColor: UIColor?
        
        /// The text attributes for annotations. Note that `NSForegroundColorAttributeName` can only be customized using `annotationFillColor`.
        let annotationTextAttributes: [NSAttributedString.Key: AnyObject]
        
        /// The stroke color for annotations.
        let annotationStrokeColor: UIColor

        /// The font used for navigation titles.
        let navigationTitleColor: UIColor
        
        /// The font used for navigation titles.
        let navigationTitleFont: UIFont
        
        /// The font used for the button that sends feedback.
        let feedbackSendButtonFont: UIFont
        
        /// The font used for the button that cancels feedback collection.
        let feedbackCancelButtonFont: UIFont
        
        /// The font used for the hint to the user on how to edit the screenshot from the feedback screen.
        let feedbackEditHintFont: UIFont
        
        /// The font used for the back button that takes the user back to the initial feedback collection screen.
        let feedbackBackButtonFont: UIFont

        /// The font used for the title of the cell that allows the user to toggle log collection.
        let logCollectionPermissionFont: UIFont
        
        /// The font used for displaying logs.
        let logFont: UIFont
        
        /// The font used for the text annotation tool segment in the editor.
        let editorTextAnnotationSegmentFont: UIFont
        
        /// The font used for the dismiss button in the editor displayed while editing a text annotation.
        let editorTextAnnotationDismissButtonFont: UIFont
        
        /// The font used for the done button in the editor to finish editing the image.
        let editorDoneButtonFont: UIFont
        
        /**
         Initializes an `Appearance` object with a optional annotation color properties.

         - parameter statusBarStyle:                        The status bar style of PinpointKit.
         - parameter tintColor:                             The tint color of the interface.
         - parameter annotationFillColor:                   The fill color for annotations. If none is supplied, the `tintColor` of the relevant view will be used.
         - parameter annotationStrokeColor:                 The stroke color for annotations.
         - parameter annotationTextAttributes:              The text attributes for annotations.
         - parameter navigationTitleColor:                  The color used for navigation titles.
         - parameter navigationTitleFont:                   The font used for navigation titles.
         - parameter feedbackSendButtonFont:                The font used for the button that sends feedback.
         - parameter feedbackCancelButtonFont:              The font used for the button that cancels feedback collection.
         - parameter feedbackEditHintFont:                  The font used for the hint to the user on how to edit the screenshot from the feedback screen.
         - parameter feedbackBackButtonFont:                The font used for the back button that takes the user back to the initial feedback collection screen.
         - parameter logCollectionPermissionFont:           The font used for the title of the cell that allows the user to toggle log collection.
         - parameter logFont:                               The font used for displaying logs.
         - parameter editorTextAnnotationSegmentFont:       The font used for the text annotation tool segment in the editor.
         - parameter editorTextAnnotationDismissButtonFont: The font used for the dismiss button in the editor displayed while editing a text annotation.
         - parameter editorDoneButtonFont:                  The font used for the done button in the editor to finish editing the image.
         */
        public init(statusBarStyle: UIStatusBarStyle = .default,
                    tintColor: UIColor? = .pinpointOrange(),
                    annotationFillColor: UIColor? = nil,
                    annotationStrokeColor: UIColor = .white,
                    annotationTextAttributes: [NSAttributedString.Key: AnyObject]? = nil,
                    navigationTitleColor: UIColor = Self.defaultNavigationTitleColor,
                    navigationTitleFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    feedbackSendButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    feedbackCancelButtonFont: UIFont = .sourceSansProFont(ofSize: 19),
                    feedbackEditHintFont: UIFont = .sourceSansProFont(ofSize: 14),
                    feedbackBackButtonFont: UIFont = .sourceSansProFont(ofSize: 19),
                    logCollectionPermissionFont: UIFont = .sourceSansProFont(ofSize: 19),
                    logFont: UIFont = .menloRegularFont(ofSize: 10),
                    editorTextAnnotationSegmentFont: UIFont = .sourceSansProFont(ofSize: 18),
                    editorTextAnnotationDismissButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold),
                    editorDoneButtonFont: UIFont = .sourceSansProFont(ofSize: 19, weight: .semibold)) {
            self.statusBarStyle = statusBarStyle
            self.tintColor = tintColor
            self.annotationFillColor = annotationFillColor
            self.annotationStrokeColor = annotationStrokeColor
            self.navigationTitleColor = navigationTitleColor
            
            // Custom annotation text attributes
            if var customAnnotationTextAttributes = annotationTextAttributes {
                // Ensure annotation font is set, if not use default font
                if customAnnotationTextAttributes[.font] == nil {
                    customAnnotationTextAttributes[.font] = type(of: self).DefaultAnnotationTextFont
                }
                self.annotationTextAttributes = customAnnotationTextAttributes
            } else {
                self.annotationTextAttributes = type(of: self).defaultTextAnnotationAttributes
            }
            
            self.logFont = logFont
            self.navigationTitleFont = navigationTitleFont
            self.feedbackSendButtonFont = feedbackSendButtonFont
{'fraction_non_alphanumeric': 0.05162359178263751, 'fraction_numerical': 0.0038436050364479787, 'mean_word_length': 2.136118038237739, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1372422', 'n_tokens_mistral': 3476, 'n_tokens_neox': 3293, 'n_words': 1285}