function validateUserToken(e){var t;return"string"!=typeof e?t="Access Token should be a String eg: 17c1a8d5b399d66b6212382d98d4c67a94d58955":e.length<30&&(t="Access Token length appears wrong!"),document.getElementById("validation-block").style.display=t?"inline-block":"none",t}function saveOptions(){document.getElementById("save-btn").setAttribute("disabled","disabled"),document.getElementById("save-btn").style.background="#DEDEDE";var e=document.getElementById("x-github-token").value;chrome.storage.sync.set({"x-github-token":e},(function(){var t=document.getElementById("status--text"),n=document.getElementById("validation-warning"),o=validateUserToken(e);o||(t.textContent="Options saved!!",document.getElementById("status").style.display="inline-block"),n.textContent=o,setTimeout((function(){t.textContent="",document.getElementById("status").style.display="none",document.getElementById("save-btn").removeAttribute("disabled"),document.getElementById("save-btn").style.background="#3fb594"}),1500)}))}function restoreOptions(){var e;chrome.storage.sync.get({"x-github-token":""},(function(t){e=t["x-github-token"],document.getElementById("x-github-token").value=e,document.getElementById("validation-warning").textContent=validateUserToken(e),document.getElementById("save-btn").style.background="#3fb594"}))}document.addEventListener("DOMContentLoaded",restoreOptions),document.getElementById("save-btn").addEventListener("click",saveOptions);