/*
 * 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 = ["M11.998.005a3.996 3.996 0 0 1 3.997 3.998c0 1.109-.46 2.088-1.19 2.808l.02.02-.999 1-.02-.02a3.97 3.97 0 0 1-2.052 1.114l-.93-.929 1.583-1.595 1-1-.01-.01c.36-.36.6-.849.6-1.398 0-1.1-.9-2-2-2-.55 0-1.039.24-1.399.6l-.01-.01L8 5.172l-.924-.925A4.04 4.04 0 0 1 8.19 2.194l-.02-.02 1-1 .02.02A3.93 3.93 0 0 1 11.997.005M2.293 2.293a1 1 0 0 1 1.414 0l10 10a1 1 0 0 1-1.414 1.414L8.936 10.35q.061.318.063.648c0 1.1-.46 2.089-1.189 2.808l.02.02-1 1-.02-.02a3.93 3.93 0 0 1-2.808 1.189 3.996 3.996 0 0 1-3.997-3.997c0-1.1.46-2.09 1.19-2.809l-.02-.02.999-1 .02.02a3.93 3.93 0 0 1 2.808-1.188q.334.001.649.064L2.293 3.707a1 1 0 0 1 0-1.414m5.71 7.124-2.292 2.29a1.002 1.002 0 0 1-1.42-1.42l2.292-2.29-.694-.694-3.296 3.295.01.01c-.36.36-.6.85-.6 1.4 0 1.099.9 1.998 2 1.998.55 0 1.039-.24 1.399-.6l.01.01 3.295-3.295zm.702-3.54 1.584-1.585a1.002 1.002 0 0 1 1.42 1.42l-1.585 1.583z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M16 0c2.21 0 4 1.79 4 4 0 1.11-.46 2.09-1.18 2.82l.01.01-3 3-.01-.01a4.05 4.05 0 0 1-2.064 1.107l-.932-.931L17.41 5.41c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2-.55 0-1.05.22-1.41.58L10 7.17l-.927-.926A4.05 4.05 0 0 1 10.18 4.18l-.01-.01 3-3 .01.01C13.91.46 14.89 0 16 0m-5.296 7.876L13.29 5.29a1.003 1.003 0 1 1 1.42 1.42l-2.586 2.586zM8.583 9.997l-.7-.7L2.59 14.59c-.37.36-.59.86-.59 1.41 0 1.1.9 2 2 2 .55 0 1.05-.22 1.41-.58l1-1 4.298-4.298-.705-.705L6.71 14.71a1.004 1.004 0 1 1-1.42-1.42zm-.934-.934L3.293 4.707a1 1 0 0 1 1.414-1.414l12 12a1 1 0 0 1-1.414 1.414l-4.356-4.356c.04.21.063.423.063.649 0 1.11-.46 2.09-1.18 2.82l.01.01-3 3-.01-.01C6.09 19.54 5.11 20 4 20c-2.21 0-4-1.79-4-4 0-1.11.46-2.09 1.18-2.82l-.01-.01 3-3 .01.01C4.91 9.46 5.89 9 7 9c.225 0 .438.023.649.063"] as readonly string[];

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