/*
 * 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 = ["M14 7H8.65c-.38-.09-.73-.18-1.04-.26s-.49-.13-.54-.14c-.43-.11-.79-.29-1.05-.52-.27-.23-.4-.55-.4-.95q0-.435.21-.72c.21-.285.32-.34.54-.46q.33-.165.72-.24c.26-.05.52-.07.77-.07.74 0 1.36.15 1.84.46.32.2.55.5.68.9h2.22c-.06-.33-.17-.64-.32-.92-.25-.45-.59-.84-1.02-1.15s-.93-.54-1.49-.7S8.59 2 7.95 2c-.55 0-1.1.07-1.63.2-.54.13-1.02.34-1.45.62q-.63.42-1.02 1.05t-.39 1.5c0 .3.04.59.13.88q.12.39.39.75H2c-.55 0-1 .45-1 1s.45 1 1 1h7.13c.25.07.49.14.71.22.25.09.48.23.7.44.21.21.32.53.32.97 0 .21-.05.43-.14.63-.09.21-.24.39-.45.55q-.315.24-.81.39t-1.2.15c-.44 0-.84-.05-1.21-.14s-.7-.24-.99-.43c-.29-.2-.51-.45-.67-.76-.01 0-.01-.01-.02-.02H3.14a3.68 3.68 0 0 0 1.39 2.03c.46.34 1 .58 1.62.74.61.15 1.27.23 1.97.23.61 0 1.2-.07 1.79-.2.58-.13 1.11-.34 1.56-.63q.69-.435 1.11-1.11c.28-.45.42-1 .42-1.64q0-.45-.15-.9c-.05-.19-.13-.36-.22-.52H14c.55 0 1-.45 1-1s-.45-1-1-1"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M18 9h-4.46a5 5 0 0 0-.4-.14c-.19-.05-.51-.14-.96-.25s-.9-.23-1.37-.35-.89-.23-1.27-.33-.6-.16-.65-.17c-.53-.15-.95-.37-1.27-.66-.32-.28-.49-.68-.49-1.19 0-.36.09-.66.26-.9s.39-.43.65-.57q.39-.21.87-.3c.48-.09.63-.09.93-.09.89 0 1.63.19 2.21.57.45.3.75.76.89 1.38h2.63c-.06-.52-.2-.98-.42-1.4-.3-.57-.71-1.05-1.23-1.43a5.3 5.3 0 0 0-1.79-.87c-.7-.2-1.42-.3-2.19-.3-.66 0-1.31.08-1.96.25s-1.22.43-1.73.77-.92.79-1.23 1.32c-.31.52-.46 1.15-.46 1.87 0 .37.05.74.15 1.1s.28.7.53 1.02c.18.24.41.47.69.67H2c-.55 0-1 .45-1 1s.45 1 1 1h10.14c.02.01.05.02.07.02.3.11.58.29.84.55.25.26.38.67.38 1.21 0 .27-.06.53-.17.79q-.165.39-.54.69c-.25.2-.57.36-.97.49s-.88.19-1.44.19c-.52 0-1.01-.06-1.45-.17-.45-.11-.84-.29-1.19-.54s-.61-.56-.8-.95c-.05-.08-.09-.18-.12-.28H4.11c.09.43.22.82.4 1.18q.495.975 1.32 1.59c.55.41 1.2.72 1.94.92q1.11.3 2.37.3c.73 0 1.44-.08 2.14-.25s1.33-.43 1.88-.79.99-.83 1.33-1.39.51-1.25.51-2.05c0-.37-.06-.75-.18-1.12a3 3 0 0 0-.15-.39H18c.55 0 1-.45 1-1s-.45-1-1-1"] as readonly string[];

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