import { jsxs as s, jsx as r } from "react/jsx-runtime";
import { NEAR_INTENTS_ICON as b, CHAIN_ICONS as a } from "../../icons/index.js";
import { ChainShortcut as n } from "../../components/ChainShortcut.js";
import { cn as y } from "../../utils/cn.js";
import { d as S, s as w, G as A } from "../../config-BDnHptBC.js";
import "react";
import "@tanstack/react-query";
import "@defuse-protocol/one-click-sdk-typescript";
import "../../constants/aurora-assets.js";
import "../../constants/chains.js";
import "../../utils/feeServiceTokens.js";
import "../../logger.js";
import "@scure/base";
import { notReachable as N } from "../../utils/notReachable.js";
import "zod";
import "../../utils/near/rpc.js";
import "ethers";
import "../../machine/machine.js";
import "../../index-DEq3oXQF.js";
import "@defuse-protocol/intents-sdk";
import "change-case";
import "../../localstorage-DVS0q1yC.js";
import "@defuse-protocol/internal-utils";
import "bs58";
import "axios";
import "../../network.js";
import "@ton/core";
import { noop as x } from "../../utils/noop.js";
import "../../hooks/useMakeNearTransfer/nearClient.js";
import "../../hooks/useOneClickExecutionStatus.js";
import { ChainsDropdown as C } from "../ChainsDropdown/index.js";
const it = ({
  variant: c,
  chainsFilter: l,
  selectedChain: o,
  className: f,
  onMsg: e
}) => {
  const p = S(c), { intentsAccountType: u } = w(), { topChainShortcuts: d, enableAccountAbstraction: h } = A(), m = d?.(u) ?? ["eth", "btc", "sol", "near"];
  return /* @__PURE__ */ s(
    "div",
    {
      className: y("flex items-start justify-between gap-sw-md", f),
      children: [
        /* @__PURE__ */ r(
          n.All,
          {
            isSelected: o === "all",
            onClick: () => e({ type: "on_select_chain", chain: "all" })
          }
        ),
        /* @__PURE__ */ s("ul", { className: "flex items-center gap-sw-md mr-auto flex-wrap h-[36px] overflow-hidden", children: [
          h && l.intents !== "none" && /* @__PURE__ */ r(
            n,
            {
              icon: b,
              label: "Intents Account",
              isSelected: o === "intents",
              onClick: () => e({ type: "on_select_chain", chain: "intents" })
            }
          ),
          m.map((t, _) => _ === m.length - 1 && ![...m, "all", "intents"].includes(o) ? /* @__PURE__ */ r(
            n,
            {
              isSelected: !0,
              icon: a[o],
              label: p.find((i) => i.id === o)?.label ?? "",
              onClick: x
            },
            o
          ) : p.some((i) => i.id === t) ? /* @__PURE__ */ r(
            n,
            {
              icon: a[t],
              isSelected: o === t,
              label: p.find((i) => i.id === t)?.label ?? "",
              onClick: () => e({ type: "on_select_chain", chain: t })
            },
            t
          ) : null)
        ] }),
        /* @__PURE__ */ r(
          C,
          {
            variant: c,
            selected: o,
            chainsFilter: l,
            onMsg: (t) => {
              switch (t.type) {
                case "on_click_chain":
                  e({ type: "on_select_chain", chain: t.chain });
                  break;
                default:
                  N(t.type, { throwError: !1 });
              }
            }
          }
        )
      ]
    }
  );
};
export {
  it as ChainsSelector
};
//# sourceMappingURL=index.js.map
