/*
 * 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 = ["M3 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2m0-2c1.385 0 2.551.94 2.896 2.215q.253.066.51.158c1.076.394 2.237 1.242 2.575 2.93.161.809.664 1.211 1.293 1.443a3 3 0 1 1 0 2.508c-.629.232-1.132.634-1.293 1.442-.338 1.69-1.499 2.537-2.575 2.93a5 5 0 0 1-.51.159A3.001 3.001 0 0 1 0 13a3 3 0 0 1 5.726-1.254c.629-.232 1.132-.634 1.293-1.442.216-1.076.765-1.81 1.413-2.304-.648-.493-1.197-1.228-1.413-2.304-.161-.808-.664-1.21-1.293-1.442A3 3 0 1 1 3 0m1 13a1 1 0 1 0-2 0 1 1 0 0 0 2 0m8-5a1 1 0 1 0 2 0 1 1 0 0 0-2 0"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M3 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2m0 4a3 3 0 1 1 2.838-3.976c.633.042 1.491.158 2.347.476 1.402.523 2.868 1.625 3.296 3.807.259 1.318 1.085 1.966 2.032 2.318q.353.132.722.21a3 3 0 1 1 0 2.33c-.238.052-.482.12-.722.21-.947.352-1.773 1-2.032 2.318-.429 2.182-1.894 3.284-3.296 3.807-.856.318-1.714.434-2.347.476a3.001 3.001 0 1 1-.019-2.004 6.2 6.2 0 0 0 1.668-.347c.947-.352 1.773-1 2.032-2.318.323-1.644 1.234-2.675 2.264-3.307-1.03-.632-1.941-1.663-2.264-3.307-.259-1.318-1.085-1.966-2.032-2.318a6.2 6.2 0 0 0-1.667-.347A3 3 0 0 1 3 6m13 4a1 1 0 1 0 2 0 1 1 0 0 0-2 0M2 17a1 1 0 1 0 2 0 1 1 0 0 0-2 0"] as readonly string[];

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