import { bn as f, bo as t, bp as e, bq as c, br as O, bs as b, b1 as o, bt as d, bu as p } from "./index-BpgHIKBe.mjs";
import { bv as h } from "./index-BpgHIKBe.mjs";
class A extends Error {
  constructor(r) {
    super(r);
  }
}
class l extends A {
  constructor() {
    super(...arguments), this.name = "TokenOwnerOffCurveError";
  }
}
const m = f([
  t("mintAuthorityOption"),
  e("mintAuthority"),
  c("supply"),
  O("decimals"),
  b("isInitialized"),
  t("freezeAuthorityOption"),
  e("freezeAuthority")
]);
m.span;
async function E(s, r, n = !1, u = d, a = p) {
  if (!n && !o.isOnCurve(r.toBuffer()))
    throw new l();
  const [i] = await o.findProgramAddress([r.toBuffer(), u.toBuffer(), s.toBuffer()], a);
  return i;
}
export {
  p as ASSOCIATED_TOKEN_PROGRAM_ID,
  m as MintLayout,
  h as TOKEN_2022_PROGRAM_ID,
  d as TOKEN_PROGRAM_ID,
  A as TokenError,
  l as TokenOwnerOffCurveError,
  E as getAssociatedTokenAddress
};
