/*
 * 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.993.883A1 1 0 0 0 15 0h-3l-.117.007A1 1 0 0 0 11 1l.007.117A1 1 0 0 0 12 2h2v12h-2l-.117.007A1 1 0 0 0 12 16h3l.117-.007A1 1 0 0 0 16 15V1zM5 1a1 1 0 0 0-1-1H1L.883.007A1 1 0 0 0 0 1v14l.007.117A1 1 0 0 0 1 16h3l.117-.007A1 1 0 0 0 5 15l-.007-.117A1 1 0 0 0 4 14H2V2h2l.117-.007A1 1 0 0 0 5 1m-.653 4.86q-.266.046-.547.047v.703h1.344v3.86h.977V5h-.727a.84.84 0 0 1-.203.422 1.2 1.2 0 0 1-.367.281q-.21.11-.477.157m7.115-.59q-.354-.264-.918-.264t-.925.263a1.8 1.8 0 0 0-.557.662q-.195.4-.27.88-.069.481-.068.933 0 .45.067.933.075.481.271.887.203.4.557.662.36.255.925.256.564 0 .918-.256.36-.263.556-.662a2.9 2.9 0 0 0 .271-.887q.075-.482.075-.933 0-.45-.075-.933a2.8 2.8 0 0 0-.27-.88 1.7 1.7 0 0 0-.557-.662m-.452 4.34a.7.7 0 0 1-.466.157.7.7 0 0 1-.474-.158 1.2 1.2 0 0 1-.293-.436 2.8 2.8 0 0 1-.15-.647 6 6 0 0 1-.046-.782q0-.414.045-.775.045-.369.15-.647.114-.277.294-.436a.7.7 0 0 1 .474-.166.68.68 0 0 1 .466.166q.188.157.294.436.113.278.158.647.045.361.045.775t-.045.782q-.045.37-.158.647-.105.27-.294.436m-3.928-.163H8.17V10.5H7.082z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M19.992 1.104A1.25 1.25 0 0 0 18.75 0H15c-.47 0-1 .359-1 1s.5 1 1.023 1h3L18 18h-3c-.5 0-1 .359-1 1 0 .69.5 1 1 1h3.75l.146-.008A1.25 1.25 0 0 0 20 18.75V1.25zM6 1c0-.69-.5-1-1-1H1.25l-.146.008A1.25 1.25 0 0 0 0 1.25v17.5l.008.146A1.25 1.25 0 0 0 1.25 20H5c.5 0 1-.359 1-1s-.5-1-1-1H2V2h3c.5 0 1-.359 1-1m-.566 6.325q-.333.058-.684.058v.88h1.68v4.825h1.221V6.25h-.908q-.06.312-.254.528-.186.215-.46.351a2 2 0 0 1-.595.196m8.893-.739q-.441-.329-1.147-.329-.705 0-1.157.33a2.24 2.24 0 0 0-.695.827 3.8 3.8 0 0 0-.339 1.1q-.085.602-.085 1.166t.085 1.166q.095.6.339 1.11.253.498.695.827.452.32 1.157.32t1.147-.32q.451-.33.696-.828.254-.507.338-1.11a7.6 7.6 0 0 0 .094-1.165 7.6 7.6 0 0 0-.094-1.166 3.5 3.5 0 0 0-.338-1.1 2.1 2.1 0 0 0-.696-.828m-.564 5.426a.88.88 0 0 1-.583.197.9.9 0 0 1-.592-.197 1.5 1.5 0 0 1-.367-.546 3.5 3.5 0 0 1-.188-.808 8 8 0 0 1-.057-.978q0-.518.057-.969.056-.46.188-.808.14-.348.367-.546a.86.86 0 0 1 .592-.206.85.85 0 0 1 .583.206q.235.198.367.546.141.348.197.808.056.452.056.969t-.056.978a3.2 3.2 0 0 1-.197.808q-.132.339-.367.546m-4.91-.205h1.358v1.319H8.853z"] as readonly string[];

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