import { bA as f, bB as s, bC as t, bD as c, bE as d, bF as A, aZ as o, bG as O, bH as b } from "./index-BC8OEwi7.mjs";
class p extends Error {
  constructor(r) {
    super(r);
  }
}
class l extends p {
  constructor() {
    super(...arguments), this.name = "TokenOwnerOffCurveError";
  }
}
const y = f([
  s("mintAuthorityOption"),
  t("mintAuthority"),
  c("supply"),
  d("decimals"),
  A("isInitialized"),
  s("freezeAuthorityOption"),
  t("freezeAuthority")
]);
y.span;
async function E(e, r, n = !1, u = O, a = b) {
  if (!n && !o.isOnCurve(r.toBuffer()))
    throw new l();
  const [i] = await o.findProgramAddress([r.toBuffer(), u.toBuffer(), e.toBuffer()], a);
  return i;
}
export {
  b as ASSOCIATED_TOKEN_PROGRAM_ID,
  y as MintLayout,
  O as TOKEN_PROGRAM_ID,
  p as TokenError,
  l as TokenOwnerOffCurveError,
  E as getAssociatedTokenAddress
};
