// This function does the following // 1. fetches the PDF resume from the url provided // 2. creates a file object with the resume data // 3. triggers the change event on the file input element // 4. the file input element gets the file object // 5. the file object is uploaded to the website async function handleResumeInput(remoteResumeURL) { const designFile = await createFile(remoteResumeURL); const input = document.querySelector('input[type="file"]'); const dt = new DataTransfer(); dt.items.add(designFile); input.files = dt.files; const event = new Event("change", { bubbles: !0, }); input.dispatchEvent(event); } async function createFile(url) { let response = await fetch(url); let data = await response.blob(); let metadata = { type: "application/pdf", }; return new File([data], "resume.pdf", metadata); }