import { r as registerInstance, h, H as Host } from './index-8dc1a0b7.js';
import { c as coreState } from './core-6e4b87fa.js';
import './_commonjsHelpers-66ac50f5.js';
import './index-2f7827f5.js';
import './runStore-08a7baa7.js';
import { s as src } from './index-313b8a90.js';
import { v as verifyEmailGQL } from './Mutations-823a697d.js';

var roles;
(function (roles) {
  roles["ADMIN"] = "admin";
  roles["USER"] = "user";
})(roles || (roles = {}));
var STATUS;
(function (STATUS) {
  STATUS["PENDING"] = "PENDING";
  STATUS["VERIFIED"] = "VERIFIED";
})(STATUS || (STATUS = {}));

const VerifyComponent = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.verifyState = false;
  }
  async componentDidLoad() {
    const params = new URLSearchParams(location.search);
    const request = await coreState.client.mutate({
      mutation: src(verifyEmailGQL),
      variables: {
        email: params.get("email"),
        token: params.get("token"),
      },
    });
    if (request.data.userVerify.status === STATUS.VERIFIED) {
      this.verifyState = true;
    }
  }
  render() {
    return (h(Host, null, h("corejam-box", { flex: true }, this.verifyState ? (h("corejam-box", { mx: "auto", flex: true, my: 50 }, h("corejam-base-link", { href: "/" }, h("corejam-type", null, "Click here to continue")), h("corejam-modal", { message: "Verified", type: "success" }))) : ("waiting"))));
  }
};

export { VerifyComponent as auth_verify };
