import { o as u, n as i, E as o, ao as $, ap as g, aq as m, v as l, t as x, ar as p } from "./index-DSGwv2Yx.js";
import { c as k } from "./complex-3DpPEG9B.js";
function K(r) {
  const e = { input: i(r, "input", "imag") };
  return o.runKernel($, e);
}
const h = /* @__PURE__ */ u({ imag_: K });
function E(r) {
  const e = { x: i(r, "x", "neg") };
  return o.runKernel(g, e);
}
const _ = /* @__PURE__ */ u({ neg_: E });
function b(r) {
  const e = { input: i(r, "input", "real") };
  return o.runKernel(m, e);
}
const d = /* @__PURE__ */ u({ real_: b });
function v(r, t, e) {
  const n = i(r, "x", "transpose");
  if (t == null && (t = n.shape.map((s, a) => a).reverse()), l(n.rank === t.length, () => `Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`), t.forEach((s) => {
    l(s >= 0 && s < n.rank, () => `All entries in 'perm' must be between 0 and ${n.rank - 1} but got ${t}`);
  }), n.rank <= 1)
    return n.clone();
  const f = { x: n }, c = { perm: t };
  return n.dtype === "complex64" ? x(() => {
    let s = d(n), a = h(n);
    return s = o.runKernel(p, { x: s }, c), a = o.runKernel(p, { x: a }, c), e && (a = _(a)), k(s, a);
  }) : o.runKernel(p, f, c);
}
const y = /* @__PURE__ */ u({ transpose_: v });
export {
  h as i,
  _ as n,
  d as r,
  y as t
};
