import { c as E, p as T, f as O, b as h, d as q, u as A, h as j } from "./AssetItem-CFsdMEwW.js";
import { v as B, r as w, A as x, t as D, n as z, M as y, O as I, I as L, Y as Q, E as R, a0 as U, F as b, bC as W, Q as Y, L as G } from "./index-BxjwuJ6T.js";
import { C as J } from "./App-pmcYlKkW.js";
import { C as K } from "./ContentHeader-IUWmor6Y.js";
import { B as k } from "./Button-S2OwL6nP.js";
var N = O("<!> <!>", 1), P = O("<!> <!>", 1);
function F(i, r) {
  if (new.target) return E({ component: F, ...i });
  B(r, !1);
  let a = T(r, "options", 12), { title: d, description: p, onConfirm: m, onCancel: v } = a();
  var f = {
    get options() {
      return a();
    },
    set options(t) {
      a(t), z();
    },
    $set: A,
    $on: (t, n) => q(r, t, n)
  }, l = P(), g = w(l);
  K(g, {
    get text() {
      return d;
    },
    get description() {
      return p;
    }
  });
  var _ = x(g, 2);
  return J(_, {
    class: "crtw-flex crtw-justify-between crtw-gap-10",
    children: (t, n) => {
      var e = N(), o = w(e);
      k(o, {
        text: "Cancel",
        get onClick() {
          return v;
        }
      });
      var C = x(o, 2);
      k(C, {
        text: "Sign the message",
        get onClick() {
          return m;
        }
      }), h(t, e);
    },
    $$slots: { default: !0 }
  }), h(i, l), D(f);
}
function V(i, r) {
  if (new.target) return E({ component: V, ...i });
  B(r, !1);
  const a = () => b(Y, "$pageOptsStore", p), d = () => b(G, "$configStore", p), [p, m] = R();
  var v = this && this.__awaiter || function(t, n, e, o) {
    function C(c) {
      return c instanceof e ? c : new e(function(u) {
        u(c);
      });
    }
    return new (e || (e = Promise))(function(c, u) {
      function H(s) {
        try {
          S(o.next(s));
        } catch ($) {
          u($);
        }
      }
      function M(s) {
        try {
          S(o.throw(s));
        } catch ($) {
          u($);
        }
      }
      function S(s) {
        s.done ? c(s.value) : C(s.value).then(H, M);
      }
      S((o = o.apply(t, n || [])).next());
    });
  };
  const { close: f } = y(I), l = () => v(void 0, void 0, void 0, function* () {
    const t = y(U);
    if (!t) return;
    const e = yield (yield t.getSigner()).signMessage(a().message);
    W.signDataAndEmitEvent(d().credenza.generalWssUrl, e, a().socketEventDataHeaders), f();
  });
  var g = {
    $set: A,
    $on: (t, n) => q(r, t, n)
  };
  j();
  {
    let t = Q(() => ({
      title: "Sign Transaction Request",
      description: "Please sign the requested transaction.",
      onCancel: f,
      onConfirm: l
    }));
    F(i, {
      get options() {
        return L(t);
      }
    });
  }
  var _ = D(g);
  return m(), _;
}
export {
  V as default
};
//# sourceMappingURL=Sign-C-aBG89V.js.map
