mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-18 21:57:20 +02:00
fix: restore visible Ko-fi support across screen sizes
This commit is contained in:
1 parent
282efdc16e
commit
a7e3826da7
7 files changed
+86
-18
No files matched your search
@@ -64,6 +64,11 @@ export const mainController = function (state, http, location, timeout) {
|
||||
document.head.append(link);
|
||||
$(`link[href='${darkPrismLink}']`).remove();
|
||||
}
|
||||
const kofiBtn = document.querySelector("[class*='floatingchat-container-wrap'] [class*='floating-chat-kofi-text-container-wrap']");
|
||||
if (kofiBtn) {
|
||||
kofiBtn.style.backgroundColor = on ? "#FAF9F6" : "#1A1815";
|
||||
kofiBtn.style.color = on ? "#1A1815" : "#FAF9F6";
|
||||
}
|
||||
state.emit("dark-mode", on);
|
||||
};
|
||||
|
||||
|
||||
Vendored
+15
-15
@@ -1,30 +1,30 @@
|
||||
"use strict";(()=>{var xl=Object.defineProperty;var ed=(e,t)=>{for(var n in t)xl(e,n,{get:t[n],enumerable:!0})};var pe=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var fe={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",markdown:"/script/markdown.44f2e93820.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};var us=new Map,sd=fe;function Jt(e){if(!us.has(e)){let t=document.createElement("script");t.src=sd[e];let n=new Promise((r,s)=>{t.onload=r,t.onerror=()=>{us.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});us.set(e,n),document.head.appendChild(t)}return us.get(e)}async function lr(){await Jt("editor"),ace.config.set("basePath","/script/external/ace/")}function po(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Ie={},Qt=[],at=()=>{},sn=()=>!1,fo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),mo=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Oo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},nd=Object.prototype.hasOwnProperty,De=(e,t)=>nd.call(e,t),be=Array.isArray,$t=e=>Io(e)==="[object Map]",co=e=>Io(e)==="[object Set]",dr=e=>Io(e)==="[object Date]";var we=e=>typeof e=="function",ze=e=>typeof e=="string",mt=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",nn=e=>(Ae(e)||we(e))&&we(e.then)&&we(e.catch),pr=Object.prototype.toString,Io=e=>pr.call(e),rn=e=>Io(e).slice(8,-1),cs=e=>Io(e)==="[object Object]",ps=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ho=po(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var fs=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},rd=/-\w/g,Je=fs(e=>e.replace(rd,t=>t.slice(1).toUpperCase())),id=/\B([A-Z])/g,St=fs(e=>e.replace(id,"-$1").toLowerCase()),Xt=fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Po=fs(e=>e?`on${Xt(e)}`:""),gt=(e,t)=>!Object.is(e,t),vo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ms=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var ur,qo=()=>ur||(ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Me(e){if(be(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],s=ze(r)?ud(r):Me(r);if(s)for(let i in s)t[i]=s[i]}return t}else if(ze(e)||Ae(e))return e}var ad=/;(?![^(]*\))/g,ld=/:([^]+)/,dd=/\/\*[^]*?\*\//g;function ud(e){let t={};return e.replace(dd,"").split(ad).forEach(n=>{if(n){let r=n.split(ld);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function A(e){let t="";if(ze(e))t=e;else if(be(e))for(let n=0;n<e.length;n++){let r=A(e[n]);r&&(t+=r+" ")}else if(Ae(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}var fr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mr=po(fr),cd=po(fr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function hs(e){return!!e||e===""}function pd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=go(e[r],t[r]);return n}function cr(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let s of e){let i=-1;for(let a=0;a<n.length;a++)if(!r[a]&&go(s,n[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function go(e,t){if(e===t)return!0;let n=dr(e),r=dr(t);if(n||r)returLine truncated
|
||||
`))),e[Bs]=ji(s);let i=r||s.props&&s.props.type==="number";So(e,t?"change":"input",a=>{a.target.composing||e[Bs](Fn(e.value,n,i))}),(n||i)&&So(e,"change",()=>{e.value=Fn(e.value,n,i)}),t||(So(e,"compositionstart",oc),So(e,"compositionend",Gi),So(e,"change",Gi))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let s=t??"",i=e[js];delete e[js],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Bs](Fn(e.value,n,r)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},a){if(e[Bs]=ji(a),e.composing)return;let u=(i||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,f=t??"";if(u===f)return;let h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===f)||(e.value=f)}};var sc=["ctrl","shift","alt","meta"],nc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>sc.some(n=>e[`${n}Key`]&&!t.includes(n))},ce=(e,t)=>{if(!e)return e;let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let a=0;a<t.length;a++){let u=nc[t[a]];if(u&&u(s,t))return}return e(s,...i)}))},rc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},No=(e,t)=>{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;let i=St(s.key);if(t.some(a=>a===i||rc[a]===i))return e(s)}))},ic=Ge({patchProp:xu},$u),Wi;function ac(){return Wi||(Wi=Ni(ic))}var Qi=((...e)=>{let t=ac().createApp(...e),{mount:n}=t;return t.mount=r=>{let s=dc(r);if(!s)return;let i=t._component;!we(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=n(s,!1,lc(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function lc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function dc(e){return ze(e)?document.querySelector(e):e}var lo=typeof document<"u";function Zi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function uc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Zi(e.default)}var Oe=Object.assign;function Ws(e,t){let n={};for(let r in t){let s=t[r];n[r]=wt(s)?s.map(e):e(s)}return n}var Ro=()=>{},wt=Array.isArray;function jn(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var xi=/#/g,cc=/&/g,pc=/\//g,fc=/=/g,mc=/\?/g,ea=/\+/g,hc=/%5B/g,vc=/%5D/g,ta=/%5E/g,gc=/%60/g,oa=/%7B/g,yc=/%7C/g,sa=/%7D/g,bc=/%20/g;function Gn(e){return e==null?"":encodeURI(""+e).replace(yc,"|").replace(hc,"[").replace(vc,"]")}function na(e){return Gn(e).replace(oa,"{").replace(sa,"}").replace(ta,"^")}function Hn(e){return Gn(e).replace(ea,"%2B").replace(bc,"+").replace(xi,"%23").replace(cc,"%26").replace(gc,"`").replace(oa,"{").replace(sa,"}").replace(ta,"^")}function wc(e){return Hn(e).replace(fc,"%3D")}function kc(e){return Gn(e).replace(xi,"%23").replace(mc,"%3F")}function ra(e){return kc(e).replace(pc,"%2F")}function Do(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Ec=/\/$/,Cc=e=>e.replace(Ec,"");function Ks(e,t,n="/"){let r,s={},i="",a="",u=t.indexOf("#"),f=t.indexOf("?");return f=u>=0&&f>u?-1:f,f>=0&&(r=t.slice(0,f),i=t.slice(f,u>0?u:t.length),s=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=Sc(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:Do(a)}}function ia(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Wn(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function aa(e,t,n){let r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&io(t.matched[r],n.matched[s])&&Kn(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function io(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Kn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!_c(e[n],t[n]))return!1;return!0}function _c(e,t){return wt(e)?Xi(e,t):wt(t)?Xi(t,e):e?.valueOf()===t?.valueOf()}function Xi(e,t){return wt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Sc(e,t){if(e.startsWith("/"))return e;if(!e)return t;let n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,a,u;for(a=0;a<r.length;a++)if(u=r[a],u!==".")if(u==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(a).join("/")}var Wt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ys=(function(e){return e.pop="pop",e.push="push",e})({}),Js=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function la(e){if(!e)if(lo){let t=document.querLine truncated
|
||||
"use strict";(()=>{var xl=Object.defineProperty;var ed=(e,t)=>{for(var n in t)xl(e,n,{get:t[n],enumerable:!0})};var pe=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var fe={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",markdown:"/script/markdown.44f2e93820.min.js",editor:"/script/editor.4f142d3adc.min.js"};var us=new Map,sd=fe;function Jt(e){if(!us.has(e)){let t=document.createElement("script");t.src=sd[e];let n=new Promise((r,s)=>{t.onload=r,t.onerror=()=>{us.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});us.set(e,n),document.head.appendChild(t)}return us.get(e)}async function lr(){await Jt("editor"),ace.config.set("basePath","/script/external/ace/")}function po(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Ie={},Qt=[],at=()=>{},sn=()=>!1,fo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),mo=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Oo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},nd=Object.prototype.hasOwnProperty,De=(e,t)=>nd.call(e,t),be=Array.isArray,$t=e=>Io(e)==="[object Map]",co=e=>Io(e)==="[object Set]",dr=e=>Io(e)==="[object Date]";var we=e=>typeof e=="function",ze=e=>typeof e=="string",mt=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",nn=e=>(Ae(e)||we(e))&&we(e.then)&&we(e.catch),pr=Object.prototype.toString,Io=e=>pr.call(e),rn=e=>Io(e).slice(8,-1),cs=e=>Io(e)==="[object Object]",ps=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ho=po(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var fs=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},rd=/-\w/g,Je=fs(e=>e.replace(rd,t=>t.slice(1).toUpperCase())),id=/\B([A-Z])/g,St=fs(e=>e.replace(id,"-$1").toLowerCase()),Xt=fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Po=fs(e=>e?`on${Xt(e)}`:""),gt=(e,t)=>!Object.is(e,t),vo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ms=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var ur,qo=()=>ur||(ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Me(e){if(be(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],s=ze(r)?ud(r):Me(r);if(s)for(let i in s)t[i]=s[i]}return t}else if(ze(e)||Ae(e))return e}var ad=/;(?![^(]*\))/g,ld=/:([^]+)/,dd=/\/\*[^]*?\*\//g;function ud(e){let t={};return e.replace(dd,"").split(ad).forEach(n=>{if(n){let r=n.split(ld);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function A(e){let t="";if(ze(e))t=e;else if(be(e))for(let n=0;n<e.length;n++){let r=A(e[n]);r&&(t+=r+" ")}else if(Ae(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}var fr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mr=po(fr),cd=po(fr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function hs(e){return!!e||e===""}function pd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=go(e[r],t[r]);return n}function cr(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let s of e){let i=-1;for(let a=0;a<n.length;a++)if(!r[a]&&go(s,n[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function go(e,t){if(e===t)return!0;let n=dr(e),r=dr(t);if(n||r)returLine truncated
|
||||
`))),e[Bs]=ji(s);let i=r||s.props&&s.props.type==="number";So(e,t?"change":"input",a=>{a.target.composing||e[Bs](Fn(e.value,n,i))}),(n||i)&&So(e,"change",()=>{e.value=Fn(e.value,n,i)}),t||(So(e,"compositionstart",oc),So(e,"compositionend",Gi),So(e,"change",Gi))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let s=t??"",i=e[js];delete e[js],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Bs](Fn(e.value,n,r)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},a){if(e[Bs]=ji(a),e.composing)return;let u=(i||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,m=t??"";if(u===m)return;let h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===m)||(e.value=m)}};var sc=["ctrl","shift","alt","meta"],nc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>sc.some(n=>e[`${n}Key`]&&!t.includes(n))},ce=(e,t)=>{if(!e)return e;let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let a=0;a<t.length;a++){let u=nc[t[a]];if(u&&u(s,t))return}return e(s,...i)}))},rc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},No=(e,t)=>{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;let i=St(s.key);if(t.some(a=>a===i||rc[a]===i))return e(s)}))},ic=Ge({patchProp:xu},$u),Wi;function ac(){return Wi||(Wi=Ni(ic))}var Qi=((...e)=>{let t=ac().createApp(...e),{mount:n}=t;return t.mount=r=>{let s=dc(r);if(!s)return;let i=t._component;!we(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=n(s,!1,lc(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function lc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function dc(e){return ze(e)?document.querySelector(e):e}var lo=typeof document<"u";function Zi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function uc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Zi(e.default)}var Oe=Object.assign;function Ws(e,t){let n={};for(let r in t){let s=t[r];n[r]=wt(s)?s.map(e):e(s)}return n}var Ro=()=>{},wt=Array.isArray;function jn(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var xi=/#/g,cc=/&/g,pc=/\//g,fc=/=/g,mc=/\?/g,ea=/\+/g,hc=/%5B/g,vc=/%5D/g,ta=/%5E/g,gc=/%60/g,oa=/%7B/g,yc=/%7C/g,sa=/%7D/g,bc=/%20/g;function Gn(e){return e==null?"":encodeURI(""+e).replace(yc,"|").replace(hc,"[").replace(vc,"]")}function na(e){return Gn(e).replace(oa,"{").replace(sa,"}").replace(ta,"^")}function Hn(e){return Gn(e).replace(ea,"%2B").replace(bc,"+").replace(xi,"%23").replace(cc,"%26").replace(gc,"`").replace(oa,"{").replace(sa,"}").replace(ta,"^")}function wc(e){return Hn(e).replace(fc,"%3D")}function kc(e){return Gn(e).replace(xi,"%23").replace(mc,"%3F")}function ra(e){return kc(e).replace(pc,"%2F")}function Do(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Ec=/\/$/,Cc=e=>e.replace(Ec,"");function Ks(e,t,n="/"){let r,s={},i="",a="",u=t.indexOf("#"),m=t.indexOf("?");return m=u>=0&&m>u?-1:m,m>=0&&(r=t.slice(0,m),i=t.slice(m,u>0?u:t.length),s=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=Sc(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:Do(a)}}function ia(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Wn(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function aa(e,t,n){let r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&io(t.matched[r],n.matched[s])&&Kn(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function io(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Kn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!_c(e[n],t[n]))return!1;return!0}function _c(e,t){return wt(e)?Xi(e,t):wt(t)?Xi(t,e):e?.valueOf()===t?.valueOf()}function Xi(e,t){return wt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Sc(e,t){if(e.startsWith("/"))return e;if(!e)return t;let n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,a,u;for(a=0;a<r.length;a++)if(u=r[a],u!==".")if(u==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(a).join("/")}var Wt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ys=(function(e){return e.pop="pop",e.push="push",e})({}),Js=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function la(e){if(!e)if(lo){let t=document.querLine truncated
|
||||
${JSON.stringify(e)}${t?`
|
||||
while being at
|
||||
`+JSON.stringify(t):""}`},[je.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Ac(t)}" via a navigation guard.`},[je.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[je.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[je.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return Oe(new Error,{type:e,[fa]:!0},t)}function Mt(e,t){return e instanceof Error&&fa in e&&(t==null||!!(e.type&t))}var Tc=["params","query","hash"];function Ac(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let n of Tc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ma(e){let t={};if(e===""||e==="?")return t;let n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){let s=n[r].replace(ea," "),i=s.indexOf("="),a=Do(i<0?s:s.slice(0,i)),u=i<0?null:Do(s.slice(i+1));if(a in t){let f=t[a];wt(f)||(f=t[a]=[f]),f.push(u)}else t[a]=u}return t}function Qn(e){let t="";for(let n in e){let r=e[n];if(n=wc(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(wt(r)?r.map(s=>s&&Hn(s)):[r&&Hn(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ha(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=wt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}var va=Symbol(""),Xn=Symbol(""),Qs=Symbol(""),Xs=Symbol(""),Zs=Symbol("");function To(){let e=[];function t(r){return e.push(r),()=>{let s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Gt(e,t,n,r,s,i=a=>a()){let a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((u,f)=>{let h=m=>{m===!1?f(ao(je.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?f(m):Rc(m)?f(ao(je.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),u())},v=i(()=>e.call(r&&r.instances[s],t,n,h)),b=Promise.resolve(v);e.length<3&&(b=b.then(h)),b.catch(m=>f(m))})}function xs(e,t,n,r,s=i=>i()){let i=[];for(let a of e)for(let u in a.components){let f=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Zi(f)){let h=(f.__vccOpts||f)[t];h&&i.push(Gt(h,n,r,a,u,s))}else{let h=f();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let b=uc(v)?v.default:v;a.mods[u]=v,a.components[u]=b;let m=(b.__vccOpts||b)[t];return m&&Gt(m,n,r,a,u,s)()}))}}return i}function ga(e,t){let n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let u=t.matched[a];u&&(e.matched.find(h=>io(h,u))?r.push(u):n.push(u));let f=e.matched[a];f&&(t.matched.find(h=>io(h,f))||s.push(f))}return[n,r,s]}var Oc=()=>location.protocol+"//"+location.host;function Ra(e,t){let{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,u=s.slice(a);return u[0]!=="/"&&(u="/"+u),Wn(u,"")}return Wn(n,e)+r+s}function Ic(e,t,n,r){let s=[],i=[],a=null,u=({state:m})=>{let w=Ra(e,location),C=n.value,k=t.value,R=0;if(m){if(n.value=w,t.value=m,a&&a===C){a=null;return}R=k?m.position-k.position:0}else r(w);s.forEach(D=>{D(n.value,C,{delta:R,type:Ys.pop,direction:R?R>0?Js.forward:Js.back:Js.unknown})})};function f(){a=n.value}function h(m){s.push(m);let w=()=>{let C=s.indexOf(m);C>-1&&s.splice(C,1)};return i.push(w),w}function v(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Oe({},m.state,{scroll:ds()}),"")}}function b(){for(let m of i)m();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:f,listen:h,destroy:b}}function ya(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ds():null}}function Pc(e){let{history:t,location:n}=window,r={value:Ra(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(f,h,v){let b=e.indexOf("#"),m=b>-1?(n.host&&document.querySelector("base")?e:e.slice(b))+f:Oc()+e+f;try{t[v?"replaceState":"pushState"](h,"",m),s.value=h}catch(w){console.error(w),n[v?"replace":"assign"](m)}}function a(f,h){i(f,Oe({},t.state,ya(s.value.back,f,s.value.forward,!0),h,{position:s.value.position}),!0),r.value=f}function u(f,h){let v=Oe({},s.value,t.state,{forward:f,scroll:ds()});i(v.current,v,!0),i(f,Oe({},ya(r.value,f,null),{position:v.position+1},h),!1),r.value=f}return{location:r,state:s,push:u,replace:a}}function Ta(e){e=la(e);let t=Pc(e),n=Ic(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}let s=Oe({locatLine truncated
|
||||
`)),e.options=Object.assign({},e.options,h.options),i.restore()})}a();let u=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let h=i.checkpoint(),v={terms:e.terms.split(`
|
||||
`).map(b=>b.trim()).filter(b=>b.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",v).then(()=>{i.accept(h),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",u&&r.cancel(u),u=r(()=>{e.message=null},2500)},b=>{e.saving=!1;let w="ERRORS."+(b&&b.data&&b.data.error);n(w).then(C=>{e.error=C&&C!==w?C:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},La=function(e,t,n){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{n.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Ua=function(e,t,n,r,s){e.user&&!e.user.status&&n.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&n.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,f){let h={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(h===void 0)return;u.preventDefault();let v=e.features.length,b=h==="first"?0:h==="last"?v-1:(f+h+v)%v;e.feature=e.features[b].key,s(()=>{let m=r.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function i(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests})}i();function a(u){let f={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return f;let h=new Array(u.length-1);for(let k=1;k<u.length;k++)h[k-1]=u[k]-u[k-1];let v=h.length,b=Math.max.apply(null,h),m=Math.min.apply(null,h),w=Math.min(0,m),C=b-w||1;f.viewW=v*2,f.bars=new Array(v);for(let k=0;k<v;k++){let R=(h[k]-w)/C,D=Math.max(1.5,R*34);f.bars[k]={x:(k*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(f.deltaToday=h[v-1],v>=2){let k=h[v-2];k&&(f.pctChange=(f.deltaToday-k)/k*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let f=u.data||[];e.history={repositories:a(f.map(h=>h.nbRepositories||0)),users:a(f.map(h=>h.nbUsers||0)),pageViews:a(f.map(h=>h.nbPageViews||0)),pullRequests:a(f.map(h=>h.nbPullRequests||0))}})},Fa=function(e,t,n,r,s,i){let a=ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,rt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Kt()(document,"click",_=>{e.quotaExpanded&&!_.target.closest?.(".dashboard-quota")&&
Line truncated
|
||||
`+JSON.stringify(t):""}`},[je.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Ac(t)}" via a navigation guard.`},[je.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[je.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[je.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return Oe(new Error,{type:e,[fa]:!0},t)}function Mt(e,t){return e instanceof Error&&fa in e&&(t==null||!!(e.type&t))}var Tc=["params","query","hash"];function Ac(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let n of Tc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ma(e){let t={};if(e===""||e==="?")return t;let n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){let s=n[r].replace(ea," "),i=s.indexOf("="),a=Do(i<0?s:s.slice(0,i)),u=i<0?null:Do(s.slice(i+1));if(a in t){let m=t[a];wt(m)||(m=t[a]=[m]),m.push(u)}else t[a]=u}return t}function Qn(e){let t="";for(let n in e){let r=e[n];if(n=wc(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(wt(r)?r.map(s=>s&&Hn(s)):[r&&Hn(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ha(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=wt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}var va=Symbol(""),Xn=Symbol(""),Qs=Symbol(""),Xs=Symbol(""),Zs=Symbol("");function To(){let e=[];function t(r){return e.push(r),()=>{let s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Gt(e,t,n,r,s,i=a=>a()){let a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((u,m)=>{let h=f=>{f===!1?m(ao(je.NAVIGATION_ABORTED,{from:n,to:t})):f instanceof Error?m(f):Rc(f)?m(ao(je.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(a&&r.enterCallbacks[s]===a&&typeof f=="function"&&a.push(f),u())},v=i(()=>e.call(r&&r.instances[s],t,n,h)),w=Promise.resolve(v);e.length<3&&(w=w.then(h)),w.catch(f=>m(f))})}function xs(e,t,n,r,s=i=>i()){let i=[];for(let a of e)for(let u in a.components){let m=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Zi(m)){let h=(m.__vccOpts||m)[t];h&&i.push(Gt(h,n,r,a,u,s))}else{let h=m();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let w=uc(v)?v.default:v;a.mods[u]=v,a.components[u]=w;let f=(w.__vccOpts||w)[t];return f&&Gt(f,n,r,a,u,s)()}))}}return i}function ga(e,t){let n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let u=t.matched[a];u&&(e.matched.find(h=>io(h,u))?r.push(u):n.push(u));let m=e.matched[a];m&&(t.matched.find(h=>io(h,m))||s.push(m))}return[n,r,s]}var Oc=()=>location.protocol+"//"+location.host;function Ra(e,t){let{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,u=s.slice(a);return u[0]!=="/"&&(u="/"+u),Wn(u,"")}return Wn(n,e)+r+s}function Ic(e,t,n,r){let s=[],i=[],a=null,u=({state:f})=>{let b=Ra(e,location),C=n.value,k=t.value,R=0;if(f){if(n.value=b,t.value=f,a&&a===C){a=null;return}R=k?f.position-k.position:0}else r(b);s.forEach(D=>{D(n.value,C,{delta:R,type:Ys.pop,direction:R?R>0?Js.forward:Js.back:Js.unknown})})};function m(){a=n.value}function h(f){s.push(f);let b=()=>{let C=s.indexOf(f);C>-1&&s.splice(C,1)};return i.push(b),b}function v(){if(document.visibilityState==="hidden"){let{history:f}=window;if(!f.state)return;f.replaceState(Oe({},f.state,{scroll:ds()}),"")}}function w(){for(let f of i)f();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:m,listen:h,destroy:w}}function ya(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ds():null}}function Pc(e){let{history:t,location:n}=window,r={value:Ra(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(m,h,v){let w=e.indexOf("#"),f=w>-1?(n.host&&document.querySelector("base")?e:e.slice(w))+m:Oc()+e+m;try{t[v?"replaceState":"pushState"](h,"",f),s.value=h}catch(b){console.error(b),n[v?"replace":"assign"](f)}}function a(m,h){i(m,Oe({},t.state,ya(s.value.back,m,s.value.forward,!0),h,{position:s.value.position}),!0),r.value=m}function u(m,h){let v=Oe({},s.value,t.state,{forward:m,scroll:ds()});i(v.current,v,!0),i(m,Oe({},ya(r.value,m,null),{position:v.position+1},h),!1),r.value=m}return{location:r,state:s,push:u,replace:a}}function Ta(e){e=la(e);let t=Pc(e),n=Ic(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}let s=Oe({locatLine truncated
|
||||
`)),e.options=Object.assign({},e.options,h.options),i.restore()})}a();let u=null;e.saveDefault=m=>{if(m&&m.preventDefault&&m.preventDefault(),e.saving)return;let h=i.checkpoint(),v={terms:e.terms.split(`
|
||||
`).map(w=>w.trim()).filter(w=>w.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",v).then(()=>{i.accept(h),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",u&&r.cancel(u),u=r(()=>{e.message=null},2500)},w=>{e.saving=!1;let b="ERRORS."+(w&&w.data&&w.data.error);n(b).then(C=>{e.error=C&&C!==b?C:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},La=function(e,t,n){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{n.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Ua=function(e,t,n,r,s){e.user&&!e.user.status&&n.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&n.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,m){let h={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(h===void 0)return;u.preventDefault();let v=e.features.length,w=h==="first"?0:h==="last"?v-1:(m+h+v)%v;e.feature=e.features[w].key,s(()=>{let f=r.document.getElementById("feature-tab-"+e.feature);f&&f.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function i(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests})}i();function a(u){let m={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return m;let h=new Array(u.length-1);for(let k=1;k<u.length;k++)h[k-1]=u[k]-u[k-1];let v=h.length,w=Math.max.apply(null,h),f=Math.min.apply(null,h),b=Math.min(0,f),C=w-b||1;m.viewW=v*2,m.bars=new Array(v);for(let k=0;k<v;k++){let R=(h[k]-b)/C,D=Math.max(1.5,R*34);m.bars[k]={x:(k*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(m.deltaToday=h[v-1],v>=2){let k=h[v-2];k&&(m.pctChange=(m.deltaToday-k)/k*100)}return m.pctAbs=Math.round(Math.abs(m.pctChange)),m.isUp=m.pctChange>=0,m}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let m=u.data||[];e.history={repositories:a(m.map(h=>h.nbRepositories||0)),users:a(m.map(h=>h.nbUsers||0)),pageViews:a(m.map(h=>h.nbPageViews||0)),pullRequests:a(m.map(h=>h.nbPullRequests||0))}})},Fa=function(e,t,n,r,s,i){let a=ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,rt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Kt()(document,"click",_=>{e.quotaExpanded&&!_.target.closest?.(".dashboard-quota")&&
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,M.options),e.options.expirationDate=M.options&&M.options.expirationDate?new Date(M.options.expirationDate):T(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),E&&E()})}function I(E,P,M){e.anonymize&&e.anonymize[E]&&e.anonymize[E].setValidity(P,M)}function J(E){try{let P=parseGithubUrl(E);if(P&&P.owner&&P.repo)return P.owner+"/"+P.repo}catch{}return null}e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await ae()}catch{}}};function Y(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:J(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function K(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function B(){let E;try{E=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!E||E.path!==s.path()||Date.now()-E.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await K(),!0):!1;R.restore();for(let P of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(E.draft,P)&&(e[P]=E.draft[P]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await K(),sessionStorage.removeItem("github-access-draft"),!0}O(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(B,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async E=>{e.githubConnection=E.data.connection||"oauth",e.sourceUrl="https://github.com/"+E.data.source.fullName,e._originalFullName=E.data.source.fullName,e.terms=E.data.options.terms.filter(P=>P).join(`
|
||||
`),e.source=E.data.source,e.role=E.data.role||"owner",e.coauthors=E.data.coauthors||[],e._originalBranch=E.data.source.branch,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,e.repositoryID=E.data.source.repositoryID,e._originalRepositoryID=E.data.source.repositoryID,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B()&&(await Promise.all([ae(),oe()]),ve())},()=>{s.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async E=>{if(e.githubConnection=E.data.connection||"oauth",e.sourceUrl="https://github.com/"+E.data.source.repositoryFullName+"/pull/"+E.data.source.pullRequestId,e.terms=E.data.options.terms.filter(P=>P).join(`
|
||||
`),e.source=E.data.source,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B())try{await me()}catch{}},()=>{s.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async E=>{e.sourceUrl="https://gist.github.com/"+E.data.source.gistId,e.terms=E.data.options.terms.filter(P=>P).join(`
|
||||
`),e.source=E.data.source,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B()&&await Se()},()=>{s.url("/404")}))}),t.get("/github/connections").then(E=>{e.githubConnections=E.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&E.data.appEnabled&&E.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&K())}).catch(()=>{}),e.urlSelected=async(E=!1)=>{let P=++f,M;try{M=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,he.cancel(),Ee.cancel(),Ve.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",I("sourceUrl","github",!1);return}let z=k(M),y=E||C===z;C=z,e.sourceUrlError="",I("sourceUrl","github",!0);let S=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,S&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!y&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],y||(e.source={type:"GitHubStream",branch:"",commit:""}),he.cancel(),Ee.cancel(),Ve.cancel(),ie.clear(),Ce.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e._preservingDraft=y;try{M.gistId&&!M.repo?(e.detectedType="gist",e.source={gistId:M.gistId},await Se()):M.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:M.owner+"/"+M.repo,pullRequestId:M.pullRequestId},await me()):(e.detectedType="repo",await Promise.all([ae(),oe()]),ve())}catch{}finally{P===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let E=e.branches.filter(M=>M.name==e.source.branch)[0];if(!E)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=E.commit),e.readme=E.readme,await oe(),ve()}),e.getBranches=async E=>{let P=parseGithubUrl(e.sourceUrl),M=m();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0||e.reconnectingSource?"1":"0",repositoryID:Y()}});if(!b(M))return;e.branches=z.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let y=e.branches.filter(S=>S.name==e.source.branch);y.length>0&&(!(!e.reconnectingSource&&!E&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=y[0].commit),e.readme=y[0].readme,await oe(E))}catch(z){if(!b(M))return;e.branches=[],e.sourceUnreachable=z&&(z.status===404||z.data&&z.data.error==="repo_not_found");let y=z&&z.data&&z.data.error||(z&&z.status===404?"repo_not_found":"unknown_error");i("ERRORS."+y).then(S=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:S}),e.error=S},console.error),typeof I=="function"&&I("sourceUrl","missing",!1)}finally{w(M)}};async function ae(){let E=parseGithubUrl(e.sourceUrl),P=m();try{U();let M=await t.get(`/api/repo/${E.owner}/${E.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:Y(),force:"1"}});if(!b(P))return;e.details=M.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(M){if(!b(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}async function oe(E){if(e.readme&&!E)return e.readme;let P=parseGithubUrl(e.sourceUrl),M=m();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0?"1":"0",branch:e.source.branch,repositoryID:Y()}});b(M,!0)&&(e.readme=z.data)}catch{b(M,!0)&&(e.readme="")}finally{w(M)}}function ne(){let E={terms:e.terms?e.terms.split(`
|
||||
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(E.branchName=e.source.branch);try{let P=parseGithubUrl(e.sourceUrl);E.repoName=`${P.owner}/${P.repo}`}catch{}return E}function ue(E,P,M){let z=null,y=0,S=()=>{if(e.detectedType!==E)return;z&&a.cancel(z);let q=++y;e.previewStatus="loading",z=a(()=>{z=null;let H=P();if(!H){e.previewStatus="idle";return}t.post("/api/anonymize-preview",H).then(j=>{q===y&&(M(j.data,H),e.previewStatus="ready")}).catch(()=>{q===y&&(e.previewStatus="error")})},200)};return S.cancel=()=>{y++,z&&a.cancel(z),z=null},e.on("dispose",S.cancel),S}e.retryPreview=()=>{e.detectedType==="repo"&&he(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()};let he=ue("repo",()=>e.readme?{content:e.readme,options:ne()}:null,E=>{if(typeof E?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=E.content;let P="";try{let z=parseGithubUrl(e.sourceUrl),y=e.source.branch||e.details&&e.details.defaultBranch||"main";P=`https://github.com/${z.owner}/${z.repo}/raw/${y}/`}catch{}let M=renderMD(e.anonymize_readme,P);e.html_readme=M,a(Prism.highlightAll,150)});function ve(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),he())}async function me(){let E=parseGithubUrl(e.sourceUrl),P=m();try{U();let M=await t.get(`/api/pr/${E.owner}/${E.repo}/${E.pullRequestId}`,{params:{connection:e.githubConnection}});if(!b(P))return;e.details=M.data,e.pullRequestId||(e.pullRequestId=E.repo+"-PR"+E.pullRequestId+"-"+generateRandomId(4))}catch(M){if(!b(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}let ie=He(new Map);function Pe(){let E=new Set,P=e.details&&e.details.pullRequest;if(!P)return E;typeof P.title=="string"&&E.add(P.title),typeof P.body=="string"&&E.add(P.body),typeof P.diff=="string"&&E.add(P.diff);let M=P.comments||[];for(let z of M)typeof z.author=="string"&&E.add(z.author),typeof z.body=="string"&&E.add(z.body);return E}let Ee=ue("pr",()=>{let E=Pe(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);ie.clear(),z.forEach((y,S)=>ie.set(S,y))});e.anonymizePrContent=function(E){return E&&(ie.has(E)?ie.get(E):"")};async function Se(){let E=parseGithubUrl(e.sourceUrl),P=m();try{if(U(),e.gistOAuthRequired=!1,e.githubConnections?.oauthConnected===!1){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}let M=await t.get(`/api/gist/source/${E.gistId}`);if(!b(P))return;e.details=M.data,e.gistId||(e.gistId="gist-"+E.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(M){if(!b(P))return;if(M.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}let Ce=He(new Map);function Te(){let E=new Set,P=e.details&&e.details.gist;if(!P)return E;typeof P.description=="string"&&E.add(P.description),typeof P.ownerLogin=="string"&&E.add(P.ownerLogin);let M=P.files||[];for(let y of M)typeof y.filename=="string"&&E.add(y.filename),typeof y.content=="string"&&E.add(y.content);let z=P.comments||[];for(let y of z)typeof y.author=="string"&&E.add(y.author),typeof y.body=="string"&&E.add(y.body);return E}let Ve=ue("gist",()=>{let E=Te(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);Ce.clear(),z.forEach((y,S)=>Ce.set(S,y)),Ue()});e.anonymizeGistContent=function(E){return E&&(Ce.has(E)?Ce.get(E):"")},e.previewGistFiles=[];function Ue(){let E=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=E.map(P=>({filename:e.anonymizeGistContent(P.filename),content:e.anonymizeGistContent(P.content),language:P.language}))}e.watch("details.gist.files",Ue,!0),e.watch("terms",Ue);function Fe(){let E=e.conference;if(e.conference_data=null,!E)return;let P=e.isUpdate&&E===e._originalConference;t.get("/api/conferences/"+E).then(M=>{e.conference===E&&(e.conference_data=M.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!P&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.ima
Line truncated
|
||||
`),e.source=E.data.source,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B()&&await Se()},()=>{s.url("/404")}))}),t.get("/github/connections").then(E=>{e.githubConnections=E.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&E.data.appEnabled&&E.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&K())}).catch(()=>{}),e.urlSelected=async(E=!1)=>{let P=++m,M;try{M=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,he.cancel(),Ee.cancel(),Ve.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",I("sourceUrl","github",!1);return}let z=k(M),y=E||C===z;C=z,e.sourceUrlError="",I("sourceUrl","github",!0);let S=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,S&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!y&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],y||(e.source={type:"GitHubStream",branch:"",commit:""}),he.cancel(),Ee.cancel(),Ve.cancel(),ie.clear(),Ce.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e._preservingDraft=y;try{M.gistId&&!M.repo?(e.detectedType="gist",e.source={gistId:M.gistId},await Se()):M.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:M.owner+"/"+M.repo,pullRequestId:M.pullRequestId},await me()):(e.detectedType="repo",await Promise.all([ae(),oe()]),ve())}catch{}finally{P===m&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let E=e.branches.filter(M=>M.name==e.source.branch)[0];if(!E)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=E.commit),e.readme=E.readme,await oe(),ve()}),e.getBranches=async E=>{let P=parseGithubUrl(e.sourceUrl),M=f();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0||e.reconnectingSource?"1":"0",repositoryID:Y()}});if(!w(M))return;e.branches=z.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let y=e.branches.filter(S=>S.name==e.source.branch);y.length>0&&(!(!e.reconnectingSource&&!E&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=y[0].commit),e.readme=y[0].readme,await oe(E))}catch(z){if(!w(M))return;e.branches=[],e.sourceUnreachable=z&&(z.status===404||z.data&&z.data.error==="repo_not_found");let y=z&&z.data&&z.data.error||(z&&z.status===404?"repo_not_found":"unknown_error");i("ERRORS."+y).then(S=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:S}),e.error=S},console.error),typeof I=="function"&&I("sourceUrl","missing",!1)}finally{b(M)}};async function ae(){let E=parseGithubUrl(e.sourceUrl),P=f();try{U();let M=await t.get(`/api/repo/${E.owner}/${E.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:Y(),force:"1"}});if(!w(P))return;e.details=M.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(M){if(!w(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{b(P)}}async function oe(E){if(e.readme&&!E)return e.readme;let P=parseGithubUrl(e.sourceUrl),M=f();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0?"1":"0",branch:e.source.branch,repositoryID:Y()}});w(M,!0)&&(e.readme=z.data)}catch{w(M,!0)&&(e.readme="")}finally{b(M)}}function ne(){let E={terms:e.terms?e.terms.split(`
|
||||
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(E.branchName=e.source.branch);try{let P=parseGithubUrl(e.sourceUrl);E.repoName=`${P.owner}/${P.repo}`}catch{}return E}function ue(E,P,M){let z=null,y=0,S=()=>{if(e.detectedType!==E)return;z&&a.cancel(z);let q=++y;e.previewStatus="loading",z=a(()=>{z=null;let H=P();if(!H){e.previewStatus="idle";return}t.post("/api/anonymize-preview",H).then(j=>{q===y&&(M(j.data,H),e.previewStatus="ready")}).catch(()=>{q===y&&(e.previewStatus="error")})},200)};return S.cancel=()=>{y++,z&&a.cancel(z),z=null},e.on("dispose",S.cancel),S}e.retryPreview=()=>{e.detectedType==="repo"&&he(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()};let he=ue("repo",()=>e.readme?{content:e.readme,options:ne()}:null,E=>{if(typeof E?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=E.content;let P="";try{let z=parseGithubUrl(e.sourceUrl),y=e.source.branch||e.details&&e.details.defaultBranch||"main";P=`https://github.com/${z.owner}/${z.repo}/raw/${y}/`}catch{}let M=renderMD(e.anonymize_readme,P);e.html_readme=M,a(Prism.highlightAll,150)});function ve(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),he())}async function me(){let E=parseGithubUrl(e.sourceUrl),P=f();try{U();let M=await t.get(`/api/pr/${E.owner}/${E.repo}/${E.pullRequestId}`,{params:{connection:e.githubConnection}});if(!w(P))return;e.details=M.data,e.pullRequestId||(e.pullRequestId=E.repo+"-PR"+E.pullRequestId+"-"+generateRandomId(4))}catch(M){if(!w(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{b(P)}}let ie=He(new Map);function Pe(){let E=new Set,P=e.details&&e.details.pullRequest;if(!P)return E;typeof P.title=="string"&&E.add(P.title),typeof P.body=="string"&&E.add(P.body),typeof P.diff=="string"&&E.add(P.diff);let M=P.comments||[];for(let z of M)typeof z.author=="string"&&E.add(z.author),typeof z.body=="string"&&E.add(z.body);return E}let Ee=ue("pr",()=>{let E=Pe(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);ie.clear(),z.forEach((y,S)=>ie.set(S,y))});e.anonymizePrContent=function(E){return E&&(ie.has(E)?ie.get(E):"")};async function Se(){let E=parseGithubUrl(e.sourceUrl),P=f();try{if(U(),e.gistOAuthRequired=!1,e.githubConnections?.oauthConnected===!1){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}let M=await t.get(`/api/gist/source/${E.gistId}`);if(!w(P))return;e.details=M.data,e.gistId||(e.gistId="gist-"+E.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(M){if(!w(P))return;if(M.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{b(P)}}let Ce=He(new Map);function Te(){let E=new Set,P=e.details&&e.details.gist;if(!P)return E;typeof P.description=="string"&&E.add(P.description),typeof P.ownerLogin=="string"&&E.add(P.ownerLogin);let M=P.files||[];for(let y of M)typeof y.filename=="string"&&E.add(y.filename),typeof y.content=="string"&&E.add(y.content);let z=P.comments||[];for(let y of z)typeof y.author=="string"&&E.add(y.author),typeof y.body=="string"&&E.add(y.body);return E}let Ve=ue("gist",()=>{let E=Te(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);Ce.clear(),z.forEach((y,S)=>Ce.set(S,y)),Ue()});e.anonymizeGistContent=function(E){return E&&(Ce.has(E)?Ce.get(E):"")},e.previewGistFiles=[];function Ue(){let E=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=E.map(P=>({filename:e.anonymizeGistContent(P.filename),content:e.anonymizeGistContent(P.content),language:P.language}))}e.watch("details.gist.files",Ue,!0),e.watch("terms",Ue);function Fe(){let E=e.conference;if(e.conference_data=null,!E)return;let P=e.isUpdate&&E===e._originalConference;t.get("/api/conferences/"+E).then(M=>{e.conference===E&&(e.conference_data=M.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!P&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.ima
Line truncated
|
||||
`).filter(S=>S),connection:e.githubConnection,fullName:`${M.owner}/${M.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(z.options.pageSource=e.details.pageSource),U();let y=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.anonymizeGist=E=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let P=E.currentTarget||E.target.closest?.("button")||E.target;P.disabled=!0;let M=parseGithubUrl(e.sourceUrl),z={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(S=>S),source:{gistId:M.gistId},options:e.options,conference:e.conference};U();let y=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.anonymizePullRequest=E=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let P=E.currentTarget||E.target.closest?.("button")||E.target;P.disabled=!0;let M=parseGithubUrl(e.sourceUrl),z={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(S=>S),source:{repositoryFullName:`${M.owner}/${M.repo}`,pullRequestId:M.pullRequestId},options:e.options,conference:e.conference};U();let y=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.watch("conference",()=>{Fe()}),e.watch("terms",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("details",()=>{e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()},!0)},tr=function(e,t,n,r,s,i){let a=ct(),u=Kt(),f=0,h=!1;e.on("dispose",()=>{h=!0,f++,v&&v.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(document,"keydown",function(B){if((B.metaKey||B.ctrlKey)&&B.key==="k"){B.preventDefault();var ae=document.querySelector(".tree-search-input");ae&&(ae.focus(),ae.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let B=e.fileSearchQuery;if(!B||B.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let ae=i.defer();v=ae,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(B)}`,{timeout:ae.promise}).then(function(oe){if(!(h||v!==ae)){v=null,e.fileSearchLoading=!1;var ne={};e.files.forEach(function(U){ne[(U.path||"")+"/"+U.name]=!0});for(var ue=[],he={},ve=0;ve<oe.data.length;ve++){var me=oe.data[ve];if(me.path)for(var ie=me.path.split("/"),Pe="",Ee=0;Ee<ie.length;Ee++){var Se=Pe;Pe=Pe?Pe+"/"+ie[Ee]:ie[Ee];var Ce=Se+"/"+ie[Ee];!ne[Ce]&&!he[Ce]&&(he[Ce]=!0,ue.push({name:ie[Ee],path:Se}))}}ue.sort(function(U,te){return(U.path||"").split("/").length-(te.path||"").split("/").length}),ue.length>0&&e.files.push.apply(e.files,ue);for(var Te=[],Ve=0;Ve<oe.data.length;Ve++){var Ue=oe.data[Ve],Fe=(Ue.path||"")+"/"+Ue.name;!ne[Fe]&&Ue.size!=null&&(Te.push(Ue),ne[Fe]=!0)}Te.length>0&&e.files.push.apply(e.files,Te),e.fileSearchResults=oe.data}},function(){!h&&v===ae&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let b={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},m=["license","txt"],w=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],C=["wav","mp3","ogg","wma","flac","aac","m4a"],k=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(B,ae){if(e.repoId!=r.repoId)return K();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(oe=>oe&&oe.trim().length>0),Y();for(let oe=0;oe<e.paths.length-1;oe++){let ne=oe>0?e.paths.slice(0,oe).join("/"):"";e.files.some(he=>he.path===ne)||e.getFiles(ne)}}});function R(){if(e.paths[0]!="")return;let B=["readme.md","readme.txt","readme.org","readme.1st","readme"],ae={};for(let ne of e.files)ne.name.toLowerCase().indexOf("readme")>-1&&(ae[ne.name.toLowerCase()]=ne.name);let oe=null;for(let ne of B)if(ae[ne]){oe=ne;break}if(!oe&&Object.keys(ae).length>0&&(oe=Object.keys(ae)[0]),oe){let ne=n.url();ne[ne.length-1]!="/"&&(ne+="/"),n.url(ne+encodePathForUrl(ae[oe]))}}e.fileCounts=null,e.getFiles=function(B){let ae=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(B)}&v=${e.options.lastUpdateDate}`).then(function(oe){if(h||ae!==e.repoId)return[];let ne=B||"";return e.files=e.files.filter(ue=>ue.path!==ne),e.files.push(...oe.data),oe.data},function(oe){if(h||ae!==e.repoId)return[];e.type="error",e.content=oe&&oe.data&&oe.data.error||"unknown_error",e.files=[]})};function D(){let B=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(ae){h||B!==e.repoId||(e.fileCounts=ae.data)},function(){e.fileCounts={}})}function T(){return e.files.filter(B=>B.name==e.paths[e.paths.length-1]&&B.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var V=null;e.on("dispose",function(){V&&a.interval.cancel(V)});function _(B){if(h)return;let ae=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(oe=>{if(!(h||ae!==e.repoId)){if(e.options=oe.data,e.options.url){window.location=e.options.url;return}B&&B(oe.data)}},oe=>{if(!(h||ae!==e.repoId)){var ne=oe.data||{};if(ne.error==="rate_limited"&&ne.resetAt){let he=function(){var ve=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ve<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,V&&(a.interval.cancel(V),V=null),_(B);else{var me=Math.floor(ve/60),ie=ve%60;e.rateLimitCountdown=me>0?me+"m "+ie+"s":ie+"s"}};var ue=he;e.type="rate_limited",e.rateLimitResetAt=ne.resetAt,V&&a.interval.cancel(V),he(),V=a.interval(he,1e3)}else ne.err
Line truncated
|
||||
`).filter(S=>S),source:{repositoryFullName:`${M.owner}/${M.repo}`,pullRequestId:M.pullRequestId},options:e.options,conference:e.conference};U();let y=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.watch("conference",()=>{Fe()}),e.watch("terms",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("details",()=>{e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()},!0)},tr=function(e,t,n,r,s,i){let a=ct(),u=Kt(),m=0,h=!1;e.on("dispose",()=>{h=!0,m++,v&&v.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(document,"keydown",function(B){if((B.metaKey||B.ctrlKey)&&B.key==="k"){B.preventDefault();var ae=document.querySelector(".tree-search-input");ae&&(ae.focus(),ae.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let B=e.fileSearchQuery;if(!B||B.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let ae=i.defer();v=ae,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(B)}`,{timeout:ae.promise}).then(function(oe){if(!(h||v!==ae)){v=null,e.fileSearchLoading=!1;var ne={};e.files.forEach(function(U){ne[(U.path||"")+"/"+U.name]=!0});for(var ue=[],he={},ve=0;ve<oe.data.length;ve++){var me=oe.data[ve];if(me.path)for(var ie=me.path.split("/"),Pe="",Ee=0;Ee<ie.length;Ee++){var Se=Pe;Pe=Pe?Pe+"/"+ie[Ee]:ie[Ee];var Ce=Se+"/"+ie[Ee];!ne[Ce]&&!he[Ce]&&(he[Ce]=!0,ue.push({name:ie[Ee],path:Se}))}}ue.sort(function(U,te){return(U.path||"").split("/").length-(te.path||"").split("/").length}),ue.length>0&&e.files.push.apply(e.files,ue);for(var Te=[],Ve=0;Ve<oe.data.length;Ve++){var Ue=oe.data[Ve],Fe=(Ue.path||"")+"/"+Ue.name;!ne[Fe]&&Ue.size!=null&&(Te.push(Ue),ne[Fe]=!0)}Te.length>0&&e.files.push.apply(e.files,Te),e.fileSearchResults=oe.data}},function(){!h&&v===ae&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let w={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},f=["license","txt"],b=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],C=["wav","mp3","ogg","wma","flac","aac","m4a"],k=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(B,ae){if(e.repoId!=r.repoId)return K();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(oe=>oe&&oe.trim().length>0),Y();for(let oe=0;oe<e.paths.length-1;oe++){let ne=oe>0?e.paths.slice(0,oe).join("/"):"";e.files.some(he=>he.path===ne)||e.getFiles(ne)}}});function R(){if(e.paths[0]!="")return;let B=["readme.md","readme.txt","readme.org","readme.1st","readme"],ae={};for(let ne of e.files)ne.name.toLowerCase().indexOf("readme")>-1&&(ae[ne.name.toLowerCase()]=ne.name);let oe=null;for(let ne of B)if(ae[ne]){oe=ne;break}if(!oe&&Object.keys(ae).length>0&&(oe=Object.keys(ae)[0]),oe){let ne=n.url();ne[ne.length-1]!="/"&&(ne+="/"),n.url(ne+encodePathForUrl(ae[oe]))}}e.fileCounts=null,e.getFiles=function(B){let ae=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(B)}&v=${e.options.lastUpdateDate}`).then(function(oe){if(h||ae!==e.repoId)return[];let ne=B||"";return e.files=e.files.filter(ue=>ue.path!==ne),e.files.push(...oe.data),oe.data},function(oe){if(h||ae!==e.repoId)return[];e.type="error",e.content=oe&&oe.data&&oe.data.error||"unknown_error",e.files=[]})};function D(){let B=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(ae){h||B!==e.repoId||(e.fileCounts=ae.data)},function(){e.fileCounts={}})}function T(){return e.files.filter(B=>B.name==e.paths[e.paths.length-1]&&B.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var V=null;e.on("dispose",function(){V&&a.interval.cancel(V)});function _(B){if(h)return;let ae=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(oe=>{if(!(h||ae!==e.repoId)){if(e.options=oe.data,e.options.url){window.location=e.options.url;return}B&&B(oe.data)}},oe=>{if(!(h||ae!==e.repoId)){var ne=oe.data||{};if(ne.error==="rate_limited"&&ne.resetAt){let he=function(){var ve=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ve<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,V&&(a.interval.cancel(V),V=null),_(B);else{var me=Math.floor(ve/60),ie=ve%60;e.rateLimitCountdown=me>0?me+"m "+ie+"s":ie+"s"}};var ue=he;e.type="rate_limited",e.rateLimitResetAt=ne.resetAt,V&&a.interval.cancel(V),he(),V=a.interval(he,1e3)}else ne.err
Line truncated
|
||||
`+k.join(`
|
||||
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(R),D.download=r.username+"-repositories.csv",D.click()},e.showStatusMessage=m=>{let w=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,w)},e.fetchGithubInfo=m=>{let w=window.open("","_blank");w&&w.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(C=>{w&&(w.document.open(),w.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(C.data,null,2).replace(/[<>]/g,k=>k==="<"?"<":">")+"</pre>"),w.document.close())},C=>{let k=C&&C.data?JSON.stringify(C.data,null,2):String(C);w&&(w.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+k+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(w=>{e.repositories=w.data},w=>{console.error(w)})}function h(m){t.get("/api/admin/users/"+m,{}).then(w=>{e.userInfo=w.data},w=>{console.error(w)})}h(r.username),f(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>h(r.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>h(r.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>h(r.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>h(r.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function v(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}v(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",v()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>v(),w=>console.error(w))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(r.username),w=>console.error(w))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(r.username),w=>console.error(w))},e.updateRepository=m=>{let w=He({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(w),t.post(`/api/repo/${m.repoId}/refresh`).then(C=>{C.data.status=="ready"?w.title=`${m.repoId} is refreshed.`:w.title=`Refreshing of ${m.repoId}.`},C=>{w.title=`Error during the refresh of ${m.repoId}.`,w.body=C.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(w=>{e.userInfo.repositories=w.data})};let b=null;e.watch("query",()=>{s.timeout.cancel(b),b=s.timeout(()=>{f(r.username)},500)},!0)},Xa=function(e,t,n){let r=ct(),s=Kt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=C=>{if(C.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){C.preventDefault();let k=document.querySelector('.admin-filter-toolbar input[type="search"]');k&&k.focus()}};s(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=C=>{C==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[C]="",e.query.page=1},e.chips=[];let a=()=>{let C=[];(e.query.dateFrom||e.query.dateTo)&&C.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=C};e.statusCountFor=C=>{let k=(e.statusCounts||[]).find(R=>R._id===C);return k?k.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=C=>{e.query.sort===C?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=C,e.query.direction="desc"),e.query.page=1},e.sortIcon=C=>e.query.sort===C?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},h=loadFilterPrefs(u)||{};e.query=Object.assign({},f,h,{page:1,search:""});let v=n.search();v.search&&(e.query.search=v.search);let b="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(b)||"[]"),e.savePreset=()=>{let C=window.prompt("Preset name:");if(!C)return;let k=Object.assign({},e.query);delete k.page,e.presets=(e.presets||[]).filter(R=>R.name!==C),e.presets.push({name:C,query:k}),localStorage.setItem(b,JSON.stringify(e.presets))},e.applyPreset=C=>{Object.assign(e.query,C.query,{page:1})},e.deletePreset=C=>{e.presets=(e.presets||[]).filter(k=>k.name!==C.name),localStorage.setItem(b,JS
Line truncated
|
||||
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(R),D.download=r.username+"-repositories.csv",D.click()},e.showStatusMessage=f=>{let b=f.statusMessage||"(no message)";window.prompt(`Status message for ${f.repoId} (${f.status}):`,b)},e.fetchGithubInfo=f=>{let b=window.open("","_blank");b&&b.document.write("<pre>Loading GitHub info for "+f.repoId+"...</pre>"),t.get("/api/admin/repos/"+f.repoId+"/github").then(C=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(C.data,null,2).replace(/[<>]/g,k=>k==="<"?"<":">")+"</pre>"),b.document.close())},C=>{let k=C&&C.data?JSON.stringify(C.data,null,2):String(C);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+k+"</pre>")})};function m(f){t.get("/api/admin/users/"+f+"/repos",{}).then(b=>{e.repositories=b.data},b=>{console.error(b)})}function h(f){t.get("/api/admin/users/"+f,{}).then(b=>{e.userInfo=b.data},b=>{console.error(b)})}h(r.username),m(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>h(r.username),f=>console.error(f))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>h(r.username),f=>console.error(f))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>h(r.username),f=>console.error(f))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>h(r.username),f=>console.error(f))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function v(){t.get("/api/admin/tokens").then(f=>{e.tokens=f.data||[]},f=>{f.status!==401&&f.status!==403&&console.error(f)})}v(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(f=>{e.tokenForm.plaintext=f.data.token,e.tokenForm.name="",v()},f=>console.error(f))},e.revokeToken=f=>{confirm(`Revoke token "${f.name}"?`)&&t.delete("/api/admin/tokens/"+f.id).then(()=>v(),b=>console.error(b))},e.removeCache=f=>{confirm("Remove cached files for "+f.repoId+"?")&&t.delete("/api/admin/repos/"+f.repoId).then(()=>m(r.username),b=>console.error(b))},e.removeRepository=f=>{confirm("Remove repository "+f.repoId+"?")&&t.delete("/api/repo/"+f.repoId+"/").then(()=>m(r.username),b=>console.error(b))},e.updateRepository=f=>{let b=He({title:`Refreshing ${f.repoId}...`,date:new Date,body:`The repository ${f.repoId} is going to be refreshed.`});e.toasts.push(b),t.post(`/api/repo/${f.repoId}/refresh`).then(C=>{C.data.status=="ready"?b.title=`${f.repoId} is refreshed.`:b.title=`Refreshing of ${f.repoId}.`},C=>{b.title=`Error during the refresh of ${f.repoId}.`,b.body=C.body})},e.getGitHubRepositories=f=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let w=null;e.watch("query",()=>{s.timeout.cancel(w),w=s.timeout(()=>{m(r.username)},500)},!0)},Xa=function(e,t,n){let r=ct(),s=Kt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=C=>{if(C.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){C.preventDefault();let k=document.querySelector('.admin-filter-toolbar input[type="search"]');k&&k.focus()}};s(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=C=>{C==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[C]="",e.query.page=1},e.chips=[];let a=()=>{let C=[];(e.query.dateFrom||e.query.dateTo)&&C.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=C};e.statusCountFor=C=>{let k=(e.statusCounts||[]).find(R=>R._id===C);return k?k.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=C=>{e.query.sort===C?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=C,e.query.direction="desc"),e.query.page=1},e.sortIcon=C=>e.query.sort===C?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",m={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},h=loadFilterPrefs(u)||{};e.query=Object.assign({},m,h,{page:1,search:""});let v=n.search();v.search&&(e.query.search=v.search);let w="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(w)||"[]"),e.savePreset=()=>{let C=window.prompt("Preset name:");if(!C)return;let k=Object.assign({},e.query);delete k.page,e.presets=(e.presets||[]).filter(R=>R.name!==C),e.presets.push({name:C,query:k}),localStorage.setItem(w,JSON.stringify(e.presets))},e.applyPreset=C=>{Object.assign(e.query,C.query,{page:1})},e.deletePreset=C=>{e.presets=(e.presets||[]).filter(k=>k.name!==C.name),localStorage.setItem(w,JS
Line truncated
|
||||
`).map((ve,me)=>me===0?ve:he+ve).join(`
|
||||
`)}else typeof K=="number"||typeof K=="boolean"?ue=String(K):ue=JSON.stringify(K);J.push(`${oe}${ue}${ne}`)}),J.push("}"),J.join(`
|
||||
`)}function h(D){let T=[],V="",_=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,O=0,I;for(;I=_.exec(D);)V+=D.slice(O,I.index),O=_.lastIndex,T.push({key:I[1],op:I[2]||"=",val:I[3]});return V+=D.slice(O),{filters:T,free:V.trim().toLowerCase()}}function v(D,T){for(let V of T.filters){let _=(I,J,Y)=>{let K=parseFloat(I),B=parseFloat(J);return Y==="="?String(I)===String(J):Y==="!="?String(I)!==String(J):Y===">="?K>=B:Y==="<="?K<=B:Y===">"?K>B:Y==="<"?K<B:!0},O;if(V.key==="code")O=D.displayMessage;else if(V.key==="module")O=D.module;else if(V.key==="status")O=D._status;else if(V.key==="url")O=D._url;else if(V.key==="repo")O=D._repoId;else if(V.key==="level")O=D.level;else continue;if(O==null||!_(O,V.val,V.op))return!1}return!(T.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(T.free)===-1)}function b(){let D=h(e.query.search||"");e.parsedFilterCount=D.filters.length;let T=e.query.bucket,V=e.entries.filter(O=>T&&O._bucket!==T?!1:v(O,D)),_=e.query.group;if(_){let O=Y=>_==="module"?Y.module:Y.displayMessage||Y.message||"_",I=new Map;for(let Y of V){let K=O(Y);if(I.has(K)){let B=I.get(K);B.count++,B._related.push(Y),new Date(Y.ts)>new Date(B.ts)&&(B.ts=Y.ts,B._url=Y._url,B._status=Y._status),new Date(Y.ts)<new Date(B._firstSeen)&&(B._firstSeen=Y.ts)}else{let B=Object.assign({},Y);B._key=`${_}:${K}`,B._related=[Y],B._firstSeen=Y.ts,B._lastHourCount=0,B.count=1,I.set(K,B)}}let J=Date.now()-3600*1e3;for(let Y of I.values())Y._lastHourCount=Y._related.filter(K=>new Date(K.ts).getTime()>=J).length;V=Array.from(I.values())}else V=V.map((O,I)=>(O._key="row:"+I+":"+O.ts,O._related=[O],O._firstSeen=O.ts,O._lastHourCount=0,O.count=1,O));e.query.sort==="count"?V.sort((O,I)=>I.count-O.count||new Date(I.ts)-new Date(O.ts)):V.sort((O,I)=>new Date(I.ts)-new Date(O.ts)),e.visible=V}function m(D){let T=D?e.entries.length:0,V=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:T,limit:V}}).then(_=>{let O=(_.data.entries||[]).map(u);e.entries=D?e.entries.concat(O):O,e.available=!!_.data.available,e.cap=_.data.max||e.cap,e.total=_.data.total||e.entries.length,b()},_=>console.error(_))}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function w(){t.get("/api/admin/errors/stats").then(D=>{let T=D.data||{},V=T.prev24h?Math.round((T.last24h-T.prev24h)/T.prev24h*100):0;e.stats={last24h:T.last24h||0,prev24h:T.prev24h||0,delta:V,severity:T.severity||{error:0,warn:0,info:0},unique:T.unique||{error:0,warn:0,info:0},buckets:T.buckets||[],dropped:T.dropped||0}},D=>console.error(D))}function C(){m(),w()}e.barPx=(D,T)=>{let V=e.stats.buckets||[],_=0;for(let Y of V)_=Math.max(_,(Y.error||0)+(Y.warn||0)+(Y.info||0));if(!_)return 0;let O=(D.error||0)+(D.warn||0)+(D.info||0);if(!O)return 0;let I=Math.round(O/_*60),J=D[T]||0;return Math.round(J/O*I)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=C,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(C,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],T=[D.join(",")];for(let I of e.visible)T.push(D.map(J=>{let Y=I[J]==null?"":String(I[J]);return/[",\n]/.test(Y)?`"${Y.replace(/"/g,'""')}"`:Y}).join(","));let V=new Blob([T.join(`
|
||||
`)],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(V),O=document.createElement("a");O.href=_,O.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(_)};function k(D){e.copyHint=`${D} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>k("JSON"))},e.copyCurl=D=>{if(!D._url)return;let V=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(V).then(()=>k("curl"))},C();let R=r(()=>{e.query.autoRefresh&&C()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},el=function(e,t,n,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null){n.url("/");return}e.data=null,e.loading=!0,e.error=null;function s(m){if(m==null)return"\u2014";for(var w=["B","KB","MB","GB","TB"],C=0,k=m;k>=1024&&C<w.length-1;)k/=1024,C++;return k.toFixed(C>0?1:0)+" "+w[C]}e.humanBytes=s;function i(m){if(!m)return"\u2014";var w=Math.floor(m/86400),C=Math.floor(m%86400/3600),k=Math.floor(m%3600/60);return w>0?w+"d "+(C<10?"0":"")+C+"h":C>0?C+"h "+(k<10?"0":"")+k+"m":k+"m"}e.humanDuration=i;function a(m){return m==null?"\u2014":m>=1e6?(m/1e6).toFixed(1)+"M":m>=1e3?(m/1e3).toFixed(1)+"K":String(m)}e.humanNum=a,e.queueTotal=function(m){return m?(m.waiting||0)+(m.active||0)+(m.delayed||0)+(m.failed||0):0},e.statusCount=function(m){if(!e.data||!e.data.repos)return 0;for(var w=e.data.repos.statusBreakdown||[],C=0;C<w.length;C++)if(w[C]._id===m)return w[C].count;return 0},e.barPct=function(m){var w=e.data&&e.data.repos?e.data.repos.total:0;if(!w)return 0;var C=[m];m==="expired"&&C.push("expiring"),m==="removed"&&C.push("removing"),m==="preparing"&&C.push("download");var k=0;return C.forEach(function(R){k+=e.statusCount(R)}),Math.max(.4,k/w*100)},e.errPct=function(m){if(!e.data||!e.data.errors)return 0;var w=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[m]/w*100};function u(m){var w=m||[];return w.map(function(C,k){var R=w[k-1]||{},D=Object.assign({},C);return D.dailyRepositories=k?Math.max(0,(C.nbRepositories||0)-(R.nbRepositories||0)):0,D.dailyUsers=k?Math.max(0,(C.nbUsers||0)-(R.nbUsers||0)):0,D.dailyPageViews=k?Math.max(0,(C.nbPageViews||0)-(R.nbPageViews||0)):0,D})}function f(m){var w=m&&m.length?m[m.length-1]:{};return{repositories:w.dailyRepositories||0,users:w.dailyUsers||0,pageViews:w.dailyPageViews||0}}var h={};e.historyBarH=function(m,w){return!m||!h[w]?0:Math.max(1,Math.round(m[w]/h[w]*140))},e.historyLabel=function(m){if(!m||!m.date)return"";var w=new Date(m.date);return w.getUTCMonth()+1+"/"+w.getUTCDate()};function v(){t.get("/api/admin/overview").then(function(m){m.data.history=u(m.data.history),m.data.daily={today:f(m.data.history)},e.data=m.data,e.loading=!1,e.error=null,h={},(m.data.history||[]).forEach(function(w){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(C){(!h[C]||w[C]>h[C])&&(h[C]=w[C])})})},function(m){e.loading=!1,e.error=m.data&&m.data.error||"Failed to load overview"})}v();var b=r(v,3e4);e.on("dispose",function(){r.cancel(b)})};var tl=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Wa(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Ka(e,t.http)},{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>Ua(e,t.http,t.location,t.window,t.timeout)},{path:"/dashboard",template:"partials/dashboard.htm",title:"Your anonymizations \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Fa(e,t.http,t.location,t.promises,t.window,t.quotaService)},{path:"/pr-dashboard",redirect:"/dashboard"},{path:"/anonymize/:repoId?",template:"partials/anonymize.htm",title:"New anonymization \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/pull-request-anonymize/:pullRequestId?",template:"partials/anonymize.htm",title:"Anonymize a pull request \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/gist-anonymize/:gistId?",template:"partials/anonymize.htm",title:"Anonymize a gist \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/status/:repoId",template:"partials/status.htm",title:"Repository status \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>za(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>ja(e,t.http,t.location)
Line truncated
|
||||
anonymous_github`)])])])])]),p(" Limitations "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-warning"})]),g("Limitations ")]),o("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),o("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[o("div",{class:"panel-body p-3"},[o("ul",null,[o("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),o("li",null," Files larger than 8 MB are not supported. "),o("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),o("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),p(" Privacy & Security "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-shield"})]),g("Privacy & Security ")]),o("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),o("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[o("div",{class:"panel-body p-3"},[o("p",null," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 this makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),o("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[o("div",{class:"panel-body p-3"},[o("p",null,[g("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),o("a",{href:"/connections"},"GitHub connections"),g(" page.")]),o("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),o("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),o("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[o("div",{class:"panel-body p-3"},[o("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),p(" Self-Hosting "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#project-icon-storage"})]),g("Self-Hosting ")]),o("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),o("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[o("div",{class:"panel-body p-3"},[o("p",null,[g(" Yes. Anonymous Git
Line truncated
|
||||
`)}function h(D){let T=[],V="",_=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,O=0,I;for(;I=_.exec(D);)V+=D.slice(O,I.index),O=_.lastIndex,T.push({key:I[1],op:I[2]||"=",val:I[3]});return V+=D.slice(O),{filters:T,free:V.trim().toLowerCase()}}function v(D,T){for(let V of T.filters){let _=(I,J,Y)=>{let K=parseFloat(I),B=parseFloat(J);return Y==="="?String(I)===String(J):Y==="!="?String(I)!==String(J):Y===">="?K>=B:Y==="<="?K<=B:Y===">"?K>B:Y==="<"?K<B:!0},O;if(V.key==="code")O=D.displayMessage;else if(V.key==="module")O=D.module;else if(V.key==="status")O=D._status;else if(V.key==="url")O=D._url;else if(V.key==="repo")O=D._repoId;else if(V.key==="level")O=D.level;else continue;if(O==null||!_(O,V.val,V.op))return!1}return!(T.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(T.free)===-1)}function w(){let D=h(e.query.search||"");e.parsedFilterCount=D.filters.length;let T=e.query.bucket,V=e.entries.filter(O=>T&&O._bucket!==T?!1:v(O,D)),_=e.query.group;if(_){let O=Y=>_==="module"?Y.module:Y.displayMessage||Y.message||"_",I=new Map;for(let Y of V){let K=O(Y);if(I.has(K)){let B=I.get(K);B.count++,B._related.push(Y),new Date(Y.ts)>new Date(B.ts)&&(B.ts=Y.ts,B._url=Y._url,B._status=Y._status),new Date(Y.ts)<new Date(B._firstSeen)&&(B._firstSeen=Y.ts)}else{let B=Object.assign({},Y);B._key=`${_}:${K}`,B._related=[Y],B._firstSeen=Y.ts,B._lastHourCount=0,B.count=1,I.set(K,B)}}let J=Date.now()-3600*1e3;for(let Y of I.values())Y._lastHourCount=Y._related.filter(K=>new Date(K.ts).getTime()>=J).length;V=Array.from(I.values())}else V=V.map((O,I)=>(O._key="row:"+I+":"+O.ts,O._related=[O],O._firstSeen=O.ts,O._lastHourCount=0,O.count=1,O));e.query.sort==="count"?V.sort((O,I)=>I.count-O.count||new Date(I.ts)-new Date(O.ts)):V.sort((O,I)=>new Date(I.ts)-new Date(O.ts)),e.visible=V}function f(D){let T=D?e.entries.length:0,V=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:T,limit:V}}).then(_=>{let O=(_.data.entries||[]).map(u);e.entries=D?e.entries.concat(O):O,e.available=!!_.data.available,e.cap=_.data.max||e.cap,e.total=_.data.total||e.entries.length,w()},_=>console.error(_))}e.loadMore=()=>f(!0),e.canLoadMore=()=>e.entries.length<e.total;function b(){t.get("/api/admin/errors/stats").then(D=>{let T=D.data||{},V=T.prev24h?Math.round((T.last24h-T.prev24h)/T.prev24h*100):0;e.stats={last24h:T.last24h||0,prev24h:T.prev24h||0,delta:V,severity:T.severity||{error:0,warn:0,info:0},unique:T.unique||{error:0,warn:0,info:0},buckets:T.buckets||[],dropped:T.dropped||0}},D=>console.error(D))}function C(){f(),b()}e.barPx=(D,T)=>{let V=e.stats.buckets||[],_=0;for(let Y of V)_=Math.max(_,(Y.error||0)+(Y.warn||0)+(Y.info||0));if(!_)return 0;let O=(D.error||0)+(D.warn||0)+(D.info||0);if(!O)return 0;let I=Math.round(O/_*60),J=D[T]||0;return Math.round(J/O*I)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=C,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(C,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],T=[D.join(",")];for(let I of e.visible)T.push(D.map(J=>{let Y=I[J]==null?"":String(I[J]);return/[",\n]/.test(Y)?`"${Y.replace(/"/g,'""')}"`:Y}).join(","));let V=new Blob([T.join(`
|
||||
`)],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(V),O=document.createElement("a");O.href=_,O.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(_)};function k(D){e.copyHint=`${D} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>k("JSON"))},e.copyCurl=D=>{if(!D._url)return;let V=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(V).then(()=>k("curl"))},C();let R=r(()=>{e.query.autoRefresh&&C()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",w),e.watch("query.bucket",w),e.watch("query.sort",w),e.watch("query.group",w)},el=function(e,t,n,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null){n.url("/");return}e.data=null,e.loading=!0,e.error=null;function s(f){if(f==null)return"\u2014";for(var b=["B","KB","MB","GB","TB"],C=0,k=f;k>=1024&&C<b.length-1;)k/=1024,C++;return k.toFixed(C>0?1:0)+" "+b[C]}e.humanBytes=s;function i(f){if(!f)return"\u2014";var b=Math.floor(f/86400),C=Math.floor(f%86400/3600),k=Math.floor(f%3600/60);return b>0?b+"d "+(C<10?"0":"")+C+"h":C>0?C+"h "+(k<10?"0":"")+k+"m":k+"m"}e.humanDuration=i;function a(f){return f==null?"\u2014":f>=1e6?(f/1e6).toFixed(1)+"M":f>=1e3?(f/1e3).toFixed(1)+"K":String(f)}e.humanNum=a,e.queueTotal=function(f){return f?(f.waiting||0)+(f.active||0)+(f.delayed||0)+(f.failed||0):0},e.statusCount=function(f){if(!e.data||!e.data.repos)return 0;for(var b=e.data.repos.statusBreakdown||[],C=0;C<b.length;C++)if(b[C]._id===f)return b[C].count;return 0},e.barPct=function(f){var b=e.data&&e.data.repos?e.data.repos.total:0;if(!b)return 0;var C=[f];f==="expired"&&C.push("expiring"),f==="removed"&&C.push("removing"),f==="preparing"&&C.push("download");var k=0;return C.forEach(function(R){k+=e.statusCount(R)}),Math.max(.4,k/b*100)},e.errPct=function(f){if(!e.data||!e.data.errors)return 0;var b=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[f]/b*100};function u(f){var b=f||[];return b.map(function(C,k){var R=b[k-1]||{},D=Object.assign({},C);return D.dailyRepositories=k?Math.max(0,(C.nbRepositories||0)-(R.nbRepositories||0)):0,D.dailyUsers=k?Math.max(0,(C.nbUsers||0)-(R.nbUsers||0)):0,D.dailyPageViews=k?Math.max(0,(C.nbPageViews||0)-(R.nbPageViews||0)):0,D})}function m(f){var b=f&&f.length?f[f.length-1]:{};return{repositories:b.dailyRepositories||0,users:b.dailyUsers||0,pageViews:b.dailyPageViews||0}}var h={};e.historyBarH=function(f,b){return!f||!h[b]?0:Math.max(1,Math.round(f[b]/h[b]*140))},e.historyLabel=function(f){if(!f||!f.date)return"";var b=new Date(f.date);return b.getUTCMonth()+1+"/"+b.getUTCDate()};function v(){t.get("/api/admin/overview").then(function(f){f.data.history=u(f.data.history),f.data.daily={today:m(f.data.history)},e.data=f.data,e.loading=!1,e.error=null,h={},(f.data.history||[]).forEach(function(b){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(C){(!h[C]||b[C]>h[C])&&(h[C]=b[C])})})},function(f){e.loading=!1,e.error=f.data&&f.data.error||"Failed to load overview"})}v();var w=r(v,3e4);e.on("dispose",function(){r.cancel(w)})};var tl=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Wa(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Ka(e,t.http)},{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>Ua(e,t.http,t.location,t.window,t.timeout)},{path:"/dashboard",template:"partials/dashboard.htm",title:"Your anonymizations \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Fa(e,t.http,t.location,t.promises,t.window,t.quotaService)},{path:"/pr-dashboard",redirect:"/dashboard"},{path:"/anonymize/:repoId?",template:"partials/anonymize.htm",title:"New anonymization \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/pull-request-anonymize/:pullRequestId?",template:"partials/anonymize.htm",title:"Anonymize a pull request \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/gist-anonymize/:gistId?",template:"partials/anonymize.htm",title:"Anonymize a gist \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/status/:repoId",template:"partials/status.htm",title:"Repository status \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>za(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>ja(e,t.http,t.location)
Line truncated
|
||||
anonymous_github`)])])])])]),p(" Limitations "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-warning"})]),g("Limitations ")]),o("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),o("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[o("div",{class:"panel-body p-3"},[o("ul",null,[o("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),o("li",null," Files larger than 8 MB are not supported. "),o("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),o("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),p(" Privacy & Security "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-shield"})]),g("Privacy & Security ")]),o("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),o("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[o("div",{class:"panel-body p-3"},[o("p",null," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 this makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),o("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[o("div",{class:"panel-body p-3"},[o("p",null,[g("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),o("a",{href:"/connections"},"GitHub connections"),g(" page.")]),o("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),o("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),o("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[o("div",{class:"panel-body p-3"},[o("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),p(" Self-Hosting "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#project-icon-storage"})]),g("Self-Hosting ")]),o("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),o("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[o("div",{class:"panel-body p-3"},[o("p",null,[g(" Yes. Anonymous Git
Line truncated
|
||||
anonymized repository often think it is about the paper, so the
|
||||
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=o("li",{class:"nav-item d-none d-lg-block"},[o("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[o("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[o("use",{href:"#ui-icon-bug"})]),g("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",QI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=ce(n=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",XI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=ce(n=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",ZI,[...t[9]||(t[9]=[o("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[o("i",{class:"fab fa-github mr-1"}),g(" Sign in ")],-1)])])),e.user?(l(),d("li",xI,[o("a",e4,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,t4)):p("v-if",!0),o("span",o4,c(e.user?.username),1)]),o("div",s4,[o("h6",n4,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=de('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,r4)):p("v-if",!0)],64)}var i4={class:"paper-landing"},a4={class:"paper-hero"},l4={class:"paper-hero-copy"},d4={class:"paper-cta-row"},u4={key:0,href:"/signin",target:"_self",class:"btn-hero"},c4={key:1,href:"/anonymize",class:"btn-hero"},p4={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},f4={class:"paper-stats-grid"},m4={class:"paper-stat-value"},h4={class:"paper-stat-label"},v4=["viewBox"],g4=["x","y","width","height"],y4={key:1,class:"paper-stat-delta"},b4={class:"paper-features paper-wrap","aria-label":"Product features"},w4={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},k4=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],E4={class:"paper-eyebrow"},C4={class:"paper-feature-title"},_4={class:"paper-feature-more"},S4={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},N4=["href","target"],D4={class:"paper-features-stage"},R4=["id","aria-labelledby"],T4={class:"paper-frame"},A4={class:"paper-frame-bar","aria-hidden":"true"},O4={class:"url"},I4=["src","alt"],P4={class:"paper-footer"},V4={class:"paper-footer-inner"},q4={class:"paper-footer-col"},M4={key:0,href:"/dashboard"},$4={key:1,href:"/conferences"},L4={class:"paper-footer-foot"};function El(e,t){return l(),d("div",i4,[p(" Hero: copy on the left, the product on the right "),o("section",a4,[o("div",l4,[t[2]||(t[2]=o("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=o("h1",{class:"hero-title"},[g(" Share the code,"),o("br"),o("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=o("p",{class:"hero-subtitle
Line truncated
|
||||
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=o("li",{class:"nav-item d-none d-lg-block"},[o("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[o("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[o("use",{href:"#ui-icon-bug"})]),g("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",QI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=ce(n=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",XI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=ce(n=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",ZI,[...t[9]||(t[9]=[o("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[o("i",{class:"fab fa-github mr-1"}),g(" Sign in ")],-1)])])),e.user?(l(),d("li",xI,[o("a",e4,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,t4)):p("v-if",!0),o("span",o4,c(e.user?.username),1)]),o("div",s4,[o("h6",n4,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=le('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,r4)):p("v-if",!0)],64)}var i4={class:"paper-landing"},a4={class:"paper-hero"},l4={class:"paper-hero-copy"},d4={class:"paper-cta-row"},u4={key:0,href:"/signin",target:"_self",class:"btn-hero"},c4={key:1,href:"/anonymize",class:"btn-hero"},p4={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},f4={class:"paper-stats-grid"},m4={class:"paper-stat-value"},h4={class:"paper-stat-label"},v4=["viewBox"],g4=["x","y","width","height"],y4={key:1,class:"paper-stat-delta"},b4={class:"paper-features paper-wrap","aria-label":"Product features"},w4={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},k4=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],E4={class:"paper-eyebrow"},C4={class:"paper-feature-title"},_4={class:"paper-feature-more"},S4={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},N4=["href","target"],D4={class:"paper-features-stage"},R4=["id","aria-labelledby"],T4={class:"paper-frame"},A4={class:"paper-frame-bar","aria-hidden":"true"},O4={class:"url"},I4=["src","alt"],P4={class:"paper-footer"},V4={class:"paper-footer-inner"},q4={class:"paper-footer-col"},M4={key:0,href:"/dashboard"},$4={key:1,href:"/conferences"},L4={class:"paper-footer-foot"};function El(e,t){return l(),d("div",i4,[p(" Hero: copy on the left, the product on the right "),o("section",a4,[o("div",l4,[t[2]||(t[2]=o("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=o("h1",{class:"hero-title"},[g(" Share the code,"),o("br"),o("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=o("p",{class:"hero-subtitle
Line truncated
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},RV={id:"termsHelp",class:"form-text text-muted"},TV={class:"invalid-feedback"},AV={id:"settings-display",class:"paper-settings-section"},OV={class:"form-group paper-check-list"},IV={class:"form-check"},PV={class:"form-check-input",type:"checkbox",id:"link",name:"link"},VV={class:"form-check"},qV={class:"form-check-input",type:"checkbox",id:"image",name:"image"},MV={class:"form-check"},$V={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},LV={class:"form-check"},UV={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},FV={id:"settings-features",class:"paper-settings-section"},zV={class:"form-group paper-check-list"},HV={class:"form-check"},BV={class:"form-check-input",type:"checkbox",id:"page",name:"page"},jV={class:"form-check"},GV={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},WV={class:"form-check"},KV={class:"form-check-input",type:"checkbox",id:"update",name:"update"},YV={class:"form-group"},JV={class:"form-control",id:"mode",name:"mode"},QV={class:"form-text text-muted"},XV={id:"settings-expiration",class:"paper-settings-section"},ZV={class:"form-group"},xV={class:"form-control",id:"expiration",name:"expiration"},e5={key:0,class:"draft-status",role:"status"},t5={key:1,class:"draft-status"},o5={class:"paper-settings-footer"},s5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},n5=["textContent"],r5={class:"paper-settings-actions"},i5=["disabled"],a5={key:0,class:"ui-icon mr-1","aria-hidden":"true"},l5={id:"settings-account",class:"paper-settings-section"},d5={class:"paper-account-card"},u5=["src"],c5={class:"paper-account-identity"},p5={class:"paper-account-name"},f5={class:"paper-danger-zone"},m5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},h5=["textContent"],v5=["disabled"];function Dl(e,t){let n=We("quota-usage"),r=ye("paper-scrollspy"),s=ye("field"),i=ye("form");return l(),d("div",yV,[t[52]||(t[52]=de('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),o("div",bV,[N((l(),d("aside",wV,[...t[4]||(t[4]=[de('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),o("div",kV,[p(" Account usage shares the dashboard component. "),o("section",EV,[t[6]||(t[6]=o("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=o("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),qt(n,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",CV,[(l(),d(Q,null,se([1,2,3],(a,u)=>o("div",_V,[...t[5]||(t[5]=[o("div",{class:"quota-header"},[o("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),o("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),o("div",{class:"quota-track"},null,-1)])])),64))]))]),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=ce(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[o("section",SV,[t[13]||(t[13]=o("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=o("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),o("div",NV,[t[12]||(t[12]=o("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),N(o("textarea",DV,null,512),[[s,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),o("small",RV,[t[8]||(t[8]=g(" One term per line (regex allowed). Each match is replaced by ",-1)),o("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=g(", or use ",-1)),t[10]||(t[10]=o("code",null,"term=>replacement",-1)),t[11]||(t[11]=g(" to pick your own. ",-1))]),N(o("div",TV," Terms are in an invalid format ",512),[[W,e.defaultsForm?.terms?.errors?.format]])])]),o("section",AV,[t[23]||(t[23]=o("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=o("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),o("div",OV,[o("div",IV,[N(o("input",PV,null,512),[[s,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=o("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=o("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),o("div",VV,[N(o("input",qV,null,512),[[s,{state:e.viewState,set:a=>{e.options.image=a},value:e.op
Line truncated
|
||||
`);for(let b=0;b<v.length;b++){let m=v[b];if(m.startsWith("diff --git")){h(),f();continue}if(m.startsWith("--- ")){i&&i.lines.length&&h(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let w=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);w&&(a=parseInt(w[1],10),u=parseInt(w[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}i&&(m.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:u,text:m.slice(1)}),u++):m.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:u,text:m.startsWith(" ")?m.slice(1):m}),a++,u++))}}return n(s,i),s.join("")}})({trustAsHtml:e=>e});function Oq(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Iq(e){return String(e??"").toUpperCase()}function Pq(e,t,n=0){return(e||[]).slice(n,n+t)}function Vq(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function qq(e,t){if(!t)return e||[];let n=Array.isArray(t)?t:[t];return[...e||[]].sort((r,s)=>{for(let i of n){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,v)=>h?.[v],r),f=i.split(".").reduce((h,v)=>h?.[v],s);if(typeof u=="string"&&(u=u.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),u!==f)return(u==null?-1:f==null?1:u<f?-1:1)*a}return 0})}function Mq(e,t){if(!e)return"";let n=new Date(e);if(isNaN(n))return String(e);if(!t||t==="mediumDate")return n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:n.getFullYear(),MMM:n.toLocaleDateString(void 0,{month:"short"}),MM:String(n.getMonth()+1).padStart(2,"0"),dd:String(n.getDate()).padStart(2,"0"),d:n.getDate(),HH:String(n.getHours()).padStart(2,"0"),mm:String(n.getMinutes()).padStart(2,"0"),ss:String(n.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>r[s])}function $q(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var ql={ERRORS:{repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub
Line truncated
|
||||
jane.smith@example.org`},RV={id:"termsHelp",class:"form-text text-muted"},TV={class:"invalid-feedback"},AV={id:"settings-display",class:"paper-settings-section"},OV={class:"form-group paper-check-list"},IV={class:"form-check"},PV={class:"form-check-input",type:"checkbox",id:"link",name:"link"},VV={class:"form-check"},qV={class:"form-check-input",type:"checkbox",id:"image",name:"image"},MV={class:"form-check"},$V={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},LV={class:"form-check"},UV={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},FV={id:"settings-features",class:"paper-settings-section"},zV={class:"form-group paper-check-list"},HV={class:"form-check"},BV={class:"form-check-input",type:"checkbox",id:"page",name:"page"},jV={class:"form-check"},GV={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},WV={class:"form-check"},KV={class:"form-check-input",type:"checkbox",id:"update",name:"update"},YV={class:"form-group"},JV={class:"form-control",id:"mode",name:"mode"},QV={class:"form-text text-muted"},XV={id:"settings-expiration",class:"paper-settings-section"},ZV={class:"form-group"},xV={class:"form-control",id:"expiration",name:"expiration"},e5={key:0,class:"draft-status",role:"status"},t5={key:1,class:"draft-status"},o5={class:"paper-settings-footer"},s5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},n5=["textContent"],r5={class:"paper-settings-actions"},i5=["disabled"],a5={key:0,class:"ui-icon mr-1","aria-hidden":"true"},l5={id:"settings-account",class:"paper-settings-section"},d5={class:"paper-account-card"},u5=["src"],c5={class:"paper-account-identity"},p5={class:"paper-account-name"},f5={class:"paper-danger-zone"},m5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},h5=["textContent"],v5=["disabled"];function Dl(e,t){let n=We("quota-usage"),r=ye("paper-scrollspy"),s=ye("field"),i=ye("form");return l(),d("div",yV,[t[52]||(t[52]=le('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),o("div",bV,[N((l(),d("aside",wV,[...t[4]||(t[4]=[le('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),o("div",kV,[p(" Account usage shares the dashboard component. "),o("section",EV,[t[6]||(t[6]=o("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=o("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),qt(n,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",CV,[(l(),d(Q,null,se([1,2,3],(a,u)=>o("div",_V,[...t[5]||(t[5]=[o("div",{class:"quota-header"},[o("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),o("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),o("div",{class:"quota-track"},null,-1)])])),64))]))]),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=ce(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[o("section",SV,[t[13]||(t[13]=o("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=o("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),o("div",NV,[t[12]||(t[12]=o("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),N(o("textarea",DV,null,512),[[s,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),o("small",RV,[t[8]||(t[8]=g(" One term per line (regex allowed). Each match is replaced by ",-1)),o("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=g(", or use ",-1)),t[10]||(t[10]=o("code",null,"term=>replacement",-1)),t[11]||(t[11]=g(" to pick your own. ",-1))]),N(o("div",TV," Terms are in an invalid format ",512),[[W,e.defaultsForm?.terms?.errors?.format]])])]),o("section",AV,[t[23]||(t[23]=o("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=o("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),o("div",OV,[o("div",IV,[N(o("input",PV,null,512),[[s,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=o("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=o("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),o("div",VV,[N(o("input",qV,null,512),[[s,{state:e.viewState,set:a=>{e.options.image=a},value:e.op
Line truncated
|
||||
`);for(let w=0;w<v.length;w++){let f=v[w];if(f.startsWith("diff --git")){h(),m();continue}if(f.startsWith("--- ")){i&&i.lines.length&&h(),m().oldPath=f.replace(/^--- (a\/)?/,"").trim();continue}if(f.startsWith("+++ ")){m().newPath=f.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(f.startsWith("index ")||f.startsWith("similarity index")||f.startsWith("rename ")||f.startsWith("new file mode")||f.startsWith("deleted file mode")||f.startsWith("Binary files"))){if(f.startsWith("@@")){let b=f.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);b&&(a=parseInt(b[1],10),u=parseInt(b[2],10)),m().lines.push({kind:"hunk",oldNo:"",newNo:"",text:f});continue}i&&(f.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:u,text:f.slice(1)}),u++):f.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:f.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:u,text:f.startsWith(" ")?f.slice(1):f}),a++,u++))}}return n(s,i),s.join("")}})({trustAsHtml:e=>e});function Oq(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Iq(e){return String(e??"").toUpperCase()}function Pq(e,t,n=0){return(e||[]).slice(n,n+t)}function Vq(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function qq(e,t){if(!t)return e||[];let n=Array.isArray(t)?t:[t];return[...e||[]].sort((r,s)=>{for(let i of n){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,v)=>h?.[v],r),m=i.split(".").reduce((h,v)=>h?.[v],s);if(typeof u=="string"&&(u=u.toLowerCase()),typeof m=="string"&&(m=m.toLowerCase()),u!==m)return(u==null?-1:m==null?1:u<m?-1:1)*a}return 0})}function Mq(e,t){if(!e)return"";let n=new Date(e);if(isNaN(n))return String(e);if(!t||t==="mediumDate")return n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:n.getFullYear(),MMM:n.toLocaleDateString(void 0,{month:"short"}),MM:String(n.getMonth()+1).padStart(2,"0"),dd:String(n.getDate()).padStart(2,"0"),d:n.getDate(),HH:String(n.getHours()).padStart(2,"0"),mm:String(n.getMinutes()).padStart(2,"0"),ss:String(n.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>r[s])}function $q(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var ql={ERRORS:{repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub
Line truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
@vue/shared/dist/shared.esm-bundler.js:
|
||||
|
||||
Reference in new issue
Block a user