fix: make dashboard UI consistent and compact on mobile

This commit is contained in:
Thomas Durieux committed 2026-10-07 14:54:49 +00:00
1 parent adc9dbd439
commit 282efdc16e
52 files changed
+2177 -712

No files matched your search

+368 -125
View File
@@ -1,8 +1,21 @@
import { reactive } from "vue";
import { reactive, nextTick } from "vue";
import { createTimers, createListeners } from "./state.js";
import { formDraft } from "./drafts.js";
function previewTabKeydown(event) {
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
const tabs = [...event.currentTarget.closest('[role="tablist"]').querySelectorAll('[role="tab"]')];
const index = tabs.indexOf(event.currentTarget);
const next = event.key === "Home" ? 0 : event.key === "End" ? tabs.length - 1
: (index + (event.key === "ArrowRight" ? 1 : -1) + tabs.length) % tabs.length;
event.preventDefault();
tabs[next]?.focus();
tabs[next]?.click();
}
// Page setup functions run inside Vue effect scopes.
export const mainController = function (state, http, location, timeout) {
state.previewTabKeydown = previewTabKeydown;
state.title = "Main";
state.user = { status: "connection" };
state.site_options;
@@ -51,12 +64,6 @@ export const mainController = function (state, http, location, timeout) {
document.head.append(link);
$(`link[href='${darkPrismLink}']`).remove();
}
// Update Ko-fi floating button to match theme
var kofiBtn = document.querySelector(".floatingchat-container-wrap-mo498 .floating-chat-kofi-text-container-wrap");
if (kofiBtn) {
kofiBtn.style.backgroundColor = on ? "#FAF9F6" : "#1A1815";
kofiBtn.style.color = on ? "#1A1815" : "#FAF9F6";
}
state.emit("dark-mode", on);
};
@@ -111,7 +118,23 @@ export const mainController = function (state, http, location, timeout) {
};
export const faqController = function (state, http) {
const listen = createListeners();};
const listen = createListeners();
const timers = createTimers();
const revealAnswer = () => {
const id = window.location.hash.slice(1);
const answer = document.getElementById(id);
if (!answer?.classList.contains("panel-collapse")) return;
$(answer).collapse("show");
const heading = document.getElementById(answer.getAttribute("aria-labelledby"));
heading?.setAttribute("tabindex", "-1");
heading?.focus({ preventScroll: true });
heading?.scrollIntoView?.({ block: "start" });
};
// Router fragments do not emit hashchange, and answers mount after navigation.
state.on("routeUpdate", () => timers.timeout(revealAnswer, 0));
listen(window, "hashchange", revealAnswer);
timers.timeout(revealAnswer, 0);
};
export const profileController = function (state, http, translate, timeout, quotaService) {
state.terms = "";
@@ -132,6 +155,8 @@ export const profileController = function (state, http, translate, timeout, quot
state.quota = quota;
}, console.error);
const draft = formDraft(state, ["terms", "options"], "profile");
state.discardDraft = () => draft.discard();
function getDefault() {
http.get("/api/user/default").then((res) => {
const data = res.data || {};
@@ -139,6 +164,7 @@ export const profileController = function (state, http, translate, timeout, quot
state.terms = data.terms.join("\n");
}
state.options = Object.assign({}, state.options, data.options);
draft.restore();
});
}
getDefault();
@@ -146,6 +172,8 @@ export const profileController = function (state, http, translate, timeout, quot
let savedTimer = null;
state.saveDefault = ($event) => {
if ($event && $event.preventDefault) $event.preventDefault();
if (state.saving) return;
const submitted = draft.checkpoint();
const params = {
terms: state.terms
.split("\n")
@@ -157,9 +185,9 @@ export const profileController = function (state, http, translate, timeout, quot
state.error = null;
http.post("/api/user/default", params).then(
() => {
getDefault();
draft.accept(submitted);
state.saving = false;
state.message = "Saved";
state.message = state.unsavedChanges ? null : "Saved";
if (savedTimer) timeout.cancel(savedTimer);
savedTimer = timeout(() => {
state.message = null;
@@ -168,8 +196,9 @@ export const profileController = function (state, http, translate, timeout, quot
(error) => {
state.saving = false;
const code = error && error.data && error.data.error;
translate("ERRORS." + code).then((translation) => {
state.error = translation;
const key = "ERRORS." + code;
translate(key).then((translation) => {
state.error = translation && translation !== key ? translation : "Unable to save your defaults. Please try again.";
}, () => {
state.error = "Unable to save your defaults. Please try again.";
});
@@ -410,6 +439,88 @@ export const unifiedDashboardController = function (state, http, location, promi
$('[data-toggle="tooltip"]').tooltip();
}, 250);
state.quotaExpanded = false;
state.closeQuota = () => {
state.quotaExpanded = false;
nextTick(() => document.querySelector(".dashboard-quota > summary")?.focus());
};
createListeners()(document, "click", event => {
if (state.quotaExpanded && !event.target.closest?.(".dashboard-quota")) state.quotaExpanded = false;
});
state.filtersExpanded = false;
state.projectView = "all";
state.selectedProject = null;
state.projectName = "";
state.nameSaving = false;
state.nameError = "";
state.nameMessage = "";
state.needsAttention = item => item.status === "error" || item._broken
|| (statusKey(item.status) === "progress" && item._stale);
state.attentionCount = () => state.items.filter(state.needsAttention).length;
state.setProjectView = view => {
state.projectView = view;
if (view === "attention") {
state.filters.status.error = true;
state.filters.status.progress = true;
}
};
state.projectDetailsId = item => "project-details-" + encodeURIComponent(item._type + ":" + (item._id || item._source || "unknown"));
state.showProjectDetails = async item => {
state.selectedProject = item;
state.projectName = item.projectName || "";
state.nameError = "";
state.nameMessage = "";
await nextTick();
const panel = document.getElementById(state.projectDetailsId(item));
panel?.focus();
panel?.scrollIntoView?.({ block: "nearest" });
};
state.closeProjectDetails = item => {
state.selectedProject = null;
nextTick(() => document.querySelector(`[data-project-actions="${encodeURIComponent(item._type + ":" + item._id)}"]`)?.focus());
};
state.saveProjectName = async item => {
if (state.nameSaving || !item._id) return;
const name = state.projectName.trim();
if (name.length > 100) { state.nameError = "Use 100 characters or fewer."; return; }
state.nameSaving = true;
state.nameError = "";
state.nameMessage = "";
try {
const res = await http.post("/api/user/project-name", { type: item._type, id: item._id, name });
item.projectName = res.data.name;
item._label = item.projectName || item._fallbackLabel;
if (state.selectedProject === item) state.nameMessage = name ? "Project name saved." : "Default project name restored.";
} catch (_) {
if (state.selectedProject === item) state.nameError = "The project name could not be saved. Try again.";
} finally { state.nameSaving = false; }
};
state.copyingId = null;
state.copyLink = async (item) => {
if (!item._viewUrl || state.copyingId) return;
const link = new URL(item._viewUrl, window.location.origin).href;
state.copyingId = item._type + ":" + item._id;
try {
if (window.navigator.clipboard?.writeText) {
await window.navigator.clipboard.writeText(link);
} else {
const field = document.createElement("textarea");
field.value = link;
field.setAttribute("readonly", "");
field.style.position = "fixed";
field.style.opacity = "0";
const focused = document.activeElement;
document.body.appendChild(field);
try {
field.select();
if (!document.execCommand?.("copy")) throw Error("Copy unavailable");
} finally { field.remove(); focused?.focus(); }
}
state.addToast({ title: "Link copied", body: "The anonymous link is ready to share." });
} catch {
state.addToast({ title: "Copy this anonymous link", body: link });
} finally { state.copyingId = null; }
};
state.items = [];
state.search = "";
state.loading = true;
@@ -458,7 +569,8 @@ export const unifiedDashboardController = function (state, http, location, promi
// `orderBy` is kept as the Angular orderBy expression ("-field" for
// descending) so saved preferences stay compatible.
const sortFields = {
_name: { label: "Name", defaultDesc: false },
_name: { label: "Anonymous ID", defaultDesc: false },
_label: { label: "Project", defaultDesc: false },
anonymizeDate: { label: "Anonymize date", defaultDesc: true },
status: { label: "Status", defaultDesc: false },
lastView: { label: "Last view", defaultDesc: true },
@@ -525,6 +637,8 @@ export const unifiedDashboardController = function (state, http, location, promi
item._source = source;
item._broken = !id;
item._name = id || source || "(unnamed)";
item._fallbackLabel = item._type === "gist" ? "Gist " + (id || source || "without an ID") : source || name || item._name;
item._label = item.projectName || item._fallbackLabel;
item._editUrl = id ? editUrl : null;
item._viewUrl = id ? viewUrl : null;
if (item._broken) {
@@ -597,7 +711,7 @@ export const unifiedDashboardController = function (state, http, location, promi
pr,
pr.pullRequestId,
pr.pullRequestId,
src.repositoryFullName + "#" + src.pullRequestId,
src.repositoryFullName ? src.repositoryFullName + "#" + src.pullRequestId : undefined,
"/pull-request-anonymize/" + pr.pullRequestId,
"/pr/" + pr.pullRequestId + "/"
)
@@ -637,11 +751,16 @@ export const unifiedDashboardController = function (state, http, location, promi
state.hasHiddenStatus = () => state.hiddenStatusCount() > 0;
state.hasActiveFilters = () =>
state.projectView !== "all" ||
state.typeFilter !== "all" ||
state.search.trim().length > 0 ||
Object.keys(state.filters.status).some((k) => state.filters.status[k] === false);
state.showClearFilters = () => state.search.trim().length > 0
|| state.typeFilter !== "all" || state.hiddenStatusCount() > 1;
state.clearFilters = () => {
state.projectView = "all";
state.typeFilter = "all";
state.search = "";
Object.keys(state.filters.status).forEach((k) => {
@@ -655,6 +774,8 @@ export const unifiedDashboardController = function (state, http, location, promi
if (item._type === "repo" && item.repoId == repoId) {
item.status = res.data.status;
item.statusMessage = res.data.statusMessage;
item._statusKey = statusKey(item.status);
if (item._statusKey !== "progress") item._stale = false;
break;
}
}
@@ -777,10 +898,12 @@ export const unifiedDashboardController = function (state, http, location, promi
};
state.itemFilter = (item) => {
if (state.projectView === "attention" && !state.needsAttention(item)) return false;
if (state.typeFilter !== "all" && item._type !== state.typeFilter) return false;
if (state.filters.status[item._statusKey] === false) return false;
const needle = state.search.trim().toLowerCase();
if (needle.length == 0) return true;
if (item._label && String(item._label).toLowerCase().indexOf(needle) > -1) return true;
if (item._source && String(item._source).toLowerCase().indexOf(needle) > -1) return true;
if (item._id && String(item._id).toLowerCase().indexOf(needle) > -1) return true;
if (item.conference && String(item.conference).toLowerCase().indexOf(needle) > -1) return true;
@@ -894,6 +1017,56 @@ export const statusController = function (state, http, params) {
export const anonymizeController = function (state, http, html, params, location, translate, timeout) {
// Unified state
state.sourceUrl = "";
state.workspaceOpen = false;
state.sourceUrlError = "";
state.previewStatus = "idle";
state.sourceLoading = false;
state.mobilePane = "settings";
const workspaceMedia = window.matchMedia?.("(max-width: 767px)");
state.mobileWorkspace = !!workspaceMedia?.matches;
if (workspaceMedia?.addEventListener) createListeners()(workspaceMedia, "change", event => { state.mobileWorkspace = event.matches; });
state.selectMobilePane = (pane) => { state.mobilePane = pane; };
let sourceGeneration = 0;
let sourceDisposed = false;
const sourceRequests = new Set();
const isCurrentSource = (request, branch = false) => !sourceDisposed
&& request.generation === sourceGeneration
&& request.url === state.sourceUrl.trim()
&& request.connection === state.githubConnection
&& (!branch || request.branch === state.source.branch);
const beginSourceRequest = () => {
const request = { generation: sourceGeneration, url: state.sourceUrl.trim(), connection: state.githubConnection, branch: state.source.branch };
sourceRequests.add(request);
state.sourceLoading = true;
return request;
};
const finishSourceRequest = (request) => {
sourceRequests.delete(request);
if (!sourceDisposed) state.sourceLoading = [...sourceRequests].some(request => isCurrentSource(request));
};
state.on("dispose", () => { sourceDisposed = true; sourceGeneration++; });
let selectedSourceKey = null;
const sourceKey = (parsed) => parsed.gistId && !parsed.repo
? "gist:" + parsed.gistId.toLowerCase()
: (parsed.owner + "/" + parsed.repo).toLowerCase() + (parsed.pullRequestId ? "/pull/" + parsed.pullRequestId : "");
const draft = formDraft(state, ["sourceUrl", "terms", "repoId", "pullRequestId", "gistId", "source", "options", "conference", "githubConnection"], "anonymize:" + (location.path?.() || ""));
state.discardDraft = async () => {
draft.discard();
state.workspaceOpen = !!state.sourceUrl;
state.error = null;
if (state.sourceUrl) await state.urlSelected(true);
else {
sourceGeneration++;
state.sourceLoading = false;
state.detectedType = null;
state.details = null;
state.sourceUrlError = "";
scheduleReadmePreview.cancel();
refreshPrPreview.cancel();
refreshGistPreview.cancel();
state.previewStatus = "idle";
}
};
state.githubConnection = undefined;
state.githubConnections = null;
state.gistOAuthRequired = false;
@@ -985,6 +1158,7 @@ export const anonymizeController = function (state, http, html, params, location
data.options && data.options.expirationDate
? new Date(data.options.expirationDate)
: defaultExpirationDate();
if (!params.repoId && !params.pullRequestId && !params.gistId && !state.anonymize?.terms?.dirty) state.terms = state.defaultTerms;
if (cb) cb();
});
}
@@ -1039,7 +1213,12 @@ export const anonymizeController = function (state, http, html, params, location
let saved;
try { saved = JSON.parse(sessionStorage.getItem("github-access-draft") || "null"); }
catch (_) { return false; }
if (!saved || saved.path !== location.path() || Date.now() - saved.savedAt >= 30 * 60000) return false;
if (!saved || saved.path !== location.path() || Date.now() - saved.savedAt >= 30 * 60000) {
if (!draft.restore()) return false;
if (state.sourceUrl) await refreshGitHubAccess();
return true;
}
draft.restore();
for (const key of ["sourceUrl", "terms", "repoId", "pullRequestId", "gistId", "source", "options", "conference", "githubConnection"]) {
if (Object.prototype.hasOwnProperty.call(saved.draft, key)) state[key] = saved.draft[key];
}
@@ -1079,6 +1258,7 @@ export const anonymizeController = function (state, http, html, params, location
if (res.data.options.expirationDate) {
state.options.expirationDate = new Date(res.data.options.expirationDate);
}
selectedSourceKey = sourceKey(parseGithubUrl(state.sourceUrl));
if (await restoreGitHubDraft()) return;
await Promise.all([getRepoDetails(), getReadme()]);
anonymizeReadme();
@@ -1104,19 +1284,10 @@ export const anonymizeController = function (state, http, html, params, location
if (res.data.options.expirationDate) {
state.options.expirationDate = new Date(res.data.options.expirationDate);
}
selectedSourceKey = sourceKey(parseGithubUrl(state.sourceUrl));
if (await restoreGitHubDraft()) return;
try {
state.details = (await http.get(`/api/pr/${res.data.source.repositoryFullName}/${res.data.source.pullRequestId}`, { params: { connection: state.githubConnection } })).data;
} catch (error) {
const code = error && error.data && error.data.error;
if (code) {
translate("ERRORS." + code).then((translation) => {
state.addToast({ title: "Error", date: new Date(), body: translation });
state.error = translation;
}, console.error);
displayErrorMessage(code);
}
}
try { await getPrDetails(); }
catch (_) { /* The source handler displays the error. */ }
},
() => { location.url("/404"); }
@@ -1138,6 +1309,7 @@ export const anonymizeController = function (state, http, html, params, location
if (res.data.options.expirationDate) {
state.options.expirationDate = new Date(res.data.options.expirationDate);
}
selectedSourceKey = sourceKey(parseGithubUrl(state.sourceUrl));
if (await restoreGitHubDraft()) return;
await getGistDetails();
@@ -1153,36 +1325,56 @@ export const anonymizeController = function (state, http, html, params, location
if (!params.repoId && !params.pullRequestId && !params.gistId && state.githubConnection === undefined
&& res.data.appEnabled && res.data.appConnected) {
state.githubConnection = "github-app";
if (state.sourceUrl && state.workspaceOpen) refreshGitHubAccess();
}
}).catch(() => {});
// URL change handler - auto-detect type
// Keep the same input focused until a complete GitHub URL can be loaded.
state.urlSelected = async (preserveDraft = false) => {
const generation = ++sourceGeneration;
let o;
try { o = parseGithubUrl(state.sourceUrl.trim()); }
catch (_) {
state.sourceLoading = false;
scheduleReadmePreview.cancel();
refreshPrPreview.cancel();
refreshGistPreview.cancel();
state.previewStatus = "idle";
state.sourceUrlError = state.sourceUrl ? "Please provide a valid GitHub URL." : "";
setValidity("sourceUrl", "github", false);
return;
}
const key = sourceKey(o);
const preserveSelection = preserveDraft || selectedSourceKey === key;
selectedSourceKey = key;
state.sourceUrlError = "";
setValidity("sourceUrl", "github", true);
const transferFocus = document.activeElement?.id === "sourceUrl-landing";
state.workspaceOpen = true;
if (transferFocus) timeout(() => document.getElementById("sourceUrl")?.focus(), 0);
state.reconnectingSource = false;
state.reconnectRepositoryId = undefined;
if (!preserveDraft) state.terms = state.defaultTerms;
if (!preserveDraft && !state.isUpdate) {
if (!preserveSelection && !state.isUpdate) {
state.repoId = "";
state.pullRequestId = "";
state.gistId = "";
}
state.details = null;
state.branches = [];
if (!preserveDraft) state.source = { type: "GitHubStream", branch: "", commit: "" };
if (!preserveSelection) state.source = { type: "GitHubStream", branch: "", commit: "" };
scheduleReadmePreview.cancel();
refreshPrPreview.cancel();
refreshGistPreview.cancel();
_prAnonCache.clear();
_gistAnonCache.clear();
state.previewStatus = "idle";
state.anonymize_readme = "";
state.readme = "";
state.html_readme = "";
state.detectedType = null;
state.gistOAuthRequired = false;
let o;
try {
o = parseGithubUrl(state.sourceUrl);
} catch (error) {
setValidity("sourceUrl", "github", false);
return;
}
setValidity("sourceUrl", "github", true);
state._preservingDraft = preserveSelection;
try {
if (o.gistId && !o.repo) {
state.detectedType = "gist";
@@ -1197,10 +1389,8 @@ export const anonymizeController = function (state, http, html, params, location
await Promise.all([getRepoDetails(), getReadme()]);
anonymizeReadme();
}
} catch (error) {
return;
}
} catch (_) { /* Source errors are displayed by the request handlers. */ }
finally { if (generation === sourceGeneration) state._preservingDraft = false; }
$('[data-toggle="tooltip"]').tooltip();
};
$('[data-toggle="tooltip"]').tooltip();
@@ -1231,10 +1421,12 @@ export const anonymizeController = function (state, http, html, params, location
state.getBranches = async (force) => {
const o = parseGithubUrl(state.sourceUrl);
const request = beginSourceRequest();
try {
const branches = await http.get(`/api/repo/${o.owner}/${o.repo}/branches`, {
params: { reconnect: state.reconnectingSource ? "1" : undefined, anonymizedRepoId: state.isUpdate && params.repoId && parseRepoFullName(state.sourceUrl) === state._originalFullName ? params.repoId : undefined, connection: state.githubConnection, force: force === true || state.reconnectingSource ? "1" : "0", repositoryID: sourceRepositoryID() },
});
if (!isCurrentSource(request)) return;
state.branches = branches.data;
state.sourceUnreachable = false;
if (!state.source.branch) {
@@ -1259,6 +1451,7 @@ export const anonymizeController = function (state, http, html, params, location
await getReadme(force);
}
} catch (error) {
if (!isCurrentSource(request)) return;
state.branches = [];
state.sourceUnreachable = error && (error.status === 404 || (error.data && error.data.error === "repo_not_found"));
const code = (error && error.data && error.data.error) || (error && error.status === 404 ? "repo_not_found" : "unknown_error");
@@ -1270,12 +1463,13 @@ export const anonymizeController = function (state, http, html, params, location
if (typeof setValidity === "function") {
setValidity("sourceUrl", "missing", false);
}
}
} finally { finishSourceRequest(request); }
};
async function getRepoDetails() {
const o = parseGithubUrl(state.sourceUrl);
const request = beginSourceRequest();
try {
resetValidity();
// force=1 so newly enabled features (e.g. GitHub Pages — see
@@ -1284,6 +1478,7 @@ export const anonymizeController = function (state, http, html, params, location
const res = await http.get(`/api/repo/${o.owner}/${o.repo}/`, {
params: { reconnect: state.reconnectingSource ? "1" : undefined, anonymizedRepoId: state.isUpdate && params.repoId && parseRepoFullName(state.sourceUrl) === state._originalFullName ? params.repoId : undefined, connection: state.githubConnection, repositoryID: sourceRepositoryID(), force: "1" },
});
if (!isCurrentSource(request)) return;
state.details = res.data;
if (state.reconnectingSource) state.reconnectRepositoryId = state.details.externalId;
if (state.details && state.details.id) {
@@ -1294,6 +1489,7 @@ export const anonymizeController = function (state, http, html, params, location
}
await state.getBranches(state.reconnectingSource);
} catch (error) {
if (!isCurrentSource(request)) return;
if (error.data) {
translate("ERRORS." + error.data.error).then((translation) => {
state.addToast({ title: "Error", date: new Date(), body: translation });
@@ -1303,20 +1499,21 @@ export const anonymizeController = function (state, http, html, params, location
}
setValidity("sourceUrl", "missing", false);
throw error;
}
} finally { finishSourceRequest(request); }
}
async function getReadme(force) {
if (state.readme && !force) return state.readme;
const o = parseGithubUrl(state.sourceUrl);
const request = beginSourceRequest();
try {
const res = await http.get(`/api/repo/${o.owner}/${o.repo}/readme`, {
params: { reconnect: state.reconnectingSource ? "1" : undefined, anonymizedRepoId: state.isUpdate && params.repoId && parseRepoFullName(state.sourceUrl) === state._originalFullName ? params.repoId : undefined, connection: state.githubConnection, force: force === true ? "1" : "0", branch: state.source.branch, repositoryID: sourceRepositoryID() },
});
state.readme = res.data;
if (isCurrentSource(request, true)) state.readme = res.data;
} catch (error) {
state.readme = "";
}
if (isCurrentSource(request, true)) state.readme = "";
} finally { finishSourceRequest(request); }
}
// Both anonymizeReadme() and anonymizePrContent() used to reimplement
@@ -1344,36 +1541,51 @@ export const anonymizeController = function (state, http, html, params, location
return opts;
}
// Single-flight + debounced wrapper. Returns a promise that resolves
// with the latest server result; intermediate calls are coalesced.
function makePreviewBatcher(buildBody, applyResult) {
// Invalidate as soon as an option changes, before the debounce expires.
function makePreviewBatcher(kind, buildBody, applyResult) {
let pendingTimer = null;
let inflightToken = 0;
return function schedule() {
let generation = 0;
const schedule = () => {
if (state.detectedType !== kind) return;
if (pendingTimer) timeout.cancel(pendingTimer);
const current = ++generation;
state.previewStatus = "loading";
pendingTimer = timeout(() => {
pendingTimer = null;
const myToken = ++inflightToken;
const body = buildBody();
if (!body) return;
http.post("/api/anonymize-preview", body).then(
(res) => {
if (myToken !== inflightToken) return; // stale
applyResult(res.data);
},
() => { /* ignore preview errors; no UI feedback needed */ }
);
if (!body) { state.previewStatus = "idle"; return; }
http.post("/api/anonymize-preview", body).then(res => {
if (current !== generation) return;
applyResult(res.data, body);
state.previewStatus = "ready";
}).catch(() => {
if (current === generation) state.previewStatus = "error";
});
}, 200);
};
schedule.cancel = () => {
generation++;
if (pendingTimer) timeout.cancel(pendingTimer);
pendingTimer = null;
};
state.on("dispose", schedule.cancel);
return schedule;
}
state.retryPreview = () => {
if (state.detectedType === "repo") scheduleReadmePreview();
if (state.detectedType === "pr") refreshPrPreview();
if (state.detectedType === "gist") refreshGistPreview();
};
const scheduleReadmePreview = makePreviewBatcher(
"repo",
() => {
if (!state.readme) return null;
return { content: state.readme, options: previewOptions() };
},
(data) => {
state.anonymize_readme = data.content || "";
if (typeof data?.content !== "string") throw Error("Invalid preview response");
state.anonymize_readme = data.content;
let baseUrl = "";
try {
const o = parseGithubUrl(state.sourceUrl);
@@ -1406,14 +1618,17 @@ export const anonymizeController = function (state, http, html, params, location
// ========== PR LOGIC ==========
async function getPrDetails() {
const o = parseGithubUrl(state.sourceUrl);
const request = beginSourceRequest();
try {
resetValidity();
const res = await http.get(`/api/pr/${o.owner}/${o.repo}/${o.pullRequestId}`, { params: { connection: state.githubConnection } });
if (!isCurrentSource(request)) return;
state.details = res.data;
if (!state.pullRequestId) {
state.pullRequestId = o.repo + "-PR" + o.pullRequestId + "-" + generateRandomId(4);
}
} catch (error) {
if (!isCurrentSource(request)) return;
if (error.data) {
translate("ERRORS." + error.data.error).then((translation) => {
state.addToast({ title: "Error", date: new Date(), body: translation });
@@ -1423,16 +1638,11 @@ export const anonymizeController = function (state, http, html, params, location
}
setValidity("sourceUrl", "missing", false);
throw error;
}
} finally { finishSourceRequest(request); }
}
// Angular templates evaluate this synchronously, so we keep a
// {original -> anonymized} cache populated by a debounced batch call to
// /api/anonymize-preview whenever the PR details, terms, or options
// change. anonymizePrContent() returns the cached value if known and
// falls back to the original until the next cycle resolves.
// Original text is never substituted for a pending or failed preview.
const _prAnonCache = reactive(new Map());
let _prSeenContents = new Set();
function collectPrContents() {
const out = new Set();
@@ -1451,16 +1661,16 @@ export const anonymizeController = function (state, http, html, params, location
}
const refreshPrPreview = makePreviewBatcher(
"pr",
() => {
const seen = collectPrContents();
_prSeenContents = seen;
const list = Array.from(seen);
if (list.length === 0) return null;
return { contents: list, options: previewOptions() };
},
(data) => {
if (!data || !Array.isArray(data.contents)) return;
const seen = Array.from(_prSeenContents);
(data, body) => {
if (!Array.isArray(data?.contents) || data.contents.length !== body.contents.length || data.contents.some(value => typeof value !== "string")) throw Error("Invalid preview response");
const seen = body.contents;
const next = new Map();
for (let i = 0; i < seen.length && i < data.contents.length; i++) {
next.set(seen[i], data.contents[i]);
@@ -1473,15 +1683,13 @@ export const anonymizeController = function (state, http, html, params, location
state.anonymizePrContent = function (content) {
if (!content) return content;
if (_prAnonCache.has(content)) return _prAnonCache.get(content);
if (!_prSeenContents.has(content)) {
refreshPrPreview();
}
return content;
return "";
};
// ========== GIST LOGIC ==========
async function getGistDetails() {
const o = parseGithubUrl(state.sourceUrl);
const request = beginSourceRequest();
try {
resetValidity();
state.gistOAuthRequired = false;
@@ -1491,11 +1699,13 @@ export const anonymizeController = function (state, http, html, params, location
return;
}
const res = await http.get(`/api/gist/source/${o.gistId}`);
if (!isCurrentSource(request)) return;
state.details = res.data;
if (!state.gistId) {
state.gistId = "gist-" + o.gistId.substring(0, 6) + "-" + generateRandomId(4);
}
} catch (error) {
if (!isCurrentSource(request)) return;
if (error.data?.error === "github_oauth_required") {
state.gistOAuthRequired = true;
setValidity("sourceUrl", "missing", false);
@@ -1510,11 +1720,10 @@ export const anonymizeController = function (state, http, html, params, location
}
setValidity("sourceUrl", "missing", false);
throw error;
}
} finally { finishSourceRequest(request); }
}
const _gistAnonCache = reactive(new Map());
let _gistSeenContents = new Set();
function collectGistContents() {
const out = new Set();
@@ -1536,16 +1745,16 @@ export const anonymizeController = function (state, http, html, params, location
}
const refreshGistPreview = makePreviewBatcher(
"gist",
() => {
const seen = collectGistContents();
_gistSeenContents = seen;
const list = Array.from(seen);
if (list.length === 0) return null;
return { contents: list, options: previewOptions() };
},
(data) => {
if (!data || !Array.isArray(data.contents)) return;
const seen = Array.from(_gistSeenContents);
(data, body) => {
if (!Array.isArray(data?.contents) || data.contents.length !== body.contents.length || data.contents.some(value => typeof value !== "string")) throw Error("Invalid preview response");
const seen = body.contents;
const next = new Map();
for (let i = 0; i < seen.length && i < data.contents.length; i++) {
next.set(seen[i], data.contents[i]);
@@ -1559,10 +1768,7 @@ export const anonymizeController = function (state, http, html, params, location
state.anonymizeGistContent = function (content) {
if (!content) return content;
if (_gistAnonCache.has(content)) return _gistAnonCache.get(content);
if (!_gistSeenContents.has(content)) {
refreshGistPreview();
}
return content;
return "";
};
// Precomputed file objects for the preview pane so <gist-file>'s
@@ -1731,9 +1937,15 @@ export const anonymizeController = function (state, http, html, params, location
// Submit: repo
state.anonymizeRepo = (event) => {
if (state.sourceLoading) { state.error = "Wait for the source to finish loading before saving."; return; }
if (state.reconnectingSource && !state.reconnectRepositoryId) return;
if (expirationDateInvalid()) return;
event.target.disabled = true;
if (state.anonymize?.invalid || state.sourceUrlError) {
state.error = "Please correct the highlighted fields before saving.";
return;
}
const button = event.currentTarget || event.target.closest?.("button") || event.target;
button.disabled = true;
const o = parseGithubUrl(state.sourceUrl);
const payload = {
repoId: state.repoId,
@@ -1750,20 +1962,26 @@ export const anonymizeController = function (state, http, html, params, location
resetValidity();
const url = state.isUpdate ? "/api/repo/" + state.repoId : "/api/repo/";
http.post(url, payload, { headers: { "Content-Type": "application/json" } }).then(
() => { window.location.href = "/status/" + state.repoId; },
() => { draft.clear(); window.location.href = "/status/" + state.repoId; },
(error) => {
if (error.data) {
translate("ERRORS." + error.data.error).then((t) => { state.error = t; }, console.error);
displayErrorMessage(error.data.error);
}
}
).finally(() => { event.target.disabled = false; });
).finally(() => { button.disabled = false; });
};
// Submit: Gist
state.anonymizeGist = (event) => {
if (state.sourceLoading) { state.error = "Wait for the source to finish loading before saving."; return; }
if (expirationDateInvalid()) return;
event.target.disabled = true;
if (state.anonymize?.invalid || state.sourceUrlError) {
state.error = "Please correct the highlighted fields before saving.";
return;
}
const button = event.currentTarget || event.target.closest?.("button") || event.target;
button.disabled = true;
const o = parseGithubUrl(state.sourceUrl);
const payload = {
gistId: state.gistId,
@@ -1775,20 +1993,26 @@ export const anonymizeController = function (state, http, html, params, location
resetValidity();
const url = state.isUpdate ? "/api/gist/" + state.gistId : "/api/gist/";
http.post(url, payload, { headers: { "Content-Type": "application/json" } }).then(
() => { window.location.href = "/gist/" + state.gistId; },
() => { draft.clear(); window.location.href = "/gist/" + state.gistId; },
(error) => {
if (error.data) {
translate("ERRORS." + error.data.error).then((t) => { state.error = t; }, console.error);
displayErrorMessage(error.data.error);
}
}
).finally(() => { event.target.disabled = false; });
).finally(() => { button.disabled = false; });
};
// Submit: PR
state.anonymizePullRequest = (event) => {
if (state.sourceLoading) { state.error = "Wait for the source to finish loading before saving."; return; }
if (expirationDateInvalid()) return;
event.target.disabled = true;
if (state.anonymize?.invalid || state.sourceUrlError) {
state.error = "Please correct the highlighted fields before saving.";
return;
}
const button = event.currentTarget || event.target.closest?.("button") || event.target;
button.disabled = true;
const o = parseGithubUrl(state.sourceUrl);
const payload = {
pullRequestId: state.pullRequestId,
@@ -1801,14 +2025,14 @@ export const anonymizeController = function (state, http, html, params, location
resetValidity();
const url = state.isUpdate ? "/api/pr/" + state.pullRequestId : "/api/pr/";
http.post(url, payload, { headers: { "Content-Type": "application/json" } }).then(
() => { window.location.href = "/pr/" + state.pullRequestId; },
() => { draft.clear(); window.location.href = "/pr/" + state.pullRequestId; },
(error) => {
if (error.data) {
translate("ERRORS." + error.data.error).then((t) => { state.error = t; }, console.error);
displayErrorMessage(error.data.error);
}
}
).finally(() => { event.target.disabled = false; });
).finally(() => { button.disabled = false; });
};
state.watch("conference", () => { getConference(); });
@@ -2589,6 +2813,8 @@ export const conferencesController = function (state, http, location) {
}
state.conferences = [];
state.loading = true;
state.error = "";
state.search = "";
const conferencesPrefsKey = "conferences.filterPrefs";
@@ -2624,11 +2850,13 @@ export const conferencesController = function (state, http, location) {
);
state.removeConference = function (conf) {
if (conf.removing) return;
if (
confirm(
`Are you sure that you want to remove the conference ${conf.name}? All the repositories linked to this conference will expire.`
)
) {
conf.removing = true;
const toast = reactive({
title: `Removing ${conf.name}...`,
date: new Date(),
@@ -2638,30 +2866,36 @@ export const conferencesController = function (state, http, location) {
http.delete(`/api/conferences/${conf.conferenceID}`).then(() => {
toast.title = `${conf.name} is removed.`;
toast.body = `The conference ${conf.name} is removed.`;
getConferences();
});
state.loadConferences();
}).catch(() => {
toast.title = "Unable to remove conference";
toast.body = "Please try again. The conference has not been removed.";
}).finally(() => { conf.removing = false; });
}
};
function getConferences() {
http.get("/api/conferences/").then(
state.loadConferences = () => {
state.loading = true;
state.error = "";
return http.get("/api/conferences/").then(
(res) => {
state.conferences = res.data || [];
},
(err) => {
console.error(err);
state.error = "Unable to load your conferences. Please try again.";
}
);
}
getConferences();
).finally(() => { state.loading = false; });
};
state.loadConferences();
state.conferenceFilter = (conference) => {
if (state.filters.status[conference.status] == false) return false;
if (state.search.trim().length == 0) return true;
const query = state.search.trim().toLowerCase();
if (!query) return true;
if (conference.name.indexOf(state.search) > -1) return true;
if (conference.conferenceID.indexOf(state.search) > -1) return true;
if ((conference.name || "").toLowerCase().includes(query)) return true;
if ((conference.conferenceID || "").toLowerCase().includes(query)) return true;
return false;
};
@@ -2679,12 +2913,14 @@ export const newConferenceController = function (state, http, location, params)
state.plans = [];
state.editionMode = false;
state.saving = false;
state.error = "";
function getConference() {
http
.get("/api/conferences/" + params.conferenceId)
.then((res) => {
state.options = res.data;
state.options = { ...state.options, ...res.data, billing: res.data.billing || {} };
state.options.startDate = new Date(state.options.startDate);
state.options.endDate = new Date(state.options.endDate);
});
@@ -2710,6 +2946,7 @@ export const newConferenceController = function (state, http, location, params)
const end = new Date(start);
end.setMonth(start.getMonth() + 7, 0);
state.options = {
billing: {},
startDate: start,
endDate: end,
plan: {
@@ -2777,39 +3014,44 @@ export const newConferenceController = function (state, http, location, params)
}
state.submit = function () {
if (state.saving) return;
state.saving = true;
state.error = "";
const submitted = JSON.parse(JSON.stringify(state.options));
const toast = reactive({
title: `Creating ${state.options.name}...`,
title: `Creating ${submitted.name}...`,
date: new Date(),
body: `The conference ${state.options.conferenceID} is in creation.`,
body: `The conference ${submitted.conferenceID} is in creation.`,
});
if (state.editionMode) {
toast.title = `Updating ${state.options.name}...`;
toast.body = `The conference '${state.options.conferenceID}' is updating.`;
toast.title = `Updating ${submitted.name}...`;
toast.body = `The conference '${submitted.conferenceID}' is updating.`;
}
state.addToast(toast);
resetValidity();
http
.post(
"/api/conferences/" +
(state.editionMode ? state.options.conferenceID : ""),
state.options
(state.editionMode ? submitted.conferenceID : ""),
submitted
)
.then(
() => {
if (!state.editionMode) {
toast.title = `${state.options.name} created`;
toast.body = `The conference '${state.options.conferenceID}' is created.`;
toast.title = `${submitted.name} created`;
toast.body = `The conference '${submitted.conferenceID}' is created.`;
} else {
toast.title = `${state.options.name} updated`;
toast.body = `The conference '${state.options.conferenceID}' is updated.`;
toast.title = `${submitted.name} updated`;
toast.body = `The conference '${submitted.conferenceID}' is updated.`;
}
location.url("/conference/" + state.options.conferenceID);
location.url("/conference/" + submitted.conferenceID);
},
(error) => {
displayErrorMessage(error.data.error);
displayErrorMessage(error.data?.error);
state.error = "Unable to save the conference. Please correct any highlighted fields and try again.";
state.removeToast(toast);
}
);
).finally(() => { state.saving = false; });
};
};
@@ -2833,10 +3075,11 @@ export const conferenceController = function (state, http, location, params) {
state.repoFiler = (repo) => {
if (state.filters.status[repo.status] == false) return false;
if (state.search.trim().length == 0) return true;
const query = state.search.trim().toLowerCase();
if (!query) return true;
if (repo.source.fullName.indexOf(state.search) > -1) return true;
if (repo.repoId.indexOf(state.search) > -1) return true;
if ((repo.source?.fullName || "").toLowerCase().includes(query)) return true;
if ((repo.repoId || "").toLowerCase().includes(query)) return true;
return false;
};
+11 -1
View File
@@ -2,6 +2,16 @@ 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";
import { render as quotaUsageTemplate } from "../partials/quotaUsage.htm";
const QuotaUsage = {
props: ["quota", "fmt"],
setup(props) {
return { formatAmount: (value, kind) => kind === "bytes"
? props.fmt.humanFileSize(value).replace(/([a-zA-Z]+)$/, " $1") : props.fmt.number(value) };
},
render: quotaUsageTemplate,
};
const editorModes = new Set(__ACE_MODES__);
@@ -68,7 +78,7 @@ const Loc = {
};
},
};
export const components = { Markdown, GistFile, Notebook, Loc, HtmlDoc, Pdfviewer: defineAsyncComponent(async () => {
export const components = { Markdown, GistFile, Notebook, Loc, HtmlDoc, QuotaUsage, Pdfviewer: defineAsyncComponent(async () => {
await loadLibrary("pdf");
pdfjsLib.GlobalWorkerOptions.workerSrc = "/script/external/pdf.worker.js";
return PdfViewer;
+77
View File
@@ -0,0 +1,77 @@
// Drafts stay in this browser tab and are tied to the signed-in account.
export function formDraft(state, fields, key) {
let baseline;
let watching = false;
const storageKey = "form-draft:" + key;
const values = () => Object.fromEntries(fields.map(field => [field, state[field]]));
const serialize = () => JSON.stringify(values());
const apply = (saved) => {
for (const field of fields) {
if (Object.prototype.hasOwnProperty.call(saved, field)) state[field] = saved[field];
}
if (state.options?.expirationDate) state.options.expirationDate = new Date(state.options.expirationDate);
};
const remove = () => { try { window.sessionStorage.removeItem(storageKey); } catch { /* Storage may be disabled. */ } };
const save = (flush = false) => {
if (baseline === undefined) return;
if (flush) document.querySelectorAll("input, select, textarea").forEach(el => {
if (el._field?.binding.state === state && el._field.timer) el._field.commit();
});
state.unsavedChanges = serialize() !== baseline;
state.draftSaved = false;
if (!state.unsavedChanges) { remove(); return; }
try {
window.sessionStorage.setItem(storageKey, JSON.stringify({
account: state.user?.username || null, savedAt: Date.now(), values: values(),
}));
state.draftSaved = true;
} catch { /* Keep the form usable when storage is disabled or full. */ }
};
const saveBeforeLeaving = () => save(true);
state.on("routeLeave", saveBeforeLeaving);
window.addEventListener("beforeunload", saveBeforeLeaving);
state.on("dispose", () => window.removeEventListener("beforeunload", saveBeforeLeaving));
return {
restore() {
baseline = serialize();
let saved;
try { saved = JSON.parse(window.sessionStorage.getItem(storageKey) || "null"); } catch { /* Ignore invalid drafts. */ }
const restored = saved && saved.account === (state.user?.username || null)
&& Date.now() - saved.savedAt < 30 * 60000 && saved.values;
if (restored) {
apply(saved.values);
state.draftRestored = true;
}
if (!watching) {
watching = true;
state.watch(() => values(), () => save(), true);
}
state.unsavedChanges = serialize() !== baseline;
return !!restored;
},
checkpoint() { return JSON.parse(serialize()); },
accept(saved) {
baseline = JSON.stringify(saved);
state.draftRestored = false;
save();
},
discard() {
document.querySelectorAll("input, select, textarea").forEach(el => {
if (el._field?.binding.state !== state || !el._field.timer) return;
clearTimeout(el._field.timer);
el._field.timer = null;
el.value = el._field.binding.value ?? "";
});
if (baseline !== undefined) apply(JSON.parse(baseline));
state.draftRestored = false;
save();
},
clear() {
baseline = serialize();
state.unsavedChanges = false;
state.draftRestored = false;
state.draftSaved = false;
remove();
},
};
}
+2
View File
@@ -3,6 +3,7 @@ import { createApp, h, watch, provide, inject, onBeforeUnmount } from "vue";
import { createRouter, createWebHistory, RouterView } from "vue-router";
import { pageRoutes } from "./routes.js";
import { templates } from "./templates.js";
import { render as iconsTemplate } from "../partials/icons.htm";
import { initializeTemplate } from "./template-state.js";
import { createPageState, createTimers } from "./state.js";
import { createHttp, promises } from "./http.js";
@@ -100,6 +101,7 @@ export function mountApplication(target = "#app", options = {}) {
document.addEventListener("click", navigate);
onBeforeUnmount(() => document.removeEventListener("click", navigate));
return () => [
iconsTemplate(root, []),
h("header", { class: "app-header" }, templates["partials/header.htm"](root, headerCache)),
h("main", { class: "app-view align-items-stretch w-100" }, h(RouterView, null, {
default: ({ Component, route }) => Component ? h(Component, { key: route.meta.preserveExplorer ? route.matched[0]?.path : route.path }) : null,
+6 -1
View File
@@ -5,7 +5,12 @@ export function initializeTemplate(name, state) {
if (name === "partials/explorer.htm") {
state.sidebarCollapsed = window.matchMedia?.("(max-width: 767px)").matches || false;
}
if (name === "partials/anonymize.htm") state.prTabState = { active: state.options.diff ? "diff" : "comments" };
if (name === "partials/anonymize.htm") {
state.prTabState = { active: state.options.diff ? "diff" : "comments" };
state.watchGroup(["options.diff", "options.comments"], () => {
if (!state.options[state.prTabState.active]) state.prTabState.active = state.options.diff ? "diff" : state.options.comments ? "comments" : null;
});
}
if (name === "partials/gist.htm") state.tabState = { active: state.details?.files ? "files" : "comments" };
if (["partials/conferences.htm", "partials/conference.htm"].includes(name)) {
state.statusLabels = { ready: "Ready", expired: "Expired", removed: "Removed" };
+23 -22
View File
@@ -1,29 +1,30 @@
"use strict";(()=>{var Hl=Object.defineProperty;var Bl=(e,t)=>{for(var o in t)Hl(e,o,{get:t[o],enumerable:!0})};var ye=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ge={org:"/script/org.f61f262915.min.js",notebook:"/script/notebook.c3144c18ae.min.js",editor:"/script/editor.4f142d3adc.min.js",markdown:"/script/markdown.44f2e93820.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js"};var an=new Map,Wl=ge;function Kt(e){if(!an.has(e)){let t=document.createElement("script");t.src=Wl[e];let o=new Promise((r,n)=>{t.onload=r,t.onerror=()=>{an.delete(e),t.remove(),n(new Error(`Unable to load ${e}. Please retry.`))}});an.set(e,o),document.head.appendChild(t)}return an.get(e)}async function sr(){await Kt("editor"),ace.config.set("basePath","/script/external/ace/")}function us(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var $e={},Yt=[],it=()=>{},Zn=()=>!1,cs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ps=e=>e.startsWith("onUpdate:"),je=Object.assign,Ds=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},Kl=Object.prototype.hasOwnProperty,Ie=(e,t)=>Kl.call(e,t),Ce=Array.isArray,qt=e=>Rs(e)==="[object Map]",ds=e=>Rs(e)==="[object Set]",nr=e=>Rs(e)==="[object Date]";var Ee=e=>typeof e=="function",ze=e=>typeof e=="string",pt=e=>typeof e=="symbol",Pe=e=>e!==null&&typeof e=="object",xn=e=>(Pe(e)||Ee(e))&&Ee(e.then)&&Ee(e.catch),ir=Object.prototype.toString,Rs=e=>ir.call(e),eo=e=>Rs(e).slice(8,-1),ln=e=>Rs(e)==="[object Object]",dn=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,fs=us(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var un=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},Yl=/-\w/g,Ye=un(e=>e.replace(Yl,t=>t.slice(1).toUpperCase())),Jl=/\B([A-Z])/g,Mt=un(e=>e.replace(Jl,"-$1").toLowerCase()),Jt=un(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ts=un(e=>e?`on${Jt(e)}`:""),vt=(e,t)=>!Object.is(e,t),Os=(e,...t)=>{for(let o=0;o<e.length;o++)e[o](...t)},cn=(e,t,o,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},to=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var or,As=()=>or||(or=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qe(e){if(Ce(e)){let t={};for(let o=0;o<e.length;o++){let r=e[o],n=ze(r)?xl(r):qe(r);if(n)for(let i in n)t[i]=n[i]}return t}else if(ze(e)||Pe(e))return e}var Ql=/;(?![^(]*\))/g,Xl=/:([^]+)/,Zl=/\/\*[^]*?\*\//g;function xl(e){let t={};return e.replace(Zl,"").split(Ql).forEach(o=>{if(o){let r=o.split(Xl);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function O(e){let t="";if(ze(e))t=e;else if(Ce(e))for(let o=0;o<e.length;o++){let r=O(e[o]);r&&(t+=r+" ")}else if(Pe(e))for(let o in e)e[o]&&(t+=o+" ");return t.trim()}var ar="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",lr=us(ar),ed=us(ar+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function pn(e){return!!e||e===""}function td(e,t){if(e.length!==t.length)return!1;let o=!0;for(let r=0;o&&r<e.length;r++)o=ms(e[r],t[r]);return o}function rr(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]&&ms(n,o[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function ms(e,t){if(e===t)return!0;let o=nr(e),r=nr(t);if(o||r)returLine truncated
"use strict";(()=>{var xl=Object.defineProperty;var ed=(e,t)=>{for(var n in t)xl(e,n,{get:t[n],enumerable:!0})};var pe=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var fe={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",markdown:"/script/markdown.44f2e93820.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};var us=new Map,sd=fe;function Jt(e){if(!us.has(e)){let t=document.createElement("script");t.src=sd[e];let n=new Promise((r,s)=>{t.onload=r,t.onerror=()=>{us.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});us.set(e,n),document.head.appendChild(t)}return us.get(e)}async function lr(){await Jt("editor"),ace.config.set("basePath","/script/external/ace/")}function po(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Ie={},Qt=[],at=()=>{},sn=()=>!1,fo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),mo=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Oo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},nd=Object.prototype.hasOwnProperty,De=(e,t)=>nd.call(e,t),be=Array.isArray,$t=e=>Io(e)==="[object Map]",co=e=>Io(e)==="[object Set]",dr=e=>Io(e)==="[object Date]";var we=e=>typeof e=="function",ze=e=>typeof e=="string",mt=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",nn=e=>(Ae(e)||we(e))&&we(e.then)&&we(e.catch),pr=Object.prototype.toString,Io=e=>pr.call(e),rn=e=>Io(e).slice(8,-1),cs=e=>Io(e)==="[object Object]",ps=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ho=po(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var fs=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},rd=/-\w/g,Je=fs(e=>e.replace(rd,t=>t.slice(1).toUpperCase())),id=/\B([A-Z])/g,St=fs(e=>e.replace(id,"-$1").toLowerCase()),Xt=fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Po=fs(e=>e?`on${Xt(e)}`:""),gt=(e,t)=>!Object.is(e,t),vo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ms=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var ur,qo=()=>ur||(ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Me(e){if(be(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],s=ze(r)?ud(r):Me(r);if(s)for(let i in s)t[i]=s[i]}return t}else if(ze(e)||Ae(e))return e}var ad=/;(?![^(]*\))/g,ld=/:([^]+)/,dd=/\/\*[^]*?\*\//g;function ud(e){let t={};return e.replace(dd,"").split(ad).forEach(n=>{if(n){let r=n.split(ld);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function A(e){let t="";if(ze(e))t=e;else if(be(e))for(let n=0;n<e.length;n++){let r=A(e[n]);r&&(t+=r+" ")}else if(Ae(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}var fr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mr=po(fr),cd=po(fr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function hs(e){return!!e||e===""}function pd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=go(e[r],t[r]);return n}function cr(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let s of e){let i=-1;for(let a=0;a<n.length;a++)if(!r[a]&&go(s,n[a])){i=a;break}if(i<0)return!1;r[i]=1}return!0}function go(e,t){if(e===t)return!0;let n=dr(e),r=dr(t);if(n||r)returLine truncated
`))),e[Bs]=ji(s);let i=r||s.props&&s.props.type==="number";So(e,t?"change":"input",a=>{a.target.composing||e[Bs](Fn(e.value,n,i))}),(n||i)&&So(e,"change",()=>{e.value=Fn(e.value,n,i)}),t||(So(e,"compositionstart",oc),So(e,"compositionend",Gi),So(e,"change",Gi))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let s=t??"",i=e[js];delete e[js],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Bs](Fn(e.value,n,r)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},a){if(e[Bs]=ji(a),e.composing)return;let u=(i||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,f=t??"";if(u===f)return;let h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===f)||(e.value=f)}};var sc=["ctrl","shift","alt","meta"],nc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>sc.some(n=>e[`${n}Key`]&&!t.includes(n))},ce=(e,t)=>{if(!e)return e;let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let a=0;a<t.length;a++){let u=nc[t[a]];if(u&&u(s,t))return}return e(s,...i)}))},rc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},No=(e,t)=>{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;let i=St(s.key);if(t.some(a=>a===i||rc[a]===i))return e(s)}))},ic=Ge({patchProp:xu},$u),Wi;function ac(){return Wi||(Wi=Ni(ic))}var Qi=((...e)=>{let t=ac().createApp(...e),{mount:n}=t;return t.mount=r=>{let s=dc(r);if(!s)return;let i=t._component;!we(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=n(s,!1,lc(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function lc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function dc(e){return ze(e)?document.querySelector(e):e}var lo=typeof document<"u";function Zi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function uc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Zi(e.default)}var Oe=Object.assign;function Ws(e,t){let n={};for(let r in t){let s=t[r];n[r]=wt(s)?s.map(e):e(s)}return n}var Ro=()=>{},wt=Array.isArray;function jn(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var xi=/#/g,cc=/&/g,pc=/\//g,fc=/=/g,mc=/\?/g,ea=/\+/g,hc=/%5B/g,vc=/%5D/g,ta=/%5E/g,gc=/%60/g,oa=/%7B/g,yc=/%7C/g,sa=/%7D/g,bc=/%20/g;function Gn(e){return e==null?"":encodeURI(""+e).replace(yc,"|").replace(hc,"[").replace(vc,"]")}function na(e){return Gn(e).replace(oa,"{").replace(sa,"}").replace(ta,"^")}function Hn(e){return Gn(e).replace(ea,"%2B").replace(bc,"+").replace(xi,"%23").replace(cc,"%26").replace(gc,"`").replace(oa,"{").replace(sa,"}").replace(ta,"^")}function wc(e){return Hn(e).replace(fc,"%3D")}function kc(e){return Gn(e).replace(xi,"%23").replace(mc,"%3F")}function ra(e){return kc(e).replace(pc,"%2F")}function Do(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Ec=/\/$/,Cc=e=>e.replace(Ec,"");function Ks(e,t,n="/"){let r,s={},i="",a="",u=t.indexOf("#"),f=t.indexOf("?");return f=u>=0&&f>u?-1:f,f>=0&&(r=t.slice(0,f),i=t.slice(f,u>0?u:t.length),s=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=Sc(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:Do(a)}}function ia(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Wn(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function aa(e,t,n){let r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&io(t.matched[r],n.matched[s])&&Kn(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function io(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Kn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!_c(e[n],t[n]))return!1;return!0}function _c(e,t){return wt(e)?Xi(e,t):wt(t)?Xi(t,e):e?.valueOf()===t?.valueOf()}function Xi(e,t){return wt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Sc(e,t){if(e.startsWith("/"))return e;if(!e)return t;let n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,a,u;for(a=0;a<r.length;a++)if(u=r[a],u!==".")if(u==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(a).join("/")}var Wt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ys=(function(e){return e.pop="pop",e.push="push",e})({}),Js=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function la(e){if(!e)if(lo){let t=document.querLine truncated
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},[Ge.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${gc(t)}" via a navigation guard.`},[Ge.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[Ge.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[Ge.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function rs(e,t){return Me(new Error,{type:e,[oa]:!0},t)}function Pt(e,t){return e instanceof Error&&oa in e&&(t==null||!!(e.type&t))}var yc=["params","query","hash"];function gc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of yc)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function ra(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(ji," "),i=n.indexOf("="),a=Es(i<0?n:n.slice(0,i)),u=i<0?null:Es(n.slice(i+1));if(a in t){let m=t[a];bt(m)||(m=t[a]=[m]),m.push(u)}else t[a]=u}return t}function jo(e){let t="";for(let o in e){let r=e[o];if(o=lc(o),r==null){r!==void 0&&(t+=(t.length?"&":"")+o);continue}(bt(r)?r.map(n=>n&&$o(n)):[r&&$o(r)]).forEach(n=>{n!==void 0&&(t+=(t.length?"&":"")+o,n!=null&&(t+="="+n))})}return t}function ia(e){let t={};for(let o in e){let r=e[o];r!==void 0&&(t[o]=bt(r)?r.map(n=>n==null?null:""+n):r==null?r:""+r)}return t}var aa=Symbol(""),Wo=Symbol(""),jn=Symbol(""),Wn=Symbol(""),Kn=Symbol("");function Ns(){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 Gt(e,t,o,r,n,i=a=>a()){let a=r&&(r.enterCallbacks[n]=r.enterCallbacks[n]||[]);return()=>new Promise((u,m)=>{let h=p=>{p===!1?m(rs(Ge.NAVIGATION_ABORTED,{from:o,to:t})):p instanceof Error?m(p):vc(p)?m(rs(Ge.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(a&&r.enterCallbacks[n]===a&&typeof p=="function"&&a.push(p),u())},v=i(()=>e.call(r&&r.instances[n],t,o,h)),k=Promise.resolve(v);e.length<3&&(k=k.then(h)),k.catch(p=>m(p))})}function Yn(e,t,o,r,n=i=>i()){let i=[];for(let a of e)for(let u in a.components){let m=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Bi(m)){let h=(m.__vccOpts||m)[t];h&&i.push(Gt(h,o,r,a,u,n))}else{let h=m();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let k=Zu(v)?v.default:v;a.mods[u]=v,a.components[u]=k;let p=(k.__vccOpts||k)[t];return p&&Gt(p,o,r,a,u,n)()}))}}return i}function la(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=>os(h,u))?r.push(u):o.push(u));let m=e.matched[a];m&&(t.matched.find(h=>os(h,m))||n.push(m))}return[o,r,n]}var bc=()=>location.protocol+"//"+location.host;function ba(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),zo(u,"")}return zo(o,e)+r+n}function wc(e,t,o,r){let n=[],i=[],a=null,u=({state:p})=>{let g=ba(e,location),w=o.value,b=t.value,T=0;if(p){if(o.value=g,t.value=p,a&&a===w){a=null;return}T=b?p.position-b.position:0}else r(g);n.forEach(N=>{N(o.value,w,{delta:T,type:Bn.pop,direction:T?T>0?Gn.forward:Gn.back:Gn.unknown})})};function m(){a=o.value}function h(p){n.push(p);let g=()=>{let w=n.indexOf(p);w>-1&&n.splice(w,1)};return i.push(g),g}function v(){if(document.visibilityState==="hidden"){let{history:p}=window;if(!p.state)return;p.replaceState(Me({},p.state,{scroll:rn()}),"")}}function k(){for(let p of i)p();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:m,listen:h,destroy:k}}function da(e,t,o,r=!1,n=!1){return{back:e,current:t,forward:o,replaced:r,position:window.history.length,scroll:n?rn():null}}function kc(e){let{history:t,location:o}=window,r={value:ba(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(m,h,v){let k=e.indexOf("#"),p=k>-1?(o.host&&document.querySelector("base")?e:e.slice(k))+m:bc()+e+m;try{t[v?"replaceState":"pushState"](h,"",p),n.value=h}catch(g){console.error(g),o[v?"replace":"assign"](p)}}function a(m,h){i(m,Me({},t.state,da(n.value.back,m,n.value.forward,!0),h,{position:n.value.position}),!0),r.value=m}function u(m,h){let v=Me({},n.value,t.state,{forward:m,scroll:rn()});i(v.current,v,!0),i(m,Me({},da(r.value,m,null),{position:v.position+1},h),!1),r.value=m}return{location:r,state:n,push:u,replace:a}}function wa(e){e=xi(e);let t=kc(e),o=wc(e,t.state,t.location,t.replace);function r(i,a=!0){a||o.pauseListeners(),history.go(i)}let n=Me({locatLine truncated
`)),e.options=Object.assign({},e.options,m.options)})}i();let a=null;e.saveDefault=u=>{u&&u.preventDefault&&u.preventDefault();let m={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",m).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(k=>{e.error=k},()=>{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."}))}},Ta=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)})}},Oa=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?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,m){let h={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(h===void 0)return;u.preventDefault();let v=e.features.length,k=h==="first"?0:h==="last"?v-1:(m+h+v)%v;e.feature=e.features[k].key,n(()=>{let p=r.document.getElementById("feature-tab-"+e.feature);p&&p.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function i(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests})}i();function a(u){let m={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return m;let h=new Array(u.length-1);for(let b=1;b<u.length;b++)h[b-1]=u[b]-u[b-1];let v=h.length,k=Math.max.apply(null,h),p=Math.min.apply(null,h),g=Math.min(0,p),w=k-g||1;m.viewW=v*2,m.bars=new Array(v);for(let b=0;b<v;b++){let T=(h[b]-g)/w,N=Math.max(1.5,T*34);m.bars[b]={x:(b*2+.25).toFixed(2),y:(36-N).toFixed(2),w:"1.5",h:N.toFixed(2)}}if(m.deltaToday=h[v-1],v>=2){let b=h[v-2];b&&(m.pctChange=(m.deltaToday-b)/b*100)}return m.pctAbs=Math.round(Math.abs(m.pctChange)),m.isUp=m.pctChange>=0,m}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let m=u.data||[];e.history={repositories:a(m.map(h=>h.nbRepositories||0)),users:a(m.map(h=>h.nbUsers||0)),pageViews:a(m.map(h=>h.nbPageViews||0)),pullRequests:a(m.map(h=>h.nbPullRequests||0))}})},Aa=function(e,t,o,r,n,i){let a=ht();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 m(C){return C==="ready"||C==="error"?C:C==="expired"||C==="expiring"?"expired":C===" Line truncated
`)),e.options=Object.assign({},e.options,W.options),e.options.expirationDate=W.options&&W.options.expirationDate?new Date(W.options.expirationDate):m(),D&&D()})}function p(D,V,W){e.anonymize&&e.anonymize[D]&&e.anonymize[D].setValidity(V,W)}function g(D){try{let V=parseGithubUrl(D);if(V&&V.owner&&V.repo)return V.owner+"/"+V.repo}catch{}return null}e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await N()}catch{}}};function w(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:g(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function b(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function T(){let D;try{D=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!D||D.path!==n.path()||Date.now()-D.savedAt>=30*6e4)return!1;for(let V of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(D.draft,V)&&(e[V]=D.draft[V]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await b(),sessionStorage.removeItem("github-access-draft"),!0}k(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(T,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async D=>{e.githubConnection=D.data.connection||"oauth",e.sourceUrl="https://github.com/"+D.data.source.fullName,e._originalFullName=D.data.source.fullName,e.terms=D.data.options.terms.filter(V=>V).join(`
`),e.source=D.data.source,e.role=D.data.role||"owner",e.coauthors=D.data.coauthors||[],e._originalBranch=D.data.source.branch,e.options=Object.assign({},e.options,D.data.options),e.conference=D.data.conference,e._originalConference=D.data.conference,e.repositoryID=D.data.source.repositoryID,e._originalRepositoryID=D.data.source.repositoryID,D.data.options.expirationDate&&(e.options.expirationDate=new Date(D.data.options.expirationDate)),!await T()&&(await Promise.all([N(),R()]),P())},()=>{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 D=>{if(e.githubConnection=D.data.connection||"oauth",e.sourceUrl="https://github.com/"+D.data.source.repositoryFullName+"/pull/"+D.data.source.pullRequestId,e.terms=D.data.options.terms.filter(V=>V).join(`
`),e.source=D.data.source,e.options=Object.assign({},e.options,D.data.options),e.conference=D.data.conference,e._originalConference=D.data.conference,D.data.options.expirationDate&&(e.options.expirationDate=new Date(D.data.options.expirationDate)),!await T())try{e.details=(await t.get(`/api/pr/${D.data.source.repositoryFullName}/${D.data.source.pullRequestId}`,{params:{connection:e.githubConnection}})).data}catch(V){let W=V&&V.data&&V.data.error;W&&(i("ERRORS."+W).then(oe=>{e.addToast({title:"Error",date:new Date,body:oe}),e.error=oe},console.error),De(W))}},()=>{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 D=>{e.sourceUrl="https://gist.github.com/"+D.data.source.gistId,e.terms=D.data.options.terms.filter(V=>V).join(`
`),e.source=D.data.source,e.options=Object.assign({},e.options,D.data.options),e.conference=D.data.conference,e._originalConference=D.data.conference,D.data.options.expirationDate&&(e.options.expirationDate=new Date(D.data.options.expirationDate)),!await T()&&await se()},()=>{n.url("/404")}))}),t.get("/github/connections").then(D=>{e.githubConnections=D.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&D.data.appEnabled&&D.data.appConnected&&(e.githubConnection="github-app")}).catch(()=>{}),e.urlSelected=async(D=!1)=>{e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,D||(e.terms=e.defaultTerms),!D&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],D||(e.source={type:"GitHubStream",branch:"",commit:""}),e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1;let V;try{V=parseGithubUrl(e.sourceUrl)}catch{p("sourceUrl","github",!1);return}p("sourceUrl","github",!0);try{V.gistId&&!V.repo?(e.detectedType="gist",e.source={gistId:V.gistId},await se()):V.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:V.owner+"/"+V.repo,pullRequestId:V.pullRequestId},await Z()):(e.detectedType="repo",await Promise.all([N(),R()]),P())}catch{return}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let D=e.branches.filter(W=>W.name==e.source.branch)[0];if(!D)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=D.commit),e.readme=D.readme,await R(),P()}),e.getBranches=async D=>{let V=parseGithubUrl(e.sourceUrl);try{let W=await t.get(`/api/repo/${V.owner}/${V.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&g(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:D===!0||e.reconnectingSource?"1":"0",repositoryID:w()}});e.branches=W.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let oe=e.branches.filter(le=>le.name==e.source.branch);oe.length>0&&(!(!e.reconnectingSource&&!D&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=oe[0].commit),e.readme=oe[0].readme,await R(D))}catch(W){e.branches=[],e.sourceUnreachable=W&&(W.status===404||W.data&&W.data.error==="repo_not_found");let oe=W&&W.data&&W.data.error||(W&&W.status===404?"repo_not_found":"unknown_error");i("ERRORS."+oe).then(le=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:le}),e.error=le},console.error),typeof p=="function"&&p("sourceUrl","missing",!1)}};async function N(){let D=parseGithubUrl(e.sourceUrl);try{Oe();let V=await t.get(`/api/repo/${D.owner}/${D.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&g(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:w(),force:"1"}});e.details=V.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(W=>{e.addToast({title:"Error",date:new Date,body:W}),e.error=W},console.error),De(V.data.error)),p("sourceUrl","missing",!1),V}}async function R(D){if(e.readme&&!D)return e.readme;let V=parseGithubUrl(e.sourceUrl);try{let W=await t.get(`/api/repo/${V.owner}/${V.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&g(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:D===!0?"1":"0",branch:e.source.branch,repositoryID:w()}});e.readme=W.data}catch{e.readme=""}}function I(){let D={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(D.branchName=e.source.branch);try{let V=parseGithubUrl(e.sourceUrl);D.repoName=`${V.owner}/${V.repo}`}catch{}return D}function C(D,V){let W=null,oe=0;return function(){W&&a.cancel(W),W=a(()=>{W=null;let U=++oe,te=D();te&&t.post("/api/anonymize-preview",te).then(L=>{U===oe&&V(L.data)},()=>{})},200)}}let A=C(()=>e.readme?{content:e.readme,options:I()}:null,D=>{e.anonymize_readme=D.content||"";let V="";try{let oe=parseGithubUrl(e.sourceUrl),le=e.source.branch||e.details&&e.details.defaultBranch||"main";V=`https://github.com/${oe.owner}/${oe.repo}/raw/${le}/`}catch{}let W=renderMD(e.anonymize_readme,V);e.html_readme=W,a(Prism.highlightAll,150)});function P(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),A())}async function Z(){let D=parseGithubUrl(e.sourceUrl);try{Oe();let V=await t.get(`/api/pr/${D.owner}/${D.repo}/${D.pullRequestId}`,{params:{connection:e.githubConnection}});e.details=V.data,e.pullRequestId||(e.pullRequestId=D.repo+"-PR"+D.pullRequestId+"-"+generateRandomId(4))}catch(V){throw V.data&&(i("ERRORS."+V.data.error).then(W=>{e.addToast({title:"Error",date:new Date,body:W}),e.error=W},console.error),De(V.data.error)),p("sourceUrl","missing",!1),V}}let Y=He(new Map),j=new Set;function z(){let D=new Set,V=e.details&&e.details.pullRequest;if(!V)return D;typeof V.title=="string"&&D.add(V.title),typeof V.body=="string"&&D.add(V.body),typeof V.diff=="string"&&D.add(V.diff);let W=V.comments||[];for(let oe of W)typeof oe.author=="string"&&D.add(oe.author),typeof oe.body=="string"&&D.add(oe.body);return D}let ae=C(()=>{let D=z();j=D;let V=Array.from(D);return V.length===0?null:{contents:V,options:I()}},D=>{if(!D||!Array.isArray(D.contents))return;let V=Array.from(j),W=new Map;for(let oe=0;oe<V.length&&oe<D.contents.length;oe++)W.set(V[oe],D.contents[oe]);Y.clear(),W.forEach((oe,le)=>Y.set(le,oe))});e.anonymizePrContent=function(D){return D&&(Y.has(D)?Y.get(D):(j.has(D)||ae(),D))};async function se(){let D=parseGithubUrl(e.sourceUrl);try{if(Oe(),e.gistOAuthRequired=!1,e.githubConnections?.oauthConnected===!1){e.gistOAuthRequired=!0,p("sourceUrl","missing",!1);return}let V=await t.get(`/api/gist/source/${D.gistId}`);e.details=V.data,e.gistId||(e.gistId="gist-"+D.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(V){if(V.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,p("sourceUrl","missing",!1);return}throw V.data&&(i("ERRORS."+V.data.error).then(W=>{e.addToast({title:"Error",date:new Date,body:W}),e.error=W},console.error),De(V.data.error)),p("sourceUrl","missing",!1),V}}let re=He(new Map),ue=new Set;function _e(){let D=new Set,V=e.details&&e.details.gist;if(!V)return D;typeof V.description=="string"&&D.add(V.description),typeof V.ownerLogin=="string"&&D.add(V.ownerLogin);let W=V.files||[];for(let le of W)typeof le.filename=="string"&&D.add(le.filename),typeof le.content=="string"&&D.add(le.content);let oe=V.comments||[];for(let le of oe)typeof le.author=="string"&&D.add(le.author),typeof le.body=="string"&&D.add(le.body);return D}let he=C(()=>{let D=_e();ue=D;let V=Array.from(D);return V.length===0?null:{contents:V,options:I()}},D=>{if(!D||!Array.isArray(D.contents))return;let V=Array.from(ue),W=new Map;for(let oe=0;oe<V.length&&oe<D.contents.length;oe++)W.set(V[oe],D.contents[oe]);re.clear(),W.forEach((oe,le)=>re.set(le,oe)),me()});e.anonymizeGistContent=function(D){return D&&(re.has(D)?re.get(D):(ue.has(D)||he(),D))},e.previewGistFiles=[];function me(){let D=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=D.map(V=>({filename:e.anonymizeGistContent(V.filename),content:e.anonymizeGistContent(V.content),language:V.language}))}e.watch("details.gist.files",me,!0),e.watch("terms",me);function pe(){let D=e.conference;if(e.conference_data=null,!D)return;let V=e.isUpdate&&D===e._originalConference;t.get("/api/conferences/"+D).then(W=>{e.conference===D&&(e.conference_data=W.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!V&&(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===D&&(e.conference_data=null)})}function Oe(){p("repoId","used",!0),p("repoId","format",!0),p("pullRequestId","used",!0),p("pullRequestId","format",!0),p("gistId","used",!0),p("gistId","format",!0),p("sourceUrl","used",!0),p("sourceUrl","missing",!0),p("sourceUrl","access",!0),p("sourceUrl","github",!0),p("commit","exists",!0),p("conference","activated",!0),p("terms","format",!0),e.termsRegexWarning=!1}function Te(){let D=e.anonymize&&e.anonymize.expirationDate;ret Line truncated
`).filter(le=>le),connection:e.githubConnection,fullName:`${V.owner}/${V.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(W.options.pageSource=e.details.pageSource),Oe();let oe=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(oe,W,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/status/"+e.repoId},le=>{le.data&&(i("ERRORS."+le.data.error).then(U=>{e.error=U},console.error),De(le.data.error))}).finally(()=>{D.target.disabled=!1})},e.anonymizeGist=D=>{if(Te())return;D.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),W={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(le=>le),source:{gistId:V.gistId},options:e.options,conference:e.conference};Oe();let oe=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(oe,W,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/gist/"+e.gistId},le=>{le.data&&(i("ERRORS."+le.data.error).then(U=>{e.error=U},console.error),De(le.data.error))}).finally(()=>{D.target.disabled=!1})},e.anonymizePullRequest=D=>{if(Te())return;D.target.disabled=!0;let V=parseGithubUrl(e.sourceUrl),W={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(le=>le),source:{repositoryFullName:`${V.owner}/${V.repo}`,pullRequestId:V.pullRequestId},options:e.options,conference:e.conference};Oe();let oe=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(oe,W,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/pr/"+e.pullRequestId},le=>{le.data&&(i("ERRORS."+le.data.error).then(U=>{e.error=U},console.error),De(le.data.error))}).finally(()=>{D.target.disabled=!1})},e.watch("conference",()=>{pe()}),e.watch("terms",()=>{e.detectedType==="repo"&&P(),e.detectedType==="pr"&&ae(),e.detectedType==="gist"&&he()}),e.watch("options.image",()=>{e.detectedType==="repo"&&P(),e.detectedType==="pr"&&ae(),e.detectedType==="gist"&&he()}),e.watch("options.link",()=>{e.detectedType==="repo"&&P(),e.detectedType==="pr"&&ae(),e.detectedType==="gist"&&he()}),e.watch("details",()=>{e.detectedType==="pr"&&ae(),e.detectedType==="gist"&&he()},!0)},Jo=function(e,t,o,r,n,i){let a=ht(),u=ls(),m=0,h=!1;e.on("dispose",()=>{h=!0,m++,v&&v.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(document,"keydown",function(z){if((z.metaKey||z.ctrlKey)&&z.key==="k"){z.preventDefault();var ae=document.querySelector(".tree-search-input");ae&&(ae.focus(),ae.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let z=e.fileSearchQuery;if(!z||z.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let ae=i.defer();v=ae,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(z)}`,{timeout:ae.promise}).then(function(se){if(!(h||v!==ae)){v=null,e.fileSearchLoading=!1;var re={};e.files.forEach(function(U){re[(U.path||"")+"/"+U.name]=!0});for(var ue=[],_e={},he=0;he<se.data.length;he++){var me=se.data[he];if(me.path)for(var pe=me.path.split("/"),Oe="",Te=0;Te<pe.length;Te++){var De=Oe;Oe=Oe?Oe+"/"+pe[Te]:pe[Te];var D=De+"/"+pe[Te];!re[D]&&!_e[D]&&(_e[D]=!0,ue.push({name:pe[Te],path:De}))}}ue.sort(function(U,te){return(U.path||"").split("/").length-(te.path||"").split("/").length}),ue.length>0&&e.files.push.apply(e.files,ue);for(var V=[],W=0;W<se.data.length;W++){var oe=se.data[W],le=(oe.path||"")+"/"+oe.name;!re[le]&&oe.size!=null&&(V.push(oe),re[le]=!0)}V.length>0&&e.files.push.apply(e.files,V),e.fileSearchResults=se.data}},function(){!h&&v===ae&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let k={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},p=["license","txt"],g=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],w=["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(z,ae){if(e.repoId!=r.repoId)return j();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(se=>se&&se.trim().length>0),Y();for(let se=0;se<e.paths.length-1;se++){let re=se>0?e.paths.slice(0,se).join("/"):"";e.files.some(_e=>_e.path===re)||e.getFiles(re)}}});function T(){if(e.paths[0]!="")return;let z=["readme.md","readme.txt","readme.org","readme.1st","readme"],ae={};for(let re of e.files)re.name.toLowerCase().indexOf("readme")>-1&&(ae[re.name.toLowerCase()]=re.name);let se=null;for(let re of z)if(ae[re]){se=re;break}if(!se&&Object.keys(ae).length>0&&(se=Object.keys(ae)[0]),se){let re=o.url();re[re.length-1]!="/"&&(re+="/"),o.url(re+encodePathForUrl(ae[se]))}}e.fileCounts=null,e.getFiles=function(z){let ae=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(z)}&v=${e.options.lastUpdateDate}`).then(function(se){if(h||ae!==e.repoId)return[];let re=z||"";return e.files=e.files.filter(ue=>ue.path!==re),e.files.push(...se.data),se.data},function(se){if(h||ae!==e.repoId)return[];e.type="error",e.content=se&&se.data&&se.data.error||"unknown_error",e.files=[]})};function N(){let z=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(ae){h||z!==e.repoId||(e.fileCounts=ae.data)},function(){e.fileCounts={}})}function R(){return e.files.filter(z=>z.name==e.paths[e.paths.length-1]&&z.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(z){if(h)return;let ae=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(se=>{if(!(h||ae!==e.repoId)){if(e.options=se.data,e.options.url){window.location=e.options.url;return}z&&z(se.data)}},se=>{if(!(h||ae!==e.repoId)){var re=se.data||{};if(re.error==="rate_limited"&&re.resetAt){let _e=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(z);else{var me=Math.floor(he/60),pe=he%60;e.rateLimitCountdown=me>0?me+"m "+pe+"s":pe+"s"}};var ue=_e;e.type="rate_limited",e.rateLimitResetAt=re.resetAt,I&&a.interval.cancel(I),_e(),I=a.interval(_e,1e3)}else re.error==="re Line truncated
`+b.join(`
`)],{type:"text/csv"}),N=document.createElement("a");N.href=URL.createObjectURL(T),N.download=r.username+"-repositories.csv",N.click()},e.showStatusMessage=p=>{let g=p.statusMessage||"(no message)";window.prompt(`Status message for ${p.repoId} (${p.status}):`,g)},e.fetchGithubInfo=p=>{let g=window.open("","_blank");g&&g.document.write("<pre>Loading GitHub info for "+p.repoId+"...</pre>"),t.get("/api/admin/repos/"+p.repoId+"/github").then(w=>{g&&(g.document.open(),g.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(w.data,null,2).replace(/[<>]/g,b=>b==="<"?"&lt;":"&gt;")+"</pre>"),g.document.close())},w=>{let b=w&&w.data?JSON.stringify(w.data,null,2):String(w);g&&(g.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+b+"</pre>")})};function m(p){t.get("/api/admin/users/"+p+"/repos",{}).then(g=>{e.repositories=g.data},g=>{console.error(g)})}function h(p){t.get("/api/admin/users/"+p,{}).then(g=>{e.userInfo=g.data},g=>{console.error(g)})}h(r.username),m(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>h(r.username),p=>console.error(p))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>h(r.username),p=>console.error(p))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>h(r.username),p=>console.error(p))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>h(r.username),p=>console.error(p))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function v(){t.get("/api/admin/tokens").then(p=>{e.tokens=p.data||[]},p=>{p.status!==401&&p.status!==403&&console.error(p)})}v(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(p=>{e.tokenForm.plaintext=p.data.token,e.tokenForm.name="",v()},p=>console.error(p))},e.revokeToken=p=>{confirm(`Revoke token "${p.name}"?`)&&t.delete("/api/admin/tokens/"+p.id).then(()=>v(),g=>console.error(g))},e.removeCache=p=>{confirm("Remove cached files for "+p.repoId+"?")&&t.delete("/api/admin/repos/"+p.repoId).then(()=>m(r.username),g=>console.error(g))},e.removeRepository=p=>{confirm("Remove repository "+p.repoId+"?")&&t.delete("/api/repo/"+p.repoId+"/").then(()=>m(r.username),g=>console.error(g))},e.updateRepository=p=>{let g=He({title:`Refreshing ${p.repoId}...`,date:new Date,body:`The repository ${p.repoId} is going to be refreshed.`});e.toasts.push(g),t.post(`/api/repo/${p.repoId}/refresh`).then(w=>{w.data.status=="ready"?g.title=`${p.repoId} is refreshed.`:g.title=`Refreshing of ${p.repoId}.`},w=>{g.title=`Error during the refresh of ${p.repoId}.`,g.body=w.body})},e.getGitHubRepositories=p=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(g=>{e.userInfo.repositories=g.data})};let k=null;e.watch("query",()=>{n.timeout.cancel(k),k=n.timeout(()=>{m(r.username)},500)},!0)},Ha=function(e,t,o){let r=ht(),n=ls();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=w=>{if(w.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){w.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=w=>{w==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[w]="",e.query.page=1},e.chips=[];let a=()=>{let w=[];(e.query.dateFrom||e.query.dateTo)&&w.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=w};e.statusCountFor=w=>{let b=(e.statusCounts||[]).find(T=>T._id===w);return b?b.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=w=>{e.query.sort===w?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=w,e.query.direction="desc"),e.query.page=1},e.sortIcon=w=>e.query.sort===w?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",m={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},h=loadFilterPrefs(u)||{};e.query=Object.assign({},m,h,{page:1,search:""});let v=o.search();v.search&&(e.query.search=v.search);let k="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(k)||"[]"),e.savePreset=()=>{let w=window.prompt("Preset name:");if(!w)return;let b=Object.assign({},e.query);delete b.page,e.presets=(e.presets||[]).filter(T=>T.name!==w),e.presets.push({name:w,query:b}),localStorage.setItem(k,JSON.stringify(e.presets))},e.applyPreset=w=>{Object.assign(e.query,w.query,{page:1})},e.deletePreset=w=>{e.presets=(e.presets||[]).filter(b=>b.name!==w.name),localStorage.setItem(k,JS Line truncated
`).map((he,me)=>me===0?he:_e+he).join(`
`)}else typeof j=="number"||typeof j=="boolean"?ue=String(j):ue=JSON.stringify(j);Z.push(`${se}${ue}${re}`)}),Z.push("}"),Z.join(`
`)}function h(N){let R=[],I="",C=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,A=0,P;for(;P=C.exec(N);)I+=N.slice(A,P.index),A=C.lastIndex,R.push({key:P[1],op:P[2]||"=",val:P[3]});return I+=N.slice(A),{filters:R,free:I.trim().toLowerCase()}}function v(N,R){for(let I of R.filters){let C=(P,Z,Y)=>{let j=parseFloat(P),z=parseFloat(Z);return Y==="="?String(P)===String(Z):Y==="!="?String(P)!==String(Z):Y===">="?j>=z:Y==="<="?j<=z:Y===">"?j>z:Y==="<"?j<z:!0},A;if(I.key==="code")A=N.displayMessage;else if(I.key==="module")A=N.module;else if(I.key==="status")A=N._status;else if(I.key==="url")A=N._url;else if(I.key==="repo")A=N._repoId;else if(I.key==="level")A=N.level;else continue;if(A==null||!C(A,I.val,I.op))return!1}return!(R.free&&((N.displayMessage||"")+" "+(N.module||"")+" "+(N._url||"")+" "+JSON.stringify(N.raw||[])).toLowerCase().indexOf(R.free)===-1)}function k(){let N=h(e.query.search||"");e.parsedFilterCount=N.filters.length;let R=e.query.bucket,I=e.entries.filter(A=>R&&A._bucket!==R?!1:v(A,N)),C=e.query.group;if(C){let A=Y=>C==="module"?Y.module:Y.displayMessage||Y.message||"_",P=new Map;for(let Y of I){let j=A(Y);if(P.has(j)){let z=P.get(j);z.count++,z._related.push(Y),new Date(Y.ts)>new Date(z.ts)&&(z.ts=Y.ts,z._url=Y._url,z._status=Y._status),new Date(Y.ts)<new Date(z._firstSeen)&&(z._firstSeen=Y.ts)}else{let z=Object.assign({},Y);z._key=`${C}:${j}`,z._related=[Y],z._firstSeen=Y.ts,z._lastHourCount=0,z.count=1,P.set(j,z)}}let Z=Date.now()-3600*1e3;for(let Y of P.values())Y._lastHourCount=Y._related.filter(j=>new Date(j.ts).getTime()>=Z).length;I=Array.from(P.values())}else I=I.map((A,P)=>(A._key="row:"+P+":"+A.ts,A._related=[A],A._firstSeen=A.ts,A._lastHourCount=0,A.count=1,A));e.query.sort==="count"?I.sort((A,P)=>P.count-A.count||new Date(P.ts)-new Date(A.ts)):I.sort((A,P)=>new Date(P.ts)-new Date(A.ts)),e.visible=I}function p(N){let R=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:R,limit:I}}).then(C=>{let A=(C.data.entries||[]).map(u);e.entries=N?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,k()},C=>console.error(C))}e.loadMore=()=>p(!0),e.canLoadMore=()=>e.entries.length<e.total;function g(){t.get("/api/admin/errors/stats").then(N=>{let R=N.data||{},I=R.prev24h?Math.round((R.last24h-R.prev24h)/R.prev24h*100):0;e.stats={last24h:R.last24h||0,prev24h:R.prev24h||0,delta:I,severity:R.severity||{error:0,warn:0,info:0},unique:R.unique||{error:0,warn:0,info:0},buckets:R.buckets||[],dropped:R.dropped||0}},N=>console.error(N))}function w(){p(),g()}e.barPx=(N,R)=>{let I=e.stats.buckets||[],C=0;for(let Y of I)C=Math.max(C,(Y.error||0)+(Y.warn||0)+(Y.info||0));if(!C)return 0;let A=(N.error||0)+(N.warn||0)+(N.info||0);if(!A)return 0;let P=Math.round(A/C*60),Z=N[R]||0;return Math.round(Z/A*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=w,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(w,N=>console.error(N))},e.exportCsv=()=>{let N=["ts","level","module","displayMessage","_status","_url","_repoId"],R=[N.join(",")];for(let P of e.visible)R.push(N.map(Z=>{let Y=P[Z]==null?"":String(P[Z]);return/[",\n]/.test(Y)?`"${Y.replace(/"/g,'""')}"`:Y}).join(","));let I=new Blob([R.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 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"))},w();let T=r(()=>{e.query.autoRefresh&&w()},15e3);e.on("dispose",()=>r.cancel(T)),e.watch("query.search",k),e.watch("query.bucket",k),e.watch("query.sort",k),e.watch("query.group",k)},ja=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(p){if(p==null)return"\u2014";for(var g=["B","KB","MB","GB","TB"],w=0,b=p;b>=1024&&w<g.length-1;)b/=1024,w++;return b.toFixed(w>0?1:0)+" "+g[w]}e.humanBytes=n;function i(p){if(!p)return"\u2014";var g=Math.floor(p/86400),w=Math.floor(p%86400/3600),b=Math.floor(p%3600/60);return g>0?g+"d "+(w<10?"0":"")+w+"h":w>0?w+"h "+(b<10?"0":"")+b+"m":b+"m"}e.humanDuration=i;function a(p){return p==null?"\u2014":p>=1e6?(p/1e6).toFixed(1)+"M":p>=1e3?(p/1e3).toFixed(1)+"K":String(p)}e.humanNum=a,e.queueTotal=function(p){return p?(p.waiting||0)+(p.active||0)+(p.delayed||0)+(p.failed||0):0},e.statusCount=function(p){if(!e.data||!e.data.repos)return 0;for(var g=e.data.repos.statusBreakdown||[],w=0;w<g.length;w++)if(g[w]._id===p)return g[w].count;return 0},e.barPct=function(p){var g=e.data&&e.data.repos?e.data.repos.total:0;if(!g)return 0;var w=[p];p==="expired"&&w.push("expiring"),p==="removed"&&w.push("removing"),p==="preparing"&&w.push("download");var b=0;return w.forEach(function(T){b+=e.statusCount(T)}),Math.max(.4,b/g*100)},e.errPct=function(p){if(!e.data||!e.data.errors)return 0;var g=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[p]/g*100};function u(p){var g=p||[];return g.map(function(w,b){var T=g[b-1]||{},N=Object.assign({},w);return N.dailyRepositories=b?Math.max(0,(w.nbRepositories||0)-(T.nbRepositories||0)):0,N.dailyUsers=b?Math.max(0,(w.nbUsers||0)-(T.nbUsers||0)):0,N.dailyPageViews=b?Math.max(0,(w.nbPageViews||0)-(T.nbPageViews||0)):0,N})}function m(p){var g=p&&p.length?p[p.length-1]:{};return{repositories:g.dailyRepositories||0,users:g.dailyUsers||0,pageViews:g.dailyPageViews||0}}var h={};e.historyBarH=function(p,g){return!p||!h[g]?0:Math.max(1,Math.round(p[g]/h[g]*140))},e.historyLabel=function(p){if(!p||!p.date)return"";var g=new Date(p.date);return g.getUTCMonth()+1+"/"+g.getUTCDate()};function v(){t.get("/api/admin/overview").then(function(p){p.data.history=u(p.data.history),p.data.daily={today:m(p.data.history)},e.data=p.data,e.loading=!1,e.error=null,h={},(p.data.history||[]).forEach(function(g){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(w){(!h[w]||g[w]>h[w])&&(h[w]=g[w])})})},function(p){e.loading=!1,e.error=p.data&&p.data.error||"Failed to load overview"})}v();var k=r(v,3e4);e.on("dispose",function(){r.cancel(k)})};var Wa=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>$a(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Ua(e,t.http)},{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>Oa(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)=>Aa(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)=>Jn(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)=>Jn(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)=>Jn(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)=>Ia(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>qa(e,t.http,t.location) Line truncated
anonymous_github`)])])])])]),f(" 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). ")])])])])]),f(" 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. ")])])])]),f(" 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
`+JSON.stringify(t):""}`},[je.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Ac(t)}" via a navigation guard.`},[je.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[je.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[je.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return Oe(new Error,{type:e,[fa]:!0},t)}function Mt(e,t){return e instanceof Error&&fa in e&&(t==null||!!(e.type&t))}var Tc=["params","query","hash"];function Ac(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let n of Tc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ma(e){let t={};if(e===""||e==="?")return t;let n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){let s=n[r].replace(ea," "),i=s.indexOf("="),a=Do(i<0?s:s.slice(0,i)),u=i<0?null:Do(s.slice(i+1));if(a in t){let f=t[a];wt(f)||(f=t[a]=[f]),f.push(u)}else t[a]=u}return t}function Qn(e){let t="";for(let n in e){let r=e[n];if(n=wc(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(wt(r)?r.map(s=>s&&Hn(s)):[r&&Hn(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function ha(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=wt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}var va=Symbol(""),Xn=Symbol(""),Qs=Symbol(""),Xs=Symbol(""),Zs=Symbol("");function To(){let e=[];function t(r){return e.push(r),()=>{let s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Gt(e,t,n,r,s,i=a=>a()){let a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((u,f)=>{let h=m=>{m===!1?f(ao(je.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?f(m):Rc(m)?f(ao(je.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),u())},v=i(()=>e.call(r&&r.instances[s],t,n,h)),b=Promise.resolve(v);e.length<3&&(b=b.then(h)),b.catch(m=>f(m))})}function xs(e,t,n,r,s=i=>i()){let i=[];for(let a of e)for(let u in a.components){let f=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Zi(f)){let h=(f.__vccOpts||f)[t];h&&i.push(Gt(h,n,r,a,u,s))}else{let h=f();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let b=uc(v)?v.default:v;a.mods[u]=v,a.components[u]=b;let m=(b.__vccOpts||b)[t];return m&&Gt(m,n,r,a,u,s)()}))}}return i}function ga(e,t){let n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let u=t.matched[a];u&&(e.matched.find(h=>io(h,u))?r.push(u):n.push(u));let f=e.matched[a];f&&(t.matched.find(h=>io(h,f))||s.push(f))}return[n,r,s]}var Oc=()=>location.protocol+"//"+location.host;function Ra(e,t){let{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,u=s.slice(a);return u[0]!=="/"&&(u="/"+u),Wn(u,"")}return Wn(n,e)+r+s}function Ic(e,t,n,r){let s=[],i=[],a=null,u=({state:m})=>{let w=Ra(e,location),C=n.value,k=t.value,R=0;if(m){if(n.value=w,t.value=m,a&&a===C){a=null;return}R=k?m.position-k.position:0}else r(w);s.forEach(D=>{D(n.value,C,{delta:R,type:Ys.pop,direction:R?R>0?Js.forward:Js.back:Js.unknown})})};function f(){a=n.value}function h(m){s.push(m);let w=()=>{let C=s.indexOf(m);C>-1&&s.splice(C,1)};return i.push(w),w}function v(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Oe({},m.state,{scroll:ds()}),"")}}function b(){for(let m of i)m();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:f,listen:h,destroy:b}}function ya(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ds():null}}function Pc(e){let{history:t,location:n}=window,r={value:Ra(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(f,h,v){let b=e.indexOf("#"),m=b>-1?(n.host&&document.querySelector("base")?e:e.slice(b))+f:Oc()+e+f;try{t[v?"replaceState":"pushState"](h,"",m),s.value=h}catch(w){console.error(w),n[v?"replace":"assign"](m)}}function a(f,h){i(f,Oe({},t.state,ya(s.value.back,f,s.value.forward,!0),h,{position:s.value.position}),!0),r.value=f}function u(f,h){let v=Oe({},s.value,t.state,{forward:f,scroll:ds()});i(v.current,v,!0),i(f,Oe({},ya(r.value,f,null),{position:v.position+1},h),!1),r.value=f}return{location:r,state:s,push:u,replace:a}}function Ta(e){e=la(e);let t=Pc(e),n=Ic(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}let s=Oe({locatLine truncated
`)),e.options=Object.assign({},e.options,h.options),i.restore()})}a();let u=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let h=i.checkpoint(),v={terms:e.terms.split(`
`).map(b=>b.trim()).filter(b=>b.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",v).then(()=>{i.accept(h),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",u&&r.cancel(u),u=r(()=>{e.message=null},2500)},b=>{e.saving=!1;let w="ERRORS."+(b&&b.data&&b.data.error);n(w).then(C=>{e.error=C&&C!==w?C:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},La=function(e,t,n){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{n.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Ua=function(e,t,n,r,s){e.user&&!e.user.status&&n.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&n.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,f){let h={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(h===void 0)return;u.preventDefault();let v=e.features.length,b=h==="first"?0:h==="last"?v-1:(f+h+v)%v;e.feature=e.features[b].key,s(()=>{let m=r.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function i(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests})}i();function a(u){let f={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return f;let h=new Array(u.length-1);for(let k=1;k<u.length;k++)h[k-1]=u[k]-u[k-1];let v=h.length,b=Math.max.apply(null,h),m=Math.min.apply(null,h),w=Math.min(0,m),C=b-w||1;f.viewW=v*2,f.bars=new Array(v);for(let k=0;k<v;k++){let R=(h[k]-w)/C,D=Math.max(1.5,R*34);f.bars[k]={x:(k*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(f.deltaToday=h[v-1],v>=2){let k=h[v-2];k&&(f.pctChange=(f.deltaToday-k)/k*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let f=u.data||[];e.history={repositories:a(f.map(h=>h.nbRepositories||0)),users:a(f.map(h=>h.nbUsers||0)),pageViews:a(f.map(h=>h.nbPageViews||0)),pullRequests:a(f.map(h=>h.nbPullRequests||0))}})},Fa=function(e,t,n,r,s,i){let a=ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,rt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Kt()(document,"click",_=>{e.quotaExpanded&&!_.target.closest?.(".dashboard-quota")&& Line truncated
`)),e.options=Object.assign({},e.options,M.options),e.options.expirationDate=M.options&&M.options.expirationDate?new Date(M.options.expirationDate):T(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),E&&E()})}function I(E,P,M){e.anonymize&&e.anonymize[E]&&e.anonymize[E].setValidity(P,M)}function J(E){try{let P=parseGithubUrl(E);if(P&&P.owner&&P.repo)return P.owner+"/"+P.repo}catch{}return null}e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await ae()}catch{}}};function Y(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:J(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function K(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function B(){let E;try{E=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!E||E.path!==s.path()||Date.now()-E.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await K(),!0):!1;R.restore();for(let P of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(E.draft,P)&&(e[P]=E.draft[P]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await K(),sessionStorage.removeItem("github-access-draft"),!0}O(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(B,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async E=>{e.githubConnection=E.data.connection||"oauth",e.sourceUrl="https://github.com/"+E.data.source.fullName,e._originalFullName=E.data.source.fullName,e.terms=E.data.options.terms.filter(P=>P).join(`
`),e.source=E.data.source,e.role=E.data.role||"owner",e.coauthors=E.data.coauthors||[],e._originalBranch=E.data.source.branch,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,e.repositoryID=E.data.source.repositoryID,e._originalRepositoryID=E.data.source.repositoryID,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B()&&(await Promise.all([ae(),oe()]),ve())},()=>{s.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async E=>{if(e.githubConnection=E.data.connection||"oauth",e.sourceUrl="https://github.com/"+E.data.source.repositoryFullName+"/pull/"+E.data.source.pullRequestId,e.terms=E.data.options.terms.filter(P=>P).join(`
`),e.source=E.data.source,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B())try{await me()}catch{}},()=>{s.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async E=>{e.sourceUrl="https://gist.github.com/"+E.data.source.gistId,e.terms=E.data.options.terms.filter(P=>P).join(`
`),e.source=E.data.source,e.options=Object.assign({},e.options,E.data.options),e.conference=E.data.conference,e._originalConference=E.data.conference,E.data.options.expirationDate&&(e.options.expirationDate=new Date(E.data.options.expirationDate)),C=k(parseGithubUrl(e.sourceUrl)),!await B()&&await Se()},()=>{s.url("/404")}))}),t.get("/github/connections").then(E=>{e.githubConnections=E.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&E.data.appEnabled&&E.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&K())}).catch(()=>{}),e.urlSelected=async(E=!1)=>{let P=++f,M;try{M=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,he.cancel(),Ee.cancel(),Ve.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",I("sourceUrl","github",!1);return}let z=k(M),y=E||C===z;C=z,e.sourceUrlError="",I("sourceUrl","github",!0);let S=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,S&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!y&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],y||(e.source={type:"GitHubStream",branch:"",commit:""}),he.cancel(),Ee.cancel(),Ve.cancel(),ie.clear(),Ce.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e._preservingDraft=y;try{M.gistId&&!M.repo?(e.detectedType="gist",e.source={gistId:M.gistId},await Se()):M.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:M.owner+"/"+M.repo,pullRequestId:M.pullRequestId},await me()):(e.detectedType="repo",await Promise.all([ae(),oe()]),ve())}catch{}finally{P===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let E=e.branches.filter(M=>M.name==e.source.branch)[0];if(!E)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&!!e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=E.commit),e.readme=E.readme,await oe(),ve()}),e.getBranches=async E=>{let P=parseGithubUrl(e.sourceUrl),M=m();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0||e.reconnectingSource?"1":"0",repositoryID:Y()}});if(!b(M))return;e.branches=z.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let y=e.branches.filter(S=>S.name==e.source.branch);y.length>0&&(!(!e.reconnectingSource&&!E&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=y[0].commit),e.readme=y[0].readme,await oe(E))}catch(z){if(!b(M))return;e.branches=[],e.sourceUnreachable=z&&(z.status===404||z.data&&z.data.error==="repo_not_found");let y=z&&z.data&&z.data.error||(z&&z.status===404?"repo_not_found":"unknown_error");i("ERRORS."+y).then(S=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:S}),e.error=S},console.error),typeof I=="function"&&I("sourceUrl","missing",!1)}finally{w(M)}};async function ae(){let E=parseGithubUrl(e.sourceUrl),P=m();try{U();let M=await t.get(`/api/repo/${E.owner}/${E.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:Y(),force:"1"}});if(!b(P))return;e.details=M.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(M){if(!b(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}async function oe(E){if(e.readme&&!E)return e.readme;let P=parseGithubUrl(e.sourceUrl),M=m();try{let z=await t.get(`/api/repo/${P.owner}/${P.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&J(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:E===!0?"1":"0",branch:e.source.branch,repositoryID:Y()}});b(M,!0)&&(e.readme=z.data)}catch{b(M,!0)&&(e.readme="")}finally{w(M)}}function ne(){let E={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(E.branchName=e.source.branch);try{let P=parseGithubUrl(e.sourceUrl);E.repoName=`${P.owner}/${P.repo}`}catch{}return E}function ue(E,P,M){let z=null,y=0,S=()=>{if(e.detectedType!==E)return;z&&a.cancel(z);let q=++y;e.previewStatus="loading",z=a(()=>{z=null;let H=P();if(!H){e.previewStatus="idle";return}t.post("/api/anonymize-preview",H).then(j=>{q===y&&(M(j.data,H),e.previewStatus="ready")}).catch(()=>{q===y&&(e.previewStatus="error")})},200)};return S.cancel=()=>{y++,z&&a.cancel(z),z=null},e.on("dispose",S.cancel),S}e.retryPreview=()=>{e.detectedType==="repo"&&he(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()};let he=ue("repo",()=>e.readme?{content:e.readme,options:ne()}:null,E=>{if(typeof E?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=E.content;let P="";try{let z=parseGithubUrl(e.sourceUrl),y=e.source.branch||e.details&&e.details.defaultBranch||"main";P=`https://github.com/${z.owner}/${z.repo}/raw/${y}/`}catch{}let M=renderMD(e.anonymize_readme,P);e.html_readme=M,a(Prism.highlightAll,150)});function ve(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),he())}async function me(){let E=parseGithubUrl(e.sourceUrl),P=m();try{U();let M=await t.get(`/api/pr/${E.owner}/${E.repo}/${E.pullRequestId}`,{params:{connection:e.githubConnection}});if(!b(P))return;e.details=M.data,e.pullRequestId||(e.pullRequestId=E.repo+"-PR"+E.pullRequestId+"-"+generateRandomId(4))}catch(M){if(!b(P))return;throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}let ie=He(new Map);function Pe(){let E=new Set,P=e.details&&e.details.pullRequest;if(!P)return E;typeof P.title=="string"&&E.add(P.title),typeof P.body=="string"&&E.add(P.body),typeof P.diff=="string"&&E.add(P.diff);let M=P.comments||[];for(let z of M)typeof z.author=="string"&&E.add(z.author),typeof z.body=="string"&&E.add(z.body);return E}let Ee=ue("pr",()=>{let E=Pe(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);ie.clear(),z.forEach((y,S)=>ie.set(S,y))});e.anonymizePrContent=function(E){return E&&(ie.has(E)?ie.get(E):"")};async function Se(){let E=parseGithubUrl(e.sourceUrl),P=m();try{if(U(),e.gistOAuthRequired=!1,e.githubConnections?.oauthConnected===!1){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}let M=await t.get(`/api/gist/source/${E.gistId}`);if(!b(P))return;e.details=M.data,e.gistId||(e.gistId="gist-"+E.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(M){if(!b(P))return;if(M.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,I("sourceUrl","missing",!1);return}throw M.data&&(i("ERRORS."+M.data.error).then(z=>{e.addToast({title:"Error",date:new Date,body:z}),e.error=z},console.error),F(M.data.error)),I("sourceUrl","missing",!1),M}finally{w(P)}}let Ce=He(new Map);function Te(){let E=new Set,P=e.details&&e.details.gist;if(!P)return E;typeof P.description=="string"&&E.add(P.description),typeof P.ownerLogin=="string"&&E.add(P.ownerLogin);let M=P.files||[];for(let y of M)typeof y.filename=="string"&&E.add(y.filename),typeof y.content=="string"&&E.add(y.content);let z=P.comments||[];for(let y of z)typeof y.author=="string"&&E.add(y.author),typeof y.body=="string"&&E.add(y.body);return E}let Ve=ue("gist",()=>{let E=Te(),P=Array.from(E);return P.length===0?null:{contents:P,options:ne()}},(E,P)=>{if(!Array.isArray(E?.contents)||E.contents.length!==P.contents.length||E.contents.some(y=>typeof y!="string"))throw Error("Invalid preview response");let M=P.contents,z=new Map;for(let y=0;y<M.length&&y<E.contents.length;y++)z.set(M[y],E.contents[y]);Ce.clear(),z.forEach((y,S)=>Ce.set(S,y)),Ue()});e.anonymizeGistContent=function(E){return E&&(Ce.has(E)?Ce.get(E):"")},e.previewGistFiles=[];function Ue(){let E=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=E.map(P=>({filename:e.anonymizeGistContent(P.filename),content:e.anonymizeGistContent(P.content),language:P.language}))}e.watch("details.gist.files",Ue,!0),e.watch("terms",Ue);function Fe(){let E=e.conference;if(e.conference_data=null,!E)return;let P=e.isUpdate&&E===e._originalConference;t.get("/api/conferences/"+E).then(M=>{e.conference===E&&(e.conference_data=M.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!P&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.ima Line truncated
`).filter(S=>S),connection:e.githubConnection,fullName:`${M.owner}/${M.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(z.options.pageSource=e.details.pageSource),U();let y=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.anonymizeGist=E=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let P=E.currentTarget||E.target.closest?.("button")||E.target;P.disabled=!0;let M=parseGithubUrl(e.sourceUrl),z={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(S=>S),source:{gistId:M.gistId},options:e.options,conference:e.conference};U();let y=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.anonymizePullRequest=E=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let P=E.currentTarget||E.target.closest?.("button")||E.target;P.disabled=!0;let M=parseGithubUrl(e.sourceUrl),z={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(S=>S),source:{repositoryFullName:`${M.owner}/${M.repo}`,pullRequestId:M.pullRequestId},options:e.options,conference:e.conference};U();let y=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(y,z,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},S=>{S.data&&(i("ERRORS."+S.data.error).then(q=>{e.error=q},console.error),F(S.data.error))}).finally(()=>{P.disabled=!1})},e.watch("conference",()=>{Fe()}),e.watch("terms",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()}),e.watch("details",()=>{e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&Ve()},!0)},tr=function(e,t,n,r,s,i){let a=ct(),u=Kt(),f=0,h=!1;e.on("dispose",()=>{h=!0,f++,v&&v.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(document,"keydown",function(B){if((B.metaKey||B.ctrlKey)&&B.key==="k"){B.preventDefault();var ae=document.querySelector(".tree-search-input");ae&&(ae.focus(),ae.select())}});var v=null;e.onFileSearchChange=function(){v&&(v.resolve(),v=null);let B=e.fileSearchQuery;if(!B||B.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let ae=i.defer();v=ae,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(B)}`,{timeout:ae.promise}).then(function(oe){if(!(h||v!==ae)){v=null,e.fileSearchLoading=!1;var ne={};e.files.forEach(function(U){ne[(U.path||"")+"/"+U.name]=!0});for(var ue=[],he={},ve=0;ve<oe.data.length;ve++){var me=oe.data[ve];if(me.path)for(var ie=me.path.split("/"),Pe="",Ee=0;Ee<ie.length;Ee++){var Se=Pe;Pe=Pe?Pe+"/"+ie[Ee]:ie[Ee];var Ce=Se+"/"+ie[Ee];!ne[Ce]&&!he[Ce]&&(he[Ce]=!0,ue.push({name:ie[Ee],path:Se}))}}ue.sort(function(U,te){return(U.path||"").split("/").length-(te.path||"").split("/").length}),ue.length>0&&e.files.push.apply(e.files,ue);for(var Te=[],Ve=0;Ve<oe.data.length;Ve++){var Ue=oe.data[Ve],Fe=(Ue.path||"")+"/"+Ue.name;!ne[Fe]&&Ue.size!=null&&(Te.push(Ue),ne[Fe]=!0)}Te.length>0&&e.files.push.apply(e.files,Te),e.fileSearchResults=oe.data}},function(){!h&&v===ae&&(v=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let b={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},m=["license","txt"],w=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],C=["wav","mp3","ogg","wma","flac","aac","m4a"],k=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(B,ae){if(e.repoId!=r.repoId)return K();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(oe=>oe&&oe.trim().length>0),Y();for(let oe=0;oe<e.paths.length-1;oe++){let ne=oe>0?e.paths.slice(0,oe).join("/"):"";e.files.some(he=>he.path===ne)||e.getFiles(ne)}}});function R(){if(e.paths[0]!="")return;let B=["readme.md","readme.txt","readme.org","readme.1st","readme"],ae={};for(let ne of e.files)ne.name.toLowerCase().indexOf("readme")>-1&&(ae[ne.name.toLowerCase()]=ne.name);let oe=null;for(let ne of B)if(ae[ne]){oe=ne;break}if(!oe&&Object.keys(ae).length>0&&(oe=Object.keys(ae)[0]),oe){let ne=n.url();ne[ne.length-1]!="/"&&(ne+="/"),n.url(ne+encodePathForUrl(ae[oe]))}}e.fileCounts=null,e.getFiles=function(B){let ae=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(B)}&v=${e.options.lastUpdateDate}`).then(function(oe){if(h||ae!==e.repoId)return[];let ne=B||"";return e.files=e.files.filter(ue=>ue.path!==ne),e.files.push(...oe.data),oe.data},function(oe){if(h||ae!==e.repoId)return[];e.type="error",e.content=oe&&oe.data&&oe.data.error||"unknown_error",e.files=[]})};function D(){let B=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(ae){h||B!==e.repoId||(e.fileCounts=ae.data)},function(){e.fileCounts={}})}function T(){return e.files.filter(B=>B.name==e.paths[e.paths.length-1]&&B.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var V=null;e.on("dispose",function(){V&&a.interval.cancel(V)});function _(B){if(h)return;let ae=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(oe=>{if(!(h||ae!==e.repoId)){if(e.options=oe.data,e.options.url){window.location=e.options.url;return}B&&B(oe.data)}},oe=>{if(!(h||ae!==e.repoId)){var ne=oe.data||{};if(ne.error==="rate_limited"&&ne.resetAt){let he=function(){var ve=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ve<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,V&&(a.interval.cancel(V),V=null),_(B);else{var me=Math.floor(ve/60),ie=ve%60;e.rateLimitCountdown=me>0?me+"m "+ie+"s":ie+"s"}};var ue=he;e.type="rate_limited",e.rateLimitResetAt=ne.resetAt,V&&a.interval.cancel(V),he(),V=a.interval(he,1e3)}else ne.err Line truncated
`+k.join(`
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(R),D.download=r.username+"-repositories.csv",D.click()},e.showStatusMessage=m=>{let w=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,w)},e.fetchGithubInfo=m=>{let w=window.open("","_blank");w&&w.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(C=>{w&&(w.document.open(),w.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(C.data,null,2).replace(/[<>]/g,k=>k==="<"?"&lt;":"&gt;")+"</pre>"),w.document.close())},C=>{let k=C&&C.data?JSON.stringify(C.data,null,2):String(C);w&&(w.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+k+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(w=>{e.repositories=w.data},w=>{console.error(w)})}function h(m){t.get("/api/admin/users/"+m,{}).then(w=>{e.userInfo=w.data},w=>{console.error(w)})}h(r.username),f(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>h(r.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>h(r.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>h(r.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>h(r.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function v(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}v(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",v()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>v(),w=>console.error(w))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(r.username),w=>console.error(w))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(r.username),w=>console.error(w))},e.updateRepository=m=>{let w=He({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(w),t.post(`/api/repo/${m.repoId}/refresh`).then(C=>{C.data.status=="ready"?w.title=`${m.repoId} is refreshed.`:w.title=`Refreshing of ${m.repoId}.`},C=>{w.title=`Error during the refresh of ${m.repoId}.`,w.body=C.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(w=>{e.userInfo.repositories=w.data})};let b=null;e.watch("query",()=>{s.timeout.cancel(b),b=s.timeout(()=>{f(r.username)},500)},!0)},Xa=function(e,t,n){let r=ct(),s=Kt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=C=>{if(C.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){C.preventDefault();let k=document.querySelector('.admin-filter-toolbar input[type="search"]');k&&k.focus()}};s(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=C=>{C==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[C]="",e.query.page=1},e.chips=[];let a=()=>{let C=[];(e.query.dateFrom||e.query.dateTo)&&C.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=C};e.statusCountFor=C=>{let k=(e.statusCounts||[]).find(R=>R._id===C);return k?k.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=C=>{e.query.sort===C?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=C,e.query.direction="desc"),e.query.page=1},e.sortIcon=C=>e.query.sort===C?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},h=loadFilterPrefs(u)||{};e.query=Object.assign({},f,h,{page:1,search:""});let v=n.search();v.search&&(e.query.search=v.search);let b="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(b)||"[]"),e.savePreset=()=>{let C=window.prompt("Preset name:");if(!C)return;let k=Object.assign({},e.query);delete k.page,e.presets=(e.presets||[]).filter(R=>R.name!==C),e.presets.push({name:C,query:k}),localStorage.setItem(b,JSON.stringify(e.presets))},e.applyPreset=C=>{Object.assign(e.query,C.query,{page:1})},e.deletePreset=C=>{e.presets=(e.presets||[]).filter(k=>k.name!==C.name),localStorage.setItem(b,JS Line truncated
`).map((ve,me)=>me===0?ve:he+ve).join(`
`)}else typeof K=="number"||typeof K=="boolean"?ue=String(K):ue=JSON.stringify(K);J.push(`${oe}${ue}${ne}`)}),J.push("}"),J.join(`
`)}function h(D){let T=[],V="",_=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,O=0,I;for(;I=_.exec(D);)V+=D.slice(O,I.index),O=_.lastIndex,T.push({key:I[1],op:I[2]||"=",val:I[3]});return V+=D.slice(O),{filters:T,free:V.trim().toLowerCase()}}function v(D,T){for(let V of T.filters){let _=(I,J,Y)=>{let K=parseFloat(I),B=parseFloat(J);return Y==="="?String(I)===String(J):Y==="!="?String(I)!==String(J):Y===">="?K>=B:Y==="<="?K<=B:Y===">"?K>B:Y==="<"?K<B:!0},O;if(V.key==="code")O=D.displayMessage;else if(V.key==="module")O=D.module;else if(V.key==="status")O=D._status;else if(V.key==="url")O=D._url;else if(V.key==="repo")O=D._repoId;else if(V.key==="level")O=D.level;else continue;if(O==null||!_(O,V.val,V.op))return!1}return!(T.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(T.free)===-1)}function b(){let D=h(e.query.search||"");e.parsedFilterCount=D.filters.length;let T=e.query.bucket,V=e.entries.filter(O=>T&&O._bucket!==T?!1:v(O,D)),_=e.query.group;if(_){let O=Y=>_==="module"?Y.module:Y.displayMessage||Y.message||"_",I=new Map;for(let Y of V){let K=O(Y);if(I.has(K)){let B=I.get(K);B.count++,B._related.push(Y),new Date(Y.ts)>new Date(B.ts)&&(B.ts=Y.ts,B._url=Y._url,B._status=Y._status),new Date(Y.ts)<new Date(B._firstSeen)&&(B._firstSeen=Y.ts)}else{let B=Object.assign({},Y);B._key=`${_}:${K}`,B._related=[Y],B._firstSeen=Y.ts,B._lastHourCount=0,B.count=1,I.set(K,B)}}let J=Date.now()-3600*1e3;for(let Y of I.values())Y._lastHourCount=Y._related.filter(K=>new Date(K.ts).getTime()>=J).length;V=Array.from(I.values())}else V=V.map((O,I)=>(O._key="row:"+I+":"+O.ts,O._related=[O],O._firstSeen=O.ts,O._lastHourCount=0,O.count=1,O));e.query.sort==="count"?V.sort((O,I)=>I.count-O.count||new Date(I.ts)-new Date(O.ts)):V.sort((O,I)=>new Date(I.ts)-new Date(O.ts)),e.visible=V}function m(D){let T=D?e.entries.length:0,V=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:T,limit:V}}).then(_=>{let O=(_.data.entries||[]).map(u);e.entries=D?e.entries.concat(O):O,e.available=!!_.data.available,e.cap=_.data.max||e.cap,e.total=_.data.total||e.entries.length,b()},_=>console.error(_))}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function w(){t.get("/api/admin/errors/stats").then(D=>{let T=D.data||{},V=T.prev24h?Math.round((T.last24h-T.prev24h)/T.prev24h*100):0;e.stats={last24h:T.last24h||0,prev24h:T.prev24h||0,delta:V,severity:T.severity||{error:0,warn:0,info:0},unique:T.unique||{error:0,warn:0,info:0},buckets:T.buckets||[],dropped:T.dropped||0}},D=>console.error(D))}function C(){m(),w()}e.barPx=(D,T)=>{let V=e.stats.buckets||[],_=0;for(let Y of V)_=Math.max(_,(Y.error||0)+(Y.warn||0)+(Y.info||0));if(!_)return 0;let O=(D.error||0)+(D.warn||0)+(D.info||0);if(!O)return 0;let I=Math.round(O/_*60),J=D[T]||0;return Math.round(J/O*I)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=C,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(C,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],T=[D.join(",")];for(let I of e.visible)T.push(D.map(J=>{let Y=I[J]==null?"":String(I[J]);return/[",\n]/.test(Y)?`"${Y.replace(/"/g,'""')}"`:Y}).join(","));let V=new Blob([T.join(`
`)],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(V),O=document.createElement("a");O.href=_,O.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(_)};function k(D){e.copyHint=`${D} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>k("JSON"))},e.copyCurl=D=>{if(!D._url)return;let V=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(V).then(()=>k("curl"))},C();let R=r(()=>{e.query.autoRefresh&&C()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},el=function(e,t,n,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null){n.url("/");return}e.data=null,e.loading=!0,e.error=null;function s(m){if(m==null)return"\u2014";for(var w=["B","KB","MB","GB","TB"],C=0,k=m;k>=1024&&C<w.length-1;)k/=1024,C++;return k.toFixed(C>0?1:0)+" "+w[C]}e.humanBytes=s;function i(m){if(!m)return"\u2014";var w=Math.floor(m/86400),C=Math.floor(m%86400/3600),k=Math.floor(m%3600/60);return w>0?w+"d "+(C<10?"0":"")+C+"h":C>0?C+"h "+(k<10?"0":"")+k+"m":k+"m"}e.humanDuration=i;function a(m){return m==null?"\u2014":m>=1e6?(m/1e6).toFixed(1)+"M":m>=1e3?(m/1e3).toFixed(1)+"K":String(m)}e.humanNum=a,e.queueTotal=function(m){return m?(m.waiting||0)+(m.active||0)+(m.delayed||0)+(m.failed||0):0},e.statusCount=function(m){if(!e.data||!e.data.repos)return 0;for(var w=e.data.repos.statusBreakdown||[],C=0;C<w.length;C++)if(w[C]._id===m)return w[C].count;return 0},e.barPct=function(m){var w=e.data&&e.data.repos?e.data.repos.total:0;if(!w)return 0;var C=[m];m==="expired"&&C.push("expiring"),m==="removed"&&C.push("removing"),m==="preparing"&&C.push("download");var k=0;return C.forEach(function(R){k+=e.statusCount(R)}),Math.max(.4,k/w*100)},e.errPct=function(m){if(!e.data||!e.data.errors)return 0;var w=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[m]/w*100};function u(m){var w=m||[];return w.map(function(C,k){var R=w[k-1]||{},D=Object.assign({},C);return D.dailyRepositories=k?Math.max(0,(C.nbRepositories||0)-(R.nbRepositories||0)):0,D.dailyUsers=k?Math.max(0,(C.nbUsers||0)-(R.nbUsers||0)):0,D.dailyPageViews=k?Math.max(0,(C.nbPageViews||0)-(R.nbPageViews||0)):0,D})}function f(m){var w=m&&m.length?m[m.length-1]:{};return{repositories:w.dailyRepositories||0,users:w.dailyUsers||0,pageViews:w.dailyPageViews||0}}var h={};e.historyBarH=function(m,w){return!m||!h[w]?0:Math.max(1,Math.round(m[w]/h[w]*140))},e.historyLabel=function(m){if(!m||!m.date)return"";var w=new Date(m.date);return w.getUTCMonth()+1+"/"+w.getUTCDate()};function v(){t.get("/api/admin/overview").then(function(m){m.data.history=u(m.data.history),m.data.daily={today:f(m.data.history)},e.data=m.data,e.loading=!1,e.error=null,h={},(m.data.history||[]).forEach(function(w){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(C){(!h[C]||w[C]>h[C])&&(h[C]=w[C])})})},function(m){e.loading=!1,e.error=m.data&&m.data.error||"Failed to load overview"})}v();var b=r(v,3e4);e.on("dispose",function(){r.cancel(b)})};var tl=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Wa(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Ka(e,t.http)},{path:"/",template:"partials/home.htm",title:"Anonymous GitHub \u2013 Share the code, not the author",preserveExplorer:!1,setup:(e,t)=>Ua(e,t.http,t.location,t.window,t.timeout)},{path:"/dashboard",template:"partials/dashboard.htm",title:"Your anonymizations \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Fa(e,t.http,t.location,t.promises,t.window,t.quotaService)},{path:"/pr-dashboard",redirect:"/dashboard"},{path:"/anonymize/:repoId?",template:"partials/anonymize.htm",title:"New anonymization \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/pull-request-anonymize/:pullRequestId?",template:"partials/anonymize.htm",title:"Anonymize a pull request \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/gist-anonymize/:gistId?",template:"partials/anonymize.htm",title:"Anonymize a gist \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>en(e,t.http,t.html,t.params,t.location,t.translate,t.timeout)},{path:"/status/:repoId",template:"partials/status.htm",title:"Repository status \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>za(e,t.http,t.params)},{path:"/conferences",template:"partials/conferences.htm",title:"Your conferences \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>ja(e,t.http,t.location) Line truncated
anonymous_github`)])])])])]),p(" Limitations "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-warning"})]),g("Limitations ")]),o("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),o("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[o("div",{class:"panel-body p-3"},[o("ul",null,[o("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),o("li",null," Files larger than 8 MB are not supported. "),o("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),o("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),p(" Privacy & Security "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-shield"})]),g("Privacy & Security ")]),o("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),o("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[o("div",{class:"panel-body p-3"},[o("p",null," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 this makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),o("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[o("div",{class:"panel-body p-3"},[o("p",null,[g("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),o("a",{href:"/connections"},"GitHub connections"),g(" page.")]),o("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),o("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),o("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[o("div",{class:"panel-body p-3"},[o("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),p(" Self-Hosting "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#project-icon-storage"})]),g("Self-Hosting ")]),o("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),o("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[o("div",{class:"panel-body p-3"},[o("p",null,[g(" Yes. Anonymous Git Line truncated
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?f("v-if",!0):(l(),d("li",tA,[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]=ke(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",sA,[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]=ke(o=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[s("i",{class:"fas fa-sun","aria-hidden":"true"},null,-1)])])])):f("v-if",!0),e.user?f("v-if",!0):(l(),d("li",nA,[...t[9]||(t[9]=[s("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[s("i",{class:"fab fa-github mr-1"}),y(" Sign in ")],-1)])])),e.user?(l(),d("li",oA,[s("a",rA,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,iA)):f("v-if",!0),s("span",aA,c(e.user?.username),1)]),s("div",lA,[s("h6",dA,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=be('<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="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><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>',8))])])):f("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,uA)):f("v-if",!0)],64)}var cA={class:"paper-landing"},pA={class:"paper-hero"},fA={class:"paper-hero-copy"},mA={class:"paper-cta-row"},hA={key:0,href:"/signin",target:"_self",class:"btn-hero"},vA={key:1,href:"/anonymize",class:"btn-hero"},yA={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},gA={class:"paper-stats-grid"},bA={class:"paper-stat-value"},wA={class:"paper-stat-label"},kA=["viewBox"],_A=["x","y","width","height"],EA={key:1,class:"paper-stat-delta"},CA={class:"paper-features paper-wrap","aria-label":"Product features"},NA={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},SA=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],DA={class:"paper-eyebrow"},RA={class:"paper-feature-title"},TA={class:"paper-feature-more"},OA={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},AA=["href","target"],IA={class:"paper-features-stage"},VA=["id","aria-labelledby"],PA={class:"paper-frame"},qA={class:"paper-frame-bar","aria-hidden":"true"},MA={class:"url"},$A=["src","alt"],UA={class:"paper-footer"},LA={class:"paper-footer-inner"},FA={class:"paper-footer-col"},zA={key:0,href:"/dashboard"},HA={key:1,href:"/conferences"},BA={class:"paper-footer-foot"};function fl(e,t){return l(),d("div",cA,[f(" Hero: copy on the left, the product on the right "),s("section",pA,[s("div",fA,[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",mA,[e.user?f("v-if",!0):(l(),d("a",hA,[...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",vA," Anonymize a repository \ Line truncated
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=o("li",{class:"nav-item d-none d-lg-block"},[o("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[o("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[o("use",{href:"#ui-icon-bug"})]),g("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",QI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=ce(n=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",XI,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=ce(n=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",ZI,[...t[9]||(t[9]=[o("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[o("i",{class:"fab fa-github mr-1"}),g(" Sign in ")],-1)])])),e.user?(l(),d("li",xI,[o("a",e4,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,t4)):p("v-if",!0),o("span",o4,c(e.user?.username),1)]),o("div",s4,[o("h6",n4,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=de('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,r4)):p("v-if",!0)],64)}var i4={class:"paper-landing"},a4={class:"paper-hero"},l4={class:"paper-hero-copy"},d4={class:"paper-cta-row"},u4={key:0,href:"/signin",target:"_self",class:"btn-hero"},c4={key:1,href:"/anonymize",class:"btn-hero"},p4={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},f4={class:"paper-stats-grid"},m4={class:"paper-stat-value"},h4={class:"paper-stat-label"},v4=["viewBox"],g4=["x","y","width","height"],y4={key:1,class:"paper-stat-delta"},b4={class:"paper-features paper-wrap","aria-label":"Product features"},w4={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},k4=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],E4={class:"paper-eyebrow"},C4={class:"paper-feature-title"},_4={class:"paper-feature-more"},S4={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},N4=["href","target"],D4={class:"paper-features-stage"},R4=["id","aria-labelledby"],T4={class:"paper-frame"},A4={class:"paper-frame-bar","aria-hidden":"true"},O4={class:"url"},I4=["src","alt"],P4={class:"paper-footer"},V4={class:"paper-footer-inner"},q4={class:"paper-footer-col"},M4={key:0,href:"/dashboard"},$4={key:1,href:"/conferences"},L4={class:"paper-footer-foot"};function El(e,t){return l(),d("div",i4,[p(" Hero: copy on the left, the product on the right "),o("section",a4,[o("div",l4,[t[2]||(t[2]=o("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=o("h1",{class:"hero-title"},[g(" Share the code,"),o("br"),o("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=o("p",{class:"hero-subtitle Line truncated
MIT CSAIL
jane.smith@example.org`},BP={id:"termsHelp",class:"form-text text-muted"},GP={class:"invalid-feedback"},jP={id:"settings-display",class:"paper-settings-section"},WP={class:"form-group paper-check-list"},KP={class:"form-check"},YP={class:"form-check-input",type:"checkbox",id:"link",name:"link"},JP={class:"form-check"},QP={class:"form-check-input",type:"checkbox",id:"image",name:"image"},XP={class:"form-check"},ZP={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},xP={class:"form-check"},e3={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},t3={id:"settings-features",class:"paper-settings-section"},s3={class:"form-group paper-check-list"},n3={class:"form-check"},o3={class:"form-check-input",type:"checkbox",id:"page",name:"page"},r3={class:"form-check"},i3={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},a3={class:"form-check"},l3={class:"form-check-input",type:"checkbox",id:"update",name:"update"},d3={class:"form-group"},u3={class:"form-control",id:"mode",name:"mode"},c3={class:"form-text text-muted"},p3={id:"settings-expiration",class:"paper-settings-section"},f3={class:"form-group"},m3={class:"form-control",id:"expiration",name:"expiration"},h3={class:"paper-settings-footer"},v3={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},y3=["textContent"],g3={class:"paper-settings-actions"},b3=["disabled"],w3={key:0,class:"fas fa-check mr-1","aria-hidden":"true"},k3={id:"settings-account",class:"paper-settings-section"},_3={class:"paper-account-card"},E3=["src"],C3={class:"paper-account-identity"},N3={class:"paper-account-name"},S3={class:"paper-danger-zone"},D3={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},R3=["textContent"],T3=["disabled"];function gl(e,t){let o=we("paper-scrollspy"),r=we("field"),n=we("form");return l(),d("div",_P,[t[48]||(t[48]=be('<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",EP,[E((l(),d("aside",CP,[...t[2]||(t[2]=[be('<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",NP,[f(" Quota: same markup as the dashboard, driven by quotaService "),s("section",SP,[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",DP,[(l(),d(J,null,ne([{key:"repository",label:"Repositories",kind:"count"},{key:"storage",label:"Storage",kind:"bytes"},{key:"file",label:"Files",kind:"count"}],(i,a)=>s("div",RP,[s("div",TP,[s("span",OP,c(i?.label),1),i?.kind==="count"?(l(),d("span",AP,[y(c(e.fmt?.number(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?f("v-if",!0):(l(),d("span",IP," / "+c(e.fmt?.number(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",VP,"Unlimited")):f("v-if",!0)])):f("v-if",!0),i?.kind==="bytes"?(l(),d("span",PP,[y(c(e.fmt?.humanFileSize(e.quota[i?.key].used)),1),e.quota[i?.key].unlimited?f("v-if",!0):(l(),d("span",qP," / "+c(e.fmt?.humanFileSize(e.quota[i?.key].total)),1)),e.quota[i?.key].unlimited?(l(),d("span",MP,"Unlimited")):f("v-if",!0)])):f("v-if",!0)]),s("div",{class:O(["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?f("v-if",!0):(l(),d("div",{key:0,class:"quota-fill",style:qe({width:e.quota[i?.key].percent+"%"})},null,4))],10,$P)])),64))])):f("v-if",!0),e.quota?f("v-if",!0):(l(),d("div",UP,[(l(),d(J,null,ne([1,2,3],(i,a)=>s("div",LP,[...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]=ke(i=>e.submitForm(i,()=>{e.saveDefault(i)}),["prevent"]))},[s("section",FP,[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",zP,[t[10]||(t[10]=s("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),E(s("tex Line truncated
`);for(let k=0;k<v.length;k++){let p=v[k];if(p.startsWith("diff --git")){h(),m();continue}if(p.startsWith("--- ")){i&&i.lines.length&&h(),m().oldPath=p.replace(/^--- (a\/)?/,"").trim();continue}if(p.startsWith("+++ ")){m().newPath=p.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(p.startsWith("index ")||p.startsWith("similarity index")||p.startsWith("rename ")||p.startsWith("new file mode")||p.startsWith("deleted file mode")||p.startsWith("Binary files"))){if(p.startsWith("@@")){let g=p.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);g&&(a=parseInt(g[1],10),u=parseInt(g[2],10)),m().lines.push({kind:"hunk",oldNo:"",newNo:"",text:p});continue}i&&(p.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:u,text:p.slice(1)}),u++):p.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:p.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:u,text:p.startsWith(" ")?p.slice(1):p}),a++,u++))}}return o(n,i),n.join("")}})({trustAsHtml:e=>e});function Fq(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function zq(e){return String(e??"").toUpperCase()}function Hq(e,t,o=0){return(e||[]).slice(o,o+t)}function Bq(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function Gq(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),m=i.split(".").reduce((h,v)=>h?.[v],n);if(typeof u=="string"&&(u=u.toLowerCase()),typeof m=="string"&&(m=m.toLowerCase()),u!==m)return(u==null?-1:m==null?1:u<m?-1:1)*a}return 0})}function jq(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 Wq(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var Nl={ERRORS:{repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub Line truncated
jane.smith@example.org`},RV={id:"termsHelp",class:"form-text text-muted"},TV={class:"invalid-feedback"},AV={id:"settings-display",class:"paper-settings-section"},OV={class:"form-group paper-check-list"},IV={class:"form-check"},PV={class:"form-check-input",type:"checkbox",id:"link",name:"link"},VV={class:"form-check"},qV={class:"form-check-input",type:"checkbox",id:"image",name:"image"},MV={class:"form-check"},$V={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},LV={class:"form-check"},UV={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},FV={id:"settings-features",class:"paper-settings-section"},zV={class:"form-group paper-check-list"},HV={class:"form-check"},BV={class:"form-check-input",type:"checkbox",id:"page",name:"page"},jV={class:"form-check"},GV={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},WV={class:"form-check"},KV={class:"form-check-input",type:"checkbox",id:"update",name:"update"},YV={class:"form-group"},JV={class:"form-control",id:"mode",name:"mode"},QV={class:"form-text text-muted"},XV={id:"settings-expiration",class:"paper-settings-section"},ZV={class:"form-group"},xV={class:"form-control",id:"expiration",name:"expiration"},e5={key:0,class:"draft-status",role:"status"},t5={key:1,class:"draft-status"},o5={class:"paper-settings-footer"},s5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},n5=["textContent"],r5={class:"paper-settings-actions"},i5=["disabled"],a5={key:0,class:"ui-icon mr-1","aria-hidden":"true"},l5={id:"settings-account",class:"paper-settings-section"},d5={class:"paper-account-card"},u5=["src"],c5={class:"paper-account-identity"},p5={class:"paper-account-name"},f5={class:"paper-danger-zone"},m5={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},h5=["textContent"],v5=["disabled"];function Dl(e,t){let n=We("quota-usage"),r=ye("paper-scrollspy"),s=ye("field"),i=ye("form");return l(),d("div",yV,[t[52]||(t[52]=de('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),o("div",bV,[N((l(),d("aside",wV,[...t[4]||(t[4]=[de('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),o("div",kV,[p(" Account usage shares the dashboard component. "),o("section",EV,[t[6]||(t[6]=o("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=o("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),qt(n,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",CV,[(l(),d(Q,null,se([1,2,3],(a,u)=>o("div",_V,[...t[5]||(t[5]=[o("div",{class:"quota-header"},[o("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),o("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),o("div",{class:"quota-track"},null,-1)])])),64))]))]),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=ce(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[o("section",SV,[t[13]||(t[13]=o("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=o("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),o("div",NV,[t[12]||(t[12]=o("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),N(o("textarea",DV,null,512),[[s,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),o("small",RV,[t[8]||(t[8]=g(" One term per line (regex allowed). Each match is replaced by ",-1)),o("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=g(", or use ",-1)),t[10]||(t[10]=o("code",null,"term=>replacement",-1)),t[11]||(t[11]=g(" to pick your own. ",-1))]),N(o("div",TV," Terms are in an invalid format ",512),[[W,e.defaultsForm?.terms?.errors?.format]])])]),o("section",AV,[t[23]||(t[23]=o("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=o("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),o("div",OV,[o("div",IV,[N(o("input",PV,null,512),[[s,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=o("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=o("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),o("div",VV,[N(o("input",qV,null,512),[[s,{state:e.viewState,set:a=>{e.options.image=a},value:e.op Line truncated
`);for(let b=0;b<v.length;b++){let m=v[b];if(m.startsWith("diff --git")){h(),f();continue}if(m.startsWith("--- ")){i&&i.lines.length&&h(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let w=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);w&&(a=parseInt(w[1],10),u=parseInt(w[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}i&&(m.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:u,text:m.slice(1)}),u++):m.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:u,text:m.startsWith(" ")?m.slice(1):m}),a++,u++))}}return n(s,i),s.join("")}})({trustAsHtml:e=>e});function Oq(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Iq(e){return String(e??"").toUpperCase()}function Pq(e,t,n=0){return(e||[]).slice(n,n+t)}function Vq(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function qq(e,t){if(!t)return e||[];let n=Array.isArray(t)?t:[t];return[...e||[]].sort((r,s)=>{for(let i of n){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,v)=>h?.[v],r),f=i.split(".").reduce((h,v)=>h?.[v],s);if(typeof u=="string"&&(u=u.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),u!==f)return(u==null?-1:f==null?1:u<f?-1:1)*a}return 0})}function Mq(e,t){if(!e)return"";let n=new Date(e);if(isNaN(n))return String(e);if(!t||t==="mediumDate")return n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:n.getFullYear(),MMM:n.toLocaleDateString(void 0,{month:"short"}),MM:String(n.getMonth()+1).padStart(2,"0"),dd:String(n.getDate()).padStart(2,"0"),d:n.getDate(),HH:String(n.getHours()).padStart(2,"0"),mm:String(n.getMinutes()).padStart(2,"0"),ss:String(n.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>r[s])}function $q(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var ql={ERRORS:{repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub Line truncated
/*! Bundled license information:
@vue/shared/dist/shared.esm-bundler.js: