import SwiftUI

// MARK: - Single Checkmark (Delivered)

/// Single checkmark shape for delivery status.
/// Exact SVG path from design — renders at any size as a vector.
/// Original viewBox: 0 0 19 14, fill-rule: evenodd.
struct SingleCheckmarkShape: Shape {
    func path(in rect: CGRect) -> Path {
        let sx = rect.width / 19.0
        let sy = rect.height / 14.0

        var path = Path()

        path.move(to: CGPoint(x: 17.9693 * sx, y: 1.30564 * sy))
        path.addCurve(
            to: CGPoint(x: 17.9283 * sx, y: 0.20733 * sy),
            control1: CGPoint(x: 18.261 * sx, y: 0.991184 * sy),
            control2: CGPoint(x: 18.2427 * sx, y: 0.498997 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 16.83 * sx, y: 0.248345 * sy),
            control1: CGPoint(x: 17.6138 * sx, y: -0.0843367 * sy),
            control2: CGPoint(x: 17.1217 * sx, y: -0.0661078 * sy)
        )
        path.addLine(to: CGPoint(x: 6.04743 * sx, y: 11.8603 * sy))
        path.addLine(to: CGPoint(x: 1.36254 * sx, y: 6.39613 * sy))
        path.addCurve(
            to: CGPoint(x: 0.268786 * sx, y: 6.3141 * sy),
            control1: CGPoint(x: 1.08454 * sx, y: 6.07256 * sy),
            control2: CGPoint(x: 0.596911 * sx, y: 6.03611 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 0.186756 * sx, y: 7.40785 * sy),
            control1: CGPoint(x: -0.0547816 * sx, y: 6.5921 * sy),
            control2: CGPoint(x: -0.0912399 * sx, y: 7.07973 * sy)
        )
        path.addLine(to: CGPoint(x: 5.43676 * sx, y: 13.5329 * sy))
        path.addCurve(
            to: CGPoint(x: 6.01097 * sx, y: 13.8017 * sy),
            control1: CGPoint(x: 5.57803 * sx, y: 13.7015 * sy),
            control2: CGPoint(x: 5.78767 * sx, y: 13.7972 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 6.59431 * sx, y: 13.5556 * sy),
            control1: CGPoint(x: 6.22972 * sx, y: 13.8063 * sy),
            control2: CGPoint(x: 6.44392 * sx, y: 13.7151 * sy)
        )
        path.addLine(to: CGPoint(x: 17.9693 * sx, y: 1.30564 * sy))
        path.closeSubpath()

        return path
    }
}

// MARK: - Double Checkmarks (Read)

/// Double checkmark shape for read status.
/// Exact SVG path from design — two overlapping checkmarks.
/// Original viewBox: 0 0 22 12, fill-rule: evenodd.
struct DoubleCheckmarkShape: Shape {
    func path(in rect: CGRect) -> Path {
        let sx = rect.width / 22.0
        let sy = rect.height / 12.0

        var path = Path()

        // Left checkmark
        path.move(to: CGPoint(x: 16.0745 * sx, y: 1.13501 * sy))
        path.addCurve(
            to: CGPoint(x: 16.0378 * sx, y: 0.180235 * sy),
            control1: CGPoint(x: 16.3354 * sx, y: 0.86165 * sy),
            control2: CGPoint(x: 16.3191 * sx, y: 0.433785 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 15.0553 * sx, y: 0.21589 * sy),
            control1: CGPoint(x: 15.7565 * sx, y: -0.0733151 * sy),
            control2: CGPoint(x: 15.3162 * sx, y: -0.0574685 * sy)
        )
        path.addLine(to: CGPoint(x: 5.40975 * sx, y: 10.3103 * sy))
        path.addLine(to: CGPoint(x: 1.21886 * sx, y: 5.56025 * sy))
        path.addCurve(
            to: CGPoint(x: 0.240444 * sx, y: 5.48894 * sy),
            control1: CGPoint(x: 0.97018 * sx, y: 5.27897 * sy),
            control2: CGPoint(x: 0.533969 * sx, y: 5.24727 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 0.167063 * sx, y: 6.43975 * sy),
            control1: CGPoint(x: -0.049005 * sx, y: 5.7306 * sy),
            control2: CGPoint(x: -0.0816189 * sx, y: 6.15451 * sy)
        )
        path.addLine(to: CGPoint(x: 4.86346 * sx, y: 11.7643 * sy))
        path.addCurve(
            to: CGPoint(x: 5.37713 * sx, y: 11.998 * sy),
            control1: CGPoint(x: 4.98984 * sx, y: 11.9109 * sy),
            control2: CGPoint(x: 5.17737 * sx, y: 11.9941 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 5.89895 * sx, y: 11.7841 * sy),
            control1: CGPoint(x: 5.57281 * sx, y: 12.002 * sy),
            control2: CGPoint(x: 5.76442 * sx, y: 11.9228 * sy)
        )
        path.addLine(to: CGPoint(x: 16.0745 * sx, y: 1.13501 * sy))
        path.closeSubpath()

        // Right checkmark
        path.move(to: CGPoint(x: 21.8145 * sx, y: 1.13501 * sy))
        path.addCurve(
            to: CGPoint(x: 21.7778 * sx, y: 0.180235 * sy),
            control1: CGPoint(x: 22.0754 * sx, y: 0.86165 * sy),
            control2: CGPoint(x: 22.0591 * sx, y: 0.433785 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 20.7953 * sx, y: 0.21589 * sy),
            control1: CGPoint(x: 21.4965 * sx, y: -0.0733151 * sy),
            control2: CGPoint(x: 21.0563 * sx, y: -0.0574685 * sy)
        )
        path.addLine(to: CGPoint(x: 10.6198 * sx, y: 10.865 * sy))
        path.addCurve(
            to: CGPoint(x: 10.6565 * sx, y: 11.8198 * sy),
            control1: CGPoint(x: 10.3589 * sx, y: 11.1383 * sy),
            control2: CGPoint(x: 10.3752 * sx, y: 11.5662 * sy)
        )
        path.addCurve(
            to: CGPoint(x: 11.639 * sx, y: 11.7841 * sy),
            control1: CGPoint(x: 10.9378 * sx, y: 12.0733 * sy),
            control2: CGPoint(x: 11.3781 * sx, y: 12.0575 * sy)
        )
        path.addLine(to: CGPoint(x: 21.8145 * sx, y: 1.13501 * sy))
        path.closeSubpath()

        return path
    }
}
