 import SwiftUI
 
 // MARK: Token text type.
-public enum TokenTextType : Int {
+public enum TokenTextType: Int {
     case unknown = 0
     case header
     case payload
     case signature
     case dot
     
-    static var typicalSchemeComponents : [Self] {
-        return [.header, .dot, .payload, .dot, .signature]
+    static var typicalSchemeComponents: [Self] {
+        [.header, .dot, .payload, .dot, .signature]
     }
 }
 
 // MARK: NSAttributes.
 extension TokenTextType {
     fileprivate var encodedTextAttributes: [NSAttributedString.Key: Any] {
-        return encodedTextAttributes(type: self)
+        encodedTextAttributes(type: self)
     }
     
     fileprivate func encodedTextAttributes(type: TokenTextType) -> [NSAttributedString.Key: Any] {


// MARK: Serialization
fileprivate class TokenTextSerialization {
    public init() {}
    fileprivate func textPart(parts: [String], type: TokenTextType) -> String? {
        switch type {
        case .unknown: return nil
        case .header:
            return parts.first
        case .payload:
            guard parts.count > 1 else { return nil }
            return parts[1]
        case .signature: if parts.count > 2 { return parts[2..<parts.count].joined(separator: ".") } else { return nil }
        case .dot: return "."
        }
    }
}

// MARK: Appearance.
public class TokenTextAppearance {
    private let serialization = TokenTextSerialization()
    fileprivate func encodedAttributes(text: String, tokenSerialization: TokenTextSerialization) -> [(String, Attributes)] {
        let parts = text.components(separatedBy: ".")
        


// MARK: Appearance.Public.
public extension TokenTextAppearance {
    func encodedAttributes(text: String) -> [(string: String, attributes: Attributes)] {
        return self.encodedAttributes(text: text, tokenSerialization: self.serialization)
    }
    
