perf: load document libraries only when needed

This commit is contained in:
tdurieux committed 2026-09-09 13:28:44 +02:00
1 parent 984906a89a
commit e68ab037eb
15 files changed
+151 -53

No files matched your search

+2
View File
@@ -21,3 +21,5 @@ scripts
.dockerignore
Dockerfile*
docker-compose*.yml
/tmp
+9
View File
@@ -122,3 +122,12 @@ Run `npm run build:ui` after changing a template or frontend script. Use
configured upstream. `npm run test:ui` rebuilds the assets and runs the frontend
regression and DOM interaction tests. `npm run build` also builds the UI for
production.
The initial bundle contains the Vue app. Markdown extensions load on content
routes; PDF.js, Ace, and notebook support load when their viewers mount.
Org support loads in the repository explorer, and Mermaid loads only when a
diagram is encountered. These libraries use hashed URLs and load once per tab.
The Docker build compiles the same bundles and copies them, the asset manifest,
and document-worker assets into the runtime image. The Compose app serves these
assets directly; no frontend development server is needed.
+15 -9
View File
@@ -23,16 +23,17 @@ const coreJsFiles = [
"public/script/utils.js",
];
const vendorJsFiles = [
"public/script/external/pdf.js",
const markdownFiles = [
"public/script/external/katex.min.js",
"public/script/external/katex-auto-render.min.js",
"public/script/external/marked-katex-extension.umd.min.js",
"public/script/external/marked-mermaid.js",
"public/script/external/notebook.min.js",
"public/script/external/org.js",
"public/script/external/ace/ace.js",
];
];
const pdfFiles = ["public/script/external/pdf.js"];
const notebookFiles = ["public/script/external/notebook.min.js"];
const orgFiles = ["public/script/external/org.js"];
const editorFiles = ["public/script/external/ace/ace.js"];
const lazyGroups = { markdown: markdownFiles, pdf: pdfFiles, notebook: notebookFiles, org: orgFiles, editor: editorFiles };
const mermaidFiles = [
"public/script/external/mermaid.min.js",
@@ -64,10 +65,15 @@ function buildCoreJs(cb) {
}
async function buildVendorJs() {
const lazyAssets = {};
await Promise.all(Object.entries(lazyGroups).map(async ([name, files]) => {
await promisify(pipeline)(orderedSrc(files), concat(`${name}.min.js`), uglify(), dest("public/script"));
lazyAssets[name] = `/script/${name}.${hashFile(`public/script/${name}.min.js`)}.min.js`;
}));
const app = await esbuild.build({
entryPoints: ["public/script/main.js"], bundle: true, write: false,
format: "iife", minify: true, target: "es2020",
define: { "process.env.NODE_ENV": JSON.stringify("production"), __VUE_OPTIONS_API__: "true", __VUE_PROD_DEVTOOLS__: "false", __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false" },
define: { __LAZY_ASSETS__: JSON.stringify(lazyAssets), "process.env.NODE_ENV": JSON.stringify("production"), __VUE_OPTIONS_API__: "true", __VUE_PROD_DEVTOOLS__: "false", __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false" },
plugins: [{ name: "vue-templates", setup(build) {
build.onLoad({ filter: /\.htm$/ }, async ({ path }) => {
const { code, errors } = compileTemplate({
@@ -81,8 +87,7 @@ async function buildVendorJs() {
});
} }],
});
await promisify(pipeline)(orderedSrc(vendorJsFiles), concat("vendor.min.js"), uglify(), dest("public/script"));
fs.appendFileSync("public/script/vendor.min.js", "\n;" + app.outputFiles[0].text);
fs.writeFileSync("public/script/vendor.min.js", app.outputFiles[0].text);
}
function buildMermaidJs(cb) {
@@ -100,6 +105,7 @@ function writeManifest(cb) {
"mermaid.min.js": "public/script/mermaid.min.js",
"all.min.css": "public/css/all.min.css",
};
for (const name of Object.keys(lazyGroups)) files[`${name}.min.js`] = `public/script/${name}.min.js`;
const manifest = {};
for (const [key, filePath] of Object.entries(files)) {
const hash = hashFile(filePath);
+7 -2
View File
@@ -1,6 +1,11 @@
{
"core.min.js": "core.c5bd53363a.min.js",
"vendor.min.js": "vendor.abcdded7b8.min.js",
"vendor.min.js": "vendor.af902bc3b4.min.js",
"mermaid.min.js": "mermaid.f848a72d16.min.js",
"all.min.css": "all.076c089579.min.css"
"all.min.css": "all.076c089579.min.css",
"markdown.min.js": "markdown.ad7b1d71c3.min.js",
"pdf.min.js": "pdf.eaa7573247.min.js",
"notebook.min.js": "notebook.8844e2735f.min.js",
"org.min.js": "org.f4e2a3f59f.min.js",
"editor.min.js": "editor.e243722d87.min.js"
}
+25 -9
View File
@@ -1,4 +1,5 @@
import { h, ref, watch, onMounted, onBeforeUnmount, nextTick } from "vue";
import { loadLibrary, loadEditor } from "./lazy-assets.js";
import { h, ref, watch, onMounted, onBeforeUnmount, nextTick, defineAsyncComponent } from "vue";
import HtmlDoc from "./html-doc.js";
import PdfViewer from "./pdf-viewer.js";
@@ -44,6 +45,7 @@ const Notebook = {
request = new AbortController();
try {
const json = props.content ? JSON.parse(props.content) : await fetch(props.file?.download_url || props.file, { signal: request.signal }).then(r => { if (!r.ok) throw Error("Notebook request failed"); return r.json(); });
await loadLibrary("notebook");
if (current !== generation) return;
host.value.innerHTML = DOMPurify.sanitize(nb.parse(json).render());
host.value.querySelectorAll("pre code").forEach(el => window.Prism?.highlightElement(el));
@@ -64,21 +66,35 @@ const Loc = {
};
},
};
export const components = { Markdown, GistFile, Notebook, Loc, HtmlDoc, Pdfviewer: PdfViewer };
export const components = { Markdown, GistFile, Notebook, Loc, HtmlDoc, Pdfviewer: defineAsyncComponent(async () => {
await loadLibrary("pdf");
pdfjsLib.GlobalWorkerOptions.workerSrc = "/script/external/pdf.worker.js";
return PdfViewer;
}) };
export const codeEditor = {
mounted(el, { value }) {
const editor = ace.edit(el);
el._editor = editor;
editor.setValue(String(value.content ?? ""), -1);
applyEditorOptions(el, value.options);
value.options?.onLoad?.(editor);
async mounted(el, { value }) {
el._editorValue = value;
try {
await loadEditor();
if (el._editorDisposed) return;
const latest = el._editorValue;
const editor = ace.edit(el);
el._editor = editor;
editor.setValue(String(latest.content ?? ""), -1);
applyEditorOptions(el, latest.options);
latest.options?.onLoad?.(editor);
} catch (error) {
if (!el._editorDisposed) el.textContent = error.message;
}
},
updated(el, { value }) {
el._editorValue = value;
if (!el._editor) return;
if (el._editor.getValue() !== String(value.content ?? "")) el._editor.setValue(String(value.content ?? ""), -1);
applyEditorOptions(el, value.options);
},
beforeUnmount(el) { el._editor.destroy(); },
beforeUnmount(el) { el._editorDisposed = true; el._editor?.destroy(); },
};
function applyEditorOptions(el, options = {}) {
if (options.mode) el._editor.session.setMode("ace/mode/" + options.mode);
+1
View File
@@ -0,0 +1 @@
(function(){function l(e,i){var t,n;return i=r(e,i),(e=s.modules[i])||("function"==typeof(e=s.payloads[i])&&(t={id:i,uri:"",exports:n={},packaged:!0},n=e(function(e,t){return o(i,e,t)},n,t)||t.exports,s.modules[i]=n,delete s.payloads[i]),e=s.modules[i]=n||e),e}var e,t,i=function(){return this}(),s=(i||"undefined"==typeof window||(i=window),function(e,t,i){"string"!=typeof e?s.original?s.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(2==arguments.length&&(i=t),s.modules[e]||(s.payloads[e]=i,s.modules[e]=null))}),o=(s.modules={},s.payloads={},function(e,t,i){if("string"==typeof t){var n=l(e,t);if(null!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],o=0,r=t.length;o<r;++o){var a=l(e,t[o]);if(null==a&&h.original)return;s.push(a)}return i&&i.apply(null,s)||!0}}),h=function(e,t){var i=o("",e,t);return null==i&&h.original?h.original.apply(this,arguments):i},r=function(e,t){var i;if(-1!==t.indexOf("!"))return i=t.split("!"),r(e,i[0])+"!"+r(e,i[1]);if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t};t=i,(e="ace")&&(i[e]||(i[e]={}),t=i[e]),t.define&&t.define.packaged||(s.original=t.define,t.define=s,t.define.packaged=!0),t.require&&t.require.packaged||(h.original=t.require,t.require=h,t.require.packaged=!0)})(),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],function(e,t,i){"use strict";"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},s=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"",n=n.appName||"";t.isWin="win"==s,t.isMac="mac"==s,t.isLinux="linux"==s,t.isIE="Microsoft Internet Explorer"==n||0<=n.indexOf("MSAppHost")?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,t.isAIR=0<=o.indexOf("AdobeAIR"),t.isAndroid=0<=o.indexOf("Android"),t.isChromeOS=0<=o.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(o)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,o,t){"use strict";var i,e=e("./useragent");o.buildDom=function e(t,i,n){if("string"==typeof t&&t)return h=document.createTextNode(t),i&&i.appendChild(h),h;if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o<t.length;o++){var r=e(t[o],i,n);r&&s.push(r)}return s}for(var a=document.createElement(t[0]),l=t[1],h=1,o=h=l&&"object"==typeof l&&!Array.isArray(l)?2:h;o<t.length;o++)e(t[o],a,n);return 2==h&&Object.keys(l).forEach(function(e){var t=l[e];"class"===e?a.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?a[e]=t:"ref"===e?n&&(n[t]=a):null!=t&&a.setAttribute(e,t)}),i&&i.appendChild(a),a},o.getDocumentHead=function(e){return(e=e||document).head||e.getElementsByTagName("head")[0]||e.documentElement},o.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},o.removeChildren=function(e){e.innerHTML=""},o.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},o.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},o.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},o.addCssClass=function(e,t){o.hasCssClass(e,t)||(e.className+=" "+t)},o.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},o.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var s=i.indexOf(t);if(-1==s)break;n=!1,i.splice(s,1)}return n&&i.push(t),e.className=i.join(" "),n},o.setCssClass=function(e,t,i){i?o.addCssClass(e,t):o.removeCssClass(e,t)},o.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},o.importCssString=function(e,t,i){var n=i,i=(n=i&&i.getRootNode&&(n=i.getRootNode())&&n!=i?n:docLine truncated
+24
View File
@@ -0,0 +1,24 @@
const pending = new Map();
// Generated from the completed library bundles, so deployments invalidate caches.
const assets = __LAZY_ASSETS__;
export function loadLibrary(name) {
if (!pending.has(name)) {
const script = document.createElement("script");
script.src = assets[name];
const promise = new Promise((resolve, reject) => {
script.onload = resolve;
script.onerror = () => {
pending.delete(name);
script.remove();
reject(new Error(`Unable to load ${name}. Please retry.`));
};
});
pending.set(name, promise);
document.head.appendChild(script);
}
return pending.get(name);
}
export async function loadEditor() {
await loadLibrary("editor");
ace.config.set("basePath", "/script/external/ace/");
}
+8 -3
View File
@@ -1,3 +1,4 @@
import { loadLibrary } from "./lazy-assets.js";
import { createApp, h, watch, provide, inject, onBeforeUnmount } from "vue";
import { createRouter, createWebHistory, RouterView } from "vue-router";
import { pageRoutes } from "./routes.js";
@@ -116,7 +117,13 @@ export function mountApplication(target = "#app", options = {}) {
app.directive("code-editor", codeEditor);
app.directive("paper-scrollspy", paperScrollspy);
app.use(router);
router.beforeEach(() => { root?.emit("routeLeave"); });
router.beforeEach(async to => {
root?.emit("routeLeave");
if (/^\/(r|repository|anonymize|pull-request-anonymize|gist-anonymize|pr|gist)(\/|$)/.test(to.path)) {
await loadLibrary("markdown");
}
if (/^\/(r|repository)\//.test(to.path)) await loadLibrary("org");
});
router.afterEach(to => {
if (!root) return;
root.title = to.meta.title;
@@ -129,6 +136,4 @@ export function mountApplication(target = "#app", options = {}) {
return { app, router, state: root };
}
ace.config.set("basePath", "/script/external/ace/");
pdfjsLib.GlobalWorkerOptions.workerSrc = "/script/external/pdf.worker.js";
if (document.querySelector("#app")) window.anonymousApp = mountApplication();
+1
View File
@@ -0,0 +1 @@
function markedMermaid(e){return{extensions:[{name:"mermaid",level:"block",start(e){return e.match(/^```mermaid/m)?.index},tokenizer(e,t){e=/^```mermaid\n([\s\S]*?)\n```/.exec(e);if(e)return{type:"mermaid",raw:e[0],text:e[1].trim()}},renderer(e){const t="mermaid-"+Math.random().toString(36).substr(2,9);e=`<div class="mermaid" id="${t}">${e.text}</div>`;return"undefined"==typeof mermaid&&"function"==typeof window.loadMermaid&&window.loadMermaid(),setTimeout(()=>{if("undefined"!=typeof mermaid){window.mermaidInitialized||(mermaid.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict"}),window.mermaidInitialized=!0);try{var e=document.getElementById(t);e&&!e.getAttribute("data-processed")&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}catch(e){console.error("Mermaid rendering error:",e)}}},100),e}}]}}!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){"use strict";var E={d:function(e,t){for(var r in t)E.o(t,r)&&!E.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};E.d(t,{default:function(){return Ar}});class L{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;let r,n,i="KaTeX parse error: "+e;var a=t&&t.loc;if(a&&a.start<=a.end){const e=a.lexer.input,t=(r=a.start,n=a.end,r===e.length?i+=" at end of input: ":i+=" at position "+(r+1)+": ",e.slice(r,n).replace(/[^]/g,"$&̲"));var a=15<r?"…"+e.slice(r-15,r):e.slice(0,r),o=n+15<e.length?e.slice(n,n+15)+"…":e.slice(n);i+=a+t+o}t=new Error(i);return t.name="ParseError",t.__proto__=L.prototype,null!=(t.position=r)&&null!=n&&(t.length=n-r),t.rawMessage=e,t}}L.prototype.__proto__=Error.prototype;var z=L;function D(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?D(e.body[0]):e:"font"===e.type?D(e.body):e}const P=/([A-Z])/g,V={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},F=/[&><"']/g;var A={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(F,e=>V[e])},hyphenate:function(e){return e.replace(P,"-$1").toLowerCase()},getBaseElem:D,isCharacterBox:function(e){e=D(e);return"mathord"===e.type||"textord"===e.type||"atom"===e.type},protocolFromUrl:function(e){e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return e?":"===e[2]&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?e[1].toLowerCase():null:"_relative"}};const G={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0Line truncated
+1
View File
@@ -0,0 +1 @@
!function(){function e(e){return e}function t(r){return function(e){var t=u("img",["image-output"]);return t.src="data:image/"+r+";base64,"+d(e).replace(/\n/g,""),t}}function r(){var t=this,e=c.display_priority.filter(function(e){return(t.raw.data||t.raw)[e]})[0];return e&&c.display[e]?c.display[e](t.raw[e]||t.raw.data[e]):u("div",["empty-output"])}function n(){var e=u("pre",["pyerr"]),t=this.raw.traceback.join("\n");return e.innerHTML=c.highlighter(c.ansi(o(t)),e),e}var i,a,s,l=this,p=void 0!==l.window,u=(a=(p?l:(i=new(require("jsdom").JSDOM)).window).document,function(e,t){e=a.createElement(e);return e.className=(t||[]).map(function(e){return c.prefix+e}).join(" "),e}),o=function(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")},d=function(e){return e.join?e.map(d).join(""):e},c={prefix:"nb-",markdown:(s=l.marked||"function"==typeof require&&require("marked"))&&s.parse||e,ansi:(s=l.ansi_up||"function"==typeof require&&require("ansi_up"))&&s.ansi_to_html||e,sanitizer:(s=l.DOMPurify||"function"==typeof require&&require("dompurify"),(p?s&&s.sanitize:s(i.window).sanitize)||e),highlighter:e,VERSION:"0.7.0",Input:function(e,t){this.raw=e,this.cell=t}},h=(c.Input.prototype.render=function(){var e,t,r,n;return this.raw.length?(e=u("div",["input"]),"number"==typeof(n=this.cell).number&&e.setAttribute("data-prompt-number",this.cell.number),t=u("pre"),r=u("code"),n=n.worksheet.notebook.metadata,n=this.cell.raw.language||n.language||n.kernelspec&&n.kernelspec.language||n.language_info&&n.language_info.name,r.setAttribute("data-language",n),r.className="lang-"+n,r.innerHTML=c.highlighter(o(d(this.raw)),t,r,n),t.appendChild(r),e.appendChild(t),this.el=e):u("div")},c.display={},c.display.text=function(e){var t=u("pre",["text-output"]);return t.innerHTML=c.highlighter(c.ansi(d(e)),t),t},c.display["text/plain"]=c.display.text,c.display.html=function(e){var t=u("div",["html-output"]);return t.innerHTML=c.sanitizer(d(e)),t},c.display["text/html"]=c.display.html,c.display.marked=function(e){return c.display.html(c.markdown(d(e)))},c.display["text/markdown"]=c.display.marked,c.display.svg=function(e){var t=u("div",["svg-output"]);return t.innerHTML=d(e),t},c.display["text/svg+xml"]=c.display.svg,c.display["image/svg+xml"]=c.display.svg,c.display.latex=function(e){var t=u("div",["latex-output"]);return t.innerHTML=d(e),t},c.display["text/latex"]=c.display.latex,c.display.javascript=function(e){var t=u("script");return t.innerHTML=d(e),t},c.display["application/javascript"]=c.display.javascript,c.display.png=t("png"),c.display["image/png"]=c.display.png,c.display.jpeg=t("jpeg"),c.display["image/jpeg"]=c.display.jpeg,c.display_priority=["png","image/png","jpeg","image/jpeg","svg","image/svg+xml","text/svg+xml","html","text/html","text/markdown","latex","text/latex","javascript","application/javascript","text","text/plain"],c.Output=function(e,t){this.raw=e,this.cell=t,this.type=e.output_type},c.Output.prototype.renderers={display_data:r,execute_result:r,pyout:r,pyerr:n,error:n,stream:function(){var e=u("pre",[this.raw.stream||this.raw.name]),t=d(this.raw.text);return e.innerHTML=c.highlighter(c.ansi(o(t)),e),e}},c.Output.prototype.render=function(){var e=u("div",["output"]),t=("number"==typeof this.cell.number&&e.setAttribute("data-prompt-number",this.cell.number),this.renderers[this.type].call(this));return e.appendChild(t),this.el=e},c.coalesceStreams=function(e){var t,r;return e.length?(t=e[0],r=[t],e.slice(1).forEach(function(e){"stream"===e.raw.output_type&&"stream"===t.raw.output_type&&e.raw.stream===t.raw.stream&&e.raw.name===t.raw.name?t.raw.text=t.raw.text.concat(e.raw.text):(r.push(e),t=e)}),r):e},[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!(c.Cell=function(e,t){var r=this;r.raw=e,r.worksheet=t,r.type=e.cell_type,"code"===r.type&&(r.number=-1<e.prompt_number?e.prompt_number:e.execution_count,t=e.input||[e.source],r.input=new c.Input(t,r),e=(r.raw.outputs||[]).map(function(e){return new c.Output(e,r)}),r.outputs=c.coalesceStreams(e))})},{left:"$",right:"$",display:!1}]);c.Cell.prototype.renderers={markdown:function(){var e=u("div",["cell","markdown-cell"]),t=d(this.raw.source);return null!=l.renderMathInElement?(e.innerHTML=c.sanitizer(t),l.renderMathInElement(e,{delimiters:h}),e.innerHTML=c.sanitizer(c.markdown(e.innerHTML.replace(/&gt;/g,">")))):e.innerHTML=c.sanitizer(c.markdown(t)),e},heading:function(){var e=u("h"+this.raw.level,["cell","heading-cell"]);return e.innerHTML=c.sanitizer(d(this.raw.source)),e},raw:function(){var e=u("div",["cell","raw-cell"]);return e.innerHTML=o(d(this.raw.source)),e},code:function(){var t=u("div",["cell","code-cell"]);t.appendChild(this.input.render()),this.outputs.forEach(function(e){t.appendChild(e.render())});return t}},c.Cell.prototype.render=function(){var e=this.renderers[this.type].call(this);return this.el=e},c.Worksheet=function(e,t){var r=this;this.raw=e,this.notebook=t,this.cells=e.cells.map(function(e){retuLine truncated
+1
View File
@@ -0,0 +1 @@
var Org=function(){var e={},i={rules:{},define:function(t,e){this.rules[t]=e,this["is"+t.substring(0,1).toUpperCase()+t.substring(1)]=function(e){return this.rules[t].exec(e)}}};function r(){}function s(e){this.stream=e,this.tokenStack=[]}function o(e,t){if(this.type=e,this.children=[],t)for(var n=0,i=t.length;n<i;++n)this.appendChild(t[n])}i.define("header",/^(\*+)\s+(.*)$/),i.define("preformatted",/^(\s*):(?: (.*)$|$)/),i.define("unorderedListElement",/^(\s*)(?:-|\+|\s+\*)\s+(.*)$/),i.define("orderedListElement",/^(\s*)(\d+)(?:\.|\))\s+(.*)$/),i.define("tableSeparator",/^(\s*)\|((?:\+|-)*?)\|?$/),i.define("tableRow",/^(\s*)\|(.*?)\|?$/),i.define("blank",/^$/),i.define("horizontalRule",/^(\s*)-{5,}$/),i.define("directive",/^(\s*)#\+(?:(begin|end)_)?(.*)$/i),i.define("comment",/^(\s*)#(.*)$/),i.define("line",/^(\s*)(.*)$/),r.prototype={isListElement:function(){return this.type===s.tokens.orderedListElement||this.type===s.tokens.unorderedListElement},isTableElement:function(){return this.type===s.tokens.tableSeparator||this.type===s.tokens.tableRow}},s.prototype={tokenize:function(e){var t=new r;if(t.fromLineNumber=this.stream.lineNumber,i.isHeader(e))t.type=s.tokens.header,t.indentation=0,t.content=RegExp.$2,t.level=RegExp.$1.length;else if(i.isPreformatted(e))t.type=s.tokens.preformatted,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(i.isUnorderedListElement(e))t.type=s.tokens.unorderedListElement,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(i.isOrderedListElement(e))t.type=s.tokens.orderedListElement,t.indentation=RegExp.$1.length,t.content=RegExp.$3,t.number=RegExp.$2;else if(i.isTableSeparator(e))t.type=s.tokens.tableSeparator,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(i.isTableRow(e))t.type=s.tokens.tableRow,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(i.isBlank(e))t.type=s.tokens.blank,t.indentation=0,t.content=null;else if(i.isHorizontalRule(e))t.type=s.tokens.horizontalRule,t.indentation=RegExp.$1.length,t.content=null;else if(i.isDirective(e)){t.type=s.tokens.directive,t.indentation=RegExp.$1.length,t.content=RegExp.$3;var n=RegExp.$2;/^begin/i.test(n)?t.beginDirective=!0:/^end/i.test(n)?t.endDirective=!0:t.oneshotDirective=!0}else{if(i.isComment(e))t.type=s.tokens.comment;else{if(!i.isLine(e))throw new Error("SyntaxError: Unknown line: "+e);t.type=s.tokens.line}t.indentation=RegExp.$1.length,t.content=RegExp.$2}return t},pushToken:function(e){this.tokenStack.push(e)},pushDummyTokenByType:function(e){var t=new r;t.type=e,this.tokenStack.push(t)},peekStackedToken:function(){return 0<this.tokenStack.length?this.tokenStack[this.tokenStack.length-1]:null},getStackedToken:function(){return 0<this.tokenStack.length?this.tokenStack.pop():null},peekNextToken:function(){return this.peekStackedToken()||this.tokenize(this.stream.peekNextLine())},getNextToken:function(){return this.getStackedToken()||this.tokenize(this.stream.getNextLine())},hasNext:function(){return this.stream.hasNext()},getLineNumber:function(){return this.stream.lineNumber}},s.tokens={},["header","orderedListElement","unorderedListElement","tableRow","tableSeparator","preformatted","line","horizontalRule","blank","directive","comment"].forEach(function(e,t){s.tokens[e]=t}),void 0!==e&&(e.Lexer=s),o.prototype={previousSibling:null,parent:null,get firstChild(){return this.children.length<1?null:this.children[0]},get lastChild(){return this.children.length<1?null:this.children[this.children.length-1]},appendChild:function(e){var t=this.children.length<1?null:this.lastChild;this.children.push(e),e.previousSibling=t,e.parent=this},toString:function(){var e="<"+this.type+">";return void 0!==this.value?e+=" "+this.value:this.children&&(e+="\n"+this.children.map(function(e,t){return"#"+t+" "+e.toString()}).join("\n").split("\n").map(function(e){return" "+e}).join("\n")),e}};var p={types:{},define:function(n,i){var e="create"+(this.types[n]=n).substring(0,1).toUpperCase()+n.substring(1),r="function"==typeof i;this[e]=function(e,t){e=new o(n,e);return r&&i(e,t||{}),e}}};function a(e){this.sequences=e.split(/\r?\n/),this.totalLines=this.sequences.length,this.lineNumber=0}function l(){this.inlineParser=new t}function t(){this.preEmphasis=" \t\\('\"",this.postEmphasis="- \t.,:!?;'\"\\)",this.borderForbidden=" \t\r\n,\"'",this.bodyRegexp="[\\s\\S]*?",this.markers="*/_=~+",this.emphasisPattern=this.buildEmphasisPattern(),this.linkPattern=/\[\[([^\]]*)\](?:\[([^\]]*)\])?\]/g}function n(){}function c(e,t){this.initialize(e,t),this.result=this.convert()}return p.define("text",function(e,t){e.value=t.value}),p.define("header",function(e,t){e.level=t.level}),p.define("orderedList"),p.define("unorderedList"),p.define("definitionList"),p.define("listElement"),p.define("paragraph"),p.define("preformatted"),p.define("table"),p.define("tableRow"),p.define("tableCell"),p.define("horizontalRule"),p.define("directive"),p.define("inlineContainer"),p.define("bold"),p.define("italic"),p.define("underline"),p.defiLine truncated
+2
View File
@@ -0,0 +1,2 @@
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=t.pdfjsLib=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>t.pdfjsLib=e()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t.pdfjsLib=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||n(e)},e.bytesToString=h,e.createValidAbsoluteUrl=function(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(t)try{if(r&&"string"==typeof t){if(r.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);2<=e?.length&&(t="http://"+t)}if(r.tryConvertEncoding)try{t=p(t)}catch{}}var i=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}}(i))return i}catch{}return null},e.getModificationDate=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();var e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return h(e)},e.getVerbosityLevel=function(){return s},e.info=function(t){s>=i.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"==typeof t&&void 0!==t?.byteLength},e.isArrayEqual=function(r,i){if(r.length!==i.length)return!1;for(let t=0,e=r.length;t<e;t++)if(r[t]!==i[t])return!1;return!0},e.isNodeJS=void 0,e.normalizeUnicode=function(t){return f||(f=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,g=new Map([["ſt","ſt"]])),t.replaceAll(f,(t,e,r)=>e?e.normalize("NFKC"):g.get(r))},e.objectFromMap=function(t){var e,r,i=Object.create(null);for([e,r]of t)i[e]=r;return i},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(s=t)},e.shadow=o,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=c,e.stringToPDFString=function(r){if("ï"<=r[0]){let t;if("þ"===r[0]&&"ÿ"===r[1]?t="utf-16be":"ÿ"===r[0]&&"þ"===r[1]?t="utf-16le":"ï"===r[0]&&"»"===r[1]&&"¿"===r[2]&&(t="utf-8"),t)try{var e=new TextDecoder(t,{fatal:!0}),i=c(r);return e.decode(i)}catch(r){a(`stringToPDFString: "${r}".`)}}var s=[];for(let t=0,e=r.length;t<e;t++){var n=u[r.charCodeAt(t)];s.push(n?String.fromCharCode(n):r.charAt(t))}return s.join("")},e.stringToUTF8String=p,e.unreachable=n,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=a,r(2),r(84),r(86),r(87),r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r,e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.MAX_IMAGE_SIZE_TO_CACHE=1e7,e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35,e.BASELINE_FACTOR=.25925925925925924,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},e.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPALine truncated
`}setFont(t){var e=this.current,r=this.commonObjs.get(t[0]);let i=t[1],s=(e.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),e.fontMatrix=r.fontMatrix||v.FONT_IDENTITY_MATRIX,"normal");r.black?s="900":r.bold&&(s="bold");t=r.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=r.loadedName,e.fontWeight=s,e.fontStyle=t,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",b(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t=this.current;t.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){0<t&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=s[t]}setLineJoin(t){this.current.lineJoin=n[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=v.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=v.Util.makeHexColor(t,e,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){var{width:e,height:r}=this.viewport,i=v.Util.inverseTransform(this.transformMatrix),[e,r,i,s]=v.Util.getAxialAlignedBoundingBox([0,0,e,r],i),n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",e),n.setAttributeNS(null,"y",r),n.setAttributeNS(null,"width",i-e),n.setAttributeNS(null,"height",s-r),n.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&n.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(n)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){var e=t[1],r=t[2],i=t[3]||v.IDENTITY_MATRIX,[s,n,a,o]=t[4],l=t[5],h=t[6],t=t[7],c="shading"+f++,[s,n,a,o]=v.Util.normalizeRect([...v.Util.applyTransform([s,n],i),...v.Util.applyTransform([a,o],i)]),[d,u]=v.Util.singularValueDecompose2dScale(i),l=l*d,d=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",c),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",d),h.setAttributeNS(null,"x",""+s),h.setAttributeNS(null,"y",""+n),this.svg),l=this.transformMatrix,d=this.current.fillColor,p=this.current.strokeColor,a=this.svgFactory.create(a-s,o-n);if(this.svg=a,this.transformMatrix=i,2===t){const t=v.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(r)),this.svg=u,this.transformMatrix=l,this.current.fillColor=d,this.current.strokeColor=p,h.append(a.childNodes[0]),this.defs.append(h),`url(#${c})`}_makeShadingPattern(e){switch((e="string"==typeof e?this.objs.get(e):e)[0]){case"RadialAxial":var r="shading"+f++,i=e[3];let t;switch(e[1]){case"axial":const h=e[4],v=e[5];(t=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",h[0]),t.setAttributeNS(null,"y1",h[1]),t.setAttributeNS(null,"x2",v[0]),t.setAttributeNS(null,"y2",v[1]);break;case"radial":var s=e[4],n=e[5],a=e[6],o=e[7];(t=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",n[0]),t.setAttributeNS(null,"cy",n[1]),t.setAttributeNS(null,"r",o),t.setAttributeNS(null,"fx",s[0]),t.setAttributeNS(null,"fy",s[1]),t.setAttributeNS(null,"fr",a);break;default:throw new Error("Unknown RadialAxial type: "+e[1])}for(const e of i){var l=this.svgFactory.createElement("svg:stop");l.setAttributeNS(null,"offset",e[0]),l.setAttributeNS(null,"stop-color",e[1]),t.append(l)}return this.defs.append(t),`url(#${r})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+e[0])}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const r=this.current;let i=r.x,s=r.y,n=[],a=0;for(const r of t)switch(0|r){case v.OPS.rectangle:i=e[a++],s=e[a++];const t=i+e[a++],r=s+e[a++];n.push("M",b(i),b(s),"L",b(t),b(s),"L",b(t),b(r),"L",b(i),b(r),"Z");break;case v.OPS.moveTo:i=e[a++],s=e[a++],n.push("M",b(i),b(s));break;case v.OPS.lineTo:i=e[a++],s=e[a++],n.push("L",b(i),b(s));break;case v.OPS.curveTo:i=e[a+4],s=e[a+5],n.push("C",b(e[a]),b(e[a+1]),b(e[a+2]),b(e[a+3]),b(i),b(s)),a+=6;break;case v.OPS.curveTo2:n.push("C",b(i),b(s),b(e[a]),b(e[a+1]),b(e[a+2]),b(e[a+3])),i=e[a+2],s=e[a+3],a+=4;break;case v.OPS.curveTo3:i=e[a+2],s=e[a+3],n.push("C",b(e[a]),b(e[a+1]),b(i),b(s),b(i),b(s)),a+=4;break;case v.OPS.closeP Line truncated
+20 -22
View File
@@ -1,31 +1,29 @@
function markedMermaid(e){return{extensions:[{name:"mermaid",level:"block",start(e){return e.match(/^```mermaid/m)?.index},tokenizer(e,t){e=/^```mermaid\n([\s\S]*?)\n```/.exec(e);if(e)return{type:"mermaid",raw:e[0],text:e[1].trim()}},renderer(e){const t="mermaid-"+Math.random().toString(36).substr(2,9);e=`<div class="mermaid" id="${t}">${e.text}</div>`;return"undefined"==typeof mermaid&&"function"==typeof window.loadMermaid&&window.loadMermaid(),setTimeout(()=>{if("undefined"!=typeof mermaid){window.mermaidInitialized||(mermaid.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict"}),window.mermaidInitialized=!0);try{var e=document.getElementById(t);e&&!e.getAttribute("data-processed")&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}catch(e){console.error("Mermaid rendering error:",e)}}},100),e}}]}}!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=e.pdfjsLib=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>e.pdfjsLib=t()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e.pdfjsLib=t():e["pdfjs-dist/build/pdf"]=e.pdfjsLib=t()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationPrefix=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||s(t)},t.bytesToString=h,t.createValidAbsoluteUrl=function(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(e)try{if(i&&"string"==typeof e){if(i.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);2<=t?.length&&(e="http://"+e)}if(i.tryConvertEncoding)try{e=p(e)}catch{}}var n=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}}(n))return n}catch{}return null},t.getModificationDate=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();var t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return h(t)},t.getVerbosityLevel=function(){return r},t.info=function(e){r>=n.INFOS&&console.log("Info: "+e)},t.isArrayBuffer=function(e){return"object"==typeof e&&void 0!==e?.byteLength},t.isArrayEqual=function(i,n){if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0},t.isNodeJS=void 0,t.normalizeUnicode=function(e){return m||(m=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,g=new Map([["ſt","ſt"]])),e.replaceAll(m,(e,t,i)=>t?t.normalize("NFKC"):g.get(i))},t.objectFromMap=function(e){var t,i,n=Object.create(null);for([t,i]of e)n[t]=i;return n},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(r=e)},t.shadow=a,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=c,t.stringToPDFString=function(i){if("ï"<=i[0]){let e;if("þ"===i[0]&&"ÿ"===i[1]?e="utf-16be":"ÿ"===i[0]&&"þ"===i[1]?e="utf-16le":"ï"===i[0]&&"»"===i[1]&&"¿"===i[2]&&(e="utf-8"),e)try{var t=new TextDecoder(e,{fatal:!0}),n=c(i);return t.decode(n)}catch(i){o(`stringToPDFString: "${i}".`)}}var r=[];for(let e=0,t=i.length;e<t;e++){var s=u[i.charCodeAt(e)];r.push(s?String.fromCharCode(s):i.charAt(e))}return r.join("")},t.stringToUTF8String=p,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=o,i(2),i(84),i(86),i(87),i(89),i(93),i(101),i(102),i(105),i(107),i(Line truncated
`}setFont(e){var t=this.current,i=this.commonObjs.get(e[0]);let n=e[1],r=(t.font=i,!this.embedFonts||i.missingFile||this.embeddedFonts[i.loadedName]||(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),t.fontMatrix=i.fontMatrix||v.FONT_IDENTITY_MATRIX,"normal");i.black?r="900":i.bold&&(r="bold");e=i.italic?"italic":"normal";n<0?(n=-n,t.fontDirection=-1):t.fontDirection=1,t.fontSize=n,t.fontFamily=i.loadedName,t.fontWeight=r,t.fontStyle=e,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",y(-t.y)),t.xcoords=[],t.ycoords=[]}endText(){var e=this.current;e.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement?.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(e){0<e&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=r[e]}setLineJoin(e){this.current.lineJoin=s[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,i){this.current.strokeColor=v.Util.makeHexColor(e,t,i)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,i){this.current.fillColor=v.Util.makeHexColor(e,t,i),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){var{width:t,height:i}=this.viewport,n=v.Util.inverseTransform(this.transformMatrix),[t,i,n,r]=v.Util.getAxialAlignedBoundingBox([0,0,t,i],n),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",t),s.setAttributeNS(null,"y",i),s.setAttributeNS(null,"width",n-t),s.setAttributeNS(null,"height",r-i),s.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&s.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(s)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){var t=e[1],i=e[2],n=e[3]||v.IDENTITY_MATRIX,[r,s,o,a]=e[4],l=e[5],h=e[6],e=e[7],c="shading"+m++,[r,s,o,a]=v.Util.normalizeRect([...v.Util.applyTransform([r,s],n),...v.Util.applyTransform([o,a],n)]),[d,u]=v.Util.singularValueDecompose2dScale(n),l=l*d,d=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",c),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",d),h.setAttributeNS(null,"x",""+r),h.setAttributeNS(null,"y",""+s),this.svg),l=this.transformMatrix,d=this.current.fillColor,p=this.current.strokeColor,o=this.svgFactory.create(o-r,a-s);if(this.svg=o,this.transformMatrix=n,2===e){const e=v.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(i)),this.svg=u,this.transformMatrix=l,this.current.fillColor=d,this.current.strokeColor=p,h.append(o.childNodes[0]),this.defs.append(h),`url(#${c})`}_makeShadingPattern(t){switch((t="string"==typeof t?this.objs.get(t):t)[0]){case"RadialAxial":var i="shading"+m++,n=t[3];let e;switch(t[1]){case"axial":const h=t[4],v=t[5];(e=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",h[0]),e.setAttributeNS(null,"y1",h[1]),e.setAttributeNS(null,"x2",v[0]),e.setAttributeNS(null,"y2",v[1]);break;case"radial":var r=t[4],s=t[5],o=t[6],a=t[7];(e=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",s[0]),e.setAttributeNS(null,"cy",s[1]),e.setAttributeNS(null,"r",a),e.setAttributeNS(null,"fx",r[0]),e.setAttributeNS(null,"fy",r[1]),e.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: "+t[1])}for(const t of n){var l=this.svgFactory.createElement("svg:stop");l.setAttributeNS(null,"offset",t[0]),l.setAttributeNS(null,"stop-color",t[1]),e.append(l)}return this.defs.append(e),`url(#${i})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+t[0])}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const i=this.current;let n=i.x,r=i.y,s=[],o=0;for(const i of e)switch(0|i){case v.OPS.rectangle:n=t[o++],r=t[o++];const e=n+t[o++],i=r+t[o++];s.push("M",y(n),y(r),"L",y(e),y(r),"L",y(e),y(i),"L",y(n),y(i),"Z");break;case v.OPS.moveTo:n=t[o++],r=t[o++],s.push("M",y(n),y(r));break;case v.OPS.lineTo:n=t[o++],r=t[o++],s.push("L",y(n),y(r));break;case v.OPS.curveTo:n=t[o+4],r=t[o+5],s.push("C",y(t[o]),y(t[o+1]),y(t[o+2]),y(t[o+3]),y(n),y(r)),o+=6;break;case v.OPS.curveTo2:s.push("C",y(n),y(r),y(t[o]),y(t[o+1]),y(t[o+2]),y(t[o+3])),n=t[o+2],r=t[o+3],o+=4;break;case v.OPS.curveTo3:n=t[o+2],r=t[o+3],s.push("C",y(t[o]),y(t[o+1]),y(n),y(r),y(n),y(r)),o+=4;break;case v.OPS.closeP Line truncated
;"use strict";(()=>{var Ol=Object.defineProperty;var Al=(e,t)=>{for(var o in t)Ol(e,o,{get:t[o],enumerable:!0})};function as(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Ie={},jt=[],nt=()=>{},Wn=()=>!1,ls=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ds=e=>e.startsWith("onUpdate:"),Be=Object.assign,Es=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},Il=Object.prototype.hasOwnProperty,Se=(e,t)=>Il.call(e,t),we=Array.isArray,Vt=e=>Cs(e)==="[object Map]",is=e=>Cs(e)==="[object Set]",Jo=e=>Cs(e)==="[object Date]";var ke=e=>typeof e=="function",Fe=e=>typeof e=="string",ut=e=>typeof e=="symbol",Te=e=>e!==null&&typeof e=="object",Kn=e=>(Te(e)||ke(e))&&ke(e.then)&&ke(e.catch),Zo=Object.prototype.toString,Cs=e=>Zo.call(e),Yn=e=>Cs(e).slice(8,-1),en=e=>Cs(e)==="[object Object]",tn=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,us=as(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var sn=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},Vl=/-\w/g,We=sn(e=>e.replace(Vl,t=>t.slice(1).toUpperCase())),Pl=/\B([A-Z])/g,Pt=sn(e=>e.replace(Pl,"-$1").toLowerCase()),Wt=sn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ns=sn(e=>e?`on${Wt(e)}`:""),mt=(e,t)=>!Object.is(e,t),Ss=(e,...t)=>{for(let o=0;o<e.length;o++)e[o](...t)},nn=(e,t,o,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},xn=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var Qo,Ds=()=>Qo||(Qo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Oe(e){if(we(e)){let t={};for(let o=0;o<e.length;o++){let r=e[o],n=Fe(r)?Fl(r):Oe(r);if(n)for(let i in n)t[i]=n[i]}return t}else if(Fe(e)||Te(e))return e}var ql=/;(?![^(]*\))/g,Ml=/:([^]+)/,$l=/\/\*[^]*?\*\//g;function Fl(e){let t={};return e.replace($l,"").split(ql).forEach(o=>{if(o){let r=o.split(Ml);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function T(e){let t="";if(Fe(e))t=e;else if(we(e))for(let o=0;o<e.length;o++){let r=T(e[o]);r&&(t+=r+" ")}else if(Te(e))for(let o in e)e[o]&&(t+=o+" ");return t.trim()}var er="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",tr=as(er),Ll=as(er+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function on(e){return!!e||e===""}function Ul(e,t){if(e.length!==t.length)return!1;let o=!0;for(let r=0;o&&r<e.length;r++)o=cs(e[r],t[r]);return o}function Xo(e,t){if(e.size!==t.size)return!1;let o=Array.from(t),r=new Uint8Array(o.length);for(let n of e){let i=-1;for(let a=0;a<o.length;a++)if(!r[a]&&cs(n,o[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function cs(e,t){if(e===t)return!0;let o=Jo(e),r=Jo(t);if(o||r)return o&&r?e.getTime()===t.getTime():!1;if(o=ut(e),r=ut(t),o||r)return e===t;if(o=we(e),r=we(t),o||r)return o&&r?Ul(e,t):!1;if(o=Te(e),r=Te(t),o||r){if(!o||!r)return!1;if(o=Vt(e),r=Vt(t),o||r||(o=is(e),r=is(t),o||r))return o&&r?Xo(e,t):!1;let n=Object.keys(e).length,i=Object.keys(t).length;if(n!==i)return!1;for(let a in e){let u=e.hasOwnProperty(a),p=t.hasOwnProperty(a);if(u&&!p||!u&&p||!cs(e[a],t[a]))return!1}}return String(e)===String(t)}var sr=e=>!!(e&&e.__v_isRef===!0),c=e=>Fe(e)?e:e==null?"":we(e)||Te(e)&&(e.toString===Zo||!ke(e.toString))?sr(e)?c(e.value):JSON.stringify(e,nr,2):String(e),nr=(e,t)=>sr(t)?nr(e,t.value):Vt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[jn(r,i)+" =>"]=n,o),{})}:is(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>jn(o))}:ut(t)?jn(t):Te(t)&&!we(t)&&!en(t)?String(t):t,jn=(e,t="")=>{var o;return ut(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function zl(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Ke,As=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ke&&(Ke.active?(this.parent=Ke,this.index=(Ke.scopes||(Ke.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let r=this.scopes.slice();for(t=0,o=r.length;t<o;t++)r[t].pause()}for(t=0,o=this.effects.length;t<o;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,o;if(this.scopes){let n=this.scopes.slice();for(t=0,o=n.length;t<o;t++)n[t].resume()}let r=this.effects.slice();for(t=0,o=r.length;t<o;t++)r[t].resume()}}run(t){if(this._active){let o=Ke;try{return Ke=this,t()}finally{Ke=o}}}on(){++this._on===1&&(this.prevScope=Ke,Ke=this)}off(){if(this._on>0&&--this._on===0){if(Ke===this)Ke=this.prevScope;else{let t=Ke;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let o,r;for(o=0,r=this.effects.length;o<r;o++)this.effects[o].stop();for(this.effects.Line truncated
"use strict";(()=>{var $l=Object.defineProperty;var Fl=(e,t)=>{for(var o in t)$l(e,o,{get:t[o],enumerable:!0})};var ye={notebook:"/script/notebook.8844e2735f.min.js",pdf:"/script/pdf.eaa7573247.min.js",markdown:"/script/markdown.ad7b1d71c3.min.js",org:"/script/org.f4e2a3f59f.min.js",editor:"/script/editor.e243722d87.min.js"};var rn=new Map,Ul=ye;function Wt(e){if(!rn.has(e)){let t=document.createElement("script");t.src=Ul[e];let o=new Promise((r,n)=>{t.onload=r,t.onerror=()=>{rn.delete(e),t.remove(),n(new Error(`Unable to load ${e}. Please retry.`))}});rn.set(e,o),document.head.appendChild(t)}return rn.get(e)}async function tr(){await Wt("editor"),ace.config.set("basePath","/script/external/ace/")}function ds(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Ve={},Kt=[],rt=()=>{},Qn=()=>!1,us=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cs=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Ss=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},zl=Object.prototype.hasOwnProperty,Re=(e,t)=>zl.call(e,t),_e=Array.isArray,Pt=e=>Ds(e)==="[object Map]",ls=e=>Ds(e)==="[object Set]",sr=e=>Ds(e)==="[object Date]";var ke=e=>typeof e=="function",Le=e=>typeof e=="string",ct=e=>typeof e=="symbol",Oe=e=>e!==null&&typeof e=="object",Xn=e=>(Oe(e)||ke(e))&&ke(e.then)&&ke(e.catch),rr=Object.prototype.toString,Ds=e=>rr.call(e),Zn=e=>Ds(e).slice(8,-1),an=e=>Ds(e)==="[object Object]",ln=e=>Le(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ps=ds(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var dn=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},Hl=/-\w/g,Ke=dn(e=>e.replace(Hl,t=>t.slice(1).toUpperCase())),Bl=/\B([A-Z])/g,qt=dn(e=>e.replace(Bl,"-$1").toLowerCase()),Yt=dn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Rs=dn(e=>e?`on${Yt(e)}`:""),ht=(e,t)=>!Object.is(e,t),Ts=(e,...t)=>{for(let o=0;o<e.length;o++)e[o](...t)},un=(e,t,o,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},eo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var nr,Os=()=>nr||(nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ae(e){if(_e(e)){let t={};for(let o=0;o<e.length;o++){let r=e[o],n=Le(r)?Kl(r):Ae(r);if(n)for(let i in n)t[i]=n[i]}return t}else if(Le(e)||Oe(e))return e}var Gl=/;(?![^(]*\))/g,jl=/:([^]+)/,Wl=/\/\*[^]*?\*\//g;function Kl(e){let t={};return e.replace(Wl,"").split(Gl).forEach(o=>{if(o){let r=o.split(jl);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function T(e){let t="";if(Le(e))t=e;else if(_e(e))for(let o=0;o<e.length;o++){let r=T(e[o]);r&&(t+=r+" ")}else if(Oe(e))for(let o in e)e[o]&&(t+=o+" ");return t.trim()}var ir="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ar=ds(ir),Yl=ds(ir+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function cn(e){return!!e||e===""}function xl(e,t){if(e.length!==t.length)return!1;let o=!0;for(let r=0;o&&r<e.length;r++)o=fs(e[r],t[r]);return o}function or(e,t){if(e.size!==t.size)return!1;let o=Array.from(t),r=new Uint8Array(o.length);for(let n of e){let i=-1;for(let a=0;a<o.length;a++)if(!r[a]&&fs(n,o[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function fs(e,t){if(e===t)return!0;let o=sr(e),r=sr(t);if(o||r)return o&&r?e.getTime()===t.getTime():!1;if(o=ct(e),r=ct(t),o||r)return e===t;if(o=_e(e),r=_e(t),o||r)return o&&r?xl(e,t):!1;if(o=Oe(e),r=Oe(t),o||r){if(!o||!r)return!1;if(o=Pt(e),r=Pt(t),o||r||(o=ls(e),r=ls(t),o||r))return o&&r?or(e,t):!1;let n=Object.keys(e).length,i=Object.keys(t).length;if(n!==i)return!1;for(let a in e){let u=e.hasOwnProperty(a),p=t.hasOwnProperty(a);if(u&&!p||!u&&p||!fs(e[a],t[a]))return!1}}return String(e)===String(t)}var lr=e=>!!(e&&e.__v_isRef===!0),c=e=>Le(e)?e:e==null?"":_e(e)||Oe(e)&&(e.toString===rr||!ke(e.toString))?lr(e)?c(e.value):JSON.stringify(e,dr,2):String(e),dr=(e,t)=>lr(t)?dr(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Jn(r,i)+" =>"]=n,o),{})}:ls(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Jn(o))}:ct(t)?Jn(t):Oe(t)&&!_e(t)&&!an(t)?String(t):t,Jn=(e,t="")=>{var o;return ct(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function Jl(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Ye,Ps=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ye&&(Ye.active?(this.parent=Ye,this.index=(Ye.scopes||(Ye.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let r=this.scopes.slice();for(t=0,o=r.length;t<o;t++)r[t].pause()}for(t=0,o=this.effects.length;t<o;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!Line truncated
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},[He.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${sc(t)}" via a navigation guard.`},[He.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[He.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[He.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ss(e,t){return Ae(new Error,{type:e,[Ji]:!0},t)}function It(e,t){return e instanceof Error&&Ji in e&&(t==null||!!(e.type&t))}var tc=["params","query","hash"];function sc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of tc)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function Qi(e){let t={};if(e===""||e==="?")return t;let o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){let n=o[r].replace($i," "),i=n.indexOf("="),a=bs(i<0?n:n.slice(0,i)),u=i<0?null:bs(n.slice(i+1));if(a in t){let p=t[a];yt(p)||(p=t[a]=[p]),p.push(u)}else t[a]=u}return t}function Lo(e){let t="";for(let o in e){let r=e[o];if(o=Wu(o),r==null){r!==void 0&&(t+=(t.length?"&":"")+o);continue}(yt(r)?r.map(n=>n&&Ao(n)):[r&&Ao(r)]).forEach(n=>{n!==void 0&&(t+=(t.length?"&":"")+o,n!=null&&(t+="="+n))})}return t}function Xi(e){let t={};for(let o in e){let r=e[o];r!==void 0&&(t[o]=yt(r)?r.map(n=>n==null?null:""+n):r==null?r:""+r)}return t}var Zi=Symbol(""),Uo=Symbol(""),Ln=Symbol(""),Un=Symbol(""),zn=Symbol("");function ks(){let e=[];function t(r){return e.push(r),()=>{let n=e.indexOf(r);n>-1&&e.splice(n,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function Ht(e,t,o,r,n,i=a=>a()){let a=r&&(r.enterCallbacks[n]=r.enterCallbacks[n]||[]);return()=>new Promise((u,p)=>{let h=f=>{f===!1?p(ss(He.NAVIGATION_ABORTED,{from:o,to:t})):f instanceof Error?p(f):ec(f)?p(ss(He.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(a&&r.enterCallbacks[n]===a&&typeof f=="function"&&a.push(f),u())},v=i(()=>e.call(r&&r.instances[n],t,o,h)),g=Promise.resolve(v);e.length<3&&(g=g.then(h)),g.catch(f=>p(f))})}function Hn(e,t,o,r,n=i=>i()){let i=[];for(let a of e)for(let u in a.components){let p=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(qi(p)){let h=(p.__vccOpts||p)[t];h&&i.push(Ht(h,o,r,a,u,n))}else{let h=p();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let g=Mu(v)?v.default:v;a.mods[u]=v,a.components[u]=g;let f=(g.__vccOpts||g)[t];return f&&Ht(f,o,r,a,u,n)()}))}}return i}function ea(e,t){let o=[],r=[],n=[],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=>ts(h,u))?r.push(u):o.push(u));let p=e.matched[a];p&&(t.matched.find(h=>ts(h,p))||n.push(p))}return[o,r,n]}var nc=()=>location.protocol+"//"+location.host;function ca(e,t){let{pathname:o,search:r,hash:n}=t,i=e.indexOf("#");if(i>-1){let a=n.includes(e.slice(i))?e.slice(i).length:1,u=n.slice(a);return u[0]!=="/"&&(u="/"+u),qo(u,"")}return qo(o,e)+r+n}function oc(e,t,o,r){let n=[],i=[],a=null,u=({state:f})=>{let b=ca(e,location),_=o.value,k=t.value,R=0;if(f){if(o.value=b,t.value=f,a&&a===_){a=null;return}R=k?f.position-k.position:0}else r(b);n.forEach(S=>{S(o.value,_,{delta:R,type:$n.pop,direction:R?R>0?Fn.forward:Fn.back:Fn.unknown})})};function p(){a=o.value}function h(f){n.push(f);let b=()=>{let _=n.indexOf(f);_>-1&&n.splice(_,1)};return i.push(b),b}function v(){if(document.visibilityState==="hidden"){let{history:f}=window;if(!f.state)return;f.replaceState(Ae({},f.state,{scroll:Zs()}),"")}}function g(){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:p,listen:h,destroy:g}}function ta(e,t,o,r=!1,n=!1){return{back:e,current:t,forward:o,replaced:r,position:window.history.length,scroll:n?Zs():null}}function rc(e){let{history:t,location:o}=window,r={value:ca(e,o)},n={value:t.state};n.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(p,h,v){let g=e.indexOf("#"),f=g>-1?(o.host&&document.querySelector("base")?e:e.slice(g))+p:nc()+e+p;try{t[v?"replaceState":"pushState"](h,"",f),n.value=h}catch(b){console.error(b),o[v?"replace":"assign"](f)}}function a(p,h){i(p,Ae({},t.state,ta(n.value.back,p,n.value.forward,!0),h,{position:n.value.position}),!0),r.value=p}function u(p,h){let v=Ae({},n.value,t.state,{forward:p,scroll:Zs()});i(v.current,v,!0),i(p,Ae({},ta(r.value,p,null),{position:v.position+1},h),!1),r.value=p}return{location:r,state:n,push:u,replace:a}}function pa(e){e=ji(e);let t=rc(e),o=oc(e,t.state,t.location,t.replace);function r(i,a=!0){a||o.pauseListeners(),history.go(i)}let n=Ae({locatLine truncated
`+JSON.stringify(t):""}`},[Be.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${pc(t)}" via a navigation guard.`},[Be.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[Be.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[Be.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function os(e,t){return Ie(new Error,{type:e,[na]:!0},t)}function Vt(e,t){return e instanceof Error&&na in e&&(t==null||!!(e.type&t))}var cc=["params","query","hash"];function pc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of cc)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function oa(e){let t={};if(e===""||e==="?")return t;let o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){let n=o[r].replace(Gi," "),i=n.indexOf("="),a=_s(i<0?n:n.slice(0,i)),u=i<0?null:_s(n.slice(i+1));if(a in t){let p=t[a];gt(p)||(p=t[a]=[p]),p.push(u)}else t[a]=u}return t}function Go(e){let t="";for(let o in e){let r=e[o];if(o=sc(o),r==null){r!==void 0&&(t+=(t.length?"&":"")+o);continue}(gt(r)?r.map(n=>n&&Mo(n)):[r&&Mo(r)]).forEach(n=>{n!==void 0&&(t+=(t.length?"&":"")+o,n!=null&&(t+="="+n))})}return t}function ra(e){let t={};for(let o in e){let r=e[o];r!==void 0&&(t[o]=gt(r)?r.map(n=>n==null?null:""+n):r==null?r:""+r)}return t}var ia=Symbol(""),jo=Symbol(""),Gn=Symbol(""),jn=Symbol(""),Wn=Symbol("");function Cs(){let e=[];function t(r){return e.push(r),()=>{let n=e.indexOf(r);n>-1&&e.splice(n,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function Bt(e,t,o,r,n,i=a=>a()){let a=r&&(r.enterCallbacks[n]=r.enterCallbacks[n]||[]);return()=>new Promise((u,p)=>{let h=f=>{f===!1?p(os(Be.NAVIGATION_ABORTED,{from:o,to:t})):f instanceof Error?p(f):uc(f)?p(os(Be.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(a&&r.enterCallbacks[n]===a&&typeof f=="function"&&a.push(f),u())},v=i(()=>e.call(r&&r.instances[n],t,o,h)),g=Promise.resolve(v);e.length<3&&(g=g.then(h)),g.catch(f=>p(f))})}function Kn(e,t,o,r,n=i=>i()){let i=[];for(let a of e)for(let u in a.components){let p=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Hi(p)){let h=(p.__vccOpts||p)[t];h&&i.push(Bt(h,o,r,a,u,n))}else{let h=p();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let g=Wu(v)?v.default:v;a.mods[u]=v,a.components[u]=g;let f=(g.__vccOpts||g)[t];return f&&Bt(f,o,r,a,u,n)()}))}}return i}function aa(e,t){let o=[],r=[],n=[],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=>ns(h,u))?r.push(u):o.push(u));let p=e.matched[a];p&&(t.matched.find(h=>ns(h,p))||n.push(p))}return[o,r,n]}var fc=()=>location.protocol+"//"+location.host;function ga(e,t){let{pathname:o,search:r,hash:n}=t,i=e.indexOf("#");if(i>-1){let a=n.includes(e.slice(i))?e.slice(i).length:1,u=n.slice(a);return u[0]!=="/"&&(u="/"+u),Uo(u,"")}return Uo(o,e)+r+n}function mc(e,t,o,r){let n=[],i=[],a=null,u=({state:f})=>{let w=ga(e,location),k=o.value,b=t.value,R=0;if(f){if(o.value=w,t.value=f,a&&a===k){a=null;return}R=b?f.position-b.position:0}else r(w);n.forEach(N=>{N(o.value,k,{delta:R,type:Hn.pop,direction:R?R>0?Bn.forward:Bn.back:Bn.unknown})})};function p(){a=o.value}function h(f){n.push(f);let w=()=>{let k=n.indexOf(f);k>-1&&n.splice(k,1)};return i.push(w),w}function v(){if(document.visibilityState==="hidden"){let{history:f}=window;if(!f.state)return;f.replaceState(Ie({},f.state,{scroll:on()}),"")}}function g(){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:p,listen:h,destroy:g}}function la(e,t,o,r=!1,n=!1){return{back:e,current:t,forward:o,replaced:r,position:window.history.length,scroll:n?on():null}}function hc(e){let{history:t,location:o}=window,r={value:ga(e,o)},n={value:t.state};n.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(p,h,v){let g=e.indexOf("#"),f=g>-1?(o.host&&document.querySelector("base")?e:e.slice(g))+p:fc()+e+p;try{t[v?"replaceState":"pushState"](h,"",f),n.value=h}catch(w){console.error(w),o[v?"replace":"assign"](f)}}function a(p,h){i(p,Ie({},t.state,la(n.value.back,p,n.value.forward,!0),h,{position:n.value.position}),!0),r.value=p}function u(p,h){let v=Ie({},n.value,t.state,{forward:p,scroll:on()});i(v.current,v,!0),i(p,Ie({},la(r.value,p,null),{position:v.position+1},h),!1),r.value=p}return{location:r,state:n,push:u,replace:a}}function ba(e){e=Xi(e);let t=hc(e),o=mc(e,t.state,t.location,t.replace);function r(i,a=!0){a||o.pauseListeners(),history.go(i)}let n=Ie({locatLine truncated
`)),e.options=Object.assign({},e.options,p.options)})}i();let a=null;e.saveDefault=u=>{u&&u.preventDefault&&u.preventDefault();let p={terms:e.terms.split(`
`).map(h=>h.trim()).filter(h=>h.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",p).then(()=>{i(),e.saving=!1,e.message="Saved",a&&r.cancel(a),a=r(()=>{e.message=null},2500)},h=>{e.saving=!1;let v=h&&h.data&&h.data.error;o("ERRORS."+v).then(g=>{e.error=g},()=>{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."}))}},ka=function(e,t,o){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{o.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},_a=function(e,t,o,r,n){e.user&&!e.user.status&&o.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&o.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?"/github/login":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,p){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,g=h==="first"?0:h==="last"?v-1:(p+h+v)%v;e.feature=e.features[g].key,n(()=>{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 p={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return p;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,g=Math.max.apply(null,h),f=Math.min.apply(null,h),b=Math.min(0,f),_=g-b||1;p.viewW=v*2,p.bars=new Array(v);for(let k=0;k<v;k++){let R=(h[k]-b)/_,S=Math.max(1.5,R*34);p.bars[k]={x:(k*2+.25).toFixed(2),y:(36-S).toFixed(2),w:"1.5",h:S.toFixed(2)}}if(p.deltaToday=h[v-1],v>=2){let k=h[v-2];k&&(p.pctChange=(p.deltaToday-k)/k*100)}return p.pctAbs=Math.round(Math.abs(p.pctChange)),p.isUp=p.pctChange>=0,p}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let p=u.data||[];e.history={repositories:a(p.map(h=>h.nbRepositories||0)),users:a(p.map(h=>h.nbUsers||0)),pageViews:a(p.map(h=>h.nbPageViews||0)),pullRequests:a(p.map(h=>h.nbPullRequests||0))}})},Ea=function(e,t,o,r,n,i){let a=ft();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"In progress",error:"Error",expired:"Expired",removed:"Removed"};let u=["queue","download","downloaded","preparing","anonymizing"];function p(C){return C==="ready"||C==="error"?C:C==="expired"||C==="expiring"?"expired" Line truncated
`)),e.options=Object.assign({},e.options,j.options),e.options.expirationDate=j.options&&j.options.expirationDate?new Date(j.options.expirationDate):u(),O&&O()})}function g(O,V,j){e.anonymize&&e.anonymize[O]&&e.anonymize[O].setValidity(V,j)}function f(O){try{let V=parseGithubUrl(O);if(V&&V.owner&&V.repo)return V.owner+"/"+V.repo}catch{}return null}function b(){return!e.isUpdate||!e._originalRepositoryID?void 0:f(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}v(()=>{r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async O=>{e.sourceUrl="https://github.com/"+O.data.source.fullName,e._originalFullName=O.data.source.fullName,e.terms=O.data.options.terms.filter(V=>V).join(`
`),e.source=O.data.source,e.role=O.data.role||"owner",e.coauthors=O.data.coauthors||[],e._originalBranch=O.data.source.branch,e.options=Object.assign({},e.options,O.data.options),e.conference=O.data.conference,e.repositoryID=O.data.source.repositoryID,e._originalRepositoryID=O.data.source.repositoryID,O.data.options.expirationDate&&(e.options.expirationDate=new Date(O.data.options.expirationDate)),await Promise.all([_(),k()]),I()},()=>{n.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async O=>{e.sourceUrl="https://github.com/"+O.data.source.repositoryFullName+"/pull/"+O.data.source.pullRequestId,e.terms=O.data.options.terms.filter(V=>V).join(`
`),e.source=O.data.source,e.options=Object.assign({},e.options,O.data.options),e.conference=O.data.conference,O.data.options.expirationDate&&(e.options.expirationDate=new Date(O.data.options.expirationDate));try{e.details=(await t.get(`/api/pr/${O.data.source.repositoryFullName}/${O.data.source.pullRequestId}`)).data}catch(V){let j=V&&V.data&&V.data.error;j&&(i("ERRORS."+j).then(Z=>{e.addToast({title:"Error",date:new Date,body:Z}),e.error=Z},console.error),ae(j))}},()=>{n.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async O=>{e.sourceUrl="https://gist.github.com/"+O.data.source.gistId,e.terms=O.data.options.terms.filter(V=>V).join(`
`),e.source=O.data.source,e.options=Object.assign({},e.options,O.data.options),e.conference=O.data.conference,O.data.options.expirationDate&&(e.options.expirationDate=new Date(O.data.options.expirationDate)),e.details=(await t.get(`/api/gist/source/${O.data.source.gistId}`)).data},()=>{n.url("/404")}))}),e.urlSelected=async()=>{e.terms=e.defaultTerms,e.isUpdate||(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],e.source={type:"GitHubStream",branch:"",commit:""},e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null;let O;try{O=parseGithubUrl(e.sourceUrl)}catch{g("sourceUrl","github",!1);return}g("sourceUrl","github",!0);try{O.gistId&&!O.repo?(e.detectedType="gist",e.source={gistId:O.gistId},await K()):O.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:O.owner+"/"+O.repo,pullRequestId:O.pullRequestId},await C()):(e.detectedType="repo",await Promise.all([_(),k()]),I())}catch{return}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let O=e.branches.filter(j=>j.name==e.source.branch)[0];if(!O)return;e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit||(e.source.commit=O.commit),e.readme=O.readme,await k(),I()}),e.getBranches=async O=>{let V=parseGithubUrl(e.sourceUrl);try{let j=await t.get(`/api/repo/${V.owner}/${V.repo}/branches`,{params:{force:O===!0?"1":"0",repositoryID:b()}});e.branches=j.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let Z=e.branches.filter(oe=>oe.name==e.source.branch);Z.length>0&&(!O&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit||(e.source.commit=Z[0].commit),e.readme=Z[0].readme,await k(O))}catch(j){e.branches=[],e.sourceUnreachable=j&&(j.status===404||j.data&&j.data.error==="repo_not_found");let Z=j&&j.data&&j.data.error||(j&&j.status===404?"repo_not_found":"unknown_error");i("ERRORS."+Z).then(oe=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:oe}),e.error=oe},console.error),typeof g=="function"&&g("sourceUrl","missing",!1)}};async function _(){let O=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/repo/${O.owner}/${O.repo}/`,{params:{repositoryID:b(),force:"1"}});e.details=V.data,e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches()}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}async function k(O){if(e.readme&&!O)return e.readme;let V=parseGithubUrl(e.sourceUrl);try{let j=await t.get(`/api/repo/${V.owner}/${V.repo}/readme`,{params:{force:O===!0?"1":"0",branch:e.source.branch,repositoryID:b()}});e.readme=j.data}catch{e.readme=""}}function R(){let O={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(O.branchName=e.source.branch);try{let V=parseGithubUrl(e.sourceUrl);O.repoName=`${V.owner}/${V.repo}`}catch{}return O}function S(O,V){let j=null,Z=0;return function(){j&&a.cancel(j),j=a(()=>{j=null;let Pe=++Z,Ue=O();Ue&&t.post("/api/anonymize-preview",Ue).then($e=>{Pe===Z&&V($e.data)},()=>{})},200)}}let D=S(()=>e.readme?{content:e.readme,options:R()}:null,O=>{e.anonymize_readme=O.content||"";let V="";try{let Z=parseGithubUrl(e.sourceUrl),oe=e.source.branch||e.details&&e.details.defaultBranch||"main";V=`https://github.com/${Z.owner}/${Z.repo}/raw/${oe}/`}catch{}let j=renderMD(e.anonymize_readme,V);e.html_readme=j,a(Prism.highlightAll,150)});function I(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),D())}async function C(){let O=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/pr/${O.owner}/${O.repo}/${O.pullRequestId}`);e.details=V.data,e.pullRequestId||(e.pullRequestId=O.repo+"-PR"+O.pullRequestId+"-"+generateRandomId(4))}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}let A=Le(new Map),q=new Set;function ee(){let O=new Set,V=e.details&&e.details.pullRequest;if(!V)return O;typeof V.title=="string"&&O.add(V.title),typeof V.body=="string"&&O.add(V.body),typeof V.diff=="string"&&O.add(V.diff);let j=V.comments||[];for(let Z of j)typeof Z.author=="string"&&O.add(Z.author),typeof Z.body=="string"&&O.add(Z.body);return O}let J=S(()=>{let O=ee();q=O;let V=Array.from(O);return V.length===0?null:{contents:V,options:R()}},O=>{if(!O||!Array.isArray(O.contents))return;let V=Array.from(q),j=new Map;for(let Z=0;Z<V.length&&Z<O.contents.length;Z++)j.set(V[Z],O.contents[Z]);A.clear(),j.forEach((Z,oe)=>A.set(oe,Z))});e.anonymizePrContent=function(O){return O&&(A.has(O)?A.get(O):(q.has(O)||J(),O))};async function K(){let O=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/gist/source/${O.gistId}`);e.details=V.data,e.gistId||(e.gistId="gist-"+O.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}let U=Le(new Map),de=new Set;function se(){let O=new Set,V=e.details&&e.details.gist;if(!V)return O;typeof V.description=="string"&&O.add(V.description),typeof V.ownerLogin=="string"&&O.add(V.ownerLogin);let j=V.files||[];for(let oe of j)typeof oe.filename=="string"&&O.add(oe.filename),typeof oe.content=="string"&&O.add(oe.content);let Z=V.comments||[];for(let oe of Z)typeof oe.author=="string"&&O.add(oe.author),typeof oe.body=="string"&&O.add(oe.body);return O}let ie=S(()=>{let O=se();de=O;let V=Array.from(O);return V.length===0?null:{contents:V,options:R()}},O=>{if(!O||!Array.isArray(O.contents))return;let V=Array.from(de),j=new Map;for(let Z=0;Z<V.length&&Z<O.contents.length;Z++)j.set(V[Z],O.contents[Z]);U.clear(),j.forEach((Z,oe)=>U.set(oe,Z)),ce()});e.anonymizeGistContent=function(O){return O&&(U.has(O)?U.get(O):(de.has(O)||ie(),O))},e.previewGistFiles=[];function ce(){let O=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=O.map(V=>({filename:e.anonymizeGistContent(V.filename),content:e.anonymizeGistContent(V.content),language:V.language}))}e.watch("details.gist.files",ce,!0),e.watch("terms",ce);function be(){e.conference&&t.get("/api/conferences/"+e.conference).then(O=>{e.conference_data=O.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),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.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link},()=>{e.conference_data=null})}function he(){g("repoId","used",!0),g("repoId","format",!0),g("pullRequestId","used",!0),g("pullRequestId","format",!0),g("gistId","used",!0),g("gistId","format",!0),g("sourceUrl","used",!0),g("sourceUrl","missing",!0),g("sourceUrl","access",!0),g("sourceUrl","github",!0),g("commit","exists",!0),g("conference","activated",!0),g("terms","format",!0),e.termsRegexWarning=!1}function me(){let O=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||O&&O.invalid?(O&&O.setDirty&&O.setDirty(),e.error="Please choose a valid expiration date.",!0):!1}function ae(O){let V=e.detectedType==="pr"?"pullRequestId":e.detectedType==="gist"?"gistId":"repoId";switch(O){case"repoId_already_used":g(V,"used",!1);break;case"invalid_repoId":g(V,"format",!1);break;case"options_not_provided":g(V,"format",!1);break;case"repo_already_anonymized":g("sourceU Line truncated
`).filter(oe=>oe),fullName:`${V.owner}/${V.repo}`,repository:e.sourceUrl,options:e.options,source:e.source,conference:e.conference};e.details&&(j.options.pageSource=e.details.pageSource),he();let Z=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/status/"+e.repoId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(Pe=>{e.error=Pe},console.error),ae(oe.data.error))}).finally(()=>{O.target.disabled=!1})},e.anonymizeGist=O=>{if(me())return;O.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),j={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(oe=>oe),source:{gistId:V.gistId},options:e.options,conference:e.conference};he();let Z=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/gist/"+e.gistId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(Pe=>{e.error=Pe},console.error),ae(oe.data.error))}).finally(()=>{O.target.disabled=!1})},e.anonymizePullRequest=O=>{if(me())return;O.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),j={pullRequestId:e.pullRequestId,terms:e.terms.trim().split(`
`).filter(oe=>oe),source:{repositoryFullName:`${V.owner}/${V.repo}`,pullRequestId:V.pullRequestId},options:e.options,conference:e.conference};he();let Z=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/pr/"+e.pullRequestId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(Pe=>{e.error=Pe},console.error),ae(oe.data.error))}).finally(()=>{O.target.disabled=!1})},e.watch("conference",()=>{be()}),e.watch("terms",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("options.image",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("options.link",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("details",()=>{e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()},!0)},Bo=function(e,t,o,r,n,i){let a=ft(),u=rs(),p=0,h=!1;e.on("dispose",()=>{h=!0,p++,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(U){if((U.metaKey||U.ctrlKey)&&U.key==="k"){U.preventDefault();var de=document.querySelector(".tree-search-input");de&&(de.focus(),de.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let U=e.fileSearchQuery;if(!U||U.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let de=i.defer();v=de,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(U)}`,{timeout:de.promise}).then(function(se){if(!(h||v!==de)){v=null,e.fileSearchLoading=!1;var ie={};e.files.forEach(function(F){ie[(F.path||"")+"/"+F.name]=!0});for(var ce=[],be={},he=0;he<se.data.length;he++){var me=se.data[he];if(me.path)for(var ae=me.path.split("/"),O="",V=0;V<ae.length;V++){var j=O;O=O?O+"/"+ae[V]:ae[V];var Z=j+"/"+ae[V];!ie[Z]&&!be[Z]&&(be[Z]=!0,ce.push({name:ae[V],path:j}))}}ce.sort(function(F,ne){return(F.path||"").split("/").length-(ne.path||"").split("/").length}),ce.length>0&&e.files.push.apply(e.files,ce);for(var oe=[],Pe=0;Pe<se.data.length;Pe++){var Ue=se.data[Pe],$e=(Ue.path||"")+"/"+Ue.name;!ie[$e]&&Ue.size!=null&&(oe.push(Ue),ie[$e]=!0)}oe.length>0&&e.files.push.apply(e.files,oe),e.fileSearchResults=se.data}},function(){!h&&v===de&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let g={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"],_=["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(U,de){if(e.repoId!=r.repoId)return K();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(se=>se&&se.trim().length>0),J();for(let se=0;se<e.paths.length-1;se++){let ie=se>0?e.paths.slice(0,se).join("/"):"";e.files.some(be=>be.path===ie)||e.getFiles(ie)}}});function R(){if(e.paths[0]!="")return;let U=["readme.md","readme.txt","readme.org","readme.1st","readme"],de={};for(let ie of e.files)ie.name.toLowerCase().indexOf("readme")>-1&&(de[ie.name.toLowerCase()]=ie.name);let se=null;for(let ie of U)if(de[ie]){se=ie;break}if(!se&&Object.keys(de).length>0&&(se=Object.keys(de)[0]),se){let ie=o.url();ie[ie.length-1]!="/"&&(ie+="/"),o.url(ie+encodePathForUrl(de[se]))}}e.fileCounts=null,e.getFiles=function(U){let de=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(U)}&v=${e.options.lastUpdateDate}`).then(function(se){if(h||de!==e.repoId)return[];let ie=U||"";return e.files=e.files.filter(ce=>ce.path!==ie),e.files.push(...se.data),se.data},function(se){if(h||de!==e.repoId)return[];e.type="error",e.content=se&&se.data&&se.data.error||"unknown_error",e.files=[]})};function S(){let U=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(de){h||U!==e.repoId||(e.fileCounts=de.data)},function(){e.fileCounts={}})}function D(){return e.files.filter(U=>U.name==e.paths[e.paths.length-1]&&U.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var I=null;e.on("dispose",function(){I&&a.interval.cancel(I)});function C(U){if(h)return;let de=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(se=>{if(!(h||de!==e.repoId)){if(e.options=se.data,e.options.url){window.location=e.options.url;return}U&&U(se.data)}},se=>{if(!(h||de!==e.repoId)){var ie=se.data||{};if(ie.error==="rate_limited"&&ie.resetAt){let be=function(){var he=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(he<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,I&&(a.interval.cancel(I),I=null),C(U);else{var me=Math.floor(he/60),ae=he%60;e.rateLimitCountdown=me>0?me+"m "+ae+"s":ae+"s"}};var ce=be;e.type="rate_limited",e.rateLimitResetAt=ie.resetAt,I&&a.interval.cancel(I),be(),I=a.interval(be,1e3)}else ie.error==="repository_no Line truncated
`+k.join(`
`)],{type:"text/csv"}),S=document.createElement("a");S.href=URL.createObjectURL(R),S.download=r.username+"-repositories.csv",S.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(_=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(_.data,null,2).replace(/[<>]/g,k=>k==="<"?"&lt;":"&gt;")+"</pre>"),b.document.close())},_=>{let k=_&&_.data?JSON.stringify(_.data,null,2):String(_);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+k+"</pre>")})};function p(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),p(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(()=>p(r.username),b=>console.error(b))},e.removeRepository=f=>{confirm("Remove repository "+f.repoId+"?")&&t.delete("/api/repo/"+f.repoId+"/").then(()=>p(r.username),b=>console.error(b))},e.updateRepository=f=>{let b=Le({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(_=>{_.data.status=="ready"?b.title=`${f.repoId} is refreshed.`:b.title=`Refreshing of ${f.repoId}.`},_=>{b.title=`Error during the refresh of ${f.repoId}.`,b.body=_.body})},e.getGitHubRepositories=f=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let g=null;e.watch("query",()=>{n.timeout.cancel(g),g=n.timeout(()=>{p(r.username)},500)},!0)},Ia=function(e,t,o){let r=ft(),n=rs();e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=_=>{if(_.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){_.preventDefault();let k=document.querySelector('.admin-filter-toolbar input[type="search"]');k&&k.focus()}};n(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=_=>{_==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[_]="",e.query.page=1},e.chips=[];let a=()=>{let _=[];(e.query.dateFrom||e.query.dateTo)&&_.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=_};e.statusCountFor=_=>{let k=(e.statusCounts||[]).find(R=>R._id===_);return k?k.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=_=>{e.query.sort===_?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=_,e.query.direction="desc"),e.query.page=1},e.sortIcon=_=>e.query.sort===_?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",p={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({},p,h,{page:1,search:""});let v=o.search();v.search&&(e.query.search=v.search);let g="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(g)||"[]"),e.savePreset=()=>{let _=window.prompt("Preset name:");if(!_)return;let k=Object.assign({},e.query);delete k.page,e.presets=(e.presets||[]).filter(R=>R.name!==_),e.presets.push({name:_,query:k}),localStorage.setItem(g,JSON.stringify(e.presets))},e.applyPreset=_=>{Object.assign(e.query,_.query,{page:1})},e.deletePreset=_=>{e.presets=(e.presets||[]).filter(k=>k.name!==_.name),localStorage.setItem(g,JS Line truncated
`).map((he,me)=>me===0?he:be+he).join(`
`).map(h=>h.trim()).filter(h=>h.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",p).then(()=>{i(),e.saving=!1,e.message="Saved",a&&r.cancel(a),a=r(()=>{e.message=null},2500)},h=>{e.saving=!1;let v=h&&h.data&&h.data.error;o("ERRORS."+v).then(g=>{e.error=g},()=>{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."}))}},Ra=function(e,t,o){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{o.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Ta=function(e,t,o,r,n){e.user&&!e.user.status&&o.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&o.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?"/github/login":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,p){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,g=h==="first"?0:h==="last"?v-1:(p+h+v)%v;e.feature=e.features[g].key,n(()=>{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 p={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return p;let h=new Array(u.length-1);for(let b=1;b<u.length;b++)h[b-1]=u[b]-u[b-1];let v=h.length,g=Math.max.apply(null,h),f=Math.min.apply(null,h),w=Math.min(0,f),k=g-w||1;p.viewW=v*2,p.bars=new Array(v);for(let b=0;b<v;b++){let R=(h[b]-w)/k,N=Math.max(1.5,R*34);p.bars[b]={x:(b*2+.25).toFixed(2),y:(36-N).toFixed(2),w:"1.5",h:N.toFixed(2)}}if(p.deltaToday=h[v-1],v>=2){let b=h[v-2];b&&(p.pctChange=(p.deltaToday-b)/b*100)}return p.pctAbs=Math.round(Math.abs(p.pctChange)),p.isUp=p.pctChange>=0,p}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let p=u.data||[];e.history={repositories:a(p.map(h=>h.nbRepositories||0)),users:a(p.map(h=>h.nbUsers||0)),pageViews:a(p.map(h=>h.nbPageViews||0)),pullRequests:a(p.map(h=>h.nbPullRequests||0))}})},Oa=function(e,t,o,r,n,i){let a=mt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"In progress",error:"Error",expired:"Expired",removed:"Removed"};let u=["queue","download","downloaded","preparing","anonymizing"];function p(C){return C==="ready"||C==="error"?C:C==="expired"||C==="expiring"?"expired" Line truncated
`)),e.options=Object.assign({},e.options,j.options),e.options.expirationDate=j.options&&j.options.expirationDate?new Date(j.options.expirationDate):u(),A&&A()})}function g(A,V,j){e.anonymize&&e.anonymize[A]&&e.anonymize[A].setValidity(V,j)}function f(A){try{let V=parseGithubUrl(A);if(V&&V.owner&&V.repo)return V.owner+"/"+V.repo}catch{}return null}function w(){return!e.isUpdate||!e._originalRepositoryID?void 0:f(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}v(()=>{r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async A=>{e.sourceUrl="https://github.com/"+A.data.source.fullName,e._originalFullName=A.data.source.fullName,e.terms=A.data.options.terms.filter(V=>V).join(`
`),e.source=A.data.source,e.role=A.data.role||"owner",e.coauthors=A.data.coauthors||[],e._originalBranch=A.data.source.branch,e.options=Object.assign({},e.options,A.data.options),e.conference=A.data.conference,e.repositoryID=A.data.source.repositoryID,e._originalRepositoryID=A.data.source.repositoryID,A.data.options.expirationDate&&(e.options.expirationDate=new Date(A.data.options.expirationDate)),await Promise.all([k(),b()]),I()},()=>{n.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async A=>{e.sourceUrl="https://github.com/"+A.data.source.repositoryFullName+"/pull/"+A.data.source.pullRequestId,e.terms=A.data.options.terms.filter(V=>V).join(`
`),e.source=A.data.source,e.options=Object.assign({},e.options,A.data.options),e.conference=A.data.conference,A.data.options.expirationDate&&(e.options.expirationDate=new Date(A.data.options.expirationDate));try{e.details=(await t.get(`/api/pr/${A.data.source.repositoryFullName}/${A.data.source.pullRequestId}`)).data}catch(V){let j=V&&V.data&&V.data.error;j&&(i("ERRORS."+j).then(Z=>{e.addToast({title:"Error",date:new Date,body:Z}),e.error=Z},console.error),ae(j))}},()=>{n.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async A=>{e.sourceUrl="https://gist.github.com/"+A.data.source.gistId,e.terms=A.data.options.terms.filter(V=>V).join(`
`),e.source=A.data.source,e.options=Object.assign({},e.options,A.data.options),e.conference=A.data.conference,A.data.options.expirationDate&&(e.options.expirationDate=new Date(A.data.options.expirationDate)),e.details=(await t.get(`/api/gist/source/${A.data.source.gistId}`)).data},()=>{n.url("/404")}))}),e.urlSelected=async()=>{e.terms=e.defaultTerms,e.isUpdate||(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],e.source={type:"GitHubStream",branch:"",commit:""},e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null;let A;try{A=parseGithubUrl(e.sourceUrl)}catch{g("sourceUrl","github",!1);return}g("sourceUrl","github",!0);try{A.gistId&&!A.repo?(e.detectedType="gist",e.source={gistId:A.gistId},await K()):A.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:A.owner+"/"+A.repo,pullRequestId:A.pullRequestId},await C()):(e.detectedType="repo",await Promise.all([k(),b()]),I())}catch{return}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let A=e.branches.filter(j=>j.name==e.source.branch)[0];if(!A)return;e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit||(e.source.commit=A.commit),e.readme=A.readme,await b(),I()}),e.getBranches=async A=>{let V=parseGithubUrl(e.sourceUrl);try{let j=await t.get(`/api/repo/${V.owner}/${V.repo}/branches`,{params:{force:A===!0?"1":"0",repositoryID:w()}});e.branches=j.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let Z=e.branches.filter(oe=>oe.name==e.source.branch);Z.length>0&&(!A&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit||(e.source.commit=Z[0].commit),e.readme=Z[0].readme,await b(A))}catch(j){e.branches=[],e.sourceUnreachable=j&&(j.status===404||j.data&&j.data.error==="repo_not_found");let Z=j&&j.data&&j.data.error||(j&&j.status===404?"repo_not_found":"unknown_error");i("ERRORS."+Z).then(oe=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:oe}),e.error=oe},console.error),typeof g=="function"&&g("sourceUrl","missing",!1)}};async function k(){let A=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/repo/${A.owner}/${A.repo}/`,{params:{repositoryID:w(),force:"1"}});e.details=V.data,e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches()}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}async function b(A){if(e.readme&&!A)return e.readme;let V=parseGithubUrl(e.sourceUrl);try{let j=await t.get(`/api/repo/${V.owner}/${V.repo}/readme`,{params:{force:A===!0?"1":"0",branch:e.source.branch,repositoryID:w()}});e.readme=j.data}catch{e.readme=""}}function R(){let A={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(A.branchName=e.source.branch);try{let V=parseGithubUrl(e.sourceUrl);A.repoName=`${V.owner}/${V.repo}`}catch{}return A}function N(A,V){let j=null,Z=0;return function(){j&&a.cancel(j),j=a(()=>{j=null;let qe=++Z,ze=A();ze&&t.post("/api/anonymize-preview",ze).then(Fe=>{qe===Z&&V(Fe.data)},()=>{})},200)}}let D=N(()=>e.readme?{content:e.readme,options:R()}:null,A=>{e.anonymize_readme=A.content||"";let V="";try{let Z=parseGithubUrl(e.sourceUrl),oe=e.source.branch||e.details&&e.details.defaultBranch||"main";V=`https://github.com/${Z.owner}/${Z.repo}/raw/${oe}/`}catch{}let j=renderMD(e.anonymize_readme,V);e.html_readme=j,a(Prism.highlightAll,150)});function I(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),D())}async function C(){let A=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/pr/${A.owner}/${A.repo}/${A.pullRequestId}`);e.details=V.data,e.pullRequestId||(e.pullRequestId=A.repo+"-PR"+A.pullRequestId+"-"+generateRandomId(4))}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}let O=Ue(new Map),P=new Set;function ee(){let A=new Set,V=e.details&&e.details.pullRequest;if(!V)return A;typeof V.title=="string"&&A.add(V.title),typeof V.body=="string"&&A.add(V.body),typeof V.diff=="string"&&A.add(V.diff);let j=V.comments||[];for(let Z of j)typeof Z.author=="string"&&A.add(Z.author),typeof Z.body=="string"&&A.add(Z.body);return A}let J=N(()=>{let A=ee();P=A;let V=Array.from(A);return V.length===0?null:{contents:V,options:R()}},A=>{if(!A||!Array.isArray(A.contents))return;let V=Array.from(P),j=new Map;for(let Z=0;Z<V.length&&Z<A.contents.length;Z++)j.set(V[Z],A.contents[Z]);O.clear(),j.forEach((Z,oe)=>O.set(oe,Z))});e.anonymizePrContent=function(A){return A&&(O.has(A)?O.get(A):(P.has(A)||J(),A))};async function K(){let A=parseGithubUrl(e.sourceUrl);try{he();let V=await t.get(`/api/gist/source/${A.gistId}`);e.details=V.data,e.gistId||(e.gistId="gist-"+A.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),ae(V.data.error)),g("sourceUrl","missing",!1),V}}let U=Ue(new Map),de=new Set;function se(){let A=new Set,V=e.details&&e.details.gist;if(!V)return A;typeof V.description=="string"&&A.add(V.description),typeof V.ownerLogin=="string"&&A.add(V.ownerLogin);let j=V.files||[];for(let oe of j)typeof oe.filename=="string"&&A.add(oe.filename),typeof oe.content=="string"&&A.add(oe.content);let Z=V.comments||[];for(let oe of Z)typeof oe.author=="string"&&A.add(oe.author),typeof oe.body=="string"&&A.add(oe.body);return A}let ie=N(()=>{let A=se();de=A;let V=Array.from(A);return V.length===0?null:{contents:V,options:R()}},A=>{if(!A||!Array.isArray(A.contents))return;let V=Array.from(de),j=new Map;for(let Z=0;Z<V.length&&Z<A.contents.length;Z++)j.set(V[Z],A.contents[Z]);U.clear(),j.forEach((Z,oe)=>U.set(oe,Z)),ce()});e.anonymizeGistContent=function(A){return A&&(U.has(A)?U.get(A):(de.has(A)||ie(),A))},e.previewGistFiles=[];function ce(){let A=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=A.map(V=>({filename:e.anonymizeGistContent(V.filename),content:e.anonymizeGistContent(V.content),language:V.language}))}e.watch("details.gist.files",ce,!0),e.watch("terms",ce);function we(){e.conference&&t.get("/api/conferences/"+e.conference).then(A=>{e.conference_data=A.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),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.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link},()=>{e.conference_data=null})}function he(){g("repoId","used",!0),g("repoId","format",!0),g("pullRequestId","used",!0),g("pullRequestId","format",!0),g("gistId","used",!0),g("gistId","format",!0),g("sourceUrl","used",!0),g("sourceUrl","missing",!0),g("sourceUrl","access",!0),g("sourceUrl","github",!0),g("commit","exists",!0),g("conference","activated",!0),g("terms","format",!0),e.termsRegexWarning=!1}function me(){let A=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||A&&A.invalid?(A&&A.setDirty&&A.setDirty(),e.error="Please choose a valid expiration date.",!0):!1}function ae(A){let V=e.detectedType==="pr"?"pullRequestId":e.detectedType==="gist"?"gistId":"repoId";switch(A){case"repoId_already_used":g(V,"used",!1);break;case"invalid_repoId":g(V,"format",!1);break;case"options_not_provided":g(V,"format",!1);break;case"repo_already_anonymized":g("sourceU Line truncated
`).filter(oe=>oe),fullName:`${V.owner}/${V.repo}`,repository:e.sourceUrl,options:e.options,source:e.source,conference:e.conference};e.details&&(j.options.pageSource=e.details.pageSource),he();let Z=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/status/"+e.repoId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(qe=>{e.error=qe},console.error),ae(oe.data.error))}).finally(()=>{A.target.disabled=!1})},e.anonymizeGist=A=>{if(me())return;A.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),j={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(oe=>oe),source:{gistId:V.gistId},options:e.options,conference:e.conference};he();let Z=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/gist/"+e.gistId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(qe=>{e.error=qe},console.error),ae(oe.data.error))}).finally(()=>{A.target.disabled=!1})},e.anonymizePullRequest=A=>{if(me())return;A.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),j={pullRequestId:e.pullRequestId,terms:e.terms.trim().split(`
`).filter(oe=>oe),source:{repositoryFullName:`${V.owner}/${V.repo}`,pullRequestId:V.pullRequestId},options:e.options,conference:e.conference};he();let Z=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(Z,j,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/pr/"+e.pullRequestId},oe=>{oe.data&&(i("ERRORS."+oe.data.error).then(qe=>{e.error=qe},console.error),ae(oe.data.error))}).finally(()=>{A.target.disabled=!1})},e.watch("conference",()=>{we()}),e.watch("terms",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("options.image",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("options.link",()=>{e.detectedType==="repo"&&I(),e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()}),e.watch("details",()=>{e.detectedType==="pr"&&J(),e.detectedType==="gist"&&ie()},!0)},Yo=function(e,t,o,r,n,i){let a=mt(),u=as(),p=0,h=!1;e.on("dispose",()=>{h=!0,p++,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(U){if((U.metaKey||U.ctrlKey)&&U.key==="k"){U.preventDefault();var de=document.querySelector(".tree-search-input");de&&(de.focus(),de.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let U=e.fileSearchQuery;if(!U||U.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let de=i.defer();v=de,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(U)}`,{timeout:de.promise}).then(function(se){if(!(h||v!==de)){v=null,e.fileSearchLoading=!1;var ie={};e.files.forEach(function(F){ie[(F.path||"")+"/"+F.name]=!0});for(var ce=[],we={},he=0;he<se.data.length;he++){var me=se.data[he];if(me.path)for(var ae=me.path.split("/"),A="",V=0;V<ae.length;V++){var j=A;A=A?A+"/"+ae[V]:ae[V];var Z=j+"/"+ae[V];!ie[Z]&&!we[Z]&&(we[Z]=!0,ce.push({name:ae[V],path:j}))}}ce.sort(function(F,ne){return(F.path||"").split("/").length-(ne.path||"").split("/").length}),ce.length>0&&e.files.push.apply(e.files,ce);for(var oe=[],qe=0;qe<se.data.length;qe++){var ze=se.data[qe],Fe=(ze.path||"")+"/"+ze.name;!ie[Fe]&&ze.size!=null&&(oe.push(ze),ie[Fe]=!0)}oe.length>0&&e.files.push.apply(e.files,oe),e.fileSearchResults=se.data}},function(){!h&&v===de&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let g={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},f=["license","txt"],w=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],k=["wav","mp3","ogg","wma","flac","aac","m4a"],b=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(U,de){if(e.repoId!=r.repoId)return K();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(se=>se&&se.trim().length>0),J();for(let se=0;se<e.paths.length-1;se++){let ie=se>0?e.paths.slice(0,se).join("/"):"";e.files.some(we=>we.path===ie)||e.getFiles(ie)}}});function R(){if(e.paths[0]!="")return;let U=["readme.md","readme.txt","readme.org","readme.1st","readme"],de={};for(let ie of e.files)ie.name.toLowerCase().indexOf("readme")>-1&&(de[ie.name.toLowerCase()]=ie.name);let se=null;for(let ie of U)if(de[ie]){se=ie;break}if(!se&&Object.keys(de).length>0&&(se=Object.keys(de)[0]),se){let ie=o.url();ie[ie.length-1]!="/"&&(ie+="/"),o.url(ie+encodePathForUrl(de[se]))}}e.fileCounts=null,e.getFiles=function(U){let de=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(U)}&v=${e.options.lastUpdateDate}`).then(function(se){if(h||de!==e.repoId)return[];let ie=U||"";return e.files=e.files.filter(ce=>ce.path!==ie),e.files.push(...se.data),se.data},function(se){if(h||de!==e.repoId)return[];e.type="error",e.content=se&&se.data&&se.data.error||"unknown_error",e.files=[]})};function N(){let U=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(de){h||U!==e.repoId||(e.fileCounts=de.data)},function(){e.fileCounts={}})}function D(){return e.files.filter(U=>U.name==e.paths[e.paths.length-1]&&U.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var I=null;e.on("dispose",function(){I&&a.interval.cancel(I)});function C(U){if(h)return;let de=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(se=>{if(!(h||de!==e.repoId)){if(e.options=se.data,e.options.url){window.location=e.options.url;return}U&&U(se.data)}},se=>{if(!(h||de!==e.repoId)){var ie=se.data||{};if(ie.error==="rate_limited"&&ie.resetAt){let we=function(){var he=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(he<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,I&&(a.interval.cancel(I),I=null),C(U);else{var me=Math.floor(he/60),ae=he%60;e.rateLimitCountdown=me>0?me+"m "+ae+"s":ae+"s"}};var ce=we;e.type="rate_limited",e.rateLimitResetAt=ie.resetAt,I&&a.interval.cancel(I),we(),I=a.interval(we,1e3)}else ie.error==="repository_no Line truncated
`+b.join(`
`)],{type:"text/csv"}),N=document.createElement("a");N.href=URL.createObjectURL(R),N.download=r.username+"-repositories.csv",N.click()},e.showStatusMessage=f=>{let w=f.statusMessage||"(no message)";window.prompt(`Status message for ${f.repoId} (${f.status}):`,w)},e.fetchGithubInfo=f=>{let w=window.open("","_blank");w&&w.document.write("<pre>Loading GitHub info for "+f.repoId+"...</pre>"),t.get("/api/admin/repos/"+f.repoId+"/github").then(k=>{w&&(w.document.open(),w.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(k.data,null,2).replace(/[<>]/g,b=>b==="<"?"&lt;":"&gt;")+"</pre>"),w.document.close())},k=>{let b=k&&k.data?JSON.stringify(k.data,null,2):String(k);w&&(w.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+b+"</pre>")})};function p(f){t.get("/api/admin/users/"+f+"/repos",{}).then(w=>{e.repositories=w.data},w=>{console.error(w)})}function h(f){t.get("/api/admin/users/"+f,{}).then(w=>{e.userInfo=w.data},w=>{console.error(w)})}h(r.username),p(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(),w=>console.error(w))},e.removeCache=f=>{confirm("Remove cached files for "+f.repoId+"?")&&t.delete("/api/admin/repos/"+f.repoId).then(()=>p(r.username),w=>console.error(w))},e.removeRepository=f=>{confirm("Remove repository "+f.repoId+"?")&&t.delete("/api/repo/"+f.repoId+"/").then(()=>p(r.username),w=>console.error(w))},e.updateRepository=f=>{let w=Ue({title:`Refreshing ${f.repoId}...`,date:new Date,body:`The repository ${f.repoId} is going to be refreshed.`});e.toasts.push(w),t.post(`/api/repo/${f.repoId}/refresh`).then(k=>{k.data.status=="ready"?w.title=`${f.repoId} is refreshed.`:w.title=`Refreshing of ${f.repoId}.`},k=>{w.title=`Error during the refresh of ${f.repoId}.`,w.body=k.body})},e.getGitHubRepositories=f=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(w=>{e.userInfo.repositories=w.data})};let g=null;e.watch("query",()=>{n.timeout.cancel(g),g=n.timeout(()=>{p(r.username)},500)},!0)},La=function(e,t,o){let r=mt(),n=as();e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=k=>{if(k.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){k.preventDefault();let b=document.querySelector('.admin-filter-toolbar input[type="search"]');b&&b.focus()}};n(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=k=>{k==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[k]="",e.query.page=1},e.chips=[];let a=()=>{let k=[];(e.query.dateFrom||e.query.dateTo)&&k.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=k};e.statusCountFor=k=>{let b=(e.statusCounts||[]).find(R=>R._id===k);return b?b.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=k=>{e.query.sort===k?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=k,e.query.direction="desc"),e.query.page=1},e.sortIcon=k=>e.query.sort===k?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",p={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({},p,h,{page:1,search:""});let v=o.search();v.search&&(e.query.search=v.search);let g="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(g)||"[]"),e.savePreset=()=>{let k=window.prompt("Preset name:");if(!k)return;let b=Object.assign({},e.query);delete b.page,e.presets=(e.presets||[]).filter(R=>R.name!==k),e.presets.push({name:k,query:b}),localStorage.setItem(g,JSON.stringify(e.presets))},e.applyPreset=k=>{Object.assign(e.query,k.query,{page:1})},e.deletePreset=k=>{e.presets=(e.presets||[]).filter(b=>b.name!==k.name),localStorage.setItem(g,JS Line truncated
`).map((he,me)=>me===0?he:we+he).join(`
`)}else typeof K=="number"||typeof K=="boolean"?ce=String(K):ce=JSON.stringify(K);ee.push(`${se}${ce}${ie}`)}),ee.push("}"),ee.join(`
`)}function h(S){let D=[],I="",C=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,A=0,q;for(;q=C.exec(S);)I+=S.slice(A,q.index),A=C.lastIndex,D.push({key:q[1],op:q[2]||"=",val:q[3]});return I+=S.slice(A),{filters:D,free:I.trim().toLowerCase()}}function v(S,D){for(let I of D.filters){let C=(q,ee,J)=>{let K=parseFloat(q),U=parseFloat(ee);return J==="="?String(q)===String(ee):J==="!="?String(q)!==String(ee):J===">="?K>=U:J==="<="?K<=U:J===">"?K>U:J==="<"?K<U:!0},A;if(I.key==="code")A=S.displayMessage;else if(I.key==="module")A=S.module;else if(I.key==="status")A=S._status;else if(I.key==="url")A=S._url;else if(I.key==="repo")A=S._repoId;else if(I.key==="level")A=S.level;else continue;if(A==null||!C(A,I.val,I.op))return!1}return!(D.free&&((S.displayMessage||"")+" "+(S.module||"")+" "+(S._url||"")+" "+JSON.stringify(S.raw||[])).toLowerCase().indexOf(D.free)===-1)}function g(){let S=h(e.query.search||"");e.parsedFilterCount=S.filters.length;let D=e.query.bucket,I=e.entries.filter(A=>D&&A._bucket!==D?!1:v(A,S)),C=e.query.group;if(C){let A=J=>C==="module"?J.module:J.displayMessage||J.message||"_",q=new Map;for(let J of I){let K=A(J);if(q.has(K)){let U=q.get(K);U.count++,U._related.push(J),new Date(J.ts)>new Date(U.ts)&&(U.ts=J.ts,U._url=J._url,U._status=J._status),new Date(J.ts)<new Date(U._firstSeen)&&(U._firstSeen=J.ts)}else{let U=Object.assign({},J);U._key=`${C}:${K}`,U._related=[J],U._firstSeen=J.ts,U._lastHourCount=0,U.count=1,q.set(K,U)}}let ee=Date.now()-3600*1e3;for(let J of q.values())J._lastHourCount=J._related.filter(K=>new Date(K.ts).getTime()>=ee).length;I=Array.from(q.values())}else I=I.map((A,q)=>(A._key="row:"+q+":"+A.ts,A._related=[A],A._firstSeen=A.ts,A._lastHourCount=0,A.count=1,A));e.query.sort==="count"?I.sort((A,q)=>q.count-A.count||new Date(q.ts)-new Date(A.ts)):I.sort((A,q)=>new Date(q.ts)-new Date(A.ts)),e.visible=I}function f(S){let D=S?e.entries.length:0,I=S?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:D,limit:I}}).then(C=>{let A=(C.data.entries||[]).map(u);e.entries=S?e.entries.concat(A):A,e.available=!!C.data.available,e.cap=C.data.max||e.cap,e.total=C.data.total||e.entries.length,g()},C=>console.error(C))}e.loadMore=()=>f(!0),e.canLoadMore=()=>e.entries.length<e.total;function b(){t.get("/api/admin/errors/stats").then(S=>{let D=S.data||{},I=D.prev24h?Math.round((D.last24h-D.prev24h)/D.prev24h*100):0;e.stats={last24h:D.last24h||0,prev24h:D.prev24h||0,delta:I,severity:D.severity||{error:0,warn:0,info:0},unique:D.unique||{error:0,warn:0,info:0},buckets:D.buckets||[],dropped:D.dropped||0}},S=>console.error(S))}function _(){f(),b()}e.barPx=(S,D)=>{let I=e.stats.buckets||[],C=0;for(let J of I)C=Math.max(C,(J.error||0)+(J.warn||0)+(J.info||0));if(!C)return 0;let A=(S.error||0)+(S.warn||0)+(S.info||0);if(!A)return 0;let q=Math.round(A/C*60),ee=S[D]||0;return Math.round(ee/A*q)},e.bucketTitle=S=>`${new Date(S.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${S.error||0} err \xB7 ${S.warn||0} warn \xB7 ${S.info||0} info`,e.toggle=S=>{e.expanded[S._key]=!e.expanded[S._key]},e.setBucket=S=>{e.query.bucket=S},e.refreshNow=_,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(_,S=>console.error(S))},e.exportCsv=()=>{let S=["ts","level","module","displayMessage","_status","_url","_repoId"],D=[S.join(",")];for(let q of e.visible)D.push(S.map(ee=>{let J=q[ee]==null?"":String(q[ee]);return/[",\n]/.test(J)?`"${J.replace(/"/g,'""')}"`:J}).join(","));let I=new Blob([D.join(`
`)],{type:"text/csv;charset=utf-8"}),C=URL.createObjectURL(I),A=document.createElement("a");A.href=C,A.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(C)};function k(S){e.copyHint=`${S} copied`,n.timeout(()=>{e.copyHint=""},1500)}e.copyJson=S=>{navigator.clipboard.writeText(S._detailJson).then(()=>k("JSON"))},e.copyCurl=S=>{if(!S._url)return;let I=`curl -X ${S._method||"GET"} '${window.location.origin}${S._url}'`;navigator.clipboard.writeText(I).then(()=>k("curl"))},_();let R=r(()=>{e.query.autoRefresh&&_()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",g),e.watch("query.bucket",g),e.watch("query.sort",g),e.watch("query.group",g)},qa=function(e,t,o,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null){o.url("/");return}e.data=null,e.loading=!0,e.error=null;function n(f){if(f==null)return"\u2014";for(var b=["B","KB","MB","GB","TB"],_=0,k=f;k>=1024&&_<b.length-1;)k/=1024,_++;return k.toFixed(_>0?1:0)+" "+b[_]}e.humanBytes=n;function i(f){if(!f)return"\u2014";var b=Math.floor(f/86400),_=Math.floor(f%86400/3600),k=Math.floor(f%3600/60);return b>0?b+"d "+(_<10?"0":"")+_+"h":_>0?_+"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||[],_=0;_<b.length;_++)if(b[_]._id===f)return b[_].count;return 0},e.barPct=function(f){var b=e.data&&e.data.repos?e.data.repos.total:0;if(!b)return 0;var _=[f];f==="expired"&&_.push("expiring"),f==="removed"&&_.push("removing"),f==="preparing"&&_.push("download");var k=0;return _.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(_,k){var R=b[k-1]||{},S=Object.assign({},_);return S.dailyRepositories=k?Math.max(0,(_.nbRepositories||0)-(R.nbRepositories||0)):0,S.dailyUsers=k?Math.max(0,(_.nbUsers||0)-(R.nbUsers||0)):0,S.dailyPageViews=k?Math.max(0,(_.nbPageViews||0)-(R.nbPageViews||0)):0,S})}function p(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:p(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(_){(!h[_]||b[_]>h[_])&&(h[_]=b[_])})})},function(f){e.loading=!1,e.error=f.data&&f.data.error||"Failed to load overview"})}v();var g=r(v,3e4);e.on("dispose",function(){r.cancel(g)})};var Ma=[{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>_a(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)=>Ea(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)=>Bn(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)=>Bn(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)=>Bn(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)=>Ca(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Da(e,t.http,t.location)},{path:"/conference/new",template:"partials/newConference.htm",title:"New conference \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Go(e,t.http,t.location,t.params)},{path:"/conference/:conferenceId/edit",template:"partials/newConference.htm",title:"Edit conference \u2013 Anon Line truncated
anonymous_github`)])])])])]),m(" Limitations "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-exclamation-triangle mr-2"}),y("Limitations ")]),s("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[s("div",{class:"panel-body p-3"},[s("ul",null,[s("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),s("li",null," Files larger than 8 MB are not supported. "),s("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),s("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). ")])])])])]),m(" Privacy & Security "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-shield-alt mr-2"}),y("Privacy & Security ")]),s("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[s("div",{class:"panel-body p-3"},[s("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. ")])])]),s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[s("div",{class:"panel-body p-3"},[s("p",null," Anonymous GitHub only reads your repositories \u2014 it never pushes commits, opens issues, modifies settings, or deletes anything. From your perspective as a user, the service is read-only. "),s("p",null,[y(" However, GitHub's OAuth scopes do not offer a read-only option for private repositories: the only scope that grants access to private repos is "),s("code",null,"repo"),y(", which is documented as full read/write access. To support users who want to anonymize a private repository, Anonymous GitHub must request that scope, and GitHub then displays the broader permission text at sign-in. The application itself only ever performs read operations against the GitHub API. ")]),s("p",null,[y(" If you only anonymize public repositories, the source code is open and can be audited on the "),s("a",{href:"https://github.com/tdurieux/anonymous_github/",target:"_blank"},"GitHub repository"),y(", or you can self-host your own instance. ")])])])]),s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[s("div",{class:"panel-body p-3"},[s("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. ")])])])]),m(" Self-Hosting "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-server mr-2"}),y("Self-Hosting ")]),s("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[s("h3",{class:"panel-title"},[s("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-ho Line truncated
`)}function h(N){let D=[],I="",C=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,O=0,P;for(;P=C.exec(N);)I+=N.slice(O,P.index),O=C.lastIndex,D.push({key:P[1],op:P[2]||"=",val:P[3]});return I+=N.slice(O),{filters:D,free:I.trim().toLowerCase()}}function v(N,D){for(let I of D.filters){let C=(P,ee,J)=>{let K=parseFloat(P),U=parseFloat(ee);return J==="="?String(P)===String(ee):J==="!="?String(P)!==String(ee):J===">="?K>=U:J==="<="?K<=U:J===">"?K>U:J==="<"?K<U:!0},O;if(I.key==="code")O=N.displayMessage;else if(I.key==="module")O=N.module;else if(I.key==="status")O=N._status;else if(I.key==="url")O=N._url;else if(I.key==="repo")O=N._repoId;else if(I.key==="level")O=N.level;else continue;if(O==null||!C(O,I.val,I.op))return!1}return!(D.free&&((N.displayMessage||"")+" "+(N.module||"")+" "+(N._url||"")+" "+JSON.stringify(N.raw||[])).toLowerCase().indexOf(D.free)===-1)}function g(){let N=h(e.query.search||"");e.parsedFilterCount=N.filters.length;let D=e.query.bucket,I=e.entries.filter(O=>D&&O._bucket!==D?!1:v(O,N)),C=e.query.group;if(C){let O=J=>C==="module"?J.module:J.displayMessage||J.message||"_",P=new Map;for(let J of I){let K=O(J);if(P.has(K)){let U=P.get(K);U.count++,U._related.push(J),new Date(J.ts)>new Date(U.ts)&&(U.ts=J.ts,U._url=J._url,U._status=J._status),new Date(J.ts)<new Date(U._firstSeen)&&(U._firstSeen=J.ts)}else{let U=Object.assign({},J);U._key=`${C}:${K}`,U._related=[J],U._firstSeen=J.ts,U._lastHourCount=0,U.count=1,P.set(K,U)}}let ee=Date.now()-3600*1e3;for(let J of P.values())J._lastHourCount=J._related.filter(K=>new Date(K.ts).getTime()>=ee).length;I=Array.from(P.values())}else I=I.map((O,P)=>(O._key="row:"+P+":"+O.ts,O._related=[O],O._firstSeen=O.ts,O._lastHourCount=0,O.count=1,O));e.query.sort==="count"?I.sort((O,P)=>P.count-O.count||new Date(P.ts)-new Date(O.ts)):I.sort((O,P)=>new Date(P.ts)-new Date(O.ts)),e.visible=I}function f(N){let D=N?e.entries.length:0,I=N?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:D,limit:I}}).then(C=>{let O=(C.data.entries||[]).map(u);e.entries=N?e.entries.concat(O):O,e.available=!!C.data.available,e.cap=C.data.max||e.cap,e.total=C.data.total||e.entries.length,g()},C=>console.error(C))}e.loadMore=()=>f(!0),e.canLoadMore=()=>e.entries.length<e.total;function w(){t.get("/api/admin/errors/stats").then(N=>{let D=N.data||{},I=D.prev24h?Math.round((D.last24h-D.prev24h)/D.prev24h*100):0;e.stats={last24h:D.last24h||0,prev24h:D.prev24h||0,delta:I,severity:D.severity||{error:0,warn:0,info:0},unique:D.unique||{error:0,warn:0,info:0},buckets:D.buckets||[],dropped:D.dropped||0}},N=>console.error(N))}function k(){f(),w()}e.barPx=(N,D)=>{let I=e.stats.buckets||[],C=0;for(let J of I)C=Math.max(C,(J.error||0)+(J.warn||0)+(J.info||0));if(!C)return 0;let O=(N.error||0)+(N.warn||0)+(N.info||0);if(!O)return 0;let P=Math.round(O/C*60),ee=N[D]||0;return Math.round(ee/O*P)},e.bucketTitle=N=>`${new Date(N.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${N.error||0} err \xB7 ${N.warn||0} warn \xB7 ${N.info||0} info`,e.toggle=N=>{e.expanded[N._key]=!e.expanded[N._key]},e.setBucket=N=>{e.query.bucket=N},e.refreshNow=k,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(k,N=>console.error(N))},e.exportCsv=()=>{let N=["ts","level","module","displayMessage","_status","_url","_repoId"],D=[N.join(",")];for(let P of e.visible)D.push(N.map(ee=>{let J=P[ee]==null?"":String(P[ee]);return/[",\n]/.test(J)?`"${J.replace(/"/g,'""')}"`:J}).join(","));let I=new Blob([D.join(`
`)],{type:"text/csv;charset=utf-8"}),C=URL.createObjectURL(I),O=document.createElement("a");O.href=C,O.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(C)};function b(N){e.copyHint=`${N} copied`,n.timeout(()=>{e.copyHint=""},1500)}e.copyJson=N=>{navigator.clipboard.writeText(N._detailJson).then(()=>b("JSON"))},e.copyCurl=N=>{if(!N._url)return;let I=`curl -X ${N._method||"GET"} '${window.location.origin}${N._url}'`;navigator.clipboard.writeText(I).then(()=>b("curl"))},k();let R=r(()=>{e.query.autoRefresh&&k()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",g),e.watch("query.bucket",g),e.watch("query.sort",g),e.watch("query.group",g)},Ha=function(e,t,o,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null){o.url("/");return}e.data=null,e.loading=!0,e.error=null;function n(f){if(f==null)return"\u2014";for(var w=["B","KB","MB","GB","TB"],k=0,b=f;b>=1024&&k<w.length-1;)b/=1024,k++;return b.toFixed(k>0?1:0)+" "+w[k]}e.humanBytes=n;function i(f){if(!f)return"\u2014";var w=Math.floor(f/86400),k=Math.floor(f%86400/3600),b=Math.floor(f%3600/60);return w>0?w+"d "+(k<10?"0":"")+k+"h":k>0?k+"h "+(b<10?"0":"")+b+"m":b+"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 w=e.data.repos.statusBreakdown||[],k=0;k<w.length;k++)if(w[k]._id===f)return w[k].count;return 0},e.barPct=function(f){var w=e.data&&e.data.repos?e.data.repos.total:0;if(!w)return 0;var k=[f];f==="expired"&&k.push("expiring"),f==="removed"&&k.push("removing"),f==="preparing"&&k.push("download");var b=0;return k.forEach(function(R){b+=e.statusCount(R)}),Math.max(.4,b/w*100)},e.errPct=function(f){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[f]/w*100};function u(f){var w=f||[];return w.map(function(k,b){var R=w[b-1]||{},N=Object.assign({},k);return N.dailyRepositories=b?Math.max(0,(k.nbRepositories||0)-(R.nbRepositories||0)):0,N.dailyUsers=b?Math.max(0,(k.nbUsers||0)-(R.nbUsers||0)):0,N.dailyPageViews=b?Math.max(0,(k.nbPageViews||0)-(R.nbPageViews||0)):0,N})}function p(f){var w=f&&f.length?f[f.length-1]:{};return{repositories:w.dailyRepositories||0,users:w.dailyUsers||0,pageViews:w.dailyPageViews||0}}var h={};e.historyBarH=function(f,w){return!f||!h[w]?0:Math.max(1,Math.round(f[w]/h[w]*140))},e.historyLabel=function(f){if(!f||!f.date)return"";var w=new Date(f.date);return w.getUTCMonth()+1+"/"+w.getUTCDate()};function v(){t.get("/api/admin/overview").then(function(f){f.data.history=u(f.data.history),f.data.daily={today:p(f.data.history)},e.data=f.data,e.loading=!1,e.error=null,h={},(f.data.history||[]).forEach(function(w){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(k){(!h[k]||w[k]>h[k])&&(h[k]=w[k])})})},function(f){e.loading=!1,e.error=f.data&&f.data.error||"Failed to load overview"})}v();var g=r(v,3e4);e.on("dispose",function(){r.cancel(g)})};var Ba=[{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>Ta(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)=>Oa(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)=>Yn(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)=>Yn(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)=>Yn(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)=>Aa(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Pa(e,t.http,t.location)},{path:"/conference/new",template:"partials/newConference.htm",title:"New conference \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>xo(e,t.http,t.location,t.params)},{path:"/conference/:conferenceId/edit",template:"partials/newConference.htm",title:"Edit conference \u2013 Anon Line truncated
anonymous_github`)])])])])]),m(" Limitations "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-exclamation-triangle mr-2"}),y("Limitations ")]),s("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[s("div",{class:"panel-body p-3"},[s("ul",null,[s("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),s("li",null," Files larger than 8 MB are not supported. "),s("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),s("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). ")])])])])]),m(" Privacy & Security "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-shield-alt mr-2"}),y("Privacy & Security ")]),s("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[s("div",{class:"panel-body p-3"},[s("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. ")])])]),s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[s("div",{class:"panel-body p-3"},[s("p",null," Anonymous GitHub only reads your repositories \u2014 it never pushes commits, opens issues, modifies settings, or deletes anything. From your perspective as a user, the service is read-only. "),s("p",null,[y(" However, GitHub's OAuth scopes do not offer a read-only option for private repositories: the only scope that grants access to private repos is "),s("code",null,"repo"),y(", which is documented as full read/write access. To support users who want to anonymize a private repository, Anonymous GitHub must request that scope, and GitHub then displays the broader permission text at sign-in. The application itself only ever performs read operations against the GitHub API. ")]),s("p",null,[y(" If you only anonymize public repositories, the source code is open and can be audited on the "),s("a",{href:"https://github.com/tdurieux/anonymous_github/",target:"_blank"},"GitHub repository"),y(", or you can self-host your own instance. ")])])])]),s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[s("h3",{class:"panel-title"},[s("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? ")])]),s("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[s("div",{class:"panel-body p-3"},[s("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. ")])])])]),m(" Self-Hosting "),s("h4",{class:"faq-cat"},[s("i",{class:"fas fa-server mr-2"}),y("Self-Hosting ")]),s("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[s("div",{class:"panel panel-default mb-3"},[s("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[s("h3",{class:"panel-title"},[s("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-ho 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]=s("li",{class:"nav-item d-none d-lg-block"},[s("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"},[s("i",{class:"fas fa-bug d-lg-none mr-1","aria-hidden":"true"}),y("Report a bug ")])],-1)),e.isDarkMode?m("v-if",!0):(l(),d("li",_T,[s("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]=ge(o=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[s("i",{class:"fas fa-moon","aria-hidden":"true"},null,-1)])])])),e.isDarkMode?(l(),d("li",ET,[s("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]=ge(o=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[s("i",{class:"fas fa-sun","aria-hidden":"true"},null,-1)])])])):m("v-if",!0),e.user?m("v-if",!0):(l(),d("li",CT,[...t[9]||(t[9]=[s("a",{class:"nav-link btn-signin",target:"_self",href:"/github/login","data-offset":"30"},[s("i",{class:"fab fa-github mr-1"}),y(" Sign in ")],-1)])])),e.user?(l(),d("li",NT,[s("a",ST,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,DT)):m("v-if",!0),s("span",RT,c(e.user?.username),1)]),s("div",TT,[s("h6",OT,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=_e('<a class="dropdown-item" href="/profile"><i class="fas fa-sliders-h" aria-hidden="true"></i><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/claim"><i class="fas fa-link" aria-hidden="true"></i><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"><i class="fas fa-bug" aria-hidden="true"></i><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><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><i class="fas fa-sign-out-alt" aria-hidden="true"></i><span>Sign out</span></a>',7))])])):m("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,AT)):m("v-if",!0)],64)}var IT={class:"paper-landing"},VT={class:"paper-hero"},PT={class:"paper-hero-copy"},qT={class:"paper-cta-row"},MT={key:0,href:"/github/login",target:"_self",class:"btn-hero"},$T={key:1,href:"/anonymize",class:"btn-hero"},FT={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},LT={class:"paper-stats-grid"},UT={class:"paper-stat-value"},zT={class:"paper-stat-label"},HT=["viewBox"],BT=["x","y","width","height"],GT={key:1,class:"paper-stat-delta"},jT={class:"paper-features paper-wrap","aria-label":"Product features"},WT={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},KT=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],YT={class:"paper-eyebrow"},xT={class:"paper-feature-title"},JT={class:"paper-feature-more"},QT={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},XT=["href","target"],ZT={class:"paper-features-stage"},eO=["id","aria-labelledby"],tO={class:"paper-frame"},sO={class:"paper-frame-bar","aria-hidden":"true"},nO={class:"url"},oO=["src","alt"],rO={class:"paper-footer"},iO={class:"paper-footer-inner"},aO={class:"paper-footer-col"},lO={key:0,href:"/dashboard"},dO={key:1,href:"/conferences"},uO={class:"paper-footer-foot"};function tl(e,t){return l(),d("div",IT,[m(" Hero: copy on the left, the product on the right "),s("section",VT,[s("div",PT,[t[2]||(t[2]=s("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=s("h1",{class:"hero-title"},[y(" Share the code,"),s("br"),s("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=s("p",{class:"hero-subtitle"}," Anonymous GitHub makes a read-only mirror of your repository, pull request, or gist with every trace of identity removed, so you can attach a link to your submission without breaking anonymity. ",-1)),s("div",qT,[e.user?m("v-if",!0):(l(),d("a",MT,[...t[0]||(t[0]=[s("i",{class:"fab fa-github mr-2","aria-hidden":"true"},null,-1),y("Sign in with GitHub ",-1)])])),e.user?(l(),d("a",$T," Anonymize a repository \u2192 ")):m("v-if",!0),t[1]||(t[1]=s("a",{class:"paper-link-arrow",target:"_self",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389 Line truncated
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=s("li",{class:"nav-item d-none d-lg-block"},[s("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"},[s("i",{class:"fas fa-bug d-lg-none mr-1","aria-hidden":"true"}),y("Report a bug ")])],-1)),e.isDarkMode?m("v-if",!0):(l(),d("li",IT,[s("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]=be(o=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[s("i",{class:"fas fa-moon","aria-hidden":"true"},null,-1)])])])),e.isDarkMode?(l(),d("li",VT,[s("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]=be(o=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[s("i",{class:"fas fa-sun","aria-hidden":"true"},null,-1)])])])):m("v-if",!0),e.user?m("v-if",!0):(l(),d("li",PT,[...t[9]||(t[9]=[s("a",{class:"nav-link btn-signin",target:"_self",href:"/github/login","data-offset":"30"},[s("i",{class:"fab fa-github mr-1"}),y(" Sign in ")],-1)])])),e.user?(l(),d("li",qT,[s("a",MT,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,$T)):m("v-if",!0),s("span",FT,c(e.user?.username),1)]),s("div",LT,[s("h6",UT,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=Ee('<a class="dropdown-item" href="/profile"><i class="fas fa-sliders-h" aria-hidden="true"></i><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/claim"><i class="fas fa-link" aria-hidden="true"></i><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"><i class="fas fa-bug" aria-hidden="true"></i><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><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><i class="fas fa-sign-out-alt" aria-hidden="true"></i><span>Sign out</span></a>',7))])])):m("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,zT)):m("v-if",!0)],64)}var HT={class:"paper-landing"},BT={class:"paper-hero"},GT={class:"paper-hero-copy"},jT={class:"paper-cta-row"},WT={key:0,href:"/github/login",target:"_self",class:"btn-hero"},KT={key:1,href:"/anonymize",class:"btn-hero"},YT={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},xT={class:"paper-stats-grid"},JT={class:"paper-stat-value"},QT={class:"paper-stat-label"},XT=["viewBox"],ZT=["x","y","width","height"],eO={key:1,class:"paper-stat-delta"},tO={class:"paper-features paper-wrap","aria-label":"Product features"},sO={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},nO=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],oO={class:"paper-eyebrow"},rO={class:"paper-feature-title"},iO={class:"paper-feature-more"},aO={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},lO=["href","target"],dO={class:"paper-features-stage"},uO=["id","aria-labelledby"],cO={class:"paper-frame"},pO={class:"paper-frame-bar","aria-hidden":"true"},fO={class:"url"},mO=["src","alt"],hO={class:"paper-footer"},vO={class:"paper-footer-inner"},yO={class:"paper-footer-col"},gO={key:0,href:"/dashboard"},bO={key:1,href:"/conferences"},wO={class:"paper-footer-foot"};function ll(e,t){return l(),d("div",HT,[m(" Hero: copy on the left, the product on the right "),s("section",BT,[s("div",GT,[t[2]||(t[2]=s("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=s("h1",{class:"hero-title"},[y(" Share the code,"),s("br"),s("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=s("p",{class:"hero-subtitle"}," Anonymous GitHub makes a read-only mirror of your repository, pull request, or gist with every trace of identity removed, so you can attach a link to your submission without breaking anonymity. ",-1)),s("div",jT,[e.user?m("v-if",!0):(l(),d("a",WT,[...t[0]||(t[0]=[s("i",{class:"fab fa-github mr-2","aria-hidden":"true"},null,-1),y("Sign in with GitHub ",-1)])])),e.user?(l(),d("a",KT," Anonymize a repository \u2192 ")):m("v-if",!0),t[1]||(t[1]=s("a",{class:"paper-link-arrow",target:"_self",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389 Line truncated
MIT CSAIL
jane.smith@example.org`},uV={id:"termsHelp",class:"form-text text-muted"},cV={class:"invalid-feedback"},pV={id:"settings-display",class:"paper-settings-section"},fV={class:"form-group paper-check-list"},mV={class:"form-check"},hV={class:"form-check-input",type:"checkbox",id:"link",name:"link"},vV={class:"form-check"},yV={class:"form-check-input",type:"checkbox",id:"image",name:"image"},gV={class:"form-check"},bV={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},wV={class:"form-check"},kV={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},_V={id:"settings-features",class:"paper-settings-section"},EV={class:"form-group paper-check-list"},CV={class:"form-check"},NV={class:"form-check-input",type:"checkbox",id:"page",name:"page"},SV={class:"form-check"},DV={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},RV={class:"form-check"},TV={class:"form-check-input",type:"checkbox",id:"update",name:"update"},OV={class:"form-group"},AV={class:"form-control",id:"mode",name:"mode"},IV={class:"form-text text-muted"},VV={id:"settings-expiration",class:"paper-settings-section"},PV={class:"form-group"},qV={class:"form-control",id:"expiration",name:"expiration"},MV={class:"paper-settings-footer"},$V={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},FV=["textContent"],LV={class:"paper-settings-actions"},UV=["disabled"],zV={key:0,class:"fas fa-check mr-1","aria-hidden":"true"},HV={id:"settings-account",class:"paper-settings-section"},BV={class:"paper-account-card"},GV=["src"],jV={class:"paper-account-identity"},WV={class:"paper-account-name"},KV={class:"paper-danger-zone"},YV={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},xV=["textContent"],JV=["disabled"];function il(e,t){let o=ye("paper-scrollspy"),r=ye("field"),n=ye("form");return l(),d("div",BI,[t[47]||(t[47]=_e('<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)),s("div",GI,[E((l(),d("aside",jI,[...t[2]||(t[2]=[_e('<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)])])),[[o]]),s("div",WI,[m(" Quota: same markup as the dashboard, driven by quotaService "),s("section",KI,[t[4]||(t[4]=s("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[5]||(t[5]=s("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(),d("div",YI,[(l(),d(x,null,re([{key:"repository",label:"Repositories",kind:"count"},{key:"storage",label:"Storage",kind:"bytes"},{key:"file",label:"Files",kind:"count"}],(i,a)=>s("div",xI,[s("div",JI,[s("span",QI,c(i?.label),1),i?.kind==="count"?(l(),d("span",XI,[y(c(e.fmt?.number(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("span",ZI," / "+c(e.fmt?.number(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",eV,"Unlimited")):m("v-if",!0)])):m("v-if",!0),i?.kind==="bytes"?(l(),d("span",tV,[y(c(e.fmt?.humanFileSize(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("span",sV," / "+c(e.fmt?.humanFileSize(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",nV,"Unlimited")):m("v-if",!0)])):m("v-if",!0)]),s("div",{class:T(["quota-track","quota-"+e.quota[i?.key].level]),role:"progressbar","aria-valuemin":"0","aria-label":i?.label+" quota","aria-valuenow":e.quota[i?.key].used,"aria-valuemax":e.quota[i?.key].unlimited?e.quota[i?.key].used:e.quota[i?.key].total,"aria-valuetext":e.quota[i?.key].unlimited?"unlimited":e.fmt.number(e.quota[i?.key].percent,0)+"% used"},[e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("div",{key:0,class:"quota-fill",style:Oe({width:e.quota[i?.key].percent+"%"})},null,4))],10,oV)])),64))])):m("v-if",!0),e.quota?m("v-if",!0):(l(),d("div",rV,[(l(),d(x,null,re([1,2,3],(i,a)=>s("div",iV,[...t[3]||(t[3]=[s("div",{class:"quota-header"},[s("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),s("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),s("div",{class:"quota-track"},null,-1)])])),64))]))]),E((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[0]||(t[0]=ge(i=>e.submitForm(i,()=>{e.saveDefault(i)}),["prevent"]))},[s("section",aV,[t[11]||(t[11]=s("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[12]||(t[12]=s("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),s("div",lV,[t[10]||(t[10]=s("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),E(s("tex Line truncated
`);for(let g=0;g<v.length;g++){let f=v[g];if(f.startsWith("diff --git")){h(),p();continue}if(f.startsWith("--- ")){i&&i.lines.length&&h(),p().oldPath=f.replace(/^--- (a\/)?/,"").trim();continue}if(f.startsWith("+++ ")){p().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)),p().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 o(n,i),n.join("")}})({trustAsHtml:e=>e});function a3(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function l3(e){return String(e??"").toUpperCase()}function d3(e,t,o=0){return(e||[]).slice(o,o+t)}function u3(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function c3(e,t){if(!t)return e||[];let o=Array.isArray(t)?t:[t];return[...e||[]].sort((r,n)=>{for(let i of o){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,v)=>h?.[v],r),p=i.split(".").reduce((h,v)=>h?.[v],n);if(typeof u=="string"&&(u=u.toLowerCase()),typeof p=="string"&&(p=p.toLowerCase()),u!==p)return(u==null?-1:p==null?1:u<p?-1:1)*a}return 0})}function p3(e,t){if(!e)return"";let o=new Date(e);if(isNaN(o))return String(e);if(!t||t==="mediumDate")return o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:o.getFullYear(),MMM:o.toLocaleDateString(void 0,{month:"short"}),MM:String(o.getMonth()+1).padStart(2,"0"),dd:String(o.getDate()).padStart(2,"0"),d:o.getDate(),HH:String(o.getHours()).padStart(2,"0"),mm:String(o.getMinutes()).padStart(2,"0"),ss:String(o.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,n=>r[n])}function f3(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var fl={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`},wV={id:"termsHelp",class:"form-text text-muted"},kV={class:"invalid-feedback"},_V={id:"settings-display",class:"paper-settings-section"},EV={class:"form-group paper-check-list"},CV={class:"form-check"},NV={class:"form-check-input",type:"checkbox",id:"link",name:"link"},SV={class:"form-check"},DV={class:"form-check-input",type:"checkbox",id:"image",name:"image"},RV={class:"form-check"},TV={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},OV={class:"form-check"},AV={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},IV={id:"settings-features",class:"paper-settings-section"},VV={class:"form-group paper-check-list"},PV={class:"form-check"},qV={class:"form-check-input",type:"checkbox",id:"page",name:"page"},MV={class:"form-check"},$V={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},FV={class:"form-check"},LV={class:"form-check-input",type:"checkbox",id:"update",name:"update"},UV={class:"form-group"},zV={class:"form-control",id:"mode",name:"mode"},HV={class:"form-text text-muted"},BV={id:"settings-expiration",class:"paper-settings-section"},GV={class:"form-group"},jV={class:"form-control",id:"expiration",name:"expiration"},WV={class:"paper-settings-footer"},KV={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},YV=["textContent"],xV={class:"paper-settings-actions"},JV=["disabled"],QV={key:0,class:"fas fa-check mr-1","aria-hidden":"true"},XV={id:"settings-account",class:"paper-settings-section"},ZV={class:"paper-account-card"},eP=["src"],tP={class:"paper-account-identity"},sP={class:"paper-account-name"},nP={class:"paper-danger-zone"},oP={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},rP=["textContent"],iP=["disabled"];function fl(e,t){let o=ge("paper-scrollspy"),r=ge("field"),n=ge("form");return l(),d("div",ZI,[t[47]||(t[47]=Ee('<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)),s("div",eV,[E((l(),d("aside",tV,[...t[2]||(t[2]=[Ee('<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)])])),[[o]]),s("div",sV,[m(" Quota: same markup as the dashboard, driven by quotaService "),s("section",nV,[t[4]||(t[4]=s("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[5]||(t[5]=s("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(),d("div",oV,[(l(),d(x,null,re([{key:"repository",label:"Repositories",kind:"count"},{key:"storage",label:"Storage",kind:"bytes"},{key:"file",label:"Files",kind:"count"}],(i,a)=>s("div",rV,[s("div",iV,[s("span",aV,c(i?.label),1),i?.kind==="count"?(l(),d("span",lV,[y(c(e.fmt?.number(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("span",dV," / "+c(e.fmt?.number(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",uV,"Unlimited")):m("v-if",!0)])):m("v-if",!0),i?.kind==="bytes"?(l(),d("span",cV,[y(c(e.fmt?.humanFileSize(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("span",pV," / "+c(e.fmt?.humanFileSize(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",fV,"Unlimited")):m("v-if",!0)])):m("v-if",!0)]),s("div",{class:T(["quota-track","quota-"+e.quota[i?.key].level]),role:"progressbar","aria-valuemin":"0","aria-label":i?.label+" quota","aria-valuenow":e.quota[i?.key].used,"aria-valuemax":e.quota[i?.key].unlimited?e.quota[i?.key].used:e.quota[i?.key].total,"aria-valuetext":e.quota[i?.key].unlimited?"unlimited":e.fmt.number(e.quota[i?.key].percent,0)+"% used"},[e.quota[i?.key].unlimited?m("v-if",!0):(l(),d("div",{key:0,class:"quota-fill",style:Ae({width:e.quota[i?.key].percent+"%"})},null,4))],10,mV)])),64))])):m("v-if",!0),e.quota?m("v-if",!0):(l(),d("div",hV,[(l(),d(x,null,re([1,2,3],(i,a)=>s("div",vV,[...t[3]||(t[3]=[s("div",{class:"quota-header"},[s("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),s("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),s("div",{class:"quota-track"},null,-1)])])),64))]))]),E((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[0]||(t[0]=be(i=>e.submitForm(i,()=>{e.saveDefault(i)}),["prevent"]))},[s("section",yV,[t[11]||(t[11]=s("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[12]||(t[12]=s("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),s("div",gV,[t[10]||(t[10]=s("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),E(s("tex Line truncated
`);for(let g=0;g<v.length;g++){let f=v[g];if(f.startsWith("diff --git")){h(),p();continue}if(f.startsWith("--- ")){i&&i.lines.length&&h(),p().oldPath=f.replace(/^--- (a\/)?/,"").trim();continue}if(f.startsWith("+++ ")){p().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 w=f.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);w&&(a=parseInt(w[1],10),u=parseInt(w[2],10)),p().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 o(n,i),n.join("")}})({trustAsHtml:e=>e});function y3(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function g3(e){return String(e??"").toUpperCase()}function b3(e,t,o=0){return(e||[]).slice(o,o+t)}function w3(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function k3(e,t){if(!t)return e||[];let o=Array.isArray(t)?t:[t];return[...e||[]].sort((r,n)=>{for(let i of o){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,v)=>h?.[v],r),p=i.split(".").reduce((h,v)=>h?.[v],n);if(typeof u=="string"&&(u=u.toLowerCase()),typeof p=="string"&&(p=p.toLowerCase()),u!==p)return(u==null?-1:p==null?1:u<p?-1:1)*a}return 0})}function _3(e,t){if(!e)return"";let o=new Date(e);if(isNaN(o))return String(e);if(!t||t==="mediumDate")return o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:o.getFullYear(),MMM:o.toLocaleDateString(void 0,{month:"short"}),MM:String(o.getMonth()+1).padStart(2,"0"),dd:String(o.getDate()).padStart(2,"0"),d:o.getDate(),HH:String(o.getHours()).padStart(2,"0"),mm:String(o.getMinutes()).padStart(2,"0"),ss:String(o.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,n=>r[n])}function E3(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var wl={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:
+7 -4
View File
@@ -47,15 +47,18 @@ describe("asset build", function () {
it("preserves script dependencies and CSS precedence and hashes completed assets", function () {
const result = build();
expect(result.status, result.stderr).to.equal(0);
for (const [bundle, group] of [["core", "coreJsFiles"], ["vendor", "vendorJsFiles"], ["mermaid", "mermaidFiles"]]) {
for (const [bundle, group] of [["core", "coreJsFiles"], ["markdown", "markdownFiles"], ["pdf", "pdfFiles"], ["editor", "editorFiles"], ["notebook", "notebookFiles"], ["org", "orgFiles"], ["mermaid", "mermaidFiles"]]) {
const context = { assetOrder: [] };
vm.runInNewContext(fs.readFileSync(path.join(directory, `public/script/${bundle}.min.js`), "utf8"), context);
expect(context.assetOrder).to.deep.equal(groups[group]);
if (bundle === "vendor") expect(context.appLoaded).to.equal(true);
}
expect(fs.readFileSync(path.join(directory, "public/css/all.min.css"), "utf8")).to.equal(".cascade{color:#00f}".repeat(groups.cssFiles.length - 1) + ".cascade{color:red}");
const manifest = JSON.parse(fs.readFileSync(path.join(directory, "public/asset-manifest.json"), "utf8"));
expect(Object.keys(manifest)).to.have.length(4);
expect(Object.keys(manifest)).to.have.length(9);
const appContext = {};
vm.runInNewContext(fs.readFileSync(path.join(directory, "public/script/vendor.min.js"), "utf8"), appContext);
expect(appContext.appLoaded).to.equal(true);
for (const [name, hashed] of Object.entries(manifest)) {
const content = fs.readFileSync(path.join(directory, "public", name.endsWith(".css") ? "css" : "script", name));
const hash = require("node:crypto").createHash("md5").update(content).digest("hex").slice(0, 10);
@@ -72,7 +75,7 @@ describe("asset build", function () {
});
it("fails on invalid JavaScript without publishing a manifest", function () {
fs.writeFileSync(path.join(directory, groups.vendorJsFiles[0]), "function {");
fs.writeFileSync(path.join(directory, groups.pdfFiles[0]), "function {");
const result = build();
expect(result.status).not.to.equal(0);
expect(result.stderr).to.include("uglify");
+28 -4
View File
@@ -1,5 +1,5 @@
const { expect } = require("chai");
const { JSDOM, VirtualConsole } = require("jsdom");
const { JSDOM, VirtualConsole, ResourceLoader } = require("jsdom");
const fs = require("fs");
const path = require("path");
const { URL } = require("node:url");
@@ -9,13 +9,22 @@ const publicDir = path.join(__dirname, "../public");
const bundles = ["core.min.js", "vendor.min.js"].map(name => fs.readFileSync(path.join(publicDir, "script", name), "utf8"));
async function browser(route = "/", overrides = {}) {
const errors = [], requests = [];
const errors = [], requests = [], assets = [];
const virtualConsole = new VirtualConsole();
virtualConsole.on("jsdomError", error => {
if (!error.message.includes("navigation (except hash changes)")) errors.push(error.message);
});
virtualConsole.on("error", error => errors.push(error?.message || String(error)));
const dom = new JSDOM('<!doctype html><html><head></head><body><div id="app"></div></body></html>', {
resources: new class extends ResourceLoader {
fetch(url) {
assets.push(new URL(url).pathname);
if (/\/pdf\.[a-f0-9]+\.min\.js$/.test(new URL(url).pathname) && dom.window.pdfjsLib) return Promise.resolve(Buffer.from(""));
const pathname = new URL(url).pathname.replace(/\.[a-f0-9]{10}\.min\.js$/, ".min.js");
if (pathname.startsWith("/script/")) return Promise.resolve(fs.readFileSync(path.join(publicDir, pathname)));
return null;
}
}(),
url: "http://localhost" + route, runScripts: "dangerously", pretendToBeVisual: true, virtualConsole,
});
const window = dom.window;
@@ -46,7 +55,7 @@ async function browser(route = "/", overrides = {}) {
await app.router.isReady();
await delay(30);
return {
window, app, errors, requests,
window, app, errors, requests, assets,
async go(path) { await app.router.push(path); await delay(30); },
async input(selector, value, event = "input") {
const input = window.document.querySelector(selector);
@@ -79,6 +88,21 @@ describe("Vue 3 UI", function () {
expect(ui.errors).to.deep.equal([]);
});
it("loads document libraries on demand and reuses them across navigation", async function () {
ui = await browser("/dashboard");
expect(ui.assets.filter(url => url.endsWith(".js"))).to.deep.equal([]);
await ui.go("/r/test/README.md");
expect(ui.assets.some(url => /\/markdown\./.test(url))).to.equal(true);
expect(ui.assets.some(url => /\/(pdf|editor|notebook)\./.test(url))).to.equal(false);
await ui.go("/faq");
await ui.go("/r/test/README.md");
expect(ui.assets.filter(url => /\/markdown\./.test(url))).to.have.length(1);
await ui.go("/r/test/hello.js");
expect(ui.assets.some(url => /\/editor\./.test(url))).to.equal(true);
expect(ui.window.document.querySelector(".ace_editor")).not.to.equal(null);
expect(ui.errors).to.deep.equal([]);
});
it("validates a claim, binds input values and renders server validation failures", async function () {
ui = await browser("/claim", { "/api/repo/claim": { __status: 404, body: {} } });
const form = ui.window.document.querySelector("form");
@@ -231,7 +255,7 @@ describe("Vue 3 UI", function () {
it("loads PDF pages, changes documents and releases the previous document", async function () {
ui = await browser("/faq");
const loaded = [], destroyed = [];
ui.window.pdfjsLib = { getDocument({ url }) {
ui.window.pdfjsLib = { GlobalWorkerOptions: {}, getDocument({ url }) {
loaded.push(url);
return { promise: Promise.resolve({
numPages: 2,