/*
 * 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 = ["M10 1h3a1 1 0 0 1 1 1v2h-4zM2.25 4a.25.25 0 0 0-.25.25V9H.883a.5.5 0 0 0-.429.757l1.072 1.787c.207.344.477.638.791.87A10 10 0 0 1 1 12.5a.5.5 0 0 0 0 1c2.067 0 3.414-.543 4.161-.917.55.373 1.505.917 2.839.917 1.32 0 2.27-.533 2.822-.905l.004.002c.196.105.48.24.856.374.75.268 1.857.529 3.318.529a.5.5 0 0 0 0-1q-.488 0-.916-.039c.47-.328.848-.79 1.07-1.347l.572-1.428A.5.5 0 0 0 15.26 9H4V4.25A.25.25 0 0 0 3.75 4zm2.714 9.56a.5.5 0 0 1 .527.033c.455.325 1.277.907 2.509.907s2.054-.582 2.51-.907a.5.5 0 0 1 .579-.001l.006.004.036.023q.051.034.168.097c.154.082.394.197.72.313.649.232 1.642.471 2.981.471a.5.5 0 0 1 0 1c-1.46 0-2.568-.261-3.318-.53a6 6 0 0 1-.856-.373l-.004-.002c-.552.372-1.502.905-2.822.905-1.334 0-2.289-.544-2.839-.917-.747.374-2.094.917-4.161.917a.5.5 0 0 1 0-1c2.129 0 3.384-.63 3.964-.94M14 5h-4v3h3a1 1 0 0 0 1-1zM5 2a1 1 0 0 1 1-1h3v3H5zm4 3H5v2a1 1 0 0 0 1 1h3z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M12.5 1.25h4a1 1 0 0 1 1 1V5h-5zM2.75 5a.25.25 0 0 0-.25.25v6H.883a.5.5 0 0 0-.429.757l1.672 2.787c.17.284.384.533.63.741-.458.057-.959.09-1.506.09a.625.625 0 1 0 0 1.25c2.583 0 4.268-.68 5.202-1.146.687.466 1.88 1.146 3.548 1.146 1.65 0 2.837-.666 3.528-1.132l.005.003c.244.131.6.3 1.07.468.938.335 2.321.661 4.147.661a.625.625 0 1 0 0-1.25q-.478 0-.91-.03c.398-.318.717-.738.914-1.23l.972-2.43a.5.5 0 0 0-.464-.685H5v-6A.25.25 0 0 0 4.75 5zm3.455 11.95a.63.63 0 0 1 .658.041c.569.407 1.597 1.134 3.137 1.134s2.568-.727 3.137-1.134a.625.625 0 0 1 .724-.001l.007.005.045.029q.066.042.21.12a6.6 6.6 0 0 0 .9.392c.812.29 2.053.589 3.727.589a.625.625 0 1 1 0 1.25c-1.826 0-3.21-.326-4.148-.661a8 8 0 0 1-1.069-.468l-.005-.003c-.691.466-1.878 1.132-3.528 1.132-1.667 0-2.861-.68-3.548-1.146-.934.467-2.619 1.146-5.202 1.146a.625.625 0 1 1 0-1.25c2.66 0 4.23-.787 4.955-1.176M17.5 6.25h-5V10h4a1 1 0 0 0 1-1zm-11.25-4a1 1 0 0 1 1-1h4V5h-5zm5 4h-5V9a1 1 0 0 0 1 1h4z"] as readonly string[];

export const CargoShip: 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="cargo-ship" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
CargoShip.displayName = `Blueprint6.Icon.CargoShip`;
export default CargoShip;
