import {
    $ as b,
    S as v,
    V as f,
    Z as L,
    a as g,
    c as p,
    cb as h,
    f as m,
    h as c,
    i as y,
    ja as z,
    mb as w,
    nb as S,
    ta as o,
    ua as E,
    xa as C
} from "./chunk-SSI6PFOR.js";
var l = class {
        constructor() {
            this.subject = new c(1), this.subscriptions = new g
        }
        doFilter(r) {
            this.subject.next(r)
        }
        dispose() {
            this.subscriptions.unsubscribe()
        }
        notEmpty(r, e) {
            this.subscriptions.add(this.subject.subscribe(i => {
                if (i[r]) {
                    let a = i[r].currentValue;
                    a != null && e(a)
                }
            }))
        }
        has(r, e) {
            this.subscriptions.add(this.subject.subscribe(i => {
                if (i[r]) {
                    let a = i[r].currentValue;
                    e(a)
                }
            }))
        }
        notFirst(r, e) {
            this.subscriptions.add(this.subject.subscribe(i => {
                if (i[r] && !i[r].isFirstChange()) {
                    let a = i[r].currentValue;
                    e(a)
                }
            }))
        }
        notFirstAndEmpty(r, e) {
            this.subscriptions.add(this.subject.subscribe(i => {
                if (i[r] && !i[r].isFirstChange()) {
                    let a = i[r].currentValue;
                    a != null && e(a)
                }
            }))
        }
    },
    O = new b("NGX_ECHARTS_CONFIG"),
    H = (() => {
        class t {
            constructor(e, i, a) {
                this.el = i, this.ngZone = a, this.options = null, this.theme = null, this.initOpts = null, this.merge = null, this.autoResize = !0, this.loading = !1, this.loadingType = "default", this.loadingOpts = null, this.chartInit = new o, this.optionsError = new o, this.chartClick = this.createLazyEvent("click"), this.chartDblClick = this.createLazyEvent("dblclick"), this.chartMouseDown = this.createLazyEvent("mousedown"), this.chartMouseMove = this.createLazyEvent("mousemove"), this.chartMouseUp = this.createLazyEvent("mouseup"), this.chartMouseOver = this.createLazyEvent("mouseover"), this.chartMouseOut = this.createLazyEvent("mouseout"), this.chartGlobalOut = this.createLazyEvent("globalout"), this.chartContextMenu = this.createLazyEvent("contextmenu"), this.chartHighlight = this.createLazyEvent("highlight"), this.chartDownplay = this.createLazyEvent("downplay"), this.chartSelectChanged = this.createLazyEvent("selectchanged"), this.chartLegendSelectChanged = this.createLazyEvent("legendselectchanged"), this.chartLegendSelected = this.createLazyEvent("legendselected"), this.chartLegendUnselected = this.createLazyEvent("legendunselected"), this.chartLegendLegendSelectAll = this.createLazyEvent("legendselectall"), this.chartLegendLegendInverseSelect = this.createLazyEvent("legendinverseselect"), this.chartLegendScroll = this.createLazyEvent("legendscroll"), this.chartDataZoom = this.createLazyEvent("datazoom"), this.chartDataRangeSelected = this.createLazyEvent("datarangeselected"), this.chartGraphRoam = this.createLazyEvent("graphroam"), this.chartGeoRoam = this.createLazyEvent("georoam"), this.chartTreeRoam = this.createLazyEvent("treeroam"), this.chartTimelineChanged = this.createLazyEvent("timelinechanged"), this.chartTimelinePlayChanged = this.createLazyEvent("timelineplaychanged"), this.chartRestore = this.createLazyEvent("restore"), this.chartDataViewChanged = this.createLazyEvent("dataviewchanged"), this.chartMagicTypeChanged = this.createLazyEvent("magictypechanged"), this.chartGeoSelectChanged = this.createLazyEvent("geoselectchanged"), this.chartGeoSelected = this.createLazyEvent("geoselected"), this.chartGeoUnselected = this.createLazyEvent("geounselected"), this.chartAxisAreaSelected = this.createLazyEvent("axisareaselected"), this.chartBrush = this.createLazyEvent("brush"), this.chartBrushEnd = this.createLazyEvent("brushend"), this.chartBrushSelected = this.createLazyEvent("brushselected"), this.chartGlobalCursorTaken = this.createLazyEvent("globalcursortaken"), this.chartRendered = this.createLazyEvent("rendered"), this.chartFinished = this.createLazyEvent("finished"), this.animationFrameID = null, this.chart$ = new c(1), this.resize$ = new m, this.changeFilter = new l, this.resizeObFired = !1, this.echarts = e.echarts, this.theme = e.theme || null
            }
            ngOnChanges(e) {
                this.changeFilter.doFilter(e)
            }
            ngOnInit() {
                if (!window.ResizeObserver) throw new Error("please install a polyfill for ResizeObserver");
                this.resizeSub = this.resize$.pipe(f(100, y, {
                    leading: !1,
                    trailing: !0
                })).subscribe(() => this.resize()), this.autoResize && (this.resizeOb = this.ngZone.runOutsideAngular(() => new window.ResizeObserver(e => {
                    for (let i of e) i.target === this.el.nativeElement && (this.resizeObFired ? this.animationFrameID = window.requestAnimationFrame(() => {
                        this.resize$.next()
                    }) : this.resizeObFired = !0)
                })), this.resizeOb.observe(this.el.nativeElement)), this.changeFilter.notFirstAndEmpty("options", e => this.onOptionsChange(e)), this.changeFilter.notFirstAndEmpty("merge", e => this.setOption(e)), this.changeFilter.has("loading", e => this.toggleLoading(!!e)), this.changeFilter.notFirst("theme", () => this.refreshChart())
            }
            ngOnDestroy() {
                window.clearTimeout(this.initChartTimer), this.resizeSub && this.resizeSub.unsubscribe(), this.animationFrameID && window.cancelAnimationFrame(this.animationFrameID), this.resizeOb && this.resizeOb.unobserve(this.el.nativeElement), this.loadingSub && this.loadingSub.unsubscribe(), this.changeFilter.dispose(), this.dispose()
            }
            ngAfterViewInit() {
                this.initChartTimer = window.setTimeout(() => this.initChart())
            }
            dispose() {
                this.chart && (this.chart.isDisposed() || this.chart.dispose(), this.chart = null)
            }
            resize() {
                this.chart && this.chart.resize()
            }
            toggleLoading(e) {
                this.chart ? e ? this.chart.showLoading(this.loadingType, this.loadingOpts) : this.chart.hideLoading() : this.loadingSub = this.chart$.subscribe(i => e ? i.showLoading(this.loadingType, this.loadingOpts) : i.hideLoading())
            }
            setOption(e, i) {
                if (this.chart) try {
                    this.chart.setOption(e, i)
                } catch (a) {
                    console.error(a), this.optionsError.emit(a)
                }
            }
            async refreshChart() {
                this.dispose(), await this.initChart()
            }
            createChart() {
                let e = this.el.nativeElement;
                if (window && window.getComputedStyle) {
                    let i = window.getComputedStyle(e, null).getPropertyValue("height");
                    (!i || i === "0px") && (!e.style.height || e.style.height === "0px") && (e.style.height = "400px")
                }
                return this.ngZone.runOutsideAngular(() => (typeof this.echarts == "function" ? this.echarts : () => Promise.resolve(this.echarts))().then(({
                    init: a
                }) => a(e, this.theme, this.initOpts)))
            }
            async initChart() {
                await this.onOptionsChange(this.options), this.merge && this.chart && this.setOption(this.merge)
            }
            async onOptionsChange(e) {
                e && (this.chart ? this.setOption(this.options, !0) : (this.chart = await this.createChart(), this.chart$.next(this.chart), this.chartInit.emit(this.chart), this.setOption(this.options, !0)))
            }
            createLazyEvent(e) {
                return this.chartInit.pipe(v(i => new p(a => (i.on(e, x => this.ngZone.run(() => a.next(x))), () => {
                    this.chart && (this.chart.isDisposed() || i.off(e))
                }))))
            }
            static {
                this.\u0275fac = function(i) {
                    return new(i || t)(h(O), h(C), h(E))
                }
            }
            static {
                this.\u0275dir = S({
                    type: t,
                    selectors: [
                        ["echarts"],
                        ["", "echarts", ""]
                    ],
                    inputs: {
                        options: "options",
                        theme: "theme",
                        initOpts: "initOpts",
                        merge: "merge",
                        autoResize: "autoResize",
                        loading: "loading",
                        loadingType: "loadingType",
                        loadingOpts: "loadingOpts"
                    },
                    outputs: {
                        chartInit: "chartInit",
                        optionsError: "optionsError",
                        chartClick: "chartClick",
                        chartDblClick: "chartDblClick",
                        chartMouseDown: "chartMouseDown",
                        chartMouseMove: "chartMouseMove",
                        chartMouseUp: "chartMouseUp",
                        chartMouseOver: "chartMouseOver",
                        chartMouseOut: "chartMouseOut",
                        chartGlobalOut: "chartGlobalOut",
                        chartContextMenu: "chartContextMenu",
                        chartHighlight: "chartHighlight",
                        chartDownplay: "chartDownplay",
                        chartSelectChanged: "chartSelectChanged",
                        chartLegendSelectChanged: "chartLegendSelectChanged",
                        chartLegendSelected: "chartLegendSelected",
                        chartLegendUnselected: "chartLegendUnselected",
                        chartLegendLegendSelectAll: "chartLegendLegendSelectAll",
                        chartLegendLegendInverseSelect: "chartLegendLegendInverseSelect",
                        chartLegendScroll: "chartLegendScroll",
                        chartDataZoom: "chartDataZoom",
                        chartDataRangeSelected: "chartDataRangeSelected",
                        chartGraphRoam: "chartGraphRoam",
                        chartGeoRoam: "chartGeoRoam",
                        chartTreeRoam: "chartTreeRoam",
                        chartTimelineChanged: "chartTimelineChanged",
                        chartTimelinePlayChanged: "chartTimelinePlayChanged",
                        chartRestore: "chartRestore",
                        chartDataViewChanged: "chartDataViewChanged",
                        chartMagicTypeChanged: "chartMagicTypeChanged",
                        chartGeoSelectChanged: "chartGeoSelectChanged",
                        chartGeoSelected: "chartGeoSelected",
                        chartGeoUnselected: "chartGeoUnselected",
                        chartAxisAreaSelected: "chartAxisAreaSelected",
                        chartBrush: "chartBrush",
                        chartBrushEnd: "chartBrushEnd",
                        chartBrushSelected: "chartBrushSelected",
                        chartGlobalCursorTaken: "chartGlobalCursorTaken",
                        chartRendered: "chartRendered",
                        chartFinished: "chartFinished"
                    },
                    exportAs: ["echarts"],
                    features: [z]
                })
            }
        }
        return t
    })(),
    R = t => ({
        provide: O,
        useValue: t
    }),
    $ = (() => {
        class t {
            static forRoot(e) {
                return {
                    ngModule: t,
                    providers: [R(e)]
                }
            }
            static forChild() {
                return {
                    ngModule: t
                }
            }
            static {
                this.\u0275fac = function(i) {
                    return new(i || t)
                }
            }
            static {
                this.\u0275mod = w({
                    type: t
                })
            }
            static {
                this.\u0275inj = L({})
            }
        }
        return t
    })();
var F = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
    d = {
        randomUUID: F
    };
var n, M = new Uint8Array(16);

function u() {
    if (!n && (n = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !n)) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    return n(M)
}
var s = [];
for (let t = 0; t < 256; ++t) s.push((t + 256).toString(16).slice(1));

function D(t, r = 0) {
    return s[t[r + 0]] + s[t[r + 1]] + s[t[r + 2]] + s[t[r + 3]] + "-" + s[t[r + 4]] + s[t[r + 5]] + "-" + s[t[r + 6]] + s[t[r + 7]] + "-" + s[t[r + 8]] + s[t[r + 9]] + "-" + s[t[r + 10]] + s[t[r + 11]] + s[t[r + 12]] + s[t[r + 13]] + s[t[r + 14]] + s[t[r + 15]]
}

function I(t, r, e) {
    if (d.randomUUID && !r && !t) return d.randomUUID();
    t = t || {};
    let i = t.random || (t.rng || u)();
    if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, r) {
        e = e || 0;
        for (let a = 0; a < 16; ++a) r[e + a] = i[a];
        return r
    }
    return D(i)
}
var T = I;
export {
    T as a, H as b, $ as c
};
/**i18n:6e1dbccd4192d215e143e99fb4b6a095cee3c871f5aa7cd380ca91231f35e8e0*/