import { j as e } from "./jsx-runtime-Sp0orL4X.js";
import l, { useMemo as h, Suspense as m } from "react";
import { FontFamilyIcon as j, EyeOpenIcon as f } from "@radix-ui/react-icons";
import { S as g, c as v, b as S, d as b, a as N, e as w, f as n } from "./select-1WwjQDp6.js";
import { d as s, e as y, F as C, f as B } from "./index-T7WZImL0.js";
import { B as c, S as p, ac as A } from "./context-menu-zu6r7B6f.js";
import { useTranslation as x } from "react-i18next";
import "@radix-ui/react-select";
import "lodash-es";
import "jotai";
import "./iconBase-zweRWSz0.js";
import "clsx";
import "tailwind-merge";
import "@chaibuilder/runtime";
import "./plugin-sJ3Hzvpv.js";
import "@react-hookz/web";
import "tree-model";
import "react-quill";
import "./STRINGS-rPGH65PW.js";
import "react-hotkeys-hook";
import "@floating-ui/dom";
import "@floating-ui/react-dom";
import "flagged";
import "@tailwindcss/typography";
import "@tailwindcss/forms";
import "@tailwindcss/aspect-ratio";
import "tailwindcss-palette-generator";
import "react-wrap-balancer";
import "react-dom";
import "prop-types";
import "re-resizable";
import "@rjsf/validator-ajv8";
import "@rjsf/core";
import "react-arborist";
import "lucide-react";
import "himalaya";
import "react-icons-picker";
import "react-autosuggest";
import "fuse.js";
import "i18next";
import "lodash";
import "@radix-ui/react-scroll-area";
import "framer-motion";
import "@radix-ui/react-switch";
import "@radix-ui/react-accordion";
import "@radix-ui/react-alert-dialog";
import "@radix-ui/react-slot";
import "class-variance-authority";
import "@radix-ui/react-label";
import "@radix-ui/react-tabs";
import "@radix-ui/react-tooltip";
import "@radix-ui/react-popover";
import "@radix-ui/react-hover-card";
import "@radix-ui/react-dropdown-menu";
import "@radix-ui/react-separator";
import "@radix-ui/react-toast";
import "cmdk";
import "@radix-ui/react-dialog";
import "@radix-ui/react-context-menu";
const P = () => s("languages", ["en"]), k = () => P().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(g, { children: [
  /* @__PURE__ */ e.jsx(v, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
    S,
    {
      placeholder: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
        /* @__PURE__ */ e.jsx(j, { className: "h-4 w-4" }),
        " English(US)"
      ] })
    }
  ) }),
  /* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsxs(N, { children: [
    /* @__PURE__ */ e.jsx(w, { children: "Fruits" }),
    /* @__PURE__ */ e.jsx(n, { value: "apple", children: "Apple" }),
    /* @__PURE__ */ e.jsx(n, { value: "banana", children: "Banana" }),
    /* @__PURE__ */ e.jsx(n, { value: "blueberry", children: "Blueberry" }),
    /* @__PURE__ */ e.jsx(n, { value: "grapes", children: "Grapes" }),
    /* @__PURE__ */ e.jsx(n, { value: "pineapple", children: "Pineapple" })
  ] }) })
] }) }), I = () => {
  const { savePage: i, saveState: t } = y(), o = s("hideSaveButton", !1), { t: a } = x(), r = h(() => {
    switch (t) {
      case "SAVING":
        return "animate-pulse bg-gray-300 text-gray-900";
      case "SAVED":
        return "bg-green-500 text-white hover:bg-green-600 hover:text-white";
      default:
        return "bg-gray-200 text-gray-500 hover:bg-gray-100";
    }
  }, [t]);
  if (o)
    return null;
  const u = /* @__PURE__ */ e.jsxs(
    c,
    {
      disabled: t === "SAVING",
      onClick: (d) => {
        d.preventDefault(), i();
      },
      className: `flex h-auto w-fit items-center gap-x-2 p-1 px-2 ${r}`,
      size: "sm",
      variant: "outline",
      children: [
        /* @__PURE__ */ e.jsx(C, { className: "text-sm text-white" }),
        /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: t === "SAVING" ? "Saving..." : a(t === "SAVED" ? "Saved" : "Unsaved") })
      ]
    }
  );
  return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: u });
}, V = function() {
  const t = s("previewComponent"), [, o] = B(), { t: a } = x();
  return t ? /* @__PURE__ */ e.jsxs(
    c,
    {
      onClick: (r) => {
        r.preventDefault(), o(!0);
      },
      className: "flex h-auto w-fit items-center gap-x-2 bg-gray-200 p-1 px-2",
      size: "sm",
      variant: "outline",
      children: [
        /* @__PURE__ */ e.jsx(f, { className: "text-xs" }),
        /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: a("Preview") })
      ]
    }
  ) : null;
}, Me = () => {
  const i = s("topBarComponents.left", []), t = s("topBarComponents.center", []), o = s("topBarComponents.right", []), a = s("editable", !0);
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
    /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: l.Children.toArray(
      i.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
    ) }) }),
    /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: l.Children.toArray(
      t.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
    ) }),
    /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1", children: [
      /* @__PURE__ */ e.jsx(k, {}),
      /* @__PURE__ */ e.jsx(V, {}),
      /* @__PURE__ */ e.jsx(A, { orientation: "vertical" }),
      a ? /* @__PURE__ */ e.jsx(I, {}) : null,
      l.Children.toArray(
        o.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
      )
    ] })
  ] });
};
export {
  Me as default
};
