import { jsx as n } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import A from "classnames";
import { Fragment as F } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
import { useMemo as C } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { AccountDetail as b } from "./AccountDetail.js";
import { getAccountFieldTextToCopy as _, getAccountFieldFormattedValue as S, getAccountFieldCopyButtonLabelKey as g, getAccountFieldTranslationKey as L, isAccountFieldPrimary as N } from "./utils.js";
/* empty css                    */
const o = "adyen-pe-capital-account-details", r = {
  detail: `${o}__detail`,
  detailContent: `${o}__detail-content`,
  detailLabel: `${o}__detail-label`
}, j = ({ bankAccount: a, className: i, ...s }) => {
  const d = C(() => {
    const { accountNumber: t, iban: e, order: l, region: m, ...u } = a, c = Object.keys({ iban: e, accountNumber: t, ...u, region: m }), p = Array.isArray(l) ? l.filter((y) => c.includes(y)) : c;
    return [...new Set(p)];
  }, [a]);
  return /* @__PURE__ */ n("dl", { className: A(o, i), ...s, children: d.map((t) => {
    const e = a[t];
    return e ? /* @__PURE__ */ n(F, { children: /* @__PURE__ */ n(
      b,
      {
        className: r.detail,
        contentClassName: r.detailContent,
        isPrimary: N(t),
        labelClassName: r.detailLabel,
        label: L(t),
        copyButtonLabel: g(t),
        content: S(t, e),
        textToCopy: _(t, e)
      }
    ) }, t) : null;
  }) });
};
export {
  j as AccountDetails
};
