/*
 * 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 = ["M1 2c-.56 0-1 .45-1 1v10c0 .54.45 1 1 1 .56 0 1-.45 1-1V9h4v4c0 .54.45 1 1 1 .56 0 1-.45 1-1V3c0-.54-.45-1-1-1-.56 0-1 .45-1 1v4H2V3c0-.54-.45-1-1-1m12.154 11.944.016-.014c.18-.14.36-.28.57-.42l.63-.45c.21-.16.41-.33.61-.51s.37-.38.52-.59.28-.45.37-.7.13-.54.13-.85c0-.25-.04-.51-.12-.79-.07-.29-.2-.55-.39-.79a2.2 2.2 0 0 0-.73-.6c-.29-.15-.66-.23-1.11-.23-.4 0-.76.08-1.07.23-.31.16-.58.37-.79.62-.22.27-.38.59-.49.96s-.16.77-.16 1.2h1.19c.01-.27.03-.53.08-.77.04-.24.11-.45.21-.62.09-.18.22-.32.38-.42s.35-.15.59-.15c.26 0 .47.05.63.14.15.09.28.21.37.35q.135.21.18.45c.03.16.05.31.05.45-.01.31-.08.58-.22.82-.14.23-.32.45-.53.65-.22.21-.46.39-.71.57q-.39.27-.75.54c-.5.36-.89.78-1.17 1.27S11.01 15.35 11 16h4.99v-1.14h-3.55c.05-.17.14-.33.27-.49.126-.145.28-.281.444-.426"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M2 11v5a1 1 0 1 1-2 0V3a1 1 0 0 1 2 0v6h7V3a1 1 0 1 1 2 0v13a1 1 0 1 1-2 0v-5zm14.033 6.96c.16-.19.34-.38.558-.55.21-.18.449-.36.708-.53.25-.18.498-.36.748-.56.249-.2.488-.41.727-.63.23-.22.439-.47.628-.74.18-.27.329-.56.438-.88.11-.32.16-.67.16-1.07 0-.32-.05-.65-.14-1s-.249-.68-.468-.97c-.22-.3-.508-.55-.867-.74-.359-.2-.807-.29-1.346-.29-.488 0-.926.1-1.295.29q-.557.27-.947.78c-.26.33-.449.73-.578 1.2-.13.46-.2.96-.2 1.5h1.426c.01-.35.04-.67.09-.97s.139-.56.249-.78.259-.39.448-.52c.19-.13.429-.19.708-.19q.463 0 .747.18c.19.12.34.26.449.43.11.17.18.36.219.56q.06.3.06.57c-.01.38-.1.72-.26 1.02-.149.3-.368.57-.627.83-.26.25-.538.49-.847.71-.31.22-.608.45-.887.68a5.3 5.3 0 0 0-1.406 1.58c-.349.61-.518 1.32-.528 2.13h5.97v-1.43h-4.266c.06-.21.17-.42.33-.61"] as readonly string[];

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