// The one setting. When the evidence package is published, put its address here. // Empty: "The evidence package" stays plain text everywhere (no link to nowhere). const EVIDENCE_URL = ""; // The only script on this site: old links, the evidence link and the beta form (id "pilot-form"). No tracking. (function () { // Links into the old page (#how, #phone, #faq and the like) land at the top, with the address cleaned. if (location.hash) { var id = ""; try { id = decodeURIComponent(location.hash.slice(1)); } catch (e) { id = ""; } if (!id || !document.getElementById(id)) { history.replaceState(null, "", location.pathname + location.search); } } if (EVIDENCE_URL) { document.querySelectorAll(".evidence-ref").forEach(function (el) { var a = document.createElement("a"); a.href = EVIDENCE_URL; a.className = el.className; a.textContent = el.textContent; el.replaceWith(a); }); document.querySelectorAll(".evidence-when").forEach(function (el) { el.textContent = "Published before the first release."; }); } var form = document.getElementById("pilot-form"); if (!form) return; var button = form.querySelector('button[type="submit"]'); var status = form.querySelector(".form-status"); // The reply depends on the Mac. The beta needs Apple silicon, 16 GB or more and macOS 15 or newer; // the other three answers get a "not yet", never silence. var REPLIES = { "Apple silicon, under 16 GB": "Thank you. The beta needs a Mac with 16 GB of memory or more, so it will not run on yours yet. We will tell you if that changes.", "Apple silicon, older macOS": "Thank you. The beta needs macOS 15 or newer, so it will not run on your Mac as it is today. If you update to macOS 15 or newer, it will. We will email you the beta build when it is ready.", "Intel": "Thank you. The beta needs a Mac with Apple silicon, so it will not run on yours yet. We will tell you if that changes." }; var DEFAULT_REPLY = "Thank you. We will email you the beta build when it is ready."; // The browser has already checked the required fields before this runs. form.addEventListener("submit", function (event) { event.preventDefault(); var mac = form.elements.mac ? form.elements.mac.value : ""; button.disabled = true; status.textContent = "Sending."; fetch(form.action, { method: "POST", body: new FormData(form), headers: { Accept: "application/json" } }).then(function (res) { if (!res.ok) throw new Error("status " + res.status); var done = document.createElement("p"); done.className = "form-done"; done.setAttribute("role", "status"); done.tabIndex = -1; done.textContent = REPLIES[mac] || DEFAULT_REPLY; form.replaceWith(done); done.focus(); }).catch(function () { button.disabled = false; status.textContent = "That did not send. Please try again, or write to vishnu@plainword.health."; }); }); })();