// "Rt" monogram with built-in glow stack and clipped sweep highlight.
// All effects render inside a single SVG so the sweep beam clips perfectly
// to the vector path via <clipPath>.

const RT_VIEWBOX_W = 135;
const RT_VIEWBOX_H = 146;
const RT_PATH = "M39.13 4.5L38.9 4.75L34.84 5L34.67 5.24L32.81 5.51L32.67 5.74L31.58 5.76L31.44 5.99L29.31 6.51L28.67 6.99L27.81 7.01L25.7 8.24L25.05 8.26L24.71 8.73L23.3 9.26L22.95 9.74L22.04 10.02L21.71 10.48L20.54 11.03L19.96 11.73L18.79 12.28L17.96 13.23L17.54 13.28L15.71 15.22L15.29 15.28L15.22 15.71L12.78 18.04L12.73 18.46L11.53 19.54L10.98 20.71L10.27 21.29L9.74 22.7L9.27 23.04L8.99 23.95L8.51 24.3L7.49 26.7L7.01 27.05L6.74 28.44L6.01 29.56L5.99 30.42L5.76 30.56L5.74 31.17L5.51 31.31L5.24 32.69L5.01 32.83L4.75 34.91L4.5 35.1L4.5 36.41L4.25 36.59L4.25 37.91L4 38.09L4 41.4L3.75 41.62L3.75 43.15L4 43.37L4 45.9L3.75 46.12L3.75 70.63L4 70.87L4 71.91L3.75 72.12L3.75 74.15L4 74.37L4 75.41L3.75 75.62L3.75 82.38L4 82.62L3.75 83.12L3.75 85.65L4 85.87L4 88.65L3.75 88.87L3.75 92.38L4 92.62L4 93.91L3.75 94.12L3.75 104.88L4 105.09L4 106.63L3.75 106.85L3.75 108.63L4 108.84L4 110.38L3.75 110.6L3.75 112.38L4 112.59L4.26 114.92L5.26 116.95L5.73 117.29L6.28 118.46L7.54 119.72L7.95 119.76L8.54 120.48L11.55 121.99L12.91 122L13.12 122.25L16.4 122.25L16.58 122.01L18.44 121.74L20.46 120.73L21.05 120.01L21.46 119.97L22.29 119.03L22.98 118.71L23.02 118.29L23.73 117.71L23.76 117.3L24.23 116.96L24.99 115.44L25.26 113.58L25.5 113.4L25.5 111.34L25.75 111.13L25.75 83.12L25.5 82.91L25.5 81.62L25.75 81.38L25.75 40.12L26 39.91L26.01 38.83L26.24 38.69L26.26 37.83L26.74 37.19L27.01 35.81L27.74 34.95L28.27 33.54L29.22 32.71L29.28 32.29L32.79 29.02L36.81 27.01L38.42 26.74L38.59 26.5L39.42 26.49L39.59 26.25L44.88 26.25L45.09 26.5L46.17 26.51L46.33 26.74L47.16 26.75L47.33 26.99L48.94 27.26L50.95 28.26L52.54 29.73L52.96 29.78L54.04 30.97L54.72 31.29L54.77 31.71L55.47 32.29L55.52 32.71L56.73 34.04L57.74 36.06L57.76 36.67L58.49 38.06L58.76 39.67L59 39.84L59 42.9L59.25 43.13L59 43.35L58.99 46.42L58.76 46.56L58.49 47.95L58.01 48.56L57.99 49.45L56.98 51.46L56.01 52.55L55.98 52.96L55.03 53.79L54.98 54.21L54.21 54.97L53.79 55.03L51.71 56.97L50.8 57.26L50.21 57.98L49.8 58.01L49.46 58.48L48.29 59.03L45.78 61.54L45.74 61.95L45.27 62.29L44.99 63.2L44.26 64.06L44.24 64.67L44.01 64.81L43.99 65.42L43.76 65.56L43.74 66.17L43.26 66.81L43.24 67.67L43 67.84L43 71.9L43.24 72.08L43.26 72.94L43.74 73.58L43.76 74.19L43.99 74.33L44.01 75.19L45.27 77.71L45.98 78.29L46.03 78.71L49.29 81.73L51.31 82.74L51.92 82.76L52.06 82.99L52.67 83.01L53.59 83.5L55.15 83.5L55.37 83.75L75.63 83.75L76.21 84.03L76.74 84.55L76.76 85.17L77 85.37L76.99 86.17L76.75 86.37L76.76 87.17L77 87.37L77 98.88L76.76 99.08L76.75 99.88L77 100.1L77 104.13L77.25 104.35L77.25 105.91L77.5 106.09L77.5 107.16L77.75 107.34L77.75 108.41L78 108.59L78.26 110.67L78.49 110.81L78.51 111.42L78.74 111.56L79.51 114.44L81.24 117.81L81.26 118.45L81.99 119.3L82.26 120.45L82.73 120.79L83.77 122.96L84.48 123.54L84.52 123.96L85.23 124.54L85.27 124.96L85.98 125.54L86.01 125.95L86.73 126.54L86.78 126.96L87.98 128.04L88.03 128.46L89.29 129.72L89.71 129.78L90.03 130.46L91.22 131.29L91.29 131.72L91.71 131.78L92.79 132.97L93.21 133.02L93.8 133.74L94.21 133.77L95.04 134.73L95.95 135.01L97.04 135.98L97.46 136.02L98.04 136.73L102.56 138.99L103.19 139.01L104.31 139.74L106.44 140.26L107.83 140.99L108.92 141.01L109.06 141.24L109.67 141.26L110.59 141.75L111.42 141.76L111.59 142L113.16 142L113.34 142.25L116.41 142.5L116.62 142.75L122.41 142.75L123.33 142.26L123.94 142.24L124.08 142.01L124.69 141.99L126.71 140.97L129.47 138.21L129.51 137.8L129.98 137.46L130.74 135.94L131.01 134.33L131.25 134.16L131.26 133.08L131.5 132.88L131.5 131.1L131.25 130.91L130.99 128.58L129.48 125.54L127.46 123.28L127.04 123.23L126.7 122.76L124.19 121.51L122.81 121.24L122.67 121.01L117.09 120.75L116.92 120.51L114.83 120.24L114.69 120.01L113.83 119.99L112.44 119.26L111.81 119.24L109.29 117.98L108.2 117.01L107.79 116.98L103.27 112.71L103.23 112.29L101.76 110.45L100.01 106.95L99.49 104.81L99.26 104.67L99.24 103.83L99 103.66L99 101.85L98.75 101.63L98.75 84.59L99.04 84.03L99.62 83.75L121.65 83.75L121.83 83.51L122.91 83.5L123.08 83.26L124.69 82.99L126.7 81.99L127.29 81.28L127.97 80.96L128.02 80.54L129.73 78.71L129.76 78.3L130.23 77.96L130.74 76.94L131.01 75.33L131.25 75.16L131.25 74.09L131.5 73.9L131.5 71.59L131.26 71.42L131.25 70.59L131.01 70.42L130.74 68.81L129.99 67.3L128.52 65.71L128.47 65.29L126.46 63.52L124.94 62.76L124.33 62.74L123.41 62.25L122.58 62.24L122.4 62L77.29 61.98L76.76 60.83L77.74 58.94L77.76 58.3L78.24 57.69L78.26 57.05L78.99 55.94L79.01 55.08L79.24 54.94L79.51 53.55L79.99 52.92L80 51.84L80.49 50.92L80.5 49.59L80.75 49.41L80.75 47.1L81 46.88L81 39.6L80.75 39.4L80.75 36.84L80.26 36.17L80.24 35.33L80 35.15L79.99 33.58L79.51 32.94L78.74 29.81L78.26 29.19L77.99 27.8L77.01 26.19L76.99 25.55L76.01 24.19L75.99 23.55L75.27 22.96L74.99 22.05L74.02 20.96L73.73 20.04L72.03 18.21L71.97 17.79L69.78 15.71L69.72 15.29L69.29 15.22L68.21 14.02L67.79 13.97L65.71 11.78L65.3 11.74L63.46 10.27L62.05 9.74L61.71 9.27L60.3 8.74L59.96 8.27L58.94 7.76L58.31 7.74L56.69 6.76L55.83 6.74L54.42 6.01L53.34 6L53.17 5.76L51.56 5.49L51.42 5.26L48.84 5L48.66 4.75L46.35 4.75L46.13 4.5L39.15 4.5Z";

const RtPath = (props) => (
  <svg viewBox={`0 0 ${RT_VIEWBOX_W} ${RT_VIEWBOX_H}`} xmlns="http://www.w3.org/2000/svg" {...props}>
    <path d={RT_PATH} fill="currentColor" fillRule="evenodd" />
  </svg>
);

function RtLogoWithSweep({ accent = "#7cc8ff", core = "#eaf6ff", sweep = true, sweepDur = 6, ...props }) {
  const cid = React.useId().replace(/:/g, "_");
  const clipId = "rtclip_" + cid;
  const gradId = "rtgrad_" + cid;
  return (
    <svg viewBox={`0 0 ${RT_VIEWBOX_W} ${RT_VIEWBOX_H}`} xmlns="http://www.w3.org/2000/svg" {...props}>
      <defs>
        <clipPath id={clipId}>
          <path d={RT_PATH} fillRule="evenodd" />
        </clipPath>
        <linearGradient id={gradId} x1="0" y1="0" x2="1" y2="0" gradientTransform="rotate(15 0.5 0.5)">
          <stop offset="0%"   stopColor="#ffffff" stopOpacity="0" />
          <stop offset="44%"  stopColor="#ffffff" stopOpacity="0" />
          <stop offset="50%"  stopColor="#ffffff" stopOpacity="1" />
          <stop offset="56%"  stopColor="#ffffff" stopOpacity="0" />
          <stop offset="100%" stopColor="#ffffff" stopOpacity="0" />
        </linearGradient>
      </defs>
      <path d={RT_PATH} fill={core} fillRule="evenodd" />
      {sweep && (
        <g clipPath={`url(#${clipId})`}>
          <rect
            x={-RT_VIEWBOX_W * 1.5}
            y={-RT_VIEWBOX_H * 0.5}
            width={RT_VIEWBOX_W * 3}
            height={RT_VIEWBOX_H * 2}
            fill={`url(#${gradId})`}
            style={{
              animation: `rtSweep ${sweepDur}s ease-in-out infinite`,
              transformOrigin: "center",
              mixBlendMode: "screen",
            }}
          />
        </g>
      )}
    </svg>
  );
}

window.RtPath = RtPath;
window.RtLogoWithSweep = RtLogoWithSweep;
window.RT_VIEWBOX_W = RT_VIEWBOX_W;
window.RT_VIEWBOX_H = RT_VIEWBOX_H;
window.RT_PATH = RT_PATH;
