/*
 * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as React from "react";
import type { SVGIconProps } from "../../svgIconProps";
import { IconSize } from "../../iconTypes";
import { SVGIconContainer } from "../../svgIconContainer";

/** Path data for the 16px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_16 = ["M15 3a1 1 0 0 0-.707.293L12 5.586l-1.293-1.293a1 1 0 1 0-1.414 1.414l2 2a.997.997 0 0 0 1.414 0l3-3A1 1 0 0 0 15 3m-.879 6.121-.007-.007A3 3 0 0 1 13 9.816V10h-2v-.184c-.424-.15-.8-.395-1.112-.704l-.01.01-2-2 .012-.012A3 3 0 0 1 7.184 6H3c-.176 0-.06-.824 0-1l.73-1.63C3.79 3.192 3.823 3 4 3h3.78c.548-.61 1.335-1 2.22-1 .768 0 1.461.293 1.987.77l.844-.844c-.238-.244-.524-.442-.794-.524C12.037 1.402 10.72 1 8 1s-4.037.402-4.037.402c-.508.155-1.078.711-1.268 1.237l-.763 2.117H.88c-.484 0-.88.423-.88.939s.396.939.88.939h.375L1 7c-.034.685 0 1.436 0 2v5c0 .657.384 1 1 1s1-.343 1-1v-1h10v1c0 .657.384 1 1 1s1-.343 1-1V9l-.003-.754zM5.001 10H3V8h2z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M19 4a1 1 0 0 0-.707.293L14 8.586l-2.293-2.293a1 1 0 0 0-1.414 1.414l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 0 0 19 4m-2.048 7.291c.011.072.048.134.048.209a1.5 1.5 0 0 1-1.5 1.5c-.225 0-.433-.057-.624-.145-.279.085-.57.145-.876.145a3 3 0 0 1-2.121-.879l-3-3 .007-.007A3 3 0 0 1 8.184 8H4V7l1-3h10l.19.568 1.307-1.308c-.336-.356-.758-.658-1.165-.772 0 0-1.74-.488-5.332-.488s-5.332.488-5.332.488c-.67.188-1.424.864-1.674 1.502L2.99 4H3L2 7H1a1 1 0 0 0 0 2h.333l-.28.84L1 10v7.5a1.5 1.5 0 1 0 3 0V17h12v.5a1.5 1.5 0 0 0 3 0V10l-.19-.568zM4.5 13a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"] as readonly string[];

export const KnownVehicle: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const paths = isLarge ? PATHS_20 : PATHS_16;
    return (
        <SVGIconContainer iconName="known-vehicle" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
KnownVehicle.displayName = `Blueprint6.Icon.KnownVehicle`;
export default KnownVehicle;
