import { am as e, U as t, ag as s, ah as a, an as r, aj as o, ao as i, a as n, ap as l, aq as p, w as c, a6 as m, ar as d, as as g } from "./index-8935f1b4.js";
import "./lodash-226cb5b1.js";
import { lA as j, lR as u, lS as h } from "./ant-design-icons-14ab96af.js";
import "./loglevel-5e7e37fc.js";
import { memo as f } from "react";
import { d as b } from "./styled-components-c6abe9a3.js";
import { M as v, S as y, D as w } from "./antd-97b654da.js";
import "./axios-125479b5.js";
import "./redux-devtools-f8b1cd80.js";
import "./alasql-f59e855e.js";
import "./react-router-8d1fc2f1.js";
import "./fontawesome-89eb6278.js";
import "react-dom";
import "./dnd-kit-e67c9595.js";
import "./moment-d8baa15a.js";
import "./crypto-js-8020edb5.js";
import "./dayjs-7fc5ce65.js";
import "./numbro-48e81844.js";
import "./papaparse-088c0adc.js";
import "./uuid-82f303b2.js";
import "./supabase-2e4a9112.js";
import "./fetch-6a200310.js";
import "./react-draggable-fda4f1cb.js";
import "./remark-gfm-e9b5dec7.js";
import "./buffer-e20f80c8.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-cab52c82.js";
import "./react-best-gradient-color-picker-812be7ee.js";
import "./ua-parser-js-1d18a3f8.js";
import "./clsx-469c2c43.js";
import "./codemirror-edf161cb.js";
import "./really-relaxed-json-e5391d6a.js";
import "./immer-c0428a8d.js";
import "./redux-saga-1b0a458d.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-8c3eaa86.js";
import "./react-documents-ae08f8b5.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-9e54e169.js";
import "./react-json-view-364658b4.js";
import "./qrcode-react-e4f7745b.js";
import "./katex-cda5b990.js";
import "./ecogis-maps-10bb29cf.js";
import "./devextreme-28d23085.js";
import "./exceljs-1678d36b.js";
import "./file-saver-es-c18fae8f.js";
const x = b.div`
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;

  .lang-switch {
    transition: all 0.2s;

    &:hover {
      background: #f3f4f6;
    }
  }
`, C = function() {
  const t2 = { selectedLang: n({}) };
  return new e(t2, (e2, t3) => ({ selectedLang: e2.selectedLang, updateSelection: (e3) => {
    t3(l("selectedLang", e3, true));
  } })).build();
}(), V = { options: p, defaultValue: c(m, "vi"), size: c(m, "20px"), borderRadius: c(m, "0"), selectionControl: C, onEvent: d([{ label: "onOpenChange", value: "onOpenChange", description: "" }]) }, L = f((e2) => {
  var _a;
  if ((t2 = e2.selectionControl.selectedLang) && 0 === Object.keys(t2).length && t2.constructor === Object || !((_a = e2.selectionControl.selectedLang) == null ? void 0 : _a.value)) {
    const t3 = e2.options.find((t4) => t4.value === e2.defaultValue);
    t3 && e2.selectionControl.updateSelection(t3);
  }
  var t2;
  const s2 = e2.options.map((t3) => ({ key: t3.value, label: j(v.Item, { onClick: () => {
    return s3 = t3, e2.selectionControl.updateSelection(s3), void e2.onEvent("onOpenChange");
    var s3;
  }, className: "lang-item", style: { padding: 0, backgroundColor: "transparent" }, children: u(y, { children: [j("img", { src: t3.icon, width: "16px", alt: t3.label }), t3.label] }) }) })), a2 = e2.selectionControl.selectedLang;
  return j(x, { $height: e2.size, children: j(w, { menu: { items: s2 }, className: "lang-dropdown", children: j("div", { className: "lang-switch", style: { height: `calc(${e2.size}px + 10px)`, display: "flex", alignItems: "center" }, children: a2 && j("img", { src: a2.icon, height: e2.size, style: { borderRadius: e2.borderRadius }, alt: a2.label }) }) }) });
});
let k = new t(V, (e2) => {
  const t2 = s({ ...e2 }, "LangComp");
  return j(L, { ...t2 });
}).setPropertyViewFn((e2) => u(h, { children: [u(a, { name: r.basic, children: [e2.options.getPropertyView(), e2.defaultValue.propertyView({ label: "DefaultValue" }), e2.size.propertyView({ label: "Size" }), e2.borderRadius.propertyView({ label: "borderRadius" })] }), j(a, { name: "Interaction", children: e2.onEvent.getPropertyView() })] })).build();
k = g(k, [{ method: { name: "setLanguage", description: "", params: [{ name: "lang", type: "string" }] }, execute: (e2, t2) => {
  const s2 = t2[0];
  if (s2) {
    const t3 = e2.children.options.getView().find((e3) => e3.value === s2);
    t3 && e2.children.selectionControl.children.selectedLang.dispatchChangeValueAction(t3);
  }
} }]);
const z = o(k, [new i("language", (e2) => ({ language: e2.children.selectionControl.children.selectedLang.node() }), (e2) => e2.language, "Get selected language")]);
function O() {
  return { options: { data: JSON.stringify([{ languageCode: "vi", languageName: "Tiếng Việt", flag: "https://vnpt.com.vn/design/images/icon/vi.png" }, { languageCode: "en", languageName: "English", flag: "https://vnpt.com.vn/design/images/icon/en.png" }]) } };
}
export {
  z as LangComp,
  O as defaultLangData
};
