import { computed as h, ref as v, watch as fe, onMounted as Oe, onBeforeUnmount as Be, openBlock as s, createElementBlock as u, normalizeClass as ge, normalizeStyle as be, createBlock as N, createCommentVNode as c, unref as p, createSlots as Pe, withCtx as b, renderSlot as m, normalizeProps as L, guardReactiveProps as R, createVNode as me, createElementVNode as n, Fragment as S, renderList as z, toDisplayString as V, createTextVNode as Me, nextTick as Ue } from "vue";
import { u as Ee, c as De, t as We, o as Ge, e as C, C as Xe, v as I, X as je, w as D, D as He, s as Ye, x as qe, y as Je, q as Ke, r as Qe, E as xe } from "./index-DK7qqHGP.js";
import { t as Ze, u as et } from "./useResponsive-NZB-WLRF.js";
import { _ as tt } from "./Title-Cxlu3Etv.js";
import { u as lt, U as ot } from "./usePrinter-Cza87yNE.js";
import { _ as at } from "./Tooltip-Bt9pHzBM.js";
import { D as st } from "./DataTable-B9SSwFM2.js";
import ut from "./vue-ui-skeleton-CQnYuosp.js";
import { S as it } from "./Slicer-Bk9LTQad.js";
import nt from "./vue-ui-accordion-5C4CP3gA.js";
import { u as ke } from "./useNestedProp-0nRX_rTi.js";
import { _ as rt } from "./PackageVersion-I1_4jcn_.js";
import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const dt = ["id"], yt = ["xmlns", "viewBox"], ct = { key: 0 }, ht = ["id"], pt = ["stop-color"], ft = ["stop-color"], gt = ["stop-color"], bt = ["id"], mt = ["stop-color"], xt = ["stop-color"], kt = ["stop-color"], wt = { key: 0 }, $t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ct = { key: 1 }, Nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], St = ["x", "y", "font-size", "fill", "font-weight"], zt = { key: 2 }, Tt = ["transform", "text-anchor", "font-size", "fill", "font-weight"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ft = { key: 0 }, Lt = ["cx", "cy", "r", "fill"], Rt = ["cx", "cy", "r", "fill"], Vt = { key: 1 }, It = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Bt = ["x", "y", "height", "width", "fill", "rx"], Pt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], Mt = ["x", "y", "height", "width", "fill", "onMouseover"], Ut = {
  key: 3,
  class: "vue-data-ui-watermark"
}, Et = ["innerHTML"], Dt = {
  __name: "vue-ui-candlestick",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  setup($, { expose: we }) {
    const k = $, { vue_ui_candlestick: $e } = Ee(), T = h(() => !!k.dataset && k.dataset.length), x = v(De()), _e = v(null), W = v(!1), G = v(""), X = v(void 0), q = v(0), A = v(null), J = v(null), K = v(null), Q = v(null), O = v(0), Z = v(0), ee = v(0), e = h({
      get: () => te(),
      set: (t) => t
    });
    function te() {
      const t = ke({
        userConfig: k.config,
        defaultConfig: $e
      });
      return t.theme ? {
        ...ke({
          userConfig: We.vue_ui_candlestick[t.theme] || k.config,
          defaultConfig: t
        })
      } : t;
    }
    fe(() => k.config, (t) => {
      e.value = te(), le(), O.value += 1, ee.value += 1, Z.value += 1;
    }, { deep: !0 }), fe(() => k.dataset, (t) => {
      y.value.start = 0, y.value.end = t.length, O.value += 1;
    }, { deep: !0 });
    const d = v({
      height: e.value.style.height,
      width: e.value.style.width,
      xAxisFontSize: e.value.style.layout.grid.xAxis.dataLabels.fontSize,
      yAxisFontSize: e.value.style.layout.grid.yAxis.dataLabels.fontSize
    }), B = v(null);
    Oe(() => {
      le();
    });
    function le() {
      if (Ge(k.dataset) && C({
        componentName: "VueUiCandlestick",
        type: "dataset"
      }), e.value.responsive) {
        const t = Ze(() => {
          const { width: a, height: l } = et({
            chart: A.value,
            title: e.value.style.title.text ? J.value : null,
            slicer: Q.value,
            legend: K.value
          });
          d.value.width = a, d.value.height = l, d.value.xAxisFontSize = xe({
            relator: Math.min(a, l),
            adjuster: e.value.style.width,
            source: e.value.style.layout.grid.xAxis.dataLabels.fontSize,
            threshold: 6,
            fallback: 6
          }), d.value.yAxisFontSize = xe({
            relator: Math.min(a, l),
            adjuster: e.value.style.width,
            source: e.value.style.layout.grid.yAxis.dataLabels.fontSize,
            threshold: 6,
            fallback: 6
          });
        });
        B.value = new ResizeObserver(t), B.value.observe(A.value.parentNode);
      }
    }
    Be(() => {
      B.value && B.value.disconnect();
    });
    const { isPrinting: oe, isImaging: ae, generatePdf: se, generateImage: ue } = lt({
      elementId: `vue-ui-candlestick_${x.value}`,
      fileName: e.value.style.title.text || "vue-ui-candlestick"
    }), w = v({
      showTable: e.value.table.show,
      showTooltip: e.value.style.tooltip.show
    }), i = h(() => {
      const { top: t, right: a, bottom: l, left: o } = e.value.style.layout.padding;
      return {
        top: t,
        right: d.value.width - a,
        left: o,
        bottom: d.value.height - l,
        width: d.value.width - o - a,
        height: d.value.height - t - l
      };
    }), j = h(() => k.dataset.length), y = v({
      start: 0,
      end: j.value
    }), ie = h(() => k.dataset.slice(y.value.start, y.value.end)), H = h(() => (k.dataset.forEach((t, a) => {
      [null, void 0].includes(t[0]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "period (index 0)",
        index: a
      }), [null, void 0].includes(t[1]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "open (index 1)",
        index: a
      }), [null, void 0].includes(t[2]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "high (index 2)",
        index: a
      }), [null, void 0].includes(t[3]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "low (index 3)",
        index: a
      }), [null, void 0].includes(t[4]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "last (index 4)",
        index: a
      }), [null, void 0].includes(t[5]) && C({
        componentName: "VueUiCandlestick",
        type: "datasetAttribute",
        property: "volume (index 5)",
        index: a
      });
    }), ie.value.map((t) => ({
      period: t[0],
      open: t[1],
      high: t[2],
      low: t[3],
      last: t[4],
      volume: t[5]
    })))), r = h(() => i.value.width / ie.value.length), ne = h(() => ({
      max: Math.max(...H.value.map((t) => t.high)),
      min: 0
    })), _ = h(() => Xe(ne.value.min, ne.value.max, e.value.style.layout.grid.yAxis.dataLabels.steps));
    function P(t, a) {
      return {
        ...t,
        x: I(i.value.left + a * r.value + r.value / 2),
        y: I(i.value.top + (1 - t / _.value.max) * i.value.height),
        value: I(t)
      };
    }
    const f = h(() => H.value.map((t, a) => {
      const l = P(t.open, a), o = P(t.high, a), g = P(t.low, a), U = P(t.last, a), E = t.last > t.open;
      return {
        period: t.period,
        open: l,
        high: o,
        low: g,
        last: U,
        volume: t.volume,
        isBullish: E
      };
    }));
    function Ce(t) {
      return I(t / _.value.max);
    }
    const Ne = h(() => _.value.ticks.map((t) => ({
      y: i.value.bottom - i.value.height * Ce(t),
      value: I(t)
    }))), Se = h(() => H.value.map((t) => t.period)), Y = v(null);
    function ze(t, a) {
      X.value = t, Y.value = {
        datapoint: a,
        seriesIndex: t,
        series: f.value,
        config: e.value
      };
      const l = e.value.style.tooltip.customFormat;
      if (qe(l) && Je(() => l({
        seriesIndex: t,
        datapoint: a,
        series: f.value,
        config: e.value
      })))
        G.value = l({
          seriesIndex: t,
          datapoint: a,
          series: f.value,
          config: e.value
        });
      else if (e.value.style.tooltip.show) {
        let o = "";
        const { period: g, open: U, high: E, low: ye, last: ce, volume: he, isBullish: pe } = f.value[t], { period: Wt, open: Fe, high: Le, low: Re, last: Ve, volume: Ie } = e.value.translations;
        o += `<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${e.value.style.layout.candle.borderRadius * 3}" stroke="${e.value.style.layout.candle.stroke}" stroke-width="${e.value.style.layout.candle.strokeWidth}" 
                fill="${e.value.style.layout.candle.gradient.show ? pe ? `url(#bullish_gradient_${x.value})` : `url(#bearish_gradient_${x.value})` : pe ? e.value.style.layout.candle.colors.bullish : e.value.style.layout.candle.colors.bearish}"/></svg>${g}</div>`, o += `${Ie} : <b>${isNaN(he) ? "-" : Number(he.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()}</b>`, o += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`, o += `<div>${Fe}: <b>${e.value.style.tooltip.prefix} ${isNaN(U.value) ? "-" : Number(U.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`, o += `<div>${Le}: <b>${e.value.style.tooltip.prefix} ${isNaN(E.value) ? "-" : Number(E.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`, o += `<div>${Re}: <b>${e.value.style.tooltip.prefix} ${isNaN(ye.value) ? "-" : Number(ye.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`, o += `<div>${Ve}: <b>${e.value.style.tooltip.prefix} ${isNaN(ce.value) ? "-" : Number(ce.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`, o += "</div>", G.value = `<div style="text-align:right">${o}</div>`;
      }
      W.value = !0;
    }
    function Te() {
      y.value = {
        start: 0,
        end: j.value
      }, O.value += 1;
    }
    function re() {
      Ue(() => {
        const t = [e.value.translations.period, e.value.translations.open, e.value.translations.high, e.value.translations.low, e.value.translations.last, e.value.translations.volume], a = f.value.map((g) => [
          g.period,
          g.open.value,
          g.high.value,
          g.low.value,
          g.last.value,
          g.volume
        ]), l = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(a), o = Ke(l);
        Qe({ csvContent: o, title: e.value.style.title.text || "vue-ui-candlestick" });
      });
    }
    const M = h(() => {
      const t = f.value.map((o) => [
        `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${e.value.style.layout.candle.borderRadius * 3}" fill="${e.value.style.layout.candle.gradient.show ? o.isBullish ? `url(#bullish_gradient_${x.value}` : `url(#bearish_gradient_${x.value})` : o.isBullish ? e.value.style.layout.candle.colors.bullish : e.value.style.layout.candle.colors.bearish}"/></svg> ${o.period}`,
        `${e.value.table.td.prefix} ${isNaN(o.open.value) ? "-" : Number(o.open.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,
        `${e.value.table.td.prefix} ${isNaN(o.high.value) ? "-" : Number(o.high.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,
        `${e.value.table.td.prefix} ${isNaN(o.low.value) ? "-" : Number(o.low.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,
        `${e.value.table.td.prefix} ${isNaN(o.last.value) ? "-" : Number(o.last.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,
        `${isNaN(o.volume) ? "-" : o.volume.toLocaleString()}`
      ]), a = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      }, l = [
        e.value.translations.period,
        e.value.translations.open,
        e.value.translations.high,
        e.value.translations.low,
        e.value.translations.last,
        e.value.translations.volume
      ];
      return { head: l, body: t, config: a, colNames: l };
    }), F = v(!1);
    function Ae(t) {
      F.value = t, q.value += 1;
    }
    function ve() {
      w.value.showTable = !w.value.showTable;
    }
    function de() {
      w.value.showTooltip = !w.value.showTooltip;
    }
    return we({
      generatePdf: se,
      generateCsv: re,
      generateImage: ue,
      toggleTable: ve,
      toggleTooltip: de
    }), (t, a) => (s(), u("div", {
      ref_key: "candlestickChart",
      ref: A,
      class: ge(`vue-ui-candlestick ${F.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: be(`position:relative;font-family:${e.value.style.fontFamily}; text-align:center;${e.value.style.title.text ? "" : "padding-top:36px"};background:${e.value.style.backgroundColor}; ${e.value.responsive ? "height: 100%" : ""}`),
      id: `vue-ui-candlestick_${x.value}`
    }, [
      e.value.style.title.text ? (s(), u("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: J,
        style: "width:100%;background:transparent"
      }, [
        (s(), N(tt, {
          key: `title_${ee.value}`,
          config: {
            title: {
              cy: "candlestick-div-title",
              ...e.value.style.title
            },
            subtitle: {
              cy: "candlestick-div-subtitle",
              ...e.value.style.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : c("", !0),
      e.value.userOptions.show && T.value ? (s(), N(ot, {
        ref_key: "details",
        ref: _e,
        key: `user_options_${q.value}`,
        backgroundColor: e.value.style.backgroundColor,
        color: e.value.style.color,
        isImaging: p(ae),
        isPrinting: p(oe),
        uid: x.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: F.value,
        isTooltip: w.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        position: e.value.userOptions.position,
        onToggleFullscreen: Ae,
        onGeneratePdf: p(se),
        onGenerateCsv: re,
        onGenerateImage: p(ue),
        onToggleTable: ve,
        onToggleTooltip: de
      }, Pe({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: b(() => [
            m(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: b(() => [
            m(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: b(() => [
            m(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: b(() => [
            m(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: b(() => [
            m(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: b(({ toggleFullscreen: l, isFullscreen: o }) => [
            m(t.$slots, "optionFullscreen", L(R({ toggleFullscreen: l, isFullscreen: o })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : c("", !0),
      T.value ? (s(), u("svg", {
        key: 2,
        xmlns: p(je),
        class: ge({ "vue-data-ui-fullscreen--on": F.value, "vue-data-ui-fulscreen--off": !F.value }),
        viewBox: `0 0 ${d.value.width <= 0 ? 10 : d.value.width} ${d.value.height <= 0 ? 10 : d.value.height}`,
        style: be(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.color}`)
      }, [
        me(rt),
        f.value.length > 0 ? (s(), u("g", ct, [
          n("defs", null, [
            n("linearGradient", {
              id: `bearish_gradient_${x.value}`,
              x2: "0%",
              y2: "100%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.layout.candle.colors.bearish
              }, null, 8, pt),
              n("stop", {
                offset: "50%",
                "stop-color": `${p(D)(e.value.style.layout.candle.colors.bearish, 0.02)}DE`
              }, null, 8, ft),
              n("stop", {
                offset: "100%",
                "stop-color": `${p(D)(e.value.style.layout.candle.colors.bearish, 0.05)}66`
              }, null, 8, gt)
            ], 8, ht),
            n("linearGradient", {
              id: `bullish_gradient_${x.value}`,
              x2: "0%",
              y2: "100%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.layout.candle.colors.bullish
              }, null, 8, mt),
              n("stop", {
                offset: "50%",
                "stop-color": `${p(D)(e.value.style.layout.candle.colors.bullish, 0.02)}DE`
              }, null, 8, xt),
              n("stop", {
                offset: "100%",
                "stop-color": `${p(D)(e.value.style.layout.candle.colors.bullish, 0.05)}66`
              }, null, 8, kt)
            ], 8, bt)
          ]),
          e.value.style.layout.grid.show ? (s(), u("g", wt, [
            n("line", {
              x1: i.value.left,
              x2: i.value.left,
              y1: i.value.top,
              y2: i.value.bottom,
              stroke: e.value.style.layout.grid.stroke,
              "stroke-width": e.value.style.layout.grid.strokeWidth,
              "stroke-linecap": "round"
            }, null, 8, $t),
            n("line", {
              x1: i.value.left,
              x2: i.value.right,
              y1: i.value.bottom,
              y2: i.value.bottom,
              stroke: e.value.style.layout.grid.stroke,
              "stroke-width": e.value.style.layout.grid.strokeWidth,
              "stroke-linecap": "round"
            }, null, 8, _t)
          ])) : c("", !0),
          e.value.style.layout.grid.yAxis.dataLabels.show ? (s(), u("g", Ct, [
            (s(!0), u(S, null, z(Ne.value, (l, o) => (s(), u("g", null, [
              l.value >= _.value.min && l.value <= _.value.max ? (s(), u("line", {
                key: 0,
                x1: i.value.left,
                x2: i.value.left - 5,
                y1: l.y,
                y2: l.y,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, Nt)) : c("", !0),
              l.value >= _.value.min && l.value <= _.value.max ? (s(), u("text", {
                key: 1,
                x: i.value.left - 8 + e.value.style.layout.grid.yAxis.dataLabels.offsetX,
                y: l.y + d.value.yAxisFontSize / 3,
                "font-size": d.value.yAxisFontSize,
                "text-anchor": "end",
                fill: e.value.style.layout.grid.yAxis.dataLabels.color,
                "font-weight": e.value.style.layout.grid.yAxis.dataLabels.bold ? "bold" : "normal"
              }, V(e.value.style.layout.grid.yAxis.dataLabels.prefix) + " " + V(p(He)(l.value) ? l.value.toFixed(e.value.style.layout.grid.yAxis.dataLabels.roundingValue) : "") + " " + V(e.value.style.layout.grid.yAxis.dataLabels.suffix), 9, St)) : c("", !0)
            ]))), 256))
          ])) : c("", !0),
          e.value.style.layout.grid.xAxis.dataLabels.show ? (s(), u("g", zt, [
            (s(!0), u(S, null, z(Se.value, (l, o) => (s(), u("g", null, [
              n("text", {
                transform: `translate(${i.value.left + r.value * o + r.value / 2}, ${i.value.bottom + d.value.xAxisFontSize * 2 + e.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${e.value.style.layout.grid.xAxis.dataLabels.rotation})`,
                "text-anchor": e.value.style.layout.grid.xAxis.dataLabels.rotation > 0 ? "start" : e.value.style.layout.grid.xAxis.dataLabels.rotation < 0 ? "end" : "middle",
                "font-size": d.value.xAxisFontSize,
                fill: e.value.style.layout.grid.xAxis.dataLabels.color,
                "font-weight": e.value.style.layout.grid.xAxis.dataLabels.bold ? "bold" : "normal"
              }, V(l), 9, Tt)
            ]))), 256))
          ])) : c("", !0),
          n("g", null, [
            (s(!0), u(S, null, z(f.value, (l, o) => (s(), u("g", null, [
              n("line", {
                x1: l.open.x,
                x2: l.open.x,
                y1: l.high.y,
                y2: l.low.y,
                stroke: e.value.style.layout.wick.stroke,
                "stroke-width": e.value.style.layout.wick.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, At),
              e.value.style.layout.wick.extremity.shape === "circle" ? (s(), u("g", Ft, [
                n("circle", {
                  cx: l.high.x,
                  cy: l.high.y,
                  r: e.value.style.layout.wick.extremity.size === "auto" ? r.value / 20 : e.value.style.layout.wick.extremity.size,
                  fill: e.value.style.layout.wick.extremity.color
                }, null, 8, Lt),
                n("circle", {
                  cx: l.low.x,
                  cy: l.low.y,
                  r: e.value.style.layout.wick.extremity.size === "auto" ? r.value / 20 : e.value.style.layout.wick.extremity.size,
                  fill: e.value.style.layout.wick.extremity.color
                }, null, 8, Rt)
              ])) : c("", !0),
              e.value.style.layout.wick.extremity.shape === "line" ? (s(), u("g", Vt, [
                n("line", {
                  x1: l.high.x - (e.value.style.layout.wick.extremity.size === "auto" ? r.value * e.value.style.layout.candle.widthRatio : e.value.style.layout.wick.extremity.size) / 2,
                  x2: l.high.x + (e.value.style.layout.wick.extremity.size === "auto" ? r.value * e.value.style.layout.candle.widthRatio : e.value.style.layout.wick.extremity.size) / 2,
                  y1: l.high.y,
                  y2: l.high.y,
                  stroke: e.value.style.layout.wick.extremity.color,
                  "stroke-width": e.value.style.layout.wick.strokeWidth,
                  "stroke-linecap": "round"
                }, null, 8, It),
                n("line", {
                  x1: l.low.x - (e.value.style.layout.wick.extremity.size === "auto" ? r.value * e.value.style.layout.candle.widthRatio : e.value.style.layout.wick.extremity.size) / 2,
                  x2: l.low.x + (e.value.style.layout.wick.extremity.size === "auto" ? r.value * e.value.style.layout.candle.widthRatio : e.value.style.layout.wick.extremity.size) / 2,
                  y1: l.low.y,
                  y2: l.low.y,
                  stroke: e.value.style.layout.wick.extremity.color,
                  "stroke-width": e.value.style.layout.wick.strokeWidth,
                  "stroke-linecap": "round"
                }, null, 8, Ot)
              ])) : c("", !0)
            ]))), 256))
          ]),
          n("g", null, [
            (s(!0), u(S, null, z(f.value, (l, o) => (s(), u("rect", {
              x: l.open.x - r.value / 2 + r.value * (1 - e.value.style.layout.candle.widthRatio) / 2,
              y: l.isBullish ? l.last.y : l.open.y,
              height: Math.abs(l.last.y - l.open.y) <= 0 ? 1e-4 : Math.abs(l.last.y - l.open.y),
              width: r.value * e.value.style.layout.candle.widthRatio <= 0 ? 1e-4 : r.value * e.value.style.layout.candle.widthRatio,
              fill: e.value.style.layout.candle.gradient.underlayer,
              rx: e.value.style.layout.candle.borderRadius,
              stroke: "none"
            }, null, 8, Bt))), 256)),
            (s(!0), u(S, null, z(f.value, (l, o) => (s(), u("rect", {
              x: l.open.x - r.value / 2 + r.value * (1 - e.value.style.layout.candle.widthRatio) / 2,
              y: l.isBullish ? l.last.y : l.open.y,
              height: Math.abs(l.last.y - l.open.y) <= 0 ? 1e-4 : Math.abs(l.last.y - l.open.y),
              width: r.value * e.value.style.layout.candle.widthRatio <= 0 ? 1e-4 : r.value * e.value.style.layout.candle.widthRatio,
              fill: l.isBullish ? e.value.style.layout.candle.gradient.show ? `url(#bullish_gradient_${x.value})` : e.value.style.layout.candle.colors.bullish : e.value.style.layout.candle.gradient.show ? `url(#bearish_gradient_${x.value})` : e.value.style.layout.candle.colors.bearish,
              rx: e.value.style.layout.candle.borderRadius,
              stroke: e.value.style.layout.candle.stroke,
              "stroke-width": e.value.style.layout.candle.strokeWidth,
              "stroke-linecap": "round",
              "stroke-linejoin": "round"
            }, null, 8, Pt))), 256))
          ]),
          n("g", null, [
            (s(!0), u(S, null, z(f.value, (l, o) => (s(), u("rect", {
              x: i.value.left + o * r.value,
              y: i.value.top,
              height: i.value.height <= 0 ? 1e-4 : i.value.height,
              width: r.value <= 0 ? 1e-4 : r.value,
              fill: X.value === o ? p(Ye)(e.value.style.layout.selector.color, e.value.style.layout.selector.opacity) : "transparent",
              onMouseover: (g) => ze(o, l),
              onMouseleave: a[0] || (a[0] = (g) => {
                X.value = void 0, W.value = !1;
              })
            }, null, 40, Mt))), 256))
          ])
        ])) : c("", !0),
        m(t.$slots, "svg", { svg: d.value }, void 0, !0)
      ], 14, yt)) : c("", !0),
      t.$slots.watermark ? (s(), u("div", Ut, [
        m(t.$slots, "watermark", L(R({ isPrinting: p(oe) || p(ae) })), void 0, !0)
      ])) : c("", !0),
      T.value ? c("", !0) : (s(), N(ut, {
        key: 4,
        config: {
          type: "candlesticks",
          style: {
            backgroundColor: e.value.style.backgroundColor,
            candlesticks: {
              axis: {
                color: "#CCCCCC"
              },
              candle: {
                color: "#CCCCCC"
              }
            }
          }
        }
      }, null, 8, ["config"])),
      e.value.style.zoom.show && T.value ? (s(), u("div", {
        key: 5,
        ref_key: "chartSlicer",
        ref: Q
      }, [
        (s(), N(it, {
          key: `slicer_${O.value}`,
          background: e.value.style.zoom.color,
          borderColor: e.value.style.backgroundColor,
          fontSize: e.value.style.zoom.fontSize,
          useResetSlot: e.value.style.zoom.useResetSlot,
          labelLeft: $.dataset[y.value.start] ? $.dataset[y.value.start][0] : $.dataset[0][0],
          labelRight: $.dataset[y.value.end - 1] ? $.dataset[y.value.end - 1][0] : $.dataset.at(-1)[0],
          textColor: e.value.style.color,
          inputColor: e.value.style.zoom.color,
          selectColor: e.value.style.zoom.highlightColor,
          max: j.value,
          min: 0,
          valueStart: y.value.start,
          valueEnd: y.value.end,
          start: y.value.start,
          "onUpdate:start": a[1] || (a[1] = (l) => y.value.start = l),
          end: y.value.end,
          "onUpdate:end": a[2] || (a[2] = (l) => y.value.end = l),
          onReset: Te
        }, {
          "reset-action": b(({ reset: l }) => [
            m(t.$slots, "reset-action", L(R({ reset: l })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end"]))
      ], 512)) : c("", !0),
      n("div", {
        ref_key: "chartLegend",
        ref: K
      }, [
        m(t.$slots, "legend", { legend: f.value }, void 0, !0)
      ], 512),
      me(at, {
        show: w.value.showTooltip && W.value,
        backgroundColor: e.value.style.tooltip.backgroundColor,
        color: e.value.style.tooltip.color,
        borderRadius: e.value.style.tooltip.borderRadius,
        borderColor: e.value.style.tooltip.borderColor,
        borderWidth: e.value.style.tooltip.borderWidth,
        fontSize: e.value.style.tooltip.fontSize,
        backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
        position: e.value.style.tooltip.position,
        offsetY: e.value.style.tooltip.offsetY,
        parent: A.value,
        content: G.value,
        isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
      }, {
        "tooltip-before": b(() => [
          m(t.$slots, "tooltip-before", L(R({ ...Y.value })), void 0, !0)
        ]),
        "tooltip-after": b(() => [
          m(t.$slots, "tooltip-after", L(R({ ...Y.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      T.value ? (s(), N(nt, {
        key: 6,
        hideDetails: "",
        config: {
          open: w.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          },
          head: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          }
        }
      }, {
        content: b(() => [
          (s(), N(st, {
            key: `table_${Z.value}`,
            colNames: M.value.colNames,
            head: M.value.head,
            body: M.value.body,
            config: M.value.config,
            title: `${e.value.style.title.text}${e.value.style.title.subtitle.text ? ` : ${e.value.style.title.subtitle.text}` : ""}`,
            onClose: a[3] || (a[3] = (l) => w.value.showTable = !1)
          }, {
            th: b(({ th: l }) => [
              Me(V(l), 1)
            ]),
            td: b(({ td: l }) => [
              n("div", { innerHTML: l }, null, 8, Et)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : c("", !0)
    ], 14, dt));
  }
}, ol = /* @__PURE__ */ vt(Dt, [["__scopeId", "data-v-51dc0cb1"]]);
export {
  ol as default
};
