"use client";
'use strict';

var react = require('react');
var jsxRuntime = require('react/jsx-runtime');

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function TickerTape() {
  const container = react.useRef(null);
  react.useEffect(() => {
    if (!container.current) return;
    if (container.current.dataset.initialized === "true") {
      return;
    }
    container.current.dataset.initialized = "true";
    const script = document.createElement("script");
    script.src = "https://s3.tradingview.com/external-embedding/embed-widget-ticker-tape.js";
    script.type = "text/javascript";
    script.async = true;
    script.innerHTML = JSON.stringify({
      symbols: [
        { proName: "FOREXCOM:SPXUSD", title: "S&P 500" },
        { proName: "FOREXCOM:NSXUSD", title: "US 100" },
        { proName: "FX_IDC:EURUSD", title: "EUR/USD" },
        { proName: "BITSTAMP:BTCUSD", title: "Bitcoin" },
        { proName: "BITSTAMP:ETHUSD", title: "Ethereum" },
        { description: "Tesla", proName: "NASDAQ:TSLA" },
        { description: "Apple", proName: "NASDAQ:AAPL" },
        { description: "Amazon", proName: "NASDAQ:AMZN" },
        { description: "NVIDIA", proName: "NASDAQ:NVDA" },
        { description: "Microsoft", proName: "NASDAQ:MSFT" },
        { description: "Google", proName: "NASDAQ:GOOGL" },
        { description: "Meta", proName: "NASDAQ:META" }
      ],
      showSymbolLogo: true,
      isTransparent: false,
      displayMode: "adaptive",
      colorTheme: "dark",
      locale: "en"
    });
    container.current.appendChild(script);
    return () => {
      if (container.current) {
        delete container.current.dataset.initialized;
        const scripts = container.current.querySelectorAll("script");
        scripts.forEach((s) => s.remove());
      }
    };
  }, []);
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tradingview-widget-container w-full", ref: container, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tradingview-widget-container__widget" }) });
}
__name(TickerTape, "TickerTape");
var TickerTape_default = react.memo(TickerTape);

module.exports = TickerTape_default;
