import { getTokenBalanceKey as c } from "../intents/getTokenBalanceKey.js";
const f = (r) => {
  const {
    chainsFilter: n,
    selectedChain: t,
    intentBalances: l,
    supportedChains: s,
    uniqueIntentTokenIds: a
  } = r;
  return (e) => {
    if (e.isIntent && (n.intents === "none" || !["all", "intents"].includes(t)) || !e.isIntent && n.external === "none")
      return !1;
    if (e.isIntent && n.intents === "with-balance") {
      const i = l[c(e)];
      return !!i && i !== "0";
    }
    return e.isIntent && ["all", "intents"].includes(t) ? a.includes(e.assetId) : t === "all" ? !e.isIntent && n.external === "wallet-supported" && !s.includes(e.blockchain) ? !1 : (!e.isIntent && n.external === "all", !0) : e.blockchain === t;
  };
};
export {
  f as createFilterBySelectedChain
};
//# sourceMappingURL=filterBySelectedChain.js.map
