javascript:(async()=>{function g(e,t){return e.reduce((i,n,c)=>i+n+(t[c]??""),"").replace(/>%5Cs+<").replace(/%5Cs+/g," ").trim()}var y=(e,...t)=>g(e,t),h=(e,...t)=>g(e,t);var d="docapprover.uberinternal.com",k="/api/tppRejectDocumentAuthenticity?localeCode=en",T={"41d39627-0917-4390-ad39-494d676f310e":"License Checker Mismatch"},S=`https://${d}/document/`,$="https://partners-platform-tools-storage.uberinternal.com/document/",j=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function U(){let e=document.cookie.match(/(?:^|;%5Cs*)x-csrf-token=([^;]+)/i);return e?decodeURIComponent(e[1]):"x"}async function w(e,t){let i={documentUuid:{value:e},rejectReasonUuid:{value:t},isShadowModeOn:!1},n=await fetch(`https://${d}${k}`,{method:"POST",mode:"cors",credentials:"include",headers:{accept:"*/*","content-type":"application/json","x-csrf-token":U()},body:JSON.stringify(i)});if(!n.ok)throw new Error(`${n.status} ${n.statusText}`)}function E(e){let t=e.trim().replace(S,"").replace(/%5C/$/,"");return j.test(t)?t:null}function R(){if(location.hostname!==d){alert(`Doc Reject must be run from ${d}.`);return}let e=document.createElement("div");e.style.cssText=h` position: fixed; inset: 0; z-index: 2147483647; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; font-family: system-ui, sans-serif; `,e.innerHTML=y`

Reject documents

`,document.body.appendChild(e);let t=e.querySelector("%23dr-reason"),i=e.querySelector("%23dr-input"),n=e.querySelector("%23dr-status"),c=e.querySelector("%23dr-results"),v=e.querySelector("%23dr-links"),p=e.querySelector("%23dr-submit"),l=e.querySelector("%23dr-cancel"),x=()=>e.remove();l.onclick=x,e.onclick=s=>s.target===e&&x(),i.focus(),p.onclick=async()=>{let s=t.value.trim(),a=i.value.split(/%5Cr?%5Cn/).map(o=>o.trim()).filter(Boolean),f=a.map(E),b=a.filter((o,m)=>!f[m]);if(b.length){n.textContent=`Invalid document UUID or URL: ${b.join(", ")}`;return}let r=f.filter(o=>o!==null);if(!r.length){n.textContent="Enter at least one document UUID.";return}p.disabled=!0,l.disabled=!0,n.textContent=`Rejecting ${r.length}%5Cu2026`;let u=(await Promise.allSettled(r.map(o=>w(o,s)))).flatMap((o,m)=>o.status==="rejected"?[`${r[m]}: ${o.reason?.message??o.reason}`]:[]);if(!u.length){n.textContent=`Rejected all ${r.length}.`,v.value=r.map(o=>`${$}${o}`).join(`%0A`),c.hidden=!1,l.disabled=!1;return}n.style.color="%23d32f2f",n.textContent=`${r.length-u.length}/${r.length} ok. Failed: `+u.join("; "),p.disabled=!1,l.disabled=!1}}R();})()