{"size": 2033, "ext": "js", "max_stars_repo_path": "hosted/profileBundle.js", "max_stars_repo_name": "JordynA97/IGME430FinalProject", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "hosted/profileBundle.js", "max_issues_repo_name": "JordynA97/IGME430FinalProject", "max_issues_repo_issues_event_min_datetime": "2021-05-11T10:17:08.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T10:17:08.000Z", "max_forks_repo_path": "hosted/profileBundle.js", "max_forks_repo_name": "JordynA97/IGME430FinalProject", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 30.803030303, "max_line_length": 187, "alphanum_fraction": 0.6419085096}
"use strict";

//create the profile page
var UserProfilePage = function UserProfilePage(props) {
  return (/*#__PURE__*/React.createElement("div", {
      id: "userProfile"
    }, /*#__PURE__*/React.createElement("h2", null, "Username: ", props.username), /*#__PURE__*/React.createElement("h2", {
      id: "sub"
    }, "Subscription: Basic"), /*#__PURE__*/React.createElement("h2", null, "Don't want Ads?"), /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("button", {
      type: "submit",
      className: "profileButtons",
      onClick: function onClick(e) {
        e.preventDefault();
        document.getElementById("sub").innerHTML = "Subscripton: Premium";
      }
    }, "Upgrade to Premium")), /*#__PURE__*/React.createElement("h2", null, /*#__PURE__*/React.createElement("button", {
      className: "profileButtons",
      onClick: function onClick(e) {
        window.location.href = "/password";
      }
    }, /*#__PURE__*/React.createElement("div", {
      "class": "navlink"
    }, "Change Password"))))
  );
}; //place in profile.handlebars


var setup = function setup() {
  var username = document.querySelector("#userProfilePage").dataset.username;
  ReactDOM.render( /*#__PURE__*/React.createElement(UserProfilePage, {
    username: username
  }), document.querySelector("#userProfilePage"));
};

$(document).ready(setup());
"use strict";

var handleError = function handleError(message) {
  $("#errorMessage").text(message);
  $("#gameMessage").animate({
    width: 'toggle'
  }, 350);
};

var redirect = function redirect(response) {
  $("#gameMessage").animate({
    width: 'hide'
  }, 350);
  window.location = response.redirect;
};

var sendAjax = function sendAjax(type, action, data, success) {
  $.ajax({
    cache: false,
    type: type,
    url: action,
    data: data,
    dataType: "json",
    success: success,
    error: function error(xhr, status, _error) {
      var messageObj = JSON.parse(xhr.responseText);
      handleError(messageObj.error);
    }
  });
};
