/*
 * 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";

export const Spin: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const pixelGridSize = isLarge ? IconSize.LARGE : IconSize.STANDARD;
    const translation = `${-1 * pixelGridSize / 0.05 / 2}`;
    const style = { transformOrigin: "center" };
    return (
        <SVGIconContainer iconName="spin" ref={ref} {...props}>
            <path
                d={isLarge ? "M126.16 233.88A20.6 20.6 0 0 0 155.44 233.88L214.02 174.78L215.44 173.18C222.08 164.98 221.6 152.88 214.02 145.22L155.44 86.12A20.6 20.6 0 0 0 126.16 86.12A21 21 0 0 0 126.16 115.68L147.5 137.22C123.86 134.62 102.4 130.38 84.94 124.72C64.14 117.98 49.78 109.54 43.56 100.38Q38.9 93.44 40.48 86.5Q42.04 79.54 49.76 72.88C60.02 64.0799999999999 78.02 56.36 101.64 50.6S153.6 41.26 183.4 40.2799999999999S243.3 40.9599999999999 270.24 45.0799999999999C297.18 49.1799999999998 319.9000000000001 55.5799999999999 335.8 63.5199999999999Q347.72 69.5199999999999 353.9 76.2199999999999C358.02 80.6999999999999 360.1 85.36 360.1 90.0199999999999A20 20 0 0 0 400.1 90.0199999999999C400.1 72.4999999999999 392.04 58.6399999999999 383.36 49.18C374.86 39.9199999999999 364.2000000000001 32.9999999999999 353.68 27.74C332.62 17.2199999999999 305.38 9.9799999999999 276.2799999999999 5.54A520 520 0 0 0 182.0999999999999 0.3C150.12 1.3399999999999 118.9599999999999 5.1999999999999 92.1399999999999 11.7399999999999C66.5399999999999 17.98 41.1799999999999 27.5399999999999 23.7199999999999 42.5399999999999C14.6399999999999 50.3199999999999 5.0199999999999 61.8599999999999 1.4599999999999 77.6999999999999C-2.4000000000001 94.7999999999999 2.1799999999999 110.6399999999999 10.4599999999999 122.8399999999999C24.6199999999999 143.7199999999999 50.2599999999999 155.5399999999999 72.5799999999999 162.7599999999999C95.6599999999999 170.2399999999999 123.2599999999999 175.2599999999999 152.38 177.8799999999999L126.18 204.3199999999999A21 21 0 0 0 126.18 233.8799999999999M224.76 393.8799999999999A20.6 20.6 0 0 0 254.04 393.8799999999999C262.12 385.7199999999999 262.12 372.4799999999999 254.04 364.3199999999999L229.14 339.2199999999999C257.7 337.6999999999999 285.3 333.9199999999999 309.3399999999999 327.9599999999999C325.02 324.0599999999999 339.66 319.0999999999999 352.26 312.9599999999999C364.3399999999999 307.0999999999999 377.32 298.7999999999999 386.7799999999999 286.8199999999999C397.1799999999999 273.6799999999999 403.6399999999999 255.2799999999999 398.08 235.0999999999999C393.14 217.1999999999999 380.64 205.0199999999999 369.76 197.2999999999999C348.1599999999999 181.9399999999999 316.4599999999999 172.3199999999999 283.56 166.6999999999999A20 20 0 0 0 276.82 206.1199999999999C307.82 211.4199999999999 332.3399999999999 219.7799999999999 346.58 229.8799999999999C353.7 234.9599999999999 358.0199999999999 240.2999999999999 359.5199999999999 245.6999999999999C361 251.0999999999999 359.7 256.6199999999999 355.42 262.0199999999999C351.18 267.3799999999999 344.16 272.4399999999999 334.76 277.0199999999999C325.3399999999999 281.6199999999999 313.5199999999999 285.7199999999999 299.7 289.1399999999999C279.5199999999999 294.1599999999999 255.88 297.5399999999999 230.8399999999999 299.0599999999999L254.04 275.6599999999999A21 21 0 0 0 254.04 246.1199999999999A20.6 20.6 0 0 0 224.7599999999999 246.1199999999999L166.1599999999999 305.2199999999999A21 21 0 0 0 164.7399999999999 333.1999999999999L166.1599999999999 334.7799999999999zM98.3 329.7200000000001A20 20 0 0 0 107.02 290.68C91.8 287.2800000000001 78.72 283.0800000000001 68.28 278.3400000000001C57.82 273.6 49.98 268.28 45.28 262.62C40.48 256.9 39.08 251.08 40.78 245.4C42.46 239.68 47.34 234.02 55.32 228.72A20.02 20.02 0 0 0 33.2 195.4C21.6 203.1 7.92 215.44 2.4 234.04C-3.92 255.4 3.32 274.78 14.56 288.24C24.76 300.44 38.7 308.8400000000001 51.72 314.76C65.34 320.94 81.2 325.9 98.3 329.7200000000001" : "M105.74 194.38A19.6 19.6 0 0 0 133.2 194.38L174.38 153.58L175.7000000000001 152.12A19.1 19.1 0 0 0 174.4 126.4L133.2 85.62A19.6 19.6 0 0 0 105.74 85.62A19.1 19.1 0 0 0 105.74 112.82L109.16 116.22C95.96 114.14 83.92 111.3 73.7 107.78C58.1 102.38 47.34 95.64 42.68 88.3A14.6 14.6 0 0 1 40.36 77.18Q41.52 71.64 47.3 66.3C55 59.2599999999999 68.5 53.1 86.22 48.48S125.18 40.9999999999999 147.54 40.22A340 340 0 0 1 212.68 44.04C232.88 47.3199999999999 249.92 52.4399999999999 261.8400000000001 58.8A48 48 0 0 1 275.46 69.04A18 18 0 0 1 279.78 77.18L280.06 80A20 20 0 0 0 320.06 80C320.06 48.62 294.86 31.08 280.66 23.52C263.42 14.3199999999999 241.66 8.24 219.1 4.58C196.1 0.82 170.9 -0.6200000000001 146.16 0.24C121.48 1.1 97.24 4.28 76.14 9.76C56.2 14.96 35.18 23.16 20.32 36.76C12.48 43.94 4.24 54.56 1.22 68.92A54.6 54.6 0 0 0 8.92 109.76C21.2 129.06 43.12 139.52 60.62 145.56C76.92 151.2 95.8 155.12 115.56 157.44L105.76 167.18A19.1 19.1 0 0 0 105.76 194.38M166.94 314.38A19.6 19.6 0 0 0 194.4 314.38A19.1 19.1 0 0 0 194.4 287.18L186.24 279.14C208.6 277.66 230.2600000000001 274.24 249.14 268.84C269.02 263.18 291.64 253.7 306 236.82C314.04 227.36 320.8400000000001 213.82 320 197.28C319.18 181.08 311.3400000000001 168.54 303.2 160.08C288.26 144.52 265.8 135.58 245.34 130.12A20 20 0 1 0 235.02 168.76C253.46 173.68 267.14 180.3 274.36 187.8C277.96 191.56 279.86 195.46 280.06 199.32Q280.38 205.14 275.52 210.9C269.0800000000001 218.48 256.06 225.26 238.14 230.38A260 260 0 0 1 188.28 238.86L194.4 232.82A19.1 19.1 0 0 0 194.4 205.62A19.6 19.6 0 0 0 166.94 205.62L125.76 246.42A19.1 19.1 0 0 0 125.76 273.6zM58.94 264.98A20 20 0 0 0 72.38 227.3C60.48 223.06 51.48 218 46.04 212.46C40.48 206.8 38.9 200.92 40.92 195.26A20 20 0 0 0 3.24 181.86C-5.46 206.26 4.86 227.62 17.52 240.48C29.04 252.22 44.52 259.82 58.94 264.98"}
                fillRule="evenodd"
                transform={`scale(0.05, -0.05) translate(${translation}, ${translation})`}
                style={style}
            />
        </SVGIconContainer>
   );
});
Spin.displayName = `Blueprint6.Icon.Spin`;
export default Spin;
